index.js 677 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630176311763217633176341763517636176371763817639176401764117642176431764417645176461764717648176491765017651176521765317654176551765617657176581765917660176611766217663176641766517666176671766817669176701767117672176731767417675176761767717678176791768017681176821768317684176851768617687176881768917690176911769217693176941769517696176971769817699177001770117702177031770417705177061770717708177091771017711177121771317714
  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__(190),
  50. __webpack_require__(19), // deprecated: remove in v17
  51. __webpack_require__(372),
  52. __webpack_require__(148),
  53. __webpack_require__(248),
  54. __webpack_require__(586),
  55. __webpack_require__(430),
  56. __webpack_require__(850) // deprecated: remove in v17
  57. ];
  58. module.exports = Octokit.plugin(CORE_PLUGINS);
  59. /***/ }),
  60. /***/ 1:
  61. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  62. "use strict";
  63. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  64. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  65. return new (P || (P = Promise))(function (resolve, reject) {
  66. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  67. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  68. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  69. step((generator = generator.apply(thisArg, _arguments || [])).next());
  70. });
  71. };
  72. Object.defineProperty(exports, "__esModule", { value: true });
  73. const childProcess = __webpack_require__(129);
  74. const path = __webpack_require__(622);
  75. const util_1 = __webpack_require__(669);
  76. const ioUtil = __webpack_require__(672);
  77. const exec = util_1.promisify(childProcess.exec);
  78. /**
  79. * Copies a file or folder.
  80. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  81. *
  82. * @param source source path
  83. * @param dest destination path
  84. * @param options optional. See CopyOptions.
  85. */
  86. function cp(source, dest, options = {}) {
  87. return __awaiter(this, void 0, void 0, function* () {
  88. const { force, recursive } = readCopyOptions(options);
  89. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  90. // Dest is an existing file, but not forcing
  91. if (destStat && destStat.isFile() && !force) {
  92. return;
  93. }
  94. // If dest is an existing directory, should copy inside.
  95. const newDest = destStat && destStat.isDirectory()
  96. ? path.join(dest, path.basename(source))
  97. : dest;
  98. if (!(yield ioUtil.exists(source))) {
  99. throw new Error(`no such file or directory: ${source}`);
  100. }
  101. const sourceStat = yield ioUtil.stat(source);
  102. if (sourceStat.isDirectory()) {
  103. if (!recursive) {
  104. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  105. }
  106. else {
  107. yield cpDirRecursive(source, newDest, 0, force);
  108. }
  109. }
  110. else {
  111. if (path.relative(source, newDest) === '') {
  112. // a file cannot be copied to itself
  113. throw new Error(`'${newDest}' and '${source}' are the same file`);
  114. }
  115. yield copyFile(source, newDest, force);
  116. }
  117. });
  118. }
  119. exports.cp = cp;
  120. /**
  121. * Moves a path.
  122. *
  123. * @param source source path
  124. * @param dest destination path
  125. * @param options optional. See MoveOptions.
  126. */
  127. function mv(source, dest, options = {}) {
  128. return __awaiter(this, void 0, void 0, function* () {
  129. if (yield ioUtil.exists(dest)) {
  130. let destExists = true;
  131. if (yield ioUtil.isDirectory(dest)) {
  132. // If dest is directory copy src into dest
  133. dest = path.join(dest, path.basename(source));
  134. destExists = yield ioUtil.exists(dest);
  135. }
  136. if (destExists) {
  137. if (options.force == null || options.force) {
  138. yield rmRF(dest);
  139. }
  140. else {
  141. throw new Error('Destination already exists');
  142. }
  143. }
  144. }
  145. yield mkdirP(path.dirname(dest));
  146. yield ioUtil.rename(source, dest);
  147. });
  148. }
  149. exports.mv = mv;
  150. /**
  151. * Remove a path recursively with force
  152. *
  153. * @param inputPath path to remove
  154. */
  155. function rmRF(inputPath) {
  156. return __awaiter(this, void 0, void 0, function* () {
  157. if (ioUtil.IS_WINDOWS) {
  158. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  159. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  160. try {
  161. if (yield ioUtil.isDirectory(inputPath, true)) {
  162. yield exec(`rd /s /q "${inputPath}"`);
  163. }
  164. else {
  165. yield exec(`del /f /a "${inputPath}"`);
  166. }
  167. }
  168. catch (err) {
  169. // if you try to delete a file that doesn't exist, desired result is achieved
  170. // other errors are valid
  171. if (err.code !== 'ENOENT')
  172. throw err;
  173. }
  174. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  175. try {
  176. yield ioUtil.unlink(inputPath);
  177. }
  178. catch (err) {
  179. // if you try to delete a file that doesn't exist, desired result is achieved
  180. // other errors are valid
  181. if (err.code !== 'ENOENT')
  182. throw err;
  183. }
  184. }
  185. else {
  186. let isDir = false;
  187. try {
  188. isDir = yield ioUtil.isDirectory(inputPath);
  189. }
  190. catch (err) {
  191. // if you try to delete a file that doesn't exist, desired result is achieved
  192. // other errors are valid
  193. if (err.code !== 'ENOENT')
  194. throw err;
  195. return;
  196. }
  197. if (isDir) {
  198. yield exec(`rm -rf "${inputPath}"`);
  199. }
  200. else {
  201. yield ioUtil.unlink(inputPath);
  202. }
  203. }
  204. });
  205. }
  206. exports.rmRF = rmRF;
  207. /**
  208. * Make a directory. Creates the full path with folders in between
  209. * Will throw if it fails
  210. *
  211. * @param fsPath path to create
  212. * @returns Promise<void>
  213. */
  214. function mkdirP(fsPath) {
  215. return __awaiter(this, void 0, void 0, function* () {
  216. yield ioUtil.mkdirP(fsPath);
  217. });
  218. }
  219. exports.mkdirP = mkdirP;
  220. /**
  221. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  222. * If you check and the tool does not exist, it will throw.
  223. *
  224. * @param tool name of the tool
  225. * @param check whether to check if tool exists
  226. * @returns Promise<string> path to tool
  227. */
  228. function which(tool, check) {
  229. return __awaiter(this, void 0, void 0, function* () {
  230. if (!tool) {
  231. throw new Error("parameter 'tool' is required");
  232. }
  233. // recursive when check=true
  234. if (check) {
  235. const result = yield which(tool, false);
  236. if (!result) {
  237. if (ioUtil.IS_WINDOWS) {
  238. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
  239. }
  240. else {
  241. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
  242. }
  243. }
  244. }
  245. try {
  246. // build the list of extensions to try
  247. const extensions = [];
  248. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  249. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  250. if (extension) {
  251. extensions.push(extension);
  252. }
  253. }
  254. }
  255. // if it's rooted, return it if exists. otherwise return empty.
  256. if (ioUtil.isRooted(tool)) {
  257. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  258. if (filePath) {
  259. return filePath;
  260. }
  261. return '';
  262. }
  263. // if any path separators, return empty
  264. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  265. return '';
  266. }
  267. // build the list of directories
  268. //
  269. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  270. // it feels like we should not do this. Checking the current directory seems like more of a use
  271. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  272. // across platforms.
  273. const directories = [];
  274. if (process.env.PATH) {
  275. for (const p of process.env.PATH.split(path.delimiter)) {
  276. if (p) {
  277. directories.push(p);
  278. }
  279. }
  280. }
  281. // return the first match
  282. for (const directory of directories) {
  283. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  284. if (filePath) {
  285. return filePath;
  286. }
  287. }
  288. return '';
  289. }
  290. catch (err) {
  291. throw new Error(`which failed with message ${err.message}`);
  292. }
  293. });
  294. }
  295. exports.which = which;
  296. function readCopyOptions(options) {
  297. const force = options.force == null ? true : options.force;
  298. const recursive = Boolean(options.recursive);
  299. return { force, recursive };
  300. }
  301. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  302. return __awaiter(this, void 0, void 0, function* () {
  303. // Ensure there is not a run away recursive copy
  304. if (currentDepth >= 255)
  305. return;
  306. currentDepth++;
  307. yield mkdirP(destDir);
  308. const files = yield ioUtil.readdir(sourceDir);
  309. for (const fileName of files) {
  310. const srcFile = `${sourceDir}/${fileName}`;
  311. const destFile = `${destDir}/${fileName}`;
  312. const srcFileStat = yield ioUtil.lstat(srcFile);
  313. if (srcFileStat.isDirectory()) {
  314. // Recurse
  315. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  316. }
  317. else {
  318. yield copyFile(srcFile, destFile, force);
  319. }
  320. }
  321. // Change the mode for the newly created directory
  322. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  323. });
  324. }
  325. // Buffered file copy
  326. function copyFile(srcFile, destFile, force) {
  327. return __awaiter(this, void 0, void 0, function* () {
  328. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  329. // unlink/re-link it
  330. try {
  331. yield ioUtil.lstat(destFile);
  332. yield ioUtil.unlink(destFile);
  333. }
  334. catch (e) {
  335. // Try to override file permission
  336. if (e.code === 'EPERM') {
  337. yield ioUtil.chmod(destFile, '0666');
  338. yield ioUtil.unlink(destFile);
  339. }
  340. // other errors = it doesn't exist, no work to do
  341. }
  342. // Copy over symlink
  343. const symlinkFull = yield ioUtil.readlink(srcFile);
  344. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  345. }
  346. else if (!(yield ioUtil.exists(destFile)) || force) {
  347. yield ioUtil.copyFile(srcFile, destFile);
  348. }
  349. });
  350. }
  351. //# sourceMappingURL=io.js.map
  352. /***/ }),
  353. /***/ 2:
  354. /***/ (function(module, __unusedexports, __webpack_require__) {
  355. "use strict";
  356. const os = __webpack_require__(87);
  357. const macosRelease = __webpack_require__(118);
  358. const winRelease = __webpack_require__(49);
  359. const osName = (platform, release) => {
  360. if (!platform && release) {
  361. throw new Error('You can\'t specify a `release` without specifying `platform`');
  362. }
  363. platform = platform || os.platform();
  364. let id;
  365. if (platform === 'darwin') {
  366. if (!release && os.platform() === 'darwin') {
  367. release = os.release();
  368. }
  369. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  370. id = release ? macosRelease(release).name : '';
  371. return prefix + (id ? ' ' + id : '');
  372. }
  373. if (platform === 'linux') {
  374. if (!release && os.platform() === 'linux') {
  375. release = os.release();
  376. }
  377. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  378. return 'Linux' + (id ? ' ' + id : '');
  379. }
  380. if (platform === 'win32') {
  381. if (!release && os.platform() === 'win32') {
  382. release = os.release();
  383. }
  384. id = release ? winRelease(release) : '';
  385. return 'Windows' + (id ? ' ' + id : '');
  386. }
  387. return platform;
  388. };
  389. module.exports = osName;
  390. /***/ }),
  391. /***/ 8:
  392. /***/ (function(module, __unusedexports, __webpack_require__) {
  393. module.exports = iterator;
  394. const normalizePaginatedListResponse = __webpack_require__(301);
  395. function iterator(octokit, options) {
  396. const headers = options.headers;
  397. let url = octokit.request.endpoint(options).url;
  398. return {
  399. [Symbol.asyncIterator]: () => ({
  400. next() {
  401. if (!url) {
  402. return Promise.resolve({ done: true });
  403. }
  404. return octokit
  405. .request({ url, headers })
  406. .then(response => {
  407. normalizePaginatedListResponse(octokit, url, response);
  408. // `response.headers.link` format:
  409. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  410. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  411. url = ((response.headers.link || "").match(
  412. /<([^>]+)>;\s*rel="next"/
  413. ) || [])[1];
  414. return { value: response };
  415. });
  416. }
  417. })
  418. };
  419. }
  420. /***/ }),
  421. /***/ 9:
  422. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  423. "use strict";
  424. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  425. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  426. return new (P || (P = Promise))(function (resolve, reject) {
  427. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  428. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  429. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  430. step((generator = generator.apply(thisArg, _arguments || [])).next());
  431. });
  432. };
  433. Object.defineProperty(exports, "__esModule", { value: true });
  434. const os = __webpack_require__(87);
  435. const events = __webpack_require__(614);
  436. const child = __webpack_require__(129);
  437. /* eslint-disable @typescript-eslint/unbound-method */
  438. const IS_WINDOWS = process.platform === 'win32';
  439. /*
  440. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  441. */
  442. class ToolRunner extends events.EventEmitter {
  443. constructor(toolPath, args, options) {
  444. super();
  445. if (!toolPath) {
  446. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  447. }
  448. this.toolPath = toolPath;
  449. this.args = args || [];
  450. this.options = options || {};
  451. }
  452. _debug(message) {
  453. if (this.options.listeners && this.options.listeners.debug) {
  454. this.options.listeners.debug(message);
  455. }
  456. }
  457. _getCommandString(options, noPrefix) {
  458. const toolPath = this._getSpawnFileName();
  459. const args = this._getSpawnArgs(options);
  460. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  461. if (IS_WINDOWS) {
  462. // Windows + cmd file
  463. if (this._isCmdFile()) {
  464. cmd += toolPath;
  465. for (const a of args) {
  466. cmd += ` ${a}`;
  467. }
  468. }
  469. // Windows + verbatim
  470. else if (options.windowsVerbatimArguments) {
  471. cmd += `"${toolPath}"`;
  472. for (const a of args) {
  473. cmd += ` ${a}`;
  474. }
  475. }
  476. // Windows (regular)
  477. else {
  478. cmd += this._windowsQuoteCmdArg(toolPath);
  479. for (const a of args) {
  480. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  481. }
  482. }
  483. }
  484. else {
  485. // OSX/Linux - this can likely be improved with some form of quoting.
  486. // creating processes on Unix is fundamentally different than Windows.
  487. // on Unix, execvp() takes an arg array.
  488. cmd += toolPath;
  489. for (const a of args) {
  490. cmd += ` ${a}`;
  491. }
  492. }
  493. return cmd;
  494. }
  495. _processLineBuffer(data, strBuffer, onLine) {
  496. try {
  497. let s = strBuffer + data.toString();
  498. let n = s.indexOf(os.EOL);
  499. while (n > -1) {
  500. const line = s.substring(0, n);
  501. onLine(line);
  502. // the rest of the string ...
  503. s = s.substring(n + os.EOL.length);
  504. n = s.indexOf(os.EOL);
  505. }
  506. strBuffer = s;
  507. }
  508. catch (err) {
  509. // streaming lines to console is best effort. Don't fail a build.
  510. this._debug(`error processing line. Failed with error ${err}`);
  511. }
  512. }
  513. _getSpawnFileName() {
  514. if (IS_WINDOWS) {
  515. if (this._isCmdFile()) {
  516. return process.env['COMSPEC'] || 'cmd.exe';
  517. }
  518. }
  519. return this.toolPath;
  520. }
  521. _getSpawnArgs(options) {
  522. if (IS_WINDOWS) {
  523. if (this._isCmdFile()) {
  524. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  525. for (const a of this.args) {
  526. argline += ' ';
  527. argline += options.windowsVerbatimArguments
  528. ? a
  529. : this._windowsQuoteCmdArg(a);
  530. }
  531. argline += '"';
  532. return [argline];
  533. }
  534. }
  535. return this.args;
  536. }
  537. _endsWith(str, end) {
  538. return str.endsWith(end);
  539. }
  540. _isCmdFile() {
  541. const upperToolPath = this.toolPath.toUpperCase();
  542. return (this._endsWith(upperToolPath, '.CMD') ||
  543. this._endsWith(upperToolPath, '.BAT'));
  544. }
  545. _windowsQuoteCmdArg(arg) {
  546. // for .exe, apply the normal quoting rules that libuv applies
  547. if (!this._isCmdFile()) {
  548. return this._uvQuoteCmdArg(arg);
  549. }
  550. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  551. // the libuv rules are generic and are not designed specifically for cmd.exe
  552. // command line parser.
  553. //
  554. // for a detailed description of the cmd.exe command line parser, refer to
  555. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  556. // need quotes for empty arg
  557. if (!arg) {
  558. return '""';
  559. }
  560. // determine whether the arg needs to be quoted
  561. const cmdSpecialChars = [
  562. ' ',
  563. '\t',
  564. '&',
  565. '(',
  566. ')',
  567. '[',
  568. ']',
  569. '{',
  570. '}',
  571. '^',
  572. '=',
  573. ';',
  574. '!',
  575. "'",
  576. '+',
  577. ',',
  578. '`',
  579. '~',
  580. '|',
  581. '<',
  582. '>',
  583. '"'
  584. ];
  585. let needsQuotes = false;
  586. for (const char of arg) {
  587. if (cmdSpecialChars.some(x => x === char)) {
  588. needsQuotes = true;
  589. break;
  590. }
  591. }
  592. // short-circuit if quotes not needed
  593. if (!needsQuotes) {
  594. return arg;
  595. }
  596. // the following quoting rules are very similar to the rules that by libuv applies.
  597. //
  598. // 1) wrap the string in quotes
  599. //
  600. // 2) double-up quotes - i.e. " => ""
  601. //
  602. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  603. // doesn't work well with a cmd.exe command line.
  604. //
  605. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  606. // for example, the command line:
  607. // foo.exe "myarg:""my val"""
  608. // is parsed by a .NET console app into an arg array:
  609. // [ "myarg:\"my val\"" ]
  610. // which is the same end result when applying libuv quoting rules. although the actual
  611. // command line from libuv quoting rules would look like:
  612. // foo.exe "myarg:\"my val\""
  613. //
  614. // 3) double-up slashes that precede a quote,
  615. // e.g. hello \world => "hello \world"
  616. // hello\"world => "hello\\""world"
  617. // hello\\"world => "hello\\\\""world"
  618. // hello world\ => "hello world\\"
  619. //
  620. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  621. // the reasons for including this as a .cmd quoting rule are:
  622. //
  623. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  624. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  625. //
  626. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  627. // haven't heard any complaints about that aspect.
  628. //
  629. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  630. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  631. // by using %%.
  632. //
  633. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  634. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  635. //
  636. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  637. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  638. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  639. // to an external program.
  640. //
  641. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  642. // % can be escaped within a .cmd file.
  643. let reverse = '"';
  644. let quoteHit = true;
  645. for (let i = arg.length; i > 0; i--) {
  646. // walk the string in reverse
  647. reverse += arg[i - 1];
  648. if (quoteHit && arg[i - 1] === '\\') {
  649. reverse += '\\'; // double the slash
  650. }
  651. else if (arg[i - 1] === '"') {
  652. quoteHit = true;
  653. reverse += '"'; // double the quote
  654. }
  655. else {
  656. quoteHit = false;
  657. }
  658. }
  659. reverse += '"';
  660. return reverse
  661. .split('')
  662. .reverse()
  663. .join('');
  664. }
  665. _uvQuoteCmdArg(arg) {
  666. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  667. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  668. // is used.
  669. //
  670. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  671. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  672. // pasting copyright notice from Node within this function:
  673. //
  674. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  675. //
  676. // Permission is hereby granted, free of charge, to any person obtaining a copy
  677. // of this software and associated documentation files (the "Software"), to
  678. // deal in the Software without restriction, including without limitation the
  679. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  680. // sell copies of the Software, and to permit persons to whom the Software is
  681. // furnished to do so, subject to the following conditions:
  682. //
  683. // The above copyright notice and this permission notice shall be included in
  684. // all copies or substantial portions of the Software.
  685. //
  686. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  687. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  688. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  689. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  690. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  691. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  692. // IN THE SOFTWARE.
  693. if (!arg) {
  694. // Need double quotation for empty argument
  695. return '""';
  696. }
  697. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  698. // No quotation needed
  699. return arg;
  700. }
  701. if (!arg.includes('"') && !arg.includes('\\')) {
  702. // No embedded double quotes or backslashes, so I can just wrap
  703. // quote marks around the whole thing.
  704. return `"${arg}"`;
  705. }
  706. // Expected input/output:
  707. // input : hello"world
  708. // output: "hello\"world"
  709. // input : hello""world
  710. // output: "hello\"\"world"
  711. // input : hello\world
  712. // output: hello\world
  713. // input : hello\\world
  714. // output: hello\\world
  715. // input : hello\"world
  716. // output: "hello\\\"world"
  717. // input : hello\\"world
  718. // output: "hello\\\\\"world"
  719. // input : hello world\
  720. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  721. // but it appears the comment is wrong, it should be "hello world\\"
  722. let reverse = '"';
  723. let quoteHit = true;
  724. for (let i = arg.length; i > 0; i--) {
  725. // walk the string in reverse
  726. reverse += arg[i - 1];
  727. if (quoteHit && arg[i - 1] === '\\') {
  728. reverse += '\\';
  729. }
  730. else if (arg[i - 1] === '"') {
  731. quoteHit = true;
  732. reverse += '\\';
  733. }
  734. else {
  735. quoteHit = false;
  736. }
  737. }
  738. reverse += '"';
  739. return reverse
  740. .split('')
  741. .reverse()
  742. .join('');
  743. }
  744. _cloneExecOptions(options) {
  745. options = options || {};
  746. const result = {
  747. cwd: options.cwd || process.cwd(),
  748. env: options.env || process.env,
  749. silent: options.silent || false,
  750. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  751. failOnStdErr: options.failOnStdErr || false,
  752. ignoreReturnCode: options.ignoreReturnCode || false,
  753. delay: options.delay || 10000
  754. };
  755. result.outStream = options.outStream || process.stdout;
  756. result.errStream = options.errStream || process.stderr;
  757. return result;
  758. }
  759. _getSpawnOptions(options, toolPath) {
  760. options = options || {};
  761. const result = {};
  762. result.cwd = options.cwd;
  763. result.env = options.env;
  764. result['windowsVerbatimArguments'] =
  765. options.windowsVerbatimArguments || this._isCmdFile();
  766. if (options.windowsVerbatimArguments) {
  767. result.argv0 = `"${toolPath}"`;
  768. }
  769. return result;
  770. }
  771. /**
  772. * Exec a tool.
  773. * Output will be streamed to the live console.
  774. * Returns promise with return code
  775. *
  776. * @param tool path to tool to exec
  777. * @param options optional exec options. See ExecOptions
  778. * @returns number
  779. */
  780. exec() {
  781. return __awaiter(this, void 0, void 0, function* () {
  782. return new Promise((resolve, reject) => {
  783. this._debug(`exec tool: ${this.toolPath}`);
  784. this._debug('arguments:');
  785. for (const arg of this.args) {
  786. this._debug(` ${arg}`);
  787. }
  788. const optionsNonNull = this._cloneExecOptions(this.options);
  789. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  790. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  791. }
  792. const state = new ExecState(optionsNonNull, this.toolPath);
  793. state.on('debug', (message) => {
  794. this._debug(message);
  795. });
  796. const fileName = this._getSpawnFileName();
  797. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  798. const stdbuffer = '';
  799. if (cp.stdout) {
  800. cp.stdout.on('data', (data) => {
  801. if (this.options.listeners && this.options.listeners.stdout) {
  802. this.options.listeners.stdout(data);
  803. }
  804. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  805. optionsNonNull.outStream.write(data);
  806. }
  807. this._processLineBuffer(data, stdbuffer, (line) => {
  808. if (this.options.listeners && this.options.listeners.stdline) {
  809. this.options.listeners.stdline(line);
  810. }
  811. });
  812. });
  813. }
  814. const errbuffer = '';
  815. if (cp.stderr) {
  816. cp.stderr.on('data', (data) => {
  817. state.processStderr = true;
  818. if (this.options.listeners && this.options.listeners.stderr) {
  819. this.options.listeners.stderr(data);
  820. }
  821. if (!optionsNonNull.silent &&
  822. optionsNonNull.errStream &&
  823. optionsNonNull.outStream) {
  824. const s = optionsNonNull.failOnStdErr
  825. ? optionsNonNull.errStream
  826. : optionsNonNull.outStream;
  827. s.write(data);
  828. }
  829. this._processLineBuffer(data, errbuffer, (line) => {
  830. if (this.options.listeners && this.options.listeners.errline) {
  831. this.options.listeners.errline(line);
  832. }
  833. });
  834. });
  835. }
  836. cp.on('error', (err) => {
  837. state.processError = err.message;
  838. state.processExited = true;
  839. state.processClosed = true;
  840. state.CheckComplete();
  841. });
  842. cp.on('exit', (code) => {
  843. state.processExitCode = code;
  844. state.processExited = true;
  845. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  846. state.CheckComplete();
  847. });
  848. cp.on('close', (code) => {
  849. state.processExitCode = code;
  850. state.processExited = true;
  851. state.processClosed = true;
  852. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  853. state.CheckComplete();
  854. });
  855. state.on('done', (error, exitCode) => {
  856. if (stdbuffer.length > 0) {
  857. this.emit('stdline', stdbuffer);
  858. }
  859. if (errbuffer.length > 0) {
  860. this.emit('errline', errbuffer);
  861. }
  862. cp.removeAllListeners();
  863. if (error) {
  864. reject(error);
  865. }
  866. else {
  867. resolve(exitCode);
  868. }
  869. });
  870. });
  871. });
  872. }
  873. }
  874. exports.ToolRunner = ToolRunner;
  875. /**
  876. * Convert an arg string to an array of args. Handles escaping
  877. *
  878. * @param argString string of arguments
  879. * @returns string[] array of arguments
  880. */
  881. function argStringToArray(argString) {
  882. const args = [];
  883. let inQuotes = false;
  884. let escaped = false;
  885. let arg = '';
  886. function append(c) {
  887. // we only escape double quotes.
  888. if (escaped && c !== '"') {
  889. arg += '\\';
  890. }
  891. arg += c;
  892. escaped = false;
  893. }
  894. for (let i = 0; i < argString.length; i++) {
  895. const c = argString.charAt(i);
  896. if (c === '"') {
  897. if (!escaped) {
  898. inQuotes = !inQuotes;
  899. }
  900. else {
  901. append(c);
  902. }
  903. continue;
  904. }
  905. if (c === '\\' && escaped) {
  906. append(c);
  907. continue;
  908. }
  909. if (c === '\\' && inQuotes) {
  910. escaped = true;
  911. continue;
  912. }
  913. if (c === ' ' && !inQuotes) {
  914. if (arg.length > 0) {
  915. args.push(arg);
  916. arg = '';
  917. }
  918. continue;
  919. }
  920. append(c);
  921. }
  922. if (arg.length > 0) {
  923. args.push(arg.trim());
  924. }
  925. return args;
  926. }
  927. exports.argStringToArray = argStringToArray;
  928. class ExecState extends events.EventEmitter {
  929. constructor(options, toolPath) {
  930. super();
  931. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  932. this.processError = '';
  933. this.processExitCode = 0;
  934. this.processExited = false; // tracks whether the process has exited
  935. this.processStderr = false; // tracks whether stderr was written to
  936. this.delay = 10000; // 10 seconds
  937. this.done = false;
  938. this.timeout = null;
  939. if (!toolPath) {
  940. throw new Error('toolPath must not be empty');
  941. }
  942. this.options = options;
  943. this.toolPath = toolPath;
  944. if (options.delay) {
  945. this.delay = options.delay;
  946. }
  947. }
  948. CheckComplete() {
  949. if (this.done) {
  950. return;
  951. }
  952. if (this.processClosed) {
  953. this._setResult();
  954. }
  955. else if (this.processExited) {
  956. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  957. }
  958. }
  959. _debug(message) {
  960. this.emit('debug', message);
  961. }
  962. _setResult() {
  963. // determine whether there is an error
  964. let error;
  965. if (this.processExited) {
  966. if (this.processError) {
  967. error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
  968. }
  969. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  970. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  971. }
  972. else if (this.processStderr && this.options.failOnStdErr) {
  973. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  974. }
  975. }
  976. // clear the timeout
  977. if (this.timeout) {
  978. clearTimeout(this.timeout);
  979. this.timeout = null;
  980. }
  981. this.done = true;
  982. this.emit('done', error, this.processExitCode);
  983. }
  984. static HandleTimeout(state) {
  985. if (state.done) {
  986. return;
  987. }
  988. if (!state.processClosed && state.processExited) {
  989. const message = `The STDIO streams did not close within ${state.delay /
  990. 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
  991. state._debug(message);
  992. }
  993. state._setResult();
  994. }
  995. }
  996. //# sourceMappingURL=toolrunner.js.map
  997. /***/ }),
  998. /***/ 11:
  999. /***/ (function(module) {
  1000. // Returns a wrapper function that returns a wrapped callback
  1001. // The wrapper function should do some stuff, and return a
  1002. // presumably different callback function.
  1003. // This makes sure that own properties are retained, so that
  1004. // decorations and such are not lost along the way.
  1005. module.exports = wrappy
  1006. function wrappy (fn, cb) {
  1007. if (fn && cb) return wrappy(fn)(cb)
  1008. if (typeof fn !== 'function')
  1009. throw new TypeError('need wrapper function')
  1010. Object.keys(fn).forEach(function (k) {
  1011. wrapper[k] = fn[k]
  1012. })
  1013. return wrapper
  1014. function wrapper() {
  1015. var args = new Array(arguments.length)
  1016. for (var i = 0; i < args.length; i++) {
  1017. args[i] = arguments[i]
  1018. }
  1019. var ret = fn.apply(this, args)
  1020. var cb = args[args.length-1]
  1021. if (typeof ret === 'function' && ret !== cb) {
  1022. Object.keys(cb).forEach(function (k) {
  1023. ret[k] = cb[k]
  1024. })
  1025. }
  1026. return ret
  1027. }
  1028. }
  1029. /***/ }),
  1030. /***/ 16:
  1031. /***/ (function(module) {
  1032. module.exports = require("tls");
  1033. /***/ }),
  1034. /***/ 18:
  1035. /***/ (function() {
  1036. eval("require")("encoding");
  1037. /***/ }),
  1038. /***/ 19:
  1039. /***/ (function(module, __unusedexports, __webpack_require__) {
  1040. module.exports = authenticationPlugin;
  1041. const { Deprecation } = __webpack_require__(692);
  1042. const once = __webpack_require__(969);
  1043. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1044. const authenticate = __webpack_require__(674);
  1045. const beforeRequest = __webpack_require__(471);
  1046. const requestError = __webpack_require__(349);
  1047. function authenticationPlugin(octokit, options) {
  1048. if (options.auth) {
  1049. octokit.authenticate = () => {
  1050. deprecateAuthenticate(
  1051. octokit.log,
  1052. new Deprecation(
  1053. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1054. )
  1055. );
  1056. };
  1057. return;
  1058. }
  1059. const state = {
  1060. octokit,
  1061. auth: false
  1062. };
  1063. octokit.authenticate = authenticate.bind(null, state);
  1064. octokit.hook.before("request", beforeRequest.bind(null, state));
  1065. octokit.hook.error("request", requestError.bind(null, state));
  1066. }
  1067. /***/ }),
  1068. /***/ 20:
  1069. /***/ (function(module, __unusedexports, __webpack_require__) {
  1070. "use strict";
  1071. const cp = __webpack_require__(129);
  1072. const parse = __webpack_require__(568);
  1073. const enoent = __webpack_require__(881);
  1074. function spawn(command, args, options) {
  1075. // Parse the arguments
  1076. const parsed = parse(command, args, options);
  1077. // Spawn the child process
  1078. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1079. // Hook into child process "exit" event to emit an error if the command
  1080. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1081. enoent.hookChildProcess(spawned, parsed);
  1082. return spawned;
  1083. }
  1084. function spawnSync(command, args, options) {
  1085. // Parse the arguments
  1086. const parsed = parse(command, args, options);
  1087. // Spawn the child process
  1088. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1089. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1090. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1091. return result;
  1092. }
  1093. module.exports = spawn;
  1094. module.exports.spawn = spawn;
  1095. module.exports.sync = spawnSync;
  1096. module.exports._parse = parse;
  1097. module.exports._enoent = enoent;
  1098. /***/ }),
  1099. /***/ 39:
  1100. /***/ (function(module) {
  1101. "use strict";
  1102. module.exports = opts => {
  1103. opts = opts || {};
  1104. const env = opts.env || process.env;
  1105. const platform = opts.platform || process.platform;
  1106. if (platform !== 'win32') {
  1107. return 'PATH';
  1108. }
  1109. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1110. };
  1111. /***/ }),
  1112. /***/ 47:
  1113. /***/ (function(module, __unusedexports, __webpack_require__) {
  1114. module.exports = factory;
  1115. const Octokit = __webpack_require__(402);
  1116. const registerPlugin = __webpack_require__(855);
  1117. function factory(plugins) {
  1118. const Api = Octokit.bind(null, plugins || []);
  1119. Api.plugin = registerPlugin.bind(null, plugins || []);
  1120. return Api;
  1121. }
  1122. /***/ }),
  1123. /***/ 49:
  1124. /***/ (function(module, __unusedexports, __webpack_require__) {
  1125. "use strict";
  1126. const os = __webpack_require__(87);
  1127. const execa = __webpack_require__(955);
  1128. // Reference: https://www.gaijin.at/en/lstwinver.php
  1129. const names = new Map([
  1130. ['10.0', '10'],
  1131. ['6.3', '8.1'],
  1132. ['6.2', '8'],
  1133. ['6.1', '7'],
  1134. ['6.0', 'Vista'],
  1135. ['5.2', 'Server 2003'],
  1136. ['5.1', 'XP'],
  1137. ['5.0', '2000'],
  1138. ['4.9', 'ME'],
  1139. ['4.1', '98'],
  1140. ['4.0', '95']
  1141. ]);
  1142. const windowsRelease = release => {
  1143. const version = /\d+\.\d/.exec(release || os.release());
  1144. if (release && !version) {
  1145. throw new Error('`release` argument doesn\'t match `n.n`');
  1146. }
  1147. const ver = (version || [])[0];
  1148. // Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
  1149. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1150. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1151. // If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
  1152. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1153. const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1154. const year = (stdout.match(/2008|2012|2016/) || [])[0];
  1155. if (year) {
  1156. return `Server ${year}`;
  1157. }
  1158. }
  1159. return names.get(ver);
  1160. };
  1161. module.exports = windowsRelease;
  1162. /***/ }),
  1163. /***/ 81:
  1164. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  1165. "use strict";
  1166. var __importStar = (this && this.__importStar) || function (mod) {
  1167. if (mod && mod.__esModule) return mod;
  1168. var result = {};
  1169. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  1170. result["default"] = mod;
  1171. return result;
  1172. };
  1173. Object.defineProperty(exports, "__esModule", { value: true });
  1174. const assert = __importStar(__webpack_require__(357));
  1175. const url_1 = __webpack_require__(835);
  1176. function getApiUrl() {
  1177. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  1178. }
  1179. exports.getApiUrl = getApiUrl;
  1180. function getFetchUrl(settings) {
  1181. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  1182. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  1183. const serviceUrl = getServerUrl();
  1184. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  1185. const encodedName = encodeURIComponent(settings.repositoryName);
  1186. if (settings.sshKey) {
  1187. return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  1188. }
  1189. // "origin" is SCHEME://HOSTNAME[:PORT]
  1190. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  1191. }
  1192. exports.getFetchUrl = getFetchUrl;
  1193. function getServerUrl() {
  1194. return new url_1.URL(process.env['GITHUB_URL'] || 'https://github.com');
  1195. }
  1196. exports.getServerUrl = getServerUrl;
  1197. /***/ }),
  1198. /***/ 87:
  1199. /***/ (function(module) {
  1200. module.exports = require("os");
  1201. /***/ }),
  1202. /***/ 118:
  1203. /***/ (function(module, __unusedexports, __webpack_require__) {
  1204. "use strict";
  1205. const os = __webpack_require__(87);
  1206. const nameMap = new Map([
  1207. [19, 'Catalina'],
  1208. [18, 'Mojave'],
  1209. [17, 'High Sierra'],
  1210. [16, 'Sierra'],
  1211. [15, 'El Capitan'],
  1212. [14, 'Yosemite'],
  1213. [13, 'Mavericks'],
  1214. [12, 'Mountain Lion'],
  1215. [11, 'Lion'],
  1216. [10, 'Snow Leopard'],
  1217. [9, 'Leopard'],
  1218. [8, 'Tiger'],
  1219. [7, 'Panther'],
  1220. [6, 'Jaguar'],
  1221. [5, 'Puma']
  1222. ]);
  1223. const macosRelease = release => {
  1224. release = Number((release || os.release()).split('.')[0]);
  1225. return {
  1226. name: nameMap.get(release),
  1227. version: '10.' + (release - 4)
  1228. };
  1229. };
  1230. module.exports = macosRelease;
  1231. // TODO: remove this in the next major version
  1232. module.exports.default = macosRelease;
  1233. /***/ }),
  1234. /***/ 126:
  1235. /***/ (function(module) {
  1236. /**
  1237. * lodash (Custom Build) <https://lodash.com/>
  1238. * Build: `lodash modularize exports="npm" -o ./`
  1239. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1240. * Released under MIT license <https://lodash.com/license>
  1241. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1242. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1243. */
  1244. /** Used as the size to enable large array optimizations. */
  1245. var LARGE_ARRAY_SIZE = 200;
  1246. /** Used to stand-in for `undefined` hash values. */
  1247. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1248. /** Used as references for various `Number` constants. */
  1249. var INFINITY = 1 / 0;
  1250. /** `Object#toString` result references. */
  1251. var funcTag = '[object Function]',
  1252. genTag = '[object GeneratorFunction]';
  1253. /**
  1254. * Used to match `RegExp`
  1255. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1256. */
  1257. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1258. /** Used to detect host constructors (Safari). */
  1259. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1260. /** Detect free variable `global` from Node.js. */
  1261. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1262. /** Detect free variable `self`. */
  1263. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1264. /** Used as a reference to the global object. */
  1265. var root = freeGlobal || freeSelf || Function('return this')();
  1266. /**
  1267. * A specialized version of `_.includes` for arrays without support for
  1268. * specifying an index to search from.
  1269. *
  1270. * @private
  1271. * @param {Array} [array] The array to inspect.
  1272. * @param {*} target The value to search for.
  1273. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1274. */
  1275. function arrayIncludes(array, value) {
  1276. var length = array ? array.length : 0;
  1277. return !!length && baseIndexOf(array, value, 0) > -1;
  1278. }
  1279. /**
  1280. * This function is like `arrayIncludes` except that it accepts a comparator.
  1281. *
  1282. * @private
  1283. * @param {Array} [array] The array to inspect.
  1284. * @param {*} target The value to search for.
  1285. * @param {Function} comparator The comparator invoked per element.
  1286. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1287. */
  1288. function arrayIncludesWith(array, value, comparator) {
  1289. var index = -1,
  1290. length = array ? array.length : 0;
  1291. while (++index < length) {
  1292. if (comparator(value, array[index])) {
  1293. return true;
  1294. }
  1295. }
  1296. return false;
  1297. }
  1298. /**
  1299. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1300. * support for iteratee shorthands.
  1301. *
  1302. * @private
  1303. * @param {Array} array The array to inspect.
  1304. * @param {Function} predicate The function invoked per iteration.
  1305. * @param {number} fromIndex The index to search from.
  1306. * @param {boolean} [fromRight] Specify iterating from right to left.
  1307. * @returns {number} Returns the index of the matched value, else `-1`.
  1308. */
  1309. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1310. var length = array.length,
  1311. index = fromIndex + (fromRight ? 1 : -1);
  1312. while ((fromRight ? index-- : ++index < length)) {
  1313. if (predicate(array[index], index, array)) {
  1314. return index;
  1315. }
  1316. }
  1317. return -1;
  1318. }
  1319. /**
  1320. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1321. *
  1322. * @private
  1323. * @param {Array} array The array to inspect.
  1324. * @param {*} value The value to search for.
  1325. * @param {number} fromIndex The index to search from.
  1326. * @returns {number} Returns the index of the matched value, else `-1`.
  1327. */
  1328. function baseIndexOf(array, value, fromIndex) {
  1329. if (value !== value) {
  1330. return baseFindIndex(array, baseIsNaN, fromIndex);
  1331. }
  1332. var index = fromIndex - 1,
  1333. length = array.length;
  1334. while (++index < length) {
  1335. if (array[index] === value) {
  1336. return index;
  1337. }
  1338. }
  1339. return -1;
  1340. }
  1341. /**
  1342. * The base implementation of `_.isNaN` without support for number objects.
  1343. *
  1344. * @private
  1345. * @param {*} value The value to check.
  1346. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1347. */
  1348. function baseIsNaN(value) {
  1349. return value !== value;
  1350. }
  1351. /**
  1352. * Checks if a cache value for `key` exists.
  1353. *
  1354. * @private
  1355. * @param {Object} cache The cache to query.
  1356. * @param {string} key The key of the entry to check.
  1357. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1358. */
  1359. function cacheHas(cache, key) {
  1360. return cache.has(key);
  1361. }
  1362. /**
  1363. * Gets the value at `key` of `object`.
  1364. *
  1365. * @private
  1366. * @param {Object} [object] The object to query.
  1367. * @param {string} key The key of the property to get.
  1368. * @returns {*} Returns the property value.
  1369. */
  1370. function getValue(object, key) {
  1371. return object == null ? undefined : object[key];
  1372. }
  1373. /**
  1374. * Checks if `value` is a host object in IE < 9.
  1375. *
  1376. * @private
  1377. * @param {*} value The value to check.
  1378. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1379. */
  1380. function isHostObject(value) {
  1381. // Many host objects are `Object` objects that can coerce to strings
  1382. // despite having improperly defined `toString` methods.
  1383. var result = false;
  1384. if (value != null && typeof value.toString != 'function') {
  1385. try {
  1386. result = !!(value + '');
  1387. } catch (e) {}
  1388. }
  1389. return result;
  1390. }
  1391. /**
  1392. * Converts `set` to an array of its values.
  1393. *
  1394. * @private
  1395. * @param {Object} set The set to convert.
  1396. * @returns {Array} Returns the values.
  1397. */
  1398. function setToArray(set) {
  1399. var index = -1,
  1400. result = Array(set.size);
  1401. set.forEach(function(value) {
  1402. result[++index] = value;
  1403. });
  1404. return result;
  1405. }
  1406. /** Used for built-in method references. */
  1407. var arrayProto = Array.prototype,
  1408. funcProto = Function.prototype,
  1409. objectProto = Object.prototype;
  1410. /** Used to detect overreaching core-js shims. */
  1411. var coreJsData = root['__core-js_shared__'];
  1412. /** Used to detect methods masquerading as native. */
  1413. var maskSrcKey = (function() {
  1414. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1415. return uid ? ('Symbol(src)_1.' + uid) : '';
  1416. }());
  1417. /** Used to resolve the decompiled source of functions. */
  1418. var funcToString = funcProto.toString;
  1419. /** Used to check objects for own properties. */
  1420. var hasOwnProperty = objectProto.hasOwnProperty;
  1421. /**
  1422. * Used to resolve the
  1423. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1424. * of values.
  1425. */
  1426. var objectToString = objectProto.toString;
  1427. /** Used to detect if a method is native. */
  1428. var reIsNative = RegExp('^' +
  1429. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1430. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1431. );
  1432. /** Built-in value references. */
  1433. var splice = arrayProto.splice;
  1434. /* Built-in method references that are verified to be native. */
  1435. var Map = getNative(root, 'Map'),
  1436. Set = getNative(root, 'Set'),
  1437. nativeCreate = getNative(Object, 'create');
  1438. /**
  1439. * Creates a hash object.
  1440. *
  1441. * @private
  1442. * @constructor
  1443. * @param {Array} [entries] The key-value pairs to cache.
  1444. */
  1445. function Hash(entries) {
  1446. var index = -1,
  1447. length = entries ? entries.length : 0;
  1448. this.clear();
  1449. while (++index < length) {
  1450. var entry = entries[index];
  1451. this.set(entry[0], entry[1]);
  1452. }
  1453. }
  1454. /**
  1455. * Removes all key-value entries from the hash.
  1456. *
  1457. * @private
  1458. * @name clear
  1459. * @memberOf Hash
  1460. */
  1461. function hashClear() {
  1462. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1463. }
  1464. /**
  1465. * Removes `key` and its value from the hash.
  1466. *
  1467. * @private
  1468. * @name delete
  1469. * @memberOf Hash
  1470. * @param {Object} hash The hash to modify.
  1471. * @param {string} key The key of the value to remove.
  1472. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1473. */
  1474. function hashDelete(key) {
  1475. return this.has(key) && delete this.__data__[key];
  1476. }
  1477. /**
  1478. * Gets the hash value for `key`.
  1479. *
  1480. * @private
  1481. * @name get
  1482. * @memberOf Hash
  1483. * @param {string} key The key of the value to get.
  1484. * @returns {*} Returns the entry value.
  1485. */
  1486. function hashGet(key) {
  1487. var data = this.__data__;
  1488. if (nativeCreate) {
  1489. var result = data[key];
  1490. return result === HASH_UNDEFINED ? undefined : result;
  1491. }
  1492. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1493. }
  1494. /**
  1495. * Checks if a hash value for `key` exists.
  1496. *
  1497. * @private
  1498. * @name has
  1499. * @memberOf Hash
  1500. * @param {string} key The key of the entry to check.
  1501. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1502. */
  1503. function hashHas(key) {
  1504. var data = this.__data__;
  1505. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1506. }
  1507. /**
  1508. * Sets the hash `key` to `value`.
  1509. *
  1510. * @private
  1511. * @name set
  1512. * @memberOf Hash
  1513. * @param {string} key The key of the value to set.
  1514. * @param {*} value The value to set.
  1515. * @returns {Object} Returns the hash instance.
  1516. */
  1517. function hashSet(key, value) {
  1518. var data = this.__data__;
  1519. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1520. return this;
  1521. }
  1522. // Add methods to `Hash`.
  1523. Hash.prototype.clear = hashClear;
  1524. Hash.prototype['delete'] = hashDelete;
  1525. Hash.prototype.get = hashGet;
  1526. Hash.prototype.has = hashHas;
  1527. Hash.prototype.set = hashSet;
  1528. /**
  1529. * Creates an list cache object.
  1530. *
  1531. * @private
  1532. * @constructor
  1533. * @param {Array} [entries] The key-value pairs to cache.
  1534. */
  1535. function ListCache(entries) {
  1536. var index = -1,
  1537. length = entries ? entries.length : 0;
  1538. this.clear();
  1539. while (++index < length) {
  1540. var entry = entries[index];
  1541. this.set(entry[0], entry[1]);
  1542. }
  1543. }
  1544. /**
  1545. * Removes all key-value entries from the list cache.
  1546. *
  1547. * @private
  1548. * @name clear
  1549. * @memberOf ListCache
  1550. */
  1551. function listCacheClear() {
  1552. this.__data__ = [];
  1553. }
  1554. /**
  1555. * Removes `key` and its value from the list cache.
  1556. *
  1557. * @private
  1558. * @name delete
  1559. * @memberOf ListCache
  1560. * @param {string} key The key of the value to remove.
  1561. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1562. */
  1563. function listCacheDelete(key) {
  1564. var data = this.__data__,
  1565. index = assocIndexOf(data, key);
  1566. if (index < 0) {
  1567. return false;
  1568. }
  1569. var lastIndex = data.length - 1;
  1570. if (index == lastIndex) {
  1571. data.pop();
  1572. } else {
  1573. splice.call(data, index, 1);
  1574. }
  1575. return true;
  1576. }
  1577. /**
  1578. * Gets the list cache value for `key`.
  1579. *
  1580. * @private
  1581. * @name get
  1582. * @memberOf ListCache
  1583. * @param {string} key The key of the value to get.
  1584. * @returns {*} Returns the entry value.
  1585. */
  1586. function listCacheGet(key) {
  1587. var data = this.__data__,
  1588. index = assocIndexOf(data, key);
  1589. return index < 0 ? undefined : data[index][1];
  1590. }
  1591. /**
  1592. * Checks if a list cache value for `key` exists.
  1593. *
  1594. * @private
  1595. * @name has
  1596. * @memberOf ListCache
  1597. * @param {string} key The key of the entry to check.
  1598. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1599. */
  1600. function listCacheHas(key) {
  1601. return assocIndexOf(this.__data__, key) > -1;
  1602. }
  1603. /**
  1604. * Sets the list cache `key` to `value`.
  1605. *
  1606. * @private
  1607. * @name set
  1608. * @memberOf ListCache
  1609. * @param {string} key The key of the value to set.
  1610. * @param {*} value The value to set.
  1611. * @returns {Object} Returns the list cache instance.
  1612. */
  1613. function listCacheSet(key, value) {
  1614. var data = this.__data__,
  1615. index = assocIndexOf(data, key);
  1616. if (index < 0) {
  1617. data.push([key, value]);
  1618. } else {
  1619. data[index][1] = value;
  1620. }
  1621. return this;
  1622. }
  1623. // Add methods to `ListCache`.
  1624. ListCache.prototype.clear = listCacheClear;
  1625. ListCache.prototype['delete'] = listCacheDelete;
  1626. ListCache.prototype.get = listCacheGet;
  1627. ListCache.prototype.has = listCacheHas;
  1628. ListCache.prototype.set = listCacheSet;
  1629. /**
  1630. * Creates a map cache object to store key-value pairs.
  1631. *
  1632. * @private
  1633. * @constructor
  1634. * @param {Array} [entries] The key-value pairs to cache.
  1635. */
  1636. function MapCache(entries) {
  1637. var index = -1,
  1638. length = entries ? entries.length : 0;
  1639. this.clear();
  1640. while (++index < length) {
  1641. var entry = entries[index];
  1642. this.set(entry[0], entry[1]);
  1643. }
  1644. }
  1645. /**
  1646. * Removes all key-value entries from the map.
  1647. *
  1648. * @private
  1649. * @name clear
  1650. * @memberOf MapCache
  1651. */
  1652. function mapCacheClear() {
  1653. this.__data__ = {
  1654. 'hash': new Hash,
  1655. 'map': new (Map || ListCache),
  1656. 'string': new Hash
  1657. };
  1658. }
  1659. /**
  1660. * Removes `key` and its value from the map.
  1661. *
  1662. * @private
  1663. * @name delete
  1664. * @memberOf MapCache
  1665. * @param {string} key The key of the value to remove.
  1666. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1667. */
  1668. function mapCacheDelete(key) {
  1669. return getMapData(this, key)['delete'](key);
  1670. }
  1671. /**
  1672. * Gets the map value for `key`.
  1673. *
  1674. * @private
  1675. * @name get
  1676. * @memberOf MapCache
  1677. * @param {string} key The key of the value to get.
  1678. * @returns {*} Returns the entry value.
  1679. */
  1680. function mapCacheGet(key) {
  1681. return getMapData(this, key).get(key);
  1682. }
  1683. /**
  1684. * Checks if a map value for `key` exists.
  1685. *
  1686. * @private
  1687. * @name has
  1688. * @memberOf MapCache
  1689. * @param {string} key The key of the entry to check.
  1690. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1691. */
  1692. function mapCacheHas(key) {
  1693. return getMapData(this, key).has(key);
  1694. }
  1695. /**
  1696. * Sets the map `key` to `value`.
  1697. *
  1698. * @private
  1699. * @name set
  1700. * @memberOf MapCache
  1701. * @param {string} key The key of the value to set.
  1702. * @param {*} value The value to set.
  1703. * @returns {Object} Returns the map cache instance.
  1704. */
  1705. function mapCacheSet(key, value) {
  1706. getMapData(this, key).set(key, value);
  1707. return this;
  1708. }
  1709. // Add methods to `MapCache`.
  1710. MapCache.prototype.clear = mapCacheClear;
  1711. MapCache.prototype['delete'] = mapCacheDelete;
  1712. MapCache.prototype.get = mapCacheGet;
  1713. MapCache.prototype.has = mapCacheHas;
  1714. MapCache.prototype.set = mapCacheSet;
  1715. /**
  1716. *
  1717. * Creates an array cache object to store unique values.
  1718. *
  1719. * @private
  1720. * @constructor
  1721. * @param {Array} [values] The values to cache.
  1722. */
  1723. function SetCache(values) {
  1724. var index = -1,
  1725. length = values ? values.length : 0;
  1726. this.__data__ = new MapCache;
  1727. while (++index < length) {
  1728. this.add(values[index]);
  1729. }
  1730. }
  1731. /**
  1732. * Adds `value` to the array cache.
  1733. *
  1734. * @private
  1735. * @name add
  1736. * @memberOf SetCache
  1737. * @alias push
  1738. * @param {*} value The value to cache.
  1739. * @returns {Object} Returns the cache instance.
  1740. */
  1741. function setCacheAdd(value) {
  1742. this.__data__.set(value, HASH_UNDEFINED);
  1743. return this;
  1744. }
  1745. /**
  1746. * Checks if `value` is in the array cache.
  1747. *
  1748. * @private
  1749. * @name has
  1750. * @memberOf SetCache
  1751. * @param {*} value The value to search for.
  1752. * @returns {number} Returns `true` if `value` is found, else `false`.
  1753. */
  1754. function setCacheHas(value) {
  1755. return this.__data__.has(value);
  1756. }
  1757. // Add methods to `SetCache`.
  1758. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1759. SetCache.prototype.has = setCacheHas;
  1760. /**
  1761. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1762. *
  1763. * @private
  1764. * @param {Array} array The array to inspect.
  1765. * @param {*} key The key to search for.
  1766. * @returns {number} Returns the index of the matched value, else `-1`.
  1767. */
  1768. function assocIndexOf(array, key) {
  1769. var length = array.length;
  1770. while (length--) {
  1771. if (eq(array[length][0], key)) {
  1772. return length;
  1773. }
  1774. }
  1775. return -1;
  1776. }
  1777. /**
  1778. * The base implementation of `_.isNative` without bad shim checks.
  1779. *
  1780. * @private
  1781. * @param {*} value The value to check.
  1782. * @returns {boolean} Returns `true` if `value` is a native function,
  1783. * else `false`.
  1784. */
  1785. function baseIsNative(value) {
  1786. if (!isObject(value) || isMasked(value)) {
  1787. return false;
  1788. }
  1789. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1790. return pattern.test(toSource(value));
  1791. }
  1792. /**
  1793. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1794. *
  1795. * @private
  1796. * @param {Array} array The array to inspect.
  1797. * @param {Function} [iteratee] The iteratee invoked per element.
  1798. * @param {Function} [comparator] The comparator invoked per element.
  1799. * @returns {Array} Returns the new duplicate free array.
  1800. */
  1801. function baseUniq(array, iteratee, comparator) {
  1802. var index = -1,
  1803. includes = arrayIncludes,
  1804. length = array.length,
  1805. isCommon = true,
  1806. result = [],
  1807. seen = result;
  1808. if (comparator) {
  1809. isCommon = false;
  1810. includes = arrayIncludesWith;
  1811. }
  1812. else if (length >= LARGE_ARRAY_SIZE) {
  1813. var set = iteratee ? null : createSet(array);
  1814. if (set) {
  1815. return setToArray(set);
  1816. }
  1817. isCommon = false;
  1818. includes = cacheHas;
  1819. seen = new SetCache;
  1820. }
  1821. else {
  1822. seen = iteratee ? [] : result;
  1823. }
  1824. outer:
  1825. while (++index < length) {
  1826. var value = array[index],
  1827. computed = iteratee ? iteratee(value) : value;
  1828. value = (comparator || value !== 0) ? value : 0;
  1829. if (isCommon && computed === computed) {
  1830. var seenIndex = seen.length;
  1831. while (seenIndex--) {
  1832. if (seen[seenIndex] === computed) {
  1833. continue outer;
  1834. }
  1835. }
  1836. if (iteratee) {
  1837. seen.push(computed);
  1838. }
  1839. result.push(value);
  1840. }
  1841. else if (!includes(seen, computed, comparator)) {
  1842. if (seen !== result) {
  1843. seen.push(computed);
  1844. }
  1845. result.push(value);
  1846. }
  1847. }
  1848. return result;
  1849. }
  1850. /**
  1851. * Creates a set object of `values`.
  1852. *
  1853. * @private
  1854. * @param {Array} values The values to add to the set.
  1855. * @returns {Object} Returns the new set.
  1856. */
  1857. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1858. return new Set(values);
  1859. };
  1860. /**
  1861. * Gets the data for `map`.
  1862. *
  1863. * @private
  1864. * @param {Object} map The map to query.
  1865. * @param {string} key The reference key.
  1866. * @returns {*} Returns the map data.
  1867. */
  1868. function getMapData(map, key) {
  1869. var data = map.__data__;
  1870. return isKeyable(key)
  1871. ? data[typeof key == 'string' ? 'string' : 'hash']
  1872. : data.map;
  1873. }
  1874. /**
  1875. * Gets the native function at `key` of `object`.
  1876. *
  1877. * @private
  1878. * @param {Object} object The object to query.
  1879. * @param {string} key The key of the method to get.
  1880. * @returns {*} Returns the function if it's native, else `undefined`.
  1881. */
  1882. function getNative(object, key) {
  1883. var value = getValue(object, key);
  1884. return baseIsNative(value) ? value : undefined;
  1885. }
  1886. /**
  1887. * Checks if `value` is suitable for use as unique object key.
  1888. *
  1889. * @private
  1890. * @param {*} value The value to check.
  1891. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1892. */
  1893. function isKeyable(value) {
  1894. var type = typeof value;
  1895. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1896. ? (value !== '__proto__')
  1897. : (value === null);
  1898. }
  1899. /**
  1900. * Checks if `func` has its source masked.
  1901. *
  1902. * @private
  1903. * @param {Function} func The function to check.
  1904. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1905. */
  1906. function isMasked(func) {
  1907. return !!maskSrcKey && (maskSrcKey in func);
  1908. }
  1909. /**
  1910. * Converts `func` to its source code.
  1911. *
  1912. * @private
  1913. * @param {Function} func The function to process.
  1914. * @returns {string} Returns the source code.
  1915. */
  1916. function toSource(func) {
  1917. if (func != null) {
  1918. try {
  1919. return funcToString.call(func);
  1920. } catch (e) {}
  1921. try {
  1922. return (func + '');
  1923. } catch (e) {}
  1924. }
  1925. return '';
  1926. }
  1927. /**
  1928. * Creates a duplicate-free version of an array, using
  1929. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1930. * for equality comparisons, in which only the first occurrence of each
  1931. * element is kept.
  1932. *
  1933. * @static
  1934. * @memberOf _
  1935. * @since 0.1.0
  1936. * @category Array
  1937. * @param {Array} array The array to inspect.
  1938. * @returns {Array} Returns the new duplicate free array.
  1939. * @example
  1940. *
  1941. * _.uniq([2, 1, 2]);
  1942. * // => [2, 1]
  1943. */
  1944. function uniq(array) {
  1945. return (array && array.length)
  1946. ? baseUniq(array)
  1947. : [];
  1948. }
  1949. /**
  1950. * Performs a
  1951. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1952. * comparison between two values to determine if they are equivalent.
  1953. *
  1954. * @static
  1955. * @memberOf _
  1956. * @since 4.0.0
  1957. * @category Lang
  1958. * @param {*} value The value to compare.
  1959. * @param {*} other The other value to compare.
  1960. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1961. * @example
  1962. *
  1963. * var object = { 'a': 1 };
  1964. * var other = { 'a': 1 };
  1965. *
  1966. * _.eq(object, object);
  1967. * // => true
  1968. *
  1969. * _.eq(object, other);
  1970. * // => false
  1971. *
  1972. * _.eq('a', 'a');
  1973. * // => true
  1974. *
  1975. * _.eq('a', Object('a'));
  1976. * // => false
  1977. *
  1978. * _.eq(NaN, NaN);
  1979. * // => true
  1980. */
  1981. function eq(value, other) {
  1982. return value === other || (value !== value && other !== other);
  1983. }
  1984. /**
  1985. * Checks if `value` is classified as a `Function` object.
  1986. *
  1987. * @static
  1988. * @memberOf _
  1989. * @since 0.1.0
  1990. * @category Lang
  1991. * @param {*} value The value to check.
  1992. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1993. * @example
  1994. *
  1995. * _.isFunction(_);
  1996. * // => true
  1997. *
  1998. * _.isFunction(/abc/);
  1999. * // => false
  2000. */
  2001. function isFunction(value) {
  2002. // The use of `Object#toString` avoids issues with the `typeof` operator
  2003. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2004. var tag = isObject(value) ? objectToString.call(value) : '';
  2005. return tag == funcTag || tag == genTag;
  2006. }
  2007. /**
  2008. * Checks if `value` is the
  2009. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2010. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2011. *
  2012. * @static
  2013. * @memberOf _
  2014. * @since 0.1.0
  2015. * @category Lang
  2016. * @param {*} value The value to check.
  2017. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2018. * @example
  2019. *
  2020. * _.isObject({});
  2021. * // => true
  2022. *
  2023. * _.isObject([1, 2, 3]);
  2024. * // => true
  2025. *
  2026. * _.isObject(_.noop);
  2027. * // => true
  2028. *
  2029. * _.isObject(null);
  2030. * // => false
  2031. */
  2032. function isObject(value) {
  2033. var type = typeof value;
  2034. return !!value && (type == 'object' || type == 'function');
  2035. }
  2036. /**
  2037. * This method returns `undefined`.
  2038. *
  2039. * @static
  2040. * @memberOf _
  2041. * @since 2.3.0
  2042. * @category Util
  2043. * @example
  2044. *
  2045. * _.times(2, _.noop);
  2046. * // => [undefined, undefined]
  2047. */
  2048. function noop() {
  2049. // No operation performed.
  2050. }
  2051. module.exports = uniq;
  2052. /***/ }),
  2053. /***/ 129:
  2054. /***/ (function(module) {
  2055. module.exports = require("child_process");
  2056. /***/ }),
  2057. /***/ 139:
  2058. /***/ (function(module, __unusedexports, __webpack_require__) {
  2059. // Unique ID creation requires a high quality random # generator. In node.js
  2060. // this is pretty straight-forward - we use the crypto API.
  2061. var crypto = __webpack_require__(417);
  2062. module.exports = function nodeRNG() {
  2063. return crypto.randomBytes(16);
  2064. };
  2065. /***/ }),
  2066. /***/ 141:
  2067. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2068. "use strict";
  2069. var net = __webpack_require__(631);
  2070. var tls = __webpack_require__(16);
  2071. var http = __webpack_require__(605);
  2072. var https = __webpack_require__(211);
  2073. var events = __webpack_require__(614);
  2074. var assert = __webpack_require__(357);
  2075. var util = __webpack_require__(669);
  2076. exports.httpOverHttp = httpOverHttp;
  2077. exports.httpsOverHttp = httpsOverHttp;
  2078. exports.httpOverHttps = httpOverHttps;
  2079. exports.httpsOverHttps = httpsOverHttps;
  2080. function httpOverHttp(options) {
  2081. var agent = new TunnelingAgent(options);
  2082. agent.request = http.request;
  2083. return agent;
  2084. }
  2085. function httpsOverHttp(options) {
  2086. var agent = new TunnelingAgent(options);
  2087. agent.request = http.request;
  2088. agent.createSocket = createSecureSocket;
  2089. return agent;
  2090. }
  2091. function httpOverHttps(options) {
  2092. var agent = new TunnelingAgent(options);
  2093. agent.request = https.request;
  2094. return agent;
  2095. }
  2096. function httpsOverHttps(options) {
  2097. var agent = new TunnelingAgent(options);
  2098. agent.request = https.request;
  2099. agent.createSocket = createSecureSocket;
  2100. return agent;
  2101. }
  2102. function TunnelingAgent(options) {
  2103. var self = this;
  2104. self.options = options || {};
  2105. self.proxyOptions = self.options.proxy || {};
  2106. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2107. self.requests = [];
  2108. self.sockets = [];
  2109. self.on('free', function onFree(socket, host, port, localAddress) {
  2110. var options = toOptions(host, port, localAddress);
  2111. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2112. var pending = self.requests[i];
  2113. if (pending.host === options.host && pending.port === options.port) {
  2114. // Detect the request to connect same origin server,
  2115. // reuse the connection.
  2116. self.requests.splice(i, 1);
  2117. pending.request.onSocket(socket);
  2118. return;
  2119. }
  2120. }
  2121. socket.destroy();
  2122. self.removeSocket(socket);
  2123. });
  2124. }
  2125. util.inherits(TunnelingAgent, events.EventEmitter);
  2126. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2127. var self = this;
  2128. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2129. if (self.sockets.length >= this.maxSockets) {
  2130. // We are over limit so we'll add it to the queue.
  2131. self.requests.push(options);
  2132. return;
  2133. }
  2134. // If we are under maxSockets create a new one.
  2135. self.createSocket(options, function(socket) {
  2136. socket.on('free', onFree);
  2137. socket.on('close', onCloseOrRemove);
  2138. socket.on('agentRemove', onCloseOrRemove);
  2139. req.onSocket(socket);
  2140. function onFree() {
  2141. self.emit('free', socket, options);
  2142. }
  2143. function onCloseOrRemove(err) {
  2144. self.removeSocket(socket);
  2145. socket.removeListener('free', onFree);
  2146. socket.removeListener('close', onCloseOrRemove);
  2147. socket.removeListener('agentRemove', onCloseOrRemove);
  2148. }
  2149. });
  2150. };
  2151. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2152. var self = this;
  2153. var placeholder = {};
  2154. self.sockets.push(placeholder);
  2155. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2156. method: 'CONNECT',
  2157. path: options.host + ':' + options.port,
  2158. agent: false
  2159. });
  2160. if (connectOptions.proxyAuth) {
  2161. connectOptions.headers = connectOptions.headers || {};
  2162. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2163. new Buffer(connectOptions.proxyAuth).toString('base64');
  2164. }
  2165. debug('making CONNECT request');
  2166. var connectReq = self.request(connectOptions);
  2167. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2168. connectReq.once('response', onResponse); // for v0.6
  2169. connectReq.once('upgrade', onUpgrade); // for v0.6
  2170. connectReq.once('connect', onConnect); // for v0.7 or later
  2171. connectReq.once('error', onError);
  2172. connectReq.end();
  2173. function onResponse(res) {
  2174. // Very hacky. This is necessary to avoid http-parser leaks.
  2175. res.upgrade = true;
  2176. }
  2177. function onUpgrade(res, socket, head) {
  2178. // Hacky.
  2179. process.nextTick(function() {
  2180. onConnect(res, socket, head);
  2181. });
  2182. }
  2183. function onConnect(res, socket, head) {
  2184. connectReq.removeAllListeners();
  2185. socket.removeAllListeners();
  2186. if (res.statusCode === 200) {
  2187. assert.equal(head.length, 0);
  2188. debug('tunneling connection has established');
  2189. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2190. cb(socket);
  2191. } else {
  2192. debug('tunneling socket could not be established, statusCode=%d',
  2193. res.statusCode);
  2194. var error = new Error('tunneling socket could not be established, ' +
  2195. 'statusCode=' + res.statusCode);
  2196. error.code = 'ECONNRESET';
  2197. options.request.emit('error', error);
  2198. self.removeSocket(placeholder);
  2199. }
  2200. }
  2201. function onError(cause) {
  2202. connectReq.removeAllListeners();
  2203. debug('tunneling socket could not be established, cause=%s\n',
  2204. cause.message, cause.stack);
  2205. var error = new Error('tunneling socket could not be established, ' +
  2206. 'cause=' + cause.message);
  2207. error.code = 'ECONNRESET';
  2208. options.request.emit('error', error);
  2209. self.removeSocket(placeholder);
  2210. }
  2211. };
  2212. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2213. var pos = this.sockets.indexOf(socket)
  2214. if (pos === -1) {
  2215. return;
  2216. }
  2217. this.sockets.splice(pos, 1);
  2218. var pending = this.requests.shift();
  2219. if (pending) {
  2220. // If we have pending requests and a socket gets closed a new one
  2221. // needs to be created to take over in the pool for the one that closed.
  2222. this.createSocket(pending, function(socket) {
  2223. pending.request.onSocket(socket);
  2224. });
  2225. }
  2226. };
  2227. function createSecureSocket(options, cb) {
  2228. var self = this;
  2229. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2230. var hostHeader = options.request.getHeader('host');
  2231. var tlsOptions = mergeOptions({}, self.options, {
  2232. socket: socket,
  2233. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2234. });
  2235. // 0 is dummy port for v0.6
  2236. var secureSocket = tls.connect(0, tlsOptions);
  2237. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2238. cb(secureSocket);
  2239. });
  2240. }
  2241. function toOptions(host, port, localAddress) {
  2242. if (typeof host === 'string') { // since v0.10
  2243. return {
  2244. host: host,
  2245. port: port,
  2246. localAddress: localAddress
  2247. };
  2248. }
  2249. return host; // for v0.11 or later
  2250. }
  2251. function mergeOptions(target) {
  2252. for (var i = 1, len = arguments.length; i < len; ++i) {
  2253. var overrides = arguments[i];
  2254. if (typeof overrides === 'object') {
  2255. var keys = Object.keys(overrides);
  2256. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2257. var k = keys[j];
  2258. if (overrides[k] !== undefined) {
  2259. target[k] = overrides[k];
  2260. }
  2261. }
  2262. }
  2263. }
  2264. return target;
  2265. }
  2266. var debug;
  2267. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2268. debug = function() {
  2269. var args = Array.prototype.slice.call(arguments);
  2270. if (typeof args[0] === 'string') {
  2271. args[0] = 'TUNNEL: ' + args[0];
  2272. } else {
  2273. args.unshift('TUNNEL:');
  2274. }
  2275. console.error.apply(console, args);
  2276. }
  2277. } else {
  2278. debug = function() {};
  2279. }
  2280. exports.debug = debug; // for test
  2281. /***/ }),
  2282. /***/ 143:
  2283. /***/ (function(module, __unusedexports, __webpack_require__) {
  2284. module.exports = withAuthorizationPrefix;
  2285. const atob = __webpack_require__(368);
  2286. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2287. function withAuthorizationPrefix(authorization) {
  2288. if (/^(basic|bearer|token) /i.test(authorization)) {
  2289. return authorization;
  2290. }
  2291. try {
  2292. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2293. return `basic ${authorization}`;
  2294. }
  2295. } catch (error) {}
  2296. if (authorization.split(/\./).length === 3) {
  2297. return `bearer ${authorization}`;
  2298. }
  2299. return `token ${authorization}`;
  2300. }
  2301. /***/ }),
  2302. /***/ 145:
  2303. /***/ (function(module, __unusedexports, __webpack_require__) {
  2304. "use strict";
  2305. const pump = __webpack_require__(453);
  2306. const bufferStream = __webpack_require__(966);
  2307. class MaxBufferError extends Error {
  2308. constructor() {
  2309. super('maxBuffer exceeded');
  2310. this.name = 'MaxBufferError';
  2311. }
  2312. }
  2313. function getStream(inputStream, options) {
  2314. if (!inputStream) {
  2315. return Promise.reject(new Error('Expected a stream'));
  2316. }
  2317. options = Object.assign({maxBuffer: Infinity}, options);
  2318. const {maxBuffer} = options;
  2319. let stream;
  2320. return new Promise((resolve, reject) => {
  2321. const rejectPromise = error => {
  2322. if (error) { // A null check
  2323. error.bufferedData = stream.getBufferedValue();
  2324. }
  2325. reject(error);
  2326. };
  2327. stream = pump(inputStream, bufferStream(options), error => {
  2328. if (error) {
  2329. rejectPromise(error);
  2330. return;
  2331. }
  2332. resolve();
  2333. });
  2334. stream.on('data', () => {
  2335. if (stream.getBufferedLength() > maxBuffer) {
  2336. rejectPromise(new MaxBufferError());
  2337. }
  2338. });
  2339. }).then(() => stream.getBufferedValue());
  2340. }
  2341. module.exports = getStream;
  2342. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2343. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2344. module.exports.MaxBufferError = MaxBufferError;
  2345. /***/ }),
  2346. /***/ 148:
  2347. /***/ (function(module, __unusedexports, __webpack_require__) {
  2348. module.exports = paginatePlugin;
  2349. const iterator = __webpack_require__(8);
  2350. const paginate = __webpack_require__(807);
  2351. function paginatePlugin(octokit) {
  2352. octokit.paginate = paginate.bind(null, octokit);
  2353. octokit.paginate.iterator = iterator.bind(null, octokit);
  2354. }
  2355. /***/ }),
  2356. /***/ 153:
  2357. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2358. "use strict";
  2359. var __importStar = (this && this.__importStar) || function (mod) {
  2360. if (mod && mod.__esModule) return mod;
  2361. var result = {};
  2362. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2363. result["default"] = mod;
  2364. return result;
  2365. };
  2366. Object.defineProperty(exports, "__esModule", { value: true });
  2367. const coreCommand = __importStar(__webpack_require__(431));
  2368. /**
  2369. * Indicates whether the POST action is running
  2370. */
  2371. exports.IsPost = !!process.env['STATE_isPost'];
  2372. /**
  2373. * The repository path for the POST action. The value is empty during the MAIN action.
  2374. */
  2375. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2376. /**
  2377. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2378. */
  2379. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  2380. /**
  2381. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2382. */
  2383. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  2384. /**
  2385. * Save the repository path so the POST action can retrieve the value.
  2386. */
  2387. function setRepositoryPath(repositoryPath) {
  2388. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2389. }
  2390. exports.setRepositoryPath = setRepositoryPath;
  2391. /**
  2392. * Save the SSH key path so the POST action can retrieve the value.
  2393. */
  2394. function setSshKeyPath(sshKeyPath) {
  2395. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  2396. }
  2397. exports.setSshKeyPath = setSshKeyPath;
  2398. /**
  2399. * Save the SSH known hosts path so the POST action can retrieve the value.
  2400. */
  2401. function setSshKnownHostsPath(sshKnownHostsPath) {
  2402. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  2403. }
  2404. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2405. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2406. // This is necessary since we don't have a separate entry point.
  2407. if (!exports.IsPost) {
  2408. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2409. }
  2410. /***/ }),
  2411. /***/ 168:
  2412. /***/ (function(module) {
  2413. "use strict";
  2414. const alias = ['stdin', 'stdout', 'stderr'];
  2415. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2416. module.exports = opts => {
  2417. if (!opts) {
  2418. return null;
  2419. }
  2420. if (opts.stdio && hasAlias(opts)) {
  2421. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2422. }
  2423. if (typeof opts.stdio === 'string') {
  2424. return opts.stdio;
  2425. }
  2426. const stdio = opts.stdio || [];
  2427. if (!Array.isArray(stdio)) {
  2428. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2429. }
  2430. const result = [];
  2431. const len = Math.max(stdio.length, alias.length);
  2432. for (let i = 0; i < len; i++) {
  2433. let value = null;
  2434. if (stdio[i] !== undefined) {
  2435. value = stdio[i];
  2436. } else if (opts[alias[i]] !== undefined) {
  2437. value = opts[alias[i]];
  2438. }
  2439. result[i] = value;
  2440. }
  2441. return result;
  2442. };
  2443. /***/ }),
  2444. /***/ 179:
  2445. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2446. "use strict";
  2447. var net = __webpack_require__(631);
  2448. var tls = __webpack_require__(16);
  2449. var http = __webpack_require__(605);
  2450. var https = __webpack_require__(211);
  2451. var events = __webpack_require__(614);
  2452. var assert = __webpack_require__(357);
  2453. var util = __webpack_require__(669);
  2454. exports.httpOverHttp = httpOverHttp;
  2455. exports.httpsOverHttp = httpsOverHttp;
  2456. exports.httpOverHttps = httpOverHttps;
  2457. exports.httpsOverHttps = httpsOverHttps;
  2458. function httpOverHttp(options) {
  2459. var agent = new TunnelingAgent(options);
  2460. agent.request = http.request;
  2461. return agent;
  2462. }
  2463. function httpsOverHttp(options) {
  2464. var agent = new TunnelingAgent(options);
  2465. agent.request = http.request;
  2466. agent.createSocket = createSecureSocket;
  2467. agent.defaultPort = 443;
  2468. return agent;
  2469. }
  2470. function httpOverHttps(options) {
  2471. var agent = new TunnelingAgent(options);
  2472. agent.request = https.request;
  2473. return agent;
  2474. }
  2475. function httpsOverHttps(options) {
  2476. var agent = new TunnelingAgent(options);
  2477. agent.request = https.request;
  2478. agent.createSocket = createSecureSocket;
  2479. agent.defaultPort = 443;
  2480. return agent;
  2481. }
  2482. function TunnelingAgent(options) {
  2483. var self = this;
  2484. self.options = options || {};
  2485. self.proxyOptions = self.options.proxy || {};
  2486. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2487. self.requests = [];
  2488. self.sockets = [];
  2489. self.on('free', function onFree(socket, host, port, localAddress) {
  2490. var options = toOptions(host, port, localAddress);
  2491. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2492. var pending = self.requests[i];
  2493. if (pending.host === options.host && pending.port === options.port) {
  2494. // Detect the request to connect same origin server,
  2495. // reuse the connection.
  2496. self.requests.splice(i, 1);
  2497. pending.request.onSocket(socket);
  2498. return;
  2499. }
  2500. }
  2501. socket.destroy();
  2502. self.removeSocket(socket);
  2503. });
  2504. }
  2505. util.inherits(TunnelingAgent, events.EventEmitter);
  2506. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2507. var self = this;
  2508. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2509. if (self.sockets.length >= this.maxSockets) {
  2510. // We are over limit so we'll add it to the queue.
  2511. self.requests.push(options);
  2512. return;
  2513. }
  2514. // If we are under maxSockets create a new one.
  2515. self.createSocket(options, function(socket) {
  2516. socket.on('free', onFree);
  2517. socket.on('close', onCloseOrRemove);
  2518. socket.on('agentRemove', onCloseOrRemove);
  2519. req.onSocket(socket);
  2520. function onFree() {
  2521. self.emit('free', socket, options);
  2522. }
  2523. function onCloseOrRemove(err) {
  2524. self.removeSocket(socket);
  2525. socket.removeListener('free', onFree);
  2526. socket.removeListener('close', onCloseOrRemove);
  2527. socket.removeListener('agentRemove', onCloseOrRemove);
  2528. }
  2529. });
  2530. };
  2531. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2532. var self = this;
  2533. var placeholder = {};
  2534. self.sockets.push(placeholder);
  2535. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2536. method: 'CONNECT',
  2537. path: options.host + ':' + options.port,
  2538. agent: false,
  2539. headers: {
  2540. host: options.host + ':' + options.port
  2541. }
  2542. });
  2543. if (options.localAddress) {
  2544. connectOptions.localAddress = options.localAddress;
  2545. }
  2546. if (connectOptions.proxyAuth) {
  2547. connectOptions.headers = connectOptions.headers || {};
  2548. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2549. new Buffer(connectOptions.proxyAuth).toString('base64');
  2550. }
  2551. debug('making CONNECT request');
  2552. var connectReq = self.request(connectOptions);
  2553. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2554. connectReq.once('response', onResponse); // for v0.6
  2555. connectReq.once('upgrade', onUpgrade); // for v0.6
  2556. connectReq.once('connect', onConnect); // for v0.7 or later
  2557. connectReq.once('error', onError);
  2558. connectReq.end();
  2559. function onResponse(res) {
  2560. // Very hacky. This is necessary to avoid http-parser leaks.
  2561. res.upgrade = true;
  2562. }
  2563. function onUpgrade(res, socket, head) {
  2564. // Hacky.
  2565. process.nextTick(function() {
  2566. onConnect(res, socket, head);
  2567. });
  2568. }
  2569. function onConnect(res, socket, head) {
  2570. connectReq.removeAllListeners();
  2571. socket.removeAllListeners();
  2572. if (res.statusCode !== 200) {
  2573. debug('tunneling socket could not be established, statusCode=%d',
  2574. res.statusCode);
  2575. socket.destroy();
  2576. var error = new Error('tunneling socket could not be established, ' +
  2577. 'statusCode=' + res.statusCode);
  2578. error.code = 'ECONNRESET';
  2579. options.request.emit('error', error);
  2580. self.removeSocket(placeholder);
  2581. return;
  2582. }
  2583. if (head.length > 0) {
  2584. debug('got illegal response body from proxy');
  2585. socket.destroy();
  2586. var error = new Error('got illegal response body from proxy');
  2587. error.code = 'ECONNRESET';
  2588. options.request.emit('error', error);
  2589. self.removeSocket(placeholder);
  2590. return;
  2591. }
  2592. debug('tunneling connection has established');
  2593. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2594. return cb(socket);
  2595. }
  2596. function onError(cause) {
  2597. connectReq.removeAllListeners();
  2598. debug('tunneling socket could not be established, cause=%s\n',
  2599. cause.message, cause.stack);
  2600. var error = new Error('tunneling socket could not be established, ' +
  2601. 'cause=' + cause.message);
  2602. error.code = 'ECONNRESET';
  2603. options.request.emit('error', error);
  2604. self.removeSocket(placeholder);
  2605. }
  2606. };
  2607. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2608. var pos = this.sockets.indexOf(socket)
  2609. if (pos === -1) {
  2610. return;
  2611. }
  2612. this.sockets.splice(pos, 1);
  2613. var pending = this.requests.shift();
  2614. if (pending) {
  2615. // If we have pending requests and a socket gets closed a new one
  2616. // needs to be created to take over in the pool for the one that closed.
  2617. this.createSocket(pending, function(socket) {
  2618. pending.request.onSocket(socket);
  2619. });
  2620. }
  2621. };
  2622. function createSecureSocket(options, cb) {
  2623. var self = this;
  2624. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2625. var hostHeader = options.request.getHeader('host');
  2626. var tlsOptions = mergeOptions({}, self.options, {
  2627. socket: socket,
  2628. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2629. });
  2630. // 0 is dummy port for v0.6
  2631. var secureSocket = tls.connect(0, tlsOptions);
  2632. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2633. cb(secureSocket);
  2634. });
  2635. }
  2636. function toOptions(host, port, localAddress) {
  2637. if (typeof host === 'string') { // since v0.10
  2638. return {
  2639. host: host,
  2640. port: port,
  2641. localAddress: localAddress
  2642. };
  2643. }
  2644. return host; // for v0.11 or later
  2645. }
  2646. function mergeOptions(target) {
  2647. for (var i = 1, len = arguments.length; i < len; ++i) {
  2648. var overrides = arguments[i];
  2649. if (typeof overrides === 'object') {
  2650. var keys = Object.keys(overrides);
  2651. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2652. var k = keys[j];
  2653. if (overrides[k] !== undefined) {
  2654. target[k] = overrides[k];
  2655. }
  2656. }
  2657. }
  2658. }
  2659. return target;
  2660. }
  2661. var debug;
  2662. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2663. debug = function() {
  2664. var args = Array.prototype.slice.call(arguments);
  2665. if (typeof args[0] === 'string') {
  2666. args[0] = 'TUNNEL: ' + args[0];
  2667. } else {
  2668. args.unshift('TUNNEL:');
  2669. }
  2670. console.error.apply(console, args);
  2671. }
  2672. } else {
  2673. debug = function() {};
  2674. }
  2675. exports.debug = debug; // for test
  2676. /***/ }),
  2677. /***/ 190:
  2678. /***/ (function(module, __unusedexports, __webpack_require__) {
  2679. module.exports = authenticationPlugin;
  2680. const { createTokenAuth } = __webpack_require__(813);
  2681. const { Deprecation } = __webpack_require__(692);
  2682. const once = __webpack_require__(969);
  2683. const beforeRequest = __webpack_require__(863);
  2684. const requestError = __webpack_require__(991);
  2685. const validate = __webpack_require__(954);
  2686. const withAuthorizationPrefix = __webpack_require__(143);
  2687. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2688. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2689. function authenticationPlugin(octokit, options) {
  2690. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2691. if (options.authStrategy) {
  2692. const auth = options.authStrategy(options.auth);
  2693. octokit.hook.wrap("request", auth.hook);
  2694. octokit.auth = auth;
  2695. return;
  2696. }
  2697. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2698. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2699. if (!options.auth) {
  2700. octokit.auth = () =>
  2701. Promise.resolve({
  2702. type: "unauthenticated"
  2703. });
  2704. return;
  2705. }
  2706. const isBasicAuthString =
  2707. typeof options.auth === "string" &&
  2708. /^basic/.test(withAuthorizationPrefix(options.auth));
  2709. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2710. if (typeof options.auth === "string" && !isBasicAuthString) {
  2711. const auth = createTokenAuth(options.auth);
  2712. octokit.hook.wrap("request", auth.hook);
  2713. octokit.auth = auth;
  2714. return;
  2715. }
  2716. // Otherwise log a deprecation message
  2717. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2718. ? [
  2719. deprecateAuthBasic,
  2720. 'Setting the "new Octokit({ auth })" option to a Basic Auth string is deprecated. Use https://github.com/octokit/auth-basic.js instead. See (https://octokit.github.io/rest.js/#authentication)'
  2721. ]
  2722. : [
  2723. deprecateAuthObject,
  2724. 'Setting the "new Octokit({ auth })" option to an object without also setting the "authStrategy" option is deprecated and will be removed in v17. See (https://octokit.github.io/rest.js/#authentication)'
  2725. ];
  2726. deprecationMethod(
  2727. octokit.log,
  2728. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2729. );
  2730. octokit.auth = () =>
  2731. Promise.resolve({
  2732. type: "deprecated",
  2733. message: deprecationMessapge
  2734. });
  2735. validate(options.auth);
  2736. const state = {
  2737. octokit,
  2738. auth: options.auth
  2739. };
  2740. octokit.hook.before("request", beforeRequest.bind(null, state));
  2741. octokit.hook.error("request", requestError.bind(null, state));
  2742. }
  2743. /***/ }),
  2744. /***/ 197:
  2745. /***/ (function(module, __unusedexports, __webpack_require__) {
  2746. module.exports = isexe
  2747. isexe.sync = sync
  2748. var fs = __webpack_require__(747)
  2749. function isexe (path, options, cb) {
  2750. fs.stat(path, function (er, stat) {
  2751. cb(er, er ? false : checkStat(stat, options))
  2752. })
  2753. }
  2754. function sync (path, options) {
  2755. return checkStat(fs.statSync(path), options)
  2756. }
  2757. function checkStat (stat, options) {
  2758. return stat.isFile() && checkMode(stat, options)
  2759. }
  2760. function checkMode (stat, options) {
  2761. var mod = stat.mode
  2762. var uid = stat.uid
  2763. var gid = stat.gid
  2764. var myUid = options.uid !== undefined ?
  2765. options.uid : process.getuid && process.getuid()
  2766. var myGid = options.gid !== undefined ?
  2767. options.gid : process.getgid && process.getgid()
  2768. var u = parseInt('100', 8)
  2769. var g = parseInt('010', 8)
  2770. var o = parseInt('001', 8)
  2771. var ug = u | g
  2772. var ret = (mod & o) ||
  2773. (mod & g) && gid === myGid ||
  2774. (mod & u) && uid === myUid ||
  2775. (mod & ug) && myUid === 0
  2776. return ret
  2777. }
  2778. /***/ }),
  2779. /***/ 198:
  2780. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2781. "use strict";
  2782. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2783. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2784. return new (P || (P = Promise))(function (resolve, reject) {
  2785. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2786. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2787. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2788. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2789. });
  2790. };
  2791. var __importStar = (this && this.__importStar) || function (mod) {
  2792. if (mod && mod.__esModule) return mod;
  2793. var result = {};
  2794. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2795. result["default"] = mod;
  2796. return result;
  2797. };
  2798. Object.defineProperty(exports, "__esModule", { value: true });
  2799. const core = __importStar(__webpack_require__(470));
  2800. const coreCommand = __importStar(__webpack_require__(431));
  2801. const gitSourceProvider = __importStar(__webpack_require__(293));
  2802. const inputHelper = __importStar(__webpack_require__(821));
  2803. const path = __importStar(__webpack_require__(622));
  2804. const stateHelper = __importStar(__webpack_require__(153));
  2805. function run() {
  2806. return __awaiter(this, void 0, void 0, function* () {
  2807. try {
  2808. const sourceSettings = inputHelper.getInputs();
  2809. try {
  2810. // Register problem matcher
  2811. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2812. // Get sources
  2813. yield gitSourceProvider.getSource(sourceSettings);
  2814. }
  2815. finally {
  2816. // Unregister problem matcher
  2817. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2818. }
  2819. }
  2820. catch (error) {
  2821. core.setFailed(error.message);
  2822. }
  2823. });
  2824. }
  2825. function cleanup() {
  2826. return __awaiter(this, void 0, void 0, function* () {
  2827. try {
  2828. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2829. }
  2830. catch (error) {
  2831. core.warning(error.message);
  2832. }
  2833. });
  2834. }
  2835. // Main
  2836. if (!stateHelper.IsPost) {
  2837. run();
  2838. }
  2839. // Post
  2840. else {
  2841. cleanup();
  2842. }
  2843. /***/ }),
  2844. /***/ 211:
  2845. /***/ (function(module) {
  2846. module.exports = require("https");
  2847. /***/ }),
  2848. /***/ 215:
  2849. /***/ (function(module) {
  2850. module.exports = {"name":"@octokit/rest","version":"16.38.1","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/auth-token":"^2.4.0","@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/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^3.0.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":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^16.0.0","sinon":"^8.0.0","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.38.1.tgz","_integrity":"sha512-zyNFx+/Bd1EXt7LQjfrc6H4wryBQ/oDuZeZhGMBSFr1eMPFDmpEweFQR3R25zjKwBQpDY7L5GQO6A3XSaOfV1w==","_from":"@octokit/rest@16.38.1"};
  2851. /***/ }),
  2852. /***/ 227:
  2853. /***/ (function(__unusedmodule, exports) {
  2854. "use strict";
  2855. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2856. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2857. return new (P || (P = Promise))(function (resolve, reject) {
  2858. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2859. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2860. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2861. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2862. });
  2863. };
  2864. Object.defineProperty(exports, "__esModule", { value: true });
  2865. function getCheckoutInfo(git, ref, commit) {
  2866. return __awaiter(this, void 0, void 0, function* () {
  2867. if (!git) {
  2868. throw new Error('Arg git cannot be empty');
  2869. }
  2870. if (!ref && !commit) {
  2871. throw new Error('Args ref and commit cannot both be empty');
  2872. }
  2873. const result = {};
  2874. const upperRef = (ref || '').toUpperCase();
  2875. // SHA only
  2876. if (!ref) {
  2877. result.ref = commit;
  2878. }
  2879. // refs/heads/
  2880. else if (upperRef.startsWith('REFS/HEADS/')) {
  2881. const branch = ref.substring('refs/heads/'.length);
  2882. result.ref = branch;
  2883. result.startPoint = `refs/remotes/origin/${branch}`;
  2884. }
  2885. // refs/pull/
  2886. else if (upperRef.startsWith('REFS/PULL/')) {
  2887. const branch = ref.substring('refs/pull/'.length);
  2888. result.ref = `refs/remotes/pull/${branch}`;
  2889. }
  2890. // refs/tags/
  2891. else if (upperRef.startsWith('REFS/')) {
  2892. result.ref = ref;
  2893. }
  2894. // Unqualified ref, check for a matching branch or tag
  2895. else {
  2896. if (yield git.branchExists(true, `origin/${ref}`)) {
  2897. result.ref = ref;
  2898. result.startPoint = `refs/remotes/origin/${ref}`;
  2899. }
  2900. else if (yield git.tagExists(`${ref}`)) {
  2901. result.ref = `refs/tags/${ref}`;
  2902. }
  2903. else {
  2904. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2905. }
  2906. }
  2907. return result;
  2908. });
  2909. }
  2910. exports.getCheckoutInfo = getCheckoutInfo;
  2911. function getRefSpec(ref, commit) {
  2912. if (!ref && !commit) {
  2913. throw new Error('Args ref and commit cannot both be empty');
  2914. }
  2915. const upperRef = (ref || '').toUpperCase();
  2916. // SHA
  2917. if (commit) {
  2918. // refs/heads
  2919. if (upperRef.startsWith('REFS/HEADS/')) {
  2920. const branch = ref.substring('refs/heads/'.length);
  2921. return [`+${commit}:refs/remotes/origin/${branch}`];
  2922. }
  2923. // refs/pull/
  2924. else if (upperRef.startsWith('REFS/PULL/')) {
  2925. const branch = ref.substring('refs/pull/'.length);
  2926. return [`+${commit}:refs/remotes/pull/${branch}`];
  2927. }
  2928. // refs/tags/
  2929. else if (upperRef.startsWith('REFS/TAGS/')) {
  2930. return [`+${commit}:${ref}`];
  2931. }
  2932. // Otherwise no destination ref
  2933. else {
  2934. return [commit];
  2935. }
  2936. }
  2937. // Unqualified ref, check for a matching branch or tag
  2938. else if (!upperRef.startsWith('REFS/')) {
  2939. return [
  2940. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2941. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2942. ];
  2943. }
  2944. // refs/heads/
  2945. else if (upperRef.startsWith('REFS/HEADS/')) {
  2946. const branch = ref.substring('refs/heads/'.length);
  2947. return [`+${ref}:refs/remotes/origin/${branch}`];
  2948. }
  2949. // refs/pull/
  2950. else if (upperRef.startsWith('REFS/PULL/')) {
  2951. const branch = ref.substring('refs/pull/'.length);
  2952. return [`+${ref}:refs/remotes/pull/${branch}`];
  2953. }
  2954. // refs/tags/
  2955. else {
  2956. return [`+${ref}:${ref}`];
  2957. }
  2958. }
  2959. exports.getRefSpec = getRefSpec;
  2960. /***/ }),
  2961. /***/ 248:
  2962. /***/ (function(module, __unusedexports, __webpack_require__) {
  2963. module.exports = octokitRegisterEndpoints;
  2964. const registerEndpoints = __webpack_require__(899);
  2965. function octokitRegisterEndpoints(octokit) {
  2966. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2967. }
  2968. /***/ }),
  2969. /***/ 260:
  2970. /***/ (function(module, __unusedexports, __webpack_require__) {
  2971. // Note: since nyc uses this module to output coverage, any lines
  2972. // that are in the direct sync flow of nyc's outputCoverage are
  2973. // ignored, since we can never get coverage for them.
  2974. var assert = __webpack_require__(357)
  2975. var signals = __webpack_require__(654)
  2976. var EE = __webpack_require__(614)
  2977. /* istanbul ignore if */
  2978. if (typeof EE !== 'function') {
  2979. EE = EE.EventEmitter
  2980. }
  2981. var emitter
  2982. if (process.__signal_exit_emitter__) {
  2983. emitter = process.__signal_exit_emitter__
  2984. } else {
  2985. emitter = process.__signal_exit_emitter__ = new EE()
  2986. emitter.count = 0
  2987. emitter.emitted = {}
  2988. }
  2989. // Because this emitter is a global, we have to check to see if a
  2990. // previous version of this library failed to enable infinite listeners.
  2991. // I know what you're about to say. But literally everything about
  2992. // signal-exit is a compromise with evil. Get used to it.
  2993. if (!emitter.infinite) {
  2994. emitter.setMaxListeners(Infinity)
  2995. emitter.infinite = true
  2996. }
  2997. module.exports = function (cb, opts) {
  2998. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2999. if (loaded === false) {
  3000. load()
  3001. }
  3002. var ev = 'exit'
  3003. if (opts && opts.alwaysLast) {
  3004. ev = 'afterexit'
  3005. }
  3006. var remove = function () {
  3007. emitter.removeListener(ev, cb)
  3008. if (emitter.listeners('exit').length === 0 &&
  3009. emitter.listeners('afterexit').length === 0) {
  3010. unload()
  3011. }
  3012. }
  3013. emitter.on(ev, cb)
  3014. return remove
  3015. }
  3016. module.exports.unload = unload
  3017. function unload () {
  3018. if (!loaded) {
  3019. return
  3020. }
  3021. loaded = false
  3022. signals.forEach(function (sig) {
  3023. try {
  3024. process.removeListener(sig, sigListeners[sig])
  3025. } catch (er) {}
  3026. })
  3027. process.emit = originalProcessEmit
  3028. process.reallyExit = originalProcessReallyExit
  3029. emitter.count -= 1
  3030. }
  3031. function emit (event, code, signal) {
  3032. if (emitter.emitted[event]) {
  3033. return
  3034. }
  3035. emitter.emitted[event] = true
  3036. emitter.emit(event, code, signal)
  3037. }
  3038. // { <signal>: <listener fn>, ... }
  3039. var sigListeners = {}
  3040. signals.forEach(function (sig) {
  3041. sigListeners[sig] = function listener () {
  3042. // If there are no other listeners, an exit is coming!
  3043. // Simplest way: remove us and then re-send the signal.
  3044. // We know that this will kill the process, so we can
  3045. // safely emit now.
  3046. var listeners = process.listeners(sig)
  3047. if (listeners.length === emitter.count) {
  3048. unload()
  3049. emit('exit', null, sig)
  3050. /* istanbul ignore next */
  3051. emit('afterexit', null, sig)
  3052. /* istanbul ignore next */
  3053. process.kill(process.pid, sig)
  3054. }
  3055. }
  3056. })
  3057. module.exports.signals = function () {
  3058. return signals
  3059. }
  3060. module.exports.load = load
  3061. var loaded = false
  3062. function load () {
  3063. if (loaded) {
  3064. return
  3065. }
  3066. loaded = true
  3067. // This is the number of onSignalExit's that are in play.
  3068. // It's important so that we can count the correct number of
  3069. // listeners on signals, and don't wait for the other one to
  3070. // handle it instead of us.
  3071. emitter.count += 1
  3072. signals = signals.filter(function (sig) {
  3073. try {
  3074. process.on(sig, sigListeners[sig])
  3075. return true
  3076. } catch (er) {
  3077. return false
  3078. }
  3079. })
  3080. process.emit = processEmit
  3081. process.reallyExit = processReallyExit
  3082. }
  3083. var originalProcessReallyExit = process.reallyExit
  3084. function processReallyExit (code) {
  3085. process.exitCode = code || 0
  3086. emit('exit', process.exitCode, null)
  3087. /* istanbul ignore next */
  3088. emit('afterexit', process.exitCode, null)
  3089. /* istanbul ignore next */
  3090. originalProcessReallyExit.call(process, process.exitCode)
  3091. }
  3092. var originalProcessEmit = process.emit
  3093. function processEmit (ev, arg) {
  3094. if (ev === 'exit') {
  3095. if (arg !== undefined) {
  3096. process.exitCode = arg
  3097. }
  3098. var ret = originalProcessEmit.apply(this, arguments)
  3099. emit('exit', process.exitCode, null)
  3100. /* istanbul ignore next */
  3101. emit('afterexit', process.exitCode, null)
  3102. return ret
  3103. } else {
  3104. return originalProcessEmit.apply(this, arguments)
  3105. }
  3106. }
  3107. /***/ }),
  3108. /***/ 262:
  3109. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3110. "use strict";
  3111. Object.defineProperty(exports, "__esModule", { value: true });
  3112. const fs_1 = __webpack_require__(747);
  3113. const os_1 = __webpack_require__(87);
  3114. class Context {
  3115. /**
  3116. * Hydrate the context from the environment
  3117. */
  3118. constructor() {
  3119. this.payload = {};
  3120. if (process.env.GITHUB_EVENT_PATH) {
  3121. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3122. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3123. }
  3124. else {
  3125. const path = process.env.GITHUB_EVENT_PATH;
  3126. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3127. }
  3128. }
  3129. this.eventName = process.env.GITHUB_EVENT_NAME;
  3130. this.sha = process.env.GITHUB_SHA;
  3131. this.ref = process.env.GITHUB_REF;
  3132. this.workflow = process.env.GITHUB_WORKFLOW;
  3133. this.action = process.env.GITHUB_ACTION;
  3134. this.actor = process.env.GITHUB_ACTOR;
  3135. }
  3136. get issue() {
  3137. const payload = this.payload;
  3138. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3139. }
  3140. get repo() {
  3141. if (process.env.GITHUB_REPOSITORY) {
  3142. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3143. return { owner, repo };
  3144. }
  3145. if (this.payload.repository) {
  3146. return {
  3147. owner: this.payload.repository.owner.login,
  3148. repo: this.payload.repository.name
  3149. };
  3150. }
  3151. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3152. }
  3153. }
  3154. exports.Context = Context;
  3155. //# sourceMappingURL=context.js.map
  3156. /***/ }),
  3157. /***/ 265:
  3158. /***/ (function(module, __unusedexports, __webpack_require__) {
  3159. module.exports = getPage
  3160. const deprecate = __webpack_require__(370)
  3161. const getPageLinks = __webpack_require__(577)
  3162. const HttpError = __webpack_require__(297)
  3163. function getPage (octokit, link, which, headers) {
  3164. deprecate(`octokit.get${which.charAt(0).toUpperCase() + which.slice(1)}Page() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  3165. const url = getPageLinks(link)[which]
  3166. if (!url) {
  3167. const urlError = new HttpError(`No ${which} page found`, 404)
  3168. return Promise.reject(urlError)
  3169. }
  3170. const requestOptions = {
  3171. url,
  3172. headers: applyAcceptHeader(link, headers)
  3173. }
  3174. const promise = octokit.request(requestOptions)
  3175. return promise
  3176. }
  3177. function applyAcceptHeader (res, headers) {
  3178. const previous = res.headers && res.headers['x-github-media-type']
  3179. if (!previous || (headers && headers.accept)) {
  3180. return headers
  3181. }
  3182. headers = headers || {}
  3183. headers.accept = 'application/vnd.' + previous
  3184. .replace('; param=', '.')
  3185. .replace('; format=', '+')
  3186. return headers
  3187. }
  3188. /***/ }),
  3189. /***/ 280:
  3190. /***/ (function(module, exports) {
  3191. exports = module.exports = SemVer
  3192. var debug
  3193. /* istanbul ignore next */
  3194. if (typeof process === 'object' &&
  3195. process.env &&
  3196. process.env.NODE_DEBUG &&
  3197. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3198. debug = function () {
  3199. var args = Array.prototype.slice.call(arguments, 0)
  3200. args.unshift('SEMVER')
  3201. console.log.apply(console, args)
  3202. }
  3203. } else {
  3204. debug = function () {}
  3205. }
  3206. // Note: this is the semver.org version of the spec that it implements
  3207. // Not necessarily the package version of this code.
  3208. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3209. var MAX_LENGTH = 256
  3210. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3211. /* istanbul ignore next */ 9007199254740991
  3212. // Max safe segment length for coercion.
  3213. var MAX_SAFE_COMPONENT_LENGTH = 16
  3214. // The actual regexps go on exports.re
  3215. var re = exports.re = []
  3216. var src = exports.src = []
  3217. var R = 0
  3218. // The following Regular Expressions can be used for tokenizing,
  3219. // validating, and parsing SemVer version strings.
  3220. // ## Numeric Identifier
  3221. // A single `0`, or a non-zero digit followed by zero or more digits.
  3222. var NUMERICIDENTIFIER = R++
  3223. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3224. var NUMERICIDENTIFIERLOOSE = R++
  3225. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3226. // ## Non-numeric Identifier
  3227. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3228. // more letters, digits, or hyphens.
  3229. var NONNUMERICIDENTIFIER = R++
  3230. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3231. // ## Main Version
  3232. // Three dot-separated numeric identifiers.
  3233. var MAINVERSION = R++
  3234. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3235. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3236. '(' + src[NUMERICIDENTIFIER] + ')'
  3237. var MAINVERSIONLOOSE = R++
  3238. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3239. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3240. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3241. // ## Pre-release Version Identifier
  3242. // A numeric identifier, or a non-numeric identifier.
  3243. var PRERELEASEIDENTIFIER = R++
  3244. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3245. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3246. var PRERELEASEIDENTIFIERLOOSE = R++
  3247. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3248. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3249. // ## Pre-release Version
  3250. // Hyphen, followed by one or more dot-separated pre-release version
  3251. // identifiers.
  3252. var PRERELEASE = R++
  3253. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3254. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3255. var PRERELEASELOOSE = R++
  3256. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3257. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3258. // ## Build Metadata Identifier
  3259. // Any combination of digits, letters, or hyphens.
  3260. var BUILDIDENTIFIER = R++
  3261. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3262. // ## Build Metadata
  3263. // Plus sign, followed by one or more period-separated build metadata
  3264. // identifiers.
  3265. var BUILD = R++
  3266. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3267. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3268. // ## Full Version String
  3269. // A main version, followed optionally by a pre-release version and
  3270. // build metadata.
  3271. // Note that the only major, minor, patch, and pre-release sections of
  3272. // the version string are capturing groups. The build metadata is not a
  3273. // capturing group, because it should not ever be used in version
  3274. // comparison.
  3275. var FULL = R++
  3276. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3277. src[PRERELEASE] + '?' +
  3278. src[BUILD] + '?'
  3279. src[FULL] = '^' + FULLPLAIN + '$'
  3280. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3281. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3282. // common in the npm registry.
  3283. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3284. src[PRERELEASELOOSE] + '?' +
  3285. src[BUILD] + '?'
  3286. var LOOSE = R++
  3287. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3288. var GTLT = R++
  3289. src[GTLT] = '((?:<|>)?=?)'
  3290. // Something like "2.*" or "1.2.x".
  3291. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3292. // Only the first item is strictly required.
  3293. var XRANGEIDENTIFIERLOOSE = R++
  3294. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3295. var XRANGEIDENTIFIER = R++
  3296. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3297. var XRANGEPLAIN = R++
  3298. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3299. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3300. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3301. '(?:' + src[PRERELEASE] + ')?' +
  3302. src[BUILD] + '?' +
  3303. ')?)?'
  3304. var XRANGEPLAINLOOSE = R++
  3305. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3306. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3307. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3308. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3309. src[BUILD] + '?' +
  3310. ')?)?'
  3311. var XRANGE = R++
  3312. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3313. var XRANGELOOSE = R++
  3314. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3315. // Coercion.
  3316. // Extract anything that could conceivably be a part of a valid semver
  3317. var COERCE = R++
  3318. src[COERCE] = '(?:^|[^\\d])' +
  3319. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3320. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3321. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3322. '(?:$|[^\\d])'
  3323. // Tilde ranges.
  3324. // Meaning is "reasonably at or greater than"
  3325. var LONETILDE = R++
  3326. src[LONETILDE] = '(?:~>?)'
  3327. var TILDETRIM = R++
  3328. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3329. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3330. var tildeTrimReplace = '$1~'
  3331. var TILDE = R++
  3332. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3333. var TILDELOOSE = R++
  3334. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3335. // Caret ranges.
  3336. // Meaning is "at least and backwards compatible with"
  3337. var LONECARET = R++
  3338. src[LONECARET] = '(?:\\^)'
  3339. var CARETTRIM = R++
  3340. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3341. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3342. var caretTrimReplace = '$1^'
  3343. var CARET = R++
  3344. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3345. var CARETLOOSE = R++
  3346. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3347. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3348. var COMPARATORLOOSE = R++
  3349. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3350. var COMPARATOR = R++
  3351. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3352. // An expression to strip any whitespace between the gtlt and the thing
  3353. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3354. var COMPARATORTRIM = R++
  3355. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3356. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3357. // this one has to use the /g flag
  3358. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3359. var comparatorTrimReplace = '$1$2$3'
  3360. // Something like `1.2.3 - 1.2.4`
  3361. // Note that these all use the loose form, because they'll be
  3362. // checked against either the strict or loose comparator form
  3363. // later.
  3364. var HYPHENRANGE = R++
  3365. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3366. '\\s+-\\s+' +
  3367. '(' + src[XRANGEPLAIN] + ')' +
  3368. '\\s*$'
  3369. var HYPHENRANGELOOSE = R++
  3370. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3371. '\\s+-\\s+' +
  3372. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3373. '\\s*$'
  3374. // Star ranges basically just allow anything at all.
  3375. var STAR = R++
  3376. src[STAR] = '(<|>)?=?\\s*\\*'
  3377. // Compile to actual regexp objects.
  3378. // All are flag-free, unless they were created above with a flag.
  3379. for (var i = 0; i < R; i++) {
  3380. debug(i, src[i])
  3381. if (!re[i]) {
  3382. re[i] = new RegExp(src[i])
  3383. }
  3384. }
  3385. exports.parse = parse
  3386. function parse (version, options) {
  3387. if (!options || typeof options !== 'object') {
  3388. options = {
  3389. loose: !!options,
  3390. includePrerelease: false
  3391. }
  3392. }
  3393. if (version instanceof SemVer) {
  3394. return version
  3395. }
  3396. if (typeof version !== 'string') {
  3397. return null
  3398. }
  3399. if (version.length > MAX_LENGTH) {
  3400. return null
  3401. }
  3402. var r = options.loose ? re[LOOSE] : re[FULL]
  3403. if (!r.test(version)) {
  3404. return null
  3405. }
  3406. try {
  3407. return new SemVer(version, options)
  3408. } catch (er) {
  3409. return null
  3410. }
  3411. }
  3412. exports.valid = valid
  3413. function valid (version, options) {
  3414. var v = parse(version, options)
  3415. return v ? v.version : null
  3416. }
  3417. exports.clean = clean
  3418. function clean (version, options) {
  3419. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3420. return s ? s.version : null
  3421. }
  3422. exports.SemVer = SemVer
  3423. function SemVer (version, options) {
  3424. if (!options || typeof options !== 'object') {
  3425. options = {
  3426. loose: !!options,
  3427. includePrerelease: false
  3428. }
  3429. }
  3430. if (version instanceof SemVer) {
  3431. if (version.loose === options.loose) {
  3432. return version
  3433. } else {
  3434. version = version.version
  3435. }
  3436. } else if (typeof version !== 'string') {
  3437. throw new TypeError('Invalid Version: ' + version)
  3438. }
  3439. if (version.length > MAX_LENGTH) {
  3440. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3441. }
  3442. if (!(this instanceof SemVer)) {
  3443. return new SemVer(version, options)
  3444. }
  3445. debug('SemVer', version, options)
  3446. this.options = options
  3447. this.loose = !!options.loose
  3448. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3449. if (!m) {
  3450. throw new TypeError('Invalid Version: ' + version)
  3451. }
  3452. this.raw = version
  3453. // these are actually numbers
  3454. this.major = +m[1]
  3455. this.minor = +m[2]
  3456. this.patch = +m[3]
  3457. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3458. throw new TypeError('Invalid major version')
  3459. }
  3460. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3461. throw new TypeError('Invalid minor version')
  3462. }
  3463. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3464. throw new TypeError('Invalid patch version')
  3465. }
  3466. // numberify any prerelease numeric ids
  3467. if (!m[4]) {
  3468. this.prerelease = []
  3469. } else {
  3470. this.prerelease = m[4].split('.').map(function (id) {
  3471. if (/^[0-9]+$/.test(id)) {
  3472. var num = +id
  3473. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3474. return num
  3475. }
  3476. }
  3477. return id
  3478. })
  3479. }
  3480. this.build = m[5] ? m[5].split('.') : []
  3481. this.format()
  3482. }
  3483. SemVer.prototype.format = function () {
  3484. this.version = this.major + '.' + this.minor + '.' + this.patch
  3485. if (this.prerelease.length) {
  3486. this.version += '-' + this.prerelease.join('.')
  3487. }
  3488. return this.version
  3489. }
  3490. SemVer.prototype.toString = function () {
  3491. return this.version
  3492. }
  3493. SemVer.prototype.compare = function (other) {
  3494. debug('SemVer.compare', this.version, this.options, other)
  3495. if (!(other instanceof SemVer)) {
  3496. other = new SemVer(other, this.options)
  3497. }
  3498. return this.compareMain(other) || this.comparePre(other)
  3499. }
  3500. SemVer.prototype.compareMain = function (other) {
  3501. if (!(other instanceof SemVer)) {
  3502. other = new SemVer(other, this.options)
  3503. }
  3504. return compareIdentifiers(this.major, other.major) ||
  3505. compareIdentifiers(this.minor, other.minor) ||
  3506. compareIdentifiers(this.patch, other.patch)
  3507. }
  3508. SemVer.prototype.comparePre = function (other) {
  3509. if (!(other instanceof SemVer)) {
  3510. other = new SemVer(other, this.options)
  3511. }
  3512. // NOT having a prerelease is > having one
  3513. if (this.prerelease.length && !other.prerelease.length) {
  3514. return -1
  3515. } else if (!this.prerelease.length && other.prerelease.length) {
  3516. return 1
  3517. } else if (!this.prerelease.length && !other.prerelease.length) {
  3518. return 0
  3519. }
  3520. var i = 0
  3521. do {
  3522. var a = this.prerelease[i]
  3523. var b = other.prerelease[i]
  3524. debug('prerelease compare', i, a, b)
  3525. if (a === undefined && b === undefined) {
  3526. return 0
  3527. } else if (b === undefined) {
  3528. return 1
  3529. } else if (a === undefined) {
  3530. return -1
  3531. } else if (a === b) {
  3532. continue
  3533. } else {
  3534. return compareIdentifiers(a, b)
  3535. }
  3536. } while (++i)
  3537. }
  3538. // preminor will bump the version up to the next minor release, and immediately
  3539. // down to pre-release. premajor and prepatch work the same way.
  3540. SemVer.prototype.inc = function (release, identifier) {
  3541. switch (release) {
  3542. case 'premajor':
  3543. this.prerelease.length = 0
  3544. this.patch = 0
  3545. this.minor = 0
  3546. this.major++
  3547. this.inc('pre', identifier)
  3548. break
  3549. case 'preminor':
  3550. this.prerelease.length = 0
  3551. this.patch = 0
  3552. this.minor++
  3553. this.inc('pre', identifier)
  3554. break
  3555. case 'prepatch':
  3556. // If this is already a prerelease, it will bump to the next version
  3557. // drop any prereleases that might already exist, since they are not
  3558. // relevant at this point.
  3559. this.prerelease.length = 0
  3560. this.inc('patch', identifier)
  3561. this.inc('pre', identifier)
  3562. break
  3563. // If the input is a non-prerelease version, this acts the same as
  3564. // prepatch.
  3565. case 'prerelease':
  3566. if (this.prerelease.length === 0) {
  3567. this.inc('patch', identifier)
  3568. }
  3569. this.inc('pre', identifier)
  3570. break
  3571. case 'major':
  3572. // If this is a pre-major version, bump up to the same major version.
  3573. // Otherwise increment major.
  3574. // 1.0.0-5 bumps to 1.0.0
  3575. // 1.1.0 bumps to 2.0.0
  3576. if (this.minor !== 0 ||
  3577. this.patch !== 0 ||
  3578. this.prerelease.length === 0) {
  3579. this.major++
  3580. }
  3581. this.minor = 0
  3582. this.patch = 0
  3583. this.prerelease = []
  3584. break
  3585. case 'minor':
  3586. // If this is a pre-minor version, bump up to the same minor version.
  3587. // Otherwise increment minor.
  3588. // 1.2.0-5 bumps to 1.2.0
  3589. // 1.2.1 bumps to 1.3.0
  3590. if (this.patch !== 0 || this.prerelease.length === 0) {
  3591. this.minor++
  3592. }
  3593. this.patch = 0
  3594. this.prerelease = []
  3595. break
  3596. case 'patch':
  3597. // If this is not a pre-release version, it will increment the patch.
  3598. // If it is a pre-release it will bump up to the same patch version.
  3599. // 1.2.0-5 patches to 1.2.0
  3600. // 1.2.0 patches to 1.2.1
  3601. if (this.prerelease.length === 0) {
  3602. this.patch++
  3603. }
  3604. this.prerelease = []
  3605. break
  3606. // This probably shouldn't be used publicly.
  3607. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3608. case 'pre':
  3609. if (this.prerelease.length === 0) {
  3610. this.prerelease = [0]
  3611. } else {
  3612. var i = this.prerelease.length
  3613. while (--i >= 0) {
  3614. if (typeof this.prerelease[i] === 'number') {
  3615. this.prerelease[i]++
  3616. i = -2
  3617. }
  3618. }
  3619. if (i === -1) {
  3620. // didn't increment anything
  3621. this.prerelease.push(0)
  3622. }
  3623. }
  3624. if (identifier) {
  3625. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3626. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3627. if (this.prerelease[0] === identifier) {
  3628. if (isNaN(this.prerelease[1])) {
  3629. this.prerelease = [identifier, 0]
  3630. }
  3631. } else {
  3632. this.prerelease = [identifier, 0]
  3633. }
  3634. }
  3635. break
  3636. default:
  3637. throw new Error('invalid increment argument: ' + release)
  3638. }
  3639. this.format()
  3640. this.raw = this.version
  3641. return this
  3642. }
  3643. exports.inc = inc
  3644. function inc (version, release, loose, identifier) {
  3645. if (typeof (loose) === 'string') {
  3646. identifier = loose
  3647. loose = undefined
  3648. }
  3649. try {
  3650. return new SemVer(version, loose).inc(release, identifier).version
  3651. } catch (er) {
  3652. return null
  3653. }
  3654. }
  3655. exports.diff = diff
  3656. function diff (version1, version2) {
  3657. if (eq(version1, version2)) {
  3658. return null
  3659. } else {
  3660. var v1 = parse(version1)
  3661. var v2 = parse(version2)
  3662. var prefix = ''
  3663. if (v1.prerelease.length || v2.prerelease.length) {
  3664. prefix = 'pre'
  3665. var defaultResult = 'prerelease'
  3666. }
  3667. for (var key in v1) {
  3668. if (key === 'major' || key === 'minor' || key === 'patch') {
  3669. if (v1[key] !== v2[key]) {
  3670. return prefix + key
  3671. }
  3672. }
  3673. }
  3674. return defaultResult // may be undefined
  3675. }
  3676. }
  3677. exports.compareIdentifiers = compareIdentifiers
  3678. var numeric = /^[0-9]+$/
  3679. function compareIdentifiers (a, b) {
  3680. var anum = numeric.test(a)
  3681. var bnum = numeric.test(b)
  3682. if (anum && bnum) {
  3683. a = +a
  3684. b = +b
  3685. }
  3686. return a === b ? 0
  3687. : (anum && !bnum) ? -1
  3688. : (bnum && !anum) ? 1
  3689. : a < b ? -1
  3690. : 1
  3691. }
  3692. exports.rcompareIdentifiers = rcompareIdentifiers
  3693. function rcompareIdentifiers (a, b) {
  3694. return compareIdentifiers(b, a)
  3695. }
  3696. exports.major = major
  3697. function major (a, loose) {
  3698. return new SemVer(a, loose).major
  3699. }
  3700. exports.minor = minor
  3701. function minor (a, loose) {
  3702. return new SemVer(a, loose).minor
  3703. }
  3704. exports.patch = patch
  3705. function patch (a, loose) {
  3706. return new SemVer(a, loose).patch
  3707. }
  3708. exports.compare = compare
  3709. function compare (a, b, loose) {
  3710. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3711. }
  3712. exports.compareLoose = compareLoose
  3713. function compareLoose (a, b) {
  3714. return compare(a, b, true)
  3715. }
  3716. exports.rcompare = rcompare
  3717. function rcompare (a, b, loose) {
  3718. return compare(b, a, loose)
  3719. }
  3720. exports.sort = sort
  3721. function sort (list, loose) {
  3722. return list.sort(function (a, b) {
  3723. return exports.compare(a, b, loose)
  3724. })
  3725. }
  3726. exports.rsort = rsort
  3727. function rsort (list, loose) {
  3728. return list.sort(function (a, b) {
  3729. return exports.rcompare(a, b, loose)
  3730. })
  3731. }
  3732. exports.gt = gt
  3733. function gt (a, b, loose) {
  3734. return compare(a, b, loose) > 0
  3735. }
  3736. exports.lt = lt
  3737. function lt (a, b, loose) {
  3738. return compare(a, b, loose) < 0
  3739. }
  3740. exports.eq = eq
  3741. function eq (a, b, loose) {
  3742. return compare(a, b, loose) === 0
  3743. }
  3744. exports.neq = neq
  3745. function neq (a, b, loose) {
  3746. return compare(a, b, loose) !== 0
  3747. }
  3748. exports.gte = gte
  3749. function gte (a, b, loose) {
  3750. return compare(a, b, loose) >= 0
  3751. }
  3752. exports.lte = lte
  3753. function lte (a, b, loose) {
  3754. return compare(a, b, loose) <= 0
  3755. }
  3756. exports.cmp = cmp
  3757. function cmp (a, op, b, loose) {
  3758. switch (op) {
  3759. case '===':
  3760. if (typeof a === 'object')
  3761. a = a.version
  3762. if (typeof b === 'object')
  3763. b = b.version
  3764. return a === b
  3765. case '!==':
  3766. if (typeof a === 'object')
  3767. a = a.version
  3768. if (typeof b === 'object')
  3769. b = b.version
  3770. return a !== b
  3771. case '':
  3772. case '=':
  3773. case '==':
  3774. return eq(a, b, loose)
  3775. case '!=':
  3776. return neq(a, b, loose)
  3777. case '>':
  3778. return gt(a, b, loose)
  3779. case '>=':
  3780. return gte(a, b, loose)
  3781. case '<':
  3782. return lt(a, b, loose)
  3783. case '<=':
  3784. return lte(a, b, loose)
  3785. default:
  3786. throw new TypeError('Invalid operator: ' + op)
  3787. }
  3788. }
  3789. exports.Comparator = Comparator
  3790. function Comparator (comp, options) {
  3791. if (!options || typeof options !== 'object') {
  3792. options = {
  3793. loose: !!options,
  3794. includePrerelease: false
  3795. }
  3796. }
  3797. if (comp instanceof Comparator) {
  3798. if (comp.loose === !!options.loose) {
  3799. return comp
  3800. } else {
  3801. comp = comp.value
  3802. }
  3803. }
  3804. if (!(this instanceof Comparator)) {
  3805. return new Comparator(comp, options)
  3806. }
  3807. debug('comparator', comp, options)
  3808. this.options = options
  3809. this.loose = !!options.loose
  3810. this.parse(comp)
  3811. if (this.semver === ANY) {
  3812. this.value = ''
  3813. } else {
  3814. this.value = this.operator + this.semver.version
  3815. }
  3816. debug('comp', this)
  3817. }
  3818. var ANY = {}
  3819. Comparator.prototype.parse = function (comp) {
  3820. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3821. var m = comp.match(r)
  3822. if (!m) {
  3823. throw new TypeError('Invalid comparator: ' + comp)
  3824. }
  3825. this.operator = m[1]
  3826. if (this.operator === '=') {
  3827. this.operator = ''
  3828. }
  3829. // if it literally is just '>' or '' then allow anything.
  3830. if (!m[2]) {
  3831. this.semver = ANY
  3832. } else {
  3833. this.semver = new SemVer(m[2], this.options.loose)
  3834. }
  3835. }
  3836. Comparator.prototype.toString = function () {
  3837. return this.value
  3838. }
  3839. Comparator.prototype.test = function (version) {
  3840. debug('Comparator.test', version, this.options.loose)
  3841. if (this.semver === ANY) {
  3842. return true
  3843. }
  3844. if (typeof version === 'string') {
  3845. version = new SemVer(version, this.options)
  3846. }
  3847. return cmp(version, this.operator, this.semver, this.options)
  3848. }
  3849. Comparator.prototype.intersects = function (comp, options) {
  3850. if (!(comp instanceof Comparator)) {
  3851. throw new TypeError('a Comparator is required')
  3852. }
  3853. if (!options || typeof options !== 'object') {
  3854. options = {
  3855. loose: !!options,
  3856. includePrerelease: false
  3857. }
  3858. }
  3859. var rangeTmp
  3860. if (this.operator === '') {
  3861. rangeTmp = new Range(comp.value, options)
  3862. return satisfies(this.value, rangeTmp, options)
  3863. } else if (comp.operator === '') {
  3864. rangeTmp = new Range(this.value, options)
  3865. return satisfies(comp.semver, rangeTmp, options)
  3866. }
  3867. var sameDirectionIncreasing =
  3868. (this.operator === '>=' || this.operator === '>') &&
  3869. (comp.operator === '>=' || comp.operator === '>')
  3870. var sameDirectionDecreasing =
  3871. (this.operator === '<=' || this.operator === '<') &&
  3872. (comp.operator === '<=' || comp.operator === '<')
  3873. var sameSemVer = this.semver.version === comp.semver.version
  3874. var differentDirectionsInclusive =
  3875. (this.operator === '>=' || this.operator === '<=') &&
  3876. (comp.operator === '>=' || comp.operator === '<=')
  3877. var oppositeDirectionsLessThan =
  3878. cmp(this.semver, '<', comp.semver, options) &&
  3879. ((this.operator === '>=' || this.operator === '>') &&
  3880. (comp.operator === '<=' || comp.operator === '<'))
  3881. var oppositeDirectionsGreaterThan =
  3882. cmp(this.semver, '>', comp.semver, options) &&
  3883. ((this.operator === '<=' || this.operator === '<') &&
  3884. (comp.operator === '>=' || comp.operator === '>'))
  3885. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3886. (sameSemVer && differentDirectionsInclusive) ||
  3887. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3888. }
  3889. exports.Range = Range
  3890. function Range (range, options) {
  3891. if (!options || typeof options !== 'object') {
  3892. options = {
  3893. loose: !!options,
  3894. includePrerelease: false
  3895. }
  3896. }
  3897. if (range instanceof Range) {
  3898. if (range.loose === !!options.loose &&
  3899. range.includePrerelease === !!options.includePrerelease) {
  3900. return range
  3901. } else {
  3902. return new Range(range.raw, options)
  3903. }
  3904. }
  3905. if (range instanceof Comparator) {
  3906. return new Range(range.value, options)
  3907. }
  3908. if (!(this instanceof Range)) {
  3909. return new Range(range, options)
  3910. }
  3911. this.options = options
  3912. this.loose = !!options.loose
  3913. this.includePrerelease = !!options.includePrerelease
  3914. // First, split based on boolean or ||
  3915. this.raw = range
  3916. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3917. return this.parseRange(range.trim())
  3918. }, this).filter(function (c) {
  3919. // throw out any that are not relevant for whatever reason
  3920. return c.length
  3921. })
  3922. if (!this.set.length) {
  3923. throw new TypeError('Invalid SemVer Range: ' + range)
  3924. }
  3925. this.format()
  3926. }
  3927. Range.prototype.format = function () {
  3928. this.range = this.set.map(function (comps) {
  3929. return comps.join(' ').trim()
  3930. }).join('||').trim()
  3931. return this.range
  3932. }
  3933. Range.prototype.toString = function () {
  3934. return this.range
  3935. }
  3936. Range.prototype.parseRange = function (range) {
  3937. var loose = this.options.loose
  3938. range = range.trim()
  3939. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3940. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3941. range = range.replace(hr, hyphenReplace)
  3942. debug('hyphen replace', range)
  3943. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3944. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3945. debug('comparator trim', range, re[COMPARATORTRIM])
  3946. // `~ 1.2.3` => `~1.2.3`
  3947. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3948. // `^ 1.2.3` => `^1.2.3`
  3949. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3950. // normalize spaces
  3951. range = range.split(/\s+/).join(' ')
  3952. // At this point, the range is completely trimmed and
  3953. // ready to be split into comparators.
  3954. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3955. var set = range.split(' ').map(function (comp) {
  3956. return parseComparator(comp, this.options)
  3957. }, this).join(' ').split(/\s+/)
  3958. if (this.options.loose) {
  3959. // in loose mode, throw out any that are not valid comparators
  3960. set = set.filter(function (comp) {
  3961. return !!comp.match(compRe)
  3962. })
  3963. }
  3964. set = set.map(function (comp) {
  3965. return new Comparator(comp, this.options)
  3966. }, this)
  3967. return set
  3968. }
  3969. Range.prototype.intersects = function (range, options) {
  3970. if (!(range instanceof Range)) {
  3971. throw new TypeError('a Range is required')
  3972. }
  3973. return this.set.some(function (thisComparators) {
  3974. return thisComparators.every(function (thisComparator) {
  3975. return range.set.some(function (rangeComparators) {
  3976. return rangeComparators.every(function (rangeComparator) {
  3977. return thisComparator.intersects(rangeComparator, options)
  3978. })
  3979. })
  3980. })
  3981. })
  3982. }
  3983. // Mostly just for testing and legacy API reasons
  3984. exports.toComparators = toComparators
  3985. function toComparators (range, options) {
  3986. return new Range(range, options).set.map(function (comp) {
  3987. return comp.map(function (c) {
  3988. return c.value
  3989. }).join(' ').trim().split(' ')
  3990. })
  3991. }
  3992. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3993. // already replaced the hyphen ranges
  3994. // turn into a set of JUST comparators.
  3995. function parseComparator (comp, options) {
  3996. debug('comp', comp, options)
  3997. comp = replaceCarets(comp, options)
  3998. debug('caret', comp)
  3999. comp = replaceTildes(comp, options)
  4000. debug('tildes', comp)
  4001. comp = replaceXRanges(comp, options)
  4002. debug('xrange', comp)
  4003. comp = replaceStars(comp, options)
  4004. debug('stars', comp)
  4005. return comp
  4006. }
  4007. function isX (id) {
  4008. return !id || id.toLowerCase() === 'x' || id === '*'
  4009. }
  4010. // ~, ~> --> * (any, kinda silly)
  4011. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  4012. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  4013. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  4014. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  4015. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  4016. function replaceTildes (comp, options) {
  4017. return comp.trim().split(/\s+/).map(function (comp) {
  4018. return replaceTilde(comp, options)
  4019. }).join(' ')
  4020. }
  4021. function replaceTilde (comp, options) {
  4022. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  4023. return comp.replace(r, function (_, M, m, p, pr) {
  4024. debug('tilde', comp, _, M, m, p, pr)
  4025. var ret
  4026. if (isX(M)) {
  4027. ret = ''
  4028. } else if (isX(m)) {
  4029. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4030. } else if (isX(p)) {
  4031. // ~1.2 == >=1.2.0 <1.3.0
  4032. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4033. } else if (pr) {
  4034. debug('replaceTilde pr', pr)
  4035. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4036. ' <' + M + '.' + (+m + 1) + '.0'
  4037. } else {
  4038. // ~1.2.3 == >=1.2.3 <1.3.0
  4039. ret = '>=' + M + '.' + m + '.' + p +
  4040. ' <' + M + '.' + (+m + 1) + '.0'
  4041. }
  4042. debug('tilde return', ret)
  4043. return ret
  4044. })
  4045. }
  4046. // ^ --> * (any, kinda silly)
  4047. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4048. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4049. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4050. // ^1.2.3 --> >=1.2.3 <2.0.0
  4051. // ^1.2.0 --> >=1.2.0 <2.0.0
  4052. function replaceCarets (comp, options) {
  4053. return comp.trim().split(/\s+/).map(function (comp) {
  4054. return replaceCaret(comp, options)
  4055. }).join(' ')
  4056. }
  4057. function replaceCaret (comp, options) {
  4058. debug('caret', comp, options)
  4059. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4060. return comp.replace(r, function (_, M, m, p, pr) {
  4061. debug('caret', comp, _, M, m, p, pr)
  4062. var ret
  4063. if (isX(M)) {
  4064. ret = ''
  4065. } else if (isX(m)) {
  4066. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4067. } else if (isX(p)) {
  4068. if (M === '0') {
  4069. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4070. } else {
  4071. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4072. }
  4073. } else if (pr) {
  4074. debug('replaceCaret pr', pr)
  4075. if (M === '0') {
  4076. if (m === '0') {
  4077. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4078. ' <' + M + '.' + m + '.' + (+p + 1)
  4079. } else {
  4080. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4081. ' <' + M + '.' + (+m + 1) + '.0'
  4082. }
  4083. } else {
  4084. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4085. ' <' + (+M + 1) + '.0.0'
  4086. }
  4087. } else {
  4088. debug('no pr')
  4089. if (M === '0') {
  4090. if (m === '0') {
  4091. ret = '>=' + M + '.' + m + '.' + p +
  4092. ' <' + M + '.' + m + '.' + (+p + 1)
  4093. } else {
  4094. ret = '>=' + M + '.' + m + '.' + p +
  4095. ' <' + M + '.' + (+m + 1) + '.0'
  4096. }
  4097. } else {
  4098. ret = '>=' + M + '.' + m + '.' + p +
  4099. ' <' + (+M + 1) + '.0.0'
  4100. }
  4101. }
  4102. debug('caret return', ret)
  4103. return ret
  4104. })
  4105. }
  4106. function replaceXRanges (comp, options) {
  4107. debug('replaceXRanges', comp, options)
  4108. return comp.split(/\s+/).map(function (comp) {
  4109. return replaceXRange(comp, options)
  4110. }).join(' ')
  4111. }
  4112. function replaceXRange (comp, options) {
  4113. comp = comp.trim()
  4114. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4115. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4116. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4117. var xM = isX(M)
  4118. var xm = xM || isX(m)
  4119. var xp = xm || isX(p)
  4120. var anyX = xp
  4121. if (gtlt === '=' && anyX) {
  4122. gtlt = ''
  4123. }
  4124. if (xM) {
  4125. if (gtlt === '>' || gtlt === '<') {
  4126. // nothing is allowed
  4127. ret = '<0.0.0'
  4128. } else {
  4129. // nothing is forbidden
  4130. ret = '*'
  4131. }
  4132. } else if (gtlt && anyX) {
  4133. // we know patch is an x, because we have any x at all.
  4134. // replace X with 0
  4135. if (xm) {
  4136. m = 0
  4137. }
  4138. p = 0
  4139. if (gtlt === '>') {
  4140. // >1 => >=2.0.0
  4141. // >1.2 => >=1.3.0
  4142. // >1.2.3 => >= 1.2.4
  4143. gtlt = '>='
  4144. if (xm) {
  4145. M = +M + 1
  4146. m = 0
  4147. p = 0
  4148. } else {
  4149. m = +m + 1
  4150. p = 0
  4151. }
  4152. } else if (gtlt === '<=') {
  4153. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4154. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4155. gtlt = '<'
  4156. if (xm) {
  4157. M = +M + 1
  4158. } else {
  4159. m = +m + 1
  4160. }
  4161. }
  4162. ret = gtlt + M + '.' + m + '.' + p
  4163. } else if (xm) {
  4164. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4165. } else if (xp) {
  4166. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4167. }
  4168. debug('xRange return', ret)
  4169. return ret
  4170. })
  4171. }
  4172. // Because * is AND-ed with everything else in the comparator,
  4173. // and '' means "any version", just remove the *s entirely.
  4174. function replaceStars (comp, options) {
  4175. debug('replaceStars', comp, options)
  4176. // Looseness is ignored here. star is always as loose as it gets!
  4177. return comp.trim().replace(re[STAR], '')
  4178. }
  4179. // This function is passed to string.replace(re[HYPHENRANGE])
  4180. // M, m, patch, prerelease, build
  4181. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4182. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4183. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4184. function hyphenReplace ($0,
  4185. from, fM, fm, fp, fpr, fb,
  4186. to, tM, tm, tp, tpr, tb) {
  4187. if (isX(fM)) {
  4188. from = ''
  4189. } else if (isX(fm)) {
  4190. from = '>=' + fM + '.0.0'
  4191. } else if (isX(fp)) {
  4192. from = '>=' + fM + '.' + fm + '.0'
  4193. } else {
  4194. from = '>=' + from
  4195. }
  4196. if (isX(tM)) {
  4197. to = ''
  4198. } else if (isX(tm)) {
  4199. to = '<' + (+tM + 1) + '.0.0'
  4200. } else if (isX(tp)) {
  4201. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4202. } else if (tpr) {
  4203. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4204. } else {
  4205. to = '<=' + to
  4206. }
  4207. return (from + ' ' + to).trim()
  4208. }
  4209. // if ANY of the sets match ALL of its comparators, then pass
  4210. Range.prototype.test = function (version) {
  4211. if (!version) {
  4212. return false
  4213. }
  4214. if (typeof version === 'string') {
  4215. version = new SemVer(version, this.options)
  4216. }
  4217. for (var i = 0; i < this.set.length; i++) {
  4218. if (testSet(this.set[i], version, this.options)) {
  4219. return true
  4220. }
  4221. }
  4222. return false
  4223. }
  4224. function testSet (set, version, options) {
  4225. for (var i = 0; i < set.length; i++) {
  4226. if (!set[i].test(version)) {
  4227. return false
  4228. }
  4229. }
  4230. if (version.prerelease.length && !options.includePrerelease) {
  4231. // Find the set of versions that are allowed to have prereleases
  4232. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4233. // That should allow `1.2.3-pr.2` to pass.
  4234. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4235. // even though it's within the range set by the comparators.
  4236. for (i = 0; i < set.length; i++) {
  4237. debug(set[i].semver)
  4238. if (set[i].semver === ANY) {
  4239. continue
  4240. }
  4241. if (set[i].semver.prerelease.length > 0) {
  4242. var allowed = set[i].semver
  4243. if (allowed.major === version.major &&
  4244. allowed.minor === version.minor &&
  4245. allowed.patch === version.patch) {
  4246. return true
  4247. }
  4248. }
  4249. }
  4250. // Version has a -pre, but it's not one of the ones we like.
  4251. return false
  4252. }
  4253. return true
  4254. }
  4255. exports.satisfies = satisfies
  4256. function satisfies (version, range, options) {
  4257. try {
  4258. range = new Range(range, options)
  4259. } catch (er) {
  4260. return false
  4261. }
  4262. return range.test(version)
  4263. }
  4264. exports.maxSatisfying = maxSatisfying
  4265. function maxSatisfying (versions, range, options) {
  4266. var max = null
  4267. var maxSV = null
  4268. try {
  4269. var rangeObj = new Range(range, options)
  4270. } catch (er) {
  4271. return null
  4272. }
  4273. versions.forEach(function (v) {
  4274. if (rangeObj.test(v)) {
  4275. // satisfies(v, range, options)
  4276. if (!max || maxSV.compare(v) === -1) {
  4277. // compare(max, v, true)
  4278. max = v
  4279. maxSV = new SemVer(max, options)
  4280. }
  4281. }
  4282. })
  4283. return max
  4284. }
  4285. exports.minSatisfying = minSatisfying
  4286. function minSatisfying (versions, range, options) {
  4287. var min = null
  4288. var minSV = null
  4289. try {
  4290. var rangeObj = new Range(range, options)
  4291. } catch (er) {
  4292. return null
  4293. }
  4294. versions.forEach(function (v) {
  4295. if (rangeObj.test(v)) {
  4296. // satisfies(v, range, options)
  4297. if (!min || minSV.compare(v) === 1) {
  4298. // compare(min, v, true)
  4299. min = v
  4300. minSV = new SemVer(min, options)
  4301. }
  4302. }
  4303. })
  4304. return min
  4305. }
  4306. exports.minVersion = minVersion
  4307. function minVersion (range, loose) {
  4308. range = new Range(range, loose)
  4309. var minver = new SemVer('0.0.0')
  4310. if (range.test(minver)) {
  4311. return minver
  4312. }
  4313. minver = new SemVer('0.0.0-0')
  4314. if (range.test(minver)) {
  4315. return minver
  4316. }
  4317. minver = null
  4318. for (var i = 0; i < range.set.length; ++i) {
  4319. var comparators = range.set[i]
  4320. comparators.forEach(function (comparator) {
  4321. // Clone to avoid manipulating the comparator's semver object.
  4322. var compver = new SemVer(comparator.semver.version)
  4323. switch (comparator.operator) {
  4324. case '>':
  4325. if (compver.prerelease.length === 0) {
  4326. compver.patch++
  4327. } else {
  4328. compver.prerelease.push(0)
  4329. }
  4330. compver.raw = compver.format()
  4331. /* fallthrough */
  4332. case '':
  4333. case '>=':
  4334. if (!minver || gt(minver, compver)) {
  4335. minver = compver
  4336. }
  4337. break
  4338. case '<':
  4339. case '<=':
  4340. /* Ignore maximum versions */
  4341. break
  4342. /* istanbul ignore next */
  4343. default:
  4344. throw new Error('Unexpected operation: ' + comparator.operator)
  4345. }
  4346. })
  4347. }
  4348. if (minver && range.test(minver)) {
  4349. return minver
  4350. }
  4351. return null
  4352. }
  4353. exports.validRange = validRange
  4354. function validRange (range, options) {
  4355. try {
  4356. // Return '*' instead of '' so that truthiness works.
  4357. // This will throw if it's invalid anyway
  4358. return new Range(range, options).range || '*'
  4359. } catch (er) {
  4360. return null
  4361. }
  4362. }
  4363. // Determine if version is less than all the versions possible in the range
  4364. exports.ltr = ltr
  4365. function ltr (version, range, options) {
  4366. return outside(version, range, '<', options)
  4367. }
  4368. // Determine if version is greater than all the versions possible in the range.
  4369. exports.gtr = gtr
  4370. function gtr (version, range, options) {
  4371. return outside(version, range, '>', options)
  4372. }
  4373. exports.outside = outside
  4374. function outside (version, range, hilo, options) {
  4375. version = new SemVer(version, options)
  4376. range = new Range(range, options)
  4377. var gtfn, ltefn, ltfn, comp, ecomp
  4378. switch (hilo) {
  4379. case '>':
  4380. gtfn = gt
  4381. ltefn = lte
  4382. ltfn = lt
  4383. comp = '>'
  4384. ecomp = '>='
  4385. break
  4386. case '<':
  4387. gtfn = lt
  4388. ltefn = gte
  4389. ltfn = gt
  4390. comp = '<'
  4391. ecomp = '<='
  4392. break
  4393. default:
  4394. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4395. }
  4396. // If it satisifes the range it is not outside
  4397. if (satisfies(version, range, options)) {
  4398. return false
  4399. }
  4400. // From now on, variable terms are as if we're in "gtr" mode.
  4401. // but note that everything is flipped for the "ltr" function.
  4402. for (var i = 0; i < range.set.length; ++i) {
  4403. var comparators = range.set[i]
  4404. var high = null
  4405. var low = null
  4406. comparators.forEach(function (comparator) {
  4407. if (comparator.semver === ANY) {
  4408. comparator = new Comparator('>=0.0.0')
  4409. }
  4410. high = high || comparator
  4411. low = low || comparator
  4412. if (gtfn(comparator.semver, high.semver, options)) {
  4413. high = comparator
  4414. } else if (ltfn(comparator.semver, low.semver, options)) {
  4415. low = comparator
  4416. }
  4417. })
  4418. // If the edge version comparator has a operator then our version
  4419. // isn't outside it
  4420. if (high.operator === comp || high.operator === ecomp) {
  4421. return false
  4422. }
  4423. // If the lowest version comparator has an operator and our version
  4424. // is less than it then it isn't higher than the range
  4425. if ((!low.operator || low.operator === comp) &&
  4426. ltefn(version, low.semver)) {
  4427. return false
  4428. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4429. return false
  4430. }
  4431. }
  4432. return true
  4433. }
  4434. exports.prerelease = prerelease
  4435. function prerelease (version, options) {
  4436. var parsed = parse(version, options)
  4437. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4438. }
  4439. exports.intersects = intersects
  4440. function intersects (r1, r2, options) {
  4441. r1 = new Range(r1, options)
  4442. r2 = new Range(r2, options)
  4443. return r1.intersects(r2)
  4444. }
  4445. exports.coerce = coerce
  4446. function coerce (version) {
  4447. if (version instanceof SemVer) {
  4448. return version
  4449. }
  4450. if (typeof version !== 'string') {
  4451. return null
  4452. }
  4453. var match = version.match(re[COERCE])
  4454. if (match == null) {
  4455. return null
  4456. }
  4457. return parse(match[1] +
  4458. '.' + (match[2] || '0') +
  4459. '.' + (match[3] || '0'))
  4460. }
  4461. /***/ }),
  4462. /***/ 287:
  4463. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4464. "use strict";
  4465. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4466. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4467. return new (P || (P = Promise))(function (resolve, reject) {
  4468. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4469. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4470. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4471. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4472. });
  4473. };
  4474. var __importStar = (this && this.__importStar) || function (mod) {
  4475. if (mod && mod.__esModule) return mod;
  4476. var result = {};
  4477. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4478. result["default"] = mod;
  4479. return result;
  4480. };
  4481. var __importDefault = (this && this.__importDefault) || function (mod) {
  4482. return (mod && mod.__esModule) ? mod : { "default": mod };
  4483. };
  4484. Object.defineProperty(exports, "__esModule", { value: true });
  4485. const assert = __importStar(__webpack_require__(357));
  4486. const core = __importStar(__webpack_require__(470));
  4487. const exec = __importStar(__webpack_require__(986));
  4488. const fs = __importStar(__webpack_require__(747));
  4489. const io = __importStar(__webpack_require__(1));
  4490. const os = __importStar(__webpack_require__(87));
  4491. const path = __importStar(__webpack_require__(622));
  4492. const regexpHelper = __importStar(__webpack_require__(528));
  4493. const stateHelper = __importStar(__webpack_require__(153));
  4494. const urlHelper = __importStar(__webpack_require__(81));
  4495. const v4_1 = __importDefault(__webpack_require__(826));
  4496. const IS_WINDOWS = process.platform === 'win32';
  4497. const SSH_COMMAND_KEY = 'core.sshCommand';
  4498. function createAuthHelper(git, settings) {
  4499. return new GitAuthHelper(git, settings);
  4500. }
  4501. exports.createAuthHelper = createAuthHelper;
  4502. class GitAuthHelper {
  4503. constructor(gitCommandManager, gitSourceSettings) {
  4504. this.sshCommand = '';
  4505. this.sshKeyPath = '';
  4506. this.sshKnownHostsPath = '';
  4507. this.temporaryHomePath = '';
  4508. this.git = gitCommandManager;
  4509. this.settings = gitSourceSettings || {};
  4510. // Token auth header
  4511. const serverUrl = urlHelper.getServerUrl();
  4512. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4513. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4514. core.setSecret(basicCredential);
  4515. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4516. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4517. // Instead of SSH URL
  4518. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4519. this.insteadOfValue = `git@${serverUrl.hostname}:`;
  4520. }
  4521. configureAuth() {
  4522. return __awaiter(this, void 0, void 0, function* () {
  4523. // Remove possible previous values
  4524. yield this.removeAuth();
  4525. // Configure new values
  4526. yield this.configureSsh();
  4527. yield this.configureToken();
  4528. });
  4529. }
  4530. configureGlobalAuth() {
  4531. return __awaiter(this, void 0, void 0, function* () {
  4532. // Create a temp home directory
  4533. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4534. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4535. const uniqueId = v4_1.default();
  4536. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4537. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4538. // Copy the global git config
  4539. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4540. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4541. let configExists = false;
  4542. try {
  4543. yield fs.promises.stat(gitConfigPath);
  4544. configExists = true;
  4545. }
  4546. catch (err) {
  4547. if (err.code !== 'ENOENT') {
  4548. throw err;
  4549. }
  4550. }
  4551. if (configExists) {
  4552. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4553. yield io.cp(gitConfigPath, newGitConfigPath);
  4554. }
  4555. else {
  4556. yield fs.promises.writeFile(newGitConfigPath, '');
  4557. }
  4558. try {
  4559. // Override HOME
  4560. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4561. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4562. // Configure the token
  4563. yield this.configureToken(newGitConfigPath, true);
  4564. // Configure HTTPS instead of SSH
  4565. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4566. if (!this.settings.sshKey) {
  4567. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4568. }
  4569. }
  4570. catch (err) {
  4571. // Unset in case somehow written to the real global config
  4572. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4573. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4574. throw err;
  4575. }
  4576. });
  4577. }
  4578. configureSubmoduleAuth() {
  4579. return __awaiter(this, void 0, void 0, function* () {
  4580. // Remove possible previous HTTPS instead of SSH
  4581. yield this.removeGitConfig(this.insteadOfKey, true);
  4582. if (this.settings.persistCredentials) {
  4583. // Configure a placeholder value. This approach avoids the credential being captured
  4584. // by process creation audit events, which are commonly logged. For more information,
  4585. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4586. const output = yield this.git.submoduleForeach(`git config --local '${this.tokenConfigKey}' '${this.tokenPlaceholderConfigValue}' && git config --local --show-origin --name-only --get-regexp remote.origin.url`, this.settings.nestedSubmodules);
  4587. // Replace the placeholder
  4588. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4589. for (const configPath of configPaths) {
  4590. core.debug(`Replacing token placeholder in '${configPath}'`);
  4591. this.replaceTokenPlaceholder(configPath);
  4592. }
  4593. if (this.settings.sshKey) {
  4594. // Configure core.sshCommand
  4595. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4596. }
  4597. else {
  4598. // Configure HTTPS instead of SSH
  4599. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4600. }
  4601. }
  4602. });
  4603. }
  4604. removeAuth() {
  4605. return __awaiter(this, void 0, void 0, function* () {
  4606. yield this.removeSsh();
  4607. yield this.removeToken();
  4608. });
  4609. }
  4610. removeGlobalAuth() {
  4611. return __awaiter(this, void 0, void 0, function* () {
  4612. core.debug(`Unsetting HOME override`);
  4613. this.git.removeEnvironmentVariable('HOME');
  4614. yield io.rmRF(this.temporaryHomePath);
  4615. });
  4616. }
  4617. configureSsh() {
  4618. return __awaiter(this, void 0, void 0, function* () {
  4619. if (!this.settings.sshKey) {
  4620. return;
  4621. }
  4622. // Write key
  4623. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4624. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4625. const uniqueId = v4_1.default();
  4626. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4627. stateHelper.setSshKeyPath(this.sshKeyPath);
  4628. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4629. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4630. // Remove inherited permissions on Windows
  4631. if (IS_WINDOWS) {
  4632. const icacls = yield io.which('icacls.exe');
  4633. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4634. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4635. }
  4636. // Write known hosts
  4637. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4638. let userKnownHosts = '';
  4639. try {
  4640. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4641. }
  4642. catch (err) {
  4643. if (err.code !== 'ENOENT') {
  4644. throw err;
  4645. }
  4646. }
  4647. let knownHosts = '';
  4648. if (userKnownHosts) {
  4649. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4650. }
  4651. if (this.settings.sshKnownHosts) {
  4652. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4653. }
  4654. knownHosts += `# Begin implicitly added github.com\ngithub.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n# End implicitly added github.com\n`;
  4655. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4656. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4657. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4658. // Configure GIT_SSH_COMMAND
  4659. const sshPath = yield io.which('ssh', true);
  4660. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4661. if (this.settings.sshStrict) {
  4662. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4663. }
  4664. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4665. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4666. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4667. // Configure core.sshCommand
  4668. if (this.settings.persistCredentials) {
  4669. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4670. }
  4671. });
  4672. }
  4673. configureToken(configPath, globalConfig) {
  4674. return __awaiter(this, void 0, void 0, function* () {
  4675. // Validate args
  4676. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4677. // Default config path
  4678. if (!configPath && !globalConfig) {
  4679. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4680. }
  4681. // Configure a placeholder value. This approach avoids the credential being captured
  4682. // by process creation audit events, which are commonly logged. For more information,
  4683. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4684. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4685. // Replace the placeholder
  4686. yield this.replaceTokenPlaceholder(configPath || '');
  4687. });
  4688. }
  4689. replaceTokenPlaceholder(configPath) {
  4690. return __awaiter(this, void 0, void 0, function* () {
  4691. assert.ok(configPath, 'configPath is not defined');
  4692. let content = (yield fs.promises.readFile(configPath)).toString();
  4693. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4694. if (placeholderIndex < 0 ||
  4695. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4696. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4697. }
  4698. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4699. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4700. yield fs.promises.writeFile(configPath, content);
  4701. });
  4702. }
  4703. removeSsh() {
  4704. return __awaiter(this, void 0, void 0, function* () {
  4705. // SSH key
  4706. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4707. if (keyPath) {
  4708. try {
  4709. yield io.rmRF(keyPath);
  4710. }
  4711. catch (err) {
  4712. core.debug(err.message);
  4713. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4714. }
  4715. }
  4716. // SSH known hosts
  4717. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4718. if (knownHostsPath) {
  4719. try {
  4720. yield io.rmRF(knownHostsPath);
  4721. }
  4722. catch (_a) {
  4723. // Intentionally empty
  4724. }
  4725. }
  4726. // SSH command
  4727. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4728. });
  4729. }
  4730. removeToken() {
  4731. return __awaiter(this, void 0, void 0, function* () {
  4732. // HTTP extra header
  4733. yield this.removeGitConfig(this.tokenConfigKey);
  4734. });
  4735. }
  4736. removeGitConfig(configKey, submoduleOnly = false) {
  4737. return __awaiter(this, void 0, void 0, function* () {
  4738. if (!submoduleOnly) {
  4739. if ((yield this.git.configExists(configKey)) &&
  4740. !(yield this.git.tryConfigUnset(configKey))) {
  4741. // Load the config contents
  4742. core.warning(`Failed to remove '${configKey}' from the git config`);
  4743. }
  4744. }
  4745. const pattern = regexpHelper.escape(configKey);
  4746. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4747. });
  4748. }
  4749. }
  4750. /***/ }),
  4751. /***/ 289:
  4752. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4753. "use strict";
  4754. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4755. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4756. return new (P || (P = Promise))(function (resolve, reject) {
  4757. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4758. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4759. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4760. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4761. });
  4762. };
  4763. var __importStar = (this && this.__importStar) || function (mod) {
  4764. if (mod && mod.__esModule) return mod;
  4765. var result = {};
  4766. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4767. result["default"] = mod;
  4768. return result;
  4769. };
  4770. Object.defineProperty(exports, "__esModule", { value: true });
  4771. const core = __importStar(__webpack_require__(470));
  4772. const exec = __importStar(__webpack_require__(986));
  4773. const fshelper = __importStar(__webpack_require__(618));
  4774. const io = __importStar(__webpack_require__(1));
  4775. const path = __importStar(__webpack_require__(622));
  4776. const regexpHelper = __importStar(__webpack_require__(528));
  4777. const retryHelper = __importStar(__webpack_require__(587));
  4778. const git_version_1 = __webpack_require__(559);
  4779. // Auth header not supported before 2.9
  4780. // Wire protocol v2 not supported before 2.18
  4781. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4782. function createCommandManager(workingDirectory, lfs) {
  4783. return __awaiter(this, void 0, void 0, function* () {
  4784. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4785. });
  4786. }
  4787. exports.createCommandManager = createCommandManager;
  4788. class GitCommandManager {
  4789. // Private constructor; use createCommandManager()
  4790. constructor() {
  4791. this.gitEnv = {
  4792. GIT_TERMINAL_PROMPT: '0',
  4793. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4794. };
  4795. this.gitPath = '';
  4796. this.lfs = false;
  4797. this.workingDirectory = '';
  4798. }
  4799. branchDelete(remote, branch) {
  4800. return __awaiter(this, void 0, void 0, function* () {
  4801. const args = ['branch', '--delete', '--force'];
  4802. if (remote) {
  4803. args.push('--remote');
  4804. }
  4805. args.push(branch);
  4806. yield this.execGit(args);
  4807. });
  4808. }
  4809. branchExists(remote, pattern) {
  4810. return __awaiter(this, void 0, void 0, function* () {
  4811. const args = ['branch', '--list'];
  4812. if (remote) {
  4813. args.push('--remote');
  4814. }
  4815. args.push(pattern);
  4816. const output = yield this.execGit(args);
  4817. return !!output.stdout.trim();
  4818. });
  4819. }
  4820. branchList(remote) {
  4821. return __awaiter(this, void 0, void 0, function* () {
  4822. const result = [];
  4823. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4824. // "branch --list" is more difficult when in a detached HEAD state.
  4825. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4826. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4827. const args = ['rev-parse', '--symbolic-full-name'];
  4828. if (remote) {
  4829. args.push('--remotes=origin');
  4830. }
  4831. else {
  4832. args.push('--branches');
  4833. }
  4834. const output = yield this.execGit(args);
  4835. for (let branch of output.stdout.trim().split('\n')) {
  4836. branch = branch.trim();
  4837. if (branch) {
  4838. if (branch.startsWith('refs/heads/')) {
  4839. branch = branch.substr('refs/heads/'.length);
  4840. }
  4841. else if (branch.startsWith('refs/remotes/')) {
  4842. branch = branch.substr('refs/remotes/'.length);
  4843. }
  4844. result.push(branch);
  4845. }
  4846. }
  4847. return result;
  4848. });
  4849. }
  4850. checkout(ref, startPoint) {
  4851. return __awaiter(this, void 0, void 0, function* () {
  4852. const args = ['checkout', '--progress', '--force'];
  4853. if (startPoint) {
  4854. args.push('-B', ref, startPoint);
  4855. }
  4856. else {
  4857. args.push(ref);
  4858. }
  4859. yield this.execGit(args);
  4860. });
  4861. }
  4862. checkoutDetach() {
  4863. return __awaiter(this, void 0, void 0, function* () {
  4864. const args = ['checkout', '--detach'];
  4865. yield this.execGit(args);
  4866. });
  4867. }
  4868. config(configKey, configValue, globalConfig) {
  4869. return __awaiter(this, void 0, void 0, function* () {
  4870. yield this.execGit([
  4871. 'config',
  4872. globalConfig ? '--global' : '--local',
  4873. configKey,
  4874. configValue
  4875. ]);
  4876. });
  4877. }
  4878. configExists(configKey, globalConfig) {
  4879. return __awaiter(this, void 0, void 0, function* () {
  4880. const pattern = regexpHelper.escape(configKey);
  4881. const output = yield this.execGit([
  4882. 'config',
  4883. globalConfig ? '--global' : '--local',
  4884. '--name-only',
  4885. '--get-regexp',
  4886. pattern
  4887. ], true);
  4888. return output.exitCode === 0;
  4889. });
  4890. }
  4891. fetch(fetchDepth, refSpec) {
  4892. return __awaiter(this, void 0, void 0, function* () {
  4893. const args = [
  4894. '-c',
  4895. 'protocol.version=2',
  4896. 'fetch',
  4897. '--no-tags',
  4898. '--prune',
  4899. '--progress',
  4900. '--no-recurse-submodules'
  4901. ];
  4902. if (fetchDepth > 0) {
  4903. args.push(`--depth=${fetchDepth}`);
  4904. }
  4905. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4906. args.push('--unshallow');
  4907. }
  4908. args.push('origin');
  4909. for (const arg of refSpec) {
  4910. args.push(arg);
  4911. }
  4912. const that = this;
  4913. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4914. yield that.execGit(args);
  4915. }));
  4916. });
  4917. }
  4918. getWorkingDirectory() {
  4919. return this.workingDirectory;
  4920. }
  4921. init() {
  4922. return __awaiter(this, void 0, void 0, function* () {
  4923. yield this.execGit(['init', this.workingDirectory]);
  4924. });
  4925. }
  4926. isDetached() {
  4927. return __awaiter(this, void 0, void 0, function* () {
  4928. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  4929. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  4930. return !output.stdout.trim().startsWith('refs/heads/');
  4931. });
  4932. }
  4933. lfsFetch(ref) {
  4934. return __awaiter(this, void 0, void 0, function* () {
  4935. const args = ['lfs', 'fetch', 'origin', ref];
  4936. const that = this;
  4937. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4938. yield that.execGit(args);
  4939. }));
  4940. });
  4941. }
  4942. lfsInstall() {
  4943. return __awaiter(this, void 0, void 0, function* () {
  4944. yield this.execGit(['lfs', 'install', '--local']);
  4945. });
  4946. }
  4947. log1() {
  4948. return __awaiter(this, void 0, void 0, function* () {
  4949. yield this.execGit(['log', '-1']);
  4950. });
  4951. }
  4952. remoteAdd(remoteName, remoteUrl) {
  4953. return __awaiter(this, void 0, void 0, function* () {
  4954. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4955. });
  4956. }
  4957. removeEnvironmentVariable(name) {
  4958. delete this.gitEnv[name];
  4959. }
  4960. setEnvironmentVariable(name, value) {
  4961. this.gitEnv[name] = value;
  4962. }
  4963. submoduleForeach(command, recursive) {
  4964. return __awaiter(this, void 0, void 0, function* () {
  4965. const args = ['submodule', 'foreach'];
  4966. if (recursive) {
  4967. args.push('--recursive');
  4968. }
  4969. args.push(command);
  4970. const output = yield this.execGit(args);
  4971. return output.stdout;
  4972. });
  4973. }
  4974. submoduleSync(recursive) {
  4975. return __awaiter(this, void 0, void 0, function* () {
  4976. const args = ['submodule', 'sync'];
  4977. if (recursive) {
  4978. args.push('--recursive');
  4979. }
  4980. yield this.execGit(args);
  4981. });
  4982. }
  4983. submoduleUpdate(fetchDepth, recursive) {
  4984. return __awaiter(this, void 0, void 0, function* () {
  4985. const args = ['-c', 'protocol.version=2'];
  4986. args.push('submodule', 'update', '--init', '--force');
  4987. if (fetchDepth > 0) {
  4988. args.push(`--depth=${fetchDepth}`);
  4989. }
  4990. if (recursive) {
  4991. args.push('--recursive');
  4992. }
  4993. yield this.execGit(args);
  4994. });
  4995. }
  4996. tagExists(pattern) {
  4997. return __awaiter(this, void 0, void 0, function* () {
  4998. const output = yield this.execGit(['tag', '--list', pattern]);
  4999. return !!output.stdout.trim();
  5000. });
  5001. }
  5002. tryClean() {
  5003. return __awaiter(this, void 0, void 0, function* () {
  5004. const output = yield this.execGit(['clean', '-ffdx'], true);
  5005. return output.exitCode === 0;
  5006. });
  5007. }
  5008. tryConfigUnset(configKey, globalConfig) {
  5009. return __awaiter(this, void 0, void 0, function* () {
  5010. const output = yield this.execGit([
  5011. 'config',
  5012. globalConfig ? '--global' : '--local',
  5013. '--unset-all',
  5014. configKey
  5015. ], true);
  5016. return output.exitCode === 0;
  5017. });
  5018. }
  5019. tryDisableAutomaticGarbageCollection() {
  5020. return __awaiter(this, void 0, void 0, function* () {
  5021. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  5022. return output.exitCode === 0;
  5023. });
  5024. }
  5025. tryGetFetchUrl() {
  5026. return __awaiter(this, void 0, void 0, function* () {
  5027. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  5028. if (output.exitCode !== 0) {
  5029. return '';
  5030. }
  5031. const stdout = output.stdout.trim();
  5032. if (stdout.includes('\n')) {
  5033. return '';
  5034. }
  5035. return stdout;
  5036. });
  5037. }
  5038. tryReset() {
  5039. return __awaiter(this, void 0, void 0, function* () {
  5040. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5041. return output.exitCode === 0;
  5042. });
  5043. }
  5044. static createCommandManager(workingDirectory, lfs) {
  5045. return __awaiter(this, void 0, void 0, function* () {
  5046. const result = new GitCommandManager();
  5047. yield result.initializeCommandManager(workingDirectory, lfs);
  5048. return result;
  5049. });
  5050. }
  5051. execGit(args, allowAllExitCodes = false) {
  5052. return __awaiter(this, void 0, void 0, function* () {
  5053. fshelper.directoryExistsSync(this.workingDirectory, true);
  5054. const result = new GitOutput();
  5055. const env = {};
  5056. for (const key of Object.keys(process.env)) {
  5057. env[key] = process.env[key];
  5058. }
  5059. for (const key of Object.keys(this.gitEnv)) {
  5060. env[key] = this.gitEnv[key];
  5061. }
  5062. const stdout = [];
  5063. const options = {
  5064. cwd: this.workingDirectory,
  5065. env,
  5066. ignoreReturnCode: allowAllExitCodes,
  5067. listeners: {
  5068. stdout: (data) => {
  5069. stdout.push(data.toString());
  5070. }
  5071. }
  5072. };
  5073. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5074. result.stdout = stdout.join('');
  5075. return result;
  5076. });
  5077. }
  5078. initializeCommandManager(workingDirectory, lfs) {
  5079. return __awaiter(this, void 0, void 0, function* () {
  5080. this.workingDirectory = workingDirectory;
  5081. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5082. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5083. this.lfs = lfs;
  5084. if (!this.lfs) {
  5085. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5086. }
  5087. this.gitPath = yield io.which('git', true);
  5088. // Git version
  5089. core.debug('Getting git version');
  5090. let gitVersion = new git_version_1.GitVersion();
  5091. let gitOutput = yield this.execGit(['version']);
  5092. let stdout = gitOutput.stdout.trim();
  5093. if (!stdout.includes('\n')) {
  5094. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5095. if (match) {
  5096. gitVersion = new git_version_1.GitVersion(match[0]);
  5097. }
  5098. }
  5099. if (!gitVersion.isValid()) {
  5100. throw new Error('Unable to determine git version');
  5101. }
  5102. // Minimum git version
  5103. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5104. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5105. }
  5106. if (this.lfs) {
  5107. // Git-lfs version
  5108. core.debug('Getting git-lfs version');
  5109. let gitLfsVersion = new git_version_1.GitVersion();
  5110. const gitLfsPath = yield io.which('git-lfs', true);
  5111. gitOutput = yield this.execGit(['lfs', 'version']);
  5112. stdout = gitOutput.stdout.trim();
  5113. if (!stdout.includes('\n')) {
  5114. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5115. if (match) {
  5116. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5117. }
  5118. }
  5119. if (!gitLfsVersion.isValid()) {
  5120. throw new Error('Unable to determine git-lfs version');
  5121. }
  5122. // Minimum git-lfs version
  5123. // Note:
  5124. // - Auth header not supported before 2.1
  5125. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5126. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5127. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5128. }
  5129. }
  5130. // Set the user agent
  5131. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5132. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5133. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5134. });
  5135. }
  5136. }
  5137. class GitOutput {
  5138. constructor() {
  5139. this.stdout = '';
  5140. this.exitCode = 0;
  5141. }
  5142. }
  5143. /***/ }),
  5144. /***/ 293:
  5145. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5146. "use strict";
  5147. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5148. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5149. return new (P || (P = Promise))(function (resolve, reject) {
  5150. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5151. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5152. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5153. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5154. });
  5155. };
  5156. var __importStar = (this && this.__importStar) || function (mod) {
  5157. if (mod && mod.__esModule) return mod;
  5158. var result = {};
  5159. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5160. result["default"] = mod;
  5161. return result;
  5162. };
  5163. Object.defineProperty(exports, "__esModule", { value: true });
  5164. const core = __importStar(__webpack_require__(470));
  5165. const fsHelper = __importStar(__webpack_require__(618));
  5166. const gitAuthHelper = __importStar(__webpack_require__(287));
  5167. const gitCommandManager = __importStar(__webpack_require__(289));
  5168. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5169. const githubApiHelper = __importStar(__webpack_require__(464));
  5170. const io = __importStar(__webpack_require__(1));
  5171. const path = __importStar(__webpack_require__(622));
  5172. const refHelper = __importStar(__webpack_require__(227));
  5173. const stateHelper = __importStar(__webpack_require__(153));
  5174. const urlHelper = __importStar(__webpack_require__(81));
  5175. function getSource(settings) {
  5176. return __awaiter(this, void 0, void 0, function* () {
  5177. // Repository URL
  5178. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5179. const repositoryUrl = urlHelper.getFetchUrl(settings);
  5180. // Remove conflicting file path
  5181. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5182. yield io.rmRF(settings.repositoryPath);
  5183. }
  5184. // Create directory
  5185. let isExisting = true;
  5186. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5187. isExisting = false;
  5188. yield io.mkdirP(settings.repositoryPath);
  5189. }
  5190. // Git command manager
  5191. core.startGroup('Getting Git version info');
  5192. const git = yield getGitCommandManager(settings);
  5193. core.endGroup();
  5194. // Prepare existing directory, otherwise recreate
  5195. if (isExisting) {
  5196. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  5197. }
  5198. if (!git) {
  5199. // Downloading using REST API
  5200. core.info(`The repository will be downloaded using the GitHub REST API`);
  5201. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5202. if (settings.submodules) {
  5203. throw new Error(`Input 'submodules' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.`);
  5204. }
  5205. else if (settings.sshKey) {
  5206. throw new Error(`Input 'ssh-key' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.`);
  5207. }
  5208. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5209. return;
  5210. }
  5211. // Save state for POST action
  5212. stateHelper.setRepositoryPath(settings.repositoryPath);
  5213. // Initialize the repository
  5214. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5215. core.startGroup('Initializing the repository');
  5216. yield git.init();
  5217. yield git.remoteAdd('origin', repositoryUrl);
  5218. core.endGroup();
  5219. }
  5220. // Disable automatic garbage collection
  5221. core.startGroup('Disabling automatic garbage collection');
  5222. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5223. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5224. }
  5225. core.endGroup();
  5226. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5227. try {
  5228. // Configure auth
  5229. core.startGroup('Setting up auth');
  5230. yield authHelper.configureAuth();
  5231. core.endGroup();
  5232. // LFS install
  5233. if (settings.lfs) {
  5234. yield git.lfsInstall();
  5235. }
  5236. // Fetch
  5237. core.startGroup('Fetching the repository');
  5238. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5239. yield git.fetch(settings.fetchDepth, refSpec);
  5240. core.endGroup();
  5241. // Checkout info
  5242. core.startGroup('Determining the checkout info');
  5243. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5244. core.endGroup();
  5245. // LFS fetch
  5246. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5247. // Explicit lfs fetch will fetch lfs objects in parallel.
  5248. if (settings.lfs) {
  5249. core.startGroup('Fetching LFS objects');
  5250. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5251. core.endGroup();
  5252. }
  5253. // Checkout
  5254. core.startGroup('Checking out the ref');
  5255. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5256. core.endGroup();
  5257. // Submodules
  5258. if (settings.submodules) {
  5259. try {
  5260. // Temporarily override global config
  5261. core.startGroup('Setting up auth for fetching submodules');
  5262. yield authHelper.configureGlobalAuth();
  5263. core.endGroup();
  5264. // Checkout submodules
  5265. core.startGroup('Fetching submodules');
  5266. yield git.submoduleSync(settings.nestedSubmodules);
  5267. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5268. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5269. core.endGroup();
  5270. // Persist credentials
  5271. if (settings.persistCredentials) {
  5272. core.startGroup('Persisting credentials for submodules');
  5273. yield authHelper.configureSubmoduleAuth();
  5274. core.endGroup();
  5275. }
  5276. }
  5277. finally {
  5278. // Remove temporary global config override
  5279. yield authHelper.removeGlobalAuth();
  5280. }
  5281. }
  5282. // Dump some info about the checked out commit
  5283. yield git.log1();
  5284. }
  5285. finally {
  5286. // Remove auth
  5287. if (!settings.persistCredentials) {
  5288. core.startGroup('Removing auth');
  5289. yield authHelper.removeAuth();
  5290. core.endGroup();
  5291. }
  5292. }
  5293. });
  5294. }
  5295. exports.getSource = getSource;
  5296. function cleanup(repositoryPath) {
  5297. return __awaiter(this, void 0, void 0, function* () {
  5298. // Repo exists?
  5299. if (!repositoryPath ||
  5300. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5301. return;
  5302. }
  5303. let git;
  5304. try {
  5305. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5306. }
  5307. catch (_a) {
  5308. return;
  5309. }
  5310. // Remove auth
  5311. const authHelper = gitAuthHelper.createAuthHelper(git);
  5312. yield authHelper.removeAuth();
  5313. });
  5314. }
  5315. exports.cleanup = cleanup;
  5316. function getGitCommandManager(settings) {
  5317. return __awaiter(this, void 0, void 0, function* () {
  5318. core.info(`Working directory is '${settings.repositoryPath}'`);
  5319. try {
  5320. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5321. }
  5322. catch (err) {
  5323. // Git is required for LFS
  5324. if (settings.lfs) {
  5325. throw err;
  5326. }
  5327. // Otherwise fallback to REST API
  5328. return undefined;
  5329. }
  5330. });
  5331. }
  5332. /***/ }),
  5333. /***/ 294:
  5334. /***/ (function(module, __unusedexports, __webpack_require__) {
  5335. module.exports = parseOptions;
  5336. const { Deprecation } = __webpack_require__(692);
  5337. const { getUserAgent } = __webpack_require__(796);
  5338. const once = __webpack_require__(969);
  5339. const pkg = __webpack_require__(215);
  5340. const deprecateOptionsTimeout = once((log, deprecation) =>
  5341. log.warn(deprecation)
  5342. );
  5343. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5344. const deprecateOptionsHeaders = once((log, deprecation) =>
  5345. log.warn(deprecation)
  5346. );
  5347. function parseOptions(options, log, hook) {
  5348. if (options.headers) {
  5349. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5350. newObj[key.toLowerCase()] = options.headers[key];
  5351. return newObj;
  5352. }, {});
  5353. }
  5354. const clientDefaults = {
  5355. headers: options.headers || {},
  5356. request: options.request || {},
  5357. mediaType: {
  5358. previews: [],
  5359. format: ""
  5360. }
  5361. };
  5362. if (options.baseUrl) {
  5363. clientDefaults.baseUrl = options.baseUrl;
  5364. }
  5365. if (options.userAgent) {
  5366. clientDefaults.headers["user-agent"] = options.userAgent;
  5367. }
  5368. if (options.previews) {
  5369. clientDefaults.mediaType.previews = options.previews;
  5370. }
  5371. if (options.timeZone) {
  5372. clientDefaults.headers["time-zone"] = options.timeZone;
  5373. }
  5374. if (options.timeout) {
  5375. deprecateOptionsTimeout(
  5376. log,
  5377. new Deprecation(
  5378. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5379. )
  5380. );
  5381. clientDefaults.request.timeout = options.timeout;
  5382. }
  5383. if (options.agent) {
  5384. deprecateOptionsAgent(
  5385. log,
  5386. new Deprecation(
  5387. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5388. )
  5389. );
  5390. clientDefaults.request.agent = options.agent;
  5391. }
  5392. if (options.headers) {
  5393. deprecateOptionsHeaders(
  5394. log,
  5395. new Deprecation(
  5396. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5397. )
  5398. );
  5399. }
  5400. const userAgentOption = clientDefaults.headers["user-agent"];
  5401. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5402. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5403. .filter(Boolean)
  5404. .join(" ");
  5405. clientDefaults.request.hook = hook.bind(null, "request");
  5406. return clientDefaults;
  5407. }
  5408. /***/ }),
  5409. /***/ 297:
  5410. /***/ (function(module) {
  5411. module.exports = class HttpError extends Error {
  5412. constructor (message, code, headers) {
  5413. super(message)
  5414. // Maintains proper stack trace (only available on V8)
  5415. /* istanbul ignore next */
  5416. if (Error.captureStackTrace) {
  5417. Error.captureStackTrace(this, this.constructor)
  5418. }
  5419. this.name = 'HttpError'
  5420. this.code = code
  5421. this.headers = headers
  5422. }
  5423. }
  5424. /***/ }),
  5425. /***/ 301:
  5426. /***/ (function(module, __unusedexports, __webpack_require__) {
  5427. /**
  5428. * Some “list” response that can be paginated have a different response structure
  5429. *
  5430. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5431. * /installation/repositories also has `repository_selection`), as well as a key with
  5432. * the list of the items which name varies from endpoint to endpoint:
  5433. *
  5434. * - https://developer.github.com/v3/search/#example (key `items`)
  5435. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5436. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5437. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5438. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5439. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5440. *
  5441. * Octokit normalizes these responses so that paginated results are always returned following
  5442. * the same structure. One challenge is that if the list response has only one page, no Link
  5443. * header is provided, so this header alone is not sufficient to check wether a response is
  5444. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5445. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5446. * property because it also exists in the response of Get the combined status for a specific ref.
  5447. */
  5448. module.exports = normalizePaginatedListResponse;
  5449. const { Deprecation } = __webpack_require__(692);
  5450. const once = __webpack_require__(969);
  5451. const deprecateIncompleteResults = once((log, deprecation) =>
  5452. log.warn(deprecation)
  5453. );
  5454. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5455. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5456. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5457. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5458. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5459. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5460. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5461. function normalizePaginatedListResponse(octokit, url, response) {
  5462. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5463. if (
  5464. !REGEX_IS_SEARCH_PATH.test(path) &&
  5465. !REGEX_IS_CHECKS_PATH.test(path) &&
  5466. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5467. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5468. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5469. ) {
  5470. return;
  5471. }
  5472. // keep the additional properties intact to avoid a breaking change,
  5473. // but log a deprecation warning when accessed
  5474. const incompleteResults = response.data.incomplete_results;
  5475. const repositorySelection = response.data.repository_selection;
  5476. const totalCount = response.data.total_count;
  5477. delete response.data.incomplete_results;
  5478. delete response.data.repository_selection;
  5479. delete response.data.total_count;
  5480. const namespaceKey = Object.keys(response.data)[0];
  5481. response.data = response.data[namespaceKey];
  5482. Object.defineProperty(response.data, namespaceKey, {
  5483. get() {
  5484. deprecateNamespace(
  5485. octokit.log,
  5486. new Deprecation(
  5487. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5488. )
  5489. );
  5490. return response.data;
  5491. }
  5492. });
  5493. if (typeof incompleteResults !== "undefined") {
  5494. Object.defineProperty(response.data, "incomplete_results", {
  5495. get() {
  5496. deprecateIncompleteResults(
  5497. octokit.log,
  5498. new Deprecation(
  5499. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5500. )
  5501. );
  5502. return incompleteResults;
  5503. }
  5504. });
  5505. }
  5506. if (typeof repositorySelection !== "undefined") {
  5507. Object.defineProperty(response.data, "repository_selection", {
  5508. get() {
  5509. deprecateTotalCount(
  5510. octokit.log,
  5511. new Deprecation(
  5512. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5513. )
  5514. );
  5515. return repositorySelection;
  5516. }
  5517. });
  5518. }
  5519. Object.defineProperty(response.data, "total_count", {
  5520. get() {
  5521. deprecateTotalCount(
  5522. octokit.log,
  5523. new Deprecation(
  5524. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5525. )
  5526. );
  5527. return totalCount;
  5528. }
  5529. });
  5530. }
  5531. /***/ }),
  5532. /***/ 323:
  5533. /***/ (function(module) {
  5534. "use strict";
  5535. var isStream = module.exports = function (stream) {
  5536. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5537. };
  5538. isStream.writable = function (stream) {
  5539. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5540. };
  5541. isStream.readable = function (stream) {
  5542. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5543. };
  5544. isStream.duplex = function (stream) {
  5545. return isStream.writable(stream) && isStream.readable(stream);
  5546. };
  5547. isStream.transform = function (stream) {
  5548. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5549. };
  5550. /***/ }),
  5551. /***/ 335:
  5552. /***/ (function(module, __unusedexports, __webpack_require__) {
  5553. module.exports = __webpack_require__(179);
  5554. /***/ }),
  5555. /***/ 336:
  5556. /***/ (function(module, __unusedexports, __webpack_require__) {
  5557. module.exports = hasLastPage
  5558. const deprecate = __webpack_require__(370)
  5559. const getPageLinks = __webpack_require__(577)
  5560. function hasLastPage (link) {
  5561. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5562. return getPageLinks(link).last
  5563. }
  5564. /***/ }),
  5565. /***/ 348:
  5566. /***/ (function(module, __unusedexports, __webpack_require__) {
  5567. "use strict";
  5568. module.exports = validate;
  5569. const { RequestError } = __webpack_require__(463);
  5570. const get = __webpack_require__(854);
  5571. const set = __webpack_require__(883);
  5572. function validate(octokit, options) {
  5573. if (!options.request.validate) {
  5574. return;
  5575. }
  5576. const { validate: params } = options.request;
  5577. Object.keys(params).forEach(parameterName => {
  5578. const parameter = get(params, parameterName);
  5579. const expectedType = parameter.type;
  5580. let parentParameterName;
  5581. let parentValue;
  5582. let parentParamIsPresent = true;
  5583. let parentParameterIsArray = false;
  5584. if (/\./.test(parameterName)) {
  5585. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5586. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5587. if (parentParameterIsArray) {
  5588. parentParameterName = parentParameterName.slice(0, -2);
  5589. }
  5590. parentValue = get(options, parentParameterName);
  5591. parentParamIsPresent =
  5592. parentParameterName === "headers" ||
  5593. (typeof parentValue === "object" && parentValue !== null);
  5594. }
  5595. const values = parentParameterIsArray
  5596. ? (get(options, parentParameterName) || []).map(
  5597. value => value[parameterName.split(/\./).pop()]
  5598. )
  5599. : [get(options, parameterName)];
  5600. values.forEach((value, i) => {
  5601. const valueIsPresent = typeof value !== "undefined";
  5602. const valueIsNull = value === null;
  5603. const currentParameterName = parentParameterIsArray
  5604. ? parameterName.replace(/\[\]/, `[${i}]`)
  5605. : parameterName;
  5606. if (!parameter.required && !valueIsPresent) {
  5607. return;
  5608. }
  5609. // if the parent parameter is of type object but allows null
  5610. // then the child parameters can be ignored
  5611. if (!parentParamIsPresent) {
  5612. return;
  5613. }
  5614. if (parameter.allowNull && valueIsNull) {
  5615. return;
  5616. }
  5617. if (!parameter.allowNull && valueIsNull) {
  5618. throw new RequestError(
  5619. `'${currentParameterName}' cannot be null`,
  5620. 400,
  5621. {
  5622. request: options
  5623. }
  5624. );
  5625. }
  5626. if (parameter.required && !valueIsPresent) {
  5627. throw new RequestError(
  5628. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5629. value
  5630. )}`,
  5631. 400,
  5632. {
  5633. request: options
  5634. }
  5635. );
  5636. }
  5637. // parse to integer before checking for enum
  5638. // so that string "1" will match enum with number 1
  5639. if (expectedType === "integer") {
  5640. const unparsedValue = value;
  5641. value = parseInt(value, 10);
  5642. if (isNaN(value)) {
  5643. throw new RequestError(
  5644. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5645. unparsedValue
  5646. )} is NaN`,
  5647. 400,
  5648. {
  5649. request: options
  5650. }
  5651. );
  5652. }
  5653. }
  5654. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5655. throw new RequestError(
  5656. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5657. value
  5658. )}`,
  5659. 400,
  5660. {
  5661. request: options
  5662. }
  5663. );
  5664. }
  5665. if (parameter.validation) {
  5666. const regex = new RegExp(parameter.validation);
  5667. if (!regex.test(value)) {
  5668. throw new RequestError(
  5669. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5670. value
  5671. )}`,
  5672. 400,
  5673. {
  5674. request: options
  5675. }
  5676. );
  5677. }
  5678. }
  5679. if (expectedType === "object" && typeof value === "string") {
  5680. try {
  5681. value = JSON.parse(value);
  5682. } catch (exception) {
  5683. throw new RequestError(
  5684. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5685. value
  5686. )}`,
  5687. 400,
  5688. {
  5689. request: options
  5690. }
  5691. );
  5692. }
  5693. }
  5694. set(options, parameter.mapTo || currentParameterName, value);
  5695. });
  5696. });
  5697. return options;
  5698. }
  5699. /***/ }),
  5700. /***/ 349:
  5701. /***/ (function(module, __unusedexports, __webpack_require__) {
  5702. module.exports = authenticationRequestError;
  5703. const { RequestError } = __webpack_require__(463);
  5704. function authenticationRequestError(state, error, options) {
  5705. /* istanbul ignore next */
  5706. if (!error.headers) throw error;
  5707. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5708. // handle "2FA required" error only
  5709. if (error.status !== 401 || !otpRequired) {
  5710. throw error;
  5711. }
  5712. if (
  5713. error.status === 401 &&
  5714. otpRequired &&
  5715. error.request &&
  5716. error.request.headers["x-github-otp"]
  5717. ) {
  5718. throw new RequestError(
  5719. "Invalid one-time password for two-factor authentication",
  5720. 401,
  5721. {
  5722. headers: error.headers,
  5723. request: options
  5724. }
  5725. );
  5726. }
  5727. if (typeof state.auth.on2fa !== "function") {
  5728. throw new RequestError(
  5729. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5730. 401,
  5731. {
  5732. headers: error.headers,
  5733. request: options
  5734. }
  5735. );
  5736. }
  5737. return Promise.resolve()
  5738. .then(() => {
  5739. return state.auth.on2fa();
  5740. })
  5741. .then(oneTimePassword => {
  5742. const newOptions = Object.assign(options, {
  5743. headers: Object.assign(
  5744. { "x-github-otp": oneTimePassword },
  5745. options.headers
  5746. )
  5747. });
  5748. return state.octokit.request(newOptions);
  5749. });
  5750. }
  5751. /***/ }),
  5752. /***/ 357:
  5753. /***/ (function(module) {
  5754. module.exports = require("assert");
  5755. /***/ }),
  5756. /***/ 363:
  5757. /***/ (function(module) {
  5758. module.exports = register
  5759. function register (state, name, method, options) {
  5760. if (typeof method !== 'function') {
  5761. throw new Error('method for before hook must be a function')
  5762. }
  5763. if (!options) {
  5764. options = {}
  5765. }
  5766. if (Array.isArray(name)) {
  5767. return name.reverse().reduce(function (callback, name) {
  5768. return register.bind(null, state, name, callback, options)
  5769. }, method)()
  5770. }
  5771. return Promise.resolve()
  5772. .then(function () {
  5773. if (!state.registry[name]) {
  5774. return method(options)
  5775. }
  5776. return (state.registry[name]).reduce(function (method, registered) {
  5777. return registered.hook.bind(null, method, options)
  5778. }, method)()
  5779. })
  5780. }
  5781. /***/ }),
  5782. /***/ 368:
  5783. /***/ (function(module) {
  5784. module.exports = function atob(str) {
  5785. return Buffer.from(str, 'base64').toString('binary')
  5786. }
  5787. /***/ }),
  5788. /***/ 370:
  5789. /***/ (function(module) {
  5790. module.exports = deprecate
  5791. const loggedMessages = {}
  5792. function deprecate (message) {
  5793. if (loggedMessages[message]) {
  5794. return
  5795. }
  5796. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5797. loggedMessages[message] = 1
  5798. }
  5799. /***/ }),
  5800. /***/ 372:
  5801. /***/ (function(module) {
  5802. module.exports = octokitDebug;
  5803. function octokitDebug(octokit) {
  5804. octokit.hook.wrap("request", (request, options) => {
  5805. octokit.log.debug("request", options);
  5806. const start = Date.now();
  5807. const requestOptions = octokit.request.endpoint.parse(options);
  5808. const path = requestOptions.url.replace(options.baseUrl, "");
  5809. return request(options)
  5810. .then(response => {
  5811. octokit.log.info(
  5812. `${requestOptions.method} ${path} - ${
  5813. response.status
  5814. } in ${Date.now() - start}ms`
  5815. );
  5816. return response;
  5817. })
  5818. .catch(error => {
  5819. octokit.log.info(
  5820. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5821. start}ms`
  5822. );
  5823. throw error;
  5824. });
  5825. });
  5826. }
  5827. /***/ }),
  5828. /***/ 385:
  5829. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5830. "use strict";
  5831. Object.defineProperty(exports, '__esModule', { value: true });
  5832. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5833. var isPlainObject = _interopDefault(__webpack_require__(696));
  5834. var universalUserAgent = __webpack_require__(796);
  5835. function lowercaseKeys(object) {
  5836. if (!object) {
  5837. return {};
  5838. }
  5839. return Object.keys(object).reduce((newObj, key) => {
  5840. newObj[key.toLowerCase()] = object[key];
  5841. return newObj;
  5842. }, {});
  5843. }
  5844. function mergeDeep(defaults, options) {
  5845. const result = Object.assign({}, defaults);
  5846. Object.keys(options).forEach(key => {
  5847. if (isPlainObject(options[key])) {
  5848. if (!(key in defaults)) Object.assign(result, {
  5849. [key]: options[key]
  5850. });else result[key] = mergeDeep(defaults[key], options[key]);
  5851. } else {
  5852. Object.assign(result, {
  5853. [key]: options[key]
  5854. });
  5855. }
  5856. });
  5857. return result;
  5858. }
  5859. function merge(defaults, route, options) {
  5860. if (typeof route === "string") {
  5861. let [method, url] = route.split(" ");
  5862. options = Object.assign(url ? {
  5863. method,
  5864. url
  5865. } : {
  5866. url: method
  5867. }, options);
  5868. } else {
  5869. options = Object.assign({}, route);
  5870. } // lowercase header names before merging with defaults to avoid duplicates
  5871. options.headers = lowercaseKeys(options.headers);
  5872. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5873. if (defaults && defaults.mediaType.previews.length) {
  5874. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5875. }
  5876. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5877. return mergedOptions;
  5878. }
  5879. function addQueryParameters(url, parameters) {
  5880. const separator = /\?/.test(url) ? "&" : "?";
  5881. const names = Object.keys(parameters);
  5882. if (names.length === 0) {
  5883. return url;
  5884. }
  5885. return url + separator + names.map(name => {
  5886. if (name === "q") {
  5887. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5888. }
  5889. return `${name}=${encodeURIComponent(parameters[name])}`;
  5890. }).join("&");
  5891. }
  5892. const urlVariableRegex = /\{[^}]+\}/g;
  5893. function removeNonChars(variableName) {
  5894. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5895. }
  5896. function extractUrlVariableNames(url) {
  5897. const matches = url.match(urlVariableRegex);
  5898. if (!matches) {
  5899. return [];
  5900. }
  5901. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5902. }
  5903. function omit(object, keysToOmit) {
  5904. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5905. obj[key] = object[key];
  5906. return obj;
  5907. }, {});
  5908. }
  5909. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5910. // TODO: create separate package.
  5911. //
  5912. // Copyright (c) 2012-2014, Bram Stein
  5913. // All rights reserved.
  5914. // Redistribution and use in source and binary forms, with or without
  5915. // modification, are permitted provided that the following conditions
  5916. // are met:
  5917. // 1. Redistributions of source code must retain the above copyright
  5918. // notice, this list of conditions and the following disclaimer.
  5919. // 2. Redistributions in binary form must reproduce the above copyright
  5920. // notice, this list of conditions and the following disclaimer in the
  5921. // documentation and/or other materials provided with the distribution.
  5922. // 3. The name of the author may not be used to endorse or promote products
  5923. // derived from this software without specific prior written permission.
  5924. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5925. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5926. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5927. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5928. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5929. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5930. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5931. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5932. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5933. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5934. /* istanbul ignore file */
  5935. function encodeReserved(str) {
  5936. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5937. if (!/%[0-9A-Fa-f]/.test(part)) {
  5938. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5939. }
  5940. return part;
  5941. }).join("");
  5942. }
  5943. function encodeUnreserved(str) {
  5944. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5945. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5946. });
  5947. }
  5948. function encodeValue(operator, value, key) {
  5949. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5950. if (key) {
  5951. return encodeUnreserved(key) + "=" + value;
  5952. } else {
  5953. return value;
  5954. }
  5955. }
  5956. function isDefined(value) {
  5957. return value !== undefined && value !== null;
  5958. }
  5959. function isKeyOperator(operator) {
  5960. return operator === ";" || operator === "&" || operator === "?";
  5961. }
  5962. function getValues(context, operator, key, modifier) {
  5963. var value = context[key],
  5964. result = [];
  5965. if (isDefined(value) && value !== "") {
  5966. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5967. value = value.toString();
  5968. if (modifier && modifier !== "*") {
  5969. value = value.substring(0, parseInt(modifier, 10));
  5970. }
  5971. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5972. } else {
  5973. if (modifier === "*") {
  5974. if (Array.isArray(value)) {
  5975. value.filter(isDefined).forEach(function (value) {
  5976. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5977. });
  5978. } else {
  5979. Object.keys(value).forEach(function (k) {
  5980. if (isDefined(value[k])) {
  5981. result.push(encodeValue(operator, value[k], k));
  5982. }
  5983. });
  5984. }
  5985. } else {
  5986. const tmp = [];
  5987. if (Array.isArray(value)) {
  5988. value.filter(isDefined).forEach(function (value) {
  5989. tmp.push(encodeValue(operator, value));
  5990. });
  5991. } else {
  5992. Object.keys(value).forEach(function (k) {
  5993. if (isDefined(value[k])) {
  5994. tmp.push(encodeUnreserved(k));
  5995. tmp.push(encodeValue(operator, value[k].toString()));
  5996. }
  5997. });
  5998. }
  5999. if (isKeyOperator(operator)) {
  6000. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  6001. } else if (tmp.length !== 0) {
  6002. result.push(tmp.join(","));
  6003. }
  6004. }
  6005. }
  6006. } else {
  6007. if (operator === ";") {
  6008. if (isDefined(value)) {
  6009. result.push(encodeUnreserved(key));
  6010. }
  6011. } else if (value === "" && (operator === "&" || operator === "?")) {
  6012. result.push(encodeUnreserved(key) + "=");
  6013. } else if (value === "") {
  6014. result.push("");
  6015. }
  6016. }
  6017. return result;
  6018. }
  6019. function parseUrl(template) {
  6020. return {
  6021. expand: expand.bind(null, template)
  6022. };
  6023. }
  6024. function expand(template, context) {
  6025. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6026. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6027. if (expression) {
  6028. let operator = "";
  6029. const values = [];
  6030. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6031. operator = expression.charAt(0);
  6032. expression = expression.substr(1);
  6033. }
  6034. expression.split(/,/g).forEach(function (variable) {
  6035. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6036. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6037. });
  6038. if (operator && operator !== "+") {
  6039. var separator = ",";
  6040. if (operator === "?") {
  6041. separator = "&";
  6042. } else if (operator !== "#") {
  6043. separator = operator;
  6044. }
  6045. return (values.length !== 0 ? operator : "") + values.join(separator);
  6046. } else {
  6047. return values.join(",");
  6048. }
  6049. } else {
  6050. return encodeReserved(literal);
  6051. }
  6052. });
  6053. }
  6054. function parse(options) {
  6055. // https://fetch.spec.whatwg.org/#methods
  6056. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6057. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6058. let headers = Object.assign({}, options.headers);
  6059. let body;
  6060. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6061. const urlVariableNames = extractUrlVariableNames(url);
  6062. url = parseUrl(url).expand(parameters);
  6063. if (!/^http/.test(url)) {
  6064. url = options.baseUrl + url;
  6065. }
  6066. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6067. const remainingParameters = omit(parameters, omittedParameters);
  6068. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6069. if (!isBinaryRequset) {
  6070. if (options.mediaType.format) {
  6071. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6072. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6073. }
  6074. if (options.mediaType.previews.length) {
  6075. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6076. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6077. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6078. return `application/vnd.github.${preview}-preview${format}`;
  6079. }).join(",");
  6080. }
  6081. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6082. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6083. if (["GET", "HEAD"].includes(method)) {
  6084. url = addQueryParameters(url, remainingParameters);
  6085. } else {
  6086. if ("data" in remainingParameters) {
  6087. body = remainingParameters.data;
  6088. } else {
  6089. if (Object.keys(remainingParameters).length) {
  6090. body = remainingParameters;
  6091. } else {
  6092. headers["content-length"] = 0;
  6093. }
  6094. }
  6095. } // default content-type for JSON if body is set
  6096. if (!headers["content-type"] && typeof body !== "undefined") {
  6097. headers["content-type"] = "application/json; charset=utf-8";
  6098. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6099. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6100. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6101. body = "";
  6102. } // Only return body/request keys if present
  6103. return Object.assign({
  6104. method,
  6105. url,
  6106. headers
  6107. }, typeof body !== "undefined" ? {
  6108. body
  6109. } : null, options.request ? {
  6110. request: options.request
  6111. } : null);
  6112. }
  6113. function endpointWithDefaults(defaults, route, options) {
  6114. return parse(merge(defaults, route, options));
  6115. }
  6116. function withDefaults(oldDefaults, newDefaults) {
  6117. const DEFAULTS = merge(oldDefaults, newDefaults);
  6118. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6119. return Object.assign(endpoint, {
  6120. DEFAULTS,
  6121. defaults: withDefaults.bind(null, DEFAULTS),
  6122. merge: merge.bind(null, DEFAULTS),
  6123. parse
  6124. });
  6125. }
  6126. const VERSION = "5.5.1";
  6127. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6128. // So we use RequestParameters and add method as additional required property.
  6129. const DEFAULTS = {
  6130. method: "GET",
  6131. baseUrl: "https://api.github.com",
  6132. headers: {
  6133. accept: "application/vnd.github.v3+json",
  6134. "user-agent": userAgent
  6135. },
  6136. mediaType: {
  6137. format: "",
  6138. previews: []
  6139. }
  6140. };
  6141. const endpoint = withDefaults(null, DEFAULTS);
  6142. exports.endpoint = endpoint;
  6143. //# sourceMappingURL=index.js.map
  6144. /***/ }),
  6145. /***/ 389:
  6146. /***/ (function(module, __unusedexports, __webpack_require__) {
  6147. "use strict";
  6148. const fs = __webpack_require__(747);
  6149. const shebangCommand = __webpack_require__(866);
  6150. function readShebang(command) {
  6151. // Read the first 150 bytes from the file
  6152. const size = 150;
  6153. let buffer;
  6154. if (Buffer.alloc) {
  6155. // Node.js v4.5+ / v5.10+
  6156. buffer = Buffer.alloc(size);
  6157. } else {
  6158. // Old Node.js API
  6159. buffer = new Buffer(size);
  6160. buffer.fill(0); // zero-fill
  6161. }
  6162. let fd;
  6163. try {
  6164. fd = fs.openSync(command, 'r');
  6165. fs.readSync(fd, buffer, 0, size, 0);
  6166. fs.closeSync(fd);
  6167. } catch (e) { /* Empty */ }
  6168. // Attempt to extract shebang (null is returned if not a shebang)
  6169. return shebangCommand(buffer.toString());
  6170. }
  6171. module.exports = readShebang;
  6172. /***/ }),
  6173. /***/ 402:
  6174. /***/ (function(module, __unusedexports, __webpack_require__) {
  6175. module.exports = Octokit;
  6176. const { request } = __webpack_require__(753);
  6177. const Hook = __webpack_require__(523);
  6178. const parseClientOptions = __webpack_require__(294);
  6179. function Octokit(plugins, options) {
  6180. options = options || {};
  6181. const hook = new Hook.Collection();
  6182. const log = Object.assign(
  6183. {
  6184. debug: () => {},
  6185. info: () => {},
  6186. warn: console.warn,
  6187. error: console.error
  6188. },
  6189. options && options.log
  6190. );
  6191. const api = {
  6192. hook,
  6193. log,
  6194. request: request.defaults(parseClientOptions(options, log, hook))
  6195. };
  6196. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6197. return api;
  6198. }
  6199. /***/ }),
  6200. /***/ 413:
  6201. /***/ (function(module) {
  6202. module.exports = require("stream");
  6203. /***/ }),
  6204. /***/ 417:
  6205. /***/ (function(module) {
  6206. module.exports = require("crypto");
  6207. /***/ }),
  6208. /***/ 427:
  6209. /***/ (function(module, __unusedexports, __webpack_require__) {
  6210. "use strict";
  6211. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6212. // In that case, fall back to a deprecated internal.
  6213. const util = __webpack_require__(669);
  6214. let uv;
  6215. if (typeof util.getSystemErrorName === 'function') {
  6216. module.exports = util.getSystemErrorName;
  6217. } else {
  6218. try {
  6219. uv = process.binding('uv');
  6220. if (typeof uv.errname !== 'function') {
  6221. throw new TypeError('uv.errname is not a function');
  6222. }
  6223. } catch (err) {
  6224. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6225. uv = null;
  6226. }
  6227. module.exports = code => errname(uv, code);
  6228. }
  6229. // Used for testing the fallback behavior
  6230. module.exports.__test__ = errname;
  6231. function errname(uv, code) {
  6232. if (uv) {
  6233. return uv.errname(code);
  6234. }
  6235. if (!(code < 0)) {
  6236. throw new Error('err >= 0');
  6237. }
  6238. return `Unknown system error ${code}`;
  6239. }
  6240. /***/ }),
  6241. /***/ 430:
  6242. /***/ (function(module, __unusedexports, __webpack_require__) {
  6243. module.exports = octokitValidate;
  6244. const validate = __webpack_require__(348);
  6245. function octokitValidate(octokit) {
  6246. octokit.hook.before("request", validate.bind(null, octokit));
  6247. }
  6248. /***/ }),
  6249. /***/ 431:
  6250. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6251. "use strict";
  6252. Object.defineProperty(exports, "__esModule", { value: true });
  6253. const os = __webpack_require__(87);
  6254. /**
  6255. * Commands
  6256. *
  6257. * Command Format:
  6258. * ##[name key=value;key=value]message
  6259. *
  6260. * Examples:
  6261. * ##[warning]This is the user warning message
  6262. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6263. */
  6264. function issueCommand(command, properties, message) {
  6265. const cmd = new Command(command, properties, message);
  6266. process.stdout.write(cmd.toString() + os.EOL);
  6267. }
  6268. exports.issueCommand = issueCommand;
  6269. function issue(name, message = '') {
  6270. issueCommand(name, {}, message);
  6271. }
  6272. exports.issue = issue;
  6273. const CMD_STRING = '::';
  6274. class Command {
  6275. constructor(command, properties, message) {
  6276. if (!command) {
  6277. command = 'missing.command';
  6278. }
  6279. this.command = command;
  6280. this.properties = properties;
  6281. this.message = message;
  6282. }
  6283. toString() {
  6284. let cmdStr = CMD_STRING + this.command;
  6285. if (this.properties && Object.keys(this.properties).length > 0) {
  6286. cmdStr += ' ';
  6287. for (const key in this.properties) {
  6288. if (this.properties.hasOwnProperty(key)) {
  6289. const val = this.properties[key];
  6290. if (val) {
  6291. // safely append the val - avoid blowing up when attempting to
  6292. // call .replace() if message is not a string for some reason
  6293. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6294. }
  6295. }
  6296. }
  6297. }
  6298. cmdStr += CMD_STRING;
  6299. // safely append the message - avoid blowing up when attempting to
  6300. // call .replace() if message is not a string for some reason
  6301. const message = `${this.message || ''}`;
  6302. cmdStr += escapeData(message);
  6303. return cmdStr;
  6304. }
  6305. }
  6306. function escapeData(s) {
  6307. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6308. }
  6309. function escape(s) {
  6310. return s
  6311. .replace(/\r/g, '%0D')
  6312. .replace(/\n/g, '%0A')
  6313. .replace(/]/g, '%5D')
  6314. .replace(/;/g, '%3B');
  6315. }
  6316. //# sourceMappingURL=command.js.map
  6317. /***/ }),
  6318. /***/ 438:
  6319. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6320. "use strict";
  6321. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6322. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6323. return new (P || (P = Promise))(function (resolve, reject) {
  6324. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6325. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6326. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6327. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6328. });
  6329. };
  6330. var __importStar = (this && this.__importStar) || function (mod) {
  6331. if (mod && mod.__esModule) return mod;
  6332. var result = {};
  6333. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6334. result["default"] = mod;
  6335. return result;
  6336. };
  6337. Object.defineProperty(exports, "__esModule", { value: true });
  6338. const assert = __importStar(__webpack_require__(357));
  6339. const core = __importStar(__webpack_require__(470));
  6340. const fs = __importStar(__webpack_require__(747));
  6341. const fsHelper = __importStar(__webpack_require__(618));
  6342. const io = __importStar(__webpack_require__(1));
  6343. const path = __importStar(__webpack_require__(622));
  6344. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  6345. return __awaiter(this, void 0, void 0, function* () {
  6346. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6347. assert.ok(repositoryUrl, 'Expected repositoryUrl to be defined');
  6348. // Indicates whether to delete the directory contents
  6349. let remove = false;
  6350. // Check whether using git or REST API
  6351. if (!git) {
  6352. remove = true;
  6353. }
  6354. // Fetch URL does not match
  6355. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6356. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6357. remove = true;
  6358. }
  6359. else {
  6360. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6361. const lockPaths = [
  6362. path.join(repositoryPath, '.git', 'index.lock'),
  6363. path.join(repositoryPath, '.git', 'shallow.lock')
  6364. ];
  6365. for (const lockPath of lockPaths) {
  6366. try {
  6367. yield io.rmRF(lockPath);
  6368. }
  6369. catch (error) {
  6370. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6371. }
  6372. }
  6373. try {
  6374. core.startGroup('Removing previously created refs, to avoid conflicts');
  6375. // Checkout detached HEAD
  6376. if (!(yield git.isDetached())) {
  6377. yield git.checkoutDetach();
  6378. }
  6379. // Remove all refs/heads/*
  6380. let branches = yield git.branchList(false);
  6381. for (const branch of branches) {
  6382. yield git.branchDelete(false, branch);
  6383. }
  6384. // Remove all refs/remotes/origin/* to avoid conflicts
  6385. branches = yield git.branchList(true);
  6386. for (const branch of branches) {
  6387. yield git.branchDelete(true, branch);
  6388. }
  6389. core.endGroup();
  6390. // Clean
  6391. if (clean) {
  6392. core.startGroup('Cleaning the repository');
  6393. if (!(yield git.tryClean())) {
  6394. 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}'.`);
  6395. remove = true;
  6396. }
  6397. else if (!(yield git.tryReset())) {
  6398. remove = true;
  6399. }
  6400. core.endGroup();
  6401. if (remove) {
  6402. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6403. }
  6404. }
  6405. }
  6406. catch (error) {
  6407. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6408. remove = true;
  6409. }
  6410. }
  6411. if (remove) {
  6412. // Delete the contents of the directory. Don't delete the directory itself
  6413. // since it might be the current working directory.
  6414. core.info(`Deleting the contents of '${repositoryPath}'`);
  6415. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6416. yield io.rmRF(path.join(repositoryPath, file));
  6417. }
  6418. }
  6419. });
  6420. }
  6421. exports.prepareExistingDirectory = prepareExistingDirectory;
  6422. /***/ }),
  6423. /***/ 453:
  6424. /***/ (function(module, __unusedexports, __webpack_require__) {
  6425. var once = __webpack_require__(969)
  6426. var eos = __webpack_require__(562)
  6427. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6428. var noop = function () {}
  6429. var ancient = /^v?\.0/.test(process.version)
  6430. var isFn = function (fn) {
  6431. return typeof fn === 'function'
  6432. }
  6433. var isFS = function (stream) {
  6434. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6435. if (!fs) return false // browser
  6436. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6437. }
  6438. var isRequest = function (stream) {
  6439. return stream.setHeader && isFn(stream.abort)
  6440. }
  6441. var destroyer = function (stream, reading, writing, callback) {
  6442. callback = once(callback)
  6443. var closed = false
  6444. stream.on('close', function () {
  6445. closed = true
  6446. })
  6447. eos(stream, {readable: reading, writable: writing}, function (err) {
  6448. if (err) return callback(err)
  6449. closed = true
  6450. callback()
  6451. })
  6452. var destroyed = false
  6453. return function (err) {
  6454. if (closed) return
  6455. if (destroyed) return
  6456. destroyed = true
  6457. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6458. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6459. if (isFn(stream.destroy)) return stream.destroy()
  6460. callback(err || new Error('stream was destroyed'))
  6461. }
  6462. }
  6463. var call = function (fn) {
  6464. fn()
  6465. }
  6466. var pipe = function (from, to) {
  6467. return from.pipe(to)
  6468. }
  6469. var pump = function () {
  6470. var streams = Array.prototype.slice.call(arguments)
  6471. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6472. if (Array.isArray(streams[0])) streams = streams[0]
  6473. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6474. var error
  6475. var destroys = streams.map(function (stream, i) {
  6476. var reading = i < streams.length - 1
  6477. var writing = i > 0
  6478. return destroyer(stream, reading, writing, function (err) {
  6479. if (!error) error = err
  6480. if (err) destroys.forEach(call)
  6481. if (reading) return
  6482. destroys.forEach(call)
  6483. callback(error)
  6484. })
  6485. })
  6486. return streams.reduce(pipe)
  6487. }
  6488. module.exports = pump
  6489. /***/ }),
  6490. /***/ 454:
  6491. /***/ (function(module, exports, __webpack_require__) {
  6492. "use strict";
  6493. Object.defineProperty(exports, '__esModule', { value: true });
  6494. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6495. var Stream = _interopDefault(__webpack_require__(413));
  6496. var http = _interopDefault(__webpack_require__(605));
  6497. var Url = _interopDefault(__webpack_require__(835));
  6498. var https = _interopDefault(__webpack_require__(211));
  6499. var zlib = _interopDefault(__webpack_require__(761));
  6500. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6501. // fix for "Readable" isn't a named export issue
  6502. const Readable = Stream.Readable;
  6503. const BUFFER = Symbol('buffer');
  6504. const TYPE = Symbol('type');
  6505. class Blob {
  6506. constructor() {
  6507. this[TYPE] = '';
  6508. const blobParts = arguments[0];
  6509. const options = arguments[1];
  6510. const buffers = [];
  6511. let size = 0;
  6512. if (blobParts) {
  6513. const a = blobParts;
  6514. const length = Number(a.length);
  6515. for (let i = 0; i < length; i++) {
  6516. const element = a[i];
  6517. let buffer;
  6518. if (element instanceof Buffer) {
  6519. buffer = element;
  6520. } else if (ArrayBuffer.isView(element)) {
  6521. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6522. } else if (element instanceof ArrayBuffer) {
  6523. buffer = Buffer.from(element);
  6524. } else if (element instanceof Blob) {
  6525. buffer = element[BUFFER];
  6526. } else {
  6527. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6528. }
  6529. size += buffer.length;
  6530. buffers.push(buffer);
  6531. }
  6532. }
  6533. this[BUFFER] = Buffer.concat(buffers);
  6534. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6535. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6536. this[TYPE] = type;
  6537. }
  6538. }
  6539. get size() {
  6540. return this[BUFFER].length;
  6541. }
  6542. get type() {
  6543. return this[TYPE];
  6544. }
  6545. text() {
  6546. return Promise.resolve(this[BUFFER].toString());
  6547. }
  6548. arrayBuffer() {
  6549. const buf = this[BUFFER];
  6550. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6551. return Promise.resolve(ab);
  6552. }
  6553. stream() {
  6554. const readable = new Readable();
  6555. readable._read = function () {};
  6556. readable.push(this[BUFFER]);
  6557. readable.push(null);
  6558. return readable;
  6559. }
  6560. toString() {
  6561. return '[object Blob]';
  6562. }
  6563. slice() {
  6564. const size = this.size;
  6565. const start = arguments[0];
  6566. const end = arguments[1];
  6567. let relativeStart, relativeEnd;
  6568. if (start === undefined) {
  6569. relativeStart = 0;
  6570. } else if (start < 0) {
  6571. relativeStart = Math.max(size + start, 0);
  6572. } else {
  6573. relativeStart = Math.min(start, size);
  6574. }
  6575. if (end === undefined) {
  6576. relativeEnd = size;
  6577. } else if (end < 0) {
  6578. relativeEnd = Math.max(size + end, 0);
  6579. } else {
  6580. relativeEnd = Math.min(end, size);
  6581. }
  6582. const span = Math.max(relativeEnd - relativeStart, 0);
  6583. const buffer = this[BUFFER];
  6584. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6585. const blob = new Blob([], { type: arguments[2] });
  6586. blob[BUFFER] = slicedBuffer;
  6587. return blob;
  6588. }
  6589. }
  6590. Object.defineProperties(Blob.prototype, {
  6591. size: { enumerable: true },
  6592. type: { enumerable: true },
  6593. slice: { enumerable: true }
  6594. });
  6595. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6596. value: 'Blob',
  6597. writable: false,
  6598. enumerable: false,
  6599. configurable: true
  6600. });
  6601. /**
  6602. * fetch-error.js
  6603. *
  6604. * FetchError interface for operational errors
  6605. */
  6606. /**
  6607. * Create FetchError instance
  6608. *
  6609. * @param String message Error message for human
  6610. * @param String type Error type for machine
  6611. * @param String systemError For Node.js system error
  6612. * @return FetchError
  6613. */
  6614. function FetchError(message, type, systemError) {
  6615. Error.call(this, message);
  6616. this.message = message;
  6617. this.type = type;
  6618. // when err.type is `system`, err.code contains system error code
  6619. if (systemError) {
  6620. this.code = this.errno = systemError.code;
  6621. }
  6622. // hide custom error implementation details from end-users
  6623. Error.captureStackTrace(this, this.constructor);
  6624. }
  6625. FetchError.prototype = Object.create(Error.prototype);
  6626. FetchError.prototype.constructor = FetchError;
  6627. FetchError.prototype.name = 'FetchError';
  6628. let convert;
  6629. try {
  6630. convert = __webpack_require__(18).convert;
  6631. } catch (e) {}
  6632. const INTERNALS = Symbol('Body internals');
  6633. // fix an issue where "PassThrough" isn't a named export for node <10
  6634. const PassThrough = Stream.PassThrough;
  6635. /**
  6636. * Body mixin
  6637. *
  6638. * Ref: https://fetch.spec.whatwg.org/#body
  6639. *
  6640. * @param Stream body Readable stream
  6641. * @param Object opts Response options
  6642. * @return Void
  6643. */
  6644. function Body(body) {
  6645. var _this = this;
  6646. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6647. _ref$size = _ref.size;
  6648. let size = _ref$size === undefined ? 0 : _ref$size;
  6649. var _ref$timeout = _ref.timeout;
  6650. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6651. if (body == null) {
  6652. // body is undefined or null
  6653. body = null;
  6654. } else if (isURLSearchParams(body)) {
  6655. // body is a URLSearchParams
  6656. body = Buffer.from(body.toString());
  6657. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6658. // body is ArrayBuffer
  6659. body = Buffer.from(body);
  6660. } else if (ArrayBuffer.isView(body)) {
  6661. // body is ArrayBufferView
  6662. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6663. } else if (body instanceof Stream) ; else {
  6664. // none of the above
  6665. // coerce to string then buffer
  6666. body = Buffer.from(String(body));
  6667. }
  6668. this[INTERNALS] = {
  6669. body,
  6670. disturbed: false,
  6671. error: null
  6672. };
  6673. this.size = size;
  6674. this.timeout = timeout;
  6675. if (body instanceof Stream) {
  6676. body.on('error', function (err) {
  6677. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6678. _this[INTERNALS].error = error;
  6679. });
  6680. }
  6681. }
  6682. Body.prototype = {
  6683. get body() {
  6684. return this[INTERNALS].body;
  6685. },
  6686. get bodyUsed() {
  6687. return this[INTERNALS].disturbed;
  6688. },
  6689. /**
  6690. * Decode response as ArrayBuffer
  6691. *
  6692. * @return Promise
  6693. */
  6694. arrayBuffer() {
  6695. return consumeBody.call(this).then(function (buf) {
  6696. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6697. });
  6698. },
  6699. /**
  6700. * Return raw response as Blob
  6701. *
  6702. * @return Promise
  6703. */
  6704. blob() {
  6705. let ct = this.headers && this.headers.get('content-type') || '';
  6706. return consumeBody.call(this).then(function (buf) {
  6707. return Object.assign(
  6708. // Prevent copying
  6709. new Blob([], {
  6710. type: ct.toLowerCase()
  6711. }), {
  6712. [BUFFER]: buf
  6713. });
  6714. });
  6715. },
  6716. /**
  6717. * Decode response as json
  6718. *
  6719. * @return Promise
  6720. */
  6721. json() {
  6722. var _this2 = this;
  6723. return consumeBody.call(this).then(function (buffer) {
  6724. try {
  6725. return JSON.parse(buffer.toString());
  6726. } catch (err) {
  6727. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6728. }
  6729. });
  6730. },
  6731. /**
  6732. * Decode response as text
  6733. *
  6734. * @return Promise
  6735. */
  6736. text() {
  6737. return consumeBody.call(this).then(function (buffer) {
  6738. return buffer.toString();
  6739. });
  6740. },
  6741. /**
  6742. * Decode response as buffer (non-spec api)
  6743. *
  6744. * @return Promise
  6745. */
  6746. buffer() {
  6747. return consumeBody.call(this);
  6748. },
  6749. /**
  6750. * Decode response as text, while automatically detecting the encoding and
  6751. * trying to decode to UTF-8 (non-spec api)
  6752. *
  6753. * @return Promise
  6754. */
  6755. textConverted() {
  6756. var _this3 = this;
  6757. return consumeBody.call(this).then(function (buffer) {
  6758. return convertBody(buffer, _this3.headers);
  6759. });
  6760. }
  6761. };
  6762. // In browsers, all properties are enumerable.
  6763. Object.defineProperties(Body.prototype, {
  6764. body: { enumerable: true },
  6765. bodyUsed: { enumerable: true },
  6766. arrayBuffer: { enumerable: true },
  6767. blob: { enumerable: true },
  6768. json: { enumerable: true },
  6769. text: { enumerable: true }
  6770. });
  6771. Body.mixIn = function (proto) {
  6772. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6773. // istanbul ignore else: future proof
  6774. if (!(name in proto)) {
  6775. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6776. Object.defineProperty(proto, name, desc);
  6777. }
  6778. }
  6779. };
  6780. /**
  6781. * Consume and convert an entire Body to a Buffer.
  6782. *
  6783. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6784. *
  6785. * @return Promise
  6786. */
  6787. function consumeBody() {
  6788. var _this4 = this;
  6789. if (this[INTERNALS].disturbed) {
  6790. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6791. }
  6792. this[INTERNALS].disturbed = true;
  6793. if (this[INTERNALS].error) {
  6794. return Body.Promise.reject(this[INTERNALS].error);
  6795. }
  6796. let body = this.body;
  6797. // body is null
  6798. if (body === null) {
  6799. return Body.Promise.resolve(Buffer.alloc(0));
  6800. }
  6801. // body is blob
  6802. if (isBlob(body)) {
  6803. body = body.stream();
  6804. }
  6805. // body is buffer
  6806. if (Buffer.isBuffer(body)) {
  6807. return Body.Promise.resolve(body);
  6808. }
  6809. // istanbul ignore if: should never happen
  6810. if (!(body instanceof Stream)) {
  6811. return Body.Promise.resolve(Buffer.alloc(0));
  6812. }
  6813. // body is stream
  6814. // get ready to actually consume the body
  6815. let accum = [];
  6816. let accumBytes = 0;
  6817. let abort = false;
  6818. return new Body.Promise(function (resolve, reject) {
  6819. let resTimeout;
  6820. // allow timeout on slow response body
  6821. if (_this4.timeout) {
  6822. resTimeout = setTimeout(function () {
  6823. abort = true;
  6824. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6825. }, _this4.timeout);
  6826. }
  6827. // handle stream errors
  6828. body.on('error', function (err) {
  6829. if (err.name === 'AbortError') {
  6830. // if the request was aborted, reject with this Error
  6831. abort = true;
  6832. reject(err);
  6833. } else {
  6834. // other errors, such as incorrect content-encoding
  6835. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6836. }
  6837. });
  6838. body.on('data', function (chunk) {
  6839. if (abort || chunk === null) {
  6840. return;
  6841. }
  6842. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6843. abort = true;
  6844. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6845. return;
  6846. }
  6847. accumBytes += chunk.length;
  6848. accum.push(chunk);
  6849. });
  6850. body.on('end', function () {
  6851. if (abort) {
  6852. return;
  6853. }
  6854. clearTimeout(resTimeout);
  6855. try {
  6856. resolve(Buffer.concat(accum, accumBytes));
  6857. } catch (err) {
  6858. // handle streams that have accumulated too much data (issue #414)
  6859. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6860. }
  6861. });
  6862. });
  6863. }
  6864. /**
  6865. * Detect buffer encoding and convert to target encoding
  6866. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6867. *
  6868. * @param Buffer buffer Incoming buffer
  6869. * @param String encoding Target encoding
  6870. * @return String
  6871. */
  6872. function convertBody(buffer, headers) {
  6873. if (typeof convert !== 'function') {
  6874. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6875. }
  6876. const ct = headers.get('content-type');
  6877. let charset = 'utf-8';
  6878. let res, str;
  6879. // header
  6880. if (ct) {
  6881. res = /charset=([^;]*)/i.exec(ct);
  6882. }
  6883. // no charset in content type, peek at response body for at most 1024 bytes
  6884. str = buffer.slice(0, 1024).toString();
  6885. // html5
  6886. if (!res && str) {
  6887. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6888. }
  6889. // html4
  6890. if (!res && str) {
  6891. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6892. if (res) {
  6893. res = /charset=(.*)/i.exec(res.pop());
  6894. }
  6895. }
  6896. // xml
  6897. if (!res && str) {
  6898. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6899. }
  6900. // found charset
  6901. if (res) {
  6902. charset = res.pop();
  6903. // prevent decode issues when sites use incorrect encoding
  6904. // ref: https://hsivonen.fi/encoding-menu/
  6905. if (charset === 'gb2312' || charset === 'gbk') {
  6906. charset = 'gb18030';
  6907. }
  6908. }
  6909. // turn raw buffers into a single utf-8 buffer
  6910. return convert(buffer, 'UTF-8', charset).toString();
  6911. }
  6912. /**
  6913. * Detect a URLSearchParams object
  6914. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6915. *
  6916. * @param Object obj Object to detect by type or brand
  6917. * @return String
  6918. */
  6919. function isURLSearchParams(obj) {
  6920. // Duck-typing as a necessary condition.
  6921. 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') {
  6922. return false;
  6923. }
  6924. // Brand-checking and more duck-typing as optional condition.
  6925. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6926. }
  6927. /**
  6928. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6929. * @param {*} obj
  6930. * @return {boolean}
  6931. */
  6932. function isBlob(obj) {
  6933. 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]);
  6934. }
  6935. /**
  6936. * Clone body given Res/Req instance
  6937. *
  6938. * @param Mixed instance Response or Request instance
  6939. * @return Mixed
  6940. */
  6941. function clone(instance) {
  6942. let p1, p2;
  6943. let body = instance.body;
  6944. // don't allow cloning a used body
  6945. if (instance.bodyUsed) {
  6946. throw new Error('cannot clone body after it is used');
  6947. }
  6948. // check that body is a stream and not form-data object
  6949. // note: we can't clone the form-data object without having it as a dependency
  6950. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6951. // tee instance body
  6952. p1 = new PassThrough();
  6953. p2 = new PassThrough();
  6954. body.pipe(p1);
  6955. body.pipe(p2);
  6956. // set instance body to teed body and return the other teed body
  6957. instance[INTERNALS].body = p1;
  6958. body = p2;
  6959. }
  6960. return body;
  6961. }
  6962. /**
  6963. * Performs the operation "extract a `Content-Type` value from |object|" as
  6964. * specified in the specification:
  6965. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6966. *
  6967. * This function assumes that instance.body is present.
  6968. *
  6969. * @param Mixed instance Any options.body input
  6970. */
  6971. function extractContentType(body) {
  6972. if (body === null) {
  6973. // body is null
  6974. return null;
  6975. } else if (typeof body === 'string') {
  6976. // body is string
  6977. return 'text/plain;charset=UTF-8';
  6978. } else if (isURLSearchParams(body)) {
  6979. // body is a URLSearchParams
  6980. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6981. } else if (isBlob(body)) {
  6982. // body is blob
  6983. return body.type || null;
  6984. } else if (Buffer.isBuffer(body)) {
  6985. // body is buffer
  6986. return null;
  6987. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6988. // body is ArrayBuffer
  6989. return null;
  6990. } else if (ArrayBuffer.isView(body)) {
  6991. // body is ArrayBufferView
  6992. return null;
  6993. } else if (typeof body.getBoundary === 'function') {
  6994. // detect form data input from form-data module
  6995. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6996. } else if (body instanceof Stream) {
  6997. // body is stream
  6998. // can't really do much about this
  6999. return null;
  7000. } else {
  7001. // Body constructor defaults other things to string
  7002. return 'text/plain;charset=UTF-8';
  7003. }
  7004. }
  7005. /**
  7006. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  7007. * For us, we have to explicitly get it with a function.
  7008. *
  7009. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  7010. *
  7011. * @param Body instance Instance of Body
  7012. * @return Number? Number of bytes, or null if not possible
  7013. */
  7014. function getTotalBytes(instance) {
  7015. const body = instance.body;
  7016. if (body === null) {
  7017. // body is null
  7018. return 0;
  7019. } else if (isBlob(body)) {
  7020. return body.size;
  7021. } else if (Buffer.isBuffer(body)) {
  7022. // body is buffer
  7023. return body.length;
  7024. } else if (body && typeof body.getLengthSync === 'function') {
  7025. // detect form data input from form-data module
  7026. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7027. body.hasKnownLength && body.hasKnownLength()) {
  7028. // 2.x
  7029. return body.getLengthSync();
  7030. }
  7031. return null;
  7032. } else {
  7033. // body is stream
  7034. return null;
  7035. }
  7036. }
  7037. /**
  7038. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7039. *
  7040. * @param Body instance Instance of Body
  7041. * @return Void
  7042. */
  7043. function writeToStream(dest, instance) {
  7044. const body = instance.body;
  7045. if (body === null) {
  7046. // body is null
  7047. dest.end();
  7048. } else if (isBlob(body)) {
  7049. body.stream().pipe(dest);
  7050. } else if (Buffer.isBuffer(body)) {
  7051. // body is buffer
  7052. dest.write(body);
  7053. dest.end();
  7054. } else {
  7055. // body is stream
  7056. body.pipe(dest);
  7057. }
  7058. }
  7059. // expose Promise
  7060. Body.Promise = global.Promise;
  7061. /**
  7062. * headers.js
  7063. *
  7064. * Headers class offers convenient helpers
  7065. */
  7066. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7067. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7068. function validateName(name) {
  7069. name = `${name}`;
  7070. if (invalidTokenRegex.test(name) || name === '') {
  7071. throw new TypeError(`${name} is not a legal HTTP header name`);
  7072. }
  7073. }
  7074. function validateValue(value) {
  7075. value = `${value}`;
  7076. if (invalidHeaderCharRegex.test(value)) {
  7077. throw new TypeError(`${value} is not a legal HTTP header value`);
  7078. }
  7079. }
  7080. /**
  7081. * Find the key in the map object given a header name.
  7082. *
  7083. * Returns undefined if not found.
  7084. *
  7085. * @param String name Header name
  7086. * @return String|Undefined
  7087. */
  7088. function find(map, name) {
  7089. name = name.toLowerCase();
  7090. for (const key in map) {
  7091. if (key.toLowerCase() === name) {
  7092. return key;
  7093. }
  7094. }
  7095. return undefined;
  7096. }
  7097. const MAP = Symbol('map');
  7098. class Headers {
  7099. /**
  7100. * Headers class
  7101. *
  7102. * @param Object headers Response headers
  7103. * @return Void
  7104. */
  7105. constructor() {
  7106. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7107. this[MAP] = Object.create(null);
  7108. if (init instanceof Headers) {
  7109. const rawHeaders = init.raw();
  7110. const headerNames = Object.keys(rawHeaders);
  7111. for (const headerName of headerNames) {
  7112. for (const value of rawHeaders[headerName]) {
  7113. this.append(headerName, value);
  7114. }
  7115. }
  7116. return;
  7117. }
  7118. // We don't worry about converting prop to ByteString here as append()
  7119. // will handle it.
  7120. if (init == null) ; else if (typeof init === 'object') {
  7121. const method = init[Symbol.iterator];
  7122. if (method != null) {
  7123. if (typeof method !== 'function') {
  7124. throw new TypeError('Header pairs must be iterable');
  7125. }
  7126. // sequence<sequence<ByteString>>
  7127. // Note: per spec we have to first exhaust the lists then process them
  7128. const pairs = [];
  7129. for (const pair of init) {
  7130. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7131. throw new TypeError('Each header pair must be iterable');
  7132. }
  7133. pairs.push(Array.from(pair));
  7134. }
  7135. for (const pair of pairs) {
  7136. if (pair.length !== 2) {
  7137. throw new TypeError('Each header pair must be a name/value tuple');
  7138. }
  7139. this.append(pair[0], pair[1]);
  7140. }
  7141. } else {
  7142. // record<ByteString, ByteString>
  7143. for (const key of Object.keys(init)) {
  7144. const value = init[key];
  7145. this.append(key, value);
  7146. }
  7147. }
  7148. } else {
  7149. throw new TypeError('Provided initializer must be an object');
  7150. }
  7151. }
  7152. /**
  7153. * Return combined header value given name
  7154. *
  7155. * @param String name Header name
  7156. * @return Mixed
  7157. */
  7158. get(name) {
  7159. name = `${name}`;
  7160. validateName(name);
  7161. const key = find(this[MAP], name);
  7162. if (key === undefined) {
  7163. return null;
  7164. }
  7165. return this[MAP][key].join(', ');
  7166. }
  7167. /**
  7168. * Iterate over all headers
  7169. *
  7170. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7171. * @param Boolean thisArg `this` context for callback function
  7172. * @return Void
  7173. */
  7174. forEach(callback) {
  7175. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7176. let pairs = getHeaders(this);
  7177. let i = 0;
  7178. while (i < pairs.length) {
  7179. var _pairs$i = pairs[i];
  7180. const name = _pairs$i[0],
  7181. value = _pairs$i[1];
  7182. callback.call(thisArg, value, name, this);
  7183. pairs = getHeaders(this);
  7184. i++;
  7185. }
  7186. }
  7187. /**
  7188. * Overwrite header values given name
  7189. *
  7190. * @param String name Header name
  7191. * @param String value Header value
  7192. * @return Void
  7193. */
  7194. set(name, value) {
  7195. name = `${name}`;
  7196. value = `${value}`;
  7197. validateName(name);
  7198. validateValue(value);
  7199. const key = find(this[MAP], name);
  7200. this[MAP][key !== undefined ? key : name] = [value];
  7201. }
  7202. /**
  7203. * Append a value onto existing header
  7204. *
  7205. * @param String name Header name
  7206. * @param String value Header value
  7207. * @return Void
  7208. */
  7209. append(name, value) {
  7210. name = `${name}`;
  7211. value = `${value}`;
  7212. validateName(name);
  7213. validateValue(value);
  7214. const key = find(this[MAP], name);
  7215. if (key !== undefined) {
  7216. this[MAP][key].push(value);
  7217. } else {
  7218. this[MAP][name] = [value];
  7219. }
  7220. }
  7221. /**
  7222. * Check for header name existence
  7223. *
  7224. * @param String name Header name
  7225. * @return Boolean
  7226. */
  7227. has(name) {
  7228. name = `${name}`;
  7229. validateName(name);
  7230. return find(this[MAP], name) !== undefined;
  7231. }
  7232. /**
  7233. * Delete all header values given name
  7234. *
  7235. * @param String name Header name
  7236. * @return Void
  7237. */
  7238. delete(name) {
  7239. name = `${name}`;
  7240. validateName(name);
  7241. const key = find(this[MAP], name);
  7242. if (key !== undefined) {
  7243. delete this[MAP][key];
  7244. }
  7245. }
  7246. /**
  7247. * Return raw headers (non-spec api)
  7248. *
  7249. * @return Object
  7250. */
  7251. raw() {
  7252. return this[MAP];
  7253. }
  7254. /**
  7255. * Get an iterator on keys.
  7256. *
  7257. * @return Iterator
  7258. */
  7259. keys() {
  7260. return createHeadersIterator(this, 'key');
  7261. }
  7262. /**
  7263. * Get an iterator on values.
  7264. *
  7265. * @return Iterator
  7266. */
  7267. values() {
  7268. return createHeadersIterator(this, 'value');
  7269. }
  7270. /**
  7271. * Get an iterator on entries.
  7272. *
  7273. * This is the default iterator of the Headers object.
  7274. *
  7275. * @return Iterator
  7276. */
  7277. [Symbol.iterator]() {
  7278. return createHeadersIterator(this, 'key+value');
  7279. }
  7280. }
  7281. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7282. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7283. value: 'Headers',
  7284. writable: false,
  7285. enumerable: false,
  7286. configurable: true
  7287. });
  7288. Object.defineProperties(Headers.prototype, {
  7289. get: { enumerable: true },
  7290. forEach: { enumerable: true },
  7291. set: { enumerable: true },
  7292. append: { enumerable: true },
  7293. has: { enumerable: true },
  7294. delete: { enumerable: true },
  7295. keys: { enumerable: true },
  7296. values: { enumerable: true },
  7297. entries: { enumerable: true }
  7298. });
  7299. function getHeaders(headers) {
  7300. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7301. const keys = Object.keys(headers[MAP]).sort();
  7302. return keys.map(kind === 'key' ? function (k) {
  7303. return k.toLowerCase();
  7304. } : kind === 'value' ? function (k) {
  7305. return headers[MAP][k].join(', ');
  7306. } : function (k) {
  7307. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7308. });
  7309. }
  7310. const INTERNAL = Symbol('internal');
  7311. function createHeadersIterator(target, kind) {
  7312. const iterator = Object.create(HeadersIteratorPrototype);
  7313. iterator[INTERNAL] = {
  7314. target,
  7315. kind,
  7316. index: 0
  7317. };
  7318. return iterator;
  7319. }
  7320. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7321. next() {
  7322. // istanbul ignore if
  7323. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7324. throw new TypeError('Value of `this` is not a HeadersIterator');
  7325. }
  7326. var _INTERNAL = this[INTERNAL];
  7327. const target = _INTERNAL.target,
  7328. kind = _INTERNAL.kind,
  7329. index = _INTERNAL.index;
  7330. const values = getHeaders(target, kind);
  7331. const len = values.length;
  7332. if (index >= len) {
  7333. return {
  7334. value: undefined,
  7335. done: true
  7336. };
  7337. }
  7338. this[INTERNAL].index = index + 1;
  7339. return {
  7340. value: values[index],
  7341. done: false
  7342. };
  7343. }
  7344. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7345. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7346. value: 'HeadersIterator',
  7347. writable: false,
  7348. enumerable: false,
  7349. configurable: true
  7350. });
  7351. /**
  7352. * Export the Headers object in a form that Node.js can consume.
  7353. *
  7354. * @param Headers headers
  7355. * @return Object
  7356. */
  7357. function exportNodeCompatibleHeaders(headers) {
  7358. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7359. // http.request() only supports string as Host header. This hack makes
  7360. // specifying custom Host header possible.
  7361. const hostHeaderKey = find(headers[MAP], 'Host');
  7362. if (hostHeaderKey !== undefined) {
  7363. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7364. }
  7365. return obj;
  7366. }
  7367. /**
  7368. * Create a Headers object from an object of headers, ignoring those that do
  7369. * not conform to HTTP grammar productions.
  7370. *
  7371. * @param Object obj Object of headers
  7372. * @return Headers
  7373. */
  7374. function createHeadersLenient(obj) {
  7375. const headers = new Headers();
  7376. for (const name of Object.keys(obj)) {
  7377. if (invalidTokenRegex.test(name)) {
  7378. continue;
  7379. }
  7380. if (Array.isArray(obj[name])) {
  7381. for (const val of obj[name]) {
  7382. if (invalidHeaderCharRegex.test(val)) {
  7383. continue;
  7384. }
  7385. if (headers[MAP][name] === undefined) {
  7386. headers[MAP][name] = [val];
  7387. } else {
  7388. headers[MAP][name].push(val);
  7389. }
  7390. }
  7391. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7392. headers[MAP][name] = [obj[name]];
  7393. }
  7394. }
  7395. return headers;
  7396. }
  7397. const INTERNALS$1 = Symbol('Response internals');
  7398. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7399. const STATUS_CODES = http.STATUS_CODES;
  7400. /**
  7401. * Response class
  7402. *
  7403. * @param Stream body Readable stream
  7404. * @param Object opts Response options
  7405. * @return Void
  7406. */
  7407. class Response {
  7408. constructor() {
  7409. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7410. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7411. Body.call(this, body, opts);
  7412. const status = opts.status || 200;
  7413. const headers = new Headers(opts.headers);
  7414. if (body != null && !headers.has('Content-Type')) {
  7415. const contentType = extractContentType(body);
  7416. if (contentType) {
  7417. headers.append('Content-Type', contentType);
  7418. }
  7419. }
  7420. this[INTERNALS$1] = {
  7421. url: opts.url,
  7422. status,
  7423. statusText: opts.statusText || STATUS_CODES[status],
  7424. headers,
  7425. counter: opts.counter
  7426. };
  7427. }
  7428. get url() {
  7429. return this[INTERNALS$1].url || '';
  7430. }
  7431. get status() {
  7432. return this[INTERNALS$1].status;
  7433. }
  7434. /**
  7435. * Convenience property representing if the request ended normally
  7436. */
  7437. get ok() {
  7438. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7439. }
  7440. get redirected() {
  7441. return this[INTERNALS$1].counter > 0;
  7442. }
  7443. get statusText() {
  7444. return this[INTERNALS$1].statusText;
  7445. }
  7446. get headers() {
  7447. return this[INTERNALS$1].headers;
  7448. }
  7449. /**
  7450. * Clone this response
  7451. *
  7452. * @return Response
  7453. */
  7454. clone() {
  7455. return new Response(clone(this), {
  7456. url: this.url,
  7457. status: this.status,
  7458. statusText: this.statusText,
  7459. headers: this.headers,
  7460. ok: this.ok,
  7461. redirected: this.redirected
  7462. });
  7463. }
  7464. }
  7465. Body.mixIn(Response.prototype);
  7466. Object.defineProperties(Response.prototype, {
  7467. url: { enumerable: true },
  7468. status: { enumerable: true },
  7469. ok: { enumerable: true },
  7470. redirected: { enumerable: true },
  7471. statusText: { enumerable: true },
  7472. headers: { enumerable: true },
  7473. clone: { enumerable: true }
  7474. });
  7475. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7476. value: 'Response',
  7477. writable: false,
  7478. enumerable: false,
  7479. configurable: true
  7480. });
  7481. const INTERNALS$2 = Symbol('Request internals');
  7482. // fix an issue where "format", "parse" aren't a named export for node <10
  7483. const parse_url = Url.parse;
  7484. const format_url = Url.format;
  7485. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7486. /**
  7487. * Check if a value is an instance of Request.
  7488. *
  7489. * @param Mixed input
  7490. * @return Boolean
  7491. */
  7492. function isRequest(input) {
  7493. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7494. }
  7495. function isAbortSignal(signal) {
  7496. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7497. return !!(proto && proto.constructor.name === 'AbortSignal');
  7498. }
  7499. /**
  7500. * Request class
  7501. *
  7502. * @param Mixed input Url or Request instance
  7503. * @param Object init Custom options
  7504. * @return Void
  7505. */
  7506. class Request {
  7507. constructor(input) {
  7508. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7509. let parsedURL;
  7510. // normalize input
  7511. if (!isRequest(input)) {
  7512. if (input && input.href) {
  7513. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7514. // will fall into this branch also (since their `toString()` will return
  7515. // `href` property anyway)
  7516. parsedURL = parse_url(input.href);
  7517. } else {
  7518. // coerce input to a string before attempting to parse
  7519. parsedURL = parse_url(`${input}`);
  7520. }
  7521. input = {};
  7522. } else {
  7523. parsedURL = parse_url(input.url);
  7524. }
  7525. let method = init.method || input.method || 'GET';
  7526. method = method.toUpperCase();
  7527. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7528. throw new TypeError('Request with GET/HEAD method cannot have body');
  7529. }
  7530. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7531. Body.call(this, inputBody, {
  7532. timeout: init.timeout || input.timeout || 0,
  7533. size: init.size || input.size || 0
  7534. });
  7535. const headers = new Headers(init.headers || input.headers || {});
  7536. if (inputBody != null && !headers.has('Content-Type')) {
  7537. const contentType = extractContentType(inputBody);
  7538. if (contentType) {
  7539. headers.append('Content-Type', contentType);
  7540. }
  7541. }
  7542. let signal = isRequest(input) ? input.signal : null;
  7543. if ('signal' in init) signal = init.signal;
  7544. if (signal != null && !isAbortSignal(signal)) {
  7545. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7546. }
  7547. this[INTERNALS$2] = {
  7548. method,
  7549. redirect: init.redirect || input.redirect || 'follow',
  7550. headers,
  7551. parsedURL,
  7552. signal
  7553. };
  7554. // node-fetch-only options
  7555. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7556. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7557. this.counter = init.counter || input.counter || 0;
  7558. this.agent = init.agent || input.agent;
  7559. }
  7560. get method() {
  7561. return this[INTERNALS$2].method;
  7562. }
  7563. get url() {
  7564. return format_url(this[INTERNALS$2].parsedURL);
  7565. }
  7566. get headers() {
  7567. return this[INTERNALS$2].headers;
  7568. }
  7569. get redirect() {
  7570. return this[INTERNALS$2].redirect;
  7571. }
  7572. get signal() {
  7573. return this[INTERNALS$2].signal;
  7574. }
  7575. /**
  7576. * Clone this request
  7577. *
  7578. * @return Request
  7579. */
  7580. clone() {
  7581. return new Request(this);
  7582. }
  7583. }
  7584. Body.mixIn(Request.prototype);
  7585. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7586. value: 'Request',
  7587. writable: false,
  7588. enumerable: false,
  7589. configurable: true
  7590. });
  7591. Object.defineProperties(Request.prototype, {
  7592. method: { enumerable: true },
  7593. url: { enumerable: true },
  7594. headers: { enumerable: true },
  7595. redirect: { enumerable: true },
  7596. clone: { enumerable: true },
  7597. signal: { enumerable: true }
  7598. });
  7599. /**
  7600. * Convert a Request to Node.js http request options.
  7601. *
  7602. * @param Request A Request instance
  7603. * @return Object The options object to be passed to http.request
  7604. */
  7605. function getNodeRequestOptions(request) {
  7606. const parsedURL = request[INTERNALS$2].parsedURL;
  7607. const headers = new Headers(request[INTERNALS$2].headers);
  7608. // fetch step 1.3
  7609. if (!headers.has('Accept')) {
  7610. headers.set('Accept', '*/*');
  7611. }
  7612. // Basic fetch
  7613. if (!parsedURL.protocol || !parsedURL.hostname) {
  7614. throw new TypeError('Only absolute URLs are supported');
  7615. }
  7616. if (!/^https?:$/.test(parsedURL.protocol)) {
  7617. throw new TypeError('Only HTTP(S) protocols are supported');
  7618. }
  7619. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7620. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7621. }
  7622. // HTTP-network-or-cache fetch steps 2.4-2.7
  7623. let contentLengthValue = null;
  7624. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7625. contentLengthValue = '0';
  7626. }
  7627. if (request.body != null) {
  7628. const totalBytes = getTotalBytes(request);
  7629. if (typeof totalBytes === 'number') {
  7630. contentLengthValue = String(totalBytes);
  7631. }
  7632. }
  7633. if (contentLengthValue) {
  7634. headers.set('Content-Length', contentLengthValue);
  7635. }
  7636. // HTTP-network-or-cache fetch step 2.11
  7637. if (!headers.has('User-Agent')) {
  7638. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7639. }
  7640. // HTTP-network-or-cache fetch step 2.15
  7641. if (request.compress && !headers.has('Accept-Encoding')) {
  7642. headers.set('Accept-Encoding', 'gzip,deflate');
  7643. }
  7644. let agent = request.agent;
  7645. if (typeof agent === 'function') {
  7646. agent = agent(parsedURL);
  7647. }
  7648. if (!headers.has('Connection') && !agent) {
  7649. headers.set('Connection', 'close');
  7650. }
  7651. // HTTP-network fetch step 4.2
  7652. // chunked encoding is handled by Node.js
  7653. return Object.assign({}, parsedURL, {
  7654. method: request.method,
  7655. headers: exportNodeCompatibleHeaders(headers),
  7656. agent
  7657. });
  7658. }
  7659. /**
  7660. * abort-error.js
  7661. *
  7662. * AbortError interface for cancelled requests
  7663. */
  7664. /**
  7665. * Create AbortError instance
  7666. *
  7667. * @param String message Error message for human
  7668. * @return AbortError
  7669. */
  7670. function AbortError(message) {
  7671. Error.call(this, message);
  7672. this.type = 'aborted';
  7673. this.message = message;
  7674. // hide custom error implementation details from end-users
  7675. Error.captureStackTrace(this, this.constructor);
  7676. }
  7677. AbortError.prototype = Object.create(Error.prototype);
  7678. AbortError.prototype.constructor = AbortError;
  7679. AbortError.prototype.name = 'AbortError';
  7680. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7681. const PassThrough$1 = Stream.PassThrough;
  7682. const resolve_url = Url.resolve;
  7683. /**
  7684. * Fetch function
  7685. *
  7686. * @param Mixed url Absolute url or Request instance
  7687. * @param Object opts Fetch options
  7688. * @return Promise
  7689. */
  7690. function fetch(url, opts) {
  7691. // allow custom promise
  7692. if (!fetch.Promise) {
  7693. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7694. }
  7695. Body.Promise = fetch.Promise;
  7696. // wrap http.request into fetch
  7697. return new fetch.Promise(function (resolve, reject) {
  7698. // build request object
  7699. const request = new Request(url, opts);
  7700. const options = getNodeRequestOptions(request);
  7701. const send = (options.protocol === 'https:' ? https : http).request;
  7702. const signal = request.signal;
  7703. let response = null;
  7704. const abort = function abort() {
  7705. let error = new AbortError('The user aborted a request.');
  7706. reject(error);
  7707. if (request.body && request.body instanceof Stream.Readable) {
  7708. request.body.destroy(error);
  7709. }
  7710. if (!response || !response.body) return;
  7711. response.body.emit('error', error);
  7712. };
  7713. if (signal && signal.aborted) {
  7714. abort();
  7715. return;
  7716. }
  7717. const abortAndFinalize = function abortAndFinalize() {
  7718. abort();
  7719. finalize();
  7720. };
  7721. // send request
  7722. const req = send(options);
  7723. let reqTimeout;
  7724. if (signal) {
  7725. signal.addEventListener('abort', abortAndFinalize);
  7726. }
  7727. function finalize() {
  7728. req.abort();
  7729. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7730. clearTimeout(reqTimeout);
  7731. }
  7732. if (request.timeout) {
  7733. req.once('socket', function (socket) {
  7734. reqTimeout = setTimeout(function () {
  7735. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7736. finalize();
  7737. }, request.timeout);
  7738. });
  7739. }
  7740. req.on('error', function (err) {
  7741. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7742. finalize();
  7743. });
  7744. req.on('response', function (res) {
  7745. clearTimeout(reqTimeout);
  7746. const headers = createHeadersLenient(res.headers);
  7747. // HTTP fetch step 5
  7748. if (fetch.isRedirect(res.statusCode)) {
  7749. // HTTP fetch step 5.2
  7750. const location = headers.get('Location');
  7751. // HTTP fetch step 5.3
  7752. const locationURL = location === null ? null : resolve_url(request.url, location);
  7753. // HTTP fetch step 5.5
  7754. switch (request.redirect) {
  7755. case 'error':
  7756. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7757. finalize();
  7758. return;
  7759. case 'manual':
  7760. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7761. if (locationURL !== null) {
  7762. // handle corrupted header
  7763. try {
  7764. headers.set('Location', locationURL);
  7765. } catch (err) {
  7766. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7767. reject(err);
  7768. }
  7769. }
  7770. break;
  7771. case 'follow':
  7772. // HTTP-redirect fetch step 2
  7773. if (locationURL === null) {
  7774. break;
  7775. }
  7776. // HTTP-redirect fetch step 5
  7777. if (request.counter >= request.follow) {
  7778. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7779. finalize();
  7780. return;
  7781. }
  7782. // HTTP-redirect fetch step 6 (counter increment)
  7783. // Create a new Request object.
  7784. const requestOpts = {
  7785. headers: new Headers(request.headers),
  7786. follow: request.follow,
  7787. counter: request.counter + 1,
  7788. agent: request.agent,
  7789. compress: request.compress,
  7790. method: request.method,
  7791. body: request.body,
  7792. signal: request.signal,
  7793. timeout: request.timeout
  7794. };
  7795. // HTTP-redirect fetch step 9
  7796. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7797. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7798. finalize();
  7799. return;
  7800. }
  7801. // HTTP-redirect fetch step 11
  7802. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7803. requestOpts.method = 'GET';
  7804. requestOpts.body = undefined;
  7805. requestOpts.headers.delete('content-length');
  7806. }
  7807. // HTTP-redirect fetch step 15
  7808. resolve(fetch(new Request(locationURL, requestOpts)));
  7809. finalize();
  7810. return;
  7811. }
  7812. }
  7813. // prepare response
  7814. res.once('end', function () {
  7815. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7816. });
  7817. let body = res.pipe(new PassThrough$1());
  7818. const response_options = {
  7819. url: request.url,
  7820. status: res.statusCode,
  7821. statusText: res.statusMessage,
  7822. headers: headers,
  7823. size: request.size,
  7824. timeout: request.timeout,
  7825. counter: request.counter
  7826. };
  7827. // HTTP-network fetch step 12.1.1.3
  7828. const codings = headers.get('Content-Encoding');
  7829. // HTTP-network fetch step 12.1.1.4: handle content codings
  7830. // in following scenarios we ignore compression support
  7831. // 1. compression support is disabled
  7832. // 2. HEAD request
  7833. // 3. no Content-Encoding header
  7834. // 4. no content response (204)
  7835. // 5. content not modified response (304)
  7836. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7837. response = new Response(body, response_options);
  7838. resolve(response);
  7839. return;
  7840. }
  7841. // For Node v6+
  7842. // Be less strict when decoding compressed responses, since sometimes
  7843. // servers send slightly invalid responses that are still accepted
  7844. // by common browsers.
  7845. // Always using Z_SYNC_FLUSH is what cURL does.
  7846. const zlibOptions = {
  7847. flush: zlib.Z_SYNC_FLUSH,
  7848. finishFlush: zlib.Z_SYNC_FLUSH
  7849. };
  7850. // for gzip
  7851. if (codings == 'gzip' || codings == 'x-gzip') {
  7852. body = body.pipe(zlib.createGunzip(zlibOptions));
  7853. response = new Response(body, response_options);
  7854. resolve(response);
  7855. return;
  7856. }
  7857. // for deflate
  7858. if (codings == 'deflate' || codings == 'x-deflate') {
  7859. // handle the infamous raw deflate response from old servers
  7860. // a hack for old IIS and Apache servers
  7861. const raw = res.pipe(new PassThrough$1());
  7862. raw.once('data', function (chunk) {
  7863. // see http://stackoverflow.com/questions/37519828
  7864. if ((chunk[0] & 0x0F) === 0x08) {
  7865. body = body.pipe(zlib.createInflate());
  7866. } else {
  7867. body = body.pipe(zlib.createInflateRaw());
  7868. }
  7869. response = new Response(body, response_options);
  7870. resolve(response);
  7871. });
  7872. return;
  7873. }
  7874. // for br
  7875. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7876. body = body.pipe(zlib.createBrotliDecompress());
  7877. response = new Response(body, response_options);
  7878. resolve(response);
  7879. return;
  7880. }
  7881. // otherwise, use response as-is
  7882. response = new Response(body, response_options);
  7883. resolve(response);
  7884. });
  7885. writeToStream(req, request);
  7886. });
  7887. }
  7888. /**
  7889. * Redirect code matching
  7890. *
  7891. * @param Number code Status code
  7892. * @return Boolean
  7893. */
  7894. fetch.isRedirect = function (code) {
  7895. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7896. };
  7897. // expose Promise
  7898. fetch.Promise = global.Promise;
  7899. module.exports = exports = fetch;
  7900. Object.defineProperty(exports, "__esModule", { value: true });
  7901. exports.default = exports;
  7902. exports.Headers = Headers;
  7903. exports.Request = Request;
  7904. exports.Response = Response;
  7905. exports.FetchError = FetchError;
  7906. /***/ }),
  7907. /***/ 462:
  7908. /***/ (function(module) {
  7909. "use strict";
  7910. // See http://www.robvanderwoude.com/escapechars.php
  7911. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7912. function escapeCommand(arg) {
  7913. // Escape meta chars
  7914. arg = arg.replace(metaCharsRegExp, '^$1');
  7915. return arg;
  7916. }
  7917. function escapeArgument(arg, doubleEscapeMetaChars) {
  7918. // Convert to string
  7919. arg = `${arg}`;
  7920. // Algorithm below is based on https://qntm.org/cmd
  7921. // Sequence of backslashes followed by a double quote:
  7922. // double up all the backslashes and escape the double quote
  7923. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7924. // Sequence of backslashes followed by the end of the string
  7925. // (which will become a double quote later):
  7926. // double up all the backslashes
  7927. arg = arg.replace(/(\\*)$/, '$1$1');
  7928. // All other backslashes occur literally
  7929. // Quote the whole thing:
  7930. arg = `"${arg}"`;
  7931. // Escape meta chars
  7932. arg = arg.replace(metaCharsRegExp, '^$1');
  7933. // Double escape meta chars if necessary
  7934. if (doubleEscapeMetaChars) {
  7935. arg = arg.replace(metaCharsRegExp, '^$1');
  7936. }
  7937. return arg;
  7938. }
  7939. module.exports.command = escapeCommand;
  7940. module.exports.argument = escapeArgument;
  7941. /***/ }),
  7942. /***/ 463:
  7943. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7944. "use strict";
  7945. Object.defineProperty(exports, '__esModule', { value: true });
  7946. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7947. var deprecation = __webpack_require__(692);
  7948. var once = _interopDefault(__webpack_require__(969));
  7949. const logOnce = once(deprecation => console.warn(deprecation));
  7950. /**
  7951. * Error with extra properties to help with debugging
  7952. */
  7953. class RequestError extends Error {
  7954. constructor(message, statusCode, options) {
  7955. super(message); // Maintains proper stack trace (only available on V8)
  7956. /* istanbul ignore next */
  7957. if (Error.captureStackTrace) {
  7958. Error.captureStackTrace(this, this.constructor);
  7959. }
  7960. this.name = "HttpError";
  7961. this.status = statusCode;
  7962. Object.defineProperty(this, "code", {
  7963. get() {
  7964. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7965. return statusCode;
  7966. }
  7967. });
  7968. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7969. const requestCopy = Object.assign({}, options.request);
  7970. if (options.request.headers.authorization) {
  7971. requestCopy.headers = Object.assign({}, options.request.headers, {
  7972. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7973. });
  7974. }
  7975. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7976. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7977. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7978. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7979. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7980. this.request = requestCopy;
  7981. }
  7982. }
  7983. exports.RequestError = RequestError;
  7984. //# sourceMappingURL=index.js.map
  7985. /***/ }),
  7986. /***/ 464:
  7987. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7988. "use strict";
  7989. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7990. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7991. return new (P || (P = Promise))(function (resolve, reject) {
  7992. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7993. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7994. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7995. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7996. });
  7997. };
  7998. var __importStar = (this && this.__importStar) || function (mod) {
  7999. if (mod && mod.__esModule) return mod;
  8000. var result = {};
  8001. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8002. result["default"] = mod;
  8003. return result;
  8004. };
  8005. var __importDefault = (this && this.__importDefault) || function (mod) {
  8006. return (mod && mod.__esModule) ? mod : { "default": mod };
  8007. };
  8008. Object.defineProperty(exports, "__esModule", { value: true });
  8009. const assert = __importStar(__webpack_require__(357));
  8010. const core = __importStar(__webpack_require__(470));
  8011. const fs = __importStar(__webpack_require__(747));
  8012. const github = __importStar(__webpack_require__(469));
  8013. const io = __importStar(__webpack_require__(1));
  8014. const path = __importStar(__webpack_require__(622));
  8015. const retryHelper = __importStar(__webpack_require__(587));
  8016. const toolCache = __importStar(__webpack_require__(533));
  8017. const urlHelper = __importStar(__webpack_require__(81));
  8018. const v4_1 = __importDefault(__webpack_require__(826));
  8019. const IS_WINDOWS = process.platform === 'win32';
  8020. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  8021. return __awaiter(this, void 0, void 0, function* () {
  8022. // Download the archive
  8023. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8024. core.info('Downloading the archive');
  8025. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8026. }));
  8027. // Write archive to disk
  8028. core.info('Writing archive to disk');
  8029. const uniqueId = v4_1.default();
  8030. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8031. yield fs.promises.writeFile(archivePath, archiveData);
  8032. archiveData = Buffer.from(''); // Free memory
  8033. // Extract archive
  8034. core.info('Extracting the archive');
  8035. const extractPath = path.join(repositoryPath, uniqueId);
  8036. yield io.mkdirP(extractPath);
  8037. if (IS_WINDOWS) {
  8038. yield toolCache.extractZip(archivePath, extractPath);
  8039. }
  8040. else {
  8041. yield toolCache.extractTar(archivePath, extractPath);
  8042. }
  8043. io.rmRF(archivePath);
  8044. // Determine the path of the repository content. The archive contains
  8045. // a top-level folder and the repository content is inside.
  8046. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8047. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8048. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8049. core.info(`Resolved version ${archiveVersion}`);
  8050. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8051. // Move the files
  8052. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8053. const sourcePath = path.join(tempRepositoryPath, fileName);
  8054. const targetPath = path.join(repositoryPath, fileName);
  8055. if (IS_WINDOWS) {
  8056. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8057. }
  8058. else {
  8059. yield io.mv(sourcePath, targetPath);
  8060. }
  8061. }
  8062. io.rmRF(extractPath);
  8063. });
  8064. }
  8065. exports.downloadRepository = downloadRepository;
  8066. function downloadArchive(authToken, owner, repo, ref, commit) {
  8067. return __awaiter(this, void 0, void 0, function* () {
  8068. const octokit = new github.GitHub(authToken, { baseUrl: urlHelper.getApiUrl() });
  8069. const params = {
  8070. owner: owner,
  8071. repo: repo,
  8072. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8073. ref: commit || ref
  8074. };
  8075. const response = yield octokit.repos.getArchiveLink(params);
  8076. if (response.status != 200) {
  8077. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8078. }
  8079. return Buffer.from(response.data); // response.data is ArrayBuffer
  8080. });
  8081. }
  8082. /***/ }),
  8083. /***/ 469:
  8084. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8085. "use strict";
  8086. var __importDefault = (this && this.__importDefault) || function (mod) {
  8087. return (mod && mod.__esModule) ? mod : { "default": mod };
  8088. };
  8089. var __importStar = (this && this.__importStar) || function (mod) {
  8090. if (mod && mod.__esModule) return mod;
  8091. var result = {};
  8092. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8093. result["default"] = mod;
  8094. return result;
  8095. };
  8096. Object.defineProperty(exports, "__esModule", { value: true });
  8097. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8098. const graphql_1 = __webpack_require__(898);
  8099. const rest_1 = __importDefault(__webpack_require__(0));
  8100. const Context = __importStar(__webpack_require__(262));
  8101. const httpClient = __importStar(__webpack_require__(539));
  8102. // We need this in order to extend Octokit
  8103. rest_1.default.prototype = new rest_1.default();
  8104. exports.context = new Context.Context();
  8105. class GitHub extends rest_1.default {
  8106. constructor(token, opts) {
  8107. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8108. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8109. }
  8110. /**
  8111. * Disambiguates the constructor overload parameters
  8112. */
  8113. static disambiguate(token, opts) {
  8114. return [
  8115. typeof token === 'string' ? token : '',
  8116. typeof token === 'object' ? token : opts || {}
  8117. ];
  8118. }
  8119. static getOctokitOptions(args) {
  8120. const token = args[0];
  8121. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8122. // Auth
  8123. const auth = GitHub.getAuthString(token, options);
  8124. if (auth) {
  8125. options.auth = auth;
  8126. }
  8127. // Proxy
  8128. const agent = GitHub.getProxyAgent(options);
  8129. if (agent) {
  8130. // Shallow clone - don't mutate the object provided by the caller
  8131. options.request = options.request ? Object.assign({}, options.request) : {};
  8132. // Set the agent
  8133. options.request.agent = agent;
  8134. }
  8135. return options;
  8136. }
  8137. static getGraphQL(args) {
  8138. const defaults = {};
  8139. const token = args[0];
  8140. const options = args[1];
  8141. // Authorization
  8142. const auth = this.getAuthString(token, options);
  8143. if (auth) {
  8144. defaults.headers = {
  8145. authorization: auth
  8146. };
  8147. }
  8148. // Proxy
  8149. const agent = GitHub.getProxyAgent(options);
  8150. if (agent) {
  8151. defaults.request = { agent };
  8152. }
  8153. return graphql_1.graphql.defaults(defaults);
  8154. }
  8155. static getAuthString(token, options) {
  8156. // Validate args
  8157. if (!token && !options.auth) {
  8158. throw new Error('Parameter token or opts.auth is required');
  8159. }
  8160. else if (token && options.auth) {
  8161. throw new Error('Parameters token and opts.auth may not both be specified');
  8162. }
  8163. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8164. }
  8165. static getProxyAgent(options) {
  8166. var _a;
  8167. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8168. const serverUrl = 'https://api.github.com';
  8169. if (httpClient.getProxyUrl(serverUrl)) {
  8170. const hc = new httpClient.HttpClient();
  8171. return hc.getAgent(serverUrl);
  8172. }
  8173. }
  8174. return undefined;
  8175. }
  8176. }
  8177. exports.GitHub = GitHub;
  8178. //# sourceMappingURL=github.js.map
  8179. /***/ }),
  8180. /***/ 470:
  8181. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8182. "use strict";
  8183. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8184. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8185. return new (P || (P = Promise))(function (resolve, reject) {
  8186. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8187. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8188. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8189. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8190. });
  8191. };
  8192. Object.defineProperty(exports, "__esModule", { value: true });
  8193. const command_1 = __webpack_require__(431);
  8194. const os = __webpack_require__(87);
  8195. const path = __webpack_require__(622);
  8196. /**
  8197. * The code to exit an action
  8198. */
  8199. var ExitCode;
  8200. (function (ExitCode) {
  8201. /**
  8202. * A code indicating that the action was successful
  8203. */
  8204. ExitCode[ExitCode["Success"] = 0] = "Success";
  8205. /**
  8206. * A code indicating that the action was a failure
  8207. */
  8208. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8209. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8210. //-----------------------------------------------------------------------
  8211. // Variables
  8212. //-----------------------------------------------------------------------
  8213. /**
  8214. * Sets env variable for this action and future actions in the job
  8215. * @param name the name of the variable to set
  8216. * @param val the value of the variable
  8217. */
  8218. function exportVariable(name, val) {
  8219. process.env[name] = val;
  8220. command_1.issueCommand('set-env', { name }, val);
  8221. }
  8222. exports.exportVariable = exportVariable;
  8223. /**
  8224. * Registers a secret which will get masked from logs
  8225. * @param secret value of the secret
  8226. */
  8227. function setSecret(secret) {
  8228. command_1.issueCommand('add-mask', {}, secret);
  8229. }
  8230. exports.setSecret = setSecret;
  8231. /**
  8232. * Prepends inputPath to the PATH (for this action and future actions)
  8233. * @param inputPath
  8234. */
  8235. function addPath(inputPath) {
  8236. command_1.issueCommand('add-path', {}, inputPath);
  8237. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8238. }
  8239. exports.addPath = addPath;
  8240. /**
  8241. * Gets the value of an input. The value is also trimmed.
  8242. *
  8243. * @param name name of the input to get
  8244. * @param options optional. See InputOptions.
  8245. * @returns string
  8246. */
  8247. function getInput(name, options) {
  8248. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8249. if (options && options.required && !val) {
  8250. throw new Error(`Input required and not supplied: ${name}`);
  8251. }
  8252. return val.trim();
  8253. }
  8254. exports.getInput = getInput;
  8255. /**
  8256. * Sets the value of an output.
  8257. *
  8258. * @param name name of the output to set
  8259. * @param value value to store
  8260. */
  8261. function setOutput(name, value) {
  8262. command_1.issueCommand('set-output', { name }, value);
  8263. }
  8264. exports.setOutput = setOutput;
  8265. //-----------------------------------------------------------------------
  8266. // Results
  8267. //-----------------------------------------------------------------------
  8268. /**
  8269. * Sets the action status to failed.
  8270. * When the action exits it will be with an exit code of 1
  8271. * @param message add error issue message
  8272. */
  8273. function setFailed(message) {
  8274. process.exitCode = ExitCode.Failure;
  8275. error(message);
  8276. }
  8277. exports.setFailed = setFailed;
  8278. //-----------------------------------------------------------------------
  8279. // Logging Commands
  8280. //-----------------------------------------------------------------------
  8281. /**
  8282. * Writes debug message to user log
  8283. * @param message debug message
  8284. */
  8285. function debug(message) {
  8286. command_1.issueCommand('debug', {}, message);
  8287. }
  8288. exports.debug = debug;
  8289. /**
  8290. * Adds an error issue
  8291. * @param message error issue message
  8292. */
  8293. function error(message) {
  8294. command_1.issue('error', message);
  8295. }
  8296. exports.error = error;
  8297. /**
  8298. * Adds an warning issue
  8299. * @param message warning issue message
  8300. */
  8301. function warning(message) {
  8302. command_1.issue('warning', message);
  8303. }
  8304. exports.warning = warning;
  8305. /**
  8306. * Writes info to log with console.log.
  8307. * @param message info message
  8308. */
  8309. function info(message) {
  8310. process.stdout.write(message + os.EOL);
  8311. }
  8312. exports.info = info;
  8313. /**
  8314. * Begin an output group.
  8315. *
  8316. * Output until the next `groupEnd` will be foldable in this group
  8317. *
  8318. * @param name The name of the output group
  8319. */
  8320. function startGroup(name) {
  8321. command_1.issue('group', name);
  8322. }
  8323. exports.startGroup = startGroup;
  8324. /**
  8325. * End an output group.
  8326. */
  8327. function endGroup() {
  8328. command_1.issue('endgroup');
  8329. }
  8330. exports.endGroup = endGroup;
  8331. /**
  8332. * Wrap an asynchronous function call in a group.
  8333. *
  8334. * Returns the same type as the function itself.
  8335. *
  8336. * @param name The name of the group
  8337. * @param fn The function to wrap in the group
  8338. */
  8339. function group(name, fn) {
  8340. return __awaiter(this, void 0, void 0, function* () {
  8341. startGroup(name);
  8342. let result;
  8343. try {
  8344. result = yield fn();
  8345. }
  8346. finally {
  8347. endGroup();
  8348. }
  8349. return result;
  8350. });
  8351. }
  8352. exports.group = group;
  8353. //# sourceMappingURL=core.js.map
  8354. /***/ }),
  8355. /***/ 471:
  8356. /***/ (function(module, __unusedexports, __webpack_require__) {
  8357. module.exports = authenticationBeforeRequest;
  8358. const btoa = __webpack_require__(675);
  8359. const uniq = __webpack_require__(126);
  8360. function authenticationBeforeRequest(state, options) {
  8361. if (!state.auth.type) {
  8362. return;
  8363. }
  8364. if (state.auth.type === "basic") {
  8365. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8366. options.headers.authorization = `Basic ${hash}`;
  8367. return;
  8368. }
  8369. if (state.auth.type === "token") {
  8370. options.headers.authorization = `token ${state.auth.token}`;
  8371. return;
  8372. }
  8373. if (state.auth.type === "app") {
  8374. options.headers.authorization = `Bearer ${state.auth.token}`;
  8375. const acceptHeaders = options.headers.accept
  8376. .split(",")
  8377. .concat("application/vnd.github.machine-man-preview+json");
  8378. options.headers.accept = uniq(acceptHeaders)
  8379. .filter(Boolean)
  8380. .join(",");
  8381. return;
  8382. }
  8383. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8384. if (state.auth.token) {
  8385. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8386. return;
  8387. }
  8388. const key = encodeURIComponent(state.auth.key);
  8389. const secret = encodeURIComponent(state.auth.secret);
  8390. options.url += `client_id=${key}&client_secret=${secret}`;
  8391. }
  8392. /***/ }),
  8393. /***/ 489:
  8394. /***/ (function(module, __unusedexports, __webpack_require__) {
  8395. "use strict";
  8396. const path = __webpack_require__(622);
  8397. const which = __webpack_require__(814);
  8398. const pathKey = __webpack_require__(39)();
  8399. function resolveCommandAttempt(parsed, withoutPathExt) {
  8400. const cwd = process.cwd();
  8401. const hasCustomCwd = parsed.options.cwd != null;
  8402. // If a custom `cwd` was specified, we need to change the process cwd
  8403. // because `which` will do stat calls but does not support a custom cwd
  8404. if (hasCustomCwd) {
  8405. try {
  8406. process.chdir(parsed.options.cwd);
  8407. } catch (err) {
  8408. /* Empty */
  8409. }
  8410. }
  8411. let resolved;
  8412. try {
  8413. resolved = which.sync(parsed.command, {
  8414. path: (parsed.options.env || process.env)[pathKey],
  8415. pathExt: withoutPathExt ? path.delimiter : undefined,
  8416. });
  8417. } catch (e) {
  8418. /* Empty */
  8419. } finally {
  8420. process.chdir(cwd);
  8421. }
  8422. // If we successfully resolved, ensure that an absolute path is returned
  8423. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8424. if (resolved) {
  8425. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8426. }
  8427. return resolved;
  8428. }
  8429. function resolveCommand(parsed) {
  8430. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8431. }
  8432. module.exports = resolveCommand;
  8433. /***/ }),
  8434. /***/ 510:
  8435. /***/ (function(module) {
  8436. module.exports = addHook
  8437. function addHook (state, kind, name, hook) {
  8438. var orig = hook
  8439. if (!state.registry[name]) {
  8440. state.registry[name] = []
  8441. }
  8442. if (kind === 'before') {
  8443. hook = function (method, options) {
  8444. return Promise.resolve()
  8445. .then(orig.bind(null, options))
  8446. .then(method.bind(null, options))
  8447. }
  8448. }
  8449. if (kind === 'after') {
  8450. hook = function (method, options) {
  8451. var result
  8452. return Promise.resolve()
  8453. .then(method.bind(null, options))
  8454. .then(function (result_) {
  8455. result = result_
  8456. return orig(result, options)
  8457. })
  8458. .then(function () {
  8459. return result
  8460. })
  8461. }
  8462. }
  8463. if (kind === 'error') {
  8464. hook = function (method, options) {
  8465. return Promise.resolve()
  8466. .then(method.bind(null, options))
  8467. .catch(function (error) {
  8468. return orig(error, options)
  8469. })
  8470. }
  8471. }
  8472. state.registry[name].push({
  8473. hook: hook,
  8474. orig: orig
  8475. })
  8476. }
  8477. /***/ }),
  8478. /***/ 523:
  8479. /***/ (function(module, __unusedexports, __webpack_require__) {
  8480. var register = __webpack_require__(363)
  8481. var addHook = __webpack_require__(510)
  8482. var removeHook = __webpack_require__(763)
  8483. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8484. var bind = Function.bind
  8485. var bindable = bind.bind(bind)
  8486. function bindApi (hook, state, name) {
  8487. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8488. hook.api = { remove: removeHookRef }
  8489. hook.remove = removeHookRef
  8490. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8491. var args = name ? [state, kind, name] : [state, kind]
  8492. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8493. })
  8494. }
  8495. function HookSingular () {
  8496. var singularHookName = 'h'
  8497. var singularHookState = {
  8498. registry: {}
  8499. }
  8500. var singularHook = register.bind(null, singularHookState, singularHookName)
  8501. bindApi(singularHook, singularHookState, singularHookName)
  8502. return singularHook
  8503. }
  8504. function HookCollection () {
  8505. var state = {
  8506. registry: {}
  8507. }
  8508. var hook = register.bind(null, state)
  8509. bindApi(hook, state)
  8510. return hook
  8511. }
  8512. var collectionHookDeprecationMessageDisplayed = false
  8513. function Hook () {
  8514. if (!collectionHookDeprecationMessageDisplayed) {
  8515. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8516. collectionHookDeprecationMessageDisplayed = true
  8517. }
  8518. return HookCollection()
  8519. }
  8520. Hook.Singular = HookSingular.bind()
  8521. Hook.Collection = HookCollection.bind()
  8522. module.exports = Hook
  8523. // expose constructors as a named property for TypeScript
  8524. module.exports.Hook = Hook
  8525. module.exports.Singular = Hook.Singular
  8526. module.exports.Collection = Hook.Collection
  8527. /***/ }),
  8528. /***/ 528:
  8529. /***/ (function(__unusedmodule, exports) {
  8530. "use strict";
  8531. Object.defineProperty(exports, "__esModule", { value: true });
  8532. function escape(value) {
  8533. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8534. return `\\${x}`;
  8535. });
  8536. }
  8537. exports.escape = escape;
  8538. /***/ }),
  8539. /***/ 529:
  8540. /***/ (function(module, __unusedexports, __webpack_require__) {
  8541. const factory = __webpack_require__(47);
  8542. module.exports = factory();
  8543. /***/ }),
  8544. /***/ 533:
  8545. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8546. "use strict";
  8547. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8548. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8549. return new (P || (P = Promise))(function (resolve, reject) {
  8550. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8551. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8552. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8553. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8554. });
  8555. };
  8556. Object.defineProperty(exports, "__esModule", { value: true });
  8557. const core = __webpack_require__(470);
  8558. const io = __webpack_require__(1);
  8559. const fs = __webpack_require__(747);
  8560. const os = __webpack_require__(87);
  8561. const path = __webpack_require__(622);
  8562. const httpm = __webpack_require__(874);
  8563. const semver = __webpack_require__(656);
  8564. const uuidV4 = __webpack_require__(826);
  8565. const exec_1 = __webpack_require__(986);
  8566. const assert_1 = __webpack_require__(357);
  8567. class HTTPError extends Error {
  8568. constructor(httpStatusCode) {
  8569. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8570. this.httpStatusCode = httpStatusCode;
  8571. Object.setPrototypeOf(this, new.target.prototype);
  8572. }
  8573. }
  8574. exports.HTTPError = HTTPError;
  8575. const IS_WINDOWS = process.platform === 'win32';
  8576. const userAgent = 'actions/tool-cache';
  8577. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8578. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8579. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8580. // If directories not found, place them in common temp locations
  8581. if (!tempDirectory || !cacheRoot) {
  8582. let baseLocation;
  8583. if (IS_WINDOWS) {
  8584. // On windows use the USERPROFILE env variable
  8585. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8586. }
  8587. else {
  8588. if (process.platform === 'darwin') {
  8589. baseLocation = '/Users';
  8590. }
  8591. else {
  8592. baseLocation = '/home';
  8593. }
  8594. }
  8595. if (!tempDirectory) {
  8596. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8597. }
  8598. if (!cacheRoot) {
  8599. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8600. }
  8601. }
  8602. /**
  8603. * Download a tool from an url and stream it into a file
  8604. *
  8605. * @param url url of tool to download
  8606. * @returns path to downloaded tool
  8607. */
  8608. function downloadTool(url) {
  8609. return __awaiter(this, void 0, void 0, function* () {
  8610. // Wrap in a promise so that we can resolve from within stream callbacks
  8611. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8612. try {
  8613. const http = new httpm.HttpClient(userAgent, [], {
  8614. allowRetries: true,
  8615. maxRetries: 3
  8616. });
  8617. const destPath = path.join(tempDirectory, uuidV4());
  8618. yield io.mkdirP(tempDirectory);
  8619. core.debug(`Downloading ${url}`);
  8620. core.debug(`Downloading ${destPath}`);
  8621. if (fs.existsSync(destPath)) {
  8622. throw new Error(`Destination file path ${destPath} already exists`);
  8623. }
  8624. const response = yield http.get(url);
  8625. if (response.message.statusCode !== 200) {
  8626. const err = new HTTPError(response.message.statusCode);
  8627. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8628. throw err;
  8629. }
  8630. const file = fs.createWriteStream(destPath);
  8631. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8632. try {
  8633. const stream = response.message.pipe(file);
  8634. stream.on('close', () => {
  8635. core.debug('download complete');
  8636. resolve(destPath);
  8637. });
  8638. }
  8639. catch (err) {
  8640. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8641. reject(err);
  8642. }
  8643. }));
  8644. file.on('error', err => {
  8645. file.end();
  8646. reject(err);
  8647. });
  8648. }
  8649. catch (err) {
  8650. reject(err);
  8651. }
  8652. }));
  8653. });
  8654. }
  8655. exports.downloadTool = downloadTool;
  8656. /**
  8657. * Extract a .7z file
  8658. *
  8659. * @param file path to the .7z file
  8660. * @param dest destination directory. Optional.
  8661. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8662. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8663. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8664. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8665. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8666. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8667. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8668. * to 7zr.exe can be pass to this function.
  8669. * @returns path to the destination directory
  8670. */
  8671. function extract7z(file, dest, _7zPath) {
  8672. return __awaiter(this, void 0, void 0, function* () {
  8673. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8674. assert_1.ok(file, 'parameter "file" is required');
  8675. dest = dest || (yield _createExtractFolder(dest));
  8676. const originalCwd = process.cwd();
  8677. process.chdir(dest);
  8678. if (_7zPath) {
  8679. try {
  8680. const args = [
  8681. 'x',
  8682. '-bb1',
  8683. '-bd',
  8684. '-sccUTF-8',
  8685. file
  8686. ];
  8687. const options = {
  8688. silent: true
  8689. };
  8690. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8691. }
  8692. finally {
  8693. process.chdir(originalCwd);
  8694. }
  8695. }
  8696. else {
  8697. const escapedScript = path
  8698. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8699. .replace(/'/g, "''")
  8700. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8701. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8702. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8703. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8704. const args = [
  8705. '-NoLogo',
  8706. '-Sta',
  8707. '-NoProfile',
  8708. '-NonInteractive',
  8709. '-ExecutionPolicy',
  8710. 'Unrestricted',
  8711. '-Command',
  8712. command
  8713. ];
  8714. const options = {
  8715. silent: true
  8716. };
  8717. try {
  8718. const powershellPath = yield io.which('powershell', true);
  8719. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8720. }
  8721. finally {
  8722. process.chdir(originalCwd);
  8723. }
  8724. }
  8725. return dest;
  8726. });
  8727. }
  8728. exports.extract7z = extract7z;
  8729. /**
  8730. * Extract a tar
  8731. *
  8732. * @param file path to the tar
  8733. * @param dest destination directory. Optional.
  8734. * @param flags flags for the tar. Optional.
  8735. * @returns path to the destination directory
  8736. */
  8737. function extractTar(file, dest, flags = 'xz') {
  8738. return __awaiter(this, void 0, void 0, function* () {
  8739. if (!file) {
  8740. throw new Error("parameter 'file' is required");
  8741. }
  8742. dest = dest || (yield _createExtractFolder(dest));
  8743. const tarPath = yield io.which('tar', true);
  8744. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8745. return dest;
  8746. });
  8747. }
  8748. exports.extractTar = extractTar;
  8749. /**
  8750. * Extract a zip
  8751. *
  8752. * @param file path to the zip
  8753. * @param dest destination directory. Optional.
  8754. * @returns path to the destination directory
  8755. */
  8756. function extractZip(file, dest) {
  8757. return __awaiter(this, void 0, void 0, function* () {
  8758. if (!file) {
  8759. throw new Error("parameter 'file' is required");
  8760. }
  8761. dest = dest || (yield _createExtractFolder(dest));
  8762. if (IS_WINDOWS) {
  8763. yield extractZipWin(file, dest);
  8764. }
  8765. else {
  8766. yield extractZipNix(file, dest);
  8767. }
  8768. return dest;
  8769. });
  8770. }
  8771. exports.extractZip = extractZip;
  8772. function extractZipWin(file, dest) {
  8773. return __awaiter(this, void 0, void 0, function* () {
  8774. // build the powershell command
  8775. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8776. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8777. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8778. // run powershell
  8779. const powershellPath = yield io.which('powershell');
  8780. const args = [
  8781. '-NoLogo',
  8782. '-Sta',
  8783. '-NoProfile',
  8784. '-NonInteractive',
  8785. '-ExecutionPolicy',
  8786. 'Unrestricted',
  8787. '-Command',
  8788. command
  8789. ];
  8790. yield exec_1.exec(`"${powershellPath}"`, args);
  8791. });
  8792. }
  8793. function extractZipNix(file, dest) {
  8794. return __awaiter(this, void 0, void 0, function* () {
  8795. const unzipPath = yield io.which('unzip');
  8796. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8797. });
  8798. }
  8799. /**
  8800. * Caches a directory and installs it into the tool cacheDir
  8801. *
  8802. * @param sourceDir the directory to cache into tools
  8803. * @param tool tool name
  8804. * @param version version of the tool. semver format
  8805. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8806. */
  8807. function cacheDir(sourceDir, tool, version, arch) {
  8808. return __awaiter(this, void 0, void 0, function* () {
  8809. version = semver.clean(version) || version;
  8810. arch = arch || os.arch();
  8811. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8812. core.debug(`source dir: ${sourceDir}`);
  8813. if (!fs.statSync(sourceDir).isDirectory()) {
  8814. throw new Error('sourceDir is not a directory');
  8815. }
  8816. // Create the tool dir
  8817. const destPath = yield _createToolPath(tool, version, arch);
  8818. // copy each child item. do not move. move can fail on Windows
  8819. // due to anti-virus software having an open handle on a file.
  8820. for (const itemName of fs.readdirSync(sourceDir)) {
  8821. const s = path.join(sourceDir, itemName);
  8822. yield io.cp(s, destPath, { recursive: true });
  8823. }
  8824. // write .complete
  8825. _completeToolPath(tool, version, arch);
  8826. return destPath;
  8827. });
  8828. }
  8829. exports.cacheDir = cacheDir;
  8830. /**
  8831. * Caches a downloaded file (GUID) and installs it
  8832. * into the tool cache with a given targetName
  8833. *
  8834. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8835. * @param targetFile the name of the file name in the tools directory
  8836. * @param tool tool name
  8837. * @param version version of the tool. semver format
  8838. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8839. */
  8840. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8841. return __awaiter(this, void 0, void 0, function* () {
  8842. version = semver.clean(version) || version;
  8843. arch = arch || os.arch();
  8844. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8845. core.debug(`source file: ${sourceFile}`);
  8846. if (!fs.statSync(sourceFile).isFile()) {
  8847. throw new Error('sourceFile is not a file');
  8848. }
  8849. // create the tool dir
  8850. const destFolder = yield _createToolPath(tool, version, arch);
  8851. // copy instead of move. move can fail on Windows due to
  8852. // anti-virus software having an open handle on a file.
  8853. const destPath = path.join(destFolder, targetFile);
  8854. core.debug(`destination file ${destPath}`);
  8855. yield io.cp(sourceFile, destPath);
  8856. // write .complete
  8857. _completeToolPath(tool, version, arch);
  8858. return destFolder;
  8859. });
  8860. }
  8861. exports.cacheFile = cacheFile;
  8862. /**
  8863. * Finds the path to a tool version in the local installed tool cache
  8864. *
  8865. * @param toolName name of the tool
  8866. * @param versionSpec version of the tool
  8867. * @param arch optional arch. defaults to arch of computer
  8868. */
  8869. function find(toolName, versionSpec, arch) {
  8870. if (!toolName) {
  8871. throw new Error('toolName parameter is required');
  8872. }
  8873. if (!versionSpec) {
  8874. throw new Error('versionSpec parameter is required');
  8875. }
  8876. arch = arch || os.arch();
  8877. // attempt to resolve an explicit version
  8878. if (!_isExplicitVersion(versionSpec)) {
  8879. const localVersions = findAllVersions(toolName, arch);
  8880. const match = _evaluateVersions(localVersions, versionSpec);
  8881. versionSpec = match;
  8882. }
  8883. // check for the explicit version in the cache
  8884. let toolPath = '';
  8885. if (versionSpec) {
  8886. versionSpec = semver.clean(versionSpec) || '';
  8887. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8888. core.debug(`checking cache: ${cachePath}`);
  8889. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8890. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8891. toolPath = cachePath;
  8892. }
  8893. else {
  8894. core.debug('not found');
  8895. }
  8896. }
  8897. return toolPath;
  8898. }
  8899. exports.find = find;
  8900. /**
  8901. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8902. *
  8903. * @param toolName name of the tool
  8904. * @param arch optional arch. defaults to arch of computer
  8905. */
  8906. function findAllVersions(toolName, arch) {
  8907. const versions = [];
  8908. arch = arch || os.arch();
  8909. const toolPath = path.join(cacheRoot, toolName);
  8910. if (fs.existsSync(toolPath)) {
  8911. const children = fs.readdirSync(toolPath);
  8912. for (const child of children) {
  8913. if (_isExplicitVersion(child)) {
  8914. const fullPath = path.join(toolPath, child, arch || '');
  8915. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8916. versions.push(child);
  8917. }
  8918. }
  8919. }
  8920. }
  8921. return versions;
  8922. }
  8923. exports.findAllVersions = findAllVersions;
  8924. function _createExtractFolder(dest) {
  8925. return __awaiter(this, void 0, void 0, function* () {
  8926. if (!dest) {
  8927. // create a temp dir
  8928. dest = path.join(tempDirectory, uuidV4());
  8929. }
  8930. yield io.mkdirP(dest);
  8931. return dest;
  8932. });
  8933. }
  8934. function _createToolPath(tool, version, arch) {
  8935. return __awaiter(this, void 0, void 0, function* () {
  8936. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8937. core.debug(`destination ${folderPath}`);
  8938. const markerPath = `${folderPath}.complete`;
  8939. yield io.rmRF(folderPath);
  8940. yield io.rmRF(markerPath);
  8941. yield io.mkdirP(folderPath);
  8942. return folderPath;
  8943. });
  8944. }
  8945. function _completeToolPath(tool, version, arch) {
  8946. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8947. const markerPath = `${folderPath}.complete`;
  8948. fs.writeFileSync(markerPath, '');
  8949. core.debug('finished caching tool');
  8950. }
  8951. function _isExplicitVersion(versionSpec) {
  8952. const c = semver.clean(versionSpec) || '';
  8953. core.debug(`isExplicit: ${c}`);
  8954. const valid = semver.valid(c) != null;
  8955. core.debug(`explicit? ${valid}`);
  8956. return valid;
  8957. }
  8958. function _evaluateVersions(versions, versionSpec) {
  8959. let version = '';
  8960. core.debug(`evaluating ${versions.length} versions`);
  8961. versions = versions.sort((a, b) => {
  8962. if (semver.gt(a, b)) {
  8963. return 1;
  8964. }
  8965. return -1;
  8966. });
  8967. for (let i = versions.length - 1; i >= 0; i--) {
  8968. const potential = versions[i];
  8969. const satisfied = semver.satisfies(potential, versionSpec);
  8970. if (satisfied) {
  8971. version = potential;
  8972. break;
  8973. }
  8974. }
  8975. if (version) {
  8976. core.debug(`matched: ${version}`);
  8977. }
  8978. else {
  8979. core.debug('match not found');
  8980. }
  8981. return version;
  8982. }
  8983. //# sourceMappingURL=tool-cache.js.map
  8984. /***/ }),
  8985. /***/ 536:
  8986. /***/ (function(module, __unusedexports, __webpack_require__) {
  8987. module.exports = hasFirstPage
  8988. const deprecate = __webpack_require__(370)
  8989. const getPageLinks = __webpack_require__(577)
  8990. function hasFirstPage (link) {
  8991. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8992. return getPageLinks(link).first
  8993. }
  8994. /***/ }),
  8995. /***/ 539:
  8996. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8997. "use strict";
  8998. Object.defineProperty(exports, "__esModule", { value: true });
  8999. const url = __webpack_require__(835);
  9000. const http = __webpack_require__(605);
  9001. const https = __webpack_require__(211);
  9002. const pm = __webpack_require__(950);
  9003. let tunnel;
  9004. var HttpCodes;
  9005. (function (HttpCodes) {
  9006. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  9007. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  9008. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  9009. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  9010. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  9011. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  9012. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  9013. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  9014. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  9015. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  9016. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  9017. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  9018. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  9019. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  9020. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  9021. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  9022. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  9023. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  9024. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  9025. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9026. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9027. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9028. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9029. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9030. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9031. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9032. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9033. /**
  9034. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9035. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9036. */
  9037. function getProxyUrl(serverUrl) {
  9038. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9039. return proxyUrl ? proxyUrl.href : '';
  9040. }
  9041. exports.getProxyUrl = getProxyUrl;
  9042. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  9043. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  9044. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9045. const ExponentialBackoffCeiling = 10;
  9046. const ExponentialBackoffTimeSlice = 5;
  9047. class HttpClientResponse {
  9048. constructor(message) {
  9049. this.message = message;
  9050. }
  9051. readBody() {
  9052. return new Promise(async (resolve, reject) => {
  9053. let output = Buffer.alloc(0);
  9054. this.message.on('data', (chunk) => {
  9055. output = Buffer.concat([output, chunk]);
  9056. });
  9057. this.message.on('end', () => {
  9058. resolve(output.toString());
  9059. });
  9060. });
  9061. }
  9062. }
  9063. exports.HttpClientResponse = HttpClientResponse;
  9064. function isHttps(requestUrl) {
  9065. let parsedUrl = url.parse(requestUrl);
  9066. return parsedUrl.protocol === 'https:';
  9067. }
  9068. exports.isHttps = isHttps;
  9069. class HttpClient {
  9070. constructor(userAgent, handlers, requestOptions) {
  9071. this._ignoreSslError = false;
  9072. this._allowRedirects = true;
  9073. this._allowRedirectDowngrade = false;
  9074. this._maxRedirects = 50;
  9075. this._allowRetries = false;
  9076. this._maxRetries = 1;
  9077. this._keepAlive = false;
  9078. this._disposed = false;
  9079. this.userAgent = userAgent;
  9080. this.handlers = handlers || [];
  9081. this.requestOptions = requestOptions;
  9082. if (requestOptions) {
  9083. if (requestOptions.ignoreSslError != null) {
  9084. this._ignoreSslError = requestOptions.ignoreSslError;
  9085. }
  9086. this._socketTimeout = requestOptions.socketTimeout;
  9087. if (requestOptions.allowRedirects != null) {
  9088. this._allowRedirects = requestOptions.allowRedirects;
  9089. }
  9090. if (requestOptions.allowRedirectDowngrade != null) {
  9091. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9092. }
  9093. if (requestOptions.maxRedirects != null) {
  9094. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9095. }
  9096. if (requestOptions.keepAlive != null) {
  9097. this._keepAlive = requestOptions.keepAlive;
  9098. }
  9099. if (requestOptions.allowRetries != null) {
  9100. this._allowRetries = requestOptions.allowRetries;
  9101. }
  9102. if (requestOptions.maxRetries != null) {
  9103. this._maxRetries = requestOptions.maxRetries;
  9104. }
  9105. }
  9106. }
  9107. options(requestUrl, additionalHeaders) {
  9108. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9109. }
  9110. get(requestUrl, additionalHeaders) {
  9111. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9112. }
  9113. del(requestUrl, additionalHeaders) {
  9114. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9115. }
  9116. post(requestUrl, data, additionalHeaders) {
  9117. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9118. }
  9119. patch(requestUrl, data, additionalHeaders) {
  9120. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9121. }
  9122. put(requestUrl, data, additionalHeaders) {
  9123. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9124. }
  9125. head(requestUrl, additionalHeaders) {
  9126. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9127. }
  9128. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9129. return this.request(verb, requestUrl, stream, additionalHeaders);
  9130. }
  9131. /**
  9132. * Makes a raw http request.
  9133. * All other methods such as get, post, patch, and request ultimately call this.
  9134. * Prefer get, del, post and patch
  9135. */
  9136. async request(verb, requestUrl, data, headers) {
  9137. if (this._disposed) {
  9138. throw new Error("Client has already been disposed.");
  9139. }
  9140. let parsedUrl = url.parse(requestUrl);
  9141. let info = this._prepareRequest(verb, parsedUrl, headers);
  9142. // Only perform retries on reads since writes may not be idempotent.
  9143. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  9144. let numTries = 0;
  9145. let response;
  9146. while (numTries < maxTries) {
  9147. response = await this.requestRaw(info, data);
  9148. // Check if it's an authentication challenge
  9149. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  9150. let authenticationHandler;
  9151. for (let i = 0; i < this.handlers.length; i++) {
  9152. if (this.handlers[i].canHandleAuthentication(response)) {
  9153. authenticationHandler = this.handlers[i];
  9154. break;
  9155. }
  9156. }
  9157. if (authenticationHandler) {
  9158. return authenticationHandler.handleAuthentication(this, info, data);
  9159. }
  9160. else {
  9161. // We have received an unauthorized response but have no handlers to handle it.
  9162. // Let the response return to the caller.
  9163. return response;
  9164. }
  9165. }
  9166. let redirectsRemaining = this._maxRedirects;
  9167. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  9168. && this._allowRedirects
  9169. && redirectsRemaining > 0) {
  9170. const redirectUrl = response.message.headers["location"];
  9171. if (!redirectUrl) {
  9172. // if there's no location to redirect to, we won't
  9173. break;
  9174. }
  9175. let parsedRedirectUrl = url.parse(redirectUrl);
  9176. if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
  9177. throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");
  9178. }
  9179. // we need to finish reading the response before reassigning response
  9180. // which will leak the open socket.
  9181. await response.readBody();
  9182. // let's make the request with the new redirectUrl
  9183. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9184. response = await this.requestRaw(info, data);
  9185. redirectsRemaining--;
  9186. }
  9187. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9188. // If not a retry code, return immediately instead of retrying
  9189. return response;
  9190. }
  9191. numTries += 1;
  9192. if (numTries < maxTries) {
  9193. await response.readBody();
  9194. await this._performExponentialBackoff(numTries);
  9195. }
  9196. }
  9197. return response;
  9198. }
  9199. /**
  9200. * Needs to be called if keepAlive is set to true in request options.
  9201. */
  9202. dispose() {
  9203. if (this._agent) {
  9204. this._agent.destroy();
  9205. }
  9206. this._disposed = true;
  9207. }
  9208. /**
  9209. * Raw request.
  9210. * @param info
  9211. * @param data
  9212. */
  9213. requestRaw(info, data) {
  9214. return new Promise((resolve, reject) => {
  9215. let callbackForResult = function (err, res) {
  9216. if (err) {
  9217. reject(err);
  9218. }
  9219. resolve(res);
  9220. };
  9221. this.requestRawWithCallback(info, data, callbackForResult);
  9222. });
  9223. }
  9224. /**
  9225. * Raw request with callback.
  9226. * @param info
  9227. * @param data
  9228. * @param onResult
  9229. */
  9230. requestRawWithCallback(info, data, onResult) {
  9231. let socket;
  9232. if (typeof (data) === 'string') {
  9233. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  9234. }
  9235. let callbackCalled = false;
  9236. let handleResult = (err, res) => {
  9237. if (!callbackCalled) {
  9238. callbackCalled = true;
  9239. onResult(err, res);
  9240. }
  9241. };
  9242. let req = info.httpModule.request(info.options, (msg) => {
  9243. let res = new HttpClientResponse(msg);
  9244. handleResult(null, res);
  9245. });
  9246. req.on('socket', (sock) => {
  9247. socket = sock;
  9248. });
  9249. // If we ever get disconnected, we want the socket to timeout eventually
  9250. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9251. if (socket) {
  9252. socket.end();
  9253. }
  9254. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9255. });
  9256. req.on('error', function (err) {
  9257. // err has statusCode property
  9258. // res should have headers
  9259. handleResult(err, null);
  9260. });
  9261. if (data && typeof (data) === 'string') {
  9262. req.write(data, 'utf8');
  9263. }
  9264. if (data && typeof (data) !== 'string') {
  9265. data.on('close', function () {
  9266. req.end();
  9267. });
  9268. data.pipe(req);
  9269. }
  9270. else {
  9271. req.end();
  9272. }
  9273. }
  9274. /**
  9275. * Gets an http agent. This function is useful when you need an http agent that handles
  9276. * routing through a proxy server - depending upon the url and proxy environment variables.
  9277. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9278. */
  9279. getAgent(serverUrl) {
  9280. let parsedUrl = url.parse(serverUrl);
  9281. return this._getAgent(parsedUrl);
  9282. }
  9283. _prepareRequest(method, requestUrl, headers) {
  9284. const info = {};
  9285. info.parsedUrl = requestUrl;
  9286. const usingSsl = info.parsedUrl.protocol === 'https:';
  9287. info.httpModule = usingSsl ? https : http;
  9288. const defaultPort = usingSsl ? 443 : 80;
  9289. info.options = {};
  9290. info.options.host = info.parsedUrl.hostname;
  9291. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  9292. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9293. info.options.method = method;
  9294. info.options.headers = this._mergeHeaders(headers);
  9295. if (this.userAgent != null) {
  9296. info.options.headers["user-agent"] = this.userAgent;
  9297. }
  9298. info.options.agent = this._getAgent(info.parsedUrl);
  9299. // gives handlers an opportunity to participate
  9300. if (this.handlers) {
  9301. this.handlers.forEach((handler) => {
  9302. handler.prepareRequest(info.options);
  9303. });
  9304. }
  9305. return info;
  9306. }
  9307. _mergeHeaders(headers) {
  9308. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  9309. if (this.requestOptions && this.requestOptions.headers) {
  9310. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9311. }
  9312. return lowercaseKeys(headers || {});
  9313. }
  9314. _getAgent(parsedUrl) {
  9315. let agent;
  9316. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9317. let useProxy = proxyUrl && proxyUrl.hostname;
  9318. if (this._keepAlive && useProxy) {
  9319. agent = this._proxyAgent;
  9320. }
  9321. if (this._keepAlive && !useProxy) {
  9322. agent = this._agent;
  9323. }
  9324. // if agent is already assigned use that agent.
  9325. if (!!agent) {
  9326. return agent;
  9327. }
  9328. const usingSsl = parsedUrl.protocol === 'https:';
  9329. let maxSockets = 100;
  9330. if (!!this.requestOptions) {
  9331. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9332. }
  9333. if (useProxy) {
  9334. // If using proxy, need tunnel
  9335. if (!tunnel) {
  9336. tunnel = __webpack_require__(335);
  9337. }
  9338. const agentOptions = {
  9339. maxSockets: maxSockets,
  9340. keepAlive: this._keepAlive,
  9341. proxy: {
  9342. proxyAuth: proxyUrl.auth,
  9343. host: proxyUrl.hostname,
  9344. port: proxyUrl.port
  9345. },
  9346. };
  9347. let tunnelAgent;
  9348. const overHttps = proxyUrl.protocol === 'https:';
  9349. if (usingSsl) {
  9350. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9351. }
  9352. else {
  9353. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9354. }
  9355. agent = tunnelAgent(agentOptions);
  9356. this._proxyAgent = agent;
  9357. }
  9358. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9359. if (this._keepAlive && !agent) {
  9360. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9361. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9362. this._agent = agent;
  9363. }
  9364. // if not using private agent and tunnel agent isn't setup then use global agent
  9365. if (!agent) {
  9366. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9367. }
  9368. if (usingSsl && this._ignoreSslError) {
  9369. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9370. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9371. // we have to cast it to any and change it directly
  9372. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  9373. }
  9374. return agent;
  9375. }
  9376. _performExponentialBackoff(retryNumber) {
  9377. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9378. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9379. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9380. }
  9381. }
  9382. exports.HttpClient = HttpClient;
  9383. /***/ }),
  9384. /***/ 550:
  9385. /***/ (function(module, __unusedexports, __webpack_require__) {
  9386. module.exports = getNextPage
  9387. const getPage = __webpack_require__(265)
  9388. function getNextPage (octokit, link, headers) {
  9389. return getPage(octokit, link, 'next', headers)
  9390. }
  9391. /***/ }),
  9392. /***/ 558:
  9393. /***/ (function(module, __unusedexports, __webpack_require__) {
  9394. module.exports = hasPreviousPage
  9395. const deprecate = __webpack_require__(370)
  9396. const getPageLinks = __webpack_require__(577)
  9397. function hasPreviousPage (link) {
  9398. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9399. return getPageLinks(link).prev
  9400. }
  9401. /***/ }),
  9402. /***/ 559:
  9403. /***/ (function(__unusedmodule, exports) {
  9404. "use strict";
  9405. Object.defineProperty(exports, "__esModule", { value: true });
  9406. class GitVersion {
  9407. /**
  9408. * Used for comparing the version of git and git-lfs against the minimum required version
  9409. * @param version the version string, e.g. 1.2 or 1.2.3
  9410. */
  9411. constructor(version) {
  9412. this.major = NaN;
  9413. this.minor = NaN;
  9414. this.patch = NaN;
  9415. if (version) {
  9416. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9417. if (match) {
  9418. this.major = Number(match[1]);
  9419. this.minor = Number(match[2]);
  9420. if (match[4]) {
  9421. this.patch = Number(match[4]);
  9422. }
  9423. }
  9424. }
  9425. }
  9426. /**
  9427. * Compares the instance against a minimum required version
  9428. * @param minimum Minimum version
  9429. */
  9430. checkMinimum(minimum) {
  9431. if (!minimum.isValid()) {
  9432. throw new Error('Arg minimum is not a valid version');
  9433. }
  9434. // Major is insufficient
  9435. if (this.major < minimum.major) {
  9436. return false;
  9437. }
  9438. // Major is equal
  9439. if (this.major === minimum.major) {
  9440. // Minor is insufficient
  9441. if (this.minor < minimum.minor) {
  9442. return false;
  9443. }
  9444. // Minor is equal
  9445. if (this.minor === minimum.minor) {
  9446. // Patch is insufficient
  9447. if (this.patch && this.patch < (minimum.patch || 0)) {
  9448. return false;
  9449. }
  9450. }
  9451. }
  9452. return true;
  9453. }
  9454. /**
  9455. * Indicates whether the instance was constructed from a valid version string
  9456. */
  9457. isValid() {
  9458. return !isNaN(this.major);
  9459. }
  9460. /**
  9461. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9462. */
  9463. toString() {
  9464. let result = '';
  9465. if (this.isValid()) {
  9466. result = `${this.major}.${this.minor}`;
  9467. if (!isNaN(this.patch)) {
  9468. result += `.${this.patch}`;
  9469. }
  9470. }
  9471. return result;
  9472. }
  9473. }
  9474. exports.GitVersion = GitVersion;
  9475. /***/ }),
  9476. /***/ 562:
  9477. /***/ (function(module, __unusedexports, __webpack_require__) {
  9478. var once = __webpack_require__(969);
  9479. var noop = function() {};
  9480. var isRequest = function(stream) {
  9481. return stream.setHeader && typeof stream.abort === 'function';
  9482. };
  9483. var isChildProcess = function(stream) {
  9484. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9485. };
  9486. var eos = function(stream, opts, callback) {
  9487. if (typeof opts === 'function') return eos(stream, null, opts);
  9488. if (!opts) opts = {};
  9489. callback = once(callback || noop);
  9490. var ws = stream._writableState;
  9491. var rs = stream._readableState;
  9492. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9493. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9494. var cancelled = false;
  9495. var onlegacyfinish = function() {
  9496. if (!stream.writable) onfinish();
  9497. };
  9498. var onfinish = function() {
  9499. writable = false;
  9500. if (!readable) callback.call(stream);
  9501. };
  9502. var onend = function() {
  9503. readable = false;
  9504. if (!writable) callback.call(stream);
  9505. };
  9506. var onexit = function(exitCode) {
  9507. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9508. };
  9509. var onerror = function(err) {
  9510. callback.call(stream, err);
  9511. };
  9512. var onclose = function() {
  9513. process.nextTick(onclosenexttick);
  9514. };
  9515. var onclosenexttick = function() {
  9516. if (cancelled) return;
  9517. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9518. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9519. };
  9520. var onrequest = function() {
  9521. stream.req.on('finish', onfinish);
  9522. };
  9523. if (isRequest(stream)) {
  9524. stream.on('complete', onfinish);
  9525. stream.on('abort', onclose);
  9526. if (stream.req) onrequest();
  9527. else stream.on('request', onrequest);
  9528. } else if (writable && !ws) { // legacy streams
  9529. stream.on('end', onlegacyfinish);
  9530. stream.on('close', onlegacyfinish);
  9531. }
  9532. if (isChildProcess(stream)) stream.on('exit', onexit);
  9533. stream.on('end', onend);
  9534. stream.on('finish', onfinish);
  9535. if (opts.error !== false) stream.on('error', onerror);
  9536. stream.on('close', onclose);
  9537. return function() {
  9538. cancelled = true;
  9539. stream.removeListener('complete', onfinish);
  9540. stream.removeListener('abort', onclose);
  9541. stream.removeListener('request', onrequest);
  9542. if (stream.req) stream.req.removeListener('finish', onfinish);
  9543. stream.removeListener('end', onlegacyfinish);
  9544. stream.removeListener('close', onlegacyfinish);
  9545. stream.removeListener('finish', onfinish);
  9546. stream.removeListener('exit', onexit);
  9547. stream.removeListener('end', onend);
  9548. stream.removeListener('error', onerror);
  9549. stream.removeListener('close', onclose);
  9550. };
  9551. };
  9552. module.exports = eos;
  9553. /***/ }),
  9554. /***/ 563:
  9555. /***/ (function(module, __unusedexports, __webpack_require__) {
  9556. module.exports = getPreviousPage
  9557. const getPage = __webpack_require__(265)
  9558. function getPreviousPage (octokit, link, headers) {
  9559. return getPage(octokit, link, 'prev', headers)
  9560. }
  9561. /***/ }),
  9562. /***/ 568:
  9563. /***/ (function(module, __unusedexports, __webpack_require__) {
  9564. "use strict";
  9565. const path = __webpack_require__(622);
  9566. const niceTry = __webpack_require__(948);
  9567. const resolveCommand = __webpack_require__(489);
  9568. const escape = __webpack_require__(462);
  9569. const readShebang = __webpack_require__(389);
  9570. const semver = __webpack_require__(280);
  9571. const isWin = process.platform === 'win32';
  9572. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9573. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9574. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9575. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9576. function detectShebang(parsed) {
  9577. parsed.file = resolveCommand(parsed);
  9578. const shebang = parsed.file && readShebang(parsed.file);
  9579. if (shebang) {
  9580. parsed.args.unshift(parsed.file);
  9581. parsed.command = shebang;
  9582. return resolveCommand(parsed);
  9583. }
  9584. return parsed.file;
  9585. }
  9586. function parseNonShell(parsed) {
  9587. if (!isWin) {
  9588. return parsed;
  9589. }
  9590. // Detect & add support for shebangs
  9591. const commandFile = detectShebang(parsed);
  9592. // We don't need a shell if the command filename is an executable
  9593. const needsShell = !isExecutableRegExp.test(commandFile);
  9594. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9595. // Note that `forceShell` is an hidden option used only in tests
  9596. if (parsed.options.forceShell || needsShell) {
  9597. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9598. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9599. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9600. // we need to double escape them
  9601. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9602. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9603. // This is necessary otherwise it will always fail with ENOENT in those cases
  9604. parsed.command = path.normalize(parsed.command);
  9605. // Escape command & arguments
  9606. parsed.command = escape.command(parsed.command);
  9607. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9608. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9609. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9610. parsed.command = process.env.comspec || 'cmd.exe';
  9611. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9612. }
  9613. return parsed;
  9614. }
  9615. function parseShell(parsed) {
  9616. // If node supports the shell option, there's no need to mimic its behavior
  9617. if (supportsShellOption) {
  9618. return parsed;
  9619. }
  9620. // Mimic node shell option
  9621. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9622. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9623. if (isWin) {
  9624. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9625. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9626. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9627. } else {
  9628. if (typeof parsed.options.shell === 'string') {
  9629. parsed.command = parsed.options.shell;
  9630. } else if (process.platform === 'android') {
  9631. parsed.command = '/system/bin/sh';
  9632. } else {
  9633. parsed.command = '/bin/sh';
  9634. }
  9635. parsed.args = ['-c', shellCommand];
  9636. }
  9637. return parsed;
  9638. }
  9639. function parse(command, args, options) {
  9640. // Normalize arguments, similar to nodejs
  9641. if (args && !Array.isArray(args)) {
  9642. options = args;
  9643. args = null;
  9644. }
  9645. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9646. options = Object.assign({}, options); // Clone object to avoid changing the original
  9647. // Build our parsed object
  9648. const parsed = {
  9649. command,
  9650. args,
  9651. options,
  9652. file: undefined,
  9653. original: {
  9654. command,
  9655. args,
  9656. },
  9657. };
  9658. // Delegate further parsing to shell or non-shell
  9659. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9660. }
  9661. module.exports = parse;
  9662. /***/ }),
  9663. /***/ 577:
  9664. /***/ (function(module) {
  9665. module.exports = getPageLinks
  9666. function getPageLinks (link) {
  9667. link = link.link || link.headers.link || ''
  9668. const links = {}
  9669. // link format:
  9670. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9671. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9672. links[type] = uri
  9673. })
  9674. return links
  9675. }
  9676. /***/ }),
  9677. /***/ 586:
  9678. /***/ (function(module, __unusedexports, __webpack_require__) {
  9679. module.exports = octokitRestApiEndpoints;
  9680. const ROUTES = __webpack_require__(705);
  9681. function octokitRestApiEndpoints(octokit) {
  9682. // Aliasing scopes for backward compatibility
  9683. // See https://github.com/octokit/rest.js/pull/1134
  9684. ROUTES.gitdata = ROUTES.git;
  9685. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9686. ROUTES.pullRequests = ROUTES.pulls;
  9687. octokit.registerEndpoints(ROUTES);
  9688. }
  9689. /***/ }),
  9690. /***/ 587:
  9691. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9692. "use strict";
  9693. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9694. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9695. return new (P || (P = Promise))(function (resolve, reject) {
  9696. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9697. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9698. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9699. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9700. });
  9701. };
  9702. var __importStar = (this && this.__importStar) || function (mod) {
  9703. if (mod && mod.__esModule) return mod;
  9704. var result = {};
  9705. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9706. result["default"] = mod;
  9707. return result;
  9708. };
  9709. Object.defineProperty(exports, "__esModule", { value: true });
  9710. const core = __importStar(__webpack_require__(470));
  9711. const defaultMaxAttempts = 3;
  9712. const defaultMinSeconds = 10;
  9713. const defaultMaxSeconds = 20;
  9714. class RetryHelper {
  9715. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9716. this.maxAttempts = maxAttempts;
  9717. this.minSeconds = Math.floor(minSeconds);
  9718. this.maxSeconds = Math.floor(maxSeconds);
  9719. if (this.minSeconds > this.maxSeconds) {
  9720. throw new Error('min seconds should be less than or equal to max seconds');
  9721. }
  9722. }
  9723. execute(action) {
  9724. return __awaiter(this, void 0, void 0, function* () {
  9725. let attempt = 1;
  9726. while (attempt < this.maxAttempts) {
  9727. // Try
  9728. try {
  9729. return yield action();
  9730. }
  9731. catch (err) {
  9732. core.info(err.message);
  9733. }
  9734. // Sleep
  9735. const seconds = this.getSleepAmount();
  9736. core.info(`Waiting ${seconds} seconds before trying again`);
  9737. yield this.sleep(seconds);
  9738. attempt++;
  9739. }
  9740. // Last attempt
  9741. return yield action();
  9742. });
  9743. }
  9744. getSleepAmount() {
  9745. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9746. this.minSeconds);
  9747. }
  9748. sleep(seconds) {
  9749. return __awaiter(this, void 0, void 0, function* () {
  9750. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9751. });
  9752. }
  9753. }
  9754. exports.RetryHelper = RetryHelper;
  9755. function execute(action) {
  9756. return __awaiter(this, void 0, void 0, function* () {
  9757. const retryHelper = new RetryHelper();
  9758. return yield retryHelper.execute(action);
  9759. });
  9760. }
  9761. exports.execute = execute;
  9762. /***/ }),
  9763. /***/ 605:
  9764. /***/ (function(module) {
  9765. module.exports = require("http");
  9766. /***/ }),
  9767. /***/ 614:
  9768. /***/ (function(module) {
  9769. module.exports = require("events");
  9770. /***/ }),
  9771. /***/ 618:
  9772. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9773. "use strict";
  9774. var __importStar = (this && this.__importStar) || function (mod) {
  9775. if (mod && mod.__esModule) return mod;
  9776. var result = {};
  9777. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9778. result["default"] = mod;
  9779. return result;
  9780. };
  9781. Object.defineProperty(exports, "__esModule", { value: true });
  9782. const fs = __importStar(__webpack_require__(747));
  9783. function directoryExistsSync(path, required) {
  9784. if (!path) {
  9785. throw new Error("Arg 'path' must not be empty");
  9786. }
  9787. let stats;
  9788. try {
  9789. stats = fs.statSync(path);
  9790. }
  9791. catch (error) {
  9792. if (error.code === 'ENOENT') {
  9793. if (!required) {
  9794. return false;
  9795. }
  9796. throw new Error(`Directory '${path}' does not exist`);
  9797. }
  9798. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9799. }
  9800. if (stats.isDirectory()) {
  9801. return true;
  9802. }
  9803. else if (!required) {
  9804. return false;
  9805. }
  9806. throw new Error(`Directory '${path}' does not exist`);
  9807. }
  9808. exports.directoryExistsSync = directoryExistsSync;
  9809. function existsSync(path) {
  9810. if (!path) {
  9811. throw new Error("Arg 'path' must not be empty");
  9812. }
  9813. try {
  9814. fs.statSync(path);
  9815. }
  9816. catch (error) {
  9817. if (error.code === 'ENOENT') {
  9818. return false;
  9819. }
  9820. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9821. }
  9822. return true;
  9823. }
  9824. exports.existsSync = existsSync;
  9825. function fileExistsSync(path) {
  9826. if (!path) {
  9827. throw new Error("Arg 'path' must not be empty");
  9828. }
  9829. let stats;
  9830. try {
  9831. stats = fs.statSync(path);
  9832. }
  9833. catch (error) {
  9834. if (error.code === 'ENOENT') {
  9835. return false;
  9836. }
  9837. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9838. }
  9839. if (!stats.isDirectory()) {
  9840. return true;
  9841. }
  9842. return false;
  9843. }
  9844. exports.fileExistsSync = fileExistsSync;
  9845. /***/ }),
  9846. /***/ 621:
  9847. /***/ (function(module, __unusedexports, __webpack_require__) {
  9848. "use strict";
  9849. const path = __webpack_require__(622);
  9850. const pathKey = __webpack_require__(39);
  9851. module.exports = opts => {
  9852. opts = Object.assign({
  9853. cwd: process.cwd(),
  9854. path: process.env[pathKey()]
  9855. }, opts);
  9856. let prev;
  9857. let pth = path.resolve(opts.cwd);
  9858. const ret = [];
  9859. while (prev !== pth) {
  9860. ret.push(path.join(pth, 'node_modules/.bin'));
  9861. prev = pth;
  9862. pth = path.resolve(pth, '..');
  9863. }
  9864. // ensure the running `node` binary is used
  9865. ret.push(path.dirname(process.execPath));
  9866. return ret.concat(opts.path).join(path.delimiter);
  9867. };
  9868. module.exports.env = opts => {
  9869. opts = Object.assign({
  9870. env: process.env
  9871. }, opts);
  9872. const env = Object.assign({}, opts.env);
  9873. const path = pathKey({env});
  9874. opts.path = env[path];
  9875. env[path] = module.exports(opts);
  9876. return env;
  9877. };
  9878. /***/ }),
  9879. /***/ 622:
  9880. /***/ (function(module) {
  9881. module.exports = require("path");
  9882. /***/ }),
  9883. /***/ 631:
  9884. /***/ (function(module) {
  9885. module.exports = require("net");
  9886. /***/ }),
  9887. /***/ 649:
  9888. /***/ (function(module, __unusedexports, __webpack_require__) {
  9889. module.exports = getLastPage
  9890. const getPage = __webpack_require__(265)
  9891. function getLastPage (octokit, link, headers) {
  9892. return getPage(octokit, link, 'last', headers)
  9893. }
  9894. /***/ }),
  9895. /***/ 654:
  9896. /***/ (function(module) {
  9897. // This is not the set of all possible signals.
  9898. //
  9899. // It IS, however, the set of all signals that trigger
  9900. // an exit on either Linux or BSD systems. Linux is a
  9901. // superset of the signal names supported on BSD, and
  9902. // the unknown signals just fail to register, so we can
  9903. // catch that easily enough.
  9904. //
  9905. // Don't bother with SIGKILL. It's uncatchable, which
  9906. // means that we can't fire any callbacks anyway.
  9907. //
  9908. // If a user does happen to register a handler on a non-
  9909. // fatal signal like SIGWINCH or something, and then
  9910. // exit, it'll end up firing `process.emit('exit')`, so
  9911. // the handler will be fired anyway.
  9912. //
  9913. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9914. // artificially, inherently leave the process in a
  9915. // state from which it is not safe to try and enter JS
  9916. // listeners.
  9917. module.exports = [
  9918. 'SIGABRT',
  9919. 'SIGALRM',
  9920. 'SIGHUP',
  9921. 'SIGINT',
  9922. 'SIGTERM'
  9923. ]
  9924. if (process.platform !== 'win32') {
  9925. module.exports.push(
  9926. 'SIGVTALRM',
  9927. 'SIGXCPU',
  9928. 'SIGXFSZ',
  9929. 'SIGUSR2',
  9930. 'SIGTRAP',
  9931. 'SIGSYS',
  9932. 'SIGQUIT',
  9933. 'SIGIOT'
  9934. // should detect profiler and enable/disable accordingly.
  9935. // see #21
  9936. // 'SIGPROF'
  9937. )
  9938. }
  9939. if (process.platform === 'linux') {
  9940. module.exports.push(
  9941. 'SIGIO',
  9942. 'SIGPOLL',
  9943. 'SIGPWR',
  9944. 'SIGSTKFLT',
  9945. 'SIGUNUSED'
  9946. )
  9947. }
  9948. /***/ }),
  9949. /***/ 656:
  9950. /***/ (function(module, exports) {
  9951. exports = module.exports = SemVer
  9952. var debug
  9953. /* istanbul ignore next */
  9954. if (typeof process === 'object' &&
  9955. process.env &&
  9956. process.env.NODE_DEBUG &&
  9957. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9958. debug = function () {
  9959. var args = Array.prototype.slice.call(arguments, 0)
  9960. args.unshift('SEMVER')
  9961. console.log.apply(console, args)
  9962. }
  9963. } else {
  9964. debug = function () {}
  9965. }
  9966. // Note: this is the semver.org version of the spec that it implements
  9967. // Not necessarily the package version of this code.
  9968. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9969. var MAX_LENGTH = 256
  9970. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9971. /* istanbul ignore next */ 9007199254740991
  9972. // Max safe segment length for coercion.
  9973. var MAX_SAFE_COMPONENT_LENGTH = 16
  9974. // The actual regexps go on exports.re
  9975. var re = exports.re = []
  9976. var src = exports.src = []
  9977. var t = exports.tokens = {}
  9978. var R = 0
  9979. function tok (n) {
  9980. t[n] = R++
  9981. }
  9982. // The following Regular Expressions can be used for tokenizing,
  9983. // validating, and parsing SemVer version strings.
  9984. // ## Numeric Identifier
  9985. // A single `0`, or a non-zero digit followed by zero or more digits.
  9986. tok('NUMERICIDENTIFIER')
  9987. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9988. tok('NUMERICIDENTIFIERLOOSE')
  9989. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9990. // ## Non-numeric Identifier
  9991. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9992. // more letters, digits, or hyphens.
  9993. tok('NONNUMERICIDENTIFIER')
  9994. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9995. // ## Main Version
  9996. // Three dot-separated numeric identifiers.
  9997. tok('MAINVERSION')
  9998. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9999. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  10000. '(' + src[t.NUMERICIDENTIFIER] + ')'
  10001. tok('MAINVERSIONLOOSE')
  10002. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10003. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  10004. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  10005. // ## Pre-release Version Identifier
  10006. // A numeric identifier, or a non-numeric identifier.
  10007. tok('PRERELEASEIDENTIFIER')
  10008. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  10009. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10010. tok('PRERELEASEIDENTIFIERLOOSE')
  10011. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  10012. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  10013. // ## Pre-release Version
  10014. // Hyphen, followed by one or more dot-separated pre-release version
  10015. // identifiers.
  10016. tok('PRERELEASE')
  10017. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10018. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10019. tok('PRERELEASELOOSE')
  10020. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10021. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  10022. // ## Build Metadata Identifier
  10023. // Any combination of digits, letters, or hyphens.
  10024. tok('BUILDIDENTIFIER')
  10025. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10026. // ## Build Metadata
  10027. // Plus sign, followed by one or more period-separated build metadata
  10028. // identifiers.
  10029. tok('BUILD')
  10030. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10031. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10032. // ## Full Version String
  10033. // A main version, followed optionally by a pre-release version and
  10034. // build metadata.
  10035. // Note that the only major, minor, patch, and pre-release sections of
  10036. // the version string are capturing groups. The build metadata is not a
  10037. // capturing group, because it should not ever be used in version
  10038. // comparison.
  10039. tok('FULL')
  10040. tok('FULLPLAIN')
  10041. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10042. src[t.PRERELEASE] + '?' +
  10043. src[t.BUILD] + '?'
  10044. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10045. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10046. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10047. // common in the npm registry.
  10048. tok('LOOSEPLAIN')
  10049. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10050. src[t.PRERELEASELOOSE] + '?' +
  10051. src[t.BUILD] + '?'
  10052. tok('LOOSE')
  10053. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10054. tok('GTLT')
  10055. src[t.GTLT] = '((?:<|>)?=?)'
  10056. // Something like "2.*" or "1.2.x".
  10057. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10058. // Only the first item is strictly required.
  10059. tok('XRANGEIDENTIFIERLOOSE')
  10060. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10061. tok('XRANGEIDENTIFIER')
  10062. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10063. tok('XRANGEPLAIN')
  10064. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10065. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10066. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10067. '(?:' + src[t.PRERELEASE] + ')?' +
  10068. src[t.BUILD] + '?' +
  10069. ')?)?'
  10070. tok('XRANGEPLAINLOOSE')
  10071. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10072. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10073. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10074. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10075. src[t.BUILD] + '?' +
  10076. ')?)?'
  10077. tok('XRANGE')
  10078. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10079. tok('XRANGELOOSE')
  10080. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10081. // Coercion.
  10082. // Extract anything that could conceivably be a part of a valid semver
  10083. tok('COERCE')
  10084. src[t.COERCE] = '(^|[^\\d])' +
  10085. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10086. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10087. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10088. '(?:$|[^\\d])'
  10089. tok('COERCERTL')
  10090. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10091. // Tilde ranges.
  10092. // Meaning is "reasonably at or greater than"
  10093. tok('LONETILDE')
  10094. src[t.LONETILDE] = '(?:~>?)'
  10095. tok('TILDETRIM')
  10096. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10097. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10098. var tildeTrimReplace = '$1~'
  10099. tok('TILDE')
  10100. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10101. tok('TILDELOOSE')
  10102. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10103. // Caret ranges.
  10104. // Meaning is "at least and backwards compatible with"
  10105. tok('LONECARET')
  10106. src[t.LONECARET] = '(?:\\^)'
  10107. tok('CARETTRIM')
  10108. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10109. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10110. var caretTrimReplace = '$1^'
  10111. tok('CARET')
  10112. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10113. tok('CARETLOOSE')
  10114. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10115. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10116. tok('COMPARATORLOOSE')
  10117. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10118. tok('COMPARATOR')
  10119. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10120. // An expression to strip any whitespace between the gtlt and the thing
  10121. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10122. tok('COMPARATORTRIM')
  10123. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10124. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10125. // this one has to use the /g flag
  10126. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10127. var comparatorTrimReplace = '$1$2$3'
  10128. // Something like `1.2.3 - 1.2.4`
  10129. // Note that these all use the loose form, because they'll be
  10130. // checked against either the strict or loose comparator form
  10131. // later.
  10132. tok('HYPHENRANGE')
  10133. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10134. '\\s+-\\s+' +
  10135. '(' + src[t.XRANGEPLAIN] + ')' +
  10136. '\\s*$'
  10137. tok('HYPHENRANGELOOSE')
  10138. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10139. '\\s+-\\s+' +
  10140. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10141. '\\s*$'
  10142. // Star ranges basically just allow anything at all.
  10143. tok('STAR')
  10144. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10145. // Compile to actual regexp objects.
  10146. // All are flag-free, unless they were created above with a flag.
  10147. for (var i = 0; i < R; i++) {
  10148. debug(i, src[i])
  10149. if (!re[i]) {
  10150. re[i] = new RegExp(src[i])
  10151. }
  10152. }
  10153. exports.parse = parse
  10154. function parse (version, options) {
  10155. if (!options || typeof options !== 'object') {
  10156. options = {
  10157. loose: !!options,
  10158. includePrerelease: false
  10159. }
  10160. }
  10161. if (version instanceof SemVer) {
  10162. return version
  10163. }
  10164. if (typeof version !== 'string') {
  10165. return null
  10166. }
  10167. if (version.length > MAX_LENGTH) {
  10168. return null
  10169. }
  10170. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10171. if (!r.test(version)) {
  10172. return null
  10173. }
  10174. try {
  10175. return new SemVer(version, options)
  10176. } catch (er) {
  10177. return null
  10178. }
  10179. }
  10180. exports.valid = valid
  10181. function valid (version, options) {
  10182. var v = parse(version, options)
  10183. return v ? v.version : null
  10184. }
  10185. exports.clean = clean
  10186. function clean (version, options) {
  10187. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10188. return s ? s.version : null
  10189. }
  10190. exports.SemVer = SemVer
  10191. function SemVer (version, options) {
  10192. if (!options || typeof options !== 'object') {
  10193. options = {
  10194. loose: !!options,
  10195. includePrerelease: false
  10196. }
  10197. }
  10198. if (version instanceof SemVer) {
  10199. if (version.loose === options.loose) {
  10200. return version
  10201. } else {
  10202. version = version.version
  10203. }
  10204. } else if (typeof version !== 'string') {
  10205. throw new TypeError('Invalid Version: ' + version)
  10206. }
  10207. if (version.length > MAX_LENGTH) {
  10208. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10209. }
  10210. if (!(this instanceof SemVer)) {
  10211. return new SemVer(version, options)
  10212. }
  10213. debug('SemVer', version, options)
  10214. this.options = options
  10215. this.loose = !!options.loose
  10216. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10217. if (!m) {
  10218. throw new TypeError('Invalid Version: ' + version)
  10219. }
  10220. this.raw = version
  10221. // these are actually numbers
  10222. this.major = +m[1]
  10223. this.minor = +m[2]
  10224. this.patch = +m[3]
  10225. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10226. throw new TypeError('Invalid major version')
  10227. }
  10228. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10229. throw new TypeError('Invalid minor version')
  10230. }
  10231. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10232. throw new TypeError('Invalid patch version')
  10233. }
  10234. // numberify any prerelease numeric ids
  10235. if (!m[4]) {
  10236. this.prerelease = []
  10237. } else {
  10238. this.prerelease = m[4].split('.').map(function (id) {
  10239. if (/^[0-9]+$/.test(id)) {
  10240. var num = +id
  10241. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10242. return num
  10243. }
  10244. }
  10245. return id
  10246. })
  10247. }
  10248. this.build = m[5] ? m[5].split('.') : []
  10249. this.format()
  10250. }
  10251. SemVer.prototype.format = function () {
  10252. this.version = this.major + '.' + this.minor + '.' + this.patch
  10253. if (this.prerelease.length) {
  10254. this.version += '-' + this.prerelease.join('.')
  10255. }
  10256. return this.version
  10257. }
  10258. SemVer.prototype.toString = function () {
  10259. return this.version
  10260. }
  10261. SemVer.prototype.compare = function (other) {
  10262. debug('SemVer.compare', this.version, this.options, other)
  10263. if (!(other instanceof SemVer)) {
  10264. other = new SemVer(other, this.options)
  10265. }
  10266. return this.compareMain(other) || this.comparePre(other)
  10267. }
  10268. SemVer.prototype.compareMain = function (other) {
  10269. if (!(other instanceof SemVer)) {
  10270. other = new SemVer(other, this.options)
  10271. }
  10272. return compareIdentifiers(this.major, other.major) ||
  10273. compareIdentifiers(this.minor, other.minor) ||
  10274. compareIdentifiers(this.patch, other.patch)
  10275. }
  10276. SemVer.prototype.comparePre = function (other) {
  10277. if (!(other instanceof SemVer)) {
  10278. other = new SemVer(other, this.options)
  10279. }
  10280. // NOT having a prerelease is > having one
  10281. if (this.prerelease.length && !other.prerelease.length) {
  10282. return -1
  10283. } else if (!this.prerelease.length && other.prerelease.length) {
  10284. return 1
  10285. } else if (!this.prerelease.length && !other.prerelease.length) {
  10286. return 0
  10287. }
  10288. var i = 0
  10289. do {
  10290. var a = this.prerelease[i]
  10291. var b = other.prerelease[i]
  10292. debug('prerelease compare', i, a, b)
  10293. if (a === undefined && b === undefined) {
  10294. return 0
  10295. } else if (b === undefined) {
  10296. return 1
  10297. } else if (a === undefined) {
  10298. return -1
  10299. } else if (a === b) {
  10300. continue
  10301. } else {
  10302. return compareIdentifiers(a, b)
  10303. }
  10304. } while (++i)
  10305. }
  10306. SemVer.prototype.compareBuild = function (other) {
  10307. if (!(other instanceof SemVer)) {
  10308. other = new SemVer(other, this.options)
  10309. }
  10310. var i = 0
  10311. do {
  10312. var a = this.build[i]
  10313. var b = other.build[i]
  10314. debug('prerelease compare', i, a, b)
  10315. if (a === undefined && b === undefined) {
  10316. return 0
  10317. } else if (b === undefined) {
  10318. return 1
  10319. } else if (a === undefined) {
  10320. return -1
  10321. } else if (a === b) {
  10322. continue
  10323. } else {
  10324. return compareIdentifiers(a, b)
  10325. }
  10326. } while (++i)
  10327. }
  10328. // preminor will bump the version up to the next minor release, and immediately
  10329. // down to pre-release. premajor and prepatch work the same way.
  10330. SemVer.prototype.inc = function (release, identifier) {
  10331. switch (release) {
  10332. case 'premajor':
  10333. this.prerelease.length = 0
  10334. this.patch = 0
  10335. this.minor = 0
  10336. this.major++
  10337. this.inc('pre', identifier)
  10338. break
  10339. case 'preminor':
  10340. this.prerelease.length = 0
  10341. this.patch = 0
  10342. this.minor++
  10343. this.inc('pre', identifier)
  10344. break
  10345. case 'prepatch':
  10346. // If this is already a prerelease, it will bump to the next version
  10347. // drop any prereleases that might already exist, since they are not
  10348. // relevant at this point.
  10349. this.prerelease.length = 0
  10350. this.inc('patch', identifier)
  10351. this.inc('pre', identifier)
  10352. break
  10353. // If the input is a non-prerelease version, this acts the same as
  10354. // prepatch.
  10355. case 'prerelease':
  10356. if (this.prerelease.length === 0) {
  10357. this.inc('patch', identifier)
  10358. }
  10359. this.inc('pre', identifier)
  10360. break
  10361. case 'major':
  10362. // If this is a pre-major version, bump up to the same major version.
  10363. // Otherwise increment major.
  10364. // 1.0.0-5 bumps to 1.0.0
  10365. // 1.1.0 bumps to 2.0.0
  10366. if (this.minor !== 0 ||
  10367. this.patch !== 0 ||
  10368. this.prerelease.length === 0) {
  10369. this.major++
  10370. }
  10371. this.minor = 0
  10372. this.patch = 0
  10373. this.prerelease = []
  10374. break
  10375. case 'minor':
  10376. // If this is a pre-minor version, bump up to the same minor version.
  10377. // Otherwise increment minor.
  10378. // 1.2.0-5 bumps to 1.2.0
  10379. // 1.2.1 bumps to 1.3.0
  10380. if (this.patch !== 0 || this.prerelease.length === 0) {
  10381. this.minor++
  10382. }
  10383. this.patch = 0
  10384. this.prerelease = []
  10385. break
  10386. case 'patch':
  10387. // If this is not a pre-release version, it will increment the patch.
  10388. // If it is a pre-release it will bump up to the same patch version.
  10389. // 1.2.0-5 patches to 1.2.0
  10390. // 1.2.0 patches to 1.2.1
  10391. if (this.prerelease.length === 0) {
  10392. this.patch++
  10393. }
  10394. this.prerelease = []
  10395. break
  10396. // This probably shouldn't be used publicly.
  10397. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10398. case 'pre':
  10399. if (this.prerelease.length === 0) {
  10400. this.prerelease = [0]
  10401. } else {
  10402. var i = this.prerelease.length
  10403. while (--i >= 0) {
  10404. if (typeof this.prerelease[i] === 'number') {
  10405. this.prerelease[i]++
  10406. i = -2
  10407. }
  10408. }
  10409. if (i === -1) {
  10410. // didn't increment anything
  10411. this.prerelease.push(0)
  10412. }
  10413. }
  10414. if (identifier) {
  10415. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10416. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10417. if (this.prerelease[0] === identifier) {
  10418. if (isNaN(this.prerelease[1])) {
  10419. this.prerelease = [identifier, 0]
  10420. }
  10421. } else {
  10422. this.prerelease = [identifier, 0]
  10423. }
  10424. }
  10425. break
  10426. default:
  10427. throw new Error('invalid increment argument: ' + release)
  10428. }
  10429. this.format()
  10430. this.raw = this.version
  10431. return this
  10432. }
  10433. exports.inc = inc
  10434. function inc (version, release, loose, identifier) {
  10435. if (typeof (loose) === 'string') {
  10436. identifier = loose
  10437. loose = undefined
  10438. }
  10439. try {
  10440. return new SemVer(version, loose).inc(release, identifier).version
  10441. } catch (er) {
  10442. return null
  10443. }
  10444. }
  10445. exports.diff = diff
  10446. function diff (version1, version2) {
  10447. if (eq(version1, version2)) {
  10448. return null
  10449. } else {
  10450. var v1 = parse(version1)
  10451. var v2 = parse(version2)
  10452. var prefix = ''
  10453. if (v1.prerelease.length || v2.prerelease.length) {
  10454. prefix = 'pre'
  10455. var defaultResult = 'prerelease'
  10456. }
  10457. for (var key in v1) {
  10458. if (key === 'major' || key === 'minor' || key === 'patch') {
  10459. if (v1[key] !== v2[key]) {
  10460. return prefix + key
  10461. }
  10462. }
  10463. }
  10464. return defaultResult // may be undefined
  10465. }
  10466. }
  10467. exports.compareIdentifiers = compareIdentifiers
  10468. var numeric = /^[0-9]+$/
  10469. function compareIdentifiers (a, b) {
  10470. var anum = numeric.test(a)
  10471. var bnum = numeric.test(b)
  10472. if (anum && bnum) {
  10473. a = +a
  10474. b = +b
  10475. }
  10476. return a === b ? 0
  10477. : (anum && !bnum) ? -1
  10478. : (bnum && !anum) ? 1
  10479. : a < b ? -1
  10480. : 1
  10481. }
  10482. exports.rcompareIdentifiers = rcompareIdentifiers
  10483. function rcompareIdentifiers (a, b) {
  10484. return compareIdentifiers(b, a)
  10485. }
  10486. exports.major = major
  10487. function major (a, loose) {
  10488. return new SemVer(a, loose).major
  10489. }
  10490. exports.minor = minor
  10491. function minor (a, loose) {
  10492. return new SemVer(a, loose).minor
  10493. }
  10494. exports.patch = patch
  10495. function patch (a, loose) {
  10496. return new SemVer(a, loose).patch
  10497. }
  10498. exports.compare = compare
  10499. function compare (a, b, loose) {
  10500. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10501. }
  10502. exports.compareLoose = compareLoose
  10503. function compareLoose (a, b) {
  10504. return compare(a, b, true)
  10505. }
  10506. exports.compareBuild = compareBuild
  10507. function compareBuild (a, b, loose) {
  10508. var versionA = new SemVer(a, loose)
  10509. var versionB = new SemVer(b, loose)
  10510. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10511. }
  10512. exports.rcompare = rcompare
  10513. function rcompare (a, b, loose) {
  10514. return compare(b, a, loose)
  10515. }
  10516. exports.sort = sort
  10517. function sort (list, loose) {
  10518. return list.sort(function (a, b) {
  10519. return exports.compareBuild(a, b, loose)
  10520. })
  10521. }
  10522. exports.rsort = rsort
  10523. function rsort (list, loose) {
  10524. return list.sort(function (a, b) {
  10525. return exports.compareBuild(b, a, loose)
  10526. })
  10527. }
  10528. exports.gt = gt
  10529. function gt (a, b, loose) {
  10530. return compare(a, b, loose) > 0
  10531. }
  10532. exports.lt = lt
  10533. function lt (a, b, loose) {
  10534. return compare(a, b, loose) < 0
  10535. }
  10536. exports.eq = eq
  10537. function eq (a, b, loose) {
  10538. return compare(a, b, loose) === 0
  10539. }
  10540. exports.neq = neq
  10541. function neq (a, b, loose) {
  10542. return compare(a, b, loose) !== 0
  10543. }
  10544. exports.gte = gte
  10545. function gte (a, b, loose) {
  10546. return compare(a, b, loose) >= 0
  10547. }
  10548. exports.lte = lte
  10549. function lte (a, b, loose) {
  10550. return compare(a, b, loose) <= 0
  10551. }
  10552. exports.cmp = cmp
  10553. function cmp (a, op, b, loose) {
  10554. switch (op) {
  10555. case '===':
  10556. if (typeof a === 'object')
  10557. a = a.version
  10558. if (typeof b === 'object')
  10559. b = b.version
  10560. return a === b
  10561. case '!==':
  10562. if (typeof a === 'object')
  10563. a = a.version
  10564. if (typeof b === 'object')
  10565. b = b.version
  10566. return a !== b
  10567. case '':
  10568. case '=':
  10569. case '==':
  10570. return eq(a, b, loose)
  10571. case '!=':
  10572. return neq(a, b, loose)
  10573. case '>':
  10574. return gt(a, b, loose)
  10575. case '>=':
  10576. return gte(a, b, loose)
  10577. case '<':
  10578. return lt(a, b, loose)
  10579. case '<=':
  10580. return lte(a, b, loose)
  10581. default:
  10582. throw new TypeError('Invalid operator: ' + op)
  10583. }
  10584. }
  10585. exports.Comparator = Comparator
  10586. function Comparator (comp, options) {
  10587. if (!options || typeof options !== 'object') {
  10588. options = {
  10589. loose: !!options,
  10590. includePrerelease: false
  10591. }
  10592. }
  10593. if (comp instanceof Comparator) {
  10594. if (comp.loose === !!options.loose) {
  10595. return comp
  10596. } else {
  10597. comp = comp.value
  10598. }
  10599. }
  10600. if (!(this instanceof Comparator)) {
  10601. return new Comparator(comp, options)
  10602. }
  10603. debug('comparator', comp, options)
  10604. this.options = options
  10605. this.loose = !!options.loose
  10606. this.parse(comp)
  10607. if (this.semver === ANY) {
  10608. this.value = ''
  10609. } else {
  10610. this.value = this.operator + this.semver.version
  10611. }
  10612. debug('comp', this)
  10613. }
  10614. var ANY = {}
  10615. Comparator.prototype.parse = function (comp) {
  10616. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10617. var m = comp.match(r)
  10618. if (!m) {
  10619. throw new TypeError('Invalid comparator: ' + comp)
  10620. }
  10621. this.operator = m[1] !== undefined ? m[1] : ''
  10622. if (this.operator === '=') {
  10623. this.operator = ''
  10624. }
  10625. // if it literally is just '>' or '' then allow anything.
  10626. if (!m[2]) {
  10627. this.semver = ANY
  10628. } else {
  10629. this.semver = new SemVer(m[2], this.options.loose)
  10630. }
  10631. }
  10632. Comparator.prototype.toString = function () {
  10633. return this.value
  10634. }
  10635. Comparator.prototype.test = function (version) {
  10636. debug('Comparator.test', version, this.options.loose)
  10637. if (this.semver === ANY || version === ANY) {
  10638. return true
  10639. }
  10640. if (typeof version === 'string') {
  10641. try {
  10642. version = new SemVer(version, this.options)
  10643. } catch (er) {
  10644. return false
  10645. }
  10646. }
  10647. return cmp(version, this.operator, this.semver, this.options)
  10648. }
  10649. Comparator.prototype.intersects = function (comp, options) {
  10650. if (!(comp instanceof Comparator)) {
  10651. throw new TypeError('a Comparator is required')
  10652. }
  10653. if (!options || typeof options !== 'object') {
  10654. options = {
  10655. loose: !!options,
  10656. includePrerelease: false
  10657. }
  10658. }
  10659. var rangeTmp
  10660. if (this.operator === '') {
  10661. if (this.value === '') {
  10662. return true
  10663. }
  10664. rangeTmp = new Range(comp.value, options)
  10665. return satisfies(this.value, rangeTmp, options)
  10666. } else if (comp.operator === '') {
  10667. if (comp.value === '') {
  10668. return true
  10669. }
  10670. rangeTmp = new Range(this.value, options)
  10671. return satisfies(comp.semver, rangeTmp, options)
  10672. }
  10673. var sameDirectionIncreasing =
  10674. (this.operator === '>=' || this.operator === '>') &&
  10675. (comp.operator === '>=' || comp.operator === '>')
  10676. var sameDirectionDecreasing =
  10677. (this.operator === '<=' || this.operator === '<') &&
  10678. (comp.operator === '<=' || comp.operator === '<')
  10679. var sameSemVer = this.semver.version === comp.semver.version
  10680. var differentDirectionsInclusive =
  10681. (this.operator === '>=' || this.operator === '<=') &&
  10682. (comp.operator === '>=' || comp.operator === '<=')
  10683. var oppositeDirectionsLessThan =
  10684. cmp(this.semver, '<', comp.semver, options) &&
  10685. ((this.operator === '>=' || this.operator === '>') &&
  10686. (comp.operator === '<=' || comp.operator === '<'))
  10687. var oppositeDirectionsGreaterThan =
  10688. cmp(this.semver, '>', comp.semver, options) &&
  10689. ((this.operator === '<=' || this.operator === '<') &&
  10690. (comp.operator === '>=' || comp.operator === '>'))
  10691. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10692. (sameSemVer && differentDirectionsInclusive) ||
  10693. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10694. }
  10695. exports.Range = Range
  10696. function Range (range, options) {
  10697. if (!options || typeof options !== 'object') {
  10698. options = {
  10699. loose: !!options,
  10700. includePrerelease: false
  10701. }
  10702. }
  10703. if (range instanceof Range) {
  10704. if (range.loose === !!options.loose &&
  10705. range.includePrerelease === !!options.includePrerelease) {
  10706. return range
  10707. } else {
  10708. return new Range(range.raw, options)
  10709. }
  10710. }
  10711. if (range instanceof Comparator) {
  10712. return new Range(range.value, options)
  10713. }
  10714. if (!(this instanceof Range)) {
  10715. return new Range(range, options)
  10716. }
  10717. this.options = options
  10718. this.loose = !!options.loose
  10719. this.includePrerelease = !!options.includePrerelease
  10720. // First, split based on boolean or ||
  10721. this.raw = range
  10722. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10723. return this.parseRange(range.trim())
  10724. }, this).filter(function (c) {
  10725. // throw out any that are not relevant for whatever reason
  10726. return c.length
  10727. })
  10728. if (!this.set.length) {
  10729. throw new TypeError('Invalid SemVer Range: ' + range)
  10730. }
  10731. this.format()
  10732. }
  10733. Range.prototype.format = function () {
  10734. this.range = this.set.map(function (comps) {
  10735. return comps.join(' ').trim()
  10736. }).join('||').trim()
  10737. return this.range
  10738. }
  10739. Range.prototype.toString = function () {
  10740. return this.range
  10741. }
  10742. Range.prototype.parseRange = function (range) {
  10743. var loose = this.options.loose
  10744. range = range.trim()
  10745. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10746. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10747. range = range.replace(hr, hyphenReplace)
  10748. debug('hyphen replace', range)
  10749. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10750. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10751. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10752. // `~ 1.2.3` => `~1.2.3`
  10753. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10754. // `^ 1.2.3` => `^1.2.3`
  10755. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10756. // normalize spaces
  10757. range = range.split(/\s+/).join(' ')
  10758. // At this point, the range is completely trimmed and
  10759. // ready to be split into comparators.
  10760. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10761. var set = range.split(' ').map(function (comp) {
  10762. return parseComparator(comp, this.options)
  10763. }, this).join(' ').split(/\s+/)
  10764. if (this.options.loose) {
  10765. // in loose mode, throw out any that are not valid comparators
  10766. set = set.filter(function (comp) {
  10767. return !!comp.match(compRe)
  10768. })
  10769. }
  10770. set = set.map(function (comp) {
  10771. return new Comparator(comp, this.options)
  10772. }, this)
  10773. return set
  10774. }
  10775. Range.prototype.intersects = function (range, options) {
  10776. if (!(range instanceof Range)) {
  10777. throw new TypeError('a Range is required')
  10778. }
  10779. return this.set.some(function (thisComparators) {
  10780. return (
  10781. isSatisfiable(thisComparators, options) &&
  10782. range.set.some(function (rangeComparators) {
  10783. return (
  10784. isSatisfiable(rangeComparators, options) &&
  10785. thisComparators.every(function (thisComparator) {
  10786. return rangeComparators.every(function (rangeComparator) {
  10787. return thisComparator.intersects(rangeComparator, options)
  10788. })
  10789. })
  10790. )
  10791. })
  10792. )
  10793. })
  10794. }
  10795. // take a set of comparators and determine whether there
  10796. // exists a version which can satisfy it
  10797. function isSatisfiable (comparators, options) {
  10798. var result = true
  10799. var remainingComparators = comparators.slice()
  10800. var testComparator = remainingComparators.pop()
  10801. while (result && remainingComparators.length) {
  10802. result = remainingComparators.every(function (otherComparator) {
  10803. return testComparator.intersects(otherComparator, options)
  10804. })
  10805. testComparator = remainingComparators.pop()
  10806. }
  10807. return result
  10808. }
  10809. // Mostly just for testing and legacy API reasons
  10810. exports.toComparators = toComparators
  10811. function toComparators (range, options) {
  10812. return new Range(range, options).set.map(function (comp) {
  10813. return comp.map(function (c) {
  10814. return c.value
  10815. }).join(' ').trim().split(' ')
  10816. })
  10817. }
  10818. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10819. // already replaced the hyphen ranges
  10820. // turn into a set of JUST comparators.
  10821. function parseComparator (comp, options) {
  10822. debug('comp', comp, options)
  10823. comp = replaceCarets(comp, options)
  10824. debug('caret', comp)
  10825. comp = replaceTildes(comp, options)
  10826. debug('tildes', comp)
  10827. comp = replaceXRanges(comp, options)
  10828. debug('xrange', comp)
  10829. comp = replaceStars(comp, options)
  10830. debug('stars', comp)
  10831. return comp
  10832. }
  10833. function isX (id) {
  10834. return !id || id.toLowerCase() === 'x' || id === '*'
  10835. }
  10836. // ~, ~> --> * (any, kinda silly)
  10837. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10838. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10839. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10840. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10841. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10842. function replaceTildes (comp, options) {
  10843. return comp.trim().split(/\s+/).map(function (comp) {
  10844. return replaceTilde(comp, options)
  10845. }).join(' ')
  10846. }
  10847. function replaceTilde (comp, options) {
  10848. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10849. return comp.replace(r, function (_, M, m, p, pr) {
  10850. debug('tilde', comp, _, M, m, p, pr)
  10851. var ret
  10852. if (isX(M)) {
  10853. ret = ''
  10854. } else if (isX(m)) {
  10855. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10856. } else if (isX(p)) {
  10857. // ~1.2 == >=1.2.0 <1.3.0
  10858. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10859. } else if (pr) {
  10860. debug('replaceTilde pr', pr)
  10861. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10862. ' <' + M + '.' + (+m + 1) + '.0'
  10863. } else {
  10864. // ~1.2.3 == >=1.2.3 <1.3.0
  10865. ret = '>=' + M + '.' + m + '.' + p +
  10866. ' <' + M + '.' + (+m + 1) + '.0'
  10867. }
  10868. debug('tilde return', ret)
  10869. return ret
  10870. })
  10871. }
  10872. // ^ --> * (any, kinda silly)
  10873. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10874. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10875. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10876. // ^1.2.3 --> >=1.2.3 <2.0.0
  10877. // ^1.2.0 --> >=1.2.0 <2.0.0
  10878. function replaceCarets (comp, options) {
  10879. return comp.trim().split(/\s+/).map(function (comp) {
  10880. return replaceCaret(comp, options)
  10881. }).join(' ')
  10882. }
  10883. function replaceCaret (comp, options) {
  10884. debug('caret', comp, options)
  10885. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10886. return comp.replace(r, function (_, M, m, p, pr) {
  10887. debug('caret', comp, _, M, m, p, pr)
  10888. var ret
  10889. if (isX(M)) {
  10890. ret = ''
  10891. } else if (isX(m)) {
  10892. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10893. } else if (isX(p)) {
  10894. if (M === '0') {
  10895. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10896. } else {
  10897. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10898. }
  10899. } else if (pr) {
  10900. debug('replaceCaret pr', pr)
  10901. if (M === '0') {
  10902. if (m === '0') {
  10903. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10904. ' <' + M + '.' + m + '.' + (+p + 1)
  10905. } else {
  10906. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10907. ' <' + M + '.' + (+m + 1) + '.0'
  10908. }
  10909. } else {
  10910. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10911. ' <' + (+M + 1) + '.0.0'
  10912. }
  10913. } else {
  10914. debug('no pr')
  10915. if (M === '0') {
  10916. if (m === '0') {
  10917. ret = '>=' + M + '.' + m + '.' + p +
  10918. ' <' + M + '.' + m + '.' + (+p + 1)
  10919. } else {
  10920. ret = '>=' + M + '.' + m + '.' + p +
  10921. ' <' + M + '.' + (+m + 1) + '.0'
  10922. }
  10923. } else {
  10924. ret = '>=' + M + '.' + m + '.' + p +
  10925. ' <' + (+M + 1) + '.0.0'
  10926. }
  10927. }
  10928. debug('caret return', ret)
  10929. return ret
  10930. })
  10931. }
  10932. function replaceXRanges (comp, options) {
  10933. debug('replaceXRanges', comp, options)
  10934. return comp.split(/\s+/).map(function (comp) {
  10935. return replaceXRange(comp, options)
  10936. }).join(' ')
  10937. }
  10938. function replaceXRange (comp, options) {
  10939. comp = comp.trim()
  10940. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10941. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10942. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10943. var xM = isX(M)
  10944. var xm = xM || isX(m)
  10945. var xp = xm || isX(p)
  10946. var anyX = xp
  10947. if (gtlt === '=' && anyX) {
  10948. gtlt = ''
  10949. }
  10950. // if we're including prereleases in the match, then we need
  10951. // to fix this to -0, the lowest possible prerelease value
  10952. pr = options.includePrerelease ? '-0' : ''
  10953. if (xM) {
  10954. if (gtlt === '>' || gtlt === '<') {
  10955. // nothing is allowed
  10956. ret = '<0.0.0-0'
  10957. } else {
  10958. // nothing is forbidden
  10959. ret = '*'
  10960. }
  10961. } else if (gtlt && anyX) {
  10962. // we know patch is an x, because we have any x at all.
  10963. // replace X with 0
  10964. if (xm) {
  10965. m = 0
  10966. }
  10967. p = 0
  10968. if (gtlt === '>') {
  10969. // >1 => >=2.0.0
  10970. // >1.2 => >=1.3.0
  10971. // >1.2.3 => >= 1.2.4
  10972. gtlt = '>='
  10973. if (xm) {
  10974. M = +M + 1
  10975. m = 0
  10976. p = 0
  10977. } else {
  10978. m = +m + 1
  10979. p = 0
  10980. }
  10981. } else if (gtlt === '<=') {
  10982. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10983. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10984. gtlt = '<'
  10985. if (xm) {
  10986. M = +M + 1
  10987. } else {
  10988. m = +m + 1
  10989. }
  10990. }
  10991. ret = gtlt + M + '.' + m + '.' + p + pr
  10992. } else if (xm) {
  10993. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10994. } else if (xp) {
  10995. ret = '>=' + M + '.' + m + '.0' + pr +
  10996. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10997. }
  10998. debug('xRange return', ret)
  10999. return ret
  11000. })
  11001. }
  11002. // Because * is AND-ed with everything else in the comparator,
  11003. // and '' means "any version", just remove the *s entirely.
  11004. function replaceStars (comp, options) {
  11005. debug('replaceStars', comp, options)
  11006. // Looseness is ignored here. star is always as loose as it gets!
  11007. return comp.trim().replace(re[t.STAR], '')
  11008. }
  11009. // This function is passed to string.replace(re[t.HYPHENRANGE])
  11010. // M, m, patch, prerelease, build
  11011. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  11012. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  11013. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  11014. function hyphenReplace ($0,
  11015. from, fM, fm, fp, fpr, fb,
  11016. to, tM, tm, tp, tpr, tb) {
  11017. if (isX(fM)) {
  11018. from = ''
  11019. } else if (isX(fm)) {
  11020. from = '>=' + fM + '.0.0'
  11021. } else if (isX(fp)) {
  11022. from = '>=' + fM + '.' + fm + '.0'
  11023. } else {
  11024. from = '>=' + from
  11025. }
  11026. if (isX(tM)) {
  11027. to = ''
  11028. } else if (isX(tm)) {
  11029. to = '<' + (+tM + 1) + '.0.0'
  11030. } else if (isX(tp)) {
  11031. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11032. } else if (tpr) {
  11033. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11034. } else {
  11035. to = '<=' + to
  11036. }
  11037. return (from + ' ' + to).trim()
  11038. }
  11039. // if ANY of the sets match ALL of its comparators, then pass
  11040. Range.prototype.test = function (version) {
  11041. if (!version) {
  11042. return false
  11043. }
  11044. if (typeof version === 'string') {
  11045. try {
  11046. version = new SemVer(version, this.options)
  11047. } catch (er) {
  11048. return false
  11049. }
  11050. }
  11051. for (var i = 0; i < this.set.length; i++) {
  11052. if (testSet(this.set[i], version, this.options)) {
  11053. return true
  11054. }
  11055. }
  11056. return false
  11057. }
  11058. function testSet (set, version, options) {
  11059. for (var i = 0; i < set.length; i++) {
  11060. if (!set[i].test(version)) {
  11061. return false
  11062. }
  11063. }
  11064. if (version.prerelease.length && !options.includePrerelease) {
  11065. // Find the set of versions that are allowed to have prereleases
  11066. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11067. // That should allow `1.2.3-pr.2` to pass.
  11068. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11069. // even though it's within the range set by the comparators.
  11070. for (i = 0; i < set.length; i++) {
  11071. debug(set[i].semver)
  11072. if (set[i].semver === ANY) {
  11073. continue
  11074. }
  11075. if (set[i].semver.prerelease.length > 0) {
  11076. var allowed = set[i].semver
  11077. if (allowed.major === version.major &&
  11078. allowed.minor === version.minor &&
  11079. allowed.patch === version.patch) {
  11080. return true
  11081. }
  11082. }
  11083. }
  11084. // Version has a -pre, but it's not one of the ones we like.
  11085. return false
  11086. }
  11087. return true
  11088. }
  11089. exports.satisfies = satisfies
  11090. function satisfies (version, range, options) {
  11091. try {
  11092. range = new Range(range, options)
  11093. } catch (er) {
  11094. return false
  11095. }
  11096. return range.test(version)
  11097. }
  11098. exports.maxSatisfying = maxSatisfying
  11099. function maxSatisfying (versions, range, options) {
  11100. var max = null
  11101. var maxSV = null
  11102. try {
  11103. var rangeObj = new Range(range, options)
  11104. } catch (er) {
  11105. return null
  11106. }
  11107. versions.forEach(function (v) {
  11108. if (rangeObj.test(v)) {
  11109. // satisfies(v, range, options)
  11110. if (!max || maxSV.compare(v) === -1) {
  11111. // compare(max, v, true)
  11112. max = v
  11113. maxSV = new SemVer(max, options)
  11114. }
  11115. }
  11116. })
  11117. return max
  11118. }
  11119. exports.minSatisfying = minSatisfying
  11120. function minSatisfying (versions, range, options) {
  11121. var min = null
  11122. var minSV = null
  11123. try {
  11124. var rangeObj = new Range(range, options)
  11125. } catch (er) {
  11126. return null
  11127. }
  11128. versions.forEach(function (v) {
  11129. if (rangeObj.test(v)) {
  11130. // satisfies(v, range, options)
  11131. if (!min || minSV.compare(v) === 1) {
  11132. // compare(min, v, true)
  11133. min = v
  11134. minSV = new SemVer(min, options)
  11135. }
  11136. }
  11137. })
  11138. return min
  11139. }
  11140. exports.minVersion = minVersion
  11141. function minVersion (range, loose) {
  11142. range = new Range(range, loose)
  11143. var minver = new SemVer('0.0.0')
  11144. if (range.test(minver)) {
  11145. return minver
  11146. }
  11147. minver = new SemVer('0.0.0-0')
  11148. if (range.test(minver)) {
  11149. return minver
  11150. }
  11151. minver = null
  11152. for (var i = 0; i < range.set.length; ++i) {
  11153. var comparators = range.set[i]
  11154. comparators.forEach(function (comparator) {
  11155. // Clone to avoid manipulating the comparator's semver object.
  11156. var compver = new SemVer(comparator.semver.version)
  11157. switch (comparator.operator) {
  11158. case '>':
  11159. if (compver.prerelease.length === 0) {
  11160. compver.patch++
  11161. } else {
  11162. compver.prerelease.push(0)
  11163. }
  11164. compver.raw = compver.format()
  11165. /* fallthrough */
  11166. case '':
  11167. case '>=':
  11168. if (!minver || gt(minver, compver)) {
  11169. minver = compver
  11170. }
  11171. break
  11172. case '<':
  11173. case '<=':
  11174. /* Ignore maximum versions */
  11175. break
  11176. /* istanbul ignore next */
  11177. default:
  11178. throw new Error('Unexpected operation: ' + comparator.operator)
  11179. }
  11180. })
  11181. }
  11182. if (minver && range.test(minver)) {
  11183. return minver
  11184. }
  11185. return null
  11186. }
  11187. exports.validRange = validRange
  11188. function validRange (range, options) {
  11189. try {
  11190. // Return '*' instead of '' so that truthiness works.
  11191. // This will throw if it's invalid anyway
  11192. return new Range(range, options).range || '*'
  11193. } catch (er) {
  11194. return null
  11195. }
  11196. }
  11197. // Determine if version is less than all the versions possible in the range
  11198. exports.ltr = ltr
  11199. function ltr (version, range, options) {
  11200. return outside(version, range, '<', options)
  11201. }
  11202. // Determine if version is greater than all the versions possible in the range.
  11203. exports.gtr = gtr
  11204. function gtr (version, range, options) {
  11205. return outside(version, range, '>', options)
  11206. }
  11207. exports.outside = outside
  11208. function outside (version, range, hilo, options) {
  11209. version = new SemVer(version, options)
  11210. range = new Range(range, options)
  11211. var gtfn, ltefn, ltfn, comp, ecomp
  11212. switch (hilo) {
  11213. case '>':
  11214. gtfn = gt
  11215. ltefn = lte
  11216. ltfn = lt
  11217. comp = '>'
  11218. ecomp = '>='
  11219. break
  11220. case '<':
  11221. gtfn = lt
  11222. ltefn = gte
  11223. ltfn = gt
  11224. comp = '<'
  11225. ecomp = '<='
  11226. break
  11227. default:
  11228. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11229. }
  11230. // If it satisifes the range it is not outside
  11231. if (satisfies(version, range, options)) {
  11232. return false
  11233. }
  11234. // From now on, variable terms are as if we're in "gtr" mode.
  11235. // but note that everything is flipped for the "ltr" function.
  11236. for (var i = 0; i < range.set.length; ++i) {
  11237. var comparators = range.set[i]
  11238. var high = null
  11239. var low = null
  11240. comparators.forEach(function (comparator) {
  11241. if (comparator.semver === ANY) {
  11242. comparator = new Comparator('>=0.0.0')
  11243. }
  11244. high = high || comparator
  11245. low = low || comparator
  11246. if (gtfn(comparator.semver, high.semver, options)) {
  11247. high = comparator
  11248. } else if (ltfn(comparator.semver, low.semver, options)) {
  11249. low = comparator
  11250. }
  11251. })
  11252. // If the edge version comparator has a operator then our version
  11253. // isn't outside it
  11254. if (high.operator === comp || high.operator === ecomp) {
  11255. return false
  11256. }
  11257. // If the lowest version comparator has an operator and our version
  11258. // is less than it then it isn't higher than the range
  11259. if ((!low.operator || low.operator === comp) &&
  11260. ltefn(version, low.semver)) {
  11261. return false
  11262. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11263. return false
  11264. }
  11265. }
  11266. return true
  11267. }
  11268. exports.prerelease = prerelease
  11269. function prerelease (version, options) {
  11270. var parsed = parse(version, options)
  11271. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11272. }
  11273. exports.intersects = intersects
  11274. function intersects (r1, r2, options) {
  11275. r1 = new Range(r1, options)
  11276. r2 = new Range(r2, options)
  11277. return r1.intersects(r2)
  11278. }
  11279. exports.coerce = coerce
  11280. function coerce (version, options) {
  11281. if (version instanceof SemVer) {
  11282. return version
  11283. }
  11284. if (typeof version === 'number') {
  11285. version = String(version)
  11286. }
  11287. if (typeof version !== 'string') {
  11288. return null
  11289. }
  11290. options = options || {}
  11291. var match = null
  11292. if (!options.rtl) {
  11293. match = version.match(re[t.COERCE])
  11294. } else {
  11295. // Find the right-most coercible string that does not share
  11296. // a terminus with a more left-ward coercible string.
  11297. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11298. //
  11299. // Walk through the string checking with a /g regexp
  11300. // Manually set the index so as to pick up overlapping matches.
  11301. // Stop when we get a match that ends at the string end, since no
  11302. // coercible string can be more right-ward without the same terminus.
  11303. var next
  11304. while ((next = re[t.COERCERTL].exec(version)) &&
  11305. (!match || match.index + match[0].length !== version.length)
  11306. ) {
  11307. if (!match ||
  11308. next.index + next[0].length !== match.index + match[0].length) {
  11309. match = next
  11310. }
  11311. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11312. }
  11313. // leave it in a clean state
  11314. re[t.COERCERTL].lastIndex = -1
  11315. }
  11316. if (match === null) {
  11317. return null
  11318. }
  11319. return parse(match[2] +
  11320. '.' + (match[3] || '0') +
  11321. '.' + (match[4] || '0'), options)
  11322. }
  11323. /***/ }),
  11324. /***/ 669:
  11325. /***/ (function(module) {
  11326. module.exports = require("util");
  11327. /***/ }),
  11328. /***/ 672:
  11329. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11330. "use strict";
  11331. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11332. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11333. return new (P || (P = Promise))(function (resolve, reject) {
  11334. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11335. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11336. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11337. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11338. });
  11339. };
  11340. var _a;
  11341. Object.defineProperty(exports, "__esModule", { value: true });
  11342. const assert_1 = __webpack_require__(357);
  11343. const fs = __webpack_require__(747);
  11344. const path = __webpack_require__(622);
  11345. _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;
  11346. exports.IS_WINDOWS = process.platform === 'win32';
  11347. function exists(fsPath) {
  11348. return __awaiter(this, void 0, void 0, function* () {
  11349. try {
  11350. yield exports.stat(fsPath);
  11351. }
  11352. catch (err) {
  11353. if (err.code === 'ENOENT') {
  11354. return false;
  11355. }
  11356. throw err;
  11357. }
  11358. return true;
  11359. });
  11360. }
  11361. exports.exists = exists;
  11362. function isDirectory(fsPath, useStat = false) {
  11363. return __awaiter(this, void 0, void 0, function* () {
  11364. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11365. return stats.isDirectory();
  11366. });
  11367. }
  11368. exports.isDirectory = isDirectory;
  11369. /**
  11370. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11371. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11372. */
  11373. function isRooted(p) {
  11374. p = normalizeSeparators(p);
  11375. if (!p) {
  11376. throw new Error('isRooted() parameter "p" cannot be empty');
  11377. }
  11378. if (exports.IS_WINDOWS) {
  11379. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11380. ); // e.g. C: or C:\hello
  11381. }
  11382. return p.startsWith('/');
  11383. }
  11384. exports.isRooted = isRooted;
  11385. /**
  11386. * Recursively create a directory at `fsPath`.
  11387. *
  11388. * This implementation is optimistic, meaning it attempts to create the full
  11389. * path first, and backs up the path stack from there.
  11390. *
  11391. * @param fsPath The path to create
  11392. * @param maxDepth The maximum recursion depth
  11393. * @param depth The current recursion depth
  11394. */
  11395. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11396. return __awaiter(this, void 0, void 0, function* () {
  11397. assert_1.ok(fsPath, 'a path argument must be provided');
  11398. fsPath = path.resolve(fsPath);
  11399. if (depth >= maxDepth)
  11400. return exports.mkdir(fsPath);
  11401. try {
  11402. yield exports.mkdir(fsPath);
  11403. return;
  11404. }
  11405. catch (err) {
  11406. switch (err.code) {
  11407. case 'ENOENT': {
  11408. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11409. yield exports.mkdir(fsPath);
  11410. return;
  11411. }
  11412. default: {
  11413. let stats;
  11414. try {
  11415. stats = yield exports.stat(fsPath);
  11416. }
  11417. catch (err2) {
  11418. throw err;
  11419. }
  11420. if (!stats.isDirectory())
  11421. throw err;
  11422. }
  11423. }
  11424. }
  11425. });
  11426. }
  11427. exports.mkdirP = mkdirP;
  11428. /**
  11429. * Best effort attempt to determine whether a file exists and is executable.
  11430. * @param filePath file path to check
  11431. * @param extensions additional file extensions to try
  11432. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11433. */
  11434. function tryGetExecutablePath(filePath, extensions) {
  11435. return __awaiter(this, void 0, void 0, function* () {
  11436. let stats = undefined;
  11437. try {
  11438. // test file exists
  11439. stats = yield exports.stat(filePath);
  11440. }
  11441. catch (err) {
  11442. if (err.code !== 'ENOENT') {
  11443. // eslint-disable-next-line no-console
  11444. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11445. }
  11446. }
  11447. if (stats && stats.isFile()) {
  11448. if (exports.IS_WINDOWS) {
  11449. // on Windows, test for valid extension
  11450. const upperExt = path.extname(filePath).toUpperCase();
  11451. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11452. return filePath;
  11453. }
  11454. }
  11455. else {
  11456. if (isUnixExecutable(stats)) {
  11457. return filePath;
  11458. }
  11459. }
  11460. }
  11461. // try each extension
  11462. const originalFilePath = filePath;
  11463. for (const extension of extensions) {
  11464. filePath = originalFilePath + extension;
  11465. stats = undefined;
  11466. try {
  11467. stats = yield exports.stat(filePath);
  11468. }
  11469. catch (err) {
  11470. if (err.code !== 'ENOENT') {
  11471. // eslint-disable-next-line no-console
  11472. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11473. }
  11474. }
  11475. if (stats && stats.isFile()) {
  11476. if (exports.IS_WINDOWS) {
  11477. // preserve the case of the actual file (since an extension was appended)
  11478. try {
  11479. const directory = path.dirname(filePath);
  11480. const upperName = path.basename(filePath).toUpperCase();
  11481. for (const actualName of yield exports.readdir(directory)) {
  11482. if (upperName === actualName.toUpperCase()) {
  11483. filePath = path.join(directory, actualName);
  11484. break;
  11485. }
  11486. }
  11487. }
  11488. catch (err) {
  11489. // eslint-disable-next-line no-console
  11490. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11491. }
  11492. return filePath;
  11493. }
  11494. else {
  11495. if (isUnixExecutable(stats)) {
  11496. return filePath;
  11497. }
  11498. }
  11499. }
  11500. }
  11501. return '';
  11502. });
  11503. }
  11504. exports.tryGetExecutablePath = tryGetExecutablePath;
  11505. function normalizeSeparators(p) {
  11506. p = p || '';
  11507. if (exports.IS_WINDOWS) {
  11508. // convert slashes on Windows
  11509. p = p.replace(/\//g, '\\');
  11510. // remove redundant slashes
  11511. return p.replace(/\\\\+/g, '\\');
  11512. }
  11513. // remove redundant slashes
  11514. return p.replace(/\/\/+/g, '/');
  11515. }
  11516. // on Mac/Linux, test the execute bit
  11517. // R W X R W X R W X
  11518. // 256 128 64 32 16 8 4 2 1
  11519. function isUnixExecutable(stats) {
  11520. return ((stats.mode & 1) > 0 ||
  11521. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11522. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11523. }
  11524. //# sourceMappingURL=io-util.js.map
  11525. /***/ }),
  11526. /***/ 674:
  11527. /***/ (function(module, __unusedexports, __webpack_require__) {
  11528. module.exports = authenticate;
  11529. const { Deprecation } = __webpack_require__(692);
  11530. const once = __webpack_require__(969);
  11531. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11532. function authenticate(state, options) {
  11533. deprecateAuthenticate(
  11534. state.octokit.log,
  11535. new Deprecation(
  11536. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11537. )
  11538. );
  11539. if (!options) {
  11540. state.auth = false;
  11541. return;
  11542. }
  11543. switch (options.type) {
  11544. case "basic":
  11545. if (!options.username || !options.password) {
  11546. throw new Error(
  11547. "Basic authentication requires both a username and password to be set"
  11548. );
  11549. }
  11550. break;
  11551. case "oauth":
  11552. if (!options.token && !(options.key && options.secret)) {
  11553. throw new Error(
  11554. "OAuth2 authentication requires a token or key & secret to be set"
  11555. );
  11556. }
  11557. break;
  11558. case "token":
  11559. case "app":
  11560. if (!options.token) {
  11561. throw new Error("Token authentication requires a token to be set");
  11562. }
  11563. break;
  11564. default:
  11565. throw new Error(
  11566. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11567. );
  11568. }
  11569. state.auth = options;
  11570. }
  11571. /***/ }),
  11572. /***/ 675:
  11573. /***/ (function(module) {
  11574. module.exports = function btoa(str) {
  11575. return new Buffer(str).toString('base64')
  11576. }
  11577. /***/ }),
  11578. /***/ 692:
  11579. /***/ (function(__unusedmodule, exports) {
  11580. "use strict";
  11581. Object.defineProperty(exports, '__esModule', { value: true });
  11582. class Deprecation extends Error {
  11583. constructor(message) {
  11584. super(message); // Maintains proper stack trace (only available on V8)
  11585. /* istanbul ignore next */
  11586. if (Error.captureStackTrace) {
  11587. Error.captureStackTrace(this, this.constructor);
  11588. }
  11589. this.name = 'Deprecation';
  11590. }
  11591. }
  11592. exports.Deprecation = Deprecation;
  11593. /***/ }),
  11594. /***/ 696:
  11595. /***/ (function(module) {
  11596. "use strict";
  11597. /*!
  11598. * isobject <https://github.com/jonschlinkert/isobject>
  11599. *
  11600. * Copyright (c) 2014-2017, Jon Schlinkert.
  11601. * Released under the MIT License.
  11602. */
  11603. function isObject(val) {
  11604. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11605. }
  11606. /*!
  11607. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11608. *
  11609. * Copyright (c) 2014-2017, Jon Schlinkert.
  11610. * Released under the MIT License.
  11611. */
  11612. function isObjectObject(o) {
  11613. return isObject(o) === true
  11614. && Object.prototype.toString.call(o) === '[object Object]';
  11615. }
  11616. function isPlainObject(o) {
  11617. var ctor,prot;
  11618. if (isObjectObject(o) === false) return false;
  11619. // If has modified constructor
  11620. ctor = o.constructor;
  11621. if (typeof ctor !== 'function') return false;
  11622. // If has modified prototype
  11623. prot = ctor.prototype;
  11624. if (isObjectObject(prot) === false) return false;
  11625. // If constructor does not have an Object-specific method
  11626. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11627. return false;
  11628. }
  11629. // Most likely a plain Object
  11630. return true;
  11631. }
  11632. module.exports = isPlainObject;
  11633. /***/ }),
  11634. /***/ 697:
  11635. /***/ (function(module) {
  11636. "use strict";
  11637. module.exports = (promise, onFinally) => {
  11638. onFinally = onFinally || (() => {});
  11639. return promise.then(
  11640. val => new Promise(resolve => {
  11641. resolve(onFinally());
  11642. }).then(() => val),
  11643. err => new Promise(resolve => {
  11644. resolve(onFinally());
  11645. }).then(() => {
  11646. throw err;
  11647. })
  11648. );
  11649. };
  11650. /***/ }),
  11651. /***/ 705:
  11652. /***/ (function(module) {
  11653. 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"},"revokeInstallationToken":{"headers":{"accept":"application/vnd.github.gambit-preview+json"},"method":"DELETE","params":{},"url":"/installation/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":{"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":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/import/authors"},"getImportProgress":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import"},"getLargeFiles":{"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"},"listReposForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/migrations/:migration_id/repositories"},"listReposForUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/:migration_id/repositories"},"mapCommitAuthor":{"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":{"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":{"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":{"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_internal_repositories":{"type":"boolean"},"members_can_create_private_repositories":{"type":"boolean"},"members_can_create_public_repositories":{"type":"boolean"},"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":{"deprecated":"octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)","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"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"createForTeamDiscussionComment":{"deprecated":"octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)","headers":{"accept":"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"},"createForTeamDiscussionCommentInOrg":{"headers":{"accept":"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"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"},"createForTeamDiscussionCommentLegacy":{"deprecated":"octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy","headers":{"accept":"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"},"createForTeamDiscussionInOrg":{"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"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"},"createForTeamDiscussionLegacy":{"deprecated":"octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy","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"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"delete":{"headers":{"accept":"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":{"deprecated":"octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)","headers":{"accept":"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":{"deprecated":"octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)","headers":{"accept":"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"},"listForTeamDiscussionCommentInOrg":{"headers":{"accept":"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"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"},"listForTeamDiscussionCommentLegacy":{"deprecated":"octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy","headers":{"accept":"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"},"listForTeamDiscussionInOrg":{"headers":{"accept":"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"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"},"listForTeamDiscussionLegacy":{"deprecated":"octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy","headers":{"accept":"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"}},"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"},"delete_branch_on_merge":{"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"},"visibility":{"enum":["public","private","visibility","internal"],"type":"string"}},"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"},"delete_branch_on_merge":{"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"},"visibility":{"enum":["public","private","visibility","internal"],"type":"string"}},"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","internal"],"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":{"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"},"delete_branch_on_merge":{"type":"boolean"},"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"},"visibility":{"enum":["public","private","visibility","internal"],"type":"string"}},"url":"/repos/:owner/:repo"},"updateBranchProtection":{"method":"PUT","params":{"allow_deletions":{"type":"boolean"},"allow_force_pushes":{"allowNull":true,"type":"boolean"},"branch":{"required":true,"type":"string"},"enforce_admins":{"allowNull":true,"required":true,"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"required_linear_history":{"type":"boolean"},"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() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)","method":"PUT","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"addMemberLegacy":{"deprecated":"octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy","method":"PUT","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"addOrUpdateMembership":{"deprecated":"octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)","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"},"addOrUpdateMembershipInOrg":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"role":{"enum":["member","maintainer"],"type":"string"},"team_slug":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/memberships/:username"},"addOrUpdateMembershipLegacy":{"deprecated":"octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy","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":{"deprecated":"octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)","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"},"addOrUpdateProjectInOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"org":{"required":true,"type":"string"},"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/projects/:project_id"},"addOrUpdateProjectLegacy":{"deprecated":"octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy","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":{"deprecated":"octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)","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"},"addOrUpdateRepoInOrg":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/repos/:owner/:repo"},"addOrUpdateRepoLegacy":{"deprecated":"octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy","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":{"deprecated":"octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)","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"},"checkManagesRepoInOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/repos/:owner/:repo"},"checkManagesRepoLegacy":{"deprecated":"octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy","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":{"deprecated":"octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)","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":{"deprecated":"octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)","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"},"createDiscussionCommentInOrg":{"method":"POST","params":{"body":{"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"},"createDiscussionCommentLegacy":{"deprecated":"octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy","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"},"createDiscussionInOrg":{"method":"POST","params":{"body":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_slug":{"required":true,"type":"string"},"title":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions"},"createDiscussionLegacy":{"deprecated":"octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy","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"},"delete":{"deprecated":"octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"deleteDiscussion":{"deprecated":"octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)","method":"DELETE","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"deleteDiscussionComment":{"deprecated":"octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)","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"},"deleteDiscussionCommentInOrg":{"method":"DELETE","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"},"deleteDiscussionCommentLegacy":{"deprecated":"octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy","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"},"deleteDiscussionInOrg":{"method":"DELETE","params":{"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number"},"deleteDiscussionLegacy":{"deprecated":"octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy","method":"DELETE","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"deleteInOrg":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug"},"deleteLegacy":{"deprecated":"octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"get":{"deprecated":"octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)","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":{"deprecated":"octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)","method":"GET","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"getDiscussionComment":{"deprecated":"octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)","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"},"getDiscussionCommentInOrg":{"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"},"getDiscussionCommentLegacy":{"deprecated":"octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy","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"},"getDiscussionInOrg":{"method":"GET","params":{"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number"},"getDiscussionLegacy":{"deprecated":"octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy","method":"GET","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"getLegacy":{"deprecated":"octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy","method":"GET","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"getMember":{"deprecated":"octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)","method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"getMemberLegacy":{"deprecated":"octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy","method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"getMembership":{"deprecated":"octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)","method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"getMembershipInOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/memberships/:username"},"getMembershipLegacy":{"deprecated":"octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy","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":{"deprecated":"octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/teams"},"listChildInOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/teams"},"listChildLegacy":{"deprecated":"octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/teams"},"listDiscussionComments":{"deprecated":"octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)","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"},"listDiscussionCommentsInOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"},"listDiscussionCommentsLegacy":{"deprecated":"octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy","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":{"deprecated":"octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)","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"},"listDiscussionsInOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions"},"listDiscussionsLegacy":{"deprecated":"octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy","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":{"deprecated":"octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)","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"},"listMembersInOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["member","maintainer","all"],"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/members"},"listMembersLegacy":{"deprecated":"octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy","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":{"deprecated":"octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/invitations"},"listPendingInvitationsInOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/invitations"},"listPendingInvitationsLegacy":{"deprecated":"octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/invitations"},"listProjects":{"deprecated":"octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)","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"},"listProjectsInOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/projects"},"listProjectsLegacy":{"deprecated":"octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy","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":{"deprecated":"octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos"},"listReposInOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/repos"},"listReposLegacy":{"deprecated":"octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos"},"removeMemberLegacy":{"deprecated":"octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"removeMembershipInOrg":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/memberships/:username"},"removeMembershipLegacy":{"deprecated":"octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"removeProject":{"deprecated":"octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)","method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"removeProjectInOrg":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"project_id":{"required":true,"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/projects/:project_id"},"removeProjectLegacy":{"deprecated":"octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy","method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"removeRepo":{"deprecated":"octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)","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"},"removeRepoInOrg":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/repos/:owner/:repo"},"removeRepoLegacy":{"deprecated":"octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy","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":{"deprecated":"octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)","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"},"reviewProjectInOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"project_id":{"required":true,"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/projects/:project_id"},"reviewProjectLegacy":{"deprecated":"octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy","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":{"deprecated":"octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)","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":{"deprecated":"octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)","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":{"deprecated":"octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)","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"},"updateDiscussionCommentInOrg":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"},"updateDiscussionCommentLegacy":{"deprecated":"octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy","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"},"updateDiscussionInOrg":{"method":"PATCH","params":{"body":{"type":"string"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"},"title":{"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number"},"updateDiscussionLegacy":{"deprecated":"octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy","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"},"updateInOrg":{"method":"PATCH","params":{"description":{"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"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug"},"updateLegacy":{"deprecated":"octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy","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"}},"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":{"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"}}};
  11654. /***/ }),
  11655. /***/ 722:
  11656. /***/ (function(module) {
  11657. /**
  11658. * Convert array of 16 byte values to UUID string format of the form:
  11659. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11660. */
  11661. var byteToHex = [];
  11662. for (var i = 0; i < 256; ++i) {
  11663. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11664. }
  11665. function bytesToUuid(buf, offset) {
  11666. var i = offset || 0;
  11667. var bth = byteToHex;
  11668. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11669. return ([bth[buf[i++]], bth[buf[i++]],
  11670. bth[buf[i++]], bth[buf[i++]], '-',
  11671. bth[buf[i++]], bth[buf[i++]], '-',
  11672. bth[buf[i++]], bth[buf[i++]], '-',
  11673. bth[buf[i++]], bth[buf[i++]], '-',
  11674. bth[buf[i++]], bth[buf[i++]],
  11675. bth[buf[i++]], bth[buf[i++]],
  11676. bth[buf[i++]], bth[buf[i++]]]).join('');
  11677. }
  11678. module.exports = bytesToUuid;
  11679. /***/ }),
  11680. /***/ 742:
  11681. /***/ (function(module, __unusedexports, __webpack_require__) {
  11682. var fs = __webpack_require__(747)
  11683. var core
  11684. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11685. core = __webpack_require__(818)
  11686. } else {
  11687. core = __webpack_require__(197)
  11688. }
  11689. module.exports = isexe
  11690. isexe.sync = sync
  11691. function isexe (path, options, cb) {
  11692. if (typeof options === 'function') {
  11693. cb = options
  11694. options = {}
  11695. }
  11696. if (!cb) {
  11697. if (typeof Promise !== 'function') {
  11698. throw new TypeError('callback not provided')
  11699. }
  11700. return new Promise(function (resolve, reject) {
  11701. isexe(path, options || {}, function (er, is) {
  11702. if (er) {
  11703. reject(er)
  11704. } else {
  11705. resolve(is)
  11706. }
  11707. })
  11708. })
  11709. }
  11710. core(path, options || {}, function (er, is) {
  11711. // ignore EACCES because that just means we aren't allowed to run it
  11712. if (er) {
  11713. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11714. er = null
  11715. is = false
  11716. }
  11717. }
  11718. cb(er, is)
  11719. })
  11720. }
  11721. function sync (path, options) {
  11722. // my kingdom for a filtered catch
  11723. try {
  11724. return core.sync(path, options || {})
  11725. } catch (er) {
  11726. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11727. return false
  11728. } else {
  11729. throw er
  11730. }
  11731. }
  11732. }
  11733. /***/ }),
  11734. /***/ 747:
  11735. /***/ (function(module) {
  11736. module.exports = require("fs");
  11737. /***/ }),
  11738. /***/ 753:
  11739. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11740. "use strict";
  11741. Object.defineProperty(exports, '__esModule', { value: true });
  11742. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11743. var endpoint = __webpack_require__(385);
  11744. var universalUserAgent = __webpack_require__(796);
  11745. var isPlainObject = _interopDefault(__webpack_require__(696));
  11746. var nodeFetch = _interopDefault(__webpack_require__(454));
  11747. var requestError = __webpack_require__(463);
  11748. const VERSION = "5.3.1";
  11749. function getBufferResponse(response) {
  11750. return response.arrayBuffer();
  11751. }
  11752. function fetchWrapper(requestOptions) {
  11753. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11754. requestOptions.body = JSON.stringify(requestOptions.body);
  11755. }
  11756. let headers = {};
  11757. let status;
  11758. let url;
  11759. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11760. return fetch(requestOptions.url, Object.assign({
  11761. method: requestOptions.method,
  11762. body: requestOptions.body,
  11763. headers: requestOptions.headers,
  11764. redirect: requestOptions.redirect
  11765. }, requestOptions.request)).then(response => {
  11766. url = response.url;
  11767. status = response.status;
  11768. for (const keyAndValue of response.headers) {
  11769. headers[keyAndValue[0]] = keyAndValue[1];
  11770. }
  11771. if (status === 204 || status === 205) {
  11772. return;
  11773. } // GitHub API returns 200 for HEAD requsets
  11774. if (requestOptions.method === "HEAD") {
  11775. if (status < 400) {
  11776. return;
  11777. }
  11778. throw new requestError.RequestError(response.statusText, status, {
  11779. headers,
  11780. request: requestOptions
  11781. });
  11782. }
  11783. if (status === 304) {
  11784. throw new requestError.RequestError("Not modified", status, {
  11785. headers,
  11786. request: requestOptions
  11787. });
  11788. }
  11789. if (status >= 400) {
  11790. return response.text().then(message => {
  11791. const error = new requestError.RequestError(message, status, {
  11792. headers,
  11793. request: requestOptions
  11794. });
  11795. try {
  11796. let responseBody = JSON.parse(error.message);
  11797. Object.assign(error, responseBody);
  11798. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11799. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11800. } catch (e) {// ignore, see octokit/rest.js#684
  11801. }
  11802. throw error;
  11803. });
  11804. }
  11805. const contentType = response.headers.get("content-type");
  11806. if (/application\/json/.test(contentType)) {
  11807. return response.json();
  11808. }
  11809. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11810. return response.text();
  11811. }
  11812. return getBufferResponse(response);
  11813. }).then(data => {
  11814. return {
  11815. status,
  11816. url,
  11817. headers,
  11818. data
  11819. };
  11820. }).catch(error => {
  11821. if (error instanceof requestError.RequestError) {
  11822. throw error;
  11823. }
  11824. throw new requestError.RequestError(error.message, 500, {
  11825. headers,
  11826. request: requestOptions
  11827. });
  11828. });
  11829. }
  11830. function withDefaults(oldEndpoint, newDefaults) {
  11831. const endpoint = oldEndpoint.defaults(newDefaults);
  11832. const newApi = function (route, parameters) {
  11833. const endpointOptions = endpoint.merge(route, parameters);
  11834. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11835. return fetchWrapper(endpoint.parse(endpointOptions));
  11836. }
  11837. const request = (route, parameters) => {
  11838. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11839. };
  11840. Object.assign(request, {
  11841. endpoint,
  11842. defaults: withDefaults.bind(null, endpoint)
  11843. });
  11844. return endpointOptions.request.hook(request, endpointOptions);
  11845. };
  11846. return Object.assign(newApi, {
  11847. endpoint,
  11848. defaults: withDefaults.bind(null, endpoint)
  11849. });
  11850. }
  11851. const request = withDefaults(endpoint.endpoint, {
  11852. headers: {
  11853. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11854. }
  11855. });
  11856. exports.request = request;
  11857. //# sourceMappingURL=index.js.map
  11858. /***/ }),
  11859. /***/ 761:
  11860. /***/ (function(module) {
  11861. module.exports = require("zlib");
  11862. /***/ }),
  11863. /***/ 763:
  11864. /***/ (function(module) {
  11865. module.exports = removeHook
  11866. function removeHook (state, name, method) {
  11867. if (!state.registry[name]) {
  11868. return
  11869. }
  11870. var index = state.registry[name]
  11871. .map(function (registered) { return registered.orig })
  11872. .indexOf(method)
  11873. if (index === -1) {
  11874. return
  11875. }
  11876. state.registry[name].splice(index, 1)
  11877. }
  11878. /***/ }),
  11879. /***/ 768:
  11880. /***/ (function(module) {
  11881. "use strict";
  11882. module.exports = function (x) {
  11883. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11884. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11885. if (x[x.length - 1] === lf) {
  11886. x = x.slice(0, x.length - 1);
  11887. }
  11888. if (x[x.length - 1] === cr) {
  11889. x = x.slice(0, x.length - 1);
  11890. }
  11891. return x;
  11892. };
  11893. /***/ }),
  11894. /***/ 777:
  11895. /***/ (function(module, __unusedexports, __webpack_require__) {
  11896. module.exports = getFirstPage
  11897. const getPage = __webpack_require__(265)
  11898. function getFirstPage (octokit, link, headers) {
  11899. return getPage(octokit, link, 'first', headers)
  11900. }
  11901. /***/ }),
  11902. /***/ 796:
  11903. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11904. "use strict";
  11905. Object.defineProperty(exports, '__esModule', { value: true });
  11906. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11907. var osName = _interopDefault(__webpack_require__(2));
  11908. function getUserAgent() {
  11909. try {
  11910. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  11911. } catch (error) {
  11912. if (/wmic os get Caption/.test(error.message)) {
  11913. return "Windows <version undetectable>";
  11914. }
  11915. throw error;
  11916. }
  11917. }
  11918. exports.getUserAgent = getUserAgent;
  11919. //# sourceMappingURL=index.js.map
  11920. /***/ }),
  11921. /***/ 807:
  11922. /***/ (function(module, __unusedexports, __webpack_require__) {
  11923. module.exports = paginate;
  11924. const iterator = __webpack_require__(8);
  11925. function paginate(octokit, route, options, mapFn) {
  11926. if (typeof options === "function") {
  11927. mapFn = options;
  11928. options = undefined;
  11929. }
  11930. options = octokit.request.endpoint.merge(route, options);
  11931. return gather(
  11932. octokit,
  11933. [],
  11934. iterator(octokit, options)[Symbol.asyncIterator](),
  11935. mapFn
  11936. );
  11937. }
  11938. function gather(octokit, results, iterator, mapFn) {
  11939. return iterator.next().then(result => {
  11940. if (result.done) {
  11941. return results;
  11942. }
  11943. let earlyExit = false;
  11944. function done() {
  11945. earlyExit = true;
  11946. }
  11947. results = results.concat(
  11948. mapFn ? mapFn(result.value, done) : result.value.data
  11949. );
  11950. if (earlyExit) {
  11951. return results;
  11952. }
  11953. return gather(octokit, results, iterator, mapFn);
  11954. });
  11955. }
  11956. /***/ }),
  11957. /***/ 813:
  11958. /***/ (function(__unusedmodule, exports) {
  11959. "use strict";
  11960. Object.defineProperty(exports, '__esModule', { value: true });
  11961. async function auth(token) {
  11962. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  11963. return {
  11964. type: "token",
  11965. token: token,
  11966. tokenType
  11967. };
  11968. }
  11969. /**
  11970. * Prefix token for usage in the Authorization header
  11971. *
  11972. * @param token OAuth token or JSON Web Token
  11973. */
  11974. function withAuthorizationPrefix(token) {
  11975. if (token.split(/\./).length === 3) {
  11976. return `bearer ${token}`;
  11977. }
  11978. return `token ${token}`;
  11979. }
  11980. async function hook(token, request, route, parameters) {
  11981. const endpoint = request.endpoint.merge(route, parameters);
  11982. endpoint.headers.authorization = withAuthorizationPrefix(token);
  11983. return request(endpoint);
  11984. }
  11985. const createTokenAuth = function createTokenAuth(token) {
  11986. if (!token) {
  11987. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  11988. }
  11989. if (typeof token !== "string") {
  11990. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  11991. }
  11992. token = token.replace(/^(token|bearer) +/i, "");
  11993. return Object.assign(auth.bind(null, token), {
  11994. hook: hook.bind(null, token)
  11995. });
  11996. };
  11997. exports.createTokenAuth = createTokenAuth;
  11998. //# sourceMappingURL=index.js.map
  11999. /***/ }),
  12000. /***/ 814:
  12001. /***/ (function(module, __unusedexports, __webpack_require__) {
  12002. module.exports = which
  12003. which.sync = whichSync
  12004. var isWindows = process.platform === 'win32' ||
  12005. process.env.OSTYPE === 'cygwin' ||
  12006. process.env.OSTYPE === 'msys'
  12007. var path = __webpack_require__(622)
  12008. var COLON = isWindows ? ';' : ':'
  12009. var isexe = __webpack_require__(742)
  12010. function getNotFoundError (cmd) {
  12011. var er = new Error('not found: ' + cmd)
  12012. er.code = 'ENOENT'
  12013. return er
  12014. }
  12015. function getPathInfo (cmd, opt) {
  12016. var colon = opt.colon || COLON
  12017. var pathEnv = opt.path || process.env.PATH || ''
  12018. var pathExt = ['']
  12019. pathEnv = pathEnv.split(colon)
  12020. var pathExtExe = ''
  12021. if (isWindows) {
  12022. pathEnv.unshift(process.cwd())
  12023. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12024. pathExt = pathExtExe.split(colon)
  12025. // Always test the cmd itself first. isexe will check to make sure
  12026. // it's found in the pathExt set.
  12027. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12028. pathExt.unshift('')
  12029. }
  12030. // If it has a slash, then we don't bother searching the pathenv.
  12031. // just check the file itself, and that's it.
  12032. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12033. pathEnv = ['']
  12034. return {
  12035. env: pathEnv,
  12036. ext: pathExt,
  12037. extExe: pathExtExe
  12038. }
  12039. }
  12040. function which (cmd, opt, cb) {
  12041. if (typeof opt === 'function') {
  12042. cb = opt
  12043. opt = {}
  12044. }
  12045. var info = getPathInfo(cmd, opt)
  12046. var pathEnv = info.env
  12047. var pathExt = info.ext
  12048. var pathExtExe = info.extExe
  12049. var found = []
  12050. ;(function F (i, l) {
  12051. if (i === l) {
  12052. if (opt.all && found.length)
  12053. return cb(null, found)
  12054. else
  12055. return cb(getNotFoundError(cmd))
  12056. }
  12057. var pathPart = pathEnv[i]
  12058. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12059. pathPart = pathPart.slice(1, -1)
  12060. var p = path.join(pathPart, cmd)
  12061. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12062. p = cmd.slice(0, 2) + p
  12063. }
  12064. ;(function E (ii, ll) {
  12065. if (ii === ll) return F(i + 1, l)
  12066. var ext = pathExt[ii]
  12067. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12068. if (!er && is) {
  12069. if (opt.all)
  12070. found.push(p + ext)
  12071. else
  12072. return cb(null, p + ext)
  12073. }
  12074. return E(ii + 1, ll)
  12075. })
  12076. })(0, pathExt.length)
  12077. })(0, pathEnv.length)
  12078. }
  12079. function whichSync (cmd, opt) {
  12080. opt = opt || {}
  12081. var info = getPathInfo(cmd, opt)
  12082. var pathEnv = info.env
  12083. var pathExt = info.ext
  12084. var pathExtExe = info.extExe
  12085. var found = []
  12086. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12087. var pathPart = pathEnv[i]
  12088. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12089. pathPart = pathPart.slice(1, -1)
  12090. var p = path.join(pathPart, cmd)
  12091. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12092. p = cmd.slice(0, 2) + p
  12093. }
  12094. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12095. var cur = p + pathExt[j]
  12096. var is
  12097. try {
  12098. is = isexe.sync(cur, { pathExt: pathExtExe })
  12099. if (is) {
  12100. if (opt.all)
  12101. found.push(cur)
  12102. else
  12103. return cur
  12104. }
  12105. } catch (ex) {}
  12106. }
  12107. }
  12108. if (opt.all && found.length)
  12109. return found
  12110. if (opt.nothrow)
  12111. return null
  12112. throw getNotFoundError(cmd)
  12113. }
  12114. /***/ }),
  12115. /***/ 816:
  12116. /***/ (function(module) {
  12117. "use strict";
  12118. module.exports = /^#!.*/;
  12119. /***/ }),
  12120. /***/ 818:
  12121. /***/ (function(module, __unusedexports, __webpack_require__) {
  12122. module.exports = isexe
  12123. isexe.sync = sync
  12124. var fs = __webpack_require__(747)
  12125. function checkPathExt (path, options) {
  12126. var pathext = options.pathExt !== undefined ?
  12127. options.pathExt : process.env.PATHEXT
  12128. if (!pathext) {
  12129. return true
  12130. }
  12131. pathext = pathext.split(';')
  12132. if (pathext.indexOf('') !== -1) {
  12133. return true
  12134. }
  12135. for (var i = 0; i < pathext.length; i++) {
  12136. var p = pathext[i].toLowerCase()
  12137. if (p && path.substr(-p.length).toLowerCase() === p) {
  12138. return true
  12139. }
  12140. }
  12141. return false
  12142. }
  12143. function checkStat (stat, path, options) {
  12144. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12145. return false
  12146. }
  12147. return checkPathExt(path, options)
  12148. }
  12149. function isexe (path, options, cb) {
  12150. fs.stat(path, function (er, stat) {
  12151. cb(er, er ? false : checkStat(stat, path, options))
  12152. })
  12153. }
  12154. function sync (path, options) {
  12155. return checkStat(fs.statSync(path), path, options)
  12156. }
  12157. /***/ }),
  12158. /***/ 821:
  12159. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12160. "use strict";
  12161. var __importStar = (this && this.__importStar) || function (mod) {
  12162. if (mod && mod.__esModule) return mod;
  12163. var result = {};
  12164. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12165. result["default"] = mod;
  12166. return result;
  12167. };
  12168. Object.defineProperty(exports, "__esModule", { value: true });
  12169. const core = __importStar(__webpack_require__(470));
  12170. const fsHelper = __importStar(__webpack_require__(618));
  12171. const github = __importStar(__webpack_require__(469));
  12172. const path = __importStar(__webpack_require__(622));
  12173. function getInputs() {
  12174. const result = {};
  12175. // GitHub workspace
  12176. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12177. if (!githubWorkspacePath) {
  12178. throw new Error('GITHUB_WORKSPACE not defined');
  12179. }
  12180. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12181. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12182. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12183. // Qualified repository
  12184. const qualifiedRepository = core.getInput('repository') ||
  12185. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12186. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12187. const splitRepository = qualifiedRepository.split('/');
  12188. if (splitRepository.length !== 2 ||
  12189. !splitRepository[0] ||
  12190. !splitRepository[1]) {
  12191. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12192. }
  12193. result.repositoryOwner = splitRepository[0];
  12194. result.repositoryName = splitRepository[1];
  12195. // Repository path
  12196. result.repositoryPath = core.getInput('path') || '.';
  12197. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12198. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12199. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12200. }
  12201. // Workflow repository?
  12202. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12203. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12204. // Source branch, source version
  12205. result.ref = core.getInput('ref');
  12206. if (!result.ref) {
  12207. if (isWorkflowRepository) {
  12208. result.ref = github.context.ref;
  12209. result.commit = github.context.sha;
  12210. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12211. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12212. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12213. result.ref = `refs/heads/${result.ref}`;
  12214. }
  12215. }
  12216. if (!result.ref && !result.commit) {
  12217. result.ref = 'refs/heads/master';
  12218. }
  12219. }
  12220. // SHA?
  12221. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12222. result.commit = result.ref;
  12223. result.ref = '';
  12224. }
  12225. core.debug(`ref = '${result.ref}'`);
  12226. core.debug(`commit = '${result.commit}'`);
  12227. // Clean
  12228. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12229. core.debug(`clean = ${result.clean}`);
  12230. // Fetch depth
  12231. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12232. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12233. result.fetchDepth = 0;
  12234. }
  12235. core.debug(`fetch depth = ${result.fetchDepth}`);
  12236. // LFS
  12237. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12238. core.debug(`lfs = ${result.lfs}`);
  12239. // Submodules
  12240. result.submodules = false;
  12241. result.nestedSubmodules = false;
  12242. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12243. if (submodulesString == 'RECURSIVE') {
  12244. result.submodules = true;
  12245. result.nestedSubmodules = true;
  12246. }
  12247. else if (submodulesString == 'TRUE') {
  12248. result.submodules = true;
  12249. }
  12250. core.debug(`submodules = ${result.submodules}`);
  12251. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12252. // Auth token
  12253. result.authToken = core.getInput('token');
  12254. // SSH
  12255. result.sshKey = core.getInput('ssh-key');
  12256. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12257. result.sshStrict =
  12258. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12259. // Persist credentials
  12260. result.persistCredentials =
  12261. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12262. return result;
  12263. }
  12264. exports.getInputs = getInputs;
  12265. /***/ }),
  12266. /***/ 826:
  12267. /***/ (function(module, __unusedexports, __webpack_require__) {
  12268. var rng = __webpack_require__(139);
  12269. var bytesToUuid = __webpack_require__(722);
  12270. function v4(options, buf, offset) {
  12271. var i = buf && offset || 0;
  12272. if (typeof(options) == 'string') {
  12273. buf = options === 'binary' ? new Array(16) : null;
  12274. options = null;
  12275. }
  12276. options = options || {};
  12277. var rnds = options.random || (options.rng || rng)();
  12278. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12279. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12280. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12281. // Copy bytes to buffer, if provided
  12282. if (buf) {
  12283. for (var ii = 0; ii < 16; ++ii) {
  12284. buf[i + ii] = rnds[ii];
  12285. }
  12286. }
  12287. return buf || bytesToUuid(rnds);
  12288. }
  12289. module.exports = v4;
  12290. /***/ }),
  12291. /***/ 835:
  12292. /***/ (function(module) {
  12293. module.exports = require("url");
  12294. /***/ }),
  12295. /***/ 850:
  12296. /***/ (function(module, __unusedexports, __webpack_require__) {
  12297. module.exports = paginationMethodsPlugin
  12298. function paginationMethodsPlugin (octokit) {
  12299. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  12300. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  12301. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  12302. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  12303. octokit.hasFirstPage = __webpack_require__(536)
  12304. octokit.hasLastPage = __webpack_require__(336)
  12305. octokit.hasNextPage = __webpack_require__(929)
  12306. octokit.hasPreviousPage = __webpack_require__(558)
  12307. }
  12308. /***/ }),
  12309. /***/ 854:
  12310. /***/ (function(module) {
  12311. /**
  12312. * lodash (Custom Build) <https://lodash.com/>
  12313. * Build: `lodash modularize exports="npm" -o ./`
  12314. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12315. * Released under MIT license <https://lodash.com/license>
  12316. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12317. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12318. */
  12319. /** Used as the `TypeError` message for "Functions" methods. */
  12320. var FUNC_ERROR_TEXT = 'Expected a function';
  12321. /** Used to stand-in for `undefined` hash values. */
  12322. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12323. /** Used as references for various `Number` constants. */
  12324. var INFINITY = 1 / 0;
  12325. /** `Object#toString` result references. */
  12326. var funcTag = '[object Function]',
  12327. genTag = '[object GeneratorFunction]',
  12328. symbolTag = '[object Symbol]';
  12329. /** Used to match property names within property paths. */
  12330. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12331. reIsPlainProp = /^\w*$/,
  12332. reLeadingDot = /^\./,
  12333. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12334. /**
  12335. * Used to match `RegExp`
  12336. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12337. */
  12338. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12339. /** Used to match backslashes in property paths. */
  12340. var reEscapeChar = /\\(\\)?/g;
  12341. /** Used to detect host constructors (Safari). */
  12342. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12343. /** Detect free variable `global` from Node.js. */
  12344. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12345. /** Detect free variable `self`. */
  12346. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12347. /** Used as a reference to the global object. */
  12348. var root = freeGlobal || freeSelf || Function('return this')();
  12349. /**
  12350. * Gets the value at `key` of `object`.
  12351. *
  12352. * @private
  12353. * @param {Object} [object] The object to query.
  12354. * @param {string} key The key of the property to get.
  12355. * @returns {*} Returns the property value.
  12356. */
  12357. function getValue(object, key) {
  12358. return object == null ? undefined : object[key];
  12359. }
  12360. /**
  12361. * Checks if `value` is a host object in IE < 9.
  12362. *
  12363. * @private
  12364. * @param {*} value The value to check.
  12365. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12366. */
  12367. function isHostObject(value) {
  12368. // Many host objects are `Object` objects that can coerce to strings
  12369. // despite having improperly defined `toString` methods.
  12370. var result = false;
  12371. if (value != null && typeof value.toString != 'function') {
  12372. try {
  12373. result = !!(value + '');
  12374. } catch (e) {}
  12375. }
  12376. return result;
  12377. }
  12378. /** Used for built-in method references. */
  12379. var arrayProto = Array.prototype,
  12380. funcProto = Function.prototype,
  12381. objectProto = Object.prototype;
  12382. /** Used to detect overreaching core-js shims. */
  12383. var coreJsData = root['__core-js_shared__'];
  12384. /** Used to detect methods masquerading as native. */
  12385. var maskSrcKey = (function() {
  12386. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12387. return uid ? ('Symbol(src)_1.' + uid) : '';
  12388. }());
  12389. /** Used to resolve the decompiled source of functions. */
  12390. var funcToString = funcProto.toString;
  12391. /** Used to check objects for own properties. */
  12392. var hasOwnProperty = objectProto.hasOwnProperty;
  12393. /**
  12394. * Used to resolve the
  12395. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12396. * of values.
  12397. */
  12398. var objectToString = objectProto.toString;
  12399. /** Used to detect if a method is native. */
  12400. var reIsNative = RegExp('^' +
  12401. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12402. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12403. );
  12404. /** Built-in value references. */
  12405. var Symbol = root.Symbol,
  12406. splice = arrayProto.splice;
  12407. /* Built-in method references that are verified to be native. */
  12408. var Map = getNative(root, 'Map'),
  12409. nativeCreate = getNative(Object, 'create');
  12410. /** Used to convert symbols to primitives and strings. */
  12411. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12412. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12413. /**
  12414. * Creates a hash object.
  12415. *
  12416. * @private
  12417. * @constructor
  12418. * @param {Array} [entries] The key-value pairs to cache.
  12419. */
  12420. function Hash(entries) {
  12421. var index = -1,
  12422. length = entries ? entries.length : 0;
  12423. this.clear();
  12424. while (++index < length) {
  12425. var entry = entries[index];
  12426. this.set(entry[0], entry[1]);
  12427. }
  12428. }
  12429. /**
  12430. * Removes all key-value entries from the hash.
  12431. *
  12432. * @private
  12433. * @name clear
  12434. * @memberOf Hash
  12435. */
  12436. function hashClear() {
  12437. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12438. }
  12439. /**
  12440. * Removes `key` and its value from the hash.
  12441. *
  12442. * @private
  12443. * @name delete
  12444. * @memberOf Hash
  12445. * @param {Object} hash The hash to modify.
  12446. * @param {string} key The key of the value to remove.
  12447. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12448. */
  12449. function hashDelete(key) {
  12450. return this.has(key) && delete this.__data__[key];
  12451. }
  12452. /**
  12453. * Gets the hash value for `key`.
  12454. *
  12455. * @private
  12456. * @name get
  12457. * @memberOf Hash
  12458. * @param {string} key The key of the value to get.
  12459. * @returns {*} Returns the entry value.
  12460. */
  12461. function hashGet(key) {
  12462. var data = this.__data__;
  12463. if (nativeCreate) {
  12464. var result = data[key];
  12465. return result === HASH_UNDEFINED ? undefined : result;
  12466. }
  12467. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12468. }
  12469. /**
  12470. * Checks if a hash value for `key` exists.
  12471. *
  12472. * @private
  12473. * @name has
  12474. * @memberOf Hash
  12475. * @param {string} key The key of the entry to check.
  12476. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12477. */
  12478. function hashHas(key) {
  12479. var data = this.__data__;
  12480. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12481. }
  12482. /**
  12483. * Sets the hash `key` to `value`.
  12484. *
  12485. * @private
  12486. * @name set
  12487. * @memberOf Hash
  12488. * @param {string} key The key of the value to set.
  12489. * @param {*} value The value to set.
  12490. * @returns {Object} Returns the hash instance.
  12491. */
  12492. function hashSet(key, value) {
  12493. var data = this.__data__;
  12494. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12495. return this;
  12496. }
  12497. // Add methods to `Hash`.
  12498. Hash.prototype.clear = hashClear;
  12499. Hash.prototype['delete'] = hashDelete;
  12500. Hash.prototype.get = hashGet;
  12501. Hash.prototype.has = hashHas;
  12502. Hash.prototype.set = hashSet;
  12503. /**
  12504. * Creates an list cache object.
  12505. *
  12506. * @private
  12507. * @constructor
  12508. * @param {Array} [entries] The key-value pairs to cache.
  12509. */
  12510. function ListCache(entries) {
  12511. var index = -1,
  12512. length = entries ? entries.length : 0;
  12513. this.clear();
  12514. while (++index < length) {
  12515. var entry = entries[index];
  12516. this.set(entry[0], entry[1]);
  12517. }
  12518. }
  12519. /**
  12520. * Removes all key-value entries from the list cache.
  12521. *
  12522. * @private
  12523. * @name clear
  12524. * @memberOf ListCache
  12525. */
  12526. function listCacheClear() {
  12527. this.__data__ = [];
  12528. }
  12529. /**
  12530. * Removes `key` and its value from the list cache.
  12531. *
  12532. * @private
  12533. * @name delete
  12534. * @memberOf ListCache
  12535. * @param {string} key The key of the value to remove.
  12536. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12537. */
  12538. function listCacheDelete(key) {
  12539. var data = this.__data__,
  12540. index = assocIndexOf(data, key);
  12541. if (index < 0) {
  12542. return false;
  12543. }
  12544. var lastIndex = data.length - 1;
  12545. if (index == lastIndex) {
  12546. data.pop();
  12547. } else {
  12548. splice.call(data, index, 1);
  12549. }
  12550. return true;
  12551. }
  12552. /**
  12553. * Gets the list cache value for `key`.
  12554. *
  12555. * @private
  12556. * @name get
  12557. * @memberOf ListCache
  12558. * @param {string} key The key of the value to get.
  12559. * @returns {*} Returns the entry value.
  12560. */
  12561. function listCacheGet(key) {
  12562. var data = this.__data__,
  12563. index = assocIndexOf(data, key);
  12564. return index < 0 ? undefined : data[index][1];
  12565. }
  12566. /**
  12567. * Checks if a list cache value for `key` exists.
  12568. *
  12569. * @private
  12570. * @name has
  12571. * @memberOf ListCache
  12572. * @param {string} key The key of the entry to check.
  12573. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12574. */
  12575. function listCacheHas(key) {
  12576. return assocIndexOf(this.__data__, key) > -1;
  12577. }
  12578. /**
  12579. * Sets the list cache `key` to `value`.
  12580. *
  12581. * @private
  12582. * @name set
  12583. * @memberOf ListCache
  12584. * @param {string} key The key of the value to set.
  12585. * @param {*} value The value to set.
  12586. * @returns {Object} Returns the list cache instance.
  12587. */
  12588. function listCacheSet(key, value) {
  12589. var data = this.__data__,
  12590. index = assocIndexOf(data, key);
  12591. if (index < 0) {
  12592. data.push([key, value]);
  12593. } else {
  12594. data[index][1] = value;
  12595. }
  12596. return this;
  12597. }
  12598. // Add methods to `ListCache`.
  12599. ListCache.prototype.clear = listCacheClear;
  12600. ListCache.prototype['delete'] = listCacheDelete;
  12601. ListCache.prototype.get = listCacheGet;
  12602. ListCache.prototype.has = listCacheHas;
  12603. ListCache.prototype.set = listCacheSet;
  12604. /**
  12605. * Creates a map cache object to store key-value pairs.
  12606. *
  12607. * @private
  12608. * @constructor
  12609. * @param {Array} [entries] The key-value pairs to cache.
  12610. */
  12611. function MapCache(entries) {
  12612. var index = -1,
  12613. length = entries ? entries.length : 0;
  12614. this.clear();
  12615. while (++index < length) {
  12616. var entry = entries[index];
  12617. this.set(entry[0], entry[1]);
  12618. }
  12619. }
  12620. /**
  12621. * Removes all key-value entries from the map.
  12622. *
  12623. * @private
  12624. * @name clear
  12625. * @memberOf MapCache
  12626. */
  12627. function mapCacheClear() {
  12628. this.__data__ = {
  12629. 'hash': new Hash,
  12630. 'map': new (Map || ListCache),
  12631. 'string': new Hash
  12632. };
  12633. }
  12634. /**
  12635. * Removes `key` and its value from the map.
  12636. *
  12637. * @private
  12638. * @name delete
  12639. * @memberOf MapCache
  12640. * @param {string} key The key of the value to remove.
  12641. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12642. */
  12643. function mapCacheDelete(key) {
  12644. return getMapData(this, key)['delete'](key);
  12645. }
  12646. /**
  12647. * Gets the map value for `key`.
  12648. *
  12649. * @private
  12650. * @name get
  12651. * @memberOf MapCache
  12652. * @param {string} key The key of the value to get.
  12653. * @returns {*} Returns the entry value.
  12654. */
  12655. function mapCacheGet(key) {
  12656. return getMapData(this, key).get(key);
  12657. }
  12658. /**
  12659. * Checks if a map value for `key` exists.
  12660. *
  12661. * @private
  12662. * @name has
  12663. * @memberOf MapCache
  12664. * @param {string} key The key of the entry to check.
  12665. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12666. */
  12667. function mapCacheHas(key) {
  12668. return getMapData(this, key).has(key);
  12669. }
  12670. /**
  12671. * Sets the map `key` to `value`.
  12672. *
  12673. * @private
  12674. * @name set
  12675. * @memberOf MapCache
  12676. * @param {string} key The key of the value to set.
  12677. * @param {*} value The value to set.
  12678. * @returns {Object} Returns the map cache instance.
  12679. */
  12680. function mapCacheSet(key, value) {
  12681. getMapData(this, key).set(key, value);
  12682. return this;
  12683. }
  12684. // Add methods to `MapCache`.
  12685. MapCache.prototype.clear = mapCacheClear;
  12686. MapCache.prototype['delete'] = mapCacheDelete;
  12687. MapCache.prototype.get = mapCacheGet;
  12688. MapCache.prototype.has = mapCacheHas;
  12689. MapCache.prototype.set = mapCacheSet;
  12690. /**
  12691. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12692. *
  12693. * @private
  12694. * @param {Array} array The array to inspect.
  12695. * @param {*} key The key to search for.
  12696. * @returns {number} Returns the index of the matched value, else `-1`.
  12697. */
  12698. function assocIndexOf(array, key) {
  12699. var length = array.length;
  12700. while (length--) {
  12701. if (eq(array[length][0], key)) {
  12702. return length;
  12703. }
  12704. }
  12705. return -1;
  12706. }
  12707. /**
  12708. * The base implementation of `_.get` without support for default values.
  12709. *
  12710. * @private
  12711. * @param {Object} object The object to query.
  12712. * @param {Array|string} path The path of the property to get.
  12713. * @returns {*} Returns the resolved value.
  12714. */
  12715. function baseGet(object, path) {
  12716. path = isKey(path, object) ? [path] : castPath(path);
  12717. var index = 0,
  12718. length = path.length;
  12719. while (object != null && index < length) {
  12720. object = object[toKey(path[index++])];
  12721. }
  12722. return (index && index == length) ? object : undefined;
  12723. }
  12724. /**
  12725. * The base implementation of `_.isNative` without bad shim checks.
  12726. *
  12727. * @private
  12728. * @param {*} value The value to check.
  12729. * @returns {boolean} Returns `true` if `value` is a native function,
  12730. * else `false`.
  12731. */
  12732. function baseIsNative(value) {
  12733. if (!isObject(value) || isMasked(value)) {
  12734. return false;
  12735. }
  12736. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12737. return pattern.test(toSource(value));
  12738. }
  12739. /**
  12740. * The base implementation of `_.toString` which doesn't convert nullish
  12741. * values to empty strings.
  12742. *
  12743. * @private
  12744. * @param {*} value The value to process.
  12745. * @returns {string} Returns the string.
  12746. */
  12747. function baseToString(value) {
  12748. // Exit early for strings to avoid a performance hit in some environments.
  12749. if (typeof value == 'string') {
  12750. return value;
  12751. }
  12752. if (isSymbol(value)) {
  12753. return symbolToString ? symbolToString.call(value) : '';
  12754. }
  12755. var result = (value + '');
  12756. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12757. }
  12758. /**
  12759. * Casts `value` to a path array if it's not one.
  12760. *
  12761. * @private
  12762. * @param {*} value The value to inspect.
  12763. * @returns {Array} Returns the cast property path array.
  12764. */
  12765. function castPath(value) {
  12766. return isArray(value) ? value : stringToPath(value);
  12767. }
  12768. /**
  12769. * Gets the data for `map`.
  12770. *
  12771. * @private
  12772. * @param {Object} map The map to query.
  12773. * @param {string} key The reference key.
  12774. * @returns {*} Returns the map data.
  12775. */
  12776. function getMapData(map, key) {
  12777. var data = map.__data__;
  12778. return isKeyable(key)
  12779. ? data[typeof key == 'string' ? 'string' : 'hash']
  12780. : data.map;
  12781. }
  12782. /**
  12783. * Gets the native function at `key` of `object`.
  12784. *
  12785. * @private
  12786. * @param {Object} object The object to query.
  12787. * @param {string} key The key of the method to get.
  12788. * @returns {*} Returns the function if it's native, else `undefined`.
  12789. */
  12790. function getNative(object, key) {
  12791. var value = getValue(object, key);
  12792. return baseIsNative(value) ? value : undefined;
  12793. }
  12794. /**
  12795. * Checks if `value` is a property name and not a property path.
  12796. *
  12797. * @private
  12798. * @param {*} value The value to check.
  12799. * @param {Object} [object] The object to query keys on.
  12800. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12801. */
  12802. function isKey(value, object) {
  12803. if (isArray(value)) {
  12804. return false;
  12805. }
  12806. var type = typeof value;
  12807. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12808. value == null || isSymbol(value)) {
  12809. return true;
  12810. }
  12811. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12812. (object != null && value in Object(object));
  12813. }
  12814. /**
  12815. * Checks if `value` is suitable for use as unique object key.
  12816. *
  12817. * @private
  12818. * @param {*} value The value to check.
  12819. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12820. */
  12821. function isKeyable(value) {
  12822. var type = typeof value;
  12823. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12824. ? (value !== '__proto__')
  12825. : (value === null);
  12826. }
  12827. /**
  12828. * Checks if `func` has its source masked.
  12829. *
  12830. * @private
  12831. * @param {Function} func The function to check.
  12832. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12833. */
  12834. function isMasked(func) {
  12835. return !!maskSrcKey && (maskSrcKey in func);
  12836. }
  12837. /**
  12838. * Converts `string` to a property path array.
  12839. *
  12840. * @private
  12841. * @param {string} string The string to convert.
  12842. * @returns {Array} Returns the property path array.
  12843. */
  12844. var stringToPath = memoize(function(string) {
  12845. string = toString(string);
  12846. var result = [];
  12847. if (reLeadingDot.test(string)) {
  12848. result.push('');
  12849. }
  12850. string.replace(rePropName, function(match, number, quote, string) {
  12851. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  12852. });
  12853. return result;
  12854. });
  12855. /**
  12856. * Converts `value` to a string key if it's not a string or symbol.
  12857. *
  12858. * @private
  12859. * @param {*} value The value to inspect.
  12860. * @returns {string|symbol} Returns the key.
  12861. */
  12862. function toKey(value) {
  12863. if (typeof value == 'string' || isSymbol(value)) {
  12864. return value;
  12865. }
  12866. var result = (value + '');
  12867. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12868. }
  12869. /**
  12870. * Converts `func` to its source code.
  12871. *
  12872. * @private
  12873. * @param {Function} func The function to process.
  12874. * @returns {string} Returns the source code.
  12875. */
  12876. function toSource(func) {
  12877. if (func != null) {
  12878. try {
  12879. return funcToString.call(func);
  12880. } catch (e) {}
  12881. try {
  12882. return (func + '');
  12883. } catch (e) {}
  12884. }
  12885. return '';
  12886. }
  12887. /**
  12888. * Creates a function that memoizes the result of `func`. If `resolver` is
  12889. * provided, it determines the cache key for storing the result based on the
  12890. * arguments provided to the memoized function. By default, the first argument
  12891. * provided to the memoized function is used as the map cache key. The `func`
  12892. * is invoked with the `this` binding of the memoized function.
  12893. *
  12894. * **Note:** The cache is exposed as the `cache` property on the memoized
  12895. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  12896. * constructor with one whose instances implement the
  12897. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  12898. * method interface of `delete`, `get`, `has`, and `set`.
  12899. *
  12900. * @static
  12901. * @memberOf _
  12902. * @since 0.1.0
  12903. * @category Function
  12904. * @param {Function} func The function to have its output memoized.
  12905. * @param {Function} [resolver] The function to resolve the cache key.
  12906. * @returns {Function} Returns the new memoized function.
  12907. * @example
  12908. *
  12909. * var object = { 'a': 1, 'b': 2 };
  12910. * var other = { 'c': 3, 'd': 4 };
  12911. *
  12912. * var values = _.memoize(_.values);
  12913. * values(object);
  12914. * // => [1, 2]
  12915. *
  12916. * values(other);
  12917. * // => [3, 4]
  12918. *
  12919. * object.a = 2;
  12920. * values(object);
  12921. * // => [1, 2]
  12922. *
  12923. * // Modify the result cache.
  12924. * values.cache.set(object, ['a', 'b']);
  12925. * values(object);
  12926. * // => ['a', 'b']
  12927. *
  12928. * // Replace `_.memoize.Cache`.
  12929. * _.memoize.Cache = WeakMap;
  12930. */
  12931. function memoize(func, resolver) {
  12932. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  12933. throw new TypeError(FUNC_ERROR_TEXT);
  12934. }
  12935. var memoized = function() {
  12936. var args = arguments,
  12937. key = resolver ? resolver.apply(this, args) : args[0],
  12938. cache = memoized.cache;
  12939. if (cache.has(key)) {
  12940. return cache.get(key);
  12941. }
  12942. var result = func.apply(this, args);
  12943. memoized.cache = cache.set(key, result);
  12944. return result;
  12945. };
  12946. memoized.cache = new (memoize.Cache || MapCache);
  12947. return memoized;
  12948. }
  12949. // Assign cache to `_.memoize`.
  12950. memoize.Cache = MapCache;
  12951. /**
  12952. * Performs a
  12953. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12954. * comparison between two values to determine if they are equivalent.
  12955. *
  12956. * @static
  12957. * @memberOf _
  12958. * @since 4.0.0
  12959. * @category Lang
  12960. * @param {*} value The value to compare.
  12961. * @param {*} other The other value to compare.
  12962. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12963. * @example
  12964. *
  12965. * var object = { 'a': 1 };
  12966. * var other = { 'a': 1 };
  12967. *
  12968. * _.eq(object, object);
  12969. * // => true
  12970. *
  12971. * _.eq(object, other);
  12972. * // => false
  12973. *
  12974. * _.eq('a', 'a');
  12975. * // => true
  12976. *
  12977. * _.eq('a', Object('a'));
  12978. * // => false
  12979. *
  12980. * _.eq(NaN, NaN);
  12981. * // => true
  12982. */
  12983. function eq(value, other) {
  12984. return value === other || (value !== value && other !== other);
  12985. }
  12986. /**
  12987. * Checks if `value` is classified as an `Array` object.
  12988. *
  12989. * @static
  12990. * @memberOf _
  12991. * @since 0.1.0
  12992. * @category Lang
  12993. * @param {*} value The value to check.
  12994. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12995. * @example
  12996. *
  12997. * _.isArray([1, 2, 3]);
  12998. * // => true
  12999. *
  13000. * _.isArray(document.body.children);
  13001. * // => false
  13002. *
  13003. * _.isArray('abc');
  13004. * // => false
  13005. *
  13006. * _.isArray(_.noop);
  13007. * // => false
  13008. */
  13009. var isArray = Array.isArray;
  13010. /**
  13011. * Checks if `value` is classified as a `Function` object.
  13012. *
  13013. * @static
  13014. * @memberOf _
  13015. * @since 0.1.0
  13016. * @category Lang
  13017. * @param {*} value The value to check.
  13018. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  13019. * @example
  13020. *
  13021. * _.isFunction(_);
  13022. * // => true
  13023. *
  13024. * _.isFunction(/abc/);
  13025. * // => false
  13026. */
  13027. function isFunction(value) {
  13028. // The use of `Object#toString` avoids issues with the `typeof` operator
  13029. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  13030. var tag = isObject(value) ? objectToString.call(value) : '';
  13031. return tag == funcTag || tag == genTag;
  13032. }
  13033. /**
  13034. * Checks if `value` is the
  13035. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  13036. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  13037. *
  13038. * @static
  13039. * @memberOf _
  13040. * @since 0.1.0
  13041. * @category Lang
  13042. * @param {*} value The value to check.
  13043. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  13044. * @example
  13045. *
  13046. * _.isObject({});
  13047. * // => true
  13048. *
  13049. * _.isObject([1, 2, 3]);
  13050. * // => true
  13051. *
  13052. * _.isObject(_.noop);
  13053. * // => true
  13054. *
  13055. * _.isObject(null);
  13056. * // => false
  13057. */
  13058. function isObject(value) {
  13059. var type = typeof value;
  13060. return !!value && (type == 'object' || type == 'function');
  13061. }
  13062. /**
  13063. * Checks if `value` is object-like. A value is object-like if it's not `null`
  13064. * and has a `typeof` result of "object".
  13065. *
  13066. * @static
  13067. * @memberOf _
  13068. * @since 4.0.0
  13069. * @category Lang
  13070. * @param {*} value The value to check.
  13071. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  13072. * @example
  13073. *
  13074. * _.isObjectLike({});
  13075. * // => true
  13076. *
  13077. * _.isObjectLike([1, 2, 3]);
  13078. * // => true
  13079. *
  13080. * _.isObjectLike(_.noop);
  13081. * // => false
  13082. *
  13083. * _.isObjectLike(null);
  13084. * // => false
  13085. */
  13086. function isObjectLike(value) {
  13087. return !!value && typeof value == 'object';
  13088. }
  13089. /**
  13090. * Checks if `value` is classified as a `Symbol` primitive or object.
  13091. *
  13092. * @static
  13093. * @memberOf _
  13094. * @since 4.0.0
  13095. * @category Lang
  13096. * @param {*} value The value to check.
  13097. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13098. * @example
  13099. *
  13100. * _.isSymbol(Symbol.iterator);
  13101. * // => true
  13102. *
  13103. * _.isSymbol('abc');
  13104. * // => false
  13105. */
  13106. function isSymbol(value) {
  13107. return typeof value == 'symbol' ||
  13108. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13109. }
  13110. /**
  13111. * Converts `value` to a string. An empty string is returned for `null`
  13112. * and `undefined` values. The sign of `-0` is preserved.
  13113. *
  13114. * @static
  13115. * @memberOf _
  13116. * @since 4.0.0
  13117. * @category Lang
  13118. * @param {*} value The value to process.
  13119. * @returns {string} Returns the string.
  13120. * @example
  13121. *
  13122. * _.toString(null);
  13123. * // => ''
  13124. *
  13125. * _.toString(-0);
  13126. * // => '-0'
  13127. *
  13128. * _.toString([1, 2, 3]);
  13129. * // => '1,2,3'
  13130. */
  13131. function toString(value) {
  13132. return value == null ? '' : baseToString(value);
  13133. }
  13134. /**
  13135. * Gets the value at `path` of `object`. If the resolved value is
  13136. * `undefined`, the `defaultValue` is returned in its place.
  13137. *
  13138. * @static
  13139. * @memberOf _
  13140. * @since 3.7.0
  13141. * @category Object
  13142. * @param {Object} object The object to query.
  13143. * @param {Array|string} path The path of the property to get.
  13144. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13145. * @returns {*} Returns the resolved value.
  13146. * @example
  13147. *
  13148. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13149. *
  13150. * _.get(object, 'a[0].b.c');
  13151. * // => 3
  13152. *
  13153. * _.get(object, ['a', '0', 'b', 'c']);
  13154. * // => 3
  13155. *
  13156. * _.get(object, 'a.b.c', 'default');
  13157. * // => 'default'
  13158. */
  13159. function get(object, path, defaultValue) {
  13160. var result = object == null ? undefined : baseGet(object, path);
  13161. return result === undefined ? defaultValue : result;
  13162. }
  13163. module.exports = get;
  13164. /***/ }),
  13165. /***/ 855:
  13166. /***/ (function(module, __unusedexports, __webpack_require__) {
  13167. module.exports = registerPlugin;
  13168. const factory = __webpack_require__(47);
  13169. function registerPlugin(plugins, pluginFunction) {
  13170. return factory(
  13171. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  13172. );
  13173. }
  13174. /***/ }),
  13175. /***/ 856:
  13176. /***/ (function(module, __unusedexports, __webpack_require__) {
  13177. module.exports = __webpack_require__(141);
  13178. /***/ }),
  13179. /***/ 863:
  13180. /***/ (function(module, __unusedexports, __webpack_require__) {
  13181. module.exports = authenticationBeforeRequest;
  13182. const btoa = __webpack_require__(675);
  13183. const withAuthorizationPrefix = __webpack_require__(143);
  13184. function authenticationBeforeRequest(state, options) {
  13185. if (typeof state.auth === "string") {
  13186. options.headers.authorization = withAuthorizationPrefix(state.auth);
  13187. return;
  13188. }
  13189. if (state.auth.username) {
  13190. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  13191. options.headers.authorization = `Basic ${hash}`;
  13192. if (state.otp) {
  13193. options.headers["x-github-otp"] = state.otp;
  13194. }
  13195. return;
  13196. }
  13197. if (state.auth.clientId) {
  13198. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  13199. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  13200. // URL though: `/applications/:client_id/tokens/:access_token`.
  13201. //
  13202. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  13203. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  13204. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  13205. //
  13206. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  13207. // as well as "/applications/123/tokens/token456"
  13208. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  13209. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  13210. options.headers.authorization = `Basic ${hash}`;
  13211. return;
  13212. }
  13213. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  13214. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  13215. return;
  13216. }
  13217. return Promise.resolve()
  13218. .then(() => {
  13219. return state.auth();
  13220. })
  13221. .then(authorization => {
  13222. options.headers.authorization = withAuthorizationPrefix(authorization);
  13223. });
  13224. }
  13225. /***/ }),
  13226. /***/ 866:
  13227. /***/ (function(module, __unusedexports, __webpack_require__) {
  13228. "use strict";
  13229. var shebangRegex = __webpack_require__(816);
  13230. module.exports = function (str) {
  13231. var match = str.match(shebangRegex);
  13232. if (!match) {
  13233. return null;
  13234. }
  13235. var arr = match[0].replace(/#! ?/, '').split(' ');
  13236. var bin = arr[0].split('/').pop();
  13237. var arg = arr[1];
  13238. return (bin === 'env' ?
  13239. arg :
  13240. bin + (arg ? ' ' + arg : '')
  13241. );
  13242. };
  13243. /***/ }),
  13244. /***/ 874:
  13245. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13246. "use strict";
  13247. // Copyright (c) Microsoft. All rights reserved.
  13248. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  13249. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13250. return new (P || (P = Promise))(function (resolve, reject) {
  13251. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13252. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13253. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  13254. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13255. });
  13256. };
  13257. Object.defineProperty(exports, "__esModule", { value: true });
  13258. const url = __webpack_require__(835);
  13259. const http = __webpack_require__(605);
  13260. const https = __webpack_require__(211);
  13261. let fs;
  13262. let tunnel;
  13263. var HttpCodes;
  13264. (function (HttpCodes) {
  13265. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  13266. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  13267. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  13268. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  13269. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  13270. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  13271. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  13272. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  13273. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  13274. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  13275. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  13276. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  13277. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  13278. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  13279. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  13280. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  13281. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  13282. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  13283. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  13284. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  13285. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  13286. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  13287. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  13288. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  13289. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  13290. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  13291. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  13292. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  13293. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  13294. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  13295. const ExponentialBackoffCeiling = 10;
  13296. const ExponentialBackoffTimeSlice = 5;
  13297. class HttpClientResponse {
  13298. constructor(message) {
  13299. this.message = message;
  13300. }
  13301. readBody() {
  13302. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  13303. let output = '';
  13304. this.message.on('data', (chunk) => {
  13305. output += chunk;
  13306. });
  13307. this.message.on('end', () => {
  13308. resolve(output);
  13309. });
  13310. }));
  13311. }
  13312. }
  13313. exports.HttpClientResponse = HttpClientResponse;
  13314. function isHttps(requestUrl) {
  13315. let parsedUrl = url.parse(requestUrl);
  13316. return parsedUrl.protocol === 'https:';
  13317. }
  13318. exports.isHttps = isHttps;
  13319. var EnvironmentVariables;
  13320. (function (EnvironmentVariables) {
  13321. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  13322. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  13323. })(EnvironmentVariables || (EnvironmentVariables = {}));
  13324. class HttpClient {
  13325. constructor(userAgent, handlers, requestOptions) {
  13326. this._ignoreSslError = false;
  13327. this._allowRedirects = true;
  13328. this._maxRedirects = 50;
  13329. this._allowRetries = false;
  13330. this._maxRetries = 1;
  13331. this._keepAlive = false;
  13332. this._disposed = false;
  13333. this.userAgent = userAgent;
  13334. this.handlers = handlers || [];
  13335. this.requestOptions = requestOptions;
  13336. if (requestOptions) {
  13337. if (requestOptions.ignoreSslError != null) {
  13338. this._ignoreSslError = requestOptions.ignoreSslError;
  13339. }
  13340. this._socketTimeout = requestOptions.socketTimeout;
  13341. this._httpProxy = requestOptions.proxy;
  13342. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  13343. this._httpProxyBypassHosts = [];
  13344. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  13345. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  13346. });
  13347. }
  13348. this._certConfig = requestOptions.cert;
  13349. if (this._certConfig) {
  13350. // If using cert, need fs
  13351. fs = __webpack_require__(747);
  13352. // cache the cert content into memory, so we don't have to read it from disk every time
  13353. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  13354. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  13355. }
  13356. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  13357. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  13358. }
  13359. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  13360. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  13361. }
  13362. }
  13363. if (requestOptions.allowRedirects != null) {
  13364. this._allowRedirects = requestOptions.allowRedirects;
  13365. }
  13366. if (requestOptions.maxRedirects != null) {
  13367. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  13368. }
  13369. if (requestOptions.keepAlive != null) {
  13370. this._keepAlive = requestOptions.keepAlive;
  13371. }
  13372. if (requestOptions.allowRetries != null) {
  13373. this._allowRetries = requestOptions.allowRetries;
  13374. }
  13375. if (requestOptions.maxRetries != null) {
  13376. this._maxRetries = requestOptions.maxRetries;
  13377. }
  13378. }
  13379. }
  13380. options(requestUrl, additionalHeaders) {
  13381. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  13382. }
  13383. get(requestUrl, additionalHeaders) {
  13384. return this.request('GET', requestUrl, null, additionalHeaders || {});
  13385. }
  13386. del(requestUrl, additionalHeaders) {
  13387. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  13388. }
  13389. post(requestUrl, data, additionalHeaders) {
  13390. return this.request('POST', requestUrl, data, additionalHeaders || {});
  13391. }
  13392. patch(requestUrl, data, additionalHeaders) {
  13393. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  13394. }
  13395. put(requestUrl, data, additionalHeaders) {
  13396. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  13397. }
  13398. head(requestUrl, additionalHeaders) {
  13399. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  13400. }
  13401. sendStream(verb, requestUrl, stream, additionalHeaders) {
  13402. return this.request(verb, requestUrl, stream, additionalHeaders);
  13403. }
  13404. /**
  13405. * Makes a raw http request.
  13406. * All other methods such as get, post, patch, and request ultimately call this.
  13407. * Prefer get, del, post and patch
  13408. */
  13409. request(verb, requestUrl, data, headers) {
  13410. return __awaiter(this, void 0, void 0, function* () {
  13411. if (this._disposed) {
  13412. throw new Error("Client has already been disposed.");
  13413. }
  13414. let info = this._prepareRequest(verb, requestUrl, headers);
  13415. // Only perform retries on reads since writes may not be idempotent.
  13416. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  13417. let numTries = 0;
  13418. let response;
  13419. while (numTries < maxTries) {
  13420. response = yield this.requestRaw(info, data);
  13421. // Check if it's an authentication challenge
  13422. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  13423. let authenticationHandler;
  13424. for (let i = 0; i < this.handlers.length; i++) {
  13425. if (this.handlers[i].canHandleAuthentication(response)) {
  13426. authenticationHandler = this.handlers[i];
  13427. break;
  13428. }
  13429. }
  13430. if (authenticationHandler) {
  13431. return authenticationHandler.handleAuthentication(this, info, data);
  13432. }
  13433. else {
  13434. // We have received an unauthorized response but have no handlers to handle it.
  13435. // Let the response return to the caller.
  13436. return response;
  13437. }
  13438. }
  13439. let redirectsRemaining = this._maxRedirects;
  13440. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  13441. && this._allowRedirects
  13442. && redirectsRemaining > 0) {
  13443. const redirectUrl = response.message.headers["location"];
  13444. if (!redirectUrl) {
  13445. // if there's no location to redirect to, we won't
  13446. break;
  13447. }
  13448. // we need to finish reading the response before reassigning response
  13449. // which will leak the open socket.
  13450. yield response.readBody();
  13451. // let's make the request with the new redirectUrl
  13452. info = this._prepareRequest(verb, redirectUrl, headers);
  13453. response = yield this.requestRaw(info, data);
  13454. redirectsRemaining--;
  13455. }
  13456. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  13457. // If not a retry code, return immediately instead of retrying
  13458. return response;
  13459. }
  13460. numTries += 1;
  13461. if (numTries < maxTries) {
  13462. yield response.readBody();
  13463. yield this._performExponentialBackoff(numTries);
  13464. }
  13465. }
  13466. return response;
  13467. });
  13468. }
  13469. /**
  13470. * Needs to be called if keepAlive is set to true in request options.
  13471. */
  13472. dispose() {
  13473. if (this._agent) {
  13474. this._agent.destroy();
  13475. }
  13476. this._disposed = true;
  13477. }
  13478. /**
  13479. * Raw request.
  13480. * @param info
  13481. * @param data
  13482. */
  13483. requestRaw(info, data) {
  13484. return new Promise((resolve, reject) => {
  13485. let callbackForResult = function (err, res) {
  13486. if (err) {
  13487. reject(err);
  13488. }
  13489. resolve(res);
  13490. };
  13491. this.requestRawWithCallback(info, data, callbackForResult);
  13492. });
  13493. }
  13494. /**
  13495. * Raw request with callback.
  13496. * @param info
  13497. * @param data
  13498. * @param onResult
  13499. */
  13500. requestRawWithCallback(info, data, onResult) {
  13501. let socket;
  13502. let isDataString = typeof (data) === 'string';
  13503. if (typeof (data) === 'string') {
  13504. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13505. }
  13506. let callbackCalled = false;
  13507. let handleResult = (err, res) => {
  13508. if (!callbackCalled) {
  13509. callbackCalled = true;
  13510. onResult(err, res);
  13511. }
  13512. };
  13513. let req = info.httpModule.request(info.options, (msg) => {
  13514. let res = new HttpClientResponse(msg);
  13515. handleResult(null, res);
  13516. });
  13517. req.on('socket', (sock) => {
  13518. socket = sock;
  13519. });
  13520. // If we ever get disconnected, we want the socket to timeout eventually
  13521. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13522. if (socket) {
  13523. socket.end();
  13524. }
  13525. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13526. });
  13527. req.on('error', function (err) {
  13528. // err has statusCode property
  13529. // res should have headers
  13530. handleResult(err, null);
  13531. });
  13532. if (data && typeof (data) === 'string') {
  13533. req.write(data, 'utf8');
  13534. }
  13535. if (data && typeof (data) !== 'string') {
  13536. data.on('close', function () {
  13537. req.end();
  13538. });
  13539. data.pipe(req);
  13540. }
  13541. else {
  13542. req.end();
  13543. }
  13544. }
  13545. _prepareRequest(method, requestUrl, headers) {
  13546. const info = {};
  13547. info.parsedUrl = url.parse(requestUrl);
  13548. const usingSsl = info.parsedUrl.protocol === 'https:';
  13549. info.httpModule = usingSsl ? https : http;
  13550. const defaultPort = usingSsl ? 443 : 80;
  13551. info.options = {};
  13552. info.options.host = info.parsedUrl.hostname;
  13553. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13554. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13555. info.options.method = method;
  13556. info.options.headers = this._mergeHeaders(headers);
  13557. info.options.headers["user-agent"] = this.userAgent;
  13558. info.options.agent = this._getAgent(requestUrl);
  13559. // gives handlers an opportunity to participate
  13560. if (this.handlers && !this._isPresigned(requestUrl)) {
  13561. this.handlers.forEach((handler) => {
  13562. handler.prepareRequest(info.options);
  13563. });
  13564. }
  13565. return info;
  13566. }
  13567. _isPresigned(requestUrl) {
  13568. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13569. const patterns = this.requestOptions.presignedUrlPatterns;
  13570. for (let i = 0; i < patterns.length; i++) {
  13571. if (requestUrl.match(patterns[i])) {
  13572. return true;
  13573. }
  13574. }
  13575. }
  13576. return false;
  13577. }
  13578. _mergeHeaders(headers) {
  13579. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13580. if (this.requestOptions && this.requestOptions.headers) {
  13581. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13582. }
  13583. return lowercaseKeys(headers || {});
  13584. }
  13585. _getAgent(requestUrl) {
  13586. let agent;
  13587. let proxy = this._getProxy(requestUrl);
  13588. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13589. if (this._keepAlive && useProxy) {
  13590. agent = this._proxyAgent;
  13591. }
  13592. if (this._keepAlive && !useProxy) {
  13593. agent = this._agent;
  13594. }
  13595. // if agent is already assigned use that agent.
  13596. if (!!agent) {
  13597. return agent;
  13598. }
  13599. let parsedUrl = url.parse(requestUrl);
  13600. const usingSsl = parsedUrl.protocol === 'https:';
  13601. let maxSockets = 100;
  13602. if (!!this.requestOptions) {
  13603. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13604. }
  13605. if (useProxy) {
  13606. // If using proxy, need tunnel
  13607. if (!tunnel) {
  13608. tunnel = __webpack_require__(856);
  13609. }
  13610. const agentOptions = {
  13611. maxSockets: maxSockets,
  13612. keepAlive: this._keepAlive,
  13613. proxy: {
  13614. proxyAuth: proxy.proxyAuth,
  13615. host: proxy.proxyUrl.hostname,
  13616. port: proxy.proxyUrl.port
  13617. },
  13618. };
  13619. let tunnelAgent;
  13620. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13621. if (usingSsl) {
  13622. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13623. }
  13624. else {
  13625. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13626. }
  13627. agent = tunnelAgent(agentOptions);
  13628. this._proxyAgent = agent;
  13629. }
  13630. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13631. if (this._keepAlive && !agent) {
  13632. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13633. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13634. this._agent = agent;
  13635. }
  13636. // if not using private agent and tunnel agent isn't setup then use global agent
  13637. if (!agent) {
  13638. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13639. }
  13640. if (usingSsl && this._ignoreSslError) {
  13641. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13642. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13643. // we have to cast it to any and change it directly
  13644. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13645. }
  13646. if (usingSsl && this._certConfig) {
  13647. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13648. }
  13649. return agent;
  13650. }
  13651. _getProxy(requestUrl) {
  13652. const parsedUrl = url.parse(requestUrl);
  13653. let usingSsl = parsedUrl.protocol === 'https:';
  13654. let proxyConfig = this._httpProxy;
  13655. // fallback to http_proxy and https_proxy env
  13656. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13657. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13658. if (!proxyConfig) {
  13659. if (https_proxy && usingSsl) {
  13660. proxyConfig = {
  13661. proxyUrl: https_proxy
  13662. };
  13663. }
  13664. else if (http_proxy) {
  13665. proxyConfig = {
  13666. proxyUrl: http_proxy
  13667. };
  13668. }
  13669. }
  13670. let proxyUrl;
  13671. let proxyAuth;
  13672. if (proxyConfig) {
  13673. if (proxyConfig.proxyUrl.length > 0) {
  13674. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13675. }
  13676. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13677. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13678. }
  13679. }
  13680. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13681. }
  13682. _isBypassProxy(requestUrl) {
  13683. if (!this._httpProxyBypassHosts) {
  13684. return false;
  13685. }
  13686. let bypass = false;
  13687. this._httpProxyBypassHosts.forEach(bypassHost => {
  13688. if (bypassHost.test(requestUrl)) {
  13689. bypass = true;
  13690. }
  13691. });
  13692. return bypass;
  13693. }
  13694. _performExponentialBackoff(retryNumber) {
  13695. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13696. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13697. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13698. }
  13699. }
  13700. exports.HttpClient = HttpClient;
  13701. /***/ }),
  13702. /***/ 881:
  13703. /***/ (function(module) {
  13704. "use strict";
  13705. const isWin = process.platform === 'win32';
  13706. function notFoundError(original, syscall) {
  13707. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13708. code: 'ENOENT',
  13709. errno: 'ENOENT',
  13710. syscall: `${syscall} ${original.command}`,
  13711. path: original.command,
  13712. spawnargs: original.args,
  13713. });
  13714. }
  13715. function hookChildProcess(cp, parsed) {
  13716. if (!isWin) {
  13717. return;
  13718. }
  13719. const originalEmit = cp.emit;
  13720. cp.emit = function (name, arg1) {
  13721. // If emitting "exit" event and exit code is 1, we need to check if
  13722. // the command exists and emit an "error" instead
  13723. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13724. if (name === 'exit') {
  13725. const err = verifyENOENT(arg1, parsed, 'spawn');
  13726. if (err) {
  13727. return originalEmit.call(cp, 'error', err);
  13728. }
  13729. }
  13730. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13731. };
  13732. }
  13733. function verifyENOENT(status, parsed) {
  13734. if (isWin && status === 1 && !parsed.file) {
  13735. return notFoundError(parsed.original, 'spawn');
  13736. }
  13737. return null;
  13738. }
  13739. function verifyENOENTSync(status, parsed) {
  13740. if (isWin && status === 1 && !parsed.file) {
  13741. return notFoundError(parsed.original, 'spawnSync');
  13742. }
  13743. return null;
  13744. }
  13745. module.exports = {
  13746. hookChildProcess,
  13747. verifyENOENT,
  13748. verifyENOENTSync,
  13749. notFoundError,
  13750. };
  13751. /***/ }),
  13752. /***/ 883:
  13753. /***/ (function(module) {
  13754. /**
  13755. * lodash (Custom Build) <https://lodash.com/>
  13756. * Build: `lodash modularize exports="npm" -o ./`
  13757. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13758. * Released under MIT license <https://lodash.com/license>
  13759. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13760. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13761. */
  13762. /** Used as the `TypeError` message for "Functions" methods. */
  13763. var FUNC_ERROR_TEXT = 'Expected a function';
  13764. /** Used to stand-in for `undefined` hash values. */
  13765. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13766. /** Used as references for various `Number` constants. */
  13767. var INFINITY = 1 / 0,
  13768. MAX_SAFE_INTEGER = 9007199254740991;
  13769. /** `Object#toString` result references. */
  13770. var funcTag = '[object Function]',
  13771. genTag = '[object GeneratorFunction]',
  13772. symbolTag = '[object Symbol]';
  13773. /** Used to match property names within property paths. */
  13774. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13775. reIsPlainProp = /^\w*$/,
  13776. reLeadingDot = /^\./,
  13777. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13778. /**
  13779. * Used to match `RegExp`
  13780. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13781. */
  13782. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13783. /** Used to match backslashes in property paths. */
  13784. var reEscapeChar = /\\(\\)?/g;
  13785. /** Used to detect host constructors (Safari). */
  13786. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13787. /** Used to detect unsigned integer values. */
  13788. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13789. /** Detect free variable `global` from Node.js. */
  13790. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13791. /** Detect free variable `self`. */
  13792. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13793. /** Used as a reference to the global object. */
  13794. var root = freeGlobal || freeSelf || Function('return this')();
  13795. /**
  13796. * Gets the value at `key` of `object`.
  13797. *
  13798. * @private
  13799. * @param {Object} [object] The object to query.
  13800. * @param {string} key The key of the property to get.
  13801. * @returns {*} Returns the property value.
  13802. */
  13803. function getValue(object, key) {
  13804. return object == null ? undefined : object[key];
  13805. }
  13806. /**
  13807. * Checks if `value` is a host object in IE < 9.
  13808. *
  13809. * @private
  13810. * @param {*} value The value to check.
  13811. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13812. */
  13813. function isHostObject(value) {
  13814. // Many host objects are `Object` objects that can coerce to strings
  13815. // despite having improperly defined `toString` methods.
  13816. var result = false;
  13817. if (value != null && typeof value.toString != 'function') {
  13818. try {
  13819. result = !!(value + '');
  13820. } catch (e) {}
  13821. }
  13822. return result;
  13823. }
  13824. /** Used for built-in method references. */
  13825. var arrayProto = Array.prototype,
  13826. funcProto = Function.prototype,
  13827. objectProto = Object.prototype;
  13828. /** Used to detect overreaching core-js shims. */
  13829. var coreJsData = root['__core-js_shared__'];
  13830. /** Used to detect methods masquerading as native. */
  13831. var maskSrcKey = (function() {
  13832. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  13833. return uid ? ('Symbol(src)_1.' + uid) : '';
  13834. }());
  13835. /** Used to resolve the decompiled source of functions. */
  13836. var funcToString = funcProto.toString;
  13837. /** Used to check objects for own properties. */
  13838. var hasOwnProperty = objectProto.hasOwnProperty;
  13839. /**
  13840. * Used to resolve the
  13841. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  13842. * of values.
  13843. */
  13844. var objectToString = objectProto.toString;
  13845. /** Used to detect if a method is native. */
  13846. var reIsNative = RegExp('^' +
  13847. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  13848. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  13849. );
  13850. /** Built-in value references. */
  13851. var Symbol = root.Symbol,
  13852. splice = arrayProto.splice;
  13853. /* Built-in method references that are verified to be native. */
  13854. var Map = getNative(root, 'Map'),
  13855. nativeCreate = getNative(Object, 'create');
  13856. /** Used to convert symbols to primitives and strings. */
  13857. var symbolProto = Symbol ? Symbol.prototype : undefined,
  13858. symbolToString = symbolProto ? symbolProto.toString : undefined;
  13859. /**
  13860. * Creates a hash object.
  13861. *
  13862. * @private
  13863. * @constructor
  13864. * @param {Array} [entries] The key-value pairs to cache.
  13865. */
  13866. function Hash(entries) {
  13867. var index = -1,
  13868. length = entries ? entries.length : 0;
  13869. this.clear();
  13870. while (++index < length) {
  13871. var entry = entries[index];
  13872. this.set(entry[0], entry[1]);
  13873. }
  13874. }
  13875. /**
  13876. * Removes all key-value entries from the hash.
  13877. *
  13878. * @private
  13879. * @name clear
  13880. * @memberOf Hash
  13881. */
  13882. function hashClear() {
  13883. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  13884. }
  13885. /**
  13886. * Removes `key` and its value from the hash.
  13887. *
  13888. * @private
  13889. * @name delete
  13890. * @memberOf Hash
  13891. * @param {Object} hash The hash to modify.
  13892. * @param {string} key The key of the value to remove.
  13893. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13894. */
  13895. function hashDelete(key) {
  13896. return this.has(key) && delete this.__data__[key];
  13897. }
  13898. /**
  13899. * Gets the hash value for `key`.
  13900. *
  13901. * @private
  13902. * @name get
  13903. * @memberOf Hash
  13904. * @param {string} key The key of the value to get.
  13905. * @returns {*} Returns the entry value.
  13906. */
  13907. function hashGet(key) {
  13908. var data = this.__data__;
  13909. if (nativeCreate) {
  13910. var result = data[key];
  13911. return result === HASH_UNDEFINED ? undefined : result;
  13912. }
  13913. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  13914. }
  13915. /**
  13916. * Checks if a hash value for `key` exists.
  13917. *
  13918. * @private
  13919. * @name has
  13920. * @memberOf Hash
  13921. * @param {string} key The key of the entry to check.
  13922. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13923. */
  13924. function hashHas(key) {
  13925. var data = this.__data__;
  13926. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  13927. }
  13928. /**
  13929. * Sets the hash `key` to `value`.
  13930. *
  13931. * @private
  13932. * @name set
  13933. * @memberOf Hash
  13934. * @param {string} key The key of the value to set.
  13935. * @param {*} value The value to set.
  13936. * @returns {Object} Returns the hash instance.
  13937. */
  13938. function hashSet(key, value) {
  13939. var data = this.__data__;
  13940. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  13941. return this;
  13942. }
  13943. // Add methods to `Hash`.
  13944. Hash.prototype.clear = hashClear;
  13945. Hash.prototype['delete'] = hashDelete;
  13946. Hash.prototype.get = hashGet;
  13947. Hash.prototype.has = hashHas;
  13948. Hash.prototype.set = hashSet;
  13949. /**
  13950. * Creates an list cache object.
  13951. *
  13952. * @private
  13953. * @constructor
  13954. * @param {Array} [entries] The key-value pairs to cache.
  13955. */
  13956. function ListCache(entries) {
  13957. var index = -1,
  13958. length = entries ? entries.length : 0;
  13959. this.clear();
  13960. while (++index < length) {
  13961. var entry = entries[index];
  13962. this.set(entry[0], entry[1]);
  13963. }
  13964. }
  13965. /**
  13966. * Removes all key-value entries from the list cache.
  13967. *
  13968. * @private
  13969. * @name clear
  13970. * @memberOf ListCache
  13971. */
  13972. function listCacheClear() {
  13973. this.__data__ = [];
  13974. }
  13975. /**
  13976. * Removes `key` and its value from the list cache.
  13977. *
  13978. * @private
  13979. * @name delete
  13980. * @memberOf ListCache
  13981. * @param {string} key The key of the value to remove.
  13982. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13983. */
  13984. function listCacheDelete(key) {
  13985. var data = this.__data__,
  13986. index = assocIndexOf(data, key);
  13987. if (index < 0) {
  13988. return false;
  13989. }
  13990. var lastIndex = data.length - 1;
  13991. if (index == lastIndex) {
  13992. data.pop();
  13993. } else {
  13994. splice.call(data, index, 1);
  13995. }
  13996. return true;
  13997. }
  13998. /**
  13999. * Gets the list cache value for `key`.
  14000. *
  14001. * @private
  14002. * @name get
  14003. * @memberOf ListCache
  14004. * @param {string} key The key of the value to get.
  14005. * @returns {*} Returns the entry value.
  14006. */
  14007. function listCacheGet(key) {
  14008. var data = this.__data__,
  14009. index = assocIndexOf(data, key);
  14010. return index < 0 ? undefined : data[index][1];
  14011. }
  14012. /**
  14013. * Checks if a list cache value for `key` exists.
  14014. *
  14015. * @private
  14016. * @name has
  14017. * @memberOf ListCache
  14018. * @param {string} key The key of the entry to check.
  14019. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14020. */
  14021. function listCacheHas(key) {
  14022. return assocIndexOf(this.__data__, key) > -1;
  14023. }
  14024. /**
  14025. * Sets the list cache `key` to `value`.
  14026. *
  14027. * @private
  14028. * @name set
  14029. * @memberOf ListCache
  14030. * @param {string} key The key of the value to set.
  14031. * @param {*} value The value to set.
  14032. * @returns {Object} Returns the list cache instance.
  14033. */
  14034. function listCacheSet(key, value) {
  14035. var data = this.__data__,
  14036. index = assocIndexOf(data, key);
  14037. if (index < 0) {
  14038. data.push([key, value]);
  14039. } else {
  14040. data[index][1] = value;
  14041. }
  14042. return this;
  14043. }
  14044. // Add methods to `ListCache`.
  14045. ListCache.prototype.clear = listCacheClear;
  14046. ListCache.prototype['delete'] = listCacheDelete;
  14047. ListCache.prototype.get = listCacheGet;
  14048. ListCache.prototype.has = listCacheHas;
  14049. ListCache.prototype.set = listCacheSet;
  14050. /**
  14051. * Creates a map cache object to store key-value pairs.
  14052. *
  14053. * @private
  14054. * @constructor
  14055. * @param {Array} [entries] The key-value pairs to cache.
  14056. */
  14057. function MapCache(entries) {
  14058. var index = -1,
  14059. length = entries ? entries.length : 0;
  14060. this.clear();
  14061. while (++index < length) {
  14062. var entry = entries[index];
  14063. this.set(entry[0], entry[1]);
  14064. }
  14065. }
  14066. /**
  14067. * Removes all key-value entries from the map.
  14068. *
  14069. * @private
  14070. * @name clear
  14071. * @memberOf MapCache
  14072. */
  14073. function mapCacheClear() {
  14074. this.__data__ = {
  14075. 'hash': new Hash,
  14076. 'map': new (Map || ListCache),
  14077. 'string': new Hash
  14078. };
  14079. }
  14080. /**
  14081. * Removes `key` and its value from the map.
  14082. *
  14083. * @private
  14084. * @name delete
  14085. * @memberOf MapCache
  14086. * @param {string} key The key of the value to remove.
  14087. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  14088. */
  14089. function mapCacheDelete(key) {
  14090. return getMapData(this, key)['delete'](key);
  14091. }
  14092. /**
  14093. * Gets the map value for `key`.
  14094. *
  14095. * @private
  14096. * @name get
  14097. * @memberOf MapCache
  14098. * @param {string} key The key of the value to get.
  14099. * @returns {*} Returns the entry value.
  14100. */
  14101. function mapCacheGet(key) {
  14102. return getMapData(this, key).get(key);
  14103. }
  14104. /**
  14105. * Checks if a map value for `key` exists.
  14106. *
  14107. * @private
  14108. * @name has
  14109. * @memberOf MapCache
  14110. * @param {string} key The key of the entry to check.
  14111. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14112. */
  14113. function mapCacheHas(key) {
  14114. return getMapData(this, key).has(key);
  14115. }
  14116. /**
  14117. * Sets the map `key` to `value`.
  14118. *
  14119. * @private
  14120. * @name set
  14121. * @memberOf MapCache
  14122. * @param {string} key The key of the value to set.
  14123. * @param {*} value The value to set.
  14124. * @returns {Object} Returns the map cache instance.
  14125. */
  14126. function mapCacheSet(key, value) {
  14127. getMapData(this, key).set(key, value);
  14128. return this;
  14129. }
  14130. // Add methods to `MapCache`.
  14131. MapCache.prototype.clear = mapCacheClear;
  14132. MapCache.prototype['delete'] = mapCacheDelete;
  14133. MapCache.prototype.get = mapCacheGet;
  14134. MapCache.prototype.has = mapCacheHas;
  14135. MapCache.prototype.set = mapCacheSet;
  14136. /**
  14137. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  14138. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14139. * for equality comparisons.
  14140. *
  14141. * @private
  14142. * @param {Object} object The object to modify.
  14143. * @param {string} key The key of the property to assign.
  14144. * @param {*} value The value to assign.
  14145. */
  14146. function assignValue(object, key, value) {
  14147. var objValue = object[key];
  14148. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  14149. (value === undefined && !(key in object))) {
  14150. object[key] = value;
  14151. }
  14152. }
  14153. /**
  14154. * Gets the index at which the `key` is found in `array` of key-value pairs.
  14155. *
  14156. * @private
  14157. * @param {Array} array The array to inspect.
  14158. * @param {*} key The key to search for.
  14159. * @returns {number} Returns the index of the matched value, else `-1`.
  14160. */
  14161. function assocIndexOf(array, key) {
  14162. var length = array.length;
  14163. while (length--) {
  14164. if (eq(array[length][0], key)) {
  14165. return length;
  14166. }
  14167. }
  14168. return -1;
  14169. }
  14170. /**
  14171. * The base implementation of `_.isNative` without bad shim checks.
  14172. *
  14173. * @private
  14174. * @param {*} value The value to check.
  14175. * @returns {boolean} Returns `true` if `value` is a native function,
  14176. * else `false`.
  14177. */
  14178. function baseIsNative(value) {
  14179. if (!isObject(value) || isMasked(value)) {
  14180. return false;
  14181. }
  14182. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  14183. return pattern.test(toSource(value));
  14184. }
  14185. /**
  14186. * The base implementation of `_.set`.
  14187. *
  14188. * @private
  14189. * @param {Object} object The object to modify.
  14190. * @param {Array|string} path The path of the property to set.
  14191. * @param {*} value The value to set.
  14192. * @param {Function} [customizer] The function to customize path creation.
  14193. * @returns {Object} Returns `object`.
  14194. */
  14195. function baseSet(object, path, value, customizer) {
  14196. if (!isObject(object)) {
  14197. return object;
  14198. }
  14199. path = isKey(path, object) ? [path] : castPath(path);
  14200. var index = -1,
  14201. length = path.length,
  14202. lastIndex = length - 1,
  14203. nested = object;
  14204. while (nested != null && ++index < length) {
  14205. var key = toKey(path[index]),
  14206. newValue = value;
  14207. if (index != lastIndex) {
  14208. var objValue = nested[key];
  14209. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  14210. if (newValue === undefined) {
  14211. newValue = isObject(objValue)
  14212. ? objValue
  14213. : (isIndex(path[index + 1]) ? [] : {});
  14214. }
  14215. }
  14216. assignValue(nested, key, newValue);
  14217. nested = nested[key];
  14218. }
  14219. return object;
  14220. }
  14221. /**
  14222. * The base implementation of `_.toString` which doesn't convert nullish
  14223. * values to empty strings.
  14224. *
  14225. * @private
  14226. * @param {*} value The value to process.
  14227. * @returns {string} Returns the string.
  14228. */
  14229. function baseToString(value) {
  14230. // Exit early for strings to avoid a performance hit in some environments.
  14231. if (typeof value == 'string') {
  14232. return value;
  14233. }
  14234. if (isSymbol(value)) {
  14235. return symbolToString ? symbolToString.call(value) : '';
  14236. }
  14237. var result = (value + '');
  14238. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14239. }
  14240. /**
  14241. * Casts `value` to a path array if it's not one.
  14242. *
  14243. * @private
  14244. * @param {*} value The value to inspect.
  14245. * @returns {Array} Returns the cast property path array.
  14246. */
  14247. function castPath(value) {
  14248. return isArray(value) ? value : stringToPath(value);
  14249. }
  14250. /**
  14251. * Gets the data for `map`.
  14252. *
  14253. * @private
  14254. * @param {Object} map The map to query.
  14255. * @param {string} key The reference key.
  14256. * @returns {*} Returns the map data.
  14257. */
  14258. function getMapData(map, key) {
  14259. var data = map.__data__;
  14260. return isKeyable(key)
  14261. ? data[typeof key == 'string' ? 'string' : 'hash']
  14262. : data.map;
  14263. }
  14264. /**
  14265. * Gets the native function at `key` of `object`.
  14266. *
  14267. * @private
  14268. * @param {Object} object The object to query.
  14269. * @param {string} key The key of the method to get.
  14270. * @returns {*} Returns the function if it's native, else `undefined`.
  14271. */
  14272. function getNative(object, key) {
  14273. var value = getValue(object, key);
  14274. return baseIsNative(value) ? value : undefined;
  14275. }
  14276. /**
  14277. * Checks if `value` is a valid array-like index.
  14278. *
  14279. * @private
  14280. * @param {*} value The value to check.
  14281. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  14282. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  14283. */
  14284. function isIndex(value, length) {
  14285. length = length == null ? MAX_SAFE_INTEGER : length;
  14286. return !!length &&
  14287. (typeof value == 'number' || reIsUint.test(value)) &&
  14288. (value > -1 && value % 1 == 0 && value < length);
  14289. }
  14290. /**
  14291. * Checks if `value` is a property name and not a property path.
  14292. *
  14293. * @private
  14294. * @param {*} value The value to check.
  14295. * @param {Object} [object] The object to query keys on.
  14296. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  14297. */
  14298. function isKey(value, object) {
  14299. if (isArray(value)) {
  14300. return false;
  14301. }
  14302. var type = typeof value;
  14303. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  14304. value == null || isSymbol(value)) {
  14305. return true;
  14306. }
  14307. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  14308. (object != null && value in Object(object));
  14309. }
  14310. /**
  14311. * Checks if `value` is suitable for use as unique object key.
  14312. *
  14313. * @private
  14314. * @param {*} value The value to check.
  14315. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  14316. */
  14317. function isKeyable(value) {
  14318. var type = typeof value;
  14319. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  14320. ? (value !== '__proto__')
  14321. : (value === null);
  14322. }
  14323. /**
  14324. * Checks if `func` has its source masked.
  14325. *
  14326. * @private
  14327. * @param {Function} func The function to check.
  14328. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  14329. */
  14330. function isMasked(func) {
  14331. return !!maskSrcKey && (maskSrcKey in func);
  14332. }
  14333. /**
  14334. * Converts `string` to a property path array.
  14335. *
  14336. * @private
  14337. * @param {string} string The string to convert.
  14338. * @returns {Array} Returns the property path array.
  14339. */
  14340. var stringToPath = memoize(function(string) {
  14341. string = toString(string);
  14342. var result = [];
  14343. if (reLeadingDot.test(string)) {
  14344. result.push('');
  14345. }
  14346. string.replace(rePropName, function(match, number, quote, string) {
  14347. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  14348. });
  14349. return result;
  14350. });
  14351. /**
  14352. * Converts `value` to a string key if it's not a string or symbol.
  14353. *
  14354. * @private
  14355. * @param {*} value The value to inspect.
  14356. * @returns {string|symbol} Returns the key.
  14357. */
  14358. function toKey(value) {
  14359. if (typeof value == 'string' || isSymbol(value)) {
  14360. return value;
  14361. }
  14362. var result = (value + '');
  14363. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14364. }
  14365. /**
  14366. * Converts `func` to its source code.
  14367. *
  14368. * @private
  14369. * @param {Function} func The function to process.
  14370. * @returns {string} Returns the source code.
  14371. */
  14372. function toSource(func) {
  14373. if (func != null) {
  14374. try {
  14375. return funcToString.call(func);
  14376. } catch (e) {}
  14377. try {
  14378. return (func + '');
  14379. } catch (e) {}
  14380. }
  14381. return '';
  14382. }
  14383. /**
  14384. * Creates a function that memoizes the result of `func`. If `resolver` is
  14385. * provided, it determines the cache key for storing the result based on the
  14386. * arguments provided to the memoized function. By default, the first argument
  14387. * provided to the memoized function is used as the map cache key. The `func`
  14388. * is invoked with the `this` binding of the memoized function.
  14389. *
  14390. * **Note:** The cache is exposed as the `cache` property on the memoized
  14391. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  14392. * constructor with one whose instances implement the
  14393. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  14394. * method interface of `delete`, `get`, `has`, and `set`.
  14395. *
  14396. * @static
  14397. * @memberOf _
  14398. * @since 0.1.0
  14399. * @category Function
  14400. * @param {Function} func The function to have its output memoized.
  14401. * @param {Function} [resolver] The function to resolve the cache key.
  14402. * @returns {Function} Returns the new memoized function.
  14403. * @example
  14404. *
  14405. * var object = { 'a': 1, 'b': 2 };
  14406. * var other = { 'c': 3, 'd': 4 };
  14407. *
  14408. * var values = _.memoize(_.values);
  14409. * values(object);
  14410. * // => [1, 2]
  14411. *
  14412. * values(other);
  14413. * // => [3, 4]
  14414. *
  14415. * object.a = 2;
  14416. * values(object);
  14417. * // => [1, 2]
  14418. *
  14419. * // Modify the result cache.
  14420. * values.cache.set(object, ['a', 'b']);
  14421. * values(object);
  14422. * // => ['a', 'b']
  14423. *
  14424. * // Replace `_.memoize.Cache`.
  14425. * _.memoize.Cache = WeakMap;
  14426. */
  14427. function memoize(func, resolver) {
  14428. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  14429. throw new TypeError(FUNC_ERROR_TEXT);
  14430. }
  14431. var memoized = function() {
  14432. var args = arguments,
  14433. key = resolver ? resolver.apply(this, args) : args[0],
  14434. cache = memoized.cache;
  14435. if (cache.has(key)) {
  14436. return cache.get(key);
  14437. }
  14438. var result = func.apply(this, args);
  14439. memoized.cache = cache.set(key, result);
  14440. return result;
  14441. };
  14442. memoized.cache = new (memoize.Cache || MapCache);
  14443. return memoized;
  14444. }
  14445. // Assign cache to `_.memoize`.
  14446. memoize.Cache = MapCache;
  14447. /**
  14448. * Performs a
  14449. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14450. * comparison between two values to determine if they are equivalent.
  14451. *
  14452. * @static
  14453. * @memberOf _
  14454. * @since 4.0.0
  14455. * @category Lang
  14456. * @param {*} value The value to compare.
  14457. * @param {*} other The other value to compare.
  14458. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  14459. * @example
  14460. *
  14461. * var object = { 'a': 1 };
  14462. * var other = { 'a': 1 };
  14463. *
  14464. * _.eq(object, object);
  14465. * // => true
  14466. *
  14467. * _.eq(object, other);
  14468. * // => false
  14469. *
  14470. * _.eq('a', 'a');
  14471. * // => true
  14472. *
  14473. * _.eq('a', Object('a'));
  14474. * // => false
  14475. *
  14476. * _.eq(NaN, NaN);
  14477. * // => true
  14478. */
  14479. function eq(value, other) {
  14480. return value === other || (value !== value && other !== other);
  14481. }
  14482. /**
  14483. * Checks if `value` is classified as an `Array` object.
  14484. *
  14485. * @static
  14486. * @memberOf _
  14487. * @since 0.1.0
  14488. * @category Lang
  14489. * @param {*} value The value to check.
  14490. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14491. * @example
  14492. *
  14493. * _.isArray([1, 2, 3]);
  14494. * // => true
  14495. *
  14496. * _.isArray(document.body.children);
  14497. * // => false
  14498. *
  14499. * _.isArray('abc');
  14500. * // => false
  14501. *
  14502. * _.isArray(_.noop);
  14503. * // => false
  14504. */
  14505. var isArray = Array.isArray;
  14506. /**
  14507. * Checks if `value` is classified as a `Function` object.
  14508. *
  14509. * @static
  14510. * @memberOf _
  14511. * @since 0.1.0
  14512. * @category Lang
  14513. * @param {*} value The value to check.
  14514. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14515. * @example
  14516. *
  14517. * _.isFunction(_);
  14518. * // => true
  14519. *
  14520. * _.isFunction(/abc/);
  14521. * // => false
  14522. */
  14523. function isFunction(value) {
  14524. // The use of `Object#toString` avoids issues with the `typeof` operator
  14525. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14526. var tag = isObject(value) ? objectToString.call(value) : '';
  14527. return tag == funcTag || tag == genTag;
  14528. }
  14529. /**
  14530. * Checks if `value` is the
  14531. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14532. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14533. *
  14534. * @static
  14535. * @memberOf _
  14536. * @since 0.1.0
  14537. * @category Lang
  14538. * @param {*} value The value to check.
  14539. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14540. * @example
  14541. *
  14542. * _.isObject({});
  14543. * // => true
  14544. *
  14545. * _.isObject([1, 2, 3]);
  14546. * // => true
  14547. *
  14548. * _.isObject(_.noop);
  14549. * // => true
  14550. *
  14551. * _.isObject(null);
  14552. * // => false
  14553. */
  14554. function isObject(value) {
  14555. var type = typeof value;
  14556. return !!value && (type == 'object' || type == 'function');
  14557. }
  14558. /**
  14559. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14560. * and has a `typeof` result of "object".
  14561. *
  14562. * @static
  14563. * @memberOf _
  14564. * @since 4.0.0
  14565. * @category Lang
  14566. * @param {*} value The value to check.
  14567. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14568. * @example
  14569. *
  14570. * _.isObjectLike({});
  14571. * // => true
  14572. *
  14573. * _.isObjectLike([1, 2, 3]);
  14574. * // => true
  14575. *
  14576. * _.isObjectLike(_.noop);
  14577. * // => false
  14578. *
  14579. * _.isObjectLike(null);
  14580. * // => false
  14581. */
  14582. function isObjectLike(value) {
  14583. return !!value && typeof value == 'object';
  14584. }
  14585. /**
  14586. * Checks if `value` is classified as a `Symbol` primitive or object.
  14587. *
  14588. * @static
  14589. * @memberOf _
  14590. * @since 4.0.0
  14591. * @category Lang
  14592. * @param {*} value The value to check.
  14593. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14594. * @example
  14595. *
  14596. * _.isSymbol(Symbol.iterator);
  14597. * // => true
  14598. *
  14599. * _.isSymbol('abc');
  14600. * // => false
  14601. */
  14602. function isSymbol(value) {
  14603. return typeof value == 'symbol' ||
  14604. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14605. }
  14606. /**
  14607. * Converts `value` to a string. An empty string is returned for `null`
  14608. * and `undefined` values. The sign of `-0` is preserved.
  14609. *
  14610. * @static
  14611. * @memberOf _
  14612. * @since 4.0.0
  14613. * @category Lang
  14614. * @param {*} value The value to process.
  14615. * @returns {string} Returns the string.
  14616. * @example
  14617. *
  14618. * _.toString(null);
  14619. * // => ''
  14620. *
  14621. * _.toString(-0);
  14622. * // => '-0'
  14623. *
  14624. * _.toString([1, 2, 3]);
  14625. * // => '1,2,3'
  14626. */
  14627. function toString(value) {
  14628. return value == null ? '' : baseToString(value);
  14629. }
  14630. /**
  14631. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14632. * it's created. Arrays are created for missing index properties while objects
  14633. * are created for all other missing properties. Use `_.setWith` to customize
  14634. * `path` creation.
  14635. *
  14636. * **Note:** This method mutates `object`.
  14637. *
  14638. * @static
  14639. * @memberOf _
  14640. * @since 3.7.0
  14641. * @category Object
  14642. * @param {Object} object The object to modify.
  14643. * @param {Array|string} path The path of the property to set.
  14644. * @param {*} value The value to set.
  14645. * @returns {Object} Returns `object`.
  14646. * @example
  14647. *
  14648. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14649. *
  14650. * _.set(object, 'a[0].b.c', 4);
  14651. * console.log(object.a[0].b.c);
  14652. * // => 4
  14653. *
  14654. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14655. * console.log(object.x[0].y.z);
  14656. * // => 5
  14657. */
  14658. function set(object, path, value) {
  14659. return object == null ? object : baseSet(object, path, value);
  14660. }
  14661. module.exports = set;
  14662. /***/ }),
  14663. /***/ 898:
  14664. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14665. "use strict";
  14666. Object.defineProperty(exports, '__esModule', { value: true });
  14667. var request = __webpack_require__(753);
  14668. var universalUserAgent = __webpack_require__(796);
  14669. const VERSION = "4.3.1";
  14670. class GraphqlError extends Error {
  14671. constructor(request, response) {
  14672. const message = response.data.errors[0].message;
  14673. super(message);
  14674. Object.assign(this, response.data);
  14675. this.name = "GraphqlError";
  14676. this.request = request; // Maintains proper stack trace (only available on V8)
  14677. /* istanbul ignore next */
  14678. if (Error.captureStackTrace) {
  14679. Error.captureStackTrace(this, this.constructor);
  14680. }
  14681. }
  14682. }
  14683. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14684. function graphql(request, query, options) {
  14685. options = typeof query === "string" ? options = Object.assign({
  14686. query
  14687. }, options) : options = query;
  14688. const requestOptions = Object.keys(options).reduce((result, key) => {
  14689. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14690. result[key] = options[key];
  14691. return result;
  14692. }
  14693. if (!result.variables) {
  14694. result.variables = {};
  14695. }
  14696. result.variables[key] = options[key];
  14697. return result;
  14698. }, {});
  14699. return request(requestOptions).then(response => {
  14700. if (response.data.errors) {
  14701. throw new GraphqlError(requestOptions, {
  14702. data: response.data
  14703. });
  14704. }
  14705. return response.data.data;
  14706. });
  14707. }
  14708. function withDefaults(request$1, newDefaults) {
  14709. const newRequest = request$1.defaults(newDefaults);
  14710. const newApi = (query, options) => {
  14711. return graphql(newRequest, query, options);
  14712. };
  14713. return Object.assign(newApi, {
  14714. defaults: withDefaults.bind(null, newRequest),
  14715. endpoint: request.request.endpoint
  14716. });
  14717. }
  14718. const graphql$1 = withDefaults(request.request, {
  14719. headers: {
  14720. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14721. },
  14722. method: "POST",
  14723. url: "/graphql"
  14724. });
  14725. function withCustomRequest(customRequest) {
  14726. return withDefaults(customRequest, {
  14727. method: "POST",
  14728. url: "/graphql"
  14729. });
  14730. }
  14731. exports.graphql = graphql$1;
  14732. exports.withCustomRequest = withCustomRequest;
  14733. //# sourceMappingURL=index.js.map
  14734. /***/ }),
  14735. /***/ 899:
  14736. /***/ (function(module, __unusedexports, __webpack_require__) {
  14737. module.exports = registerEndpoints;
  14738. const { Deprecation } = __webpack_require__(692);
  14739. function registerEndpoints(octokit, routes) {
  14740. Object.keys(routes).forEach(namespaceName => {
  14741. if (!octokit[namespaceName]) {
  14742. octokit[namespaceName] = {};
  14743. }
  14744. Object.keys(routes[namespaceName]).forEach(apiName => {
  14745. const apiOptions = routes[namespaceName][apiName];
  14746. const endpointDefaults = ["method", "url", "headers"].reduce(
  14747. (map, key) => {
  14748. if (typeof apiOptions[key] !== "undefined") {
  14749. map[key] = apiOptions[key];
  14750. }
  14751. return map;
  14752. },
  14753. {}
  14754. );
  14755. endpointDefaults.request = {
  14756. validate: apiOptions.params
  14757. };
  14758. let request = octokit.request.defaults(endpointDefaults);
  14759. // patch request & endpoint methods to support deprecated parameters.
  14760. // Not the most elegant solution, but we don’t want to move deprecation
  14761. // logic into octokit/endpoint.js as it’s out of scope
  14762. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14763. key => apiOptions.params[key].deprecated
  14764. );
  14765. if (hasDeprecatedParam) {
  14766. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14767. request = patch(
  14768. octokit.request.defaults(endpointDefaults),
  14769. `.${namespaceName}.${apiName}()`
  14770. );
  14771. request.endpoint = patch(
  14772. request.endpoint,
  14773. `.${namespaceName}.${apiName}.endpoint()`
  14774. );
  14775. request.endpoint.merge = patch(
  14776. request.endpoint.merge,
  14777. `.${namespaceName}.${apiName}.endpoint.merge()`
  14778. );
  14779. }
  14780. if (apiOptions.deprecated) {
  14781. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14782. octokit.log.warn(
  14783. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14784. );
  14785. octokit[namespaceName][apiName] = request;
  14786. return request.apply(null, arguments);
  14787. };
  14788. return;
  14789. }
  14790. octokit[namespaceName][apiName] = request;
  14791. });
  14792. });
  14793. }
  14794. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14795. const patchedMethod = options => {
  14796. options = Object.assign({}, options);
  14797. Object.keys(options).forEach(key => {
  14798. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14799. const aliasKey = apiOptions.params[key].alias;
  14800. octokit.log.warn(
  14801. new Deprecation(
  14802. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14803. )
  14804. );
  14805. if (!(aliasKey in options)) {
  14806. options[aliasKey] = options[key];
  14807. }
  14808. delete options[key];
  14809. }
  14810. });
  14811. return method(options);
  14812. };
  14813. Object.keys(method).forEach(key => {
  14814. patchedMethod[key] = method[key];
  14815. });
  14816. return patchedMethod;
  14817. }
  14818. /***/ }),
  14819. /***/ 929:
  14820. /***/ (function(module, __unusedexports, __webpack_require__) {
  14821. module.exports = hasNextPage
  14822. const deprecate = __webpack_require__(370)
  14823. const getPageLinks = __webpack_require__(577)
  14824. function hasNextPage (link) {
  14825. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  14826. return getPageLinks(link).next
  14827. }
  14828. /***/ }),
  14829. /***/ 948:
  14830. /***/ (function(module) {
  14831. "use strict";
  14832. /**
  14833. * Tries to execute a function and discards any error that occurs.
  14834. * @param {Function} fn - Function that might or might not throw an error.
  14835. * @returns {?*} Return-value of the function when no error occurred.
  14836. */
  14837. module.exports = function(fn) {
  14838. try { return fn() } catch (e) {}
  14839. }
  14840. /***/ }),
  14841. /***/ 950:
  14842. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14843. "use strict";
  14844. Object.defineProperty(exports, "__esModule", { value: true });
  14845. const url = __webpack_require__(835);
  14846. function getProxyUrl(reqUrl) {
  14847. let usingSsl = reqUrl.protocol === 'https:';
  14848. let proxyUrl;
  14849. if (checkBypass(reqUrl)) {
  14850. return proxyUrl;
  14851. }
  14852. let proxyVar;
  14853. if (usingSsl) {
  14854. proxyVar = process.env["https_proxy"] ||
  14855. process.env["HTTPS_PROXY"];
  14856. }
  14857. else {
  14858. proxyVar = process.env["http_proxy"] ||
  14859. process.env["HTTP_PROXY"];
  14860. }
  14861. if (proxyVar) {
  14862. proxyUrl = url.parse(proxyVar);
  14863. }
  14864. return proxyUrl;
  14865. }
  14866. exports.getProxyUrl = getProxyUrl;
  14867. function checkBypass(reqUrl) {
  14868. if (!reqUrl.hostname) {
  14869. return false;
  14870. }
  14871. let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
  14872. if (!noProxy) {
  14873. return false;
  14874. }
  14875. // Determine the request port
  14876. let reqPort;
  14877. if (reqUrl.port) {
  14878. reqPort = Number(reqUrl.port);
  14879. }
  14880. else if (reqUrl.protocol === 'http:') {
  14881. reqPort = 80;
  14882. }
  14883. else if (reqUrl.protocol === 'https:') {
  14884. reqPort = 443;
  14885. }
  14886. // Format the request hostname and hostname with port
  14887. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  14888. if (typeof reqPort === 'number') {
  14889. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  14890. }
  14891. // Compare request host against noproxy
  14892. for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
  14893. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  14894. return true;
  14895. }
  14896. }
  14897. return false;
  14898. }
  14899. exports.checkBypass = checkBypass;
  14900. /***/ }),
  14901. /***/ 954:
  14902. /***/ (function(module) {
  14903. module.exports = validateAuth;
  14904. function validateAuth(auth) {
  14905. if (typeof auth === "string") {
  14906. return;
  14907. }
  14908. if (typeof auth === "function") {
  14909. return;
  14910. }
  14911. if (auth.username && auth.password) {
  14912. return;
  14913. }
  14914. if (auth.clientId && auth.clientSecret) {
  14915. return;
  14916. }
  14917. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  14918. }
  14919. /***/ }),
  14920. /***/ 955:
  14921. /***/ (function(module, __unusedexports, __webpack_require__) {
  14922. "use strict";
  14923. const path = __webpack_require__(622);
  14924. const childProcess = __webpack_require__(129);
  14925. const crossSpawn = __webpack_require__(20);
  14926. const stripEof = __webpack_require__(768);
  14927. const npmRunPath = __webpack_require__(621);
  14928. const isStream = __webpack_require__(323);
  14929. const _getStream = __webpack_require__(145);
  14930. const pFinally = __webpack_require__(697);
  14931. const onExit = __webpack_require__(260);
  14932. const errname = __webpack_require__(427);
  14933. const stdio = __webpack_require__(168);
  14934. const TEN_MEGABYTES = 1000 * 1000 * 10;
  14935. function handleArgs(cmd, args, opts) {
  14936. let parsed;
  14937. opts = Object.assign({
  14938. extendEnv: true,
  14939. env: {}
  14940. }, opts);
  14941. if (opts.extendEnv) {
  14942. opts.env = Object.assign({}, process.env, opts.env);
  14943. }
  14944. if (opts.__winShell === true) {
  14945. delete opts.__winShell;
  14946. parsed = {
  14947. command: cmd,
  14948. args,
  14949. options: opts,
  14950. file: cmd,
  14951. original: {
  14952. cmd,
  14953. args
  14954. }
  14955. };
  14956. } else {
  14957. parsed = crossSpawn._parse(cmd, args, opts);
  14958. }
  14959. opts = Object.assign({
  14960. maxBuffer: TEN_MEGABYTES,
  14961. buffer: true,
  14962. stripEof: true,
  14963. preferLocal: true,
  14964. localDir: parsed.options.cwd || process.cwd(),
  14965. encoding: 'utf8',
  14966. reject: true,
  14967. cleanup: true
  14968. }, parsed.options);
  14969. opts.stdio = stdio(opts);
  14970. if (opts.preferLocal) {
  14971. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  14972. }
  14973. if (opts.detached) {
  14974. // #115
  14975. opts.cleanup = false;
  14976. }
  14977. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  14978. // #116
  14979. parsed.args.unshift('/q');
  14980. }
  14981. return {
  14982. cmd: parsed.command,
  14983. args: parsed.args,
  14984. opts,
  14985. parsed
  14986. };
  14987. }
  14988. function handleInput(spawned, input) {
  14989. if (input === null || input === undefined) {
  14990. return;
  14991. }
  14992. if (isStream(input)) {
  14993. input.pipe(spawned.stdin);
  14994. } else {
  14995. spawned.stdin.end(input);
  14996. }
  14997. }
  14998. function handleOutput(opts, val) {
  14999. if (val && opts.stripEof) {
  15000. val = stripEof(val);
  15001. }
  15002. return val;
  15003. }
  15004. function handleShell(fn, cmd, opts) {
  15005. let file = '/bin/sh';
  15006. let args = ['-c', cmd];
  15007. opts = Object.assign({}, opts);
  15008. if (process.platform === 'win32') {
  15009. opts.__winShell = true;
  15010. file = process.env.comspec || 'cmd.exe';
  15011. args = ['/s', '/c', `"${cmd}"`];
  15012. opts.windowsVerbatimArguments = true;
  15013. }
  15014. if (opts.shell) {
  15015. file = opts.shell;
  15016. delete opts.shell;
  15017. }
  15018. return fn(file, args, opts);
  15019. }
  15020. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  15021. if (!process[stream]) {
  15022. return null;
  15023. }
  15024. let ret;
  15025. if (!buffer) {
  15026. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  15027. ret = new Promise((resolve, reject) => {
  15028. process[stream]
  15029. .once('end', resolve)
  15030. .once('error', reject);
  15031. });
  15032. } else if (encoding) {
  15033. ret = _getStream(process[stream], {
  15034. encoding,
  15035. maxBuffer
  15036. });
  15037. } else {
  15038. ret = _getStream.buffer(process[stream], {maxBuffer});
  15039. }
  15040. return ret.catch(err => {
  15041. err.stream = stream;
  15042. err.message = `${stream} ${err.message}`;
  15043. throw err;
  15044. });
  15045. }
  15046. function makeError(result, options) {
  15047. const {stdout, stderr} = result;
  15048. let err = result.error;
  15049. const {code, signal} = result;
  15050. const {parsed, joinedCmd} = options;
  15051. const timedOut = options.timedOut || false;
  15052. if (!err) {
  15053. let output = '';
  15054. if (Array.isArray(parsed.opts.stdio)) {
  15055. if (parsed.opts.stdio[2] !== 'inherit') {
  15056. output += output.length > 0 ? stderr : `\n${stderr}`;
  15057. }
  15058. if (parsed.opts.stdio[1] !== 'inherit') {
  15059. output += `\n${stdout}`;
  15060. }
  15061. } else if (parsed.opts.stdio !== 'inherit') {
  15062. output = `\n${stderr}${stdout}`;
  15063. }
  15064. err = new Error(`Command failed: ${joinedCmd}${output}`);
  15065. err.code = code < 0 ? errname(code) : code;
  15066. }
  15067. err.stdout = stdout;
  15068. err.stderr = stderr;
  15069. err.failed = true;
  15070. err.signal = signal || null;
  15071. err.cmd = joinedCmd;
  15072. err.timedOut = timedOut;
  15073. return err;
  15074. }
  15075. function joinCmd(cmd, args) {
  15076. let joinedCmd = cmd;
  15077. if (Array.isArray(args) && args.length > 0) {
  15078. joinedCmd += ' ' + args.join(' ');
  15079. }
  15080. return joinedCmd;
  15081. }
  15082. module.exports = (cmd, args, opts) => {
  15083. const parsed = handleArgs(cmd, args, opts);
  15084. const {encoding, buffer, maxBuffer} = parsed.opts;
  15085. const joinedCmd = joinCmd(cmd, args);
  15086. let spawned;
  15087. try {
  15088. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  15089. } catch (err) {
  15090. return Promise.reject(err);
  15091. }
  15092. let removeExitHandler;
  15093. if (parsed.opts.cleanup) {
  15094. removeExitHandler = onExit(() => {
  15095. spawned.kill();
  15096. });
  15097. }
  15098. let timeoutId = null;
  15099. let timedOut = false;
  15100. const cleanup = () => {
  15101. if (timeoutId) {
  15102. clearTimeout(timeoutId);
  15103. timeoutId = null;
  15104. }
  15105. if (removeExitHandler) {
  15106. removeExitHandler();
  15107. }
  15108. };
  15109. if (parsed.opts.timeout > 0) {
  15110. timeoutId = setTimeout(() => {
  15111. timeoutId = null;
  15112. timedOut = true;
  15113. spawned.kill(parsed.opts.killSignal);
  15114. }, parsed.opts.timeout);
  15115. }
  15116. const processDone = new Promise(resolve => {
  15117. spawned.on('exit', (code, signal) => {
  15118. cleanup();
  15119. resolve({code, signal});
  15120. });
  15121. spawned.on('error', err => {
  15122. cleanup();
  15123. resolve({error: err});
  15124. });
  15125. if (spawned.stdin) {
  15126. spawned.stdin.on('error', err => {
  15127. cleanup();
  15128. resolve({error: err});
  15129. });
  15130. }
  15131. });
  15132. function destroy() {
  15133. if (spawned.stdout) {
  15134. spawned.stdout.destroy();
  15135. }
  15136. if (spawned.stderr) {
  15137. spawned.stderr.destroy();
  15138. }
  15139. }
  15140. const handlePromise = () => pFinally(Promise.all([
  15141. processDone,
  15142. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  15143. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  15144. ]).then(arr => {
  15145. const result = arr[0];
  15146. result.stdout = arr[1];
  15147. result.stderr = arr[2];
  15148. if (result.error || result.code !== 0 || result.signal !== null) {
  15149. const err = makeError(result, {
  15150. joinedCmd,
  15151. parsed,
  15152. timedOut
  15153. });
  15154. // TODO: missing some timeout logic for killed
  15155. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  15156. // err.killed = spawned.killed || killed;
  15157. err.killed = err.killed || spawned.killed;
  15158. if (!parsed.opts.reject) {
  15159. return err;
  15160. }
  15161. throw err;
  15162. }
  15163. return {
  15164. stdout: handleOutput(parsed.opts, result.stdout),
  15165. stderr: handleOutput(parsed.opts, result.stderr),
  15166. code: 0,
  15167. failed: false,
  15168. killed: false,
  15169. signal: null,
  15170. cmd: joinedCmd,
  15171. timedOut: false
  15172. };
  15173. }), destroy);
  15174. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  15175. handleInput(spawned, parsed.opts.input);
  15176. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  15177. spawned.catch = onrejected => handlePromise().catch(onrejected);
  15178. return spawned;
  15179. };
  15180. // TODO: set `stderr: 'ignore'` when that option is implemented
  15181. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  15182. // TODO: set `stdout: 'ignore'` when that option is implemented
  15183. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  15184. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  15185. module.exports.sync = (cmd, args, opts) => {
  15186. const parsed = handleArgs(cmd, args, opts);
  15187. const joinedCmd = joinCmd(cmd, args);
  15188. if (isStream(parsed.opts.input)) {
  15189. throw new TypeError('The `input` option cannot be a stream in sync mode');
  15190. }
  15191. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  15192. result.code = result.status;
  15193. if (result.error || result.status !== 0 || result.signal !== null) {
  15194. const err = makeError(result, {
  15195. joinedCmd,
  15196. parsed
  15197. });
  15198. if (!parsed.opts.reject) {
  15199. return err;
  15200. }
  15201. throw err;
  15202. }
  15203. return {
  15204. stdout: handleOutput(parsed.opts, result.stdout),
  15205. stderr: handleOutput(parsed.opts, result.stderr),
  15206. code: 0,
  15207. failed: false,
  15208. signal: null,
  15209. cmd: joinedCmd,
  15210. timedOut: false
  15211. };
  15212. };
  15213. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  15214. /***/ }),
  15215. /***/ 966:
  15216. /***/ (function(module, __unusedexports, __webpack_require__) {
  15217. "use strict";
  15218. const {PassThrough} = __webpack_require__(413);
  15219. module.exports = options => {
  15220. options = Object.assign({}, options);
  15221. const {array} = options;
  15222. let {encoding} = options;
  15223. const buffer = encoding === 'buffer';
  15224. let objectMode = false;
  15225. if (array) {
  15226. objectMode = !(encoding || buffer);
  15227. } else {
  15228. encoding = encoding || 'utf8';
  15229. }
  15230. if (buffer) {
  15231. encoding = null;
  15232. }
  15233. let len = 0;
  15234. const ret = [];
  15235. const stream = new PassThrough({objectMode});
  15236. if (encoding) {
  15237. stream.setEncoding(encoding);
  15238. }
  15239. stream.on('data', chunk => {
  15240. ret.push(chunk);
  15241. if (objectMode) {
  15242. len = ret.length;
  15243. } else {
  15244. len += chunk.length;
  15245. }
  15246. });
  15247. stream.getBufferedValue = () => {
  15248. if (array) {
  15249. return ret;
  15250. }
  15251. return buffer ? Buffer.concat(ret, len) : ret.join('');
  15252. };
  15253. stream.getBufferedLength = () => len;
  15254. return stream;
  15255. };
  15256. /***/ }),
  15257. /***/ 969:
  15258. /***/ (function(module, __unusedexports, __webpack_require__) {
  15259. var wrappy = __webpack_require__(11)
  15260. module.exports = wrappy(once)
  15261. module.exports.strict = wrappy(onceStrict)
  15262. once.proto = once(function () {
  15263. Object.defineProperty(Function.prototype, 'once', {
  15264. value: function () {
  15265. return once(this)
  15266. },
  15267. configurable: true
  15268. })
  15269. Object.defineProperty(Function.prototype, 'onceStrict', {
  15270. value: function () {
  15271. return onceStrict(this)
  15272. },
  15273. configurable: true
  15274. })
  15275. })
  15276. function once (fn) {
  15277. var f = function () {
  15278. if (f.called) return f.value
  15279. f.called = true
  15280. return f.value = fn.apply(this, arguments)
  15281. }
  15282. f.called = false
  15283. return f
  15284. }
  15285. function onceStrict (fn) {
  15286. var f = function () {
  15287. if (f.called)
  15288. throw new Error(f.onceError)
  15289. f.called = true
  15290. return f.value = fn.apply(this, arguments)
  15291. }
  15292. var name = fn.name || 'Function wrapped with `once`'
  15293. f.onceError = name + " shouldn't be called more than once"
  15294. f.called = false
  15295. return f
  15296. }
  15297. /***/ }),
  15298. /***/ 986:
  15299. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  15300. "use strict";
  15301. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  15302. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  15303. return new (P || (P = Promise))(function (resolve, reject) {
  15304. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  15305. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  15306. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  15307. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15308. });
  15309. };
  15310. Object.defineProperty(exports, "__esModule", { value: true });
  15311. const tr = __webpack_require__(9);
  15312. /**
  15313. * Exec a command.
  15314. * Output will be streamed to the live console.
  15315. * Returns promise with return code
  15316. *
  15317. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  15318. * @param args optional arguments for tool. Escaping is handled by the lib.
  15319. * @param options optional exec options. See ExecOptions
  15320. * @returns Promise<number> exit code
  15321. */
  15322. function exec(commandLine, args, options) {
  15323. return __awaiter(this, void 0, void 0, function* () {
  15324. const commandArgs = tr.argStringToArray(commandLine);
  15325. if (commandArgs.length === 0) {
  15326. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  15327. }
  15328. // Path to tool to execute should be first arg
  15329. const toolPath = commandArgs[0];
  15330. args = commandArgs.slice(1).concat(args || []);
  15331. const runner = new tr.ToolRunner(toolPath, args, options);
  15332. return runner.exec();
  15333. });
  15334. }
  15335. exports.exec = exec;
  15336. //# sourceMappingURL=exec.js.map
  15337. /***/ }),
  15338. /***/ 991:
  15339. /***/ (function(module, __unusedexports, __webpack_require__) {
  15340. module.exports = authenticationRequestError;
  15341. const { RequestError } = __webpack_require__(463);
  15342. function authenticationRequestError(state, error, options) {
  15343. if (!error.headers) throw error;
  15344. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  15345. // handle "2FA required" error only
  15346. if (error.status !== 401 || !otpRequired) {
  15347. throw error;
  15348. }
  15349. if (
  15350. error.status === 401 &&
  15351. otpRequired &&
  15352. error.request &&
  15353. error.request.headers["x-github-otp"]
  15354. ) {
  15355. if (state.otp) {
  15356. delete state.otp; // no longer valid, request again
  15357. } else {
  15358. throw new RequestError(
  15359. "Invalid one-time password for two-factor authentication",
  15360. 401,
  15361. {
  15362. headers: error.headers,
  15363. request: options
  15364. }
  15365. );
  15366. }
  15367. }
  15368. if (typeof state.auth.on2fa !== "function") {
  15369. throw new RequestError(
  15370. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  15371. 401,
  15372. {
  15373. headers: error.headers,
  15374. request: options
  15375. }
  15376. );
  15377. }
  15378. return Promise.resolve()
  15379. .then(() => {
  15380. return state.auth.on2fa();
  15381. })
  15382. .then(oneTimePassword => {
  15383. const newOptions = Object.assign(options, {
  15384. headers: Object.assign(options.headers, {
  15385. "x-github-otp": oneTimePassword
  15386. })
  15387. });
  15388. return state.octokit.request(newOptions).then(response => {
  15389. // If OTP still valid, then persist it for following requests
  15390. state.otp = oneTimePassword;
  15391. return response;
  15392. });
  15393. });
  15394. }
  15395. /***/ })
  15396. /******/ });