index.js 674 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641
  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. /***/ 87:
  1164. /***/ (function(module) {
  1165. module.exports = require("os");
  1166. /***/ }),
  1167. /***/ 118:
  1168. /***/ (function(module, __unusedexports, __webpack_require__) {
  1169. "use strict";
  1170. const os = __webpack_require__(87);
  1171. const nameMap = new Map([
  1172. [19, 'Catalina'],
  1173. [18, 'Mojave'],
  1174. [17, 'High Sierra'],
  1175. [16, 'Sierra'],
  1176. [15, 'El Capitan'],
  1177. [14, 'Yosemite'],
  1178. [13, 'Mavericks'],
  1179. [12, 'Mountain Lion'],
  1180. [11, 'Lion'],
  1181. [10, 'Snow Leopard'],
  1182. [9, 'Leopard'],
  1183. [8, 'Tiger'],
  1184. [7, 'Panther'],
  1185. [6, 'Jaguar'],
  1186. [5, 'Puma']
  1187. ]);
  1188. const macosRelease = release => {
  1189. release = Number((release || os.release()).split('.')[0]);
  1190. return {
  1191. name: nameMap.get(release),
  1192. version: '10.' + (release - 4)
  1193. };
  1194. };
  1195. module.exports = macosRelease;
  1196. // TODO: remove this in the next major version
  1197. module.exports.default = macosRelease;
  1198. /***/ }),
  1199. /***/ 126:
  1200. /***/ (function(module) {
  1201. /**
  1202. * lodash (Custom Build) <https://lodash.com/>
  1203. * Build: `lodash modularize exports="npm" -o ./`
  1204. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1205. * Released under MIT license <https://lodash.com/license>
  1206. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1207. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1208. */
  1209. /** Used as the size to enable large array optimizations. */
  1210. var LARGE_ARRAY_SIZE = 200;
  1211. /** Used to stand-in for `undefined` hash values. */
  1212. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1213. /** Used as references for various `Number` constants. */
  1214. var INFINITY = 1 / 0;
  1215. /** `Object#toString` result references. */
  1216. var funcTag = '[object Function]',
  1217. genTag = '[object GeneratorFunction]';
  1218. /**
  1219. * Used to match `RegExp`
  1220. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1221. */
  1222. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1223. /** Used to detect host constructors (Safari). */
  1224. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1225. /** Detect free variable `global` from Node.js. */
  1226. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1227. /** Detect free variable `self`. */
  1228. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1229. /** Used as a reference to the global object. */
  1230. var root = freeGlobal || freeSelf || Function('return this')();
  1231. /**
  1232. * A specialized version of `_.includes` for arrays without support for
  1233. * specifying an index to search from.
  1234. *
  1235. * @private
  1236. * @param {Array} [array] The array to inspect.
  1237. * @param {*} target The value to search for.
  1238. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1239. */
  1240. function arrayIncludes(array, value) {
  1241. var length = array ? array.length : 0;
  1242. return !!length && baseIndexOf(array, value, 0) > -1;
  1243. }
  1244. /**
  1245. * This function is like `arrayIncludes` except that it accepts a comparator.
  1246. *
  1247. * @private
  1248. * @param {Array} [array] The array to inspect.
  1249. * @param {*} target The value to search for.
  1250. * @param {Function} comparator The comparator invoked per element.
  1251. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1252. */
  1253. function arrayIncludesWith(array, value, comparator) {
  1254. var index = -1,
  1255. length = array ? array.length : 0;
  1256. while (++index < length) {
  1257. if (comparator(value, array[index])) {
  1258. return true;
  1259. }
  1260. }
  1261. return false;
  1262. }
  1263. /**
  1264. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1265. * support for iteratee shorthands.
  1266. *
  1267. * @private
  1268. * @param {Array} array The array to inspect.
  1269. * @param {Function} predicate The function invoked per iteration.
  1270. * @param {number} fromIndex The index to search from.
  1271. * @param {boolean} [fromRight] Specify iterating from right to left.
  1272. * @returns {number} Returns the index of the matched value, else `-1`.
  1273. */
  1274. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1275. var length = array.length,
  1276. index = fromIndex + (fromRight ? 1 : -1);
  1277. while ((fromRight ? index-- : ++index < length)) {
  1278. if (predicate(array[index], index, array)) {
  1279. return index;
  1280. }
  1281. }
  1282. return -1;
  1283. }
  1284. /**
  1285. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1286. *
  1287. * @private
  1288. * @param {Array} array The array to inspect.
  1289. * @param {*} value The value to search for.
  1290. * @param {number} fromIndex The index to search from.
  1291. * @returns {number} Returns the index of the matched value, else `-1`.
  1292. */
  1293. function baseIndexOf(array, value, fromIndex) {
  1294. if (value !== value) {
  1295. return baseFindIndex(array, baseIsNaN, fromIndex);
  1296. }
  1297. var index = fromIndex - 1,
  1298. length = array.length;
  1299. while (++index < length) {
  1300. if (array[index] === value) {
  1301. return index;
  1302. }
  1303. }
  1304. return -1;
  1305. }
  1306. /**
  1307. * The base implementation of `_.isNaN` without support for number objects.
  1308. *
  1309. * @private
  1310. * @param {*} value The value to check.
  1311. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1312. */
  1313. function baseIsNaN(value) {
  1314. return value !== value;
  1315. }
  1316. /**
  1317. * Checks if a cache value for `key` exists.
  1318. *
  1319. * @private
  1320. * @param {Object} cache The cache to query.
  1321. * @param {string} key The key of the entry to check.
  1322. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1323. */
  1324. function cacheHas(cache, key) {
  1325. return cache.has(key);
  1326. }
  1327. /**
  1328. * Gets the value at `key` of `object`.
  1329. *
  1330. * @private
  1331. * @param {Object} [object] The object to query.
  1332. * @param {string} key The key of the property to get.
  1333. * @returns {*} Returns the property value.
  1334. */
  1335. function getValue(object, key) {
  1336. return object == null ? undefined : object[key];
  1337. }
  1338. /**
  1339. * Checks if `value` is a host object in IE < 9.
  1340. *
  1341. * @private
  1342. * @param {*} value The value to check.
  1343. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1344. */
  1345. function isHostObject(value) {
  1346. // Many host objects are `Object` objects that can coerce to strings
  1347. // despite having improperly defined `toString` methods.
  1348. var result = false;
  1349. if (value != null && typeof value.toString != 'function') {
  1350. try {
  1351. result = !!(value + '');
  1352. } catch (e) {}
  1353. }
  1354. return result;
  1355. }
  1356. /**
  1357. * Converts `set` to an array of its values.
  1358. *
  1359. * @private
  1360. * @param {Object} set The set to convert.
  1361. * @returns {Array} Returns the values.
  1362. */
  1363. function setToArray(set) {
  1364. var index = -1,
  1365. result = Array(set.size);
  1366. set.forEach(function(value) {
  1367. result[++index] = value;
  1368. });
  1369. return result;
  1370. }
  1371. /** Used for built-in method references. */
  1372. var arrayProto = Array.prototype,
  1373. funcProto = Function.prototype,
  1374. objectProto = Object.prototype;
  1375. /** Used to detect overreaching core-js shims. */
  1376. var coreJsData = root['__core-js_shared__'];
  1377. /** Used to detect methods masquerading as native. */
  1378. var maskSrcKey = (function() {
  1379. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1380. return uid ? ('Symbol(src)_1.' + uid) : '';
  1381. }());
  1382. /** Used to resolve the decompiled source of functions. */
  1383. var funcToString = funcProto.toString;
  1384. /** Used to check objects for own properties. */
  1385. var hasOwnProperty = objectProto.hasOwnProperty;
  1386. /**
  1387. * Used to resolve the
  1388. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1389. * of values.
  1390. */
  1391. var objectToString = objectProto.toString;
  1392. /** Used to detect if a method is native. */
  1393. var reIsNative = RegExp('^' +
  1394. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1395. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1396. );
  1397. /** Built-in value references. */
  1398. var splice = arrayProto.splice;
  1399. /* Built-in method references that are verified to be native. */
  1400. var Map = getNative(root, 'Map'),
  1401. Set = getNative(root, 'Set'),
  1402. nativeCreate = getNative(Object, 'create');
  1403. /**
  1404. * Creates a hash object.
  1405. *
  1406. * @private
  1407. * @constructor
  1408. * @param {Array} [entries] The key-value pairs to cache.
  1409. */
  1410. function Hash(entries) {
  1411. var index = -1,
  1412. length = entries ? entries.length : 0;
  1413. this.clear();
  1414. while (++index < length) {
  1415. var entry = entries[index];
  1416. this.set(entry[0], entry[1]);
  1417. }
  1418. }
  1419. /**
  1420. * Removes all key-value entries from the hash.
  1421. *
  1422. * @private
  1423. * @name clear
  1424. * @memberOf Hash
  1425. */
  1426. function hashClear() {
  1427. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1428. }
  1429. /**
  1430. * Removes `key` and its value from the hash.
  1431. *
  1432. * @private
  1433. * @name delete
  1434. * @memberOf Hash
  1435. * @param {Object} hash The hash to modify.
  1436. * @param {string} key The key of the value to remove.
  1437. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1438. */
  1439. function hashDelete(key) {
  1440. return this.has(key) && delete this.__data__[key];
  1441. }
  1442. /**
  1443. * Gets the hash value for `key`.
  1444. *
  1445. * @private
  1446. * @name get
  1447. * @memberOf Hash
  1448. * @param {string} key The key of the value to get.
  1449. * @returns {*} Returns the entry value.
  1450. */
  1451. function hashGet(key) {
  1452. var data = this.__data__;
  1453. if (nativeCreate) {
  1454. var result = data[key];
  1455. return result === HASH_UNDEFINED ? undefined : result;
  1456. }
  1457. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1458. }
  1459. /**
  1460. * Checks if a hash value for `key` exists.
  1461. *
  1462. * @private
  1463. * @name has
  1464. * @memberOf Hash
  1465. * @param {string} key The key of the entry to check.
  1466. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1467. */
  1468. function hashHas(key) {
  1469. var data = this.__data__;
  1470. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1471. }
  1472. /**
  1473. * Sets the hash `key` to `value`.
  1474. *
  1475. * @private
  1476. * @name set
  1477. * @memberOf Hash
  1478. * @param {string} key The key of the value to set.
  1479. * @param {*} value The value to set.
  1480. * @returns {Object} Returns the hash instance.
  1481. */
  1482. function hashSet(key, value) {
  1483. var data = this.__data__;
  1484. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1485. return this;
  1486. }
  1487. // Add methods to `Hash`.
  1488. Hash.prototype.clear = hashClear;
  1489. Hash.prototype['delete'] = hashDelete;
  1490. Hash.prototype.get = hashGet;
  1491. Hash.prototype.has = hashHas;
  1492. Hash.prototype.set = hashSet;
  1493. /**
  1494. * Creates an list cache object.
  1495. *
  1496. * @private
  1497. * @constructor
  1498. * @param {Array} [entries] The key-value pairs to cache.
  1499. */
  1500. function ListCache(entries) {
  1501. var index = -1,
  1502. length = entries ? entries.length : 0;
  1503. this.clear();
  1504. while (++index < length) {
  1505. var entry = entries[index];
  1506. this.set(entry[0], entry[1]);
  1507. }
  1508. }
  1509. /**
  1510. * Removes all key-value entries from the list cache.
  1511. *
  1512. * @private
  1513. * @name clear
  1514. * @memberOf ListCache
  1515. */
  1516. function listCacheClear() {
  1517. this.__data__ = [];
  1518. }
  1519. /**
  1520. * Removes `key` and its value from the list cache.
  1521. *
  1522. * @private
  1523. * @name delete
  1524. * @memberOf ListCache
  1525. * @param {string} key The key of the value to remove.
  1526. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1527. */
  1528. function listCacheDelete(key) {
  1529. var data = this.__data__,
  1530. index = assocIndexOf(data, key);
  1531. if (index < 0) {
  1532. return false;
  1533. }
  1534. var lastIndex = data.length - 1;
  1535. if (index == lastIndex) {
  1536. data.pop();
  1537. } else {
  1538. splice.call(data, index, 1);
  1539. }
  1540. return true;
  1541. }
  1542. /**
  1543. * Gets the list cache value for `key`.
  1544. *
  1545. * @private
  1546. * @name get
  1547. * @memberOf ListCache
  1548. * @param {string} key The key of the value to get.
  1549. * @returns {*} Returns the entry value.
  1550. */
  1551. function listCacheGet(key) {
  1552. var data = this.__data__,
  1553. index = assocIndexOf(data, key);
  1554. return index < 0 ? undefined : data[index][1];
  1555. }
  1556. /**
  1557. * Checks if a list cache value for `key` exists.
  1558. *
  1559. * @private
  1560. * @name has
  1561. * @memberOf ListCache
  1562. * @param {string} key The key of the entry to check.
  1563. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1564. */
  1565. function listCacheHas(key) {
  1566. return assocIndexOf(this.__data__, key) > -1;
  1567. }
  1568. /**
  1569. * Sets the list cache `key` to `value`.
  1570. *
  1571. * @private
  1572. * @name set
  1573. * @memberOf ListCache
  1574. * @param {string} key The key of the value to set.
  1575. * @param {*} value The value to set.
  1576. * @returns {Object} Returns the list cache instance.
  1577. */
  1578. function listCacheSet(key, value) {
  1579. var data = this.__data__,
  1580. index = assocIndexOf(data, key);
  1581. if (index < 0) {
  1582. data.push([key, value]);
  1583. } else {
  1584. data[index][1] = value;
  1585. }
  1586. return this;
  1587. }
  1588. // Add methods to `ListCache`.
  1589. ListCache.prototype.clear = listCacheClear;
  1590. ListCache.prototype['delete'] = listCacheDelete;
  1591. ListCache.prototype.get = listCacheGet;
  1592. ListCache.prototype.has = listCacheHas;
  1593. ListCache.prototype.set = listCacheSet;
  1594. /**
  1595. * Creates a map cache object to store key-value pairs.
  1596. *
  1597. * @private
  1598. * @constructor
  1599. * @param {Array} [entries] The key-value pairs to cache.
  1600. */
  1601. function MapCache(entries) {
  1602. var index = -1,
  1603. length = entries ? entries.length : 0;
  1604. this.clear();
  1605. while (++index < length) {
  1606. var entry = entries[index];
  1607. this.set(entry[0], entry[1]);
  1608. }
  1609. }
  1610. /**
  1611. * Removes all key-value entries from the map.
  1612. *
  1613. * @private
  1614. * @name clear
  1615. * @memberOf MapCache
  1616. */
  1617. function mapCacheClear() {
  1618. this.__data__ = {
  1619. 'hash': new Hash,
  1620. 'map': new (Map || ListCache),
  1621. 'string': new Hash
  1622. };
  1623. }
  1624. /**
  1625. * Removes `key` and its value from the map.
  1626. *
  1627. * @private
  1628. * @name delete
  1629. * @memberOf MapCache
  1630. * @param {string} key The key of the value to remove.
  1631. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1632. */
  1633. function mapCacheDelete(key) {
  1634. return getMapData(this, key)['delete'](key);
  1635. }
  1636. /**
  1637. * Gets the map value for `key`.
  1638. *
  1639. * @private
  1640. * @name get
  1641. * @memberOf MapCache
  1642. * @param {string} key The key of the value to get.
  1643. * @returns {*} Returns the entry value.
  1644. */
  1645. function mapCacheGet(key) {
  1646. return getMapData(this, key).get(key);
  1647. }
  1648. /**
  1649. * Checks if a map value for `key` exists.
  1650. *
  1651. * @private
  1652. * @name has
  1653. * @memberOf MapCache
  1654. * @param {string} key The key of the entry to check.
  1655. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1656. */
  1657. function mapCacheHas(key) {
  1658. return getMapData(this, key).has(key);
  1659. }
  1660. /**
  1661. * Sets the map `key` to `value`.
  1662. *
  1663. * @private
  1664. * @name set
  1665. * @memberOf MapCache
  1666. * @param {string} key The key of the value to set.
  1667. * @param {*} value The value to set.
  1668. * @returns {Object} Returns the map cache instance.
  1669. */
  1670. function mapCacheSet(key, value) {
  1671. getMapData(this, key).set(key, value);
  1672. return this;
  1673. }
  1674. // Add methods to `MapCache`.
  1675. MapCache.prototype.clear = mapCacheClear;
  1676. MapCache.prototype['delete'] = mapCacheDelete;
  1677. MapCache.prototype.get = mapCacheGet;
  1678. MapCache.prototype.has = mapCacheHas;
  1679. MapCache.prototype.set = mapCacheSet;
  1680. /**
  1681. *
  1682. * Creates an array cache object to store unique values.
  1683. *
  1684. * @private
  1685. * @constructor
  1686. * @param {Array} [values] The values to cache.
  1687. */
  1688. function SetCache(values) {
  1689. var index = -1,
  1690. length = values ? values.length : 0;
  1691. this.__data__ = new MapCache;
  1692. while (++index < length) {
  1693. this.add(values[index]);
  1694. }
  1695. }
  1696. /**
  1697. * Adds `value` to the array cache.
  1698. *
  1699. * @private
  1700. * @name add
  1701. * @memberOf SetCache
  1702. * @alias push
  1703. * @param {*} value The value to cache.
  1704. * @returns {Object} Returns the cache instance.
  1705. */
  1706. function setCacheAdd(value) {
  1707. this.__data__.set(value, HASH_UNDEFINED);
  1708. return this;
  1709. }
  1710. /**
  1711. * Checks if `value` is in the array cache.
  1712. *
  1713. * @private
  1714. * @name has
  1715. * @memberOf SetCache
  1716. * @param {*} value The value to search for.
  1717. * @returns {number} Returns `true` if `value` is found, else `false`.
  1718. */
  1719. function setCacheHas(value) {
  1720. return this.__data__.has(value);
  1721. }
  1722. // Add methods to `SetCache`.
  1723. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1724. SetCache.prototype.has = setCacheHas;
  1725. /**
  1726. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1727. *
  1728. * @private
  1729. * @param {Array} array The array to inspect.
  1730. * @param {*} key The key to search for.
  1731. * @returns {number} Returns the index of the matched value, else `-1`.
  1732. */
  1733. function assocIndexOf(array, key) {
  1734. var length = array.length;
  1735. while (length--) {
  1736. if (eq(array[length][0], key)) {
  1737. return length;
  1738. }
  1739. }
  1740. return -1;
  1741. }
  1742. /**
  1743. * The base implementation of `_.isNative` without bad shim checks.
  1744. *
  1745. * @private
  1746. * @param {*} value The value to check.
  1747. * @returns {boolean} Returns `true` if `value` is a native function,
  1748. * else `false`.
  1749. */
  1750. function baseIsNative(value) {
  1751. if (!isObject(value) || isMasked(value)) {
  1752. return false;
  1753. }
  1754. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1755. return pattern.test(toSource(value));
  1756. }
  1757. /**
  1758. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1759. *
  1760. * @private
  1761. * @param {Array} array The array to inspect.
  1762. * @param {Function} [iteratee] The iteratee invoked per element.
  1763. * @param {Function} [comparator] The comparator invoked per element.
  1764. * @returns {Array} Returns the new duplicate free array.
  1765. */
  1766. function baseUniq(array, iteratee, comparator) {
  1767. var index = -1,
  1768. includes = arrayIncludes,
  1769. length = array.length,
  1770. isCommon = true,
  1771. result = [],
  1772. seen = result;
  1773. if (comparator) {
  1774. isCommon = false;
  1775. includes = arrayIncludesWith;
  1776. }
  1777. else if (length >= LARGE_ARRAY_SIZE) {
  1778. var set = iteratee ? null : createSet(array);
  1779. if (set) {
  1780. return setToArray(set);
  1781. }
  1782. isCommon = false;
  1783. includes = cacheHas;
  1784. seen = new SetCache;
  1785. }
  1786. else {
  1787. seen = iteratee ? [] : result;
  1788. }
  1789. outer:
  1790. while (++index < length) {
  1791. var value = array[index],
  1792. computed = iteratee ? iteratee(value) : value;
  1793. value = (comparator || value !== 0) ? value : 0;
  1794. if (isCommon && computed === computed) {
  1795. var seenIndex = seen.length;
  1796. while (seenIndex--) {
  1797. if (seen[seenIndex] === computed) {
  1798. continue outer;
  1799. }
  1800. }
  1801. if (iteratee) {
  1802. seen.push(computed);
  1803. }
  1804. result.push(value);
  1805. }
  1806. else if (!includes(seen, computed, comparator)) {
  1807. if (seen !== result) {
  1808. seen.push(computed);
  1809. }
  1810. result.push(value);
  1811. }
  1812. }
  1813. return result;
  1814. }
  1815. /**
  1816. * Creates a set object of `values`.
  1817. *
  1818. * @private
  1819. * @param {Array} values The values to add to the set.
  1820. * @returns {Object} Returns the new set.
  1821. */
  1822. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1823. return new Set(values);
  1824. };
  1825. /**
  1826. * Gets the data for `map`.
  1827. *
  1828. * @private
  1829. * @param {Object} map The map to query.
  1830. * @param {string} key The reference key.
  1831. * @returns {*} Returns the map data.
  1832. */
  1833. function getMapData(map, key) {
  1834. var data = map.__data__;
  1835. return isKeyable(key)
  1836. ? data[typeof key == 'string' ? 'string' : 'hash']
  1837. : data.map;
  1838. }
  1839. /**
  1840. * Gets the native function at `key` of `object`.
  1841. *
  1842. * @private
  1843. * @param {Object} object The object to query.
  1844. * @param {string} key The key of the method to get.
  1845. * @returns {*} Returns the function if it's native, else `undefined`.
  1846. */
  1847. function getNative(object, key) {
  1848. var value = getValue(object, key);
  1849. return baseIsNative(value) ? value : undefined;
  1850. }
  1851. /**
  1852. * Checks if `value` is suitable for use as unique object key.
  1853. *
  1854. * @private
  1855. * @param {*} value The value to check.
  1856. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1857. */
  1858. function isKeyable(value) {
  1859. var type = typeof value;
  1860. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1861. ? (value !== '__proto__')
  1862. : (value === null);
  1863. }
  1864. /**
  1865. * Checks if `func` has its source masked.
  1866. *
  1867. * @private
  1868. * @param {Function} func The function to check.
  1869. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1870. */
  1871. function isMasked(func) {
  1872. return !!maskSrcKey && (maskSrcKey in func);
  1873. }
  1874. /**
  1875. * Converts `func` to its source code.
  1876. *
  1877. * @private
  1878. * @param {Function} func The function to process.
  1879. * @returns {string} Returns the source code.
  1880. */
  1881. function toSource(func) {
  1882. if (func != null) {
  1883. try {
  1884. return funcToString.call(func);
  1885. } catch (e) {}
  1886. try {
  1887. return (func + '');
  1888. } catch (e) {}
  1889. }
  1890. return '';
  1891. }
  1892. /**
  1893. * Creates a duplicate-free version of an array, using
  1894. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1895. * for equality comparisons, in which only the first occurrence of each
  1896. * element is kept.
  1897. *
  1898. * @static
  1899. * @memberOf _
  1900. * @since 0.1.0
  1901. * @category Array
  1902. * @param {Array} array The array to inspect.
  1903. * @returns {Array} Returns the new duplicate free array.
  1904. * @example
  1905. *
  1906. * _.uniq([2, 1, 2]);
  1907. * // => [2, 1]
  1908. */
  1909. function uniq(array) {
  1910. return (array && array.length)
  1911. ? baseUniq(array)
  1912. : [];
  1913. }
  1914. /**
  1915. * Performs a
  1916. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1917. * comparison between two values to determine if they are equivalent.
  1918. *
  1919. * @static
  1920. * @memberOf _
  1921. * @since 4.0.0
  1922. * @category Lang
  1923. * @param {*} value The value to compare.
  1924. * @param {*} other The other value to compare.
  1925. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1926. * @example
  1927. *
  1928. * var object = { 'a': 1 };
  1929. * var other = { 'a': 1 };
  1930. *
  1931. * _.eq(object, object);
  1932. * // => true
  1933. *
  1934. * _.eq(object, other);
  1935. * // => false
  1936. *
  1937. * _.eq('a', 'a');
  1938. * // => true
  1939. *
  1940. * _.eq('a', Object('a'));
  1941. * // => false
  1942. *
  1943. * _.eq(NaN, NaN);
  1944. * // => true
  1945. */
  1946. function eq(value, other) {
  1947. return value === other || (value !== value && other !== other);
  1948. }
  1949. /**
  1950. * Checks if `value` is classified as a `Function` object.
  1951. *
  1952. * @static
  1953. * @memberOf _
  1954. * @since 0.1.0
  1955. * @category Lang
  1956. * @param {*} value The value to check.
  1957. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1958. * @example
  1959. *
  1960. * _.isFunction(_);
  1961. * // => true
  1962. *
  1963. * _.isFunction(/abc/);
  1964. * // => false
  1965. */
  1966. function isFunction(value) {
  1967. // The use of `Object#toString` avoids issues with the `typeof` operator
  1968. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  1969. var tag = isObject(value) ? objectToString.call(value) : '';
  1970. return tag == funcTag || tag == genTag;
  1971. }
  1972. /**
  1973. * Checks if `value` is the
  1974. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1975. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1976. *
  1977. * @static
  1978. * @memberOf _
  1979. * @since 0.1.0
  1980. * @category Lang
  1981. * @param {*} value The value to check.
  1982. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1983. * @example
  1984. *
  1985. * _.isObject({});
  1986. * // => true
  1987. *
  1988. * _.isObject([1, 2, 3]);
  1989. * // => true
  1990. *
  1991. * _.isObject(_.noop);
  1992. * // => true
  1993. *
  1994. * _.isObject(null);
  1995. * // => false
  1996. */
  1997. function isObject(value) {
  1998. var type = typeof value;
  1999. return !!value && (type == 'object' || type == 'function');
  2000. }
  2001. /**
  2002. * This method returns `undefined`.
  2003. *
  2004. * @static
  2005. * @memberOf _
  2006. * @since 2.3.0
  2007. * @category Util
  2008. * @example
  2009. *
  2010. * _.times(2, _.noop);
  2011. * // => [undefined, undefined]
  2012. */
  2013. function noop() {
  2014. // No operation performed.
  2015. }
  2016. module.exports = uniq;
  2017. /***/ }),
  2018. /***/ 129:
  2019. /***/ (function(module) {
  2020. module.exports = require("child_process");
  2021. /***/ }),
  2022. /***/ 139:
  2023. /***/ (function(module, __unusedexports, __webpack_require__) {
  2024. // Unique ID creation requires a high quality random # generator. In node.js
  2025. // this is pretty straight-forward - we use the crypto API.
  2026. var crypto = __webpack_require__(417);
  2027. module.exports = function nodeRNG() {
  2028. return crypto.randomBytes(16);
  2029. };
  2030. /***/ }),
  2031. /***/ 141:
  2032. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2033. "use strict";
  2034. var net = __webpack_require__(631);
  2035. var tls = __webpack_require__(16);
  2036. var http = __webpack_require__(605);
  2037. var https = __webpack_require__(211);
  2038. var events = __webpack_require__(614);
  2039. var assert = __webpack_require__(357);
  2040. var util = __webpack_require__(669);
  2041. exports.httpOverHttp = httpOverHttp;
  2042. exports.httpsOverHttp = httpsOverHttp;
  2043. exports.httpOverHttps = httpOverHttps;
  2044. exports.httpsOverHttps = httpsOverHttps;
  2045. function httpOverHttp(options) {
  2046. var agent = new TunnelingAgent(options);
  2047. agent.request = http.request;
  2048. return agent;
  2049. }
  2050. function httpsOverHttp(options) {
  2051. var agent = new TunnelingAgent(options);
  2052. agent.request = http.request;
  2053. agent.createSocket = createSecureSocket;
  2054. return agent;
  2055. }
  2056. function httpOverHttps(options) {
  2057. var agent = new TunnelingAgent(options);
  2058. agent.request = https.request;
  2059. return agent;
  2060. }
  2061. function httpsOverHttps(options) {
  2062. var agent = new TunnelingAgent(options);
  2063. agent.request = https.request;
  2064. agent.createSocket = createSecureSocket;
  2065. return agent;
  2066. }
  2067. function TunnelingAgent(options) {
  2068. var self = this;
  2069. self.options = options || {};
  2070. self.proxyOptions = self.options.proxy || {};
  2071. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2072. self.requests = [];
  2073. self.sockets = [];
  2074. self.on('free', function onFree(socket, host, port, localAddress) {
  2075. var options = toOptions(host, port, localAddress);
  2076. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2077. var pending = self.requests[i];
  2078. if (pending.host === options.host && pending.port === options.port) {
  2079. // Detect the request to connect same origin server,
  2080. // reuse the connection.
  2081. self.requests.splice(i, 1);
  2082. pending.request.onSocket(socket);
  2083. return;
  2084. }
  2085. }
  2086. socket.destroy();
  2087. self.removeSocket(socket);
  2088. });
  2089. }
  2090. util.inherits(TunnelingAgent, events.EventEmitter);
  2091. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2092. var self = this;
  2093. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2094. if (self.sockets.length >= this.maxSockets) {
  2095. // We are over limit so we'll add it to the queue.
  2096. self.requests.push(options);
  2097. return;
  2098. }
  2099. // If we are under maxSockets create a new one.
  2100. self.createSocket(options, function(socket) {
  2101. socket.on('free', onFree);
  2102. socket.on('close', onCloseOrRemove);
  2103. socket.on('agentRemove', onCloseOrRemove);
  2104. req.onSocket(socket);
  2105. function onFree() {
  2106. self.emit('free', socket, options);
  2107. }
  2108. function onCloseOrRemove(err) {
  2109. self.removeSocket(socket);
  2110. socket.removeListener('free', onFree);
  2111. socket.removeListener('close', onCloseOrRemove);
  2112. socket.removeListener('agentRemove', onCloseOrRemove);
  2113. }
  2114. });
  2115. };
  2116. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2117. var self = this;
  2118. var placeholder = {};
  2119. self.sockets.push(placeholder);
  2120. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2121. method: 'CONNECT',
  2122. path: options.host + ':' + options.port,
  2123. agent: false
  2124. });
  2125. if (connectOptions.proxyAuth) {
  2126. connectOptions.headers = connectOptions.headers || {};
  2127. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2128. new Buffer(connectOptions.proxyAuth).toString('base64');
  2129. }
  2130. debug('making CONNECT request');
  2131. var connectReq = self.request(connectOptions);
  2132. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2133. connectReq.once('response', onResponse); // for v0.6
  2134. connectReq.once('upgrade', onUpgrade); // for v0.6
  2135. connectReq.once('connect', onConnect); // for v0.7 or later
  2136. connectReq.once('error', onError);
  2137. connectReq.end();
  2138. function onResponse(res) {
  2139. // Very hacky. This is necessary to avoid http-parser leaks.
  2140. res.upgrade = true;
  2141. }
  2142. function onUpgrade(res, socket, head) {
  2143. // Hacky.
  2144. process.nextTick(function() {
  2145. onConnect(res, socket, head);
  2146. });
  2147. }
  2148. function onConnect(res, socket, head) {
  2149. connectReq.removeAllListeners();
  2150. socket.removeAllListeners();
  2151. if (res.statusCode === 200) {
  2152. assert.equal(head.length, 0);
  2153. debug('tunneling connection has established');
  2154. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2155. cb(socket);
  2156. } else {
  2157. debug('tunneling socket could not be established, statusCode=%d',
  2158. res.statusCode);
  2159. var error = new Error('tunneling socket could not be established, ' +
  2160. 'statusCode=' + res.statusCode);
  2161. error.code = 'ECONNRESET';
  2162. options.request.emit('error', error);
  2163. self.removeSocket(placeholder);
  2164. }
  2165. }
  2166. function onError(cause) {
  2167. connectReq.removeAllListeners();
  2168. debug('tunneling socket could not be established, cause=%s\n',
  2169. cause.message, cause.stack);
  2170. var error = new Error('tunneling socket could not be established, ' +
  2171. 'cause=' + cause.message);
  2172. error.code = 'ECONNRESET';
  2173. options.request.emit('error', error);
  2174. self.removeSocket(placeholder);
  2175. }
  2176. };
  2177. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2178. var pos = this.sockets.indexOf(socket)
  2179. if (pos === -1) {
  2180. return;
  2181. }
  2182. this.sockets.splice(pos, 1);
  2183. var pending = this.requests.shift();
  2184. if (pending) {
  2185. // If we have pending requests and a socket gets closed a new one
  2186. // needs to be created to take over in the pool for the one that closed.
  2187. this.createSocket(pending, function(socket) {
  2188. pending.request.onSocket(socket);
  2189. });
  2190. }
  2191. };
  2192. function createSecureSocket(options, cb) {
  2193. var self = this;
  2194. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2195. var hostHeader = options.request.getHeader('host');
  2196. var tlsOptions = mergeOptions({}, self.options, {
  2197. socket: socket,
  2198. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2199. });
  2200. // 0 is dummy port for v0.6
  2201. var secureSocket = tls.connect(0, tlsOptions);
  2202. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2203. cb(secureSocket);
  2204. });
  2205. }
  2206. function toOptions(host, port, localAddress) {
  2207. if (typeof host === 'string') { // since v0.10
  2208. return {
  2209. host: host,
  2210. port: port,
  2211. localAddress: localAddress
  2212. };
  2213. }
  2214. return host; // for v0.11 or later
  2215. }
  2216. function mergeOptions(target) {
  2217. for (var i = 1, len = arguments.length; i < len; ++i) {
  2218. var overrides = arguments[i];
  2219. if (typeof overrides === 'object') {
  2220. var keys = Object.keys(overrides);
  2221. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2222. var k = keys[j];
  2223. if (overrides[k] !== undefined) {
  2224. target[k] = overrides[k];
  2225. }
  2226. }
  2227. }
  2228. }
  2229. return target;
  2230. }
  2231. var debug;
  2232. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2233. debug = function() {
  2234. var args = Array.prototype.slice.call(arguments);
  2235. if (typeof args[0] === 'string') {
  2236. args[0] = 'TUNNEL: ' + args[0];
  2237. } else {
  2238. args.unshift('TUNNEL:');
  2239. }
  2240. console.error.apply(console, args);
  2241. }
  2242. } else {
  2243. debug = function() {};
  2244. }
  2245. exports.debug = debug; // for test
  2246. /***/ }),
  2247. /***/ 143:
  2248. /***/ (function(module, __unusedexports, __webpack_require__) {
  2249. module.exports = withAuthorizationPrefix;
  2250. const atob = __webpack_require__(368);
  2251. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2252. function withAuthorizationPrefix(authorization) {
  2253. if (/^(basic|bearer|token) /i.test(authorization)) {
  2254. return authorization;
  2255. }
  2256. try {
  2257. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2258. return `basic ${authorization}`;
  2259. }
  2260. } catch (error) {}
  2261. if (authorization.split(/\./).length === 3) {
  2262. return `bearer ${authorization}`;
  2263. }
  2264. return `token ${authorization}`;
  2265. }
  2266. /***/ }),
  2267. /***/ 145:
  2268. /***/ (function(module, __unusedexports, __webpack_require__) {
  2269. "use strict";
  2270. const pump = __webpack_require__(453);
  2271. const bufferStream = __webpack_require__(966);
  2272. class MaxBufferError extends Error {
  2273. constructor() {
  2274. super('maxBuffer exceeded');
  2275. this.name = 'MaxBufferError';
  2276. }
  2277. }
  2278. function getStream(inputStream, options) {
  2279. if (!inputStream) {
  2280. return Promise.reject(new Error('Expected a stream'));
  2281. }
  2282. options = Object.assign({maxBuffer: Infinity}, options);
  2283. const {maxBuffer} = options;
  2284. let stream;
  2285. return new Promise((resolve, reject) => {
  2286. const rejectPromise = error => {
  2287. if (error) { // A null check
  2288. error.bufferedData = stream.getBufferedValue();
  2289. }
  2290. reject(error);
  2291. };
  2292. stream = pump(inputStream, bufferStream(options), error => {
  2293. if (error) {
  2294. rejectPromise(error);
  2295. return;
  2296. }
  2297. resolve();
  2298. });
  2299. stream.on('data', () => {
  2300. if (stream.getBufferedLength() > maxBuffer) {
  2301. rejectPromise(new MaxBufferError());
  2302. }
  2303. });
  2304. }).then(() => stream.getBufferedValue());
  2305. }
  2306. module.exports = getStream;
  2307. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2308. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2309. module.exports.MaxBufferError = MaxBufferError;
  2310. /***/ }),
  2311. /***/ 148:
  2312. /***/ (function(module, __unusedexports, __webpack_require__) {
  2313. module.exports = paginatePlugin;
  2314. const iterator = __webpack_require__(8);
  2315. const paginate = __webpack_require__(807);
  2316. function paginatePlugin(octokit) {
  2317. octokit.paginate = paginate.bind(null, octokit);
  2318. octokit.paginate.iterator = iterator.bind(null, octokit);
  2319. }
  2320. /***/ }),
  2321. /***/ 153:
  2322. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2323. "use strict";
  2324. var __importStar = (this && this.__importStar) || function (mod) {
  2325. if (mod && mod.__esModule) return mod;
  2326. var result = {};
  2327. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2328. result["default"] = mod;
  2329. return result;
  2330. };
  2331. Object.defineProperty(exports, "__esModule", { value: true });
  2332. const coreCommand = __importStar(__webpack_require__(431));
  2333. /**
  2334. * Indicates whether the POST action is running
  2335. */
  2336. exports.IsPost = !!process.env['STATE_isPost'];
  2337. /**
  2338. * The repository path for the POST action. The value is empty during the MAIN action.
  2339. */
  2340. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2341. /**
  2342. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2343. */
  2344. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  2345. /**
  2346. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2347. */
  2348. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  2349. /**
  2350. * Save the repository path so the POST action can retrieve the value.
  2351. */
  2352. function setRepositoryPath(repositoryPath) {
  2353. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2354. }
  2355. exports.setRepositoryPath = setRepositoryPath;
  2356. /**
  2357. * Save the SSH key path so the POST action can retrieve the value.
  2358. */
  2359. function setSshKeyPath(sshKeyPath) {
  2360. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  2361. }
  2362. exports.setSshKeyPath = setSshKeyPath;
  2363. /**
  2364. * Save the SSH known hosts path so the POST action can retrieve the value.
  2365. */
  2366. function setSshKnownHostsPath(sshKnownHostsPath) {
  2367. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  2368. }
  2369. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2370. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2371. // This is necessary since we don't have a separate entry point.
  2372. if (!exports.IsPost) {
  2373. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2374. }
  2375. /***/ }),
  2376. /***/ 168:
  2377. /***/ (function(module) {
  2378. "use strict";
  2379. const alias = ['stdin', 'stdout', 'stderr'];
  2380. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2381. module.exports = opts => {
  2382. if (!opts) {
  2383. return null;
  2384. }
  2385. if (opts.stdio && hasAlias(opts)) {
  2386. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2387. }
  2388. if (typeof opts.stdio === 'string') {
  2389. return opts.stdio;
  2390. }
  2391. const stdio = opts.stdio || [];
  2392. if (!Array.isArray(stdio)) {
  2393. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2394. }
  2395. const result = [];
  2396. const len = Math.max(stdio.length, alias.length);
  2397. for (let i = 0; i < len; i++) {
  2398. let value = null;
  2399. if (stdio[i] !== undefined) {
  2400. value = stdio[i];
  2401. } else if (opts[alias[i]] !== undefined) {
  2402. value = opts[alias[i]];
  2403. }
  2404. result[i] = value;
  2405. }
  2406. return result;
  2407. };
  2408. /***/ }),
  2409. /***/ 179:
  2410. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2411. "use strict";
  2412. var net = __webpack_require__(631);
  2413. var tls = __webpack_require__(16);
  2414. var http = __webpack_require__(605);
  2415. var https = __webpack_require__(211);
  2416. var events = __webpack_require__(614);
  2417. var assert = __webpack_require__(357);
  2418. var util = __webpack_require__(669);
  2419. exports.httpOverHttp = httpOverHttp;
  2420. exports.httpsOverHttp = httpsOverHttp;
  2421. exports.httpOverHttps = httpOverHttps;
  2422. exports.httpsOverHttps = httpsOverHttps;
  2423. function httpOverHttp(options) {
  2424. var agent = new TunnelingAgent(options);
  2425. agent.request = http.request;
  2426. return agent;
  2427. }
  2428. function httpsOverHttp(options) {
  2429. var agent = new TunnelingAgent(options);
  2430. agent.request = http.request;
  2431. agent.createSocket = createSecureSocket;
  2432. agent.defaultPort = 443;
  2433. return agent;
  2434. }
  2435. function httpOverHttps(options) {
  2436. var agent = new TunnelingAgent(options);
  2437. agent.request = https.request;
  2438. return agent;
  2439. }
  2440. function httpsOverHttps(options) {
  2441. var agent = new TunnelingAgent(options);
  2442. agent.request = https.request;
  2443. agent.createSocket = createSecureSocket;
  2444. agent.defaultPort = 443;
  2445. return agent;
  2446. }
  2447. function TunnelingAgent(options) {
  2448. var self = this;
  2449. self.options = options || {};
  2450. self.proxyOptions = self.options.proxy || {};
  2451. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2452. self.requests = [];
  2453. self.sockets = [];
  2454. self.on('free', function onFree(socket, host, port, localAddress) {
  2455. var options = toOptions(host, port, localAddress);
  2456. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2457. var pending = self.requests[i];
  2458. if (pending.host === options.host && pending.port === options.port) {
  2459. // Detect the request to connect same origin server,
  2460. // reuse the connection.
  2461. self.requests.splice(i, 1);
  2462. pending.request.onSocket(socket);
  2463. return;
  2464. }
  2465. }
  2466. socket.destroy();
  2467. self.removeSocket(socket);
  2468. });
  2469. }
  2470. util.inherits(TunnelingAgent, events.EventEmitter);
  2471. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2472. var self = this;
  2473. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2474. if (self.sockets.length >= this.maxSockets) {
  2475. // We are over limit so we'll add it to the queue.
  2476. self.requests.push(options);
  2477. return;
  2478. }
  2479. // If we are under maxSockets create a new one.
  2480. self.createSocket(options, function(socket) {
  2481. socket.on('free', onFree);
  2482. socket.on('close', onCloseOrRemove);
  2483. socket.on('agentRemove', onCloseOrRemove);
  2484. req.onSocket(socket);
  2485. function onFree() {
  2486. self.emit('free', socket, options);
  2487. }
  2488. function onCloseOrRemove(err) {
  2489. self.removeSocket(socket);
  2490. socket.removeListener('free', onFree);
  2491. socket.removeListener('close', onCloseOrRemove);
  2492. socket.removeListener('agentRemove', onCloseOrRemove);
  2493. }
  2494. });
  2495. };
  2496. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2497. var self = this;
  2498. var placeholder = {};
  2499. self.sockets.push(placeholder);
  2500. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2501. method: 'CONNECT',
  2502. path: options.host + ':' + options.port,
  2503. agent: false,
  2504. headers: {
  2505. host: options.host + ':' + options.port
  2506. }
  2507. });
  2508. if (options.localAddress) {
  2509. connectOptions.localAddress = options.localAddress;
  2510. }
  2511. if (connectOptions.proxyAuth) {
  2512. connectOptions.headers = connectOptions.headers || {};
  2513. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2514. new Buffer(connectOptions.proxyAuth).toString('base64');
  2515. }
  2516. debug('making CONNECT request');
  2517. var connectReq = self.request(connectOptions);
  2518. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2519. connectReq.once('response', onResponse); // for v0.6
  2520. connectReq.once('upgrade', onUpgrade); // for v0.6
  2521. connectReq.once('connect', onConnect); // for v0.7 or later
  2522. connectReq.once('error', onError);
  2523. connectReq.end();
  2524. function onResponse(res) {
  2525. // Very hacky. This is necessary to avoid http-parser leaks.
  2526. res.upgrade = true;
  2527. }
  2528. function onUpgrade(res, socket, head) {
  2529. // Hacky.
  2530. process.nextTick(function() {
  2531. onConnect(res, socket, head);
  2532. });
  2533. }
  2534. function onConnect(res, socket, head) {
  2535. connectReq.removeAllListeners();
  2536. socket.removeAllListeners();
  2537. if (res.statusCode !== 200) {
  2538. debug('tunneling socket could not be established, statusCode=%d',
  2539. res.statusCode);
  2540. socket.destroy();
  2541. var error = new Error('tunneling socket could not be established, ' +
  2542. 'statusCode=' + res.statusCode);
  2543. error.code = 'ECONNRESET';
  2544. options.request.emit('error', error);
  2545. self.removeSocket(placeholder);
  2546. return;
  2547. }
  2548. if (head.length > 0) {
  2549. debug('got illegal response body from proxy');
  2550. socket.destroy();
  2551. var error = new Error('got illegal response body from proxy');
  2552. error.code = 'ECONNRESET';
  2553. options.request.emit('error', error);
  2554. self.removeSocket(placeholder);
  2555. return;
  2556. }
  2557. debug('tunneling connection has established');
  2558. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2559. return cb(socket);
  2560. }
  2561. function onError(cause) {
  2562. connectReq.removeAllListeners();
  2563. debug('tunneling socket could not be established, cause=%s\n',
  2564. cause.message, cause.stack);
  2565. var error = new Error('tunneling socket could not be established, ' +
  2566. 'cause=' + cause.message);
  2567. error.code = 'ECONNRESET';
  2568. options.request.emit('error', error);
  2569. self.removeSocket(placeholder);
  2570. }
  2571. };
  2572. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2573. var pos = this.sockets.indexOf(socket)
  2574. if (pos === -1) {
  2575. return;
  2576. }
  2577. this.sockets.splice(pos, 1);
  2578. var pending = this.requests.shift();
  2579. if (pending) {
  2580. // If we have pending requests and a socket gets closed a new one
  2581. // needs to be created to take over in the pool for the one that closed.
  2582. this.createSocket(pending, function(socket) {
  2583. pending.request.onSocket(socket);
  2584. });
  2585. }
  2586. };
  2587. function createSecureSocket(options, cb) {
  2588. var self = this;
  2589. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2590. var hostHeader = options.request.getHeader('host');
  2591. var tlsOptions = mergeOptions({}, self.options, {
  2592. socket: socket,
  2593. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2594. });
  2595. // 0 is dummy port for v0.6
  2596. var secureSocket = tls.connect(0, tlsOptions);
  2597. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2598. cb(secureSocket);
  2599. });
  2600. }
  2601. function toOptions(host, port, localAddress) {
  2602. if (typeof host === 'string') { // since v0.10
  2603. return {
  2604. host: host,
  2605. port: port,
  2606. localAddress: localAddress
  2607. };
  2608. }
  2609. return host; // for v0.11 or later
  2610. }
  2611. function mergeOptions(target) {
  2612. for (var i = 1, len = arguments.length; i < len; ++i) {
  2613. var overrides = arguments[i];
  2614. if (typeof overrides === 'object') {
  2615. var keys = Object.keys(overrides);
  2616. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2617. var k = keys[j];
  2618. if (overrides[k] !== undefined) {
  2619. target[k] = overrides[k];
  2620. }
  2621. }
  2622. }
  2623. }
  2624. return target;
  2625. }
  2626. var debug;
  2627. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2628. debug = function() {
  2629. var args = Array.prototype.slice.call(arguments);
  2630. if (typeof args[0] === 'string') {
  2631. args[0] = 'TUNNEL: ' + args[0];
  2632. } else {
  2633. args.unshift('TUNNEL:');
  2634. }
  2635. console.error.apply(console, args);
  2636. }
  2637. } else {
  2638. debug = function() {};
  2639. }
  2640. exports.debug = debug; // for test
  2641. /***/ }),
  2642. /***/ 190:
  2643. /***/ (function(module, __unusedexports, __webpack_require__) {
  2644. module.exports = authenticationPlugin;
  2645. const { createTokenAuth } = __webpack_require__(813);
  2646. const { Deprecation } = __webpack_require__(692);
  2647. const once = __webpack_require__(969);
  2648. const beforeRequest = __webpack_require__(863);
  2649. const requestError = __webpack_require__(991);
  2650. const validate = __webpack_require__(954);
  2651. const withAuthorizationPrefix = __webpack_require__(143);
  2652. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2653. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2654. function authenticationPlugin(octokit, options) {
  2655. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2656. if (options.authStrategy) {
  2657. const auth = options.authStrategy(options.auth);
  2658. octokit.hook.wrap("request", auth.hook);
  2659. octokit.auth = auth;
  2660. return;
  2661. }
  2662. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2663. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2664. if (!options.auth) {
  2665. octokit.auth = () =>
  2666. Promise.resolve({
  2667. type: "unauthenticated"
  2668. });
  2669. return;
  2670. }
  2671. const isBasicAuthString =
  2672. typeof options.auth === "string" &&
  2673. /^basic/.test(withAuthorizationPrefix(options.auth));
  2674. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2675. if (typeof options.auth === "string" && !isBasicAuthString) {
  2676. const auth = createTokenAuth(options.auth);
  2677. octokit.hook.wrap("request", auth.hook);
  2678. octokit.auth = auth;
  2679. return;
  2680. }
  2681. // Otherwise log a deprecation message
  2682. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2683. ? [
  2684. deprecateAuthBasic,
  2685. '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)'
  2686. ]
  2687. : [
  2688. deprecateAuthObject,
  2689. '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)'
  2690. ];
  2691. deprecationMethod(
  2692. octokit.log,
  2693. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2694. );
  2695. octokit.auth = () =>
  2696. Promise.resolve({
  2697. type: "deprecated",
  2698. message: deprecationMessapge
  2699. });
  2700. validate(options.auth);
  2701. const state = {
  2702. octokit,
  2703. auth: options.auth
  2704. };
  2705. octokit.hook.before("request", beforeRequest.bind(null, state));
  2706. octokit.hook.error("request", requestError.bind(null, state));
  2707. }
  2708. /***/ }),
  2709. /***/ 197:
  2710. /***/ (function(module, __unusedexports, __webpack_require__) {
  2711. module.exports = isexe
  2712. isexe.sync = sync
  2713. var fs = __webpack_require__(747)
  2714. function isexe (path, options, cb) {
  2715. fs.stat(path, function (er, stat) {
  2716. cb(er, er ? false : checkStat(stat, options))
  2717. })
  2718. }
  2719. function sync (path, options) {
  2720. return checkStat(fs.statSync(path), options)
  2721. }
  2722. function checkStat (stat, options) {
  2723. return stat.isFile() && checkMode(stat, options)
  2724. }
  2725. function checkMode (stat, options) {
  2726. var mod = stat.mode
  2727. var uid = stat.uid
  2728. var gid = stat.gid
  2729. var myUid = options.uid !== undefined ?
  2730. options.uid : process.getuid && process.getuid()
  2731. var myGid = options.gid !== undefined ?
  2732. options.gid : process.getgid && process.getgid()
  2733. var u = parseInt('100', 8)
  2734. var g = parseInt('010', 8)
  2735. var o = parseInt('001', 8)
  2736. var ug = u | g
  2737. var ret = (mod & o) ||
  2738. (mod & g) && gid === myGid ||
  2739. (mod & u) && uid === myUid ||
  2740. (mod & ug) && myUid === 0
  2741. return ret
  2742. }
  2743. /***/ }),
  2744. /***/ 198:
  2745. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2746. "use strict";
  2747. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2748. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2749. return new (P || (P = Promise))(function (resolve, reject) {
  2750. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2751. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2752. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2753. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2754. });
  2755. };
  2756. var __importStar = (this && this.__importStar) || function (mod) {
  2757. if (mod && mod.__esModule) return mod;
  2758. var result = {};
  2759. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2760. result["default"] = mod;
  2761. return result;
  2762. };
  2763. Object.defineProperty(exports, "__esModule", { value: true });
  2764. const core = __importStar(__webpack_require__(470));
  2765. const coreCommand = __importStar(__webpack_require__(431));
  2766. const gitSourceProvider = __importStar(__webpack_require__(293));
  2767. const inputHelper = __importStar(__webpack_require__(821));
  2768. const path = __importStar(__webpack_require__(622));
  2769. const stateHelper = __importStar(__webpack_require__(153));
  2770. function run() {
  2771. return __awaiter(this, void 0, void 0, function* () {
  2772. try {
  2773. const sourceSettings = inputHelper.getInputs();
  2774. try {
  2775. // Register problem matcher
  2776. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2777. // Get sources
  2778. yield gitSourceProvider.getSource(sourceSettings);
  2779. }
  2780. finally {
  2781. // Unregister problem matcher
  2782. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2783. }
  2784. }
  2785. catch (error) {
  2786. core.setFailed(error.message);
  2787. }
  2788. });
  2789. }
  2790. function cleanup() {
  2791. return __awaiter(this, void 0, void 0, function* () {
  2792. try {
  2793. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2794. }
  2795. catch (error) {
  2796. core.warning(error.message);
  2797. }
  2798. });
  2799. }
  2800. // Main
  2801. if (!stateHelper.IsPost) {
  2802. run();
  2803. }
  2804. // Post
  2805. else {
  2806. cleanup();
  2807. }
  2808. /***/ }),
  2809. /***/ 211:
  2810. /***/ (function(module) {
  2811. module.exports = require("https");
  2812. /***/ }),
  2813. /***/ 215:
  2814. /***/ (function(module) {
  2815. 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"};
  2816. /***/ }),
  2817. /***/ 227:
  2818. /***/ (function(__unusedmodule, exports) {
  2819. "use strict";
  2820. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2821. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2822. return new (P || (P = Promise))(function (resolve, reject) {
  2823. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2824. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2825. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2826. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2827. });
  2828. };
  2829. Object.defineProperty(exports, "__esModule", { value: true });
  2830. function getCheckoutInfo(git, ref, commit) {
  2831. return __awaiter(this, void 0, void 0, function* () {
  2832. if (!git) {
  2833. throw new Error('Arg git cannot be empty');
  2834. }
  2835. if (!ref && !commit) {
  2836. throw new Error('Args ref and commit cannot both be empty');
  2837. }
  2838. const result = {};
  2839. const upperRef = (ref || '').toUpperCase();
  2840. // SHA only
  2841. if (!ref) {
  2842. result.ref = commit;
  2843. }
  2844. // refs/heads/
  2845. else if (upperRef.startsWith('REFS/HEADS/')) {
  2846. const branch = ref.substring('refs/heads/'.length);
  2847. result.ref = branch;
  2848. result.startPoint = `refs/remotes/origin/${branch}`;
  2849. }
  2850. // refs/pull/
  2851. else if (upperRef.startsWith('REFS/PULL/')) {
  2852. const branch = ref.substring('refs/pull/'.length);
  2853. result.ref = `refs/remotes/pull/${branch}`;
  2854. }
  2855. // refs/tags/
  2856. else if (upperRef.startsWith('REFS/')) {
  2857. result.ref = ref;
  2858. }
  2859. // Unqualified ref, check for a matching branch or tag
  2860. else {
  2861. if (yield git.branchExists(true, `origin/${ref}`)) {
  2862. result.ref = ref;
  2863. result.startPoint = `refs/remotes/origin/${ref}`;
  2864. }
  2865. else if (yield git.tagExists(`${ref}`)) {
  2866. result.ref = `refs/tags/${ref}`;
  2867. }
  2868. else {
  2869. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2870. }
  2871. }
  2872. return result;
  2873. });
  2874. }
  2875. exports.getCheckoutInfo = getCheckoutInfo;
  2876. function getRefSpec(ref, commit) {
  2877. if (!ref && !commit) {
  2878. throw new Error('Args ref and commit cannot both be empty');
  2879. }
  2880. const upperRef = (ref || '').toUpperCase();
  2881. // SHA
  2882. if (commit) {
  2883. // refs/heads
  2884. if (upperRef.startsWith('REFS/HEADS/')) {
  2885. const branch = ref.substring('refs/heads/'.length);
  2886. return [`+${commit}:refs/remotes/origin/${branch}`];
  2887. }
  2888. // refs/pull/
  2889. else if (upperRef.startsWith('REFS/PULL/')) {
  2890. const branch = ref.substring('refs/pull/'.length);
  2891. return [`+${commit}:refs/remotes/pull/${branch}`];
  2892. }
  2893. // refs/tags/
  2894. else if (upperRef.startsWith('REFS/TAGS/')) {
  2895. return [`+${commit}:${ref}`];
  2896. }
  2897. // Otherwise no destination ref
  2898. else {
  2899. return [commit];
  2900. }
  2901. }
  2902. // Unqualified ref, check for a matching branch or tag
  2903. else if (!upperRef.startsWith('REFS/')) {
  2904. return [
  2905. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2906. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2907. ];
  2908. }
  2909. // refs/heads/
  2910. else if (upperRef.startsWith('REFS/HEADS/')) {
  2911. const branch = ref.substring('refs/heads/'.length);
  2912. return [`+${ref}:refs/remotes/origin/${branch}`];
  2913. }
  2914. // refs/pull/
  2915. else if (upperRef.startsWith('REFS/PULL/')) {
  2916. const branch = ref.substring('refs/pull/'.length);
  2917. return [`+${ref}:refs/remotes/pull/${branch}`];
  2918. }
  2919. // refs/tags/
  2920. else {
  2921. return [`+${ref}:${ref}`];
  2922. }
  2923. }
  2924. exports.getRefSpec = getRefSpec;
  2925. /***/ }),
  2926. /***/ 248:
  2927. /***/ (function(module, __unusedexports, __webpack_require__) {
  2928. module.exports = octokitRegisterEndpoints;
  2929. const registerEndpoints = __webpack_require__(899);
  2930. function octokitRegisterEndpoints(octokit) {
  2931. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2932. }
  2933. /***/ }),
  2934. /***/ 260:
  2935. /***/ (function(module, __unusedexports, __webpack_require__) {
  2936. // Note: since nyc uses this module to output coverage, any lines
  2937. // that are in the direct sync flow of nyc's outputCoverage are
  2938. // ignored, since we can never get coverage for them.
  2939. var assert = __webpack_require__(357)
  2940. var signals = __webpack_require__(654)
  2941. var EE = __webpack_require__(614)
  2942. /* istanbul ignore if */
  2943. if (typeof EE !== 'function') {
  2944. EE = EE.EventEmitter
  2945. }
  2946. var emitter
  2947. if (process.__signal_exit_emitter__) {
  2948. emitter = process.__signal_exit_emitter__
  2949. } else {
  2950. emitter = process.__signal_exit_emitter__ = new EE()
  2951. emitter.count = 0
  2952. emitter.emitted = {}
  2953. }
  2954. // Because this emitter is a global, we have to check to see if a
  2955. // previous version of this library failed to enable infinite listeners.
  2956. // I know what you're about to say. But literally everything about
  2957. // signal-exit is a compromise with evil. Get used to it.
  2958. if (!emitter.infinite) {
  2959. emitter.setMaxListeners(Infinity)
  2960. emitter.infinite = true
  2961. }
  2962. module.exports = function (cb, opts) {
  2963. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2964. if (loaded === false) {
  2965. load()
  2966. }
  2967. var ev = 'exit'
  2968. if (opts && opts.alwaysLast) {
  2969. ev = 'afterexit'
  2970. }
  2971. var remove = function () {
  2972. emitter.removeListener(ev, cb)
  2973. if (emitter.listeners('exit').length === 0 &&
  2974. emitter.listeners('afterexit').length === 0) {
  2975. unload()
  2976. }
  2977. }
  2978. emitter.on(ev, cb)
  2979. return remove
  2980. }
  2981. module.exports.unload = unload
  2982. function unload () {
  2983. if (!loaded) {
  2984. return
  2985. }
  2986. loaded = false
  2987. signals.forEach(function (sig) {
  2988. try {
  2989. process.removeListener(sig, sigListeners[sig])
  2990. } catch (er) {}
  2991. })
  2992. process.emit = originalProcessEmit
  2993. process.reallyExit = originalProcessReallyExit
  2994. emitter.count -= 1
  2995. }
  2996. function emit (event, code, signal) {
  2997. if (emitter.emitted[event]) {
  2998. return
  2999. }
  3000. emitter.emitted[event] = true
  3001. emitter.emit(event, code, signal)
  3002. }
  3003. // { <signal>: <listener fn>, ... }
  3004. var sigListeners = {}
  3005. signals.forEach(function (sig) {
  3006. sigListeners[sig] = function listener () {
  3007. // If there are no other listeners, an exit is coming!
  3008. // Simplest way: remove us and then re-send the signal.
  3009. // We know that this will kill the process, so we can
  3010. // safely emit now.
  3011. var listeners = process.listeners(sig)
  3012. if (listeners.length === emitter.count) {
  3013. unload()
  3014. emit('exit', null, sig)
  3015. /* istanbul ignore next */
  3016. emit('afterexit', null, sig)
  3017. /* istanbul ignore next */
  3018. process.kill(process.pid, sig)
  3019. }
  3020. }
  3021. })
  3022. module.exports.signals = function () {
  3023. return signals
  3024. }
  3025. module.exports.load = load
  3026. var loaded = false
  3027. function load () {
  3028. if (loaded) {
  3029. return
  3030. }
  3031. loaded = true
  3032. // This is the number of onSignalExit's that are in play.
  3033. // It's important so that we can count the correct number of
  3034. // listeners on signals, and don't wait for the other one to
  3035. // handle it instead of us.
  3036. emitter.count += 1
  3037. signals = signals.filter(function (sig) {
  3038. try {
  3039. process.on(sig, sigListeners[sig])
  3040. return true
  3041. } catch (er) {
  3042. return false
  3043. }
  3044. })
  3045. process.emit = processEmit
  3046. process.reallyExit = processReallyExit
  3047. }
  3048. var originalProcessReallyExit = process.reallyExit
  3049. function processReallyExit (code) {
  3050. process.exitCode = code || 0
  3051. emit('exit', process.exitCode, null)
  3052. /* istanbul ignore next */
  3053. emit('afterexit', process.exitCode, null)
  3054. /* istanbul ignore next */
  3055. originalProcessReallyExit.call(process, process.exitCode)
  3056. }
  3057. var originalProcessEmit = process.emit
  3058. function processEmit (ev, arg) {
  3059. if (ev === 'exit') {
  3060. if (arg !== undefined) {
  3061. process.exitCode = arg
  3062. }
  3063. var ret = originalProcessEmit.apply(this, arguments)
  3064. emit('exit', process.exitCode, null)
  3065. /* istanbul ignore next */
  3066. emit('afterexit', process.exitCode, null)
  3067. return ret
  3068. } else {
  3069. return originalProcessEmit.apply(this, arguments)
  3070. }
  3071. }
  3072. /***/ }),
  3073. /***/ 262:
  3074. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3075. "use strict";
  3076. Object.defineProperty(exports, "__esModule", { value: true });
  3077. const fs_1 = __webpack_require__(747);
  3078. const os_1 = __webpack_require__(87);
  3079. class Context {
  3080. /**
  3081. * Hydrate the context from the environment
  3082. */
  3083. constructor() {
  3084. this.payload = {};
  3085. if (process.env.GITHUB_EVENT_PATH) {
  3086. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3087. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3088. }
  3089. else {
  3090. const path = process.env.GITHUB_EVENT_PATH;
  3091. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3092. }
  3093. }
  3094. this.eventName = process.env.GITHUB_EVENT_NAME;
  3095. this.sha = process.env.GITHUB_SHA;
  3096. this.ref = process.env.GITHUB_REF;
  3097. this.workflow = process.env.GITHUB_WORKFLOW;
  3098. this.action = process.env.GITHUB_ACTION;
  3099. this.actor = process.env.GITHUB_ACTOR;
  3100. }
  3101. get issue() {
  3102. const payload = this.payload;
  3103. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3104. }
  3105. get repo() {
  3106. if (process.env.GITHUB_REPOSITORY) {
  3107. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3108. return { owner, repo };
  3109. }
  3110. if (this.payload.repository) {
  3111. return {
  3112. owner: this.payload.repository.owner.login,
  3113. repo: this.payload.repository.name
  3114. };
  3115. }
  3116. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3117. }
  3118. }
  3119. exports.Context = Context;
  3120. //# sourceMappingURL=context.js.map
  3121. /***/ }),
  3122. /***/ 265:
  3123. /***/ (function(module, __unusedexports, __webpack_require__) {
  3124. module.exports = getPage
  3125. const deprecate = __webpack_require__(370)
  3126. const getPageLinks = __webpack_require__(577)
  3127. const HttpError = __webpack_require__(297)
  3128. function getPage (octokit, link, which, headers) {
  3129. 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.`)
  3130. const url = getPageLinks(link)[which]
  3131. if (!url) {
  3132. const urlError = new HttpError(`No ${which} page found`, 404)
  3133. return Promise.reject(urlError)
  3134. }
  3135. const requestOptions = {
  3136. url,
  3137. headers: applyAcceptHeader(link, headers)
  3138. }
  3139. const promise = octokit.request(requestOptions)
  3140. return promise
  3141. }
  3142. function applyAcceptHeader (res, headers) {
  3143. const previous = res.headers && res.headers['x-github-media-type']
  3144. if (!previous || (headers && headers.accept)) {
  3145. return headers
  3146. }
  3147. headers = headers || {}
  3148. headers.accept = 'application/vnd.' + previous
  3149. .replace('; param=', '.')
  3150. .replace('; format=', '+')
  3151. return headers
  3152. }
  3153. /***/ }),
  3154. /***/ 280:
  3155. /***/ (function(module, exports) {
  3156. exports = module.exports = SemVer
  3157. var debug
  3158. /* istanbul ignore next */
  3159. if (typeof process === 'object' &&
  3160. process.env &&
  3161. process.env.NODE_DEBUG &&
  3162. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3163. debug = function () {
  3164. var args = Array.prototype.slice.call(arguments, 0)
  3165. args.unshift('SEMVER')
  3166. console.log.apply(console, args)
  3167. }
  3168. } else {
  3169. debug = function () {}
  3170. }
  3171. // Note: this is the semver.org version of the spec that it implements
  3172. // Not necessarily the package version of this code.
  3173. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3174. var MAX_LENGTH = 256
  3175. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3176. /* istanbul ignore next */ 9007199254740991
  3177. // Max safe segment length for coercion.
  3178. var MAX_SAFE_COMPONENT_LENGTH = 16
  3179. // The actual regexps go on exports.re
  3180. var re = exports.re = []
  3181. var src = exports.src = []
  3182. var R = 0
  3183. // The following Regular Expressions can be used for tokenizing,
  3184. // validating, and parsing SemVer version strings.
  3185. // ## Numeric Identifier
  3186. // A single `0`, or a non-zero digit followed by zero or more digits.
  3187. var NUMERICIDENTIFIER = R++
  3188. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3189. var NUMERICIDENTIFIERLOOSE = R++
  3190. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3191. // ## Non-numeric Identifier
  3192. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3193. // more letters, digits, or hyphens.
  3194. var NONNUMERICIDENTIFIER = R++
  3195. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3196. // ## Main Version
  3197. // Three dot-separated numeric identifiers.
  3198. var MAINVERSION = R++
  3199. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3200. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3201. '(' + src[NUMERICIDENTIFIER] + ')'
  3202. var MAINVERSIONLOOSE = R++
  3203. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3204. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3205. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3206. // ## Pre-release Version Identifier
  3207. // A numeric identifier, or a non-numeric identifier.
  3208. var PRERELEASEIDENTIFIER = R++
  3209. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3210. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3211. var PRERELEASEIDENTIFIERLOOSE = R++
  3212. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3213. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3214. // ## Pre-release Version
  3215. // Hyphen, followed by one or more dot-separated pre-release version
  3216. // identifiers.
  3217. var PRERELEASE = R++
  3218. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3219. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3220. var PRERELEASELOOSE = R++
  3221. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3222. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3223. // ## Build Metadata Identifier
  3224. // Any combination of digits, letters, or hyphens.
  3225. var BUILDIDENTIFIER = R++
  3226. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3227. // ## Build Metadata
  3228. // Plus sign, followed by one or more period-separated build metadata
  3229. // identifiers.
  3230. var BUILD = R++
  3231. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3232. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3233. // ## Full Version String
  3234. // A main version, followed optionally by a pre-release version and
  3235. // build metadata.
  3236. // Note that the only major, minor, patch, and pre-release sections of
  3237. // the version string are capturing groups. The build metadata is not a
  3238. // capturing group, because it should not ever be used in version
  3239. // comparison.
  3240. var FULL = R++
  3241. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3242. src[PRERELEASE] + '?' +
  3243. src[BUILD] + '?'
  3244. src[FULL] = '^' + FULLPLAIN + '$'
  3245. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3246. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3247. // common in the npm registry.
  3248. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3249. src[PRERELEASELOOSE] + '?' +
  3250. src[BUILD] + '?'
  3251. var LOOSE = R++
  3252. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3253. var GTLT = R++
  3254. src[GTLT] = '((?:<|>)?=?)'
  3255. // Something like "2.*" or "1.2.x".
  3256. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3257. // Only the first item is strictly required.
  3258. var XRANGEIDENTIFIERLOOSE = R++
  3259. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3260. var XRANGEIDENTIFIER = R++
  3261. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3262. var XRANGEPLAIN = R++
  3263. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3264. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3265. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3266. '(?:' + src[PRERELEASE] + ')?' +
  3267. src[BUILD] + '?' +
  3268. ')?)?'
  3269. var XRANGEPLAINLOOSE = R++
  3270. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3271. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3272. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3273. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3274. src[BUILD] + '?' +
  3275. ')?)?'
  3276. var XRANGE = R++
  3277. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3278. var XRANGELOOSE = R++
  3279. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3280. // Coercion.
  3281. // Extract anything that could conceivably be a part of a valid semver
  3282. var COERCE = R++
  3283. src[COERCE] = '(?:^|[^\\d])' +
  3284. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3285. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3286. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3287. '(?:$|[^\\d])'
  3288. // Tilde ranges.
  3289. // Meaning is "reasonably at or greater than"
  3290. var LONETILDE = R++
  3291. src[LONETILDE] = '(?:~>?)'
  3292. var TILDETRIM = R++
  3293. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3294. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3295. var tildeTrimReplace = '$1~'
  3296. var TILDE = R++
  3297. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3298. var TILDELOOSE = R++
  3299. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3300. // Caret ranges.
  3301. // Meaning is "at least and backwards compatible with"
  3302. var LONECARET = R++
  3303. src[LONECARET] = '(?:\\^)'
  3304. var CARETTRIM = R++
  3305. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3306. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3307. var caretTrimReplace = '$1^'
  3308. var CARET = R++
  3309. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3310. var CARETLOOSE = R++
  3311. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3312. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3313. var COMPARATORLOOSE = R++
  3314. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3315. var COMPARATOR = R++
  3316. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3317. // An expression to strip any whitespace between the gtlt and the thing
  3318. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3319. var COMPARATORTRIM = R++
  3320. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3321. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3322. // this one has to use the /g flag
  3323. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3324. var comparatorTrimReplace = '$1$2$3'
  3325. // Something like `1.2.3 - 1.2.4`
  3326. // Note that these all use the loose form, because they'll be
  3327. // checked against either the strict or loose comparator form
  3328. // later.
  3329. var HYPHENRANGE = R++
  3330. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3331. '\\s+-\\s+' +
  3332. '(' + src[XRANGEPLAIN] + ')' +
  3333. '\\s*$'
  3334. var HYPHENRANGELOOSE = R++
  3335. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3336. '\\s+-\\s+' +
  3337. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3338. '\\s*$'
  3339. // Star ranges basically just allow anything at all.
  3340. var STAR = R++
  3341. src[STAR] = '(<|>)?=?\\s*\\*'
  3342. // Compile to actual regexp objects.
  3343. // All are flag-free, unless they were created above with a flag.
  3344. for (var i = 0; i < R; i++) {
  3345. debug(i, src[i])
  3346. if (!re[i]) {
  3347. re[i] = new RegExp(src[i])
  3348. }
  3349. }
  3350. exports.parse = parse
  3351. function parse (version, options) {
  3352. if (!options || typeof options !== 'object') {
  3353. options = {
  3354. loose: !!options,
  3355. includePrerelease: false
  3356. }
  3357. }
  3358. if (version instanceof SemVer) {
  3359. return version
  3360. }
  3361. if (typeof version !== 'string') {
  3362. return null
  3363. }
  3364. if (version.length > MAX_LENGTH) {
  3365. return null
  3366. }
  3367. var r = options.loose ? re[LOOSE] : re[FULL]
  3368. if (!r.test(version)) {
  3369. return null
  3370. }
  3371. try {
  3372. return new SemVer(version, options)
  3373. } catch (er) {
  3374. return null
  3375. }
  3376. }
  3377. exports.valid = valid
  3378. function valid (version, options) {
  3379. var v = parse(version, options)
  3380. return v ? v.version : null
  3381. }
  3382. exports.clean = clean
  3383. function clean (version, options) {
  3384. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3385. return s ? s.version : null
  3386. }
  3387. exports.SemVer = SemVer
  3388. function SemVer (version, options) {
  3389. if (!options || typeof options !== 'object') {
  3390. options = {
  3391. loose: !!options,
  3392. includePrerelease: false
  3393. }
  3394. }
  3395. if (version instanceof SemVer) {
  3396. if (version.loose === options.loose) {
  3397. return version
  3398. } else {
  3399. version = version.version
  3400. }
  3401. } else if (typeof version !== 'string') {
  3402. throw new TypeError('Invalid Version: ' + version)
  3403. }
  3404. if (version.length > MAX_LENGTH) {
  3405. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3406. }
  3407. if (!(this instanceof SemVer)) {
  3408. return new SemVer(version, options)
  3409. }
  3410. debug('SemVer', version, options)
  3411. this.options = options
  3412. this.loose = !!options.loose
  3413. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3414. if (!m) {
  3415. throw new TypeError('Invalid Version: ' + version)
  3416. }
  3417. this.raw = version
  3418. // these are actually numbers
  3419. this.major = +m[1]
  3420. this.minor = +m[2]
  3421. this.patch = +m[3]
  3422. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3423. throw new TypeError('Invalid major version')
  3424. }
  3425. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3426. throw new TypeError('Invalid minor version')
  3427. }
  3428. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3429. throw new TypeError('Invalid patch version')
  3430. }
  3431. // numberify any prerelease numeric ids
  3432. if (!m[4]) {
  3433. this.prerelease = []
  3434. } else {
  3435. this.prerelease = m[4].split('.').map(function (id) {
  3436. if (/^[0-9]+$/.test(id)) {
  3437. var num = +id
  3438. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3439. return num
  3440. }
  3441. }
  3442. return id
  3443. })
  3444. }
  3445. this.build = m[5] ? m[5].split('.') : []
  3446. this.format()
  3447. }
  3448. SemVer.prototype.format = function () {
  3449. this.version = this.major + '.' + this.minor + '.' + this.patch
  3450. if (this.prerelease.length) {
  3451. this.version += '-' + this.prerelease.join('.')
  3452. }
  3453. return this.version
  3454. }
  3455. SemVer.prototype.toString = function () {
  3456. return this.version
  3457. }
  3458. SemVer.prototype.compare = function (other) {
  3459. debug('SemVer.compare', this.version, this.options, other)
  3460. if (!(other instanceof SemVer)) {
  3461. other = new SemVer(other, this.options)
  3462. }
  3463. return this.compareMain(other) || this.comparePre(other)
  3464. }
  3465. SemVer.prototype.compareMain = function (other) {
  3466. if (!(other instanceof SemVer)) {
  3467. other = new SemVer(other, this.options)
  3468. }
  3469. return compareIdentifiers(this.major, other.major) ||
  3470. compareIdentifiers(this.minor, other.minor) ||
  3471. compareIdentifiers(this.patch, other.patch)
  3472. }
  3473. SemVer.prototype.comparePre = function (other) {
  3474. if (!(other instanceof SemVer)) {
  3475. other = new SemVer(other, this.options)
  3476. }
  3477. // NOT having a prerelease is > having one
  3478. if (this.prerelease.length && !other.prerelease.length) {
  3479. return -1
  3480. } else if (!this.prerelease.length && other.prerelease.length) {
  3481. return 1
  3482. } else if (!this.prerelease.length && !other.prerelease.length) {
  3483. return 0
  3484. }
  3485. var i = 0
  3486. do {
  3487. var a = this.prerelease[i]
  3488. var b = other.prerelease[i]
  3489. debug('prerelease compare', i, a, b)
  3490. if (a === undefined && b === undefined) {
  3491. return 0
  3492. } else if (b === undefined) {
  3493. return 1
  3494. } else if (a === undefined) {
  3495. return -1
  3496. } else if (a === b) {
  3497. continue
  3498. } else {
  3499. return compareIdentifiers(a, b)
  3500. }
  3501. } while (++i)
  3502. }
  3503. // preminor will bump the version up to the next minor release, and immediately
  3504. // down to pre-release. premajor and prepatch work the same way.
  3505. SemVer.prototype.inc = function (release, identifier) {
  3506. switch (release) {
  3507. case 'premajor':
  3508. this.prerelease.length = 0
  3509. this.patch = 0
  3510. this.minor = 0
  3511. this.major++
  3512. this.inc('pre', identifier)
  3513. break
  3514. case 'preminor':
  3515. this.prerelease.length = 0
  3516. this.patch = 0
  3517. this.minor++
  3518. this.inc('pre', identifier)
  3519. break
  3520. case 'prepatch':
  3521. // If this is already a prerelease, it will bump to the next version
  3522. // drop any prereleases that might already exist, since they are not
  3523. // relevant at this point.
  3524. this.prerelease.length = 0
  3525. this.inc('patch', identifier)
  3526. this.inc('pre', identifier)
  3527. break
  3528. // If the input is a non-prerelease version, this acts the same as
  3529. // prepatch.
  3530. case 'prerelease':
  3531. if (this.prerelease.length === 0) {
  3532. this.inc('patch', identifier)
  3533. }
  3534. this.inc('pre', identifier)
  3535. break
  3536. case 'major':
  3537. // If this is a pre-major version, bump up to the same major version.
  3538. // Otherwise increment major.
  3539. // 1.0.0-5 bumps to 1.0.0
  3540. // 1.1.0 bumps to 2.0.0
  3541. if (this.minor !== 0 ||
  3542. this.patch !== 0 ||
  3543. this.prerelease.length === 0) {
  3544. this.major++
  3545. }
  3546. this.minor = 0
  3547. this.patch = 0
  3548. this.prerelease = []
  3549. break
  3550. case 'minor':
  3551. // If this is a pre-minor version, bump up to the same minor version.
  3552. // Otherwise increment minor.
  3553. // 1.2.0-5 bumps to 1.2.0
  3554. // 1.2.1 bumps to 1.3.0
  3555. if (this.patch !== 0 || this.prerelease.length === 0) {
  3556. this.minor++
  3557. }
  3558. this.patch = 0
  3559. this.prerelease = []
  3560. break
  3561. case 'patch':
  3562. // If this is not a pre-release version, it will increment the patch.
  3563. // If it is a pre-release it will bump up to the same patch version.
  3564. // 1.2.0-5 patches to 1.2.0
  3565. // 1.2.0 patches to 1.2.1
  3566. if (this.prerelease.length === 0) {
  3567. this.patch++
  3568. }
  3569. this.prerelease = []
  3570. break
  3571. // This probably shouldn't be used publicly.
  3572. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3573. case 'pre':
  3574. if (this.prerelease.length === 0) {
  3575. this.prerelease = [0]
  3576. } else {
  3577. var i = this.prerelease.length
  3578. while (--i >= 0) {
  3579. if (typeof this.prerelease[i] === 'number') {
  3580. this.prerelease[i]++
  3581. i = -2
  3582. }
  3583. }
  3584. if (i === -1) {
  3585. // didn't increment anything
  3586. this.prerelease.push(0)
  3587. }
  3588. }
  3589. if (identifier) {
  3590. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3591. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3592. if (this.prerelease[0] === identifier) {
  3593. if (isNaN(this.prerelease[1])) {
  3594. this.prerelease = [identifier, 0]
  3595. }
  3596. } else {
  3597. this.prerelease = [identifier, 0]
  3598. }
  3599. }
  3600. break
  3601. default:
  3602. throw new Error('invalid increment argument: ' + release)
  3603. }
  3604. this.format()
  3605. this.raw = this.version
  3606. return this
  3607. }
  3608. exports.inc = inc
  3609. function inc (version, release, loose, identifier) {
  3610. if (typeof (loose) === 'string') {
  3611. identifier = loose
  3612. loose = undefined
  3613. }
  3614. try {
  3615. return new SemVer(version, loose).inc(release, identifier).version
  3616. } catch (er) {
  3617. return null
  3618. }
  3619. }
  3620. exports.diff = diff
  3621. function diff (version1, version2) {
  3622. if (eq(version1, version2)) {
  3623. return null
  3624. } else {
  3625. var v1 = parse(version1)
  3626. var v2 = parse(version2)
  3627. var prefix = ''
  3628. if (v1.prerelease.length || v2.prerelease.length) {
  3629. prefix = 'pre'
  3630. var defaultResult = 'prerelease'
  3631. }
  3632. for (var key in v1) {
  3633. if (key === 'major' || key === 'minor' || key === 'patch') {
  3634. if (v1[key] !== v2[key]) {
  3635. return prefix + key
  3636. }
  3637. }
  3638. }
  3639. return defaultResult // may be undefined
  3640. }
  3641. }
  3642. exports.compareIdentifiers = compareIdentifiers
  3643. var numeric = /^[0-9]+$/
  3644. function compareIdentifiers (a, b) {
  3645. var anum = numeric.test(a)
  3646. var bnum = numeric.test(b)
  3647. if (anum && bnum) {
  3648. a = +a
  3649. b = +b
  3650. }
  3651. return a === b ? 0
  3652. : (anum && !bnum) ? -1
  3653. : (bnum && !anum) ? 1
  3654. : a < b ? -1
  3655. : 1
  3656. }
  3657. exports.rcompareIdentifiers = rcompareIdentifiers
  3658. function rcompareIdentifiers (a, b) {
  3659. return compareIdentifiers(b, a)
  3660. }
  3661. exports.major = major
  3662. function major (a, loose) {
  3663. return new SemVer(a, loose).major
  3664. }
  3665. exports.minor = minor
  3666. function minor (a, loose) {
  3667. return new SemVer(a, loose).minor
  3668. }
  3669. exports.patch = patch
  3670. function patch (a, loose) {
  3671. return new SemVer(a, loose).patch
  3672. }
  3673. exports.compare = compare
  3674. function compare (a, b, loose) {
  3675. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3676. }
  3677. exports.compareLoose = compareLoose
  3678. function compareLoose (a, b) {
  3679. return compare(a, b, true)
  3680. }
  3681. exports.rcompare = rcompare
  3682. function rcompare (a, b, loose) {
  3683. return compare(b, a, loose)
  3684. }
  3685. exports.sort = sort
  3686. function sort (list, loose) {
  3687. return list.sort(function (a, b) {
  3688. return exports.compare(a, b, loose)
  3689. })
  3690. }
  3691. exports.rsort = rsort
  3692. function rsort (list, loose) {
  3693. return list.sort(function (a, b) {
  3694. return exports.rcompare(a, b, loose)
  3695. })
  3696. }
  3697. exports.gt = gt
  3698. function gt (a, b, loose) {
  3699. return compare(a, b, loose) > 0
  3700. }
  3701. exports.lt = lt
  3702. function lt (a, b, loose) {
  3703. return compare(a, b, loose) < 0
  3704. }
  3705. exports.eq = eq
  3706. function eq (a, b, loose) {
  3707. return compare(a, b, loose) === 0
  3708. }
  3709. exports.neq = neq
  3710. function neq (a, b, loose) {
  3711. return compare(a, b, loose) !== 0
  3712. }
  3713. exports.gte = gte
  3714. function gte (a, b, loose) {
  3715. return compare(a, b, loose) >= 0
  3716. }
  3717. exports.lte = lte
  3718. function lte (a, b, loose) {
  3719. return compare(a, b, loose) <= 0
  3720. }
  3721. exports.cmp = cmp
  3722. function cmp (a, op, b, loose) {
  3723. switch (op) {
  3724. case '===':
  3725. if (typeof a === 'object')
  3726. a = a.version
  3727. if (typeof b === 'object')
  3728. b = b.version
  3729. return a === b
  3730. case '!==':
  3731. if (typeof a === 'object')
  3732. a = a.version
  3733. if (typeof b === 'object')
  3734. b = b.version
  3735. return a !== b
  3736. case '':
  3737. case '=':
  3738. case '==':
  3739. return eq(a, b, loose)
  3740. case '!=':
  3741. return neq(a, b, loose)
  3742. case '>':
  3743. return gt(a, b, loose)
  3744. case '>=':
  3745. return gte(a, b, loose)
  3746. case '<':
  3747. return lt(a, b, loose)
  3748. case '<=':
  3749. return lte(a, b, loose)
  3750. default:
  3751. throw new TypeError('Invalid operator: ' + op)
  3752. }
  3753. }
  3754. exports.Comparator = Comparator
  3755. function Comparator (comp, options) {
  3756. if (!options || typeof options !== 'object') {
  3757. options = {
  3758. loose: !!options,
  3759. includePrerelease: false
  3760. }
  3761. }
  3762. if (comp instanceof Comparator) {
  3763. if (comp.loose === !!options.loose) {
  3764. return comp
  3765. } else {
  3766. comp = comp.value
  3767. }
  3768. }
  3769. if (!(this instanceof Comparator)) {
  3770. return new Comparator(comp, options)
  3771. }
  3772. debug('comparator', comp, options)
  3773. this.options = options
  3774. this.loose = !!options.loose
  3775. this.parse(comp)
  3776. if (this.semver === ANY) {
  3777. this.value = ''
  3778. } else {
  3779. this.value = this.operator + this.semver.version
  3780. }
  3781. debug('comp', this)
  3782. }
  3783. var ANY = {}
  3784. Comparator.prototype.parse = function (comp) {
  3785. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3786. var m = comp.match(r)
  3787. if (!m) {
  3788. throw new TypeError('Invalid comparator: ' + comp)
  3789. }
  3790. this.operator = m[1]
  3791. if (this.operator === '=') {
  3792. this.operator = ''
  3793. }
  3794. // if it literally is just '>' or '' then allow anything.
  3795. if (!m[2]) {
  3796. this.semver = ANY
  3797. } else {
  3798. this.semver = new SemVer(m[2], this.options.loose)
  3799. }
  3800. }
  3801. Comparator.prototype.toString = function () {
  3802. return this.value
  3803. }
  3804. Comparator.prototype.test = function (version) {
  3805. debug('Comparator.test', version, this.options.loose)
  3806. if (this.semver === ANY) {
  3807. return true
  3808. }
  3809. if (typeof version === 'string') {
  3810. version = new SemVer(version, this.options)
  3811. }
  3812. return cmp(version, this.operator, this.semver, this.options)
  3813. }
  3814. Comparator.prototype.intersects = function (comp, options) {
  3815. if (!(comp instanceof Comparator)) {
  3816. throw new TypeError('a Comparator is required')
  3817. }
  3818. if (!options || typeof options !== 'object') {
  3819. options = {
  3820. loose: !!options,
  3821. includePrerelease: false
  3822. }
  3823. }
  3824. var rangeTmp
  3825. if (this.operator === '') {
  3826. rangeTmp = new Range(comp.value, options)
  3827. return satisfies(this.value, rangeTmp, options)
  3828. } else if (comp.operator === '') {
  3829. rangeTmp = new Range(this.value, options)
  3830. return satisfies(comp.semver, rangeTmp, options)
  3831. }
  3832. var sameDirectionIncreasing =
  3833. (this.operator === '>=' || this.operator === '>') &&
  3834. (comp.operator === '>=' || comp.operator === '>')
  3835. var sameDirectionDecreasing =
  3836. (this.operator === '<=' || this.operator === '<') &&
  3837. (comp.operator === '<=' || comp.operator === '<')
  3838. var sameSemVer = this.semver.version === comp.semver.version
  3839. var differentDirectionsInclusive =
  3840. (this.operator === '>=' || this.operator === '<=') &&
  3841. (comp.operator === '>=' || comp.operator === '<=')
  3842. var oppositeDirectionsLessThan =
  3843. cmp(this.semver, '<', comp.semver, options) &&
  3844. ((this.operator === '>=' || this.operator === '>') &&
  3845. (comp.operator === '<=' || comp.operator === '<'))
  3846. var oppositeDirectionsGreaterThan =
  3847. cmp(this.semver, '>', comp.semver, options) &&
  3848. ((this.operator === '<=' || this.operator === '<') &&
  3849. (comp.operator === '>=' || comp.operator === '>'))
  3850. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3851. (sameSemVer && differentDirectionsInclusive) ||
  3852. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3853. }
  3854. exports.Range = Range
  3855. function Range (range, options) {
  3856. if (!options || typeof options !== 'object') {
  3857. options = {
  3858. loose: !!options,
  3859. includePrerelease: false
  3860. }
  3861. }
  3862. if (range instanceof Range) {
  3863. if (range.loose === !!options.loose &&
  3864. range.includePrerelease === !!options.includePrerelease) {
  3865. return range
  3866. } else {
  3867. return new Range(range.raw, options)
  3868. }
  3869. }
  3870. if (range instanceof Comparator) {
  3871. return new Range(range.value, options)
  3872. }
  3873. if (!(this instanceof Range)) {
  3874. return new Range(range, options)
  3875. }
  3876. this.options = options
  3877. this.loose = !!options.loose
  3878. this.includePrerelease = !!options.includePrerelease
  3879. // First, split based on boolean or ||
  3880. this.raw = range
  3881. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3882. return this.parseRange(range.trim())
  3883. }, this).filter(function (c) {
  3884. // throw out any that are not relevant for whatever reason
  3885. return c.length
  3886. })
  3887. if (!this.set.length) {
  3888. throw new TypeError('Invalid SemVer Range: ' + range)
  3889. }
  3890. this.format()
  3891. }
  3892. Range.prototype.format = function () {
  3893. this.range = this.set.map(function (comps) {
  3894. return comps.join(' ').trim()
  3895. }).join('||').trim()
  3896. return this.range
  3897. }
  3898. Range.prototype.toString = function () {
  3899. return this.range
  3900. }
  3901. Range.prototype.parseRange = function (range) {
  3902. var loose = this.options.loose
  3903. range = range.trim()
  3904. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3905. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3906. range = range.replace(hr, hyphenReplace)
  3907. debug('hyphen replace', range)
  3908. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3909. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3910. debug('comparator trim', range, re[COMPARATORTRIM])
  3911. // `~ 1.2.3` => `~1.2.3`
  3912. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3913. // `^ 1.2.3` => `^1.2.3`
  3914. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3915. // normalize spaces
  3916. range = range.split(/\s+/).join(' ')
  3917. // At this point, the range is completely trimmed and
  3918. // ready to be split into comparators.
  3919. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3920. var set = range.split(' ').map(function (comp) {
  3921. return parseComparator(comp, this.options)
  3922. }, this).join(' ').split(/\s+/)
  3923. if (this.options.loose) {
  3924. // in loose mode, throw out any that are not valid comparators
  3925. set = set.filter(function (comp) {
  3926. return !!comp.match(compRe)
  3927. })
  3928. }
  3929. set = set.map(function (comp) {
  3930. return new Comparator(comp, this.options)
  3931. }, this)
  3932. return set
  3933. }
  3934. Range.prototype.intersects = function (range, options) {
  3935. if (!(range instanceof Range)) {
  3936. throw new TypeError('a Range is required')
  3937. }
  3938. return this.set.some(function (thisComparators) {
  3939. return thisComparators.every(function (thisComparator) {
  3940. return range.set.some(function (rangeComparators) {
  3941. return rangeComparators.every(function (rangeComparator) {
  3942. return thisComparator.intersects(rangeComparator, options)
  3943. })
  3944. })
  3945. })
  3946. })
  3947. }
  3948. // Mostly just for testing and legacy API reasons
  3949. exports.toComparators = toComparators
  3950. function toComparators (range, options) {
  3951. return new Range(range, options).set.map(function (comp) {
  3952. return comp.map(function (c) {
  3953. return c.value
  3954. }).join(' ').trim().split(' ')
  3955. })
  3956. }
  3957. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3958. // already replaced the hyphen ranges
  3959. // turn into a set of JUST comparators.
  3960. function parseComparator (comp, options) {
  3961. debug('comp', comp, options)
  3962. comp = replaceCarets(comp, options)
  3963. debug('caret', comp)
  3964. comp = replaceTildes(comp, options)
  3965. debug('tildes', comp)
  3966. comp = replaceXRanges(comp, options)
  3967. debug('xrange', comp)
  3968. comp = replaceStars(comp, options)
  3969. debug('stars', comp)
  3970. return comp
  3971. }
  3972. function isX (id) {
  3973. return !id || id.toLowerCase() === 'x' || id === '*'
  3974. }
  3975. // ~, ~> --> * (any, kinda silly)
  3976. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3977. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3978. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3979. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3980. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3981. function replaceTildes (comp, options) {
  3982. return comp.trim().split(/\s+/).map(function (comp) {
  3983. return replaceTilde(comp, options)
  3984. }).join(' ')
  3985. }
  3986. function replaceTilde (comp, options) {
  3987. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3988. return comp.replace(r, function (_, M, m, p, pr) {
  3989. debug('tilde', comp, _, M, m, p, pr)
  3990. var ret
  3991. if (isX(M)) {
  3992. ret = ''
  3993. } else if (isX(m)) {
  3994. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3995. } else if (isX(p)) {
  3996. // ~1.2 == >=1.2.0 <1.3.0
  3997. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3998. } else if (pr) {
  3999. debug('replaceTilde pr', pr)
  4000. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4001. ' <' + M + '.' + (+m + 1) + '.0'
  4002. } else {
  4003. // ~1.2.3 == >=1.2.3 <1.3.0
  4004. ret = '>=' + M + '.' + m + '.' + p +
  4005. ' <' + M + '.' + (+m + 1) + '.0'
  4006. }
  4007. debug('tilde return', ret)
  4008. return ret
  4009. })
  4010. }
  4011. // ^ --> * (any, kinda silly)
  4012. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4013. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4014. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4015. // ^1.2.3 --> >=1.2.3 <2.0.0
  4016. // ^1.2.0 --> >=1.2.0 <2.0.0
  4017. function replaceCarets (comp, options) {
  4018. return comp.trim().split(/\s+/).map(function (comp) {
  4019. return replaceCaret(comp, options)
  4020. }).join(' ')
  4021. }
  4022. function replaceCaret (comp, options) {
  4023. debug('caret', comp, options)
  4024. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4025. return comp.replace(r, function (_, M, m, p, pr) {
  4026. debug('caret', comp, _, M, m, p, pr)
  4027. var ret
  4028. if (isX(M)) {
  4029. ret = ''
  4030. } else if (isX(m)) {
  4031. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4032. } else if (isX(p)) {
  4033. if (M === '0') {
  4034. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4035. } else {
  4036. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4037. }
  4038. } else if (pr) {
  4039. debug('replaceCaret pr', pr)
  4040. if (M === '0') {
  4041. if (m === '0') {
  4042. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4043. ' <' + M + '.' + m + '.' + (+p + 1)
  4044. } else {
  4045. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4046. ' <' + M + '.' + (+m + 1) + '.0'
  4047. }
  4048. } else {
  4049. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4050. ' <' + (+M + 1) + '.0.0'
  4051. }
  4052. } else {
  4053. debug('no pr')
  4054. if (M === '0') {
  4055. if (m === '0') {
  4056. ret = '>=' + M + '.' + m + '.' + p +
  4057. ' <' + M + '.' + m + '.' + (+p + 1)
  4058. } else {
  4059. ret = '>=' + M + '.' + m + '.' + p +
  4060. ' <' + M + '.' + (+m + 1) + '.0'
  4061. }
  4062. } else {
  4063. ret = '>=' + M + '.' + m + '.' + p +
  4064. ' <' + (+M + 1) + '.0.0'
  4065. }
  4066. }
  4067. debug('caret return', ret)
  4068. return ret
  4069. })
  4070. }
  4071. function replaceXRanges (comp, options) {
  4072. debug('replaceXRanges', comp, options)
  4073. return comp.split(/\s+/).map(function (comp) {
  4074. return replaceXRange(comp, options)
  4075. }).join(' ')
  4076. }
  4077. function replaceXRange (comp, options) {
  4078. comp = comp.trim()
  4079. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4080. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4081. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4082. var xM = isX(M)
  4083. var xm = xM || isX(m)
  4084. var xp = xm || isX(p)
  4085. var anyX = xp
  4086. if (gtlt === '=' && anyX) {
  4087. gtlt = ''
  4088. }
  4089. if (xM) {
  4090. if (gtlt === '>' || gtlt === '<') {
  4091. // nothing is allowed
  4092. ret = '<0.0.0'
  4093. } else {
  4094. // nothing is forbidden
  4095. ret = '*'
  4096. }
  4097. } else if (gtlt && anyX) {
  4098. // we know patch is an x, because we have any x at all.
  4099. // replace X with 0
  4100. if (xm) {
  4101. m = 0
  4102. }
  4103. p = 0
  4104. if (gtlt === '>') {
  4105. // >1 => >=2.0.0
  4106. // >1.2 => >=1.3.0
  4107. // >1.2.3 => >= 1.2.4
  4108. gtlt = '>='
  4109. if (xm) {
  4110. M = +M + 1
  4111. m = 0
  4112. p = 0
  4113. } else {
  4114. m = +m + 1
  4115. p = 0
  4116. }
  4117. } else if (gtlt === '<=') {
  4118. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4119. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4120. gtlt = '<'
  4121. if (xm) {
  4122. M = +M + 1
  4123. } else {
  4124. m = +m + 1
  4125. }
  4126. }
  4127. ret = gtlt + M + '.' + m + '.' + p
  4128. } else if (xm) {
  4129. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4130. } else if (xp) {
  4131. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4132. }
  4133. debug('xRange return', ret)
  4134. return ret
  4135. })
  4136. }
  4137. // Because * is AND-ed with everything else in the comparator,
  4138. // and '' means "any version", just remove the *s entirely.
  4139. function replaceStars (comp, options) {
  4140. debug('replaceStars', comp, options)
  4141. // Looseness is ignored here. star is always as loose as it gets!
  4142. return comp.trim().replace(re[STAR], '')
  4143. }
  4144. // This function is passed to string.replace(re[HYPHENRANGE])
  4145. // M, m, patch, prerelease, build
  4146. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4147. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4148. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4149. function hyphenReplace ($0,
  4150. from, fM, fm, fp, fpr, fb,
  4151. to, tM, tm, tp, tpr, tb) {
  4152. if (isX(fM)) {
  4153. from = ''
  4154. } else if (isX(fm)) {
  4155. from = '>=' + fM + '.0.0'
  4156. } else if (isX(fp)) {
  4157. from = '>=' + fM + '.' + fm + '.0'
  4158. } else {
  4159. from = '>=' + from
  4160. }
  4161. if (isX(tM)) {
  4162. to = ''
  4163. } else if (isX(tm)) {
  4164. to = '<' + (+tM + 1) + '.0.0'
  4165. } else if (isX(tp)) {
  4166. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4167. } else if (tpr) {
  4168. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4169. } else {
  4170. to = '<=' + to
  4171. }
  4172. return (from + ' ' + to).trim()
  4173. }
  4174. // if ANY of the sets match ALL of its comparators, then pass
  4175. Range.prototype.test = function (version) {
  4176. if (!version) {
  4177. return false
  4178. }
  4179. if (typeof version === 'string') {
  4180. version = new SemVer(version, this.options)
  4181. }
  4182. for (var i = 0; i < this.set.length; i++) {
  4183. if (testSet(this.set[i], version, this.options)) {
  4184. return true
  4185. }
  4186. }
  4187. return false
  4188. }
  4189. function testSet (set, version, options) {
  4190. for (var i = 0; i < set.length; i++) {
  4191. if (!set[i].test(version)) {
  4192. return false
  4193. }
  4194. }
  4195. if (version.prerelease.length && !options.includePrerelease) {
  4196. // Find the set of versions that are allowed to have prereleases
  4197. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4198. // That should allow `1.2.3-pr.2` to pass.
  4199. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4200. // even though it's within the range set by the comparators.
  4201. for (i = 0; i < set.length; i++) {
  4202. debug(set[i].semver)
  4203. if (set[i].semver === ANY) {
  4204. continue
  4205. }
  4206. if (set[i].semver.prerelease.length > 0) {
  4207. var allowed = set[i].semver
  4208. if (allowed.major === version.major &&
  4209. allowed.minor === version.minor &&
  4210. allowed.patch === version.patch) {
  4211. return true
  4212. }
  4213. }
  4214. }
  4215. // Version has a -pre, but it's not one of the ones we like.
  4216. return false
  4217. }
  4218. return true
  4219. }
  4220. exports.satisfies = satisfies
  4221. function satisfies (version, range, options) {
  4222. try {
  4223. range = new Range(range, options)
  4224. } catch (er) {
  4225. return false
  4226. }
  4227. return range.test(version)
  4228. }
  4229. exports.maxSatisfying = maxSatisfying
  4230. function maxSatisfying (versions, range, options) {
  4231. var max = null
  4232. var maxSV = null
  4233. try {
  4234. var rangeObj = new Range(range, options)
  4235. } catch (er) {
  4236. return null
  4237. }
  4238. versions.forEach(function (v) {
  4239. if (rangeObj.test(v)) {
  4240. // satisfies(v, range, options)
  4241. if (!max || maxSV.compare(v) === -1) {
  4242. // compare(max, v, true)
  4243. max = v
  4244. maxSV = new SemVer(max, options)
  4245. }
  4246. }
  4247. })
  4248. return max
  4249. }
  4250. exports.minSatisfying = minSatisfying
  4251. function minSatisfying (versions, range, options) {
  4252. var min = null
  4253. var minSV = null
  4254. try {
  4255. var rangeObj = new Range(range, options)
  4256. } catch (er) {
  4257. return null
  4258. }
  4259. versions.forEach(function (v) {
  4260. if (rangeObj.test(v)) {
  4261. // satisfies(v, range, options)
  4262. if (!min || minSV.compare(v) === 1) {
  4263. // compare(min, v, true)
  4264. min = v
  4265. minSV = new SemVer(min, options)
  4266. }
  4267. }
  4268. })
  4269. return min
  4270. }
  4271. exports.minVersion = minVersion
  4272. function minVersion (range, loose) {
  4273. range = new Range(range, loose)
  4274. var minver = new SemVer('0.0.0')
  4275. if (range.test(minver)) {
  4276. return minver
  4277. }
  4278. minver = new SemVer('0.0.0-0')
  4279. if (range.test(minver)) {
  4280. return minver
  4281. }
  4282. minver = null
  4283. for (var i = 0; i < range.set.length; ++i) {
  4284. var comparators = range.set[i]
  4285. comparators.forEach(function (comparator) {
  4286. // Clone to avoid manipulating the comparator's semver object.
  4287. var compver = new SemVer(comparator.semver.version)
  4288. switch (comparator.operator) {
  4289. case '>':
  4290. if (compver.prerelease.length === 0) {
  4291. compver.patch++
  4292. } else {
  4293. compver.prerelease.push(0)
  4294. }
  4295. compver.raw = compver.format()
  4296. /* fallthrough */
  4297. case '':
  4298. case '>=':
  4299. if (!minver || gt(minver, compver)) {
  4300. minver = compver
  4301. }
  4302. break
  4303. case '<':
  4304. case '<=':
  4305. /* Ignore maximum versions */
  4306. break
  4307. /* istanbul ignore next */
  4308. default:
  4309. throw new Error('Unexpected operation: ' + comparator.operator)
  4310. }
  4311. })
  4312. }
  4313. if (minver && range.test(minver)) {
  4314. return minver
  4315. }
  4316. return null
  4317. }
  4318. exports.validRange = validRange
  4319. function validRange (range, options) {
  4320. try {
  4321. // Return '*' instead of '' so that truthiness works.
  4322. // This will throw if it's invalid anyway
  4323. return new Range(range, options).range || '*'
  4324. } catch (er) {
  4325. return null
  4326. }
  4327. }
  4328. // Determine if version is less than all the versions possible in the range
  4329. exports.ltr = ltr
  4330. function ltr (version, range, options) {
  4331. return outside(version, range, '<', options)
  4332. }
  4333. // Determine if version is greater than all the versions possible in the range.
  4334. exports.gtr = gtr
  4335. function gtr (version, range, options) {
  4336. return outside(version, range, '>', options)
  4337. }
  4338. exports.outside = outside
  4339. function outside (version, range, hilo, options) {
  4340. version = new SemVer(version, options)
  4341. range = new Range(range, options)
  4342. var gtfn, ltefn, ltfn, comp, ecomp
  4343. switch (hilo) {
  4344. case '>':
  4345. gtfn = gt
  4346. ltefn = lte
  4347. ltfn = lt
  4348. comp = '>'
  4349. ecomp = '>='
  4350. break
  4351. case '<':
  4352. gtfn = lt
  4353. ltefn = gte
  4354. ltfn = gt
  4355. comp = '<'
  4356. ecomp = '<='
  4357. break
  4358. default:
  4359. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4360. }
  4361. // If it satisifes the range it is not outside
  4362. if (satisfies(version, range, options)) {
  4363. return false
  4364. }
  4365. // From now on, variable terms are as if we're in "gtr" mode.
  4366. // but note that everything is flipped for the "ltr" function.
  4367. for (var i = 0; i < range.set.length; ++i) {
  4368. var comparators = range.set[i]
  4369. var high = null
  4370. var low = null
  4371. comparators.forEach(function (comparator) {
  4372. if (comparator.semver === ANY) {
  4373. comparator = new Comparator('>=0.0.0')
  4374. }
  4375. high = high || comparator
  4376. low = low || comparator
  4377. if (gtfn(comparator.semver, high.semver, options)) {
  4378. high = comparator
  4379. } else if (ltfn(comparator.semver, low.semver, options)) {
  4380. low = comparator
  4381. }
  4382. })
  4383. // If the edge version comparator has a operator then our version
  4384. // isn't outside it
  4385. if (high.operator === comp || high.operator === ecomp) {
  4386. return false
  4387. }
  4388. // If the lowest version comparator has an operator and our version
  4389. // is less than it then it isn't higher than the range
  4390. if ((!low.operator || low.operator === comp) &&
  4391. ltefn(version, low.semver)) {
  4392. return false
  4393. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4394. return false
  4395. }
  4396. }
  4397. return true
  4398. }
  4399. exports.prerelease = prerelease
  4400. function prerelease (version, options) {
  4401. var parsed = parse(version, options)
  4402. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4403. }
  4404. exports.intersects = intersects
  4405. function intersects (r1, r2, options) {
  4406. r1 = new Range(r1, options)
  4407. r2 = new Range(r2, options)
  4408. return r1.intersects(r2)
  4409. }
  4410. exports.coerce = coerce
  4411. function coerce (version) {
  4412. if (version instanceof SemVer) {
  4413. return version
  4414. }
  4415. if (typeof version !== 'string') {
  4416. return null
  4417. }
  4418. var match = version.match(re[COERCE])
  4419. if (match == null) {
  4420. return null
  4421. }
  4422. return parse(match[1] +
  4423. '.' + (match[2] || '0') +
  4424. '.' + (match[3] || '0'))
  4425. }
  4426. /***/ }),
  4427. /***/ 287:
  4428. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4429. "use strict";
  4430. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4431. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4432. return new (P || (P = Promise))(function (resolve, reject) {
  4433. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4434. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4435. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4436. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4437. });
  4438. };
  4439. var __importStar = (this && this.__importStar) || function (mod) {
  4440. if (mod && mod.__esModule) return mod;
  4441. var result = {};
  4442. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4443. result["default"] = mod;
  4444. return result;
  4445. };
  4446. var __importDefault = (this && this.__importDefault) || function (mod) {
  4447. return (mod && mod.__esModule) ? mod : { "default": mod };
  4448. };
  4449. Object.defineProperty(exports, "__esModule", { value: true });
  4450. const assert = __importStar(__webpack_require__(357));
  4451. const core = __importStar(__webpack_require__(470));
  4452. const exec = __importStar(__webpack_require__(986));
  4453. const fs = __importStar(__webpack_require__(747));
  4454. const io = __importStar(__webpack_require__(1));
  4455. const os = __importStar(__webpack_require__(87));
  4456. const path = __importStar(__webpack_require__(622));
  4457. const regexpHelper = __importStar(__webpack_require__(528));
  4458. const stateHelper = __importStar(__webpack_require__(153));
  4459. const v4_1 = __importDefault(__webpack_require__(826));
  4460. const IS_WINDOWS = process.platform === 'win32';
  4461. const HOSTNAME = 'github.com';
  4462. const SSH_COMMAND_KEY = 'core.sshCommand';
  4463. function createAuthHelper(git, settings) {
  4464. return new GitAuthHelper(git, settings);
  4465. }
  4466. exports.createAuthHelper = createAuthHelper;
  4467. class GitAuthHelper {
  4468. constructor(gitCommandManager, gitSourceSettings) {
  4469. this.tokenConfigKey = `http.https://${HOSTNAME}/.extraheader`;
  4470. this.insteadOfKey = `url.https://${HOSTNAME}/.insteadOf`;
  4471. this.insteadOfValue = `git@${HOSTNAME}:`;
  4472. this.sshCommand = '';
  4473. this.sshKeyPath = '';
  4474. this.sshKnownHostsPath = '';
  4475. this.temporaryHomePath = '';
  4476. this.git = gitCommandManager;
  4477. this.settings = gitSourceSettings || {};
  4478. // Token auth header
  4479. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4480. core.setSecret(basicCredential);
  4481. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4482. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4483. }
  4484. configureAuth() {
  4485. return __awaiter(this, void 0, void 0, function* () {
  4486. // Remove possible previous values
  4487. yield this.removeAuth();
  4488. // Configure new values
  4489. yield this.configureSsh();
  4490. yield this.configureToken();
  4491. });
  4492. }
  4493. configureGlobalAuth() {
  4494. return __awaiter(this, void 0, void 0, function* () {
  4495. // Create a temp home directory
  4496. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4497. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4498. const uniqueId = v4_1.default();
  4499. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4500. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4501. // Copy the global git config
  4502. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4503. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4504. let configExists = false;
  4505. try {
  4506. yield fs.promises.stat(gitConfigPath);
  4507. configExists = true;
  4508. }
  4509. catch (err) {
  4510. if (err.code !== 'ENOENT') {
  4511. throw err;
  4512. }
  4513. }
  4514. if (configExists) {
  4515. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4516. yield io.cp(gitConfigPath, newGitConfigPath);
  4517. }
  4518. else {
  4519. yield fs.promises.writeFile(newGitConfigPath, '');
  4520. }
  4521. try {
  4522. // Override HOME
  4523. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4524. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4525. // Configure the token
  4526. yield this.configureToken(newGitConfigPath, true);
  4527. // Configure HTTPS instead of SSH
  4528. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4529. if (!this.settings.sshKey) {
  4530. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4531. }
  4532. }
  4533. catch (err) {
  4534. // Unset in case somehow written to the real global config
  4535. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4536. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4537. throw err;
  4538. }
  4539. });
  4540. }
  4541. configureSubmoduleAuth() {
  4542. return __awaiter(this, void 0, void 0, function* () {
  4543. // Remove possible previous HTTPS instead of SSH
  4544. yield this.removeGitConfig(this.insteadOfKey, true);
  4545. if (this.settings.persistCredentials) {
  4546. // Configure a placeholder value. This approach avoids the credential being captured
  4547. // by process creation audit events, which are commonly logged. For more information,
  4548. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4549. 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);
  4550. // Replace the placeholder
  4551. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4552. for (const configPath of configPaths) {
  4553. core.debug(`Replacing token placeholder in '${configPath}'`);
  4554. this.replaceTokenPlaceholder(configPath);
  4555. }
  4556. if (this.settings.sshKey) {
  4557. // Configure core.sshCommand
  4558. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4559. }
  4560. else {
  4561. // Configure HTTPS instead of SSH
  4562. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4563. }
  4564. }
  4565. });
  4566. }
  4567. removeAuth() {
  4568. return __awaiter(this, void 0, void 0, function* () {
  4569. yield this.removeSsh();
  4570. yield this.removeToken();
  4571. });
  4572. }
  4573. removeGlobalAuth() {
  4574. return __awaiter(this, void 0, void 0, function* () {
  4575. core.info(`Unsetting HOME override`);
  4576. this.git.removeEnvironmentVariable('HOME');
  4577. yield io.rmRF(this.temporaryHomePath);
  4578. });
  4579. }
  4580. configureSsh() {
  4581. return __awaiter(this, void 0, void 0, function* () {
  4582. if (!this.settings.sshKey) {
  4583. return;
  4584. }
  4585. // Write key
  4586. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4587. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4588. const uniqueId = v4_1.default();
  4589. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4590. stateHelper.setSshKeyPath(this.sshKeyPath);
  4591. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4592. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4593. // Remove inherited permissions on Windows
  4594. if (IS_WINDOWS) {
  4595. const icacls = yield io.which('icacls.exe');
  4596. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4597. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4598. }
  4599. // Write known hosts
  4600. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4601. let userKnownHosts = '';
  4602. try {
  4603. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4604. }
  4605. catch (err) {
  4606. if (err.code !== 'ENOENT') {
  4607. throw err;
  4608. }
  4609. }
  4610. let knownHosts = '';
  4611. if (userKnownHosts) {
  4612. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4613. }
  4614. if (this.settings.sshKnownHosts) {
  4615. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4616. }
  4617. 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`;
  4618. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4619. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4620. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4621. // Configure GIT_SSH_COMMAND
  4622. const sshPath = yield io.which('ssh', true);
  4623. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4624. if (this.settings.sshStrict) {
  4625. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4626. }
  4627. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4628. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4629. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4630. // Configure core.sshCommand
  4631. if (this.settings.persistCredentials) {
  4632. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4633. }
  4634. });
  4635. }
  4636. configureToken(configPath, globalConfig) {
  4637. return __awaiter(this, void 0, void 0, function* () {
  4638. // Validate args
  4639. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4640. // Default config path
  4641. if (!configPath && !globalConfig) {
  4642. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4643. }
  4644. // Configure a placeholder value. This approach avoids the credential being captured
  4645. // by process creation audit events, which are commonly logged. For more information,
  4646. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4647. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4648. // Replace the placeholder
  4649. yield this.replaceTokenPlaceholder(configPath || '');
  4650. });
  4651. }
  4652. replaceTokenPlaceholder(configPath) {
  4653. return __awaiter(this, void 0, void 0, function* () {
  4654. assert.ok(configPath, 'configPath is not defined');
  4655. let content = (yield fs.promises.readFile(configPath)).toString();
  4656. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4657. if (placeholderIndex < 0 ||
  4658. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4659. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4660. }
  4661. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4662. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4663. yield fs.promises.writeFile(configPath, content);
  4664. });
  4665. }
  4666. removeSsh() {
  4667. return __awaiter(this, void 0, void 0, function* () {
  4668. // SSH key
  4669. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4670. if (keyPath) {
  4671. try {
  4672. yield io.rmRF(keyPath);
  4673. }
  4674. catch (err) {
  4675. core.debug(err.message);
  4676. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4677. }
  4678. }
  4679. // SSH known hosts
  4680. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4681. if (knownHostsPath) {
  4682. try {
  4683. yield io.rmRF(knownHostsPath);
  4684. }
  4685. catch (_a) {
  4686. // Intentionally empty
  4687. }
  4688. }
  4689. // SSH command
  4690. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4691. });
  4692. }
  4693. removeToken() {
  4694. return __awaiter(this, void 0, void 0, function* () {
  4695. // HTTP extra header
  4696. yield this.removeGitConfig(this.tokenConfigKey);
  4697. });
  4698. }
  4699. removeGitConfig(configKey, submoduleOnly = false) {
  4700. return __awaiter(this, void 0, void 0, function* () {
  4701. if (!submoduleOnly) {
  4702. if ((yield this.git.configExists(configKey)) &&
  4703. !(yield this.git.tryConfigUnset(configKey))) {
  4704. // Load the config contents
  4705. core.warning(`Failed to remove '${configKey}' from the git config`);
  4706. }
  4707. }
  4708. const pattern = regexpHelper.escape(configKey);
  4709. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4710. });
  4711. }
  4712. }
  4713. /***/ }),
  4714. /***/ 289:
  4715. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4716. "use strict";
  4717. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4718. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4719. return new (P || (P = Promise))(function (resolve, reject) {
  4720. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4721. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4722. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4723. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4724. });
  4725. };
  4726. var __importStar = (this && this.__importStar) || function (mod) {
  4727. if (mod && mod.__esModule) return mod;
  4728. var result = {};
  4729. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4730. result["default"] = mod;
  4731. return result;
  4732. };
  4733. Object.defineProperty(exports, "__esModule", { value: true });
  4734. const core = __importStar(__webpack_require__(470));
  4735. const exec = __importStar(__webpack_require__(986));
  4736. const fshelper = __importStar(__webpack_require__(618));
  4737. const io = __importStar(__webpack_require__(1));
  4738. const path = __importStar(__webpack_require__(622));
  4739. const regexpHelper = __importStar(__webpack_require__(528));
  4740. const retryHelper = __importStar(__webpack_require__(587));
  4741. const git_version_1 = __webpack_require__(559);
  4742. // Auth header not supported before 2.9
  4743. // Wire protocol v2 not supported before 2.18
  4744. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4745. function createCommandManager(workingDirectory, lfs) {
  4746. return __awaiter(this, void 0, void 0, function* () {
  4747. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4748. });
  4749. }
  4750. exports.createCommandManager = createCommandManager;
  4751. class GitCommandManager {
  4752. // Private constructor; use createCommandManager()
  4753. constructor() {
  4754. this.gitEnv = {
  4755. GIT_TERMINAL_PROMPT: '0',
  4756. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4757. };
  4758. this.gitPath = '';
  4759. this.lfs = false;
  4760. this.workingDirectory = '';
  4761. }
  4762. branchDelete(remote, branch) {
  4763. return __awaiter(this, void 0, void 0, function* () {
  4764. const args = ['branch', '--delete', '--force'];
  4765. if (remote) {
  4766. args.push('--remote');
  4767. }
  4768. args.push(branch);
  4769. yield this.execGit(args);
  4770. });
  4771. }
  4772. branchExists(remote, pattern) {
  4773. return __awaiter(this, void 0, void 0, function* () {
  4774. const args = ['branch', '--list'];
  4775. if (remote) {
  4776. args.push('--remote');
  4777. }
  4778. args.push(pattern);
  4779. const output = yield this.execGit(args);
  4780. return !!output.stdout.trim();
  4781. });
  4782. }
  4783. branchList(remote) {
  4784. return __awaiter(this, void 0, void 0, function* () {
  4785. const result = [];
  4786. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4787. // "branch --list" is more difficult when in a detached HEAD state.
  4788. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4789. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4790. const args = ['rev-parse', '--symbolic-full-name'];
  4791. if (remote) {
  4792. args.push('--remotes=origin');
  4793. }
  4794. else {
  4795. args.push('--branches');
  4796. }
  4797. const output = yield this.execGit(args);
  4798. for (let branch of output.stdout.trim().split('\n')) {
  4799. branch = branch.trim();
  4800. if (branch) {
  4801. if (branch.startsWith('refs/heads/')) {
  4802. branch = branch.substr('refs/heads/'.length);
  4803. }
  4804. else if (branch.startsWith('refs/remotes/')) {
  4805. branch = branch.substr('refs/remotes/'.length);
  4806. }
  4807. result.push(branch);
  4808. }
  4809. }
  4810. return result;
  4811. });
  4812. }
  4813. checkout(ref, startPoint) {
  4814. return __awaiter(this, void 0, void 0, function* () {
  4815. const args = ['checkout', '--progress', '--force'];
  4816. if (startPoint) {
  4817. args.push('-B', ref, startPoint);
  4818. }
  4819. else {
  4820. args.push(ref);
  4821. }
  4822. yield this.execGit(args);
  4823. });
  4824. }
  4825. checkoutDetach() {
  4826. return __awaiter(this, void 0, void 0, function* () {
  4827. const args = ['checkout', '--detach'];
  4828. yield this.execGit(args);
  4829. });
  4830. }
  4831. config(configKey, configValue, globalConfig) {
  4832. return __awaiter(this, void 0, void 0, function* () {
  4833. yield this.execGit([
  4834. 'config',
  4835. globalConfig ? '--global' : '--local',
  4836. configKey,
  4837. configValue
  4838. ]);
  4839. });
  4840. }
  4841. configExists(configKey, globalConfig) {
  4842. return __awaiter(this, void 0, void 0, function* () {
  4843. const pattern = regexpHelper.escape(configKey);
  4844. const output = yield this.execGit([
  4845. 'config',
  4846. globalConfig ? '--global' : '--local',
  4847. '--name-only',
  4848. '--get-regexp',
  4849. pattern
  4850. ], true);
  4851. return output.exitCode === 0;
  4852. });
  4853. }
  4854. fetch(fetchDepth, refSpec) {
  4855. return __awaiter(this, void 0, void 0, function* () {
  4856. const args = [
  4857. '-c',
  4858. 'protocol.version=2',
  4859. 'fetch',
  4860. '--no-tags',
  4861. '--prune',
  4862. '--progress',
  4863. '--no-recurse-submodules'
  4864. ];
  4865. if (fetchDepth > 0) {
  4866. args.push(`--depth=${fetchDepth}`);
  4867. }
  4868. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4869. args.push('--unshallow');
  4870. }
  4871. args.push('origin');
  4872. for (const arg of refSpec) {
  4873. args.push(arg);
  4874. }
  4875. const that = this;
  4876. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4877. yield that.execGit(args);
  4878. }));
  4879. });
  4880. }
  4881. getWorkingDirectory() {
  4882. return this.workingDirectory;
  4883. }
  4884. init() {
  4885. return __awaiter(this, void 0, void 0, function* () {
  4886. yield this.execGit(['init', this.workingDirectory]);
  4887. });
  4888. }
  4889. isDetached() {
  4890. return __awaiter(this, void 0, void 0, function* () {
  4891. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  4892. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  4893. return !output.stdout.trim().startsWith('refs/heads/');
  4894. });
  4895. }
  4896. lfsFetch(ref) {
  4897. return __awaiter(this, void 0, void 0, function* () {
  4898. const args = ['lfs', 'fetch', 'origin', ref];
  4899. const that = this;
  4900. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4901. yield that.execGit(args);
  4902. }));
  4903. });
  4904. }
  4905. lfsInstall() {
  4906. return __awaiter(this, void 0, void 0, function* () {
  4907. yield this.execGit(['lfs', 'install', '--local']);
  4908. });
  4909. }
  4910. log1() {
  4911. return __awaiter(this, void 0, void 0, function* () {
  4912. yield this.execGit(['log', '-1']);
  4913. });
  4914. }
  4915. remoteAdd(remoteName, remoteUrl) {
  4916. return __awaiter(this, void 0, void 0, function* () {
  4917. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4918. });
  4919. }
  4920. removeEnvironmentVariable(name) {
  4921. delete this.gitEnv[name];
  4922. }
  4923. setEnvironmentVariable(name, value) {
  4924. this.gitEnv[name] = value;
  4925. }
  4926. submoduleForeach(command, recursive) {
  4927. return __awaiter(this, void 0, void 0, function* () {
  4928. const args = ['submodule', 'foreach'];
  4929. if (recursive) {
  4930. args.push('--recursive');
  4931. }
  4932. args.push(command);
  4933. const output = yield this.execGit(args);
  4934. return output.stdout;
  4935. });
  4936. }
  4937. submoduleSync(recursive) {
  4938. return __awaiter(this, void 0, void 0, function* () {
  4939. const args = ['submodule', 'sync'];
  4940. if (recursive) {
  4941. args.push('--recursive');
  4942. }
  4943. yield this.execGit(args);
  4944. });
  4945. }
  4946. submoduleUpdate(fetchDepth, recursive) {
  4947. return __awaiter(this, void 0, void 0, function* () {
  4948. const args = ['-c', 'protocol.version=2'];
  4949. args.push('submodule', 'update', '--init', '--force');
  4950. if (fetchDepth > 0) {
  4951. args.push(`--depth=${fetchDepth}`);
  4952. }
  4953. if (recursive) {
  4954. args.push('--recursive');
  4955. }
  4956. yield this.execGit(args);
  4957. });
  4958. }
  4959. tagExists(pattern) {
  4960. return __awaiter(this, void 0, void 0, function* () {
  4961. const output = yield this.execGit(['tag', '--list', pattern]);
  4962. return !!output.stdout.trim();
  4963. });
  4964. }
  4965. tryClean() {
  4966. return __awaiter(this, void 0, void 0, function* () {
  4967. const output = yield this.execGit(['clean', '-ffdx'], true);
  4968. return output.exitCode === 0;
  4969. });
  4970. }
  4971. tryConfigUnset(configKey, globalConfig) {
  4972. return __awaiter(this, void 0, void 0, function* () {
  4973. const output = yield this.execGit([
  4974. 'config',
  4975. globalConfig ? '--global' : '--local',
  4976. '--unset-all',
  4977. configKey
  4978. ], true);
  4979. return output.exitCode === 0;
  4980. });
  4981. }
  4982. tryDisableAutomaticGarbageCollection() {
  4983. return __awaiter(this, void 0, void 0, function* () {
  4984. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  4985. return output.exitCode === 0;
  4986. });
  4987. }
  4988. tryGetFetchUrl() {
  4989. return __awaiter(this, void 0, void 0, function* () {
  4990. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  4991. if (output.exitCode !== 0) {
  4992. return '';
  4993. }
  4994. const stdout = output.stdout.trim();
  4995. if (stdout.includes('\n')) {
  4996. return '';
  4997. }
  4998. return stdout;
  4999. });
  5000. }
  5001. tryReset() {
  5002. return __awaiter(this, void 0, void 0, function* () {
  5003. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5004. return output.exitCode === 0;
  5005. });
  5006. }
  5007. static createCommandManager(workingDirectory, lfs) {
  5008. return __awaiter(this, void 0, void 0, function* () {
  5009. const result = new GitCommandManager();
  5010. yield result.initializeCommandManager(workingDirectory, lfs);
  5011. return result;
  5012. });
  5013. }
  5014. execGit(args, allowAllExitCodes = false) {
  5015. return __awaiter(this, void 0, void 0, function* () {
  5016. fshelper.directoryExistsSync(this.workingDirectory, true);
  5017. const result = new GitOutput();
  5018. const env = {};
  5019. for (const key of Object.keys(process.env)) {
  5020. env[key] = process.env[key];
  5021. }
  5022. for (const key of Object.keys(this.gitEnv)) {
  5023. env[key] = this.gitEnv[key];
  5024. }
  5025. const stdout = [];
  5026. const options = {
  5027. cwd: this.workingDirectory,
  5028. env,
  5029. ignoreReturnCode: allowAllExitCodes,
  5030. listeners: {
  5031. stdout: (data) => {
  5032. stdout.push(data.toString());
  5033. }
  5034. }
  5035. };
  5036. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5037. result.stdout = stdout.join('');
  5038. return result;
  5039. });
  5040. }
  5041. initializeCommandManager(workingDirectory, lfs) {
  5042. return __awaiter(this, void 0, void 0, function* () {
  5043. this.workingDirectory = workingDirectory;
  5044. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5045. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5046. this.lfs = lfs;
  5047. if (!this.lfs) {
  5048. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5049. }
  5050. this.gitPath = yield io.which('git', true);
  5051. // Git version
  5052. core.debug('Getting git version');
  5053. let gitVersion = new git_version_1.GitVersion();
  5054. let gitOutput = yield this.execGit(['version']);
  5055. let stdout = gitOutput.stdout.trim();
  5056. if (!stdout.includes('\n')) {
  5057. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5058. if (match) {
  5059. gitVersion = new git_version_1.GitVersion(match[0]);
  5060. }
  5061. }
  5062. if (!gitVersion.isValid()) {
  5063. throw new Error('Unable to determine git version');
  5064. }
  5065. // Minimum git version
  5066. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5067. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5068. }
  5069. if (this.lfs) {
  5070. // Git-lfs version
  5071. core.debug('Getting git-lfs version');
  5072. let gitLfsVersion = new git_version_1.GitVersion();
  5073. const gitLfsPath = yield io.which('git-lfs', true);
  5074. gitOutput = yield this.execGit(['lfs', 'version']);
  5075. stdout = gitOutput.stdout.trim();
  5076. if (!stdout.includes('\n')) {
  5077. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5078. if (match) {
  5079. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5080. }
  5081. }
  5082. if (!gitLfsVersion.isValid()) {
  5083. throw new Error('Unable to determine git-lfs version');
  5084. }
  5085. // Minimum git-lfs version
  5086. // Note:
  5087. // - Auth header not supported before 2.1
  5088. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5089. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5090. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5091. }
  5092. }
  5093. // Set the user agent
  5094. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5095. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5096. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5097. });
  5098. }
  5099. }
  5100. class GitOutput {
  5101. constructor() {
  5102. this.stdout = '';
  5103. this.exitCode = 0;
  5104. }
  5105. }
  5106. /***/ }),
  5107. /***/ 293:
  5108. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5109. "use strict";
  5110. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5111. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5112. return new (P || (P = Promise))(function (resolve, reject) {
  5113. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5114. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5115. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5116. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5117. });
  5118. };
  5119. var __importStar = (this && this.__importStar) || function (mod) {
  5120. if (mod && mod.__esModule) return mod;
  5121. var result = {};
  5122. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5123. result["default"] = mod;
  5124. return result;
  5125. };
  5126. Object.defineProperty(exports, "__esModule", { value: true });
  5127. const core = __importStar(__webpack_require__(470));
  5128. const fsHelper = __importStar(__webpack_require__(618));
  5129. const gitAuthHelper = __importStar(__webpack_require__(287));
  5130. const gitCommandManager = __importStar(__webpack_require__(289));
  5131. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5132. const githubApiHelper = __importStar(__webpack_require__(464));
  5133. const io = __importStar(__webpack_require__(1));
  5134. const path = __importStar(__webpack_require__(622));
  5135. const refHelper = __importStar(__webpack_require__(227));
  5136. const stateHelper = __importStar(__webpack_require__(153));
  5137. const hostname = 'github.com';
  5138. function getSource(settings) {
  5139. return __awaiter(this, void 0, void 0, function* () {
  5140. // Repository URL
  5141. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5142. const repositoryUrl = settings.sshKey
  5143. ? `git@${hostname}:${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}.git`
  5144. : `https://${hostname}/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  5145. // Remove conflicting file path
  5146. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5147. yield io.rmRF(settings.repositoryPath);
  5148. }
  5149. // Create directory
  5150. let isExisting = true;
  5151. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5152. isExisting = false;
  5153. yield io.mkdirP(settings.repositoryPath);
  5154. }
  5155. // Git command manager
  5156. const git = yield getGitCommandManager(settings);
  5157. // Prepare existing directory, otherwise recreate
  5158. if (isExisting) {
  5159. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  5160. }
  5161. if (!git) {
  5162. // Downloading using REST API
  5163. core.info(`The repository will be downloaded using the GitHub REST API`);
  5164. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5165. if (settings.submodules) {
  5166. 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.`);
  5167. }
  5168. else if (settings.sshKey) {
  5169. 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.`);
  5170. }
  5171. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5172. return;
  5173. }
  5174. // Save state for POST action
  5175. stateHelper.setRepositoryPath(settings.repositoryPath);
  5176. // Initialize the repository
  5177. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5178. yield git.init();
  5179. yield git.remoteAdd('origin', repositoryUrl);
  5180. }
  5181. // Disable automatic garbage collection
  5182. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5183. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5184. }
  5185. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5186. try {
  5187. // Configure auth
  5188. yield authHelper.configureAuth();
  5189. // LFS install
  5190. if (settings.lfs) {
  5191. yield git.lfsInstall();
  5192. }
  5193. // Fetch
  5194. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5195. yield git.fetch(settings.fetchDepth, refSpec);
  5196. // Checkout info
  5197. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5198. // LFS fetch
  5199. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5200. // Explicit lfs fetch will fetch lfs objects in parallel.
  5201. if (settings.lfs) {
  5202. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5203. }
  5204. // Checkout
  5205. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5206. // Submodules
  5207. if (settings.submodules) {
  5208. try {
  5209. // Temporarily override global config
  5210. yield authHelper.configureGlobalAuth();
  5211. // Checkout submodules
  5212. yield git.submoduleSync(settings.nestedSubmodules);
  5213. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5214. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5215. // Persist credentials
  5216. if (settings.persistCredentials) {
  5217. yield authHelper.configureSubmoduleAuth();
  5218. }
  5219. }
  5220. finally {
  5221. // Remove temporary global config override
  5222. yield authHelper.removeGlobalAuth();
  5223. }
  5224. }
  5225. // Dump some info about the checked out commit
  5226. yield git.log1();
  5227. }
  5228. finally {
  5229. // Remove auth
  5230. if (!settings.persistCredentials) {
  5231. yield authHelper.removeAuth();
  5232. }
  5233. }
  5234. });
  5235. }
  5236. exports.getSource = getSource;
  5237. function cleanup(repositoryPath) {
  5238. return __awaiter(this, void 0, void 0, function* () {
  5239. // Repo exists?
  5240. if (!repositoryPath ||
  5241. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5242. return;
  5243. }
  5244. let git;
  5245. try {
  5246. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5247. }
  5248. catch (_a) {
  5249. return;
  5250. }
  5251. // Remove auth
  5252. const authHelper = gitAuthHelper.createAuthHelper(git);
  5253. yield authHelper.removeAuth();
  5254. });
  5255. }
  5256. exports.cleanup = cleanup;
  5257. function getGitCommandManager(settings) {
  5258. return __awaiter(this, void 0, void 0, function* () {
  5259. core.info(`Working directory is '${settings.repositoryPath}'`);
  5260. try {
  5261. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5262. }
  5263. catch (err) {
  5264. // Git is required for LFS
  5265. if (settings.lfs) {
  5266. throw err;
  5267. }
  5268. // Otherwise fallback to REST API
  5269. return undefined;
  5270. }
  5271. });
  5272. }
  5273. /***/ }),
  5274. /***/ 294:
  5275. /***/ (function(module, __unusedexports, __webpack_require__) {
  5276. module.exports = parseOptions;
  5277. const { Deprecation } = __webpack_require__(692);
  5278. const { getUserAgent } = __webpack_require__(796);
  5279. const once = __webpack_require__(969);
  5280. const pkg = __webpack_require__(215);
  5281. const deprecateOptionsTimeout = once((log, deprecation) =>
  5282. log.warn(deprecation)
  5283. );
  5284. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5285. const deprecateOptionsHeaders = once((log, deprecation) =>
  5286. log.warn(deprecation)
  5287. );
  5288. function parseOptions(options, log, hook) {
  5289. if (options.headers) {
  5290. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5291. newObj[key.toLowerCase()] = options.headers[key];
  5292. return newObj;
  5293. }, {});
  5294. }
  5295. const clientDefaults = {
  5296. headers: options.headers || {},
  5297. request: options.request || {},
  5298. mediaType: {
  5299. previews: [],
  5300. format: ""
  5301. }
  5302. };
  5303. if (options.baseUrl) {
  5304. clientDefaults.baseUrl = options.baseUrl;
  5305. }
  5306. if (options.userAgent) {
  5307. clientDefaults.headers["user-agent"] = options.userAgent;
  5308. }
  5309. if (options.previews) {
  5310. clientDefaults.mediaType.previews = options.previews;
  5311. }
  5312. if (options.timeZone) {
  5313. clientDefaults.headers["time-zone"] = options.timeZone;
  5314. }
  5315. if (options.timeout) {
  5316. deprecateOptionsTimeout(
  5317. log,
  5318. new Deprecation(
  5319. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5320. )
  5321. );
  5322. clientDefaults.request.timeout = options.timeout;
  5323. }
  5324. if (options.agent) {
  5325. deprecateOptionsAgent(
  5326. log,
  5327. new Deprecation(
  5328. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5329. )
  5330. );
  5331. clientDefaults.request.agent = options.agent;
  5332. }
  5333. if (options.headers) {
  5334. deprecateOptionsHeaders(
  5335. log,
  5336. new Deprecation(
  5337. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5338. )
  5339. );
  5340. }
  5341. const userAgentOption = clientDefaults.headers["user-agent"];
  5342. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5343. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5344. .filter(Boolean)
  5345. .join(" ");
  5346. clientDefaults.request.hook = hook.bind(null, "request");
  5347. return clientDefaults;
  5348. }
  5349. /***/ }),
  5350. /***/ 297:
  5351. /***/ (function(module) {
  5352. module.exports = class HttpError extends Error {
  5353. constructor (message, code, headers) {
  5354. super(message)
  5355. // Maintains proper stack trace (only available on V8)
  5356. /* istanbul ignore next */
  5357. if (Error.captureStackTrace) {
  5358. Error.captureStackTrace(this, this.constructor)
  5359. }
  5360. this.name = 'HttpError'
  5361. this.code = code
  5362. this.headers = headers
  5363. }
  5364. }
  5365. /***/ }),
  5366. /***/ 301:
  5367. /***/ (function(module, __unusedexports, __webpack_require__) {
  5368. /**
  5369. * Some “list” response that can be paginated have a different response structure
  5370. *
  5371. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5372. * /installation/repositories also has `repository_selection`), as well as a key with
  5373. * the list of the items which name varies from endpoint to endpoint:
  5374. *
  5375. * - https://developer.github.com/v3/search/#example (key `items`)
  5376. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5377. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5378. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5379. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5380. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5381. *
  5382. * Octokit normalizes these responses so that paginated results are always returned following
  5383. * the same structure. One challenge is that if the list response has only one page, no Link
  5384. * header is provided, so this header alone is not sufficient to check wether a response is
  5385. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5386. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5387. * property because it also exists in the response of Get the combined status for a specific ref.
  5388. */
  5389. module.exports = normalizePaginatedListResponse;
  5390. const { Deprecation } = __webpack_require__(692);
  5391. const once = __webpack_require__(969);
  5392. const deprecateIncompleteResults = once((log, deprecation) =>
  5393. log.warn(deprecation)
  5394. );
  5395. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5396. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5397. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5398. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5399. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5400. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5401. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5402. function normalizePaginatedListResponse(octokit, url, response) {
  5403. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5404. if (
  5405. !REGEX_IS_SEARCH_PATH.test(path) &&
  5406. !REGEX_IS_CHECKS_PATH.test(path) &&
  5407. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5408. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5409. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5410. ) {
  5411. return;
  5412. }
  5413. // keep the additional properties intact to avoid a breaking change,
  5414. // but log a deprecation warning when accessed
  5415. const incompleteResults = response.data.incomplete_results;
  5416. const repositorySelection = response.data.repository_selection;
  5417. const totalCount = response.data.total_count;
  5418. delete response.data.incomplete_results;
  5419. delete response.data.repository_selection;
  5420. delete response.data.total_count;
  5421. const namespaceKey = Object.keys(response.data)[0];
  5422. response.data = response.data[namespaceKey];
  5423. Object.defineProperty(response.data, namespaceKey, {
  5424. get() {
  5425. deprecateNamespace(
  5426. octokit.log,
  5427. new Deprecation(
  5428. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5429. )
  5430. );
  5431. return response.data;
  5432. }
  5433. });
  5434. if (typeof incompleteResults !== "undefined") {
  5435. Object.defineProperty(response.data, "incomplete_results", {
  5436. get() {
  5437. deprecateIncompleteResults(
  5438. octokit.log,
  5439. new Deprecation(
  5440. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5441. )
  5442. );
  5443. return incompleteResults;
  5444. }
  5445. });
  5446. }
  5447. if (typeof repositorySelection !== "undefined") {
  5448. Object.defineProperty(response.data, "repository_selection", {
  5449. get() {
  5450. deprecateTotalCount(
  5451. octokit.log,
  5452. new Deprecation(
  5453. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5454. )
  5455. );
  5456. return repositorySelection;
  5457. }
  5458. });
  5459. }
  5460. Object.defineProperty(response.data, "total_count", {
  5461. get() {
  5462. deprecateTotalCount(
  5463. octokit.log,
  5464. new Deprecation(
  5465. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5466. )
  5467. );
  5468. return totalCount;
  5469. }
  5470. });
  5471. }
  5472. /***/ }),
  5473. /***/ 323:
  5474. /***/ (function(module) {
  5475. "use strict";
  5476. var isStream = module.exports = function (stream) {
  5477. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5478. };
  5479. isStream.writable = function (stream) {
  5480. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5481. };
  5482. isStream.readable = function (stream) {
  5483. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5484. };
  5485. isStream.duplex = function (stream) {
  5486. return isStream.writable(stream) && isStream.readable(stream);
  5487. };
  5488. isStream.transform = function (stream) {
  5489. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5490. };
  5491. /***/ }),
  5492. /***/ 335:
  5493. /***/ (function(module, __unusedexports, __webpack_require__) {
  5494. module.exports = __webpack_require__(179);
  5495. /***/ }),
  5496. /***/ 336:
  5497. /***/ (function(module, __unusedexports, __webpack_require__) {
  5498. module.exports = hasLastPage
  5499. const deprecate = __webpack_require__(370)
  5500. const getPageLinks = __webpack_require__(577)
  5501. function hasLastPage (link) {
  5502. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5503. return getPageLinks(link).last
  5504. }
  5505. /***/ }),
  5506. /***/ 348:
  5507. /***/ (function(module, __unusedexports, __webpack_require__) {
  5508. "use strict";
  5509. module.exports = validate;
  5510. const { RequestError } = __webpack_require__(463);
  5511. const get = __webpack_require__(854);
  5512. const set = __webpack_require__(883);
  5513. function validate(octokit, options) {
  5514. if (!options.request.validate) {
  5515. return;
  5516. }
  5517. const { validate: params } = options.request;
  5518. Object.keys(params).forEach(parameterName => {
  5519. const parameter = get(params, parameterName);
  5520. const expectedType = parameter.type;
  5521. let parentParameterName;
  5522. let parentValue;
  5523. let parentParamIsPresent = true;
  5524. let parentParameterIsArray = false;
  5525. if (/\./.test(parameterName)) {
  5526. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5527. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5528. if (parentParameterIsArray) {
  5529. parentParameterName = parentParameterName.slice(0, -2);
  5530. }
  5531. parentValue = get(options, parentParameterName);
  5532. parentParamIsPresent =
  5533. parentParameterName === "headers" ||
  5534. (typeof parentValue === "object" && parentValue !== null);
  5535. }
  5536. const values = parentParameterIsArray
  5537. ? (get(options, parentParameterName) || []).map(
  5538. value => value[parameterName.split(/\./).pop()]
  5539. )
  5540. : [get(options, parameterName)];
  5541. values.forEach((value, i) => {
  5542. const valueIsPresent = typeof value !== "undefined";
  5543. const valueIsNull = value === null;
  5544. const currentParameterName = parentParameterIsArray
  5545. ? parameterName.replace(/\[\]/, `[${i}]`)
  5546. : parameterName;
  5547. if (!parameter.required && !valueIsPresent) {
  5548. return;
  5549. }
  5550. // if the parent parameter is of type object but allows null
  5551. // then the child parameters can be ignored
  5552. if (!parentParamIsPresent) {
  5553. return;
  5554. }
  5555. if (parameter.allowNull && valueIsNull) {
  5556. return;
  5557. }
  5558. if (!parameter.allowNull && valueIsNull) {
  5559. throw new RequestError(
  5560. `'${currentParameterName}' cannot be null`,
  5561. 400,
  5562. {
  5563. request: options
  5564. }
  5565. );
  5566. }
  5567. if (parameter.required && !valueIsPresent) {
  5568. throw new RequestError(
  5569. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5570. value
  5571. )}`,
  5572. 400,
  5573. {
  5574. request: options
  5575. }
  5576. );
  5577. }
  5578. // parse to integer before checking for enum
  5579. // so that string "1" will match enum with number 1
  5580. if (expectedType === "integer") {
  5581. const unparsedValue = value;
  5582. value = parseInt(value, 10);
  5583. if (isNaN(value)) {
  5584. throw new RequestError(
  5585. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5586. unparsedValue
  5587. )} is NaN`,
  5588. 400,
  5589. {
  5590. request: options
  5591. }
  5592. );
  5593. }
  5594. }
  5595. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5596. throw new RequestError(
  5597. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5598. value
  5599. )}`,
  5600. 400,
  5601. {
  5602. request: options
  5603. }
  5604. );
  5605. }
  5606. if (parameter.validation) {
  5607. const regex = new RegExp(parameter.validation);
  5608. if (!regex.test(value)) {
  5609. throw new RequestError(
  5610. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5611. value
  5612. )}`,
  5613. 400,
  5614. {
  5615. request: options
  5616. }
  5617. );
  5618. }
  5619. }
  5620. if (expectedType === "object" && typeof value === "string") {
  5621. try {
  5622. value = JSON.parse(value);
  5623. } catch (exception) {
  5624. throw new RequestError(
  5625. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5626. value
  5627. )}`,
  5628. 400,
  5629. {
  5630. request: options
  5631. }
  5632. );
  5633. }
  5634. }
  5635. set(options, parameter.mapTo || currentParameterName, value);
  5636. });
  5637. });
  5638. return options;
  5639. }
  5640. /***/ }),
  5641. /***/ 349:
  5642. /***/ (function(module, __unusedexports, __webpack_require__) {
  5643. module.exports = authenticationRequestError;
  5644. const { RequestError } = __webpack_require__(463);
  5645. function authenticationRequestError(state, error, options) {
  5646. /* istanbul ignore next */
  5647. if (!error.headers) throw error;
  5648. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5649. // handle "2FA required" error only
  5650. if (error.status !== 401 || !otpRequired) {
  5651. throw error;
  5652. }
  5653. if (
  5654. error.status === 401 &&
  5655. otpRequired &&
  5656. error.request &&
  5657. error.request.headers["x-github-otp"]
  5658. ) {
  5659. throw new RequestError(
  5660. "Invalid one-time password for two-factor authentication",
  5661. 401,
  5662. {
  5663. headers: error.headers,
  5664. request: options
  5665. }
  5666. );
  5667. }
  5668. if (typeof state.auth.on2fa !== "function") {
  5669. throw new RequestError(
  5670. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5671. 401,
  5672. {
  5673. headers: error.headers,
  5674. request: options
  5675. }
  5676. );
  5677. }
  5678. return Promise.resolve()
  5679. .then(() => {
  5680. return state.auth.on2fa();
  5681. })
  5682. .then(oneTimePassword => {
  5683. const newOptions = Object.assign(options, {
  5684. headers: Object.assign(
  5685. { "x-github-otp": oneTimePassword },
  5686. options.headers
  5687. )
  5688. });
  5689. return state.octokit.request(newOptions);
  5690. });
  5691. }
  5692. /***/ }),
  5693. /***/ 357:
  5694. /***/ (function(module) {
  5695. module.exports = require("assert");
  5696. /***/ }),
  5697. /***/ 363:
  5698. /***/ (function(module) {
  5699. module.exports = register
  5700. function register (state, name, method, options) {
  5701. if (typeof method !== 'function') {
  5702. throw new Error('method for before hook must be a function')
  5703. }
  5704. if (!options) {
  5705. options = {}
  5706. }
  5707. if (Array.isArray(name)) {
  5708. return name.reverse().reduce(function (callback, name) {
  5709. return register.bind(null, state, name, callback, options)
  5710. }, method)()
  5711. }
  5712. return Promise.resolve()
  5713. .then(function () {
  5714. if (!state.registry[name]) {
  5715. return method(options)
  5716. }
  5717. return (state.registry[name]).reduce(function (method, registered) {
  5718. return registered.hook.bind(null, method, options)
  5719. }, method)()
  5720. })
  5721. }
  5722. /***/ }),
  5723. /***/ 368:
  5724. /***/ (function(module) {
  5725. module.exports = function atob(str) {
  5726. return Buffer.from(str, 'base64').toString('binary')
  5727. }
  5728. /***/ }),
  5729. /***/ 370:
  5730. /***/ (function(module) {
  5731. module.exports = deprecate
  5732. const loggedMessages = {}
  5733. function deprecate (message) {
  5734. if (loggedMessages[message]) {
  5735. return
  5736. }
  5737. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5738. loggedMessages[message] = 1
  5739. }
  5740. /***/ }),
  5741. /***/ 372:
  5742. /***/ (function(module) {
  5743. module.exports = octokitDebug;
  5744. function octokitDebug(octokit) {
  5745. octokit.hook.wrap("request", (request, options) => {
  5746. octokit.log.debug("request", options);
  5747. const start = Date.now();
  5748. const requestOptions = octokit.request.endpoint.parse(options);
  5749. const path = requestOptions.url.replace(options.baseUrl, "");
  5750. return request(options)
  5751. .then(response => {
  5752. octokit.log.info(
  5753. `${requestOptions.method} ${path} - ${
  5754. response.status
  5755. } in ${Date.now() - start}ms`
  5756. );
  5757. return response;
  5758. })
  5759. .catch(error => {
  5760. octokit.log.info(
  5761. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5762. start}ms`
  5763. );
  5764. throw error;
  5765. });
  5766. });
  5767. }
  5768. /***/ }),
  5769. /***/ 385:
  5770. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5771. "use strict";
  5772. Object.defineProperty(exports, '__esModule', { value: true });
  5773. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5774. var isPlainObject = _interopDefault(__webpack_require__(696));
  5775. var universalUserAgent = __webpack_require__(796);
  5776. function lowercaseKeys(object) {
  5777. if (!object) {
  5778. return {};
  5779. }
  5780. return Object.keys(object).reduce((newObj, key) => {
  5781. newObj[key.toLowerCase()] = object[key];
  5782. return newObj;
  5783. }, {});
  5784. }
  5785. function mergeDeep(defaults, options) {
  5786. const result = Object.assign({}, defaults);
  5787. Object.keys(options).forEach(key => {
  5788. if (isPlainObject(options[key])) {
  5789. if (!(key in defaults)) Object.assign(result, {
  5790. [key]: options[key]
  5791. });else result[key] = mergeDeep(defaults[key], options[key]);
  5792. } else {
  5793. Object.assign(result, {
  5794. [key]: options[key]
  5795. });
  5796. }
  5797. });
  5798. return result;
  5799. }
  5800. function merge(defaults, route, options) {
  5801. if (typeof route === "string") {
  5802. let [method, url] = route.split(" ");
  5803. options = Object.assign(url ? {
  5804. method,
  5805. url
  5806. } : {
  5807. url: method
  5808. }, options);
  5809. } else {
  5810. options = Object.assign({}, route);
  5811. } // lowercase header names before merging with defaults to avoid duplicates
  5812. options.headers = lowercaseKeys(options.headers);
  5813. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5814. if (defaults && defaults.mediaType.previews.length) {
  5815. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5816. }
  5817. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5818. return mergedOptions;
  5819. }
  5820. function addQueryParameters(url, parameters) {
  5821. const separator = /\?/.test(url) ? "&" : "?";
  5822. const names = Object.keys(parameters);
  5823. if (names.length === 0) {
  5824. return url;
  5825. }
  5826. return url + separator + names.map(name => {
  5827. if (name === "q") {
  5828. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5829. }
  5830. return `${name}=${encodeURIComponent(parameters[name])}`;
  5831. }).join("&");
  5832. }
  5833. const urlVariableRegex = /\{[^}]+\}/g;
  5834. function removeNonChars(variableName) {
  5835. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5836. }
  5837. function extractUrlVariableNames(url) {
  5838. const matches = url.match(urlVariableRegex);
  5839. if (!matches) {
  5840. return [];
  5841. }
  5842. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5843. }
  5844. function omit(object, keysToOmit) {
  5845. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5846. obj[key] = object[key];
  5847. return obj;
  5848. }, {});
  5849. }
  5850. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5851. // TODO: create separate package.
  5852. //
  5853. // Copyright (c) 2012-2014, Bram Stein
  5854. // All rights reserved.
  5855. // Redistribution and use in source and binary forms, with or without
  5856. // modification, are permitted provided that the following conditions
  5857. // are met:
  5858. // 1. Redistributions of source code must retain the above copyright
  5859. // notice, this list of conditions and the following disclaimer.
  5860. // 2. Redistributions in binary form must reproduce the above copyright
  5861. // notice, this list of conditions and the following disclaimer in the
  5862. // documentation and/or other materials provided with the distribution.
  5863. // 3. The name of the author may not be used to endorse or promote products
  5864. // derived from this software without specific prior written permission.
  5865. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5866. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5867. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5868. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5869. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5870. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5871. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5872. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5873. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5874. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5875. /* istanbul ignore file */
  5876. function encodeReserved(str) {
  5877. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5878. if (!/%[0-9A-Fa-f]/.test(part)) {
  5879. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5880. }
  5881. return part;
  5882. }).join("");
  5883. }
  5884. function encodeUnreserved(str) {
  5885. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5886. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5887. });
  5888. }
  5889. function encodeValue(operator, value, key) {
  5890. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5891. if (key) {
  5892. return encodeUnreserved(key) + "=" + value;
  5893. } else {
  5894. return value;
  5895. }
  5896. }
  5897. function isDefined(value) {
  5898. return value !== undefined && value !== null;
  5899. }
  5900. function isKeyOperator(operator) {
  5901. return operator === ";" || operator === "&" || operator === "?";
  5902. }
  5903. function getValues(context, operator, key, modifier) {
  5904. var value = context[key],
  5905. result = [];
  5906. if (isDefined(value) && value !== "") {
  5907. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5908. value = value.toString();
  5909. if (modifier && modifier !== "*") {
  5910. value = value.substring(0, parseInt(modifier, 10));
  5911. }
  5912. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5913. } else {
  5914. if (modifier === "*") {
  5915. if (Array.isArray(value)) {
  5916. value.filter(isDefined).forEach(function (value) {
  5917. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5918. });
  5919. } else {
  5920. Object.keys(value).forEach(function (k) {
  5921. if (isDefined(value[k])) {
  5922. result.push(encodeValue(operator, value[k], k));
  5923. }
  5924. });
  5925. }
  5926. } else {
  5927. const tmp = [];
  5928. if (Array.isArray(value)) {
  5929. value.filter(isDefined).forEach(function (value) {
  5930. tmp.push(encodeValue(operator, value));
  5931. });
  5932. } else {
  5933. Object.keys(value).forEach(function (k) {
  5934. if (isDefined(value[k])) {
  5935. tmp.push(encodeUnreserved(k));
  5936. tmp.push(encodeValue(operator, value[k].toString()));
  5937. }
  5938. });
  5939. }
  5940. if (isKeyOperator(operator)) {
  5941. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5942. } else if (tmp.length !== 0) {
  5943. result.push(tmp.join(","));
  5944. }
  5945. }
  5946. }
  5947. } else {
  5948. if (operator === ";") {
  5949. if (isDefined(value)) {
  5950. result.push(encodeUnreserved(key));
  5951. }
  5952. } else if (value === "" && (operator === "&" || operator === "?")) {
  5953. result.push(encodeUnreserved(key) + "=");
  5954. } else if (value === "") {
  5955. result.push("");
  5956. }
  5957. }
  5958. return result;
  5959. }
  5960. function parseUrl(template) {
  5961. return {
  5962. expand: expand.bind(null, template)
  5963. };
  5964. }
  5965. function expand(template, context) {
  5966. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5967. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5968. if (expression) {
  5969. let operator = "";
  5970. const values = [];
  5971. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5972. operator = expression.charAt(0);
  5973. expression = expression.substr(1);
  5974. }
  5975. expression.split(/,/g).forEach(function (variable) {
  5976. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5977. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5978. });
  5979. if (operator && operator !== "+") {
  5980. var separator = ",";
  5981. if (operator === "?") {
  5982. separator = "&";
  5983. } else if (operator !== "#") {
  5984. separator = operator;
  5985. }
  5986. return (values.length !== 0 ? operator : "") + values.join(separator);
  5987. } else {
  5988. return values.join(",");
  5989. }
  5990. } else {
  5991. return encodeReserved(literal);
  5992. }
  5993. });
  5994. }
  5995. function parse(options) {
  5996. // https://fetch.spec.whatwg.org/#methods
  5997. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5998. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5999. let headers = Object.assign({}, options.headers);
  6000. let body;
  6001. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6002. const urlVariableNames = extractUrlVariableNames(url);
  6003. url = parseUrl(url).expand(parameters);
  6004. if (!/^http/.test(url)) {
  6005. url = options.baseUrl + url;
  6006. }
  6007. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6008. const remainingParameters = omit(parameters, omittedParameters);
  6009. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6010. if (!isBinaryRequset) {
  6011. if (options.mediaType.format) {
  6012. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6013. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6014. }
  6015. if (options.mediaType.previews.length) {
  6016. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6017. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6018. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6019. return `application/vnd.github.${preview}-preview${format}`;
  6020. }).join(",");
  6021. }
  6022. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6023. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6024. if (["GET", "HEAD"].includes(method)) {
  6025. url = addQueryParameters(url, remainingParameters);
  6026. } else {
  6027. if ("data" in remainingParameters) {
  6028. body = remainingParameters.data;
  6029. } else {
  6030. if (Object.keys(remainingParameters).length) {
  6031. body = remainingParameters;
  6032. } else {
  6033. headers["content-length"] = 0;
  6034. }
  6035. }
  6036. } // default content-type for JSON if body is set
  6037. if (!headers["content-type"] && typeof body !== "undefined") {
  6038. headers["content-type"] = "application/json; charset=utf-8";
  6039. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6040. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6041. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6042. body = "";
  6043. } // Only return body/request keys if present
  6044. return Object.assign({
  6045. method,
  6046. url,
  6047. headers
  6048. }, typeof body !== "undefined" ? {
  6049. body
  6050. } : null, options.request ? {
  6051. request: options.request
  6052. } : null);
  6053. }
  6054. function endpointWithDefaults(defaults, route, options) {
  6055. return parse(merge(defaults, route, options));
  6056. }
  6057. function withDefaults(oldDefaults, newDefaults) {
  6058. const DEFAULTS = merge(oldDefaults, newDefaults);
  6059. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6060. return Object.assign(endpoint, {
  6061. DEFAULTS,
  6062. defaults: withDefaults.bind(null, DEFAULTS),
  6063. merge: merge.bind(null, DEFAULTS),
  6064. parse
  6065. });
  6066. }
  6067. const VERSION = "5.5.1";
  6068. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6069. // So we use RequestParameters and add method as additional required property.
  6070. const DEFAULTS = {
  6071. method: "GET",
  6072. baseUrl: "https://api.github.com",
  6073. headers: {
  6074. accept: "application/vnd.github.v3+json",
  6075. "user-agent": userAgent
  6076. },
  6077. mediaType: {
  6078. format: "",
  6079. previews: []
  6080. }
  6081. };
  6082. const endpoint = withDefaults(null, DEFAULTS);
  6083. exports.endpoint = endpoint;
  6084. //# sourceMappingURL=index.js.map
  6085. /***/ }),
  6086. /***/ 389:
  6087. /***/ (function(module, __unusedexports, __webpack_require__) {
  6088. "use strict";
  6089. const fs = __webpack_require__(747);
  6090. const shebangCommand = __webpack_require__(866);
  6091. function readShebang(command) {
  6092. // Read the first 150 bytes from the file
  6093. const size = 150;
  6094. let buffer;
  6095. if (Buffer.alloc) {
  6096. // Node.js v4.5+ / v5.10+
  6097. buffer = Buffer.alloc(size);
  6098. } else {
  6099. // Old Node.js API
  6100. buffer = new Buffer(size);
  6101. buffer.fill(0); // zero-fill
  6102. }
  6103. let fd;
  6104. try {
  6105. fd = fs.openSync(command, 'r');
  6106. fs.readSync(fd, buffer, 0, size, 0);
  6107. fs.closeSync(fd);
  6108. } catch (e) { /* Empty */ }
  6109. // Attempt to extract shebang (null is returned if not a shebang)
  6110. return shebangCommand(buffer.toString());
  6111. }
  6112. module.exports = readShebang;
  6113. /***/ }),
  6114. /***/ 402:
  6115. /***/ (function(module, __unusedexports, __webpack_require__) {
  6116. module.exports = Octokit;
  6117. const { request } = __webpack_require__(753);
  6118. const Hook = __webpack_require__(523);
  6119. const parseClientOptions = __webpack_require__(294);
  6120. function Octokit(plugins, options) {
  6121. options = options || {};
  6122. const hook = new Hook.Collection();
  6123. const log = Object.assign(
  6124. {
  6125. debug: () => {},
  6126. info: () => {},
  6127. warn: console.warn,
  6128. error: console.error
  6129. },
  6130. options && options.log
  6131. );
  6132. const api = {
  6133. hook,
  6134. log,
  6135. request: request.defaults(parseClientOptions(options, log, hook))
  6136. };
  6137. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6138. return api;
  6139. }
  6140. /***/ }),
  6141. /***/ 413:
  6142. /***/ (function(module) {
  6143. module.exports = require("stream");
  6144. /***/ }),
  6145. /***/ 417:
  6146. /***/ (function(module) {
  6147. module.exports = require("crypto");
  6148. /***/ }),
  6149. /***/ 427:
  6150. /***/ (function(module, __unusedexports, __webpack_require__) {
  6151. "use strict";
  6152. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6153. // In that case, fall back to a deprecated internal.
  6154. const util = __webpack_require__(669);
  6155. let uv;
  6156. if (typeof util.getSystemErrorName === 'function') {
  6157. module.exports = util.getSystemErrorName;
  6158. } else {
  6159. try {
  6160. uv = process.binding('uv');
  6161. if (typeof uv.errname !== 'function') {
  6162. throw new TypeError('uv.errname is not a function');
  6163. }
  6164. } catch (err) {
  6165. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6166. uv = null;
  6167. }
  6168. module.exports = code => errname(uv, code);
  6169. }
  6170. // Used for testing the fallback behavior
  6171. module.exports.__test__ = errname;
  6172. function errname(uv, code) {
  6173. if (uv) {
  6174. return uv.errname(code);
  6175. }
  6176. if (!(code < 0)) {
  6177. throw new Error('err >= 0');
  6178. }
  6179. return `Unknown system error ${code}`;
  6180. }
  6181. /***/ }),
  6182. /***/ 430:
  6183. /***/ (function(module, __unusedexports, __webpack_require__) {
  6184. module.exports = octokitValidate;
  6185. const validate = __webpack_require__(348);
  6186. function octokitValidate(octokit) {
  6187. octokit.hook.before("request", validate.bind(null, octokit));
  6188. }
  6189. /***/ }),
  6190. /***/ 431:
  6191. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6192. "use strict";
  6193. Object.defineProperty(exports, "__esModule", { value: true });
  6194. const os = __webpack_require__(87);
  6195. /**
  6196. * Commands
  6197. *
  6198. * Command Format:
  6199. * ##[name key=value;key=value]message
  6200. *
  6201. * Examples:
  6202. * ##[warning]This is the user warning message
  6203. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6204. */
  6205. function issueCommand(command, properties, message) {
  6206. const cmd = new Command(command, properties, message);
  6207. process.stdout.write(cmd.toString() + os.EOL);
  6208. }
  6209. exports.issueCommand = issueCommand;
  6210. function issue(name, message = '') {
  6211. issueCommand(name, {}, message);
  6212. }
  6213. exports.issue = issue;
  6214. const CMD_STRING = '::';
  6215. class Command {
  6216. constructor(command, properties, message) {
  6217. if (!command) {
  6218. command = 'missing.command';
  6219. }
  6220. this.command = command;
  6221. this.properties = properties;
  6222. this.message = message;
  6223. }
  6224. toString() {
  6225. let cmdStr = CMD_STRING + this.command;
  6226. if (this.properties && Object.keys(this.properties).length > 0) {
  6227. cmdStr += ' ';
  6228. for (const key in this.properties) {
  6229. if (this.properties.hasOwnProperty(key)) {
  6230. const val = this.properties[key];
  6231. if (val) {
  6232. // safely append the val - avoid blowing up when attempting to
  6233. // call .replace() if message is not a string for some reason
  6234. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6235. }
  6236. }
  6237. }
  6238. }
  6239. cmdStr += CMD_STRING;
  6240. // safely append the message - avoid blowing up when attempting to
  6241. // call .replace() if message is not a string for some reason
  6242. const message = `${this.message || ''}`;
  6243. cmdStr += escapeData(message);
  6244. return cmdStr;
  6245. }
  6246. }
  6247. function escapeData(s) {
  6248. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6249. }
  6250. function escape(s) {
  6251. return s
  6252. .replace(/\r/g, '%0D')
  6253. .replace(/\n/g, '%0A')
  6254. .replace(/]/g, '%5D')
  6255. .replace(/;/g, '%3B');
  6256. }
  6257. //# sourceMappingURL=command.js.map
  6258. /***/ }),
  6259. /***/ 438:
  6260. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6261. "use strict";
  6262. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6263. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6264. return new (P || (P = Promise))(function (resolve, reject) {
  6265. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6266. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6267. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6268. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6269. });
  6270. };
  6271. var __importStar = (this && this.__importStar) || function (mod) {
  6272. if (mod && mod.__esModule) return mod;
  6273. var result = {};
  6274. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6275. result["default"] = mod;
  6276. return result;
  6277. };
  6278. Object.defineProperty(exports, "__esModule", { value: true });
  6279. const core = __importStar(__webpack_require__(470));
  6280. const fs = __importStar(__webpack_require__(747));
  6281. const fsHelper = __importStar(__webpack_require__(618));
  6282. const io = __importStar(__webpack_require__(1));
  6283. const path = __importStar(__webpack_require__(622));
  6284. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  6285. return __awaiter(this, void 0, void 0, function* () {
  6286. let remove = false;
  6287. // Check whether using git or REST API
  6288. if (!git) {
  6289. remove = true;
  6290. }
  6291. // Fetch URL does not match
  6292. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6293. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6294. remove = true;
  6295. }
  6296. else {
  6297. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6298. const lockPaths = [
  6299. path.join(repositoryPath, '.git', 'index.lock'),
  6300. path.join(repositoryPath, '.git', 'shallow.lock')
  6301. ];
  6302. for (const lockPath of lockPaths) {
  6303. try {
  6304. yield io.rmRF(lockPath);
  6305. }
  6306. catch (error) {
  6307. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6308. }
  6309. }
  6310. try {
  6311. // Checkout detached HEAD
  6312. if (!(yield git.isDetached())) {
  6313. yield git.checkoutDetach();
  6314. }
  6315. // Remove all refs/heads/*
  6316. let branches = yield git.branchList(false);
  6317. for (const branch of branches) {
  6318. yield git.branchDelete(false, branch);
  6319. }
  6320. // Remove all refs/remotes/origin/* to avoid conflicts
  6321. branches = yield git.branchList(true);
  6322. for (const branch of branches) {
  6323. yield git.branchDelete(true, branch);
  6324. }
  6325. // Clean
  6326. if (clean) {
  6327. if (!(yield git.tryClean())) {
  6328. 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}'.`);
  6329. remove = true;
  6330. }
  6331. else if (!(yield git.tryReset())) {
  6332. remove = true;
  6333. }
  6334. if (remove) {
  6335. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6336. }
  6337. }
  6338. }
  6339. catch (error) {
  6340. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6341. remove = true;
  6342. }
  6343. }
  6344. if (remove) {
  6345. // Delete the contents of the directory. Don't delete the directory itself
  6346. // since it might be the current working directory.
  6347. core.info(`Deleting the contents of '${repositoryPath}'`);
  6348. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6349. yield io.rmRF(path.join(repositoryPath, file));
  6350. }
  6351. }
  6352. });
  6353. }
  6354. exports.prepareExistingDirectory = prepareExistingDirectory;
  6355. /***/ }),
  6356. /***/ 453:
  6357. /***/ (function(module, __unusedexports, __webpack_require__) {
  6358. var once = __webpack_require__(969)
  6359. var eos = __webpack_require__(562)
  6360. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6361. var noop = function () {}
  6362. var ancient = /^v?\.0/.test(process.version)
  6363. var isFn = function (fn) {
  6364. return typeof fn === 'function'
  6365. }
  6366. var isFS = function (stream) {
  6367. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6368. if (!fs) return false // browser
  6369. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6370. }
  6371. var isRequest = function (stream) {
  6372. return stream.setHeader && isFn(stream.abort)
  6373. }
  6374. var destroyer = function (stream, reading, writing, callback) {
  6375. callback = once(callback)
  6376. var closed = false
  6377. stream.on('close', function () {
  6378. closed = true
  6379. })
  6380. eos(stream, {readable: reading, writable: writing}, function (err) {
  6381. if (err) return callback(err)
  6382. closed = true
  6383. callback()
  6384. })
  6385. var destroyed = false
  6386. return function (err) {
  6387. if (closed) return
  6388. if (destroyed) return
  6389. destroyed = true
  6390. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6391. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6392. if (isFn(stream.destroy)) return stream.destroy()
  6393. callback(err || new Error('stream was destroyed'))
  6394. }
  6395. }
  6396. var call = function (fn) {
  6397. fn()
  6398. }
  6399. var pipe = function (from, to) {
  6400. return from.pipe(to)
  6401. }
  6402. var pump = function () {
  6403. var streams = Array.prototype.slice.call(arguments)
  6404. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6405. if (Array.isArray(streams[0])) streams = streams[0]
  6406. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6407. var error
  6408. var destroys = streams.map(function (stream, i) {
  6409. var reading = i < streams.length - 1
  6410. var writing = i > 0
  6411. return destroyer(stream, reading, writing, function (err) {
  6412. if (!error) error = err
  6413. if (err) destroys.forEach(call)
  6414. if (reading) return
  6415. destroys.forEach(call)
  6416. callback(error)
  6417. })
  6418. })
  6419. return streams.reduce(pipe)
  6420. }
  6421. module.exports = pump
  6422. /***/ }),
  6423. /***/ 454:
  6424. /***/ (function(module, exports, __webpack_require__) {
  6425. "use strict";
  6426. Object.defineProperty(exports, '__esModule', { value: true });
  6427. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6428. var Stream = _interopDefault(__webpack_require__(413));
  6429. var http = _interopDefault(__webpack_require__(605));
  6430. var Url = _interopDefault(__webpack_require__(835));
  6431. var https = _interopDefault(__webpack_require__(211));
  6432. var zlib = _interopDefault(__webpack_require__(761));
  6433. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6434. // fix for "Readable" isn't a named export issue
  6435. const Readable = Stream.Readable;
  6436. const BUFFER = Symbol('buffer');
  6437. const TYPE = Symbol('type');
  6438. class Blob {
  6439. constructor() {
  6440. this[TYPE] = '';
  6441. const blobParts = arguments[0];
  6442. const options = arguments[1];
  6443. const buffers = [];
  6444. let size = 0;
  6445. if (blobParts) {
  6446. const a = blobParts;
  6447. const length = Number(a.length);
  6448. for (let i = 0; i < length; i++) {
  6449. const element = a[i];
  6450. let buffer;
  6451. if (element instanceof Buffer) {
  6452. buffer = element;
  6453. } else if (ArrayBuffer.isView(element)) {
  6454. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6455. } else if (element instanceof ArrayBuffer) {
  6456. buffer = Buffer.from(element);
  6457. } else if (element instanceof Blob) {
  6458. buffer = element[BUFFER];
  6459. } else {
  6460. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6461. }
  6462. size += buffer.length;
  6463. buffers.push(buffer);
  6464. }
  6465. }
  6466. this[BUFFER] = Buffer.concat(buffers);
  6467. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6468. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6469. this[TYPE] = type;
  6470. }
  6471. }
  6472. get size() {
  6473. return this[BUFFER].length;
  6474. }
  6475. get type() {
  6476. return this[TYPE];
  6477. }
  6478. text() {
  6479. return Promise.resolve(this[BUFFER].toString());
  6480. }
  6481. arrayBuffer() {
  6482. const buf = this[BUFFER];
  6483. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6484. return Promise.resolve(ab);
  6485. }
  6486. stream() {
  6487. const readable = new Readable();
  6488. readable._read = function () {};
  6489. readable.push(this[BUFFER]);
  6490. readable.push(null);
  6491. return readable;
  6492. }
  6493. toString() {
  6494. return '[object Blob]';
  6495. }
  6496. slice() {
  6497. const size = this.size;
  6498. const start = arguments[0];
  6499. const end = arguments[1];
  6500. let relativeStart, relativeEnd;
  6501. if (start === undefined) {
  6502. relativeStart = 0;
  6503. } else if (start < 0) {
  6504. relativeStart = Math.max(size + start, 0);
  6505. } else {
  6506. relativeStart = Math.min(start, size);
  6507. }
  6508. if (end === undefined) {
  6509. relativeEnd = size;
  6510. } else if (end < 0) {
  6511. relativeEnd = Math.max(size + end, 0);
  6512. } else {
  6513. relativeEnd = Math.min(end, size);
  6514. }
  6515. const span = Math.max(relativeEnd - relativeStart, 0);
  6516. const buffer = this[BUFFER];
  6517. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6518. const blob = new Blob([], { type: arguments[2] });
  6519. blob[BUFFER] = slicedBuffer;
  6520. return blob;
  6521. }
  6522. }
  6523. Object.defineProperties(Blob.prototype, {
  6524. size: { enumerable: true },
  6525. type: { enumerable: true },
  6526. slice: { enumerable: true }
  6527. });
  6528. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6529. value: 'Blob',
  6530. writable: false,
  6531. enumerable: false,
  6532. configurable: true
  6533. });
  6534. /**
  6535. * fetch-error.js
  6536. *
  6537. * FetchError interface for operational errors
  6538. */
  6539. /**
  6540. * Create FetchError instance
  6541. *
  6542. * @param String message Error message for human
  6543. * @param String type Error type for machine
  6544. * @param String systemError For Node.js system error
  6545. * @return FetchError
  6546. */
  6547. function FetchError(message, type, systemError) {
  6548. Error.call(this, message);
  6549. this.message = message;
  6550. this.type = type;
  6551. // when err.type is `system`, err.code contains system error code
  6552. if (systemError) {
  6553. this.code = this.errno = systemError.code;
  6554. }
  6555. // hide custom error implementation details from end-users
  6556. Error.captureStackTrace(this, this.constructor);
  6557. }
  6558. FetchError.prototype = Object.create(Error.prototype);
  6559. FetchError.prototype.constructor = FetchError;
  6560. FetchError.prototype.name = 'FetchError';
  6561. let convert;
  6562. try {
  6563. convert = __webpack_require__(18).convert;
  6564. } catch (e) {}
  6565. const INTERNALS = Symbol('Body internals');
  6566. // fix an issue where "PassThrough" isn't a named export for node <10
  6567. const PassThrough = Stream.PassThrough;
  6568. /**
  6569. * Body mixin
  6570. *
  6571. * Ref: https://fetch.spec.whatwg.org/#body
  6572. *
  6573. * @param Stream body Readable stream
  6574. * @param Object opts Response options
  6575. * @return Void
  6576. */
  6577. function Body(body) {
  6578. var _this = this;
  6579. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6580. _ref$size = _ref.size;
  6581. let size = _ref$size === undefined ? 0 : _ref$size;
  6582. var _ref$timeout = _ref.timeout;
  6583. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6584. if (body == null) {
  6585. // body is undefined or null
  6586. body = null;
  6587. } else if (isURLSearchParams(body)) {
  6588. // body is a URLSearchParams
  6589. body = Buffer.from(body.toString());
  6590. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6591. // body is ArrayBuffer
  6592. body = Buffer.from(body);
  6593. } else if (ArrayBuffer.isView(body)) {
  6594. // body is ArrayBufferView
  6595. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6596. } else if (body instanceof Stream) ; else {
  6597. // none of the above
  6598. // coerce to string then buffer
  6599. body = Buffer.from(String(body));
  6600. }
  6601. this[INTERNALS] = {
  6602. body,
  6603. disturbed: false,
  6604. error: null
  6605. };
  6606. this.size = size;
  6607. this.timeout = timeout;
  6608. if (body instanceof Stream) {
  6609. body.on('error', function (err) {
  6610. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6611. _this[INTERNALS].error = error;
  6612. });
  6613. }
  6614. }
  6615. Body.prototype = {
  6616. get body() {
  6617. return this[INTERNALS].body;
  6618. },
  6619. get bodyUsed() {
  6620. return this[INTERNALS].disturbed;
  6621. },
  6622. /**
  6623. * Decode response as ArrayBuffer
  6624. *
  6625. * @return Promise
  6626. */
  6627. arrayBuffer() {
  6628. return consumeBody.call(this).then(function (buf) {
  6629. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6630. });
  6631. },
  6632. /**
  6633. * Return raw response as Blob
  6634. *
  6635. * @return Promise
  6636. */
  6637. blob() {
  6638. let ct = this.headers && this.headers.get('content-type') || '';
  6639. return consumeBody.call(this).then(function (buf) {
  6640. return Object.assign(
  6641. // Prevent copying
  6642. new Blob([], {
  6643. type: ct.toLowerCase()
  6644. }), {
  6645. [BUFFER]: buf
  6646. });
  6647. });
  6648. },
  6649. /**
  6650. * Decode response as json
  6651. *
  6652. * @return Promise
  6653. */
  6654. json() {
  6655. var _this2 = this;
  6656. return consumeBody.call(this).then(function (buffer) {
  6657. try {
  6658. return JSON.parse(buffer.toString());
  6659. } catch (err) {
  6660. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6661. }
  6662. });
  6663. },
  6664. /**
  6665. * Decode response as text
  6666. *
  6667. * @return Promise
  6668. */
  6669. text() {
  6670. return consumeBody.call(this).then(function (buffer) {
  6671. return buffer.toString();
  6672. });
  6673. },
  6674. /**
  6675. * Decode response as buffer (non-spec api)
  6676. *
  6677. * @return Promise
  6678. */
  6679. buffer() {
  6680. return consumeBody.call(this);
  6681. },
  6682. /**
  6683. * Decode response as text, while automatically detecting the encoding and
  6684. * trying to decode to UTF-8 (non-spec api)
  6685. *
  6686. * @return Promise
  6687. */
  6688. textConverted() {
  6689. var _this3 = this;
  6690. return consumeBody.call(this).then(function (buffer) {
  6691. return convertBody(buffer, _this3.headers);
  6692. });
  6693. }
  6694. };
  6695. // In browsers, all properties are enumerable.
  6696. Object.defineProperties(Body.prototype, {
  6697. body: { enumerable: true },
  6698. bodyUsed: { enumerable: true },
  6699. arrayBuffer: { enumerable: true },
  6700. blob: { enumerable: true },
  6701. json: { enumerable: true },
  6702. text: { enumerable: true }
  6703. });
  6704. Body.mixIn = function (proto) {
  6705. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6706. // istanbul ignore else: future proof
  6707. if (!(name in proto)) {
  6708. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6709. Object.defineProperty(proto, name, desc);
  6710. }
  6711. }
  6712. };
  6713. /**
  6714. * Consume and convert an entire Body to a Buffer.
  6715. *
  6716. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6717. *
  6718. * @return Promise
  6719. */
  6720. function consumeBody() {
  6721. var _this4 = this;
  6722. if (this[INTERNALS].disturbed) {
  6723. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6724. }
  6725. this[INTERNALS].disturbed = true;
  6726. if (this[INTERNALS].error) {
  6727. return Body.Promise.reject(this[INTERNALS].error);
  6728. }
  6729. let body = this.body;
  6730. // body is null
  6731. if (body === null) {
  6732. return Body.Promise.resolve(Buffer.alloc(0));
  6733. }
  6734. // body is blob
  6735. if (isBlob(body)) {
  6736. body = body.stream();
  6737. }
  6738. // body is buffer
  6739. if (Buffer.isBuffer(body)) {
  6740. return Body.Promise.resolve(body);
  6741. }
  6742. // istanbul ignore if: should never happen
  6743. if (!(body instanceof Stream)) {
  6744. return Body.Promise.resolve(Buffer.alloc(0));
  6745. }
  6746. // body is stream
  6747. // get ready to actually consume the body
  6748. let accum = [];
  6749. let accumBytes = 0;
  6750. let abort = false;
  6751. return new Body.Promise(function (resolve, reject) {
  6752. let resTimeout;
  6753. // allow timeout on slow response body
  6754. if (_this4.timeout) {
  6755. resTimeout = setTimeout(function () {
  6756. abort = true;
  6757. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6758. }, _this4.timeout);
  6759. }
  6760. // handle stream errors
  6761. body.on('error', function (err) {
  6762. if (err.name === 'AbortError') {
  6763. // if the request was aborted, reject with this Error
  6764. abort = true;
  6765. reject(err);
  6766. } else {
  6767. // other errors, such as incorrect content-encoding
  6768. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6769. }
  6770. });
  6771. body.on('data', function (chunk) {
  6772. if (abort || chunk === null) {
  6773. return;
  6774. }
  6775. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6776. abort = true;
  6777. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6778. return;
  6779. }
  6780. accumBytes += chunk.length;
  6781. accum.push(chunk);
  6782. });
  6783. body.on('end', function () {
  6784. if (abort) {
  6785. return;
  6786. }
  6787. clearTimeout(resTimeout);
  6788. try {
  6789. resolve(Buffer.concat(accum, accumBytes));
  6790. } catch (err) {
  6791. // handle streams that have accumulated too much data (issue #414)
  6792. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6793. }
  6794. });
  6795. });
  6796. }
  6797. /**
  6798. * Detect buffer encoding and convert to target encoding
  6799. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6800. *
  6801. * @param Buffer buffer Incoming buffer
  6802. * @param String encoding Target encoding
  6803. * @return String
  6804. */
  6805. function convertBody(buffer, headers) {
  6806. if (typeof convert !== 'function') {
  6807. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6808. }
  6809. const ct = headers.get('content-type');
  6810. let charset = 'utf-8';
  6811. let res, str;
  6812. // header
  6813. if (ct) {
  6814. res = /charset=([^;]*)/i.exec(ct);
  6815. }
  6816. // no charset in content type, peek at response body for at most 1024 bytes
  6817. str = buffer.slice(0, 1024).toString();
  6818. // html5
  6819. if (!res && str) {
  6820. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6821. }
  6822. // html4
  6823. if (!res && str) {
  6824. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6825. if (res) {
  6826. res = /charset=(.*)/i.exec(res.pop());
  6827. }
  6828. }
  6829. // xml
  6830. if (!res && str) {
  6831. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6832. }
  6833. // found charset
  6834. if (res) {
  6835. charset = res.pop();
  6836. // prevent decode issues when sites use incorrect encoding
  6837. // ref: https://hsivonen.fi/encoding-menu/
  6838. if (charset === 'gb2312' || charset === 'gbk') {
  6839. charset = 'gb18030';
  6840. }
  6841. }
  6842. // turn raw buffers into a single utf-8 buffer
  6843. return convert(buffer, 'UTF-8', charset).toString();
  6844. }
  6845. /**
  6846. * Detect a URLSearchParams object
  6847. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6848. *
  6849. * @param Object obj Object to detect by type or brand
  6850. * @return String
  6851. */
  6852. function isURLSearchParams(obj) {
  6853. // Duck-typing as a necessary condition.
  6854. 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') {
  6855. return false;
  6856. }
  6857. // Brand-checking and more duck-typing as optional condition.
  6858. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6859. }
  6860. /**
  6861. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6862. * @param {*} obj
  6863. * @return {boolean}
  6864. */
  6865. function isBlob(obj) {
  6866. 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]);
  6867. }
  6868. /**
  6869. * Clone body given Res/Req instance
  6870. *
  6871. * @param Mixed instance Response or Request instance
  6872. * @return Mixed
  6873. */
  6874. function clone(instance) {
  6875. let p1, p2;
  6876. let body = instance.body;
  6877. // don't allow cloning a used body
  6878. if (instance.bodyUsed) {
  6879. throw new Error('cannot clone body after it is used');
  6880. }
  6881. // check that body is a stream and not form-data object
  6882. // note: we can't clone the form-data object without having it as a dependency
  6883. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6884. // tee instance body
  6885. p1 = new PassThrough();
  6886. p2 = new PassThrough();
  6887. body.pipe(p1);
  6888. body.pipe(p2);
  6889. // set instance body to teed body and return the other teed body
  6890. instance[INTERNALS].body = p1;
  6891. body = p2;
  6892. }
  6893. return body;
  6894. }
  6895. /**
  6896. * Performs the operation "extract a `Content-Type` value from |object|" as
  6897. * specified in the specification:
  6898. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6899. *
  6900. * This function assumes that instance.body is present.
  6901. *
  6902. * @param Mixed instance Any options.body input
  6903. */
  6904. function extractContentType(body) {
  6905. if (body === null) {
  6906. // body is null
  6907. return null;
  6908. } else if (typeof body === 'string') {
  6909. // body is string
  6910. return 'text/plain;charset=UTF-8';
  6911. } else if (isURLSearchParams(body)) {
  6912. // body is a URLSearchParams
  6913. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6914. } else if (isBlob(body)) {
  6915. // body is blob
  6916. return body.type || null;
  6917. } else if (Buffer.isBuffer(body)) {
  6918. // body is buffer
  6919. return null;
  6920. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6921. // body is ArrayBuffer
  6922. return null;
  6923. } else if (ArrayBuffer.isView(body)) {
  6924. // body is ArrayBufferView
  6925. return null;
  6926. } else if (typeof body.getBoundary === 'function') {
  6927. // detect form data input from form-data module
  6928. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6929. } else if (body instanceof Stream) {
  6930. // body is stream
  6931. // can't really do much about this
  6932. return null;
  6933. } else {
  6934. // Body constructor defaults other things to string
  6935. return 'text/plain;charset=UTF-8';
  6936. }
  6937. }
  6938. /**
  6939. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6940. * For us, we have to explicitly get it with a function.
  6941. *
  6942. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6943. *
  6944. * @param Body instance Instance of Body
  6945. * @return Number? Number of bytes, or null if not possible
  6946. */
  6947. function getTotalBytes(instance) {
  6948. const body = instance.body;
  6949. if (body === null) {
  6950. // body is null
  6951. return 0;
  6952. } else if (isBlob(body)) {
  6953. return body.size;
  6954. } else if (Buffer.isBuffer(body)) {
  6955. // body is buffer
  6956. return body.length;
  6957. } else if (body && typeof body.getLengthSync === 'function') {
  6958. // detect form data input from form-data module
  6959. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6960. body.hasKnownLength && body.hasKnownLength()) {
  6961. // 2.x
  6962. return body.getLengthSync();
  6963. }
  6964. return null;
  6965. } else {
  6966. // body is stream
  6967. return null;
  6968. }
  6969. }
  6970. /**
  6971. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6972. *
  6973. * @param Body instance Instance of Body
  6974. * @return Void
  6975. */
  6976. function writeToStream(dest, instance) {
  6977. const body = instance.body;
  6978. if (body === null) {
  6979. // body is null
  6980. dest.end();
  6981. } else if (isBlob(body)) {
  6982. body.stream().pipe(dest);
  6983. } else if (Buffer.isBuffer(body)) {
  6984. // body is buffer
  6985. dest.write(body);
  6986. dest.end();
  6987. } else {
  6988. // body is stream
  6989. body.pipe(dest);
  6990. }
  6991. }
  6992. // expose Promise
  6993. Body.Promise = global.Promise;
  6994. /**
  6995. * headers.js
  6996. *
  6997. * Headers class offers convenient helpers
  6998. */
  6999. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7000. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7001. function validateName(name) {
  7002. name = `${name}`;
  7003. if (invalidTokenRegex.test(name) || name === '') {
  7004. throw new TypeError(`${name} is not a legal HTTP header name`);
  7005. }
  7006. }
  7007. function validateValue(value) {
  7008. value = `${value}`;
  7009. if (invalidHeaderCharRegex.test(value)) {
  7010. throw new TypeError(`${value} is not a legal HTTP header value`);
  7011. }
  7012. }
  7013. /**
  7014. * Find the key in the map object given a header name.
  7015. *
  7016. * Returns undefined if not found.
  7017. *
  7018. * @param String name Header name
  7019. * @return String|Undefined
  7020. */
  7021. function find(map, name) {
  7022. name = name.toLowerCase();
  7023. for (const key in map) {
  7024. if (key.toLowerCase() === name) {
  7025. return key;
  7026. }
  7027. }
  7028. return undefined;
  7029. }
  7030. const MAP = Symbol('map');
  7031. class Headers {
  7032. /**
  7033. * Headers class
  7034. *
  7035. * @param Object headers Response headers
  7036. * @return Void
  7037. */
  7038. constructor() {
  7039. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7040. this[MAP] = Object.create(null);
  7041. if (init instanceof Headers) {
  7042. const rawHeaders = init.raw();
  7043. const headerNames = Object.keys(rawHeaders);
  7044. for (const headerName of headerNames) {
  7045. for (const value of rawHeaders[headerName]) {
  7046. this.append(headerName, value);
  7047. }
  7048. }
  7049. return;
  7050. }
  7051. // We don't worry about converting prop to ByteString here as append()
  7052. // will handle it.
  7053. if (init == null) ; else if (typeof init === 'object') {
  7054. const method = init[Symbol.iterator];
  7055. if (method != null) {
  7056. if (typeof method !== 'function') {
  7057. throw new TypeError('Header pairs must be iterable');
  7058. }
  7059. // sequence<sequence<ByteString>>
  7060. // Note: per spec we have to first exhaust the lists then process them
  7061. const pairs = [];
  7062. for (const pair of init) {
  7063. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7064. throw new TypeError('Each header pair must be iterable');
  7065. }
  7066. pairs.push(Array.from(pair));
  7067. }
  7068. for (const pair of pairs) {
  7069. if (pair.length !== 2) {
  7070. throw new TypeError('Each header pair must be a name/value tuple');
  7071. }
  7072. this.append(pair[0], pair[1]);
  7073. }
  7074. } else {
  7075. // record<ByteString, ByteString>
  7076. for (const key of Object.keys(init)) {
  7077. const value = init[key];
  7078. this.append(key, value);
  7079. }
  7080. }
  7081. } else {
  7082. throw new TypeError('Provided initializer must be an object');
  7083. }
  7084. }
  7085. /**
  7086. * Return combined header value given name
  7087. *
  7088. * @param String name Header name
  7089. * @return Mixed
  7090. */
  7091. get(name) {
  7092. name = `${name}`;
  7093. validateName(name);
  7094. const key = find(this[MAP], name);
  7095. if (key === undefined) {
  7096. return null;
  7097. }
  7098. return this[MAP][key].join(', ');
  7099. }
  7100. /**
  7101. * Iterate over all headers
  7102. *
  7103. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7104. * @param Boolean thisArg `this` context for callback function
  7105. * @return Void
  7106. */
  7107. forEach(callback) {
  7108. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7109. let pairs = getHeaders(this);
  7110. let i = 0;
  7111. while (i < pairs.length) {
  7112. var _pairs$i = pairs[i];
  7113. const name = _pairs$i[0],
  7114. value = _pairs$i[1];
  7115. callback.call(thisArg, value, name, this);
  7116. pairs = getHeaders(this);
  7117. i++;
  7118. }
  7119. }
  7120. /**
  7121. * Overwrite header values given name
  7122. *
  7123. * @param String name Header name
  7124. * @param String value Header value
  7125. * @return Void
  7126. */
  7127. set(name, value) {
  7128. name = `${name}`;
  7129. value = `${value}`;
  7130. validateName(name);
  7131. validateValue(value);
  7132. const key = find(this[MAP], name);
  7133. this[MAP][key !== undefined ? key : name] = [value];
  7134. }
  7135. /**
  7136. * Append a value onto existing header
  7137. *
  7138. * @param String name Header name
  7139. * @param String value Header value
  7140. * @return Void
  7141. */
  7142. append(name, value) {
  7143. name = `${name}`;
  7144. value = `${value}`;
  7145. validateName(name);
  7146. validateValue(value);
  7147. const key = find(this[MAP], name);
  7148. if (key !== undefined) {
  7149. this[MAP][key].push(value);
  7150. } else {
  7151. this[MAP][name] = [value];
  7152. }
  7153. }
  7154. /**
  7155. * Check for header name existence
  7156. *
  7157. * @param String name Header name
  7158. * @return Boolean
  7159. */
  7160. has(name) {
  7161. name = `${name}`;
  7162. validateName(name);
  7163. return find(this[MAP], name) !== undefined;
  7164. }
  7165. /**
  7166. * Delete all header values given name
  7167. *
  7168. * @param String name Header name
  7169. * @return Void
  7170. */
  7171. delete(name) {
  7172. name = `${name}`;
  7173. validateName(name);
  7174. const key = find(this[MAP], name);
  7175. if (key !== undefined) {
  7176. delete this[MAP][key];
  7177. }
  7178. }
  7179. /**
  7180. * Return raw headers (non-spec api)
  7181. *
  7182. * @return Object
  7183. */
  7184. raw() {
  7185. return this[MAP];
  7186. }
  7187. /**
  7188. * Get an iterator on keys.
  7189. *
  7190. * @return Iterator
  7191. */
  7192. keys() {
  7193. return createHeadersIterator(this, 'key');
  7194. }
  7195. /**
  7196. * Get an iterator on values.
  7197. *
  7198. * @return Iterator
  7199. */
  7200. values() {
  7201. return createHeadersIterator(this, 'value');
  7202. }
  7203. /**
  7204. * Get an iterator on entries.
  7205. *
  7206. * This is the default iterator of the Headers object.
  7207. *
  7208. * @return Iterator
  7209. */
  7210. [Symbol.iterator]() {
  7211. return createHeadersIterator(this, 'key+value');
  7212. }
  7213. }
  7214. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7215. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7216. value: 'Headers',
  7217. writable: false,
  7218. enumerable: false,
  7219. configurable: true
  7220. });
  7221. Object.defineProperties(Headers.prototype, {
  7222. get: { enumerable: true },
  7223. forEach: { enumerable: true },
  7224. set: { enumerable: true },
  7225. append: { enumerable: true },
  7226. has: { enumerable: true },
  7227. delete: { enumerable: true },
  7228. keys: { enumerable: true },
  7229. values: { enumerable: true },
  7230. entries: { enumerable: true }
  7231. });
  7232. function getHeaders(headers) {
  7233. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7234. const keys = Object.keys(headers[MAP]).sort();
  7235. return keys.map(kind === 'key' ? function (k) {
  7236. return k.toLowerCase();
  7237. } : kind === 'value' ? function (k) {
  7238. return headers[MAP][k].join(', ');
  7239. } : function (k) {
  7240. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7241. });
  7242. }
  7243. const INTERNAL = Symbol('internal');
  7244. function createHeadersIterator(target, kind) {
  7245. const iterator = Object.create(HeadersIteratorPrototype);
  7246. iterator[INTERNAL] = {
  7247. target,
  7248. kind,
  7249. index: 0
  7250. };
  7251. return iterator;
  7252. }
  7253. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7254. next() {
  7255. // istanbul ignore if
  7256. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7257. throw new TypeError('Value of `this` is not a HeadersIterator');
  7258. }
  7259. var _INTERNAL = this[INTERNAL];
  7260. const target = _INTERNAL.target,
  7261. kind = _INTERNAL.kind,
  7262. index = _INTERNAL.index;
  7263. const values = getHeaders(target, kind);
  7264. const len = values.length;
  7265. if (index >= len) {
  7266. return {
  7267. value: undefined,
  7268. done: true
  7269. };
  7270. }
  7271. this[INTERNAL].index = index + 1;
  7272. return {
  7273. value: values[index],
  7274. done: false
  7275. };
  7276. }
  7277. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7278. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7279. value: 'HeadersIterator',
  7280. writable: false,
  7281. enumerable: false,
  7282. configurable: true
  7283. });
  7284. /**
  7285. * Export the Headers object in a form that Node.js can consume.
  7286. *
  7287. * @param Headers headers
  7288. * @return Object
  7289. */
  7290. function exportNodeCompatibleHeaders(headers) {
  7291. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7292. // http.request() only supports string as Host header. This hack makes
  7293. // specifying custom Host header possible.
  7294. const hostHeaderKey = find(headers[MAP], 'Host');
  7295. if (hostHeaderKey !== undefined) {
  7296. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7297. }
  7298. return obj;
  7299. }
  7300. /**
  7301. * Create a Headers object from an object of headers, ignoring those that do
  7302. * not conform to HTTP grammar productions.
  7303. *
  7304. * @param Object obj Object of headers
  7305. * @return Headers
  7306. */
  7307. function createHeadersLenient(obj) {
  7308. const headers = new Headers();
  7309. for (const name of Object.keys(obj)) {
  7310. if (invalidTokenRegex.test(name)) {
  7311. continue;
  7312. }
  7313. if (Array.isArray(obj[name])) {
  7314. for (const val of obj[name]) {
  7315. if (invalidHeaderCharRegex.test(val)) {
  7316. continue;
  7317. }
  7318. if (headers[MAP][name] === undefined) {
  7319. headers[MAP][name] = [val];
  7320. } else {
  7321. headers[MAP][name].push(val);
  7322. }
  7323. }
  7324. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7325. headers[MAP][name] = [obj[name]];
  7326. }
  7327. }
  7328. return headers;
  7329. }
  7330. const INTERNALS$1 = Symbol('Response internals');
  7331. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7332. const STATUS_CODES = http.STATUS_CODES;
  7333. /**
  7334. * Response class
  7335. *
  7336. * @param Stream body Readable stream
  7337. * @param Object opts Response options
  7338. * @return Void
  7339. */
  7340. class Response {
  7341. constructor() {
  7342. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7343. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7344. Body.call(this, body, opts);
  7345. const status = opts.status || 200;
  7346. const headers = new Headers(opts.headers);
  7347. if (body != null && !headers.has('Content-Type')) {
  7348. const contentType = extractContentType(body);
  7349. if (contentType) {
  7350. headers.append('Content-Type', contentType);
  7351. }
  7352. }
  7353. this[INTERNALS$1] = {
  7354. url: opts.url,
  7355. status,
  7356. statusText: opts.statusText || STATUS_CODES[status],
  7357. headers,
  7358. counter: opts.counter
  7359. };
  7360. }
  7361. get url() {
  7362. return this[INTERNALS$1].url || '';
  7363. }
  7364. get status() {
  7365. return this[INTERNALS$1].status;
  7366. }
  7367. /**
  7368. * Convenience property representing if the request ended normally
  7369. */
  7370. get ok() {
  7371. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7372. }
  7373. get redirected() {
  7374. return this[INTERNALS$1].counter > 0;
  7375. }
  7376. get statusText() {
  7377. return this[INTERNALS$1].statusText;
  7378. }
  7379. get headers() {
  7380. return this[INTERNALS$1].headers;
  7381. }
  7382. /**
  7383. * Clone this response
  7384. *
  7385. * @return Response
  7386. */
  7387. clone() {
  7388. return new Response(clone(this), {
  7389. url: this.url,
  7390. status: this.status,
  7391. statusText: this.statusText,
  7392. headers: this.headers,
  7393. ok: this.ok,
  7394. redirected: this.redirected
  7395. });
  7396. }
  7397. }
  7398. Body.mixIn(Response.prototype);
  7399. Object.defineProperties(Response.prototype, {
  7400. url: { enumerable: true },
  7401. status: { enumerable: true },
  7402. ok: { enumerable: true },
  7403. redirected: { enumerable: true },
  7404. statusText: { enumerable: true },
  7405. headers: { enumerable: true },
  7406. clone: { enumerable: true }
  7407. });
  7408. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7409. value: 'Response',
  7410. writable: false,
  7411. enumerable: false,
  7412. configurable: true
  7413. });
  7414. const INTERNALS$2 = Symbol('Request internals');
  7415. // fix an issue where "format", "parse" aren't a named export for node <10
  7416. const parse_url = Url.parse;
  7417. const format_url = Url.format;
  7418. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7419. /**
  7420. * Check if a value is an instance of Request.
  7421. *
  7422. * @param Mixed input
  7423. * @return Boolean
  7424. */
  7425. function isRequest(input) {
  7426. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7427. }
  7428. function isAbortSignal(signal) {
  7429. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7430. return !!(proto && proto.constructor.name === 'AbortSignal');
  7431. }
  7432. /**
  7433. * Request class
  7434. *
  7435. * @param Mixed input Url or Request instance
  7436. * @param Object init Custom options
  7437. * @return Void
  7438. */
  7439. class Request {
  7440. constructor(input) {
  7441. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7442. let parsedURL;
  7443. // normalize input
  7444. if (!isRequest(input)) {
  7445. if (input && input.href) {
  7446. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7447. // will fall into this branch also (since their `toString()` will return
  7448. // `href` property anyway)
  7449. parsedURL = parse_url(input.href);
  7450. } else {
  7451. // coerce input to a string before attempting to parse
  7452. parsedURL = parse_url(`${input}`);
  7453. }
  7454. input = {};
  7455. } else {
  7456. parsedURL = parse_url(input.url);
  7457. }
  7458. let method = init.method || input.method || 'GET';
  7459. method = method.toUpperCase();
  7460. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7461. throw new TypeError('Request with GET/HEAD method cannot have body');
  7462. }
  7463. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7464. Body.call(this, inputBody, {
  7465. timeout: init.timeout || input.timeout || 0,
  7466. size: init.size || input.size || 0
  7467. });
  7468. const headers = new Headers(init.headers || input.headers || {});
  7469. if (inputBody != null && !headers.has('Content-Type')) {
  7470. const contentType = extractContentType(inputBody);
  7471. if (contentType) {
  7472. headers.append('Content-Type', contentType);
  7473. }
  7474. }
  7475. let signal = isRequest(input) ? input.signal : null;
  7476. if ('signal' in init) signal = init.signal;
  7477. if (signal != null && !isAbortSignal(signal)) {
  7478. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7479. }
  7480. this[INTERNALS$2] = {
  7481. method,
  7482. redirect: init.redirect || input.redirect || 'follow',
  7483. headers,
  7484. parsedURL,
  7485. signal
  7486. };
  7487. // node-fetch-only options
  7488. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7489. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7490. this.counter = init.counter || input.counter || 0;
  7491. this.agent = init.agent || input.agent;
  7492. }
  7493. get method() {
  7494. return this[INTERNALS$2].method;
  7495. }
  7496. get url() {
  7497. return format_url(this[INTERNALS$2].parsedURL);
  7498. }
  7499. get headers() {
  7500. return this[INTERNALS$2].headers;
  7501. }
  7502. get redirect() {
  7503. return this[INTERNALS$2].redirect;
  7504. }
  7505. get signal() {
  7506. return this[INTERNALS$2].signal;
  7507. }
  7508. /**
  7509. * Clone this request
  7510. *
  7511. * @return Request
  7512. */
  7513. clone() {
  7514. return new Request(this);
  7515. }
  7516. }
  7517. Body.mixIn(Request.prototype);
  7518. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7519. value: 'Request',
  7520. writable: false,
  7521. enumerable: false,
  7522. configurable: true
  7523. });
  7524. Object.defineProperties(Request.prototype, {
  7525. method: { enumerable: true },
  7526. url: { enumerable: true },
  7527. headers: { enumerable: true },
  7528. redirect: { enumerable: true },
  7529. clone: { enumerable: true },
  7530. signal: { enumerable: true }
  7531. });
  7532. /**
  7533. * Convert a Request to Node.js http request options.
  7534. *
  7535. * @param Request A Request instance
  7536. * @return Object The options object to be passed to http.request
  7537. */
  7538. function getNodeRequestOptions(request) {
  7539. const parsedURL = request[INTERNALS$2].parsedURL;
  7540. const headers = new Headers(request[INTERNALS$2].headers);
  7541. // fetch step 1.3
  7542. if (!headers.has('Accept')) {
  7543. headers.set('Accept', '*/*');
  7544. }
  7545. // Basic fetch
  7546. if (!parsedURL.protocol || !parsedURL.hostname) {
  7547. throw new TypeError('Only absolute URLs are supported');
  7548. }
  7549. if (!/^https?:$/.test(parsedURL.protocol)) {
  7550. throw new TypeError('Only HTTP(S) protocols are supported');
  7551. }
  7552. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7553. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7554. }
  7555. // HTTP-network-or-cache fetch steps 2.4-2.7
  7556. let contentLengthValue = null;
  7557. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7558. contentLengthValue = '0';
  7559. }
  7560. if (request.body != null) {
  7561. const totalBytes = getTotalBytes(request);
  7562. if (typeof totalBytes === 'number') {
  7563. contentLengthValue = String(totalBytes);
  7564. }
  7565. }
  7566. if (contentLengthValue) {
  7567. headers.set('Content-Length', contentLengthValue);
  7568. }
  7569. // HTTP-network-or-cache fetch step 2.11
  7570. if (!headers.has('User-Agent')) {
  7571. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7572. }
  7573. // HTTP-network-or-cache fetch step 2.15
  7574. if (request.compress && !headers.has('Accept-Encoding')) {
  7575. headers.set('Accept-Encoding', 'gzip,deflate');
  7576. }
  7577. let agent = request.agent;
  7578. if (typeof agent === 'function') {
  7579. agent = agent(parsedURL);
  7580. }
  7581. if (!headers.has('Connection') && !agent) {
  7582. headers.set('Connection', 'close');
  7583. }
  7584. // HTTP-network fetch step 4.2
  7585. // chunked encoding is handled by Node.js
  7586. return Object.assign({}, parsedURL, {
  7587. method: request.method,
  7588. headers: exportNodeCompatibleHeaders(headers),
  7589. agent
  7590. });
  7591. }
  7592. /**
  7593. * abort-error.js
  7594. *
  7595. * AbortError interface for cancelled requests
  7596. */
  7597. /**
  7598. * Create AbortError instance
  7599. *
  7600. * @param String message Error message for human
  7601. * @return AbortError
  7602. */
  7603. function AbortError(message) {
  7604. Error.call(this, message);
  7605. this.type = 'aborted';
  7606. this.message = message;
  7607. // hide custom error implementation details from end-users
  7608. Error.captureStackTrace(this, this.constructor);
  7609. }
  7610. AbortError.prototype = Object.create(Error.prototype);
  7611. AbortError.prototype.constructor = AbortError;
  7612. AbortError.prototype.name = 'AbortError';
  7613. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7614. const PassThrough$1 = Stream.PassThrough;
  7615. const resolve_url = Url.resolve;
  7616. /**
  7617. * Fetch function
  7618. *
  7619. * @param Mixed url Absolute url or Request instance
  7620. * @param Object opts Fetch options
  7621. * @return Promise
  7622. */
  7623. function fetch(url, opts) {
  7624. // allow custom promise
  7625. if (!fetch.Promise) {
  7626. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7627. }
  7628. Body.Promise = fetch.Promise;
  7629. // wrap http.request into fetch
  7630. return new fetch.Promise(function (resolve, reject) {
  7631. // build request object
  7632. const request = new Request(url, opts);
  7633. const options = getNodeRequestOptions(request);
  7634. const send = (options.protocol === 'https:' ? https : http).request;
  7635. const signal = request.signal;
  7636. let response = null;
  7637. const abort = function abort() {
  7638. let error = new AbortError('The user aborted a request.');
  7639. reject(error);
  7640. if (request.body && request.body instanceof Stream.Readable) {
  7641. request.body.destroy(error);
  7642. }
  7643. if (!response || !response.body) return;
  7644. response.body.emit('error', error);
  7645. };
  7646. if (signal && signal.aborted) {
  7647. abort();
  7648. return;
  7649. }
  7650. const abortAndFinalize = function abortAndFinalize() {
  7651. abort();
  7652. finalize();
  7653. };
  7654. // send request
  7655. const req = send(options);
  7656. let reqTimeout;
  7657. if (signal) {
  7658. signal.addEventListener('abort', abortAndFinalize);
  7659. }
  7660. function finalize() {
  7661. req.abort();
  7662. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7663. clearTimeout(reqTimeout);
  7664. }
  7665. if (request.timeout) {
  7666. req.once('socket', function (socket) {
  7667. reqTimeout = setTimeout(function () {
  7668. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7669. finalize();
  7670. }, request.timeout);
  7671. });
  7672. }
  7673. req.on('error', function (err) {
  7674. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7675. finalize();
  7676. });
  7677. req.on('response', function (res) {
  7678. clearTimeout(reqTimeout);
  7679. const headers = createHeadersLenient(res.headers);
  7680. // HTTP fetch step 5
  7681. if (fetch.isRedirect(res.statusCode)) {
  7682. // HTTP fetch step 5.2
  7683. const location = headers.get('Location');
  7684. // HTTP fetch step 5.3
  7685. const locationURL = location === null ? null : resolve_url(request.url, location);
  7686. // HTTP fetch step 5.5
  7687. switch (request.redirect) {
  7688. case 'error':
  7689. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7690. finalize();
  7691. return;
  7692. case 'manual':
  7693. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7694. if (locationURL !== null) {
  7695. // handle corrupted header
  7696. try {
  7697. headers.set('Location', locationURL);
  7698. } catch (err) {
  7699. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7700. reject(err);
  7701. }
  7702. }
  7703. break;
  7704. case 'follow':
  7705. // HTTP-redirect fetch step 2
  7706. if (locationURL === null) {
  7707. break;
  7708. }
  7709. // HTTP-redirect fetch step 5
  7710. if (request.counter >= request.follow) {
  7711. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7712. finalize();
  7713. return;
  7714. }
  7715. // HTTP-redirect fetch step 6 (counter increment)
  7716. // Create a new Request object.
  7717. const requestOpts = {
  7718. headers: new Headers(request.headers),
  7719. follow: request.follow,
  7720. counter: request.counter + 1,
  7721. agent: request.agent,
  7722. compress: request.compress,
  7723. method: request.method,
  7724. body: request.body,
  7725. signal: request.signal,
  7726. timeout: request.timeout
  7727. };
  7728. // HTTP-redirect fetch step 9
  7729. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7730. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7731. finalize();
  7732. return;
  7733. }
  7734. // HTTP-redirect fetch step 11
  7735. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7736. requestOpts.method = 'GET';
  7737. requestOpts.body = undefined;
  7738. requestOpts.headers.delete('content-length');
  7739. }
  7740. // HTTP-redirect fetch step 15
  7741. resolve(fetch(new Request(locationURL, requestOpts)));
  7742. finalize();
  7743. return;
  7744. }
  7745. }
  7746. // prepare response
  7747. res.once('end', function () {
  7748. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7749. });
  7750. let body = res.pipe(new PassThrough$1());
  7751. const response_options = {
  7752. url: request.url,
  7753. status: res.statusCode,
  7754. statusText: res.statusMessage,
  7755. headers: headers,
  7756. size: request.size,
  7757. timeout: request.timeout,
  7758. counter: request.counter
  7759. };
  7760. // HTTP-network fetch step 12.1.1.3
  7761. const codings = headers.get('Content-Encoding');
  7762. // HTTP-network fetch step 12.1.1.4: handle content codings
  7763. // in following scenarios we ignore compression support
  7764. // 1. compression support is disabled
  7765. // 2. HEAD request
  7766. // 3. no Content-Encoding header
  7767. // 4. no content response (204)
  7768. // 5. content not modified response (304)
  7769. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7770. response = new Response(body, response_options);
  7771. resolve(response);
  7772. return;
  7773. }
  7774. // For Node v6+
  7775. // Be less strict when decoding compressed responses, since sometimes
  7776. // servers send slightly invalid responses that are still accepted
  7777. // by common browsers.
  7778. // Always using Z_SYNC_FLUSH is what cURL does.
  7779. const zlibOptions = {
  7780. flush: zlib.Z_SYNC_FLUSH,
  7781. finishFlush: zlib.Z_SYNC_FLUSH
  7782. };
  7783. // for gzip
  7784. if (codings == 'gzip' || codings == 'x-gzip') {
  7785. body = body.pipe(zlib.createGunzip(zlibOptions));
  7786. response = new Response(body, response_options);
  7787. resolve(response);
  7788. return;
  7789. }
  7790. // for deflate
  7791. if (codings == 'deflate' || codings == 'x-deflate') {
  7792. // handle the infamous raw deflate response from old servers
  7793. // a hack for old IIS and Apache servers
  7794. const raw = res.pipe(new PassThrough$1());
  7795. raw.once('data', function (chunk) {
  7796. // see http://stackoverflow.com/questions/37519828
  7797. if ((chunk[0] & 0x0F) === 0x08) {
  7798. body = body.pipe(zlib.createInflate());
  7799. } else {
  7800. body = body.pipe(zlib.createInflateRaw());
  7801. }
  7802. response = new Response(body, response_options);
  7803. resolve(response);
  7804. });
  7805. return;
  7806. }
  7807. // for br
  7808. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7809. body = body.pipe(zlib.createBrotliDecompress());
  7810. response = new Response(body, response_options);
  7811. resolve(response);
  7812. return;
  7813. }
  7814. // otherwise, use response as-is
  7815. response = new Response(body, response_options);
  7816. resolve(response);
  7817. });
  7818. writeToStream(req, request);
  7819. });
  7820. }
  7821. /**
  7822. * Redirect code matching
  7823. *
  7824. * @param Number code Status code
  7825. * @return Boolean
  7826. */
  7827. fetch.isRedirect = function (code) {
  7828. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7829. };
  7830. // expose Promise
  7831. fetch.Promise = global.Promise;
  7832. module.exports = exports = fetch;
  7833. Object.defineProperty(exports, "__esModule", { value: true });
  7834. exports.default = exports;
  7835. exports.Headers = Headers;
  7836. exports.Request = Request;
  7837. exports.Response = Response;
  7838. exports.FetchError = FetchError;
  7839. /***/ }),
  7840. /***/ 462:
  7841. /***/ (function(module) {
  7842. "use strict";
  7843. // See http://www.robvanderwoude.com/escapechars.php
  7844. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7845. function escapeCommand(arg) {
  7846. // Escape meta chars
  7847. arg = arg.replace(metaCharsRegExp, '^$1');
  7848. return arg;
  7849. }
  7850. function escapeArgument(arg, doubleEscapeMetaChars) {
  7851. // Convert to string
  7852. arg = `${arg}`;
  7853. // Algorithm below is based on https://qntm.org/cmd
  7854. // Sequence of backslashes followed by a double quote:
  7855. // double up all the backslashes and escape the double quote
  7856. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7857. // Sequence of backslashes followed by the end of the string
  7858. // (which will become a double quote later):
  7859. // double up all the backslashes
  7860. arg = arg.replace(/(\\*)$/, '$1$1');
  7861. // All other backslashes occur literally
  7862. // Quote the whole thing:
  7863. arg = `"${arg}"`;
  7864. // Escape meta chars
  7865. arg = arg.replace(metaCharsRegExp, '^$1');
  7866. // Double escape meta chars if necessary
  7867. if (doubleEscapeMetaChars) {
  7868. arg = arg.replace(metaCharsRegExp, '^$1');
  7869. }
  7870. return arg;
  7871. }
  7872. module.exports.command = escapeCommand;
  7873. module.exports.argument = escapeArgument;
  7874. /***/ }),
  7875. /***/ 463:
  7876. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7877. "use strict";
  7878. Object.defineProperty(exports, '__esModule', { value: true });
  7879. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7880. var deprecation = __webpack_require__(692);
  7881. var once = _interopDefault(__webpack_require__(969));
  7882. const logOnce = once(deprecation => console.warn(deprecation));
  7883. /**
  7884. * Error with extra properties to help with debugging
  7885. */
  7886. class RequestError extends Error {
  7887. constructor(message, statusCode, options) {
  7888. super(message); // Maintains proper stack trace (only available on V8)
  7889. /* istanbul ignore next */
  7890. if (Error.captureStackTrace) {
  7891. Error.captureStackTrace(this, this.constructor);
  7892. }
  7893. this.name = "HttpError";
  7894. this.status = statusCode;
  7895. Object.defineProperty(this, "code", {
  7896. get() {
  7897. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7898. return statusCode;
  7899. }
  7900. });
  7901. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7902. const requestCopy = Object.assign({}, options.request);
  7903. if (options.request.headers.authorization) {
  7904. requestCopy.headers = Object.assign({}, options.request.headers, {
  7905. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7906. });
  7907. }
  7908. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7909. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7910. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7911. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7912. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7913. this.request = requestCopy;
  7914. }
  7915. }
  7916. exports.RequestError = RequestError;
  7917. //# sourceMappingURL=index.js.map
  7918. /***/ }),
  7919. /***/ 464:
  7920. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7921. "use strict";
  7922. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7923. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7924. return new (P || (P = Promise))(function (resolve, reject) {
  7925. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7926. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7927. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7928. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7929. });
  7930. };
  7931. var __importStar = (this && this.__importStar) || function (mod) {
  7932. if (mod && mod.__esModule) return mod;
  7933. var result = {};
  7934. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7935. result["default"] = mod;
  7936. return result;
  7937. };
  7938. var __importDefault = (this && this.__importDefault) || function (mod) {
  7939. return (mod && mod.__esModule) ? mod : { "default": mod };
  7940. };
  7941. Object.defineProperty(exports, "__esModule", { value: true });
  7942. const assert = __importStar(__webpack_require__(357));
  7943. const core = __importStar(__webpack_require__(470));
  7944. const fs = __importStar(__webpack_require__(747));
  7945. const github = __importStar(__webpack_require__(469));
  7946. const io = __importStar(__webpack_require__(1));
  7947. const path = __importStar(__webpack_require__(622));
  7948. const retryHelper = __importStar(__webpack_require__(587));
  7949. const toolCache = __importStar(__webpack_require__(533));
  7950. const v4_1 = __importDefault(__webpack_require__(826));
  7951. const IS_WINDOWS = process.platform === 'win32';
  7952. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  7953. return __awaiter(this, void 0, void 0, function* () {
  7954. // Download the archive
  7955. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7956. core.info('Downloading the archive');
  7957. return yield downloadArchive(authToken, owner, repo, ref, commit);
  7958. }));
  7959. // Write archive to disk
  7960. core.info('Writing archive to disk');
  7961. const uniqueId = v4_1.default();
  7962. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  7963. yield fs.promises.writeFile(archivePath, archiveData);
  7964. archiveData = Buffer.from(''); // Free memory
  7965. // Extract archive
  7966. core.info('Extracting the archive');
  7967. const extractPath = path.join(repositoryPath, uniqueId);
  7968. yield io.mkdirP(extractPath);
  7969. if (IS_WINDOWS) {
  7970. yield toolCache.extractZip(archivePath, extractPath);
  7971. }
  7972. else {
  7973. yield toolCache.extractTar(archivePath, extractPath);
  7974. }
  7975. io.rmRF(archivePath);
  7976. // Determine the path of the repository content. The archive contains
  7977. // a top-level folder and the repository content is inside.
  7978. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7979. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7980. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  7981. core.info(`Resolved version ${archiveVersion}`);
  7982. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  7983. // Move the files
  7984. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  7985. const sourcePath = path.join(tempRepositoryPath, fileName);
  7986. const targetPath = path.join(repositoryPath, fileName);
  7987. if (IS_WINDOWS) {
  7988. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  7989. }
  7990. else {
  7991. yield io.mv(sourcePath, targetPath);
  7992. }
  7993. }
  7994. io.rmRF(extractPath);
  7995. });
  7996. }
  7997. exports.downloadRepository = downloadRepository;
  7998. function downloadArchive(authToken, owner, repo, ref, commit) {
  7999. return __awaiter(this, void 0, void 0, function* () {
  8000. const octokit = new github.GitHub(authToken);
  8001. const params = {
  8002. owner: owner,
  8003. repo: repo,
  8004. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8005. ref: commit || ref
  8006. };
  8007. const response = yield octokit.repos.getArchiveLink(params);
  8008. if (response.status != 200) {
  8009. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8010. }
  8011. return Buffer.from(response.data); // response.data is ArrayBuffer
  8012. });
  8013. }
  8014. /***/ }),
  8015. /***/ 469:
  8016. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8017. "use strict";
  8018. var __importDefault = (this && this.__importDefault) || function (mod) {
  8019. return (mod && mod.__esModule) ? mod : { "default": mod };
  8020. };
  8021. var __importStar = (this && this.__importStar) || function (mod) {
  8022. if (mod && mod.__esModule) return mod;
  8023. var result = {};
  8024. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8025. result["default"] = mod;
  8026. return result;
  8027. };
  8028. Object.defineProperty(exports, "__esModule", { value: true });
  8029. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8030. const graphql_1 = __webpack_require__(898);
  8031. const rest_1 = __importDefault(__webpack_require__(0));
  8032. const Context = __importStar(__webpack_require__(262));
  8033. const httpClient = __importStar(__webpack_require__(539));
  8034. // We need this in order to extend Octokit
  8035. rest_1.default.prototype = new rest_1.default();
  8036. exports.context = new Context.Context();
  8037. class GitHub extends rest_1.default {
  8038. constructor(token, opts) {
  8039. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8040. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8041. }
  8042. /**
  8043. * Disambiguates the constructor overload parameters
  8044. */
  8045. static disambiguate(token, opts) {
  8046. return [
  8047. typeof token === 'string' ? token : '',
  8048. typeof token === 'object' ? token : opts || {}
  8049. ];
  8050. }
  8051. static getOctokitOptions(args) {
  8052. const token = args[0];
  8053. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8054. // Auth
  8055. const auth = GitHub.getAuthString(token, options);
  8056. if (auth) {
  8057. options.auth = auth;
  8058. }
  8059. // Proxy
  8060. const agent = GitHub.getProxyAgent(options);
  8061. if (agent) {
  8062. // Shallow clone - don't mutate the object provided by the caller
  8063. options.request = options.request ? Object.assign({}, options.request) : {};
  8064. // Set the agent
  8065. options.request.agent = agent;
  8066. }
  8067. return options;
  8068. }
  8069. static getGraphQL(args) {
  8070. const defaults = {};
  8071. const token = args[0];
  8072. const options = args[1];
  8073. // Authorization
  8074. const auth = this.getAuthString(token, options);
  8075. if (auth) {
  8076. defaults.headers = {
  8077. authorization: auth
  8078. };
  8079. }
  8080. // Proxy
  8081. const agent = GitHub.getProxyAgent(options);
  8082. if (agent) {
  8083. defaults.request = { agent };
  8084. }
  8085. return graphql_1.graphql.defaults(defaults);
  8086. }
  8087. static getAuthString(token, options) {
  8088. // Validate args
  8089. if (!token && !options.auth) {
  8090. throw new Error('Parameter token or opts.auth is required');
  8091. }
  8092. else if (token && options.auth) {
  8093. throw new Error('Parameters token and opts.auth may not both be specified');
  8094. }
  8095. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8096. }
  8097. static getProxyAgent(options) {
  8098. var _a;
  8099. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8100. const serverUrl = 'https://api.github.com';
  8101. if (httpClient.getProxyUrl(serverUrl)) {
  8102. const hc = new httpClient.HttpClient();
  8103. return hc.getAgent(serverUrl);
  8104. }
  8105. }
  8106. return undefined;
  8107. }
  8108. }
  8109. exports.GitHub = GitHub;
  8110. //# sourceMappingURL=github.js.map
  8111. /***/ }),
  8112. /***/ 470:
  8113. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8114. "use strict";
  8115. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8116. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8117. return new (P || (P = Promise))(function (resolve, reject) {
  8118. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8119. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8120. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8121. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8122. });
  8123. };
  8124. Object.defineProperty(exports, "__esModule", { value: true });
  8125. const command_1 = __webpack_require__(431);
  8126. const os = __webpack_require__(87);
  8127. const path = __webpack_require__(622);
  8128. /**
  8129. * The code to exit an action
  8130. */
  8131. var ExitCode;
  8132. (function (ExitCode) {
  8133. /**
  8134. * A code indicating that the action was successful
  8135. */
  8136. ExitCode[ExitCode["Success"] = 0] = "Success";
  8137. /**
  8138. * A code indicating that the action was a failure
  8139. */
  8140. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8141. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8142. //-----------------------------------------------------------------------
  8143. // Variables
  8144. //-----------------------------------------------------------------------
  8145. /**
  8146. * Sets env variable for this action and future actions in the job
  8147. * @param name the name of the variable to set
  8148. * @param val the value of the variable
  8149. */
  8150. function exportVariable(name, val) {
  8151. process.env[name] = val;
  8152. command_1.issueCommand('set-env', { name }, val);
  8153. }
  8154. exports.exportVariable = exportVariable;
  8155. /**
  8156. * Registers a secret which will get masked from logs
  8157. * @param secret value of the secret
  8158. */
  8159. function setSecret(secret) {
  8160. command_1.issueCommand('add-mask', {}, secret);
  8161. }
  8162. exports.setSecret = setSecret;
  8163. /**
  8164. * Prepends inputPath to the PATH (for this action and future actions)
  8165. * @param inputPath
  8166. */
  8167. function addPath(inputPath) {
  8168. command_1.issueCommand('add-path', {}, inputPath);
  8169. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8170. }
  8171. exports.addPath = addPath;
  8172. /**
  8173. * Gets the value of an input. The value is also trimmed.
  8174. *
  8175. * @param name name of the input to get
  8176. * @param options optional. See InputOptions.
  8177. * @returns string
  8178. */
  8179. function getInput(name, options) {
  8180. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8181. if (options && options.required && !val) {
  8182. throw new Error(`Input required and not supplied: ${name}`);
  8183. }
  8184. return val.trim();
  8185. }
  8186. exports.getInput = getInput;
  8187. /**
  8188. * Sets the value of an output.
  8189. *
  8190. * @param name name of the output to set
  8191. * @param value value to store
  8192. */
  8193. function setOutput(name, value) {
  8194. command_1.issueCommand('set-output', { name }, value);
  8195. }
  8196. exports.setOutput = setOutput;
  8197. //-----------------------------------------------------------------------
  8198. // Results
  8199. //-----------------------------------------------------------------------
  8200. /**
  8201. * Sets the action status to failed.
  8202. * When the action exits it will be with an exit code of 1
  8203. * @param message add error issue message
  8204. */
  8205. function setFailed(message) {
  8206. process.exitCode = ExitCode.Failure;
  8207. error(message);
  8208. }
  8209. exports.setFailed = setFailed;
  8210. //-----------------------------------------------------------------------
  8211. // Logging Commands
  8212. //-----------------------------------------------------------------------
  8213. /**
  8214. * Writes debug message to user log
  8215. * @param message debug message
  8216. */
  8217. function debug(message) {
  8218. command_1.issueCommand('debug', {}, message);
  8219. }
  8220. exports.debug = debug;
  8221. /**
  8222. * Adds an error issue
  8223. * @param message error issue message
  8224. */
  8225. function error(message) {
  8226. command_1.issue('error', message);
  8227. }
  8228. exports.error = error;
  8229. /**
  8230. * Adds an warning issue
  8231. * @param message warning issue message
  8232. */
  8233. function warning(message) {
  8234. command_1.issue('warning', message);
  8235. }
  8236. exports.warning = warning;
  8237. /**
  8238. * Writes info to log with console.log.
  8239. * @param message info message
  8240. */
  8241. function info(message) {
  8242. process.stdout.write(message + os.EOL);
  8243. }
  8244. exports.info = info;
  8245. /**
  8246. * Begin an output group.
  8247. *
  8248. * Output until the next `groupEnd` will be foldable in this group
  8249. *
  8250. * @param name The name of the output group
  8251. */
  8252. function startGroup(name) {
  8253. command_1.issue('group', name);
  8254. }
  8255. exports.startGroup = startGroup;
  8256. /**
  8257. * End an output group.
  8258. */
  8259. function endGroup() {
  8260. command_1.issue('endgroup');
  8261. }
  8262. exports.endGroup = endGroup;
  8263. /**
  8264. * Wrap an asynchronous function call in a group.
  8265. *
  8266. * Returns the same type as the function itself.
  8267. *
  8268. * @param name The name of the group
  8269. * @param fn The function to wrap in the group
  8270. */
  8271. function group(name, fn) {
  8272. return __awaiter(this, void 0, void 0, function* () {
  8273. startGroup(name);
  8274. let result;
  8275. try {
  8276. result = yield fn();
  8277. }
  8278. finally {
  8279. endGroup();
  8280. }
  8281. return result;
  8282. });
  8283. }
  8284. exports.group = group;
  8285. //# sourceMappingURL=core.js.map
  8286. /***/ }),
  8287. /***/ 471:
  8288. /***/ (function(module, __unusedexports, __webpack_require__) {
  8289. module.exports = authenticationBeforeRequest;
  8290. const btoa = __webpack_require__(675);
  8291. const uniq = __webpack_require__(126);
  8292. function authenticationBeforeRequest(state, options) {
  8293. if (!state.auth.type) {
  8294. return;
  8295. }
  8296. if (state.auth.type === "basic") {
  8297. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8298. options.headers.authorization = `Basic ${hash}`;
  8299. return;
  8300. }
  8301. if (state.auth.type === "token") {
  8302. options.headers.authorization = `token ${state.auth.token}`;
  8303. return;
  8304. }
  8305. if (state.auth.type === "app") {
  8306. options.headers.authorization = `Bearer ${state.auth.token}`;
  8307. const acceptHeaders = options.headers.accept
  8308. .split(",")
  8309. .concat("application/vnd.github.machine-man-preview+json");
  8310. options.headers.accept = uniq(acceptHeaders)
  8311. .filter(Boolean)
  8312. .join(",");
  8313. return;
  8314. }
  8315. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8316. if (state.auth.token) {
  8317. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8318. return;
  8319. }
  8320. const key = encodeURIComponent(state.auth.key);
  8321. const secret = encodeURIComponent(state.auth.secret);
  8322. options.url += `client_id=${key}&client_secret=${secret}`;
  8323. }
  8324. /***/ }),
  8325. /***/ 489:
  8326. /***/ (function(module, __unusedexports, __webpack_require__) {
  8327. "use strict";
  8328. const path = __webpack_require__(622);
  8329. const which = __webpack_require__(814);
  8330. const pathKey = __webpack_require__(39)();
  8331. function resolveCommandAttempt(parsed, withoutPathExt) {
  8332. const cwd = process.cwd();
  8333. const hasCustomCwd = parsed.options.cwd != null;
  8334. // If a custom `cwd` was specified, we need to change the process cwd
  8335. // because `which` will do stat calls but does not support a custom cwd
  8336. if (hasCustomCwd) {
  8337. try {
  8338. process.chdir(parsed.options.cwd);
  8339. } catch (err) {
  8340. /* Empty */
  8341. }
  8342. }
  8343. let resolved;
  8344. try {
  8345. resolved = which.sync(parsed.command, {
  8346. path: (parsed.options.env || process.env)[pathKey],
  8347. pathExt: withoutPathExt ? path.delimiter : undefined,
  8348. });
  8349. } catch (e) {
  8350. /* Empty */
  8351. } finally {
  8352. process.chdir(cwd);
  8353. }
  8354. // If we successfully resolved, ensure that an absolute path is returned
  8355. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8356. if (resolved) {
  8357. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8358. }
  8359. return resolved;
  8360. }
  8361. function resolveCommand(parsed) {
  8362. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8363. }
  8364. module.exports = resolveCommand;
  8365. /***/ }),
  8366. /***/ 510:
  8367. /***/ (function(module) {
  8368. module.exports = addHook
  8369. function addHook (state, kind, name, hook) {
  8370. var orig = hook
  8371. if (!state.registry[name]) {
  8372. state.registry[name] = []
  8373. }
  8374. if (kind === 'before') {
  8375. hook = function (method, options) {
  8376. return Promise.resolve()
  8377. .then(orig.bind(null, options))
  8378. .then(method.bind(null, options))
  8379. }
  8380. }
  8381. if (kind === 'after') {
  8382. hook = function (method, options) {
  8383. var result
  8384. return Promise.resolve()
  8385. .then(method.bind(null, options))
  8386. .then(function (result_) {
  8387. result = result_
  8388. return orig(result, options)
  8389. })
  8390. .then(function () {
  8391. return result
  8392. })
  8393. }
  8394. }
  8395. if (kind === 'error') {
  8396. hook = function (method, options) {
  8397. return Promise.resolve()
  8398. .then(method.bind(null, options))
  8399. .catch(function (error) {
  8400. return orig(error, options)
  8401. })
  8402. }
  8403. }
  8404. state.registry[name].push({
  8405. hook: hook,
  8406. orig: orig
  8407. })
  8408. }
  8409. /***/ }),
  8410. /***/ 523:
  8411. /***/ (function(module, __unusedexports, __webpack_require__) {
  8412. var register = __webpack_require__(363)
  8413. var addHook = __webpack_require__(510)
  8414. var removeHook = __webpack_require__(763)
  8415. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8416. var bind = Function.bind
  8417. var bindable = bind.bind(bind)
  8418. function bindApi (hook, state, name) {
  8419. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8420. hook.api = { remove: removeHookRef }
  8421. hook.remove = removeHookRef
  8422. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8423. var args = name ? [state, kind, name] : [state, kind]
  8424. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8425. })
  8426. }
  8427. function HookSingular () {
  8428. var singularHookName = 'h'
  8429. var singularHookState = {
  8430. registry: {}
  8431. }
  8432. var singularHook = register.bind(null, singularHookState, singularHookName)
  8433. bindApi(singularHook, singularHookState, singularHookName)
  8434. return singularHook
  8435. }
  8436. function HookCollection () {
  8437. var state = {
  8438. registry: {}
  8439. }
  8440. var hook = register.bind(null, state)
  8441. bindApi(hook, state)
  8442. return hook
  8443. }
  8444. var collectionHookDeprecationMessageDisplayed = false
  8445. function Hook () {
  8446. if (!collectionHookDeprecationMessageDisplayed) {
  8447. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8448. collectionHookDeprecationMessageDisplayed = true
  8449. }
  8450. return HookCollection()
  8451. }
  8452. Hook.Singular = HookSingular.bind()
  8453. Hook.Collection = HookCollection.bind()
  8454. module.exports = Hook
  8455. // expose constructors as a named property for TypeScript
  8456. module.exports.Hook = Hook
  8457. module.exports.Singular = Hook.Singular
  8458. module.exports.Collection = Hook.Collection
  8459. /***/ }),
  8460. /***/ 528:
  8461. /***/ (function(__unusedmodule, exports) {
  8462. "use strict";
  8463. Object.defineProperty(exports, "__esModule", { value: true });
  8464. function escape(value) {
  8465. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8466. return `\\${x}`;
  8467. });
  8468. }
  8469. exports.escape = escape;
  8470. /***/ }),
  8471. /***/ 529:
  8472. /***/ (function(module, __unusedexports, __webpack_require__) {
  8473. const factory = __webpack_require__(47);
  8474. module.exports = factory();
  8475. /***/ }),
  8476. /***/ 533:
  8477. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8478. "use strict";
  8479. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8480. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8481. return new (P || (P = Promise))(function (resolve, reject) {
  8482. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8483. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8484. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8485. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8486. });
  8487. };
  8488. Object.defineProperty(exports, "__esModule", { value: true });
  8489. const core = __webpack_require__(470);
  8490. const io = __webpack_require__(1);
  8491. const fs = __webpack_require__(747);
  8492. const os = __webpack_require__(87);
  8493. const path = __webpack_require__(622);
  8494. const httpm = __webpack_require__(874);
  8495. const semver = __webpack_require__(656);
  8496. const uuidV4 = __webpack_require__(826);
  8497. const exec_1 = __webpack_require__(986);
  8498. const assert_1 = __webpack_require__(357);
  8499. class HTTPError extends Error {
  8500. constructor(httpStatusCode) {
  8501. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8502. this.httpStatusCode = httpStatusCode;
  8503. Object.setPrototypeOf(this, new.target.prototype);
  8504. }
  8505. }
  8506. exports.HTTPError = HTTPError;
  8507. const IS_WINDOWS = process.platform === 'win32';
  8508. const userAgent = 'actions/tool-cache';
  8509. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8510. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8511. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8512. // If directories not found, place them in common temp locations
  8513. if (!tempDirectory || !cacheRoot) {
  8514. let baseLocation;
  8515. if (IS_WINDOWS) {
  8516. // On windows use the USERPROFILE env variable
  8517. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8518. }
  8519. else {
  8520. if (process.platform === 'darwin') {
  8521. baseLocation = '/Users';
  8522. }
  8523. else {
  8524. baseLocation = '/home';
  8525. }
  8526. }
  8527. if (!tempDirectory) {
  8528. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8529. }
  8530. if (!cacheRoot) {
  8531. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8532. }
  8533. }
  8534. /**
  8535. * Download a tool from an url and stream it into a file
  8536. *
  8537. * @param url url of tool to download
  8538. * @returns path to downloaded tool
  8539. */
  8540. function downloadTool(url) {
  8541. return __awaiter(this, void 0, void 0, function* () {
  8542. // Wrap in a promise so that we can resolve from within stream callbacks
  8543. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8544. try {
  8545. const http = new httpm.HttpClient(userAgent, [], {
  8546. allowRetries: true,
  8547. maxRetries: 3
  8548. });
  8549. const destPath = path.join(tempDirectory, uuidV4());
  8550. yield io.mkdirP(tempDirectory);
  8551. core.debug(`Downloading ${url}`);
  8552. core.debug(`Downloading ${destPath}`);
  8553. if (fs.existsSync(destPath)) {
  8554. throw new Error(`Destination file path ${destPath} already exists`);
  8555. }
  8556. const response = yield http.get(url);
  8557. if (response.message.statusCode !== 200) {
  8558. const err = new HTTPError(response.message.statusCode);
  8559. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8560. throw err;
  8561. }
  8562. const file = fs.createWriteStream(destPath);
  8563. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8564. try {
  8565. const stream = response.message.pipe(file);
  8566. stream.on('close', () => {
  8567. core.debug('download complete');
  8568. resolve(destPath);
  8569. });
  8570. }
  8571. catch (err) {
  8572. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8573. reject(err);
  8574. }
  8575. }));
  8576. file.on('error', err => {
  8577. file.end();
  8578. reject(err);
  8579. });
  8580. }
  8581. catch (err) {
  8582. reject(err);
  8583. }
  8584. }));
  8585. });
  8586. }
  8587. exports.downloadTool = downloadTool;
  8588. /**
  8589. * Extract a .7z file
  8590. *
  8591. * @param file path to the .7z file
  8592. * @param dest destination directory. Optional.
  8593. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8594. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8595. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8596. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8597. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8598. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8599. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8600. * to 7zr.exe can be pass to this function.
  8601. * @returns path to the destination directory
  8602. */
  8603. function extract7z(file, dest, _7zPath) {
  8604. return __awaiter(this, void 0, void 0, function* () {
  8605. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8606. assert_1.ok(file, 'parameter "file" is required');
  8607. dest = dest || (yield _createExtractFolder(dest));
  8608. const originalCwd = process.cwd();
  8609. process.chdir(dest);
  8610. if (_7zPath) {
  8611. try {
  8612. const args = [
  8613. 'x',
  8614. '-bb1',
  8615. '-bd',
  8616. '-sccUTF-8',
  8617. file
  8618. ];
  8619. const options = {
  8620. silent: true
  8621. };
  8622. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8623. }
  8624. finally {
  8625. process.chdir(originalCwd);
  8626. }
  8627. }
  8628. else {
  8629. const escapedScript = path
  8630. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8631. .replace(/'/g, "''")
  8632. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8633. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8634. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8635. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8636. const args = [
  8637. '-NoLogo',
  8638. '-Sta',
  8639. '-NoProfile',
  8640. '-NonInteractive',
  8641. '-ExecutionPolicy',
  8642. 'Unrestricted',
  8643. '-Command',
  8644. command
  8645. ];
  8646. const options = {
  8647. silent: true
  8648. };
  8649. try {
  8650. const powershellPath = yield io.which('powershell', true);
  8651. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8652. }
  8653. finally {
  8654. process.chdir(originalCwd);
  8655. }
  8656. }
  8657. return dest;
  8658. });
  8659. }
  8660. exports.extract7z = extract7z;
  8661. /**
  8662. * Extract a tar
  8663. *
  8664. * @param file path to the tar
  8665. * @param dest destination directory. Optional.
  8666. * @param flags flags for the tar. Optional.
  8667. * @returns path to the destination directory
  8668. */
  8669. function extractTar(file, dest, flags = 'xz') {
  8670. return __awaiter(this, void 0, void 0, function* () {
  8671. if (!file) {
  8672. throw new Error("parameter 'file' is required");
  8673. }
  8674. dest = dest || (yield _createExtractFolder(dest));
  8675. const tarPath = yield io.which('tar', true);
  8676. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8677. return dest;
  8678. });
  8679. }
  8680. exports.extractTar = extractTar;
  8681. /**
  8682. * Extract a zip
  8683. *
  8684. * @param file path to the zip
  8685. * @param dest destination directory. Optional.
  8686. * @returns path to the destination directory
  8687. */
  8688. function extractZip(file, dest) {
  8689. return __awaiter(this, void 0, void 0, function* () {
  8690. if (!file) {
  8691. throw new Error("parameter 'file' is required");
  8692. }
  8693. dest = dest || (yield _createExtractFolder(dest));
  8694. if (IS_WINDOWS) {
  8695. yield extractZipWin(file, dest);
  8696. }
  8697. else {
  8698. yield extractZipNix(file, dest);
  8699. }
  8700. return dest;
  8701. });
  8702. }
  8703. exports.extractZip = extractZip;
  8704. function extractZipWin(file, dest) {
  8705. return __awaiter(this, void 0, void 0, function* () {
  8706. // build the powershell command
  8707. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8708. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8709. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8710. // run powershell
  8711. const powershellPath = yield io.which('powershell');
  8712. const args = [
  8713. '-NoLogo',
  8714. '-Sta',
  8715. '-NoProfile',
  8716. '-NonInteractive',
  8717. '-ExecutionPolicy',
  8718. 'Unrestricted',
  8719. '-Command',
  8720. command
  8721. ];
  8722. yield exec_1.exec(`"${powershellPath}"`, args);
  8723. });
  8724. }
  8725. function extractZipNix(file, dest) {
  8726. return __awaiter(this, void 0, void 0, function* () {
  8727. const unzipPath = yield io.which('unzip');
  8728. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8729. });
  8730. }
  8731. /**
  8732. * Caches a directory and installs it into the tool cacheDir
  8733. *
  8734. * @param sourceDir the directory to cache into tools
  8735. * @param tool tool name
  8736. * @param version version of the tool. semver format
  8737. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8738. */
  8739. function cacheDir(sourceDir, tool, version, arch) {
  8740. return __awaiter(this, void 0, void 0, function* () {
  8741. version = semver.clean(version) || version;
  8742. arch = arch || os.arch();
  8743. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8744. core.debug(`source dir: ${sourceDir}`);
  8745. if (!fs.statSync(sourceDir).isDirectory()) {
  8746. throw new Error('sourceDir is not a directory');
  8747. }
  8748. // Create the tool dir
  8749. const destPath = yield _createToolPath(tool, version, arch);
  8750. // copy each child item. do not move. move can fail on Windows
  8751. // due to anti-virus software having an open handle on a file.
  8752. for (const itemName of fs.readdirSync(sourceDir)) {
  8753. const s = path.join(sourceDir, itemName);
  8754. yield io.cp(s, destPath, { recursive: true });
  8755. }
  8756. // write .complete
  8757. _completeToolPath(tool, version, arch);
  8758. return destPath;
  8759. });
  8760. }
  8761. exports.cacheDir = cacheDir;
  8762. /**
  8763. * Caches a downloaded file (GUID) and installs it
  8764. * into the tool cache with a given targetName
  8765. *
  8766. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8767. * @param targetFile the name of the file name in the tools directory
  8768. * @param tool tool name
  8769. * @param version version of the tool. semver format
  8770. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8771. */
  8772. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8773. return __awaiter(this, void 0, void 0, function* () {
  8774. version = semver.clean(version) || version;
  8775. arch = arch || os.arch();
  8776. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8777. core.debug(`source file: ${sourceFile}`);
  8778. if (!fs.statSync(sourceFile).isFile()) {
  8779. throw new Error('sourceFile is not a file');
  8780. }
  8781. // create the tool dir
  8782. const destFolder = yield _createToolPath(tool, version, arch);
  8783. // copy instead of move. move can fail on Windows due to
  8784. // anti-virus software having an open handle on a file.
  8785. const destPath = path.join(destFolder, targetFile);
  8786. core.debug(`destination file ${destPath}`);
  8787. yield io.cp(sourceFile, destPath);
  8788. // write .complete
  8789. _completeToolPath(tool, version, arch);
  8790. return destFolder;
  8791. });
  8792. }
  8793. exports.cacheFile = cacheFile;
  8794. /**
  8795. * Finds the path to a tool version in the local installed tool cache
  8796. *
  8797. * @param toolName name of the tool
  8798. * @param versionSpec version of the tool
  8799. * @param arch optional arch. defaults to arch of computer
  8800. */
  8801. function find(toolName, versionSpec, arch) {
  8802. if (!toolName) {
  8803. throw new Error('toolName parameter is required');
  8804. }
  8805. if (!versionSpec) {
  8806. throw new Error('versionSpec parameter is required');
  8807. }
  8808. arch = arch || os.arch();
  8809. // attempt to resolve an explicit version
  8810. if (!_isExplicitVersion(versionSpec)) {
  8811. const localVersions = findAllVersions(toolName, arch);
  8812. const match = _evaluateVersions(localVersions, versionSpec);
  8813. versionSpec = match;
  8814. }
  8815. // check for the explicit version in the cache
  8816. let toolPath = '';
  8817. if (versionSpec) {
  8818. versionSpec = semver.clean(versionSpec) || '';
  8819. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8820. core.debug(`checking cache: ${cachePath}`);
  8821. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8822. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8823. toolPath = cachePath;
  8824. }
  8825. else {
  8826. core.debug('not found');
  8827. }
  8828. }
  8829. return toolPath;
  8830. }
  8831. exports.find = find;
  8832. /**
  8833. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8834. *
  8835. * @param toolName name of the tool
  8836. * @param arch optional arch. defaults to arch of computer
  8837. */
  8838. function findAllVersions(toolName, arch) {
  8839. const versions = [];
  8840. arch = arch || os.arch();
  8841. const toolPath = path.join(cacheRoot, toolName);
  8842. if (fs.existsSync(toolPath)) {
  8843. const children = fs.readdirSync(toolPath);
  8844. for (const child of children) {
  8845. if (_isExplicitVersion(child)) {
  8846. const fullPath = path.join(toolPath, child, arch || '');
  8847. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8848. versions.push(child);
  8849. }
  8850. }
  8851. }
  8852. }
  8853. return versions;
  8854. }
  8855. exports.findAllVersions = findAllVersions;
  8856. function _createExtractFolder(dest) {
  8857. return __awaiter(this, void 0, void 0, function* () {
  8858. if (!dest) {
  8859. // create a temp dir
  8860. dest = path.join(tempDirectory, uuidV4());
  8861. }
  8862. yield io.mkdirP(dest);
  8863. return dest;
  8864. });
  8865. }
  8866. function _createToolPath(tool, version, arch) {
  8867. return __awaiter(this, void 0, void 0, function* () {
  8868. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8869. core.debug(`destination ${folderPath}`);
  8870. const markerPath = `${folderPath}.complete`;
  8871. yield io.rmRF(folderPath);
  8872. yield io.rmRF(markerPath);
  8873. yield io.mkdirP(folderPath);
  8874. return folderPath;
  8875. });
  8876. }
  8877. function _completeToolPath(tool, version, arch) {
  8878. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8879. const markerPath = `${folderPath}.complete`;
  8880. fs.writeFileSync(markerPath, '');
  8881. core.debug('finished caching tool');
  8882. }
  8883. function _isExplicitVersion(versionSpec) {
  8884. const c = semver.clean(versionSpec) || '';
  8885. core.debug(`isExplicit: ${c}`);
  8886. const valid = semver.valid(c) != null;
  8887. core.debug(`explicit? ${valid}`);
  8888. return valid;
  8889. }
  8890. function _evaluateVersions(versions, versionSpec) {
  8891. let version = '';
  8892. core.debug(`evaluating ${versions.length} versions`);
  8893. versions = versions.sort((a, b) => {
  8894. if (semver.gt(a, b)) {
  8895. return 1;
  8896. }
  8897. return -1;
  8898. });
  8899. for (let i = versions.length - 1; i >= 0; i--) {
  8900. const potential = versions[i];
  8901. const satisfied = semver.satisfies(potential, versionSpec);
  8902. if (satisfied) {
  8903. version = potential;
  8904. break;
  8905. }
  8906. }
  8907. if (version) {
  8908. core.debug(`matched: ${version}`);
  8909. }
  8910. else {
  8911. core.debug('match not found');
  8912. }
  8913. return version;
  8914. }
  8915. //# sourceMappingURL=tool-cache.js.map
  8916. /***/ }),
  8917. /***/ 536:
  8918. /***/ (function(module, __unusedexports, __webpack_require__) {
  8919. module.exports = hasFirstPage
  8920. const deprecate = __webpack_require__(370)
  8921. const getPageLinks = __webpack_require__(577)
  8922. function hasFirstPage (link) {
  8923. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8924. return getPageLinks(link).first
  8925. }
  8926. /***/ }),
  8927. /***/ 539:
  8928. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8929. "use strict";
  8930. Object.defineProperty(exports, "__esModule", { value: true });
  8931. const url = __webpack_require__(835);
  8932. const http = __webpack_require__(605);
  8933. const https = __webpack_require__(211);
  8934. const pm = __webpack_require__(950);
  8935. let tunnel;
  8936. var HttpCodes;
  8937. (function (HttpCodes) {
  8938. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  8939. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  8940. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  8941. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  8942. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  8943. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  8944. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  8945. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  8946. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  8947. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  8948. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  8949. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  8950. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  8951. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  8952. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  8953. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  8954. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  8955. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  8956. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  8957. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  8958. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  8959. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  8960. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  8961. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  8962. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  8963. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  8964. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  8965. /**
  8966. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  8967. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  8968. */
  8969. function getProxyUrl(serverUrl) {
  8970. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  8971. return proxyUrl ? proxyUrl.href : '';
  8972. }
  8973. exports.getProxyUrl = getProxyUrl;
  8974. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  8975. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  8976. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  8977. const ExponentialBackoffCeiling = 10;
  8978. const ExponentialBackoffTimeSlice = 5;
  8979. class HttpClientResponse {
  8980. constructor(message) {
  8981. this.message = message;
  8982. }
  8983. readBody() {
  8984. return new Promise(async (resolve, reject) => {
  8985. let output = Buffer.alloc(0);
  8986. this.message.on('data', (chunk) => {
  8987. output = Buffer.concat([output, chunk]);
  8988. });
  8989. this.message.on('end', () => {
  8990. resolve(output.toString());
  8991. });
  8992. });
  8993. }
  8994. }
  8995. exports.HttpClientResponse = HttpClientResponse;
  8996. function isHttps(requestUrl) {
  8997. let parsedUrl = url.parse(requestUrl);
  8998. return parsedUrl.protocol === 'https:';
  8999. }
  9000. exports.isHttps = isHttps;
  9001. class HttpClient {
  9002. constructor(userAgent, handlers, requestOptions) {
  9003. this._ignoreSslError = false;
  9004. this._allowRedirects = true;
  9005. this._allowRedirectDowngrade = false;
  9006. this._maxRedirects = 50;
  9007. this._allowRetries = false;
  9008. this._maxRetries = 1;
  9009. this._keepAlive = false;
  9010. this._disposed = false;
  9011. this.userAgent = userAgent;
  9012. this.handlers = handlers || [];
  9013. this.requestOptions = requestOptions;
  9014. if (requestOptions) {
  9015. if (requestOptions.ignoreSslError != null) {
  9016. this._ignoreSslError = requestOptions.ignoreSslError;
  9017. }
  9018. this._socketTimeout = requestOptions.socketTimeout;
  9019. if (requestOptions.allowRedirects != null) {
  9020. this._allowRedirects = requestOptions.allowRedirects;
  9021. }
  9022. if (requestOptions.allowRedirectDowngrade != null) {
  9023. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9024. }
  9025. if (requestOptions.maxRedirects != null) {
  9026. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9027. }
  9028. if (requestOptions.keepAlive != null) {
  9029. this._keepAlive = requestOptions.keepAlive;
  9030. }
  9031. if (requestOptions.allowRetries != null) {
  9032. this._allowRetries = requestOptions.allowRetries;
  9033. }
  9034. if (requestOptions.maxRetries != null) {
  9035. this._maxRetries = requestOptions.maxRetries;
  9036. }
  9037. }
  9038. }
  9039. options(requestUrl, additionalHeaders) {
  9040. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9041. }
  9042. get(requestUrl, additionalHeaders) {
  9043. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9044. }
  9045. del(requestUrl, additionalHeaders) {
  9046. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9047. }
  9048. post(requestUrl, data, additionalHeaders) {
  9049. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9050. }
  9051. patch(requestUrl, data, additionalHeaders) {
  9052. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9053. }
  9054. put(requestUrl, data, additionalHeaders) {
  9055. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9056. }
  9057. head(requestUrl, additionalHeaders) {
  9058. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9059. }
  9060. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9061. return this.request(verb, requestUrl, stream, additionalHeaders);
  9062. }
  9063. /**
  9064. * Makes a raw http request.
  9065. * All other methods such as get, post, patch, and request ultimately call this.
  9066. * Prefer get, del, post and patch
  9067. */
  9068. async request(verb, requestUrl, data, headers) {
  9069. if (this._disposed) {
  9070. throw new Error("Client has already been disposed.");
  9071. }
  9072. let parsedUrl = url.parse(requestUrl);
  9073. let info = this._prepareRequest(verb, parsedUrl, headers);
  9074. // Only perform retries on reads since writes may not be idempotent.
  9075. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  9076. let numTries = 0;
  9077. let response;
  9078. while (numTries < maxTries) {
  9079. response = await this.requestRaw(info, data);
  9080. // Check if it's an authentication challenge
  9081. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  9082. let authenticationHandler;
  9083. for (let i = 0; i < this.handlers.length; i++) {
  9084. if (this.handlers[i].canHandleAuthentication(response)) {
  9085. authenticationHandler = this.handlers[i];
  9086. break;
  9087. }
  9088. }
  9089. if (authenticationHandler) {
  9090. return authenticationHandler.handleAuthentication(this, info, data);
  9091. }
  9092. else {
  9093. // We have received an unauthorized response but have no handlers to handle it.
  9094. // Let the response return to the caller.
  9095. return response;
  9096. }
  9097. }
  9098. let redirectsRemaining = this._maxRedirects;
  9099. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  9100. && this._allowRedirects
  9101. && redirectsRemaining > 0) {
  9102. const redirectUrl = response.message.headers["location"];
  9103. if (!redirectUrl) {
  9104. // if there's no location to redirect to, we won't
  9105. break;
  9106. }
  9107. let parsedRedirectUrl = url.parse(redirectUrl);
  9108. if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
  9109. 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.");
  9110. }
  9111. // we need to finish reading the response before reassigning response
  9112. // which will leak the open socket.
  9113. await response.readBody();
  9114. // let's make the request with the new redirectUrl
  9115. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9116. response = await this.requestRaw(info, data);
  9117. redirectsRemaining--;
  9118. }
  9119. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9120. // If not a retry code, return immediately instead of retrying
  9121. return response;
  9122. }
  9123. numTries += 1;
  9124. if (numTries < maxTries) {
  9125. await response.readBody();
  9126. await this._performExponentialBackoff(numTries);
  9127. }
  9128. }
  9129. return response;
  9130. }
  9131. /**
  9132. * Needs to be called if keepAlive is set to true in request options.
  9133. */
  9134. dispose() {
  9135. if (this._agent) {
  9136. this._agent.destroy();
  9137. }
  9138. this._disposed = true;
  9139. }
  9140. /**
  9141. * Raw request.
  9142. * @param info
  9143. * @param data
  9144. */
  9145. requestRaw(info, data) {
  9146. return new Promise((resolve, reject) => {
  9147. let callbackForResult = function (err, res) {
  9148. if (err) {
  9149. reject(err);
  9150. }
  9151. resolve(res);
  9152. };
  9153. this.requestRawWithCallback(info, data, callbackForResult);
  9154. });
  9155. }
  9156. /**
  9157. * Raw request with callback.
  9158. * @param info
  9159. * @param data
  9160. * @param onResult
  9161. */
  9162. requestRawWithCallback(info, data, onResult) {
  9163. let socket;
  9164. if (typeof (data) === 'string') {
  9165. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  9166. }
  9167. let callbackCalled = false;
  9168. let handleResult = (err, res) => {
  9169. if (!callbackCalled) {
  9170. callbackCalled = true;
  9171. onResult(err, res);
  9172. }
  9173. };
  9174. let req = info.httpModule.request(info.options, (msg) => {
  9175. let res = new HttpClientResponse(msg);
  9176. handleResult(null, res);
  9177. });
  9178. req.on('socket', (sock) => {
  9179. socket = sock;
  9180. });
  9181. // If we ever get disconnected, we want the socket to timeout eventually
  9182. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9183. if (socket) {
  9184. socket.end();
  9185. }
  9186. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9187. });
  9188. req.on('error', function (err) {
  9189. // err has statusCode property
  9190. // res should have headers
  9191. handleResult(err, null);
  9192. });
  9193. if (data && typeof (data) === 'string') {
  9194. req.write(data, 'utf8');
  9195. }
  9196. if (data && typeof (data) !== 'string') {
  9197. data.on('close', function () {
  9198. req.end();
  9199. });
  9200. data.pipe(req);
  9201. }
  9202. else {
  9203. req.end();
  9204. }
  9205. }
  9206. /**
  9207. * Gets an http agent. This function is useful when you need an http agent that handles
  9208. * routing through a proxy server - depending upon the url and proxy environment variables.
  9209. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9210. */
  9211. getAgent(serverUrl) {
  9212. let parsedUrl = url.parse(serverUrl);
  9213. return this._getAgent(parsedUrl);
  9214. }
  9215. _prepareRequest(method, requestUrl, headers) {
  9216. const info = {};
  9217. info.parsedUrl = requestUrl;
  9218. const usingSsl = info.parsedUrl.protocol === 'https:';
  9219. info.httpModule = usingSsl ? https : http;
  9220. const defaultPort = usingSsl ? 443 : 80;
  9221. info.options = {};
  9222. info.options.host = info.parsedUrl.hostname;
  9223. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  9224. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9225. info.options.method = method;
  9226. info.options.headers = this._mergeHeaders(headers);
  9227. if (this.userAgent != null) {
  9228. info.options.headers["user-agent"] = this.userAgent;
  9229. }
  9230. info.options.agent = this._getAgent(info.parsedUrl);
  9231. // gives handlers an opportunity to participate
  9232. if (this.handlers) {
  9233. this.handlers.forEach((handler) => {
  9234. handler.prepareRequest(info.options);
  9235. });
  9236. }
  9237. return info;
  9238. }
  9239. _mergeHeaders(headers) {
  9240. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  9241. if (this.requestOptions && this.requestOptions.headers) {
  9242. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9243. }
  9244. return lowercaseKeys(headers || {});
  9245. }
  9246. _getAgent(parsedUrl) {
  9247. let agent;
  9248. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9249. let useProxy = proxyUrl && proxyUrl.hostname;
  9250. if (this._keepAlive && useProxy) {
  9251. agent = this._proxyAgent;
  9252. }
  9253. if (this._keepAlive && !useProxy) {
  9254. agent = this._agent;
  9255. }
  9256. // if agent is already assigned use that agent.
  9257. if (!!agent) {
  9258. return agent;
  9259. }
  9260. const usingSsl = parsedUrl.protocol === 'https:';
  9261. let maxSockets = 100;
  9262. if (!!this.requestOptions) {
  9263. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9264. }
  9265. if (useProxy) {
  9266. // If using proxy, need tunnel
  9267. if (!tunnel) {
  9268. tunnel = __webpack_require__(335);
  9269. }
  9270. const agentOptions = {
  9271. maxSockets: maxSockets,
  9272. keepAlive: this._keepAlive,
  9273. proxy: {
  9274. proxyAuth: proxyUrl.auth,
  9275. host: proxyUrl.hostname,
  9276. port: proxyUrl.port
  9277. },
  9278. };
  9279. let tunnelAgent;
  9280. const overHttps = proxyUrl.protocol === 'https:';
  9281. if (usingSsl) {
  9282. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9283. }
  9284. else {
  9285. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9286. }
  9287. agent = tunnelAgent(agentOptions);
  9288. this._proxyAgent = agent;
  9289. }
  9290. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9291. if (this._keepAlive && !agent) {
  9292. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9293. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9294. this._agent = agent;
  9295. }
  9296. // if not using private agent and tunnel agent isn't setup then use global agent
  9297. if (!agent) {
  9298. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9299. }
  9300. if (usingSsl && this._ignoreSslError) {
  9301. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9302. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9303. // we have to cast it to any and change it directly
  9304. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  9305. }
  9306. return agent;
  9307. }
  9308. _performExponentialBackoff(retryNumber) {
  9309. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9310. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9311. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9312. }
  9313. }
  9314. exports.HttpClient = HttpClient;
  9315. /***/ }),
  9316. /***/ 550:
  9317. /***/ (function(module, __unusedexports, __webpack_require__) {
  9318. module.exports = getNextPage
  9319. const getPage = __webpack_require__(265)
  9320. function getNextPage (octokit, link, headers) {
  9321. return getPage(octokit, link, 'next', headers)
  9322. }
  9323. /***/ }),
  9324. /***/ 558:
  9325. /***/ (function(module, __unusedexports, __webpack_require__) {
  9326. module.exports = hasPreviousPage
  9327. const deprecate = __webpack_require__(370)
  9328. const getPageLinks = __webpack_require__(577)
  9329. function hasPreviousPage (link) {
  9330. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9331. return getPageLinks(link).prev
  9332. }
  9333. /***/ }),
  9334. /***/ 559:
  9335. /***/ (function(__unusedmodule, exports) {
  9336. "use strict";
  9337. Object.defineProperty(exports, "__esModule", { value: true });
  9338. class GitVersion {
  9339. /**
  9340. * Used for comparing the version of git and git-lfs against the minimum required version
  9341. * @param version the version string, e.g. 1.2 or 1.2.3
  9342. */
  9343. constructor(version) {
  9344. this.major = NaN;
  9345. this.minor = NaN;
  9346. this.patch = NaN;
  9347. if (version) {
  9348. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9349. if (match) {
  9350. this.major = Number(match[1]);
  9351. this.minor = Number(match[2]);
  9352. if (match[4]) {
  9353. this.patch = Number(match[4]);
  9354. }
  9355. }
  9356. }
  9357. }
  9358. /**
  9359. * Compares the instance against a minimum required version
  9360. * @param minimum Minimum version
  9361. */
  9362. checkMinimum(minimum) {
  9363. if (!minimum.isValid()) {
  9364. throw new Error('Arg minimum is not a valid version');
  9365. }
  9366. // Major is insufficient
  9367. if (this.major < minimum.major) {
  9368. return false;
  9369. }
  9370. // Major is equal
  9371. if (this.major === minimum.major) {
  9372. // Minor is insufficient
  9373. if (this.minor < minimum.minor) {
  9374. return false;
  9375. }
  9376. // Minor is equal
  9377. if (this.minor === minimum.minor) {
  9378. // Patch is insufficient
  9379. if (this.patch && this.patch < (minimum.patch || 0)) {
  9380. return false;
  9381. }
  9382. }
  9383. }
  9384. return true;
  9385. }
  9386. /**
  9387. * Indicates whether the instance was constructed from a valid version string
  9388. */
  9389. isValid() {
  9390. return !isNaN(this.major);
  9391. }
  9392. /**
  9393. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9394. */
  9395. toString() {
  9396. let result = '';
  9397. if (this.isValid()) {
  9398. result = `${this.major}.${this.minor}`;
  9399. if (!isNaN(this.patch)) {
  9400. result += `.${this.patch}`;
  9401. }
  9402. }
  9403. return result;
  9404. }
  9405. }
  9406. exports.GitVersion = GitVersion;
  9407. /***/ }),
  9408. /***/ 562:
  9409. /***/ (function(module, __unusedexports, __webpack_require__) {
  9410. var once = __webpack_require__(969);
  9411. var noop = function() {};
  9412. var isRequest = function(stream) {
  9413. return stream.setHeader && typeof stream.abort === 'function';
  9414. };
  9415. var isChildProcess = function(stream) {
  9416. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9417. };
  9418. var eos = function(stream, opts, callback) {
  9419. if (typeof opts === 'function') return eos(stream, null, opts);
  9420. if (!opts) opts = {};
  9421. callback = once(callback || noop);
  9422. var ws = stream._writableState;
  9423. var rs = stream._readableState;
  9424. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9425. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9426. var cancelled = false;
  9427. var onlegacyfinish = function() {
  9428. if (!stream.writable) onfinish();
  9429. };
  9430. var onfinish = function() {
  9431. writable = false;
  9432. if (!readable) callback.call(stream);
  9433. };
  9434. var onend = function() {
  9435. readable = false;
  9436. if (!writable) callback.call(stream);
  9437. };
  9438. var onexit = function(exitCode) {
  9439. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9440. };
  9441. var onerror = function(err) {
  9442. callback.call(stream, err);
  9443. };
  9444. var onclose = function() {
  9445. process.nextTick(onclosenexttick);
  9446. };
  9447. var onclosenexttick = function() {
  9448. if (cancelled) return;
  9449. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9450. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9451. };
  9452. var onrequest = function() {
  9453. stream.req.on('finish', onfinish);
  9454. };
  9455. if (isRequest(stream)) {
  9456. stream.on('complete', onfinish);
  9457. stream.on('abort', onclose);
  9458. if (stream.req) onrequest();
  9459. else stream.on('request', onrequest);
  9460. } else if (writable && !ws) { // legacy streams
  9461. stream.on('end', onlegacyfinish);
  9462. stream.on('close', onlegacyfinish);
  9463. }
  9464. if (isChildProcess(stream)) stream.on('exit', onexit);
  9465. stream.on('end', onend);
  9466. stream.on('finish', onfinish);
  9467. if (opts.error !== false) stream.on('error', onerror);
  9468. stream.on('close', onclose);
  9469. return function() {
  9470. cancelled = true;
  9471. stream.removeListener('complete', onfinish);
  9472. stream.removeListener('abort', onclose);
  9473. stream.removeListener('request', onrequest);
  9474. if (stream.req) stream.req.removeListener('finish', onfinish);
  9475. stream.removeListener('end', onlegacyfinish);
  9476. stream.removeListener('close', onlegacyfinish);
  9477. stream.removeListener('finish', onfinish);
  9478. stream.removeListener('exit', onexit);
  9479. stream.removeListener('end', onend);
  9480. stream.removeListener('error', onerror);
  9481. stream.removeListener('close', onclose);
  9482. };
  9483. };
  9484. module.exports = eos;
  9485. /***/ }),
  9486. /***/ 563:
  9487. /***/ (function(module, __unusedexports, __webpack_require__) {
  9488. module.exports = getPreviousPage
  9489. const getPage = __webpack_require__(265)
  9490. function getPreviousPage (octokit, link, headers) {
  9491. return getPage(octokit, link, 'prev', headers)
  9492. }
  9493. /***/ }),
  9494. /***/ 568:
  9495. /***/ (function(module, __unusedexports, __webpack_require__) {
  9496. "use strict";
  9497. const path = __webpack_require__(622);
  9498. const niceTry = __webpack_require__(948);
  9499. const resolveCommand = __webpack_require__(489);
  9500. const escape = __webpack_require__(462);
  9501. const readShebang = __webpack_require__(389);
  9502. const semver = __webpack_require__(280);
  9503. const isWin = process.platform === 'win32';
  9504. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9505. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9506. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9507. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9508. function detectShebang(parsed) {
  9509. parsed.file = resolveCommand(parsed);
  9510. const shebang = parsed.file && readShebang(parsed.file);
  9511. if (shebang) {
  9512. parsed.args.unshift(parsed.file);
  9513. parsed.command = shebang;
  9514. return resolveCommand(parsed);
  9515. }
  9516. return parsed.file;
  9517. }
  9518. function parseNonShell(parsed) {
  9519. if (!isWin) {
  9520. return parsed;
  9521. }
  9522. // Detect & add support for shebangs
  9523. const commandFile = detectShebang(parsed);
  9524. // We don't need a shell if the command filename is an executable
  9525. const needsShell = !isExecutableRegExp.test(commandFile);
  9526. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9527. // Note that `forceShell` is an hidden option used only in tests
  9528. if (parsed.options.forceShell || needsShell) {
  9529. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9530. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9531. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9532. // we need to double escape them
  9533. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9534. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9535. // This is necessary otherwise it will always fail with ENOENT in those cases
  9536. parsed.command = path.normalize(parsed.command);
  9537. // Escape command & arguments
  9538. parsed.command = escape.command(parsed.command);
  9539. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9540. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9541. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9542. parsed.command = process.env.comspec || 'cmd.exe';
  9543. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9544. }
  9545. return parsed;
  9546. }
  9547. function parseShell(parsed) {
  9548. // If node supports the shell option, there's no need to mimic its behavior
  9549. if (supportsShellOption) {
  9550. return parsed;
  9551. }
  9552. // Mimic node shell option
  9553. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9554. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9555. if (isWin) {
  9556. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9557. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9558. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9559. } else {
  9560. if (typeof parsed.options.shell === 'string') {
  9561. parsed.command = parsed.options.shell;
  9562. } else if (process.platform === 'android') {
  9563. parsed.command = '/system/bin/sh';
  9564. } else {
  9565. parsed.command = '/bin/sh';
  9566. }
  9567. parsed.args = ['-c', shellCommand];
  9568. }
  9569. return parsed;
  9570. }
  9571. function parse(command, args, options) {
  9572. // Normalize arguments, similar to nodejs
  9573. if (args && !Array.isArray(args)) {
  9574. options = args;
  9575. args = null;
  9576. }
  9577. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9578. options = Object.assign({}, options); // Clone object to avoid changing the original
  9579. // Build our parsed object
  9580. const parsed = {
  9581. command,
  9582. args,
  9583. options,
  9584. file: undefined,
  9585. original: {
  9586. command,
  9587. args,
  9588. },
  9589. };
  9590. // Delegate further parsing to shell or non-shell
  9591. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9592. }
  9593. module.exports = parse;
  9594. /***/ }),
  9595. /***/ 577:
  9596. /***/ (function(module) {
  9597. module.exports = getPageLinks
  9598. function getPageLinks (link) {
  9599. link = link.link || link.headers.link || ''
  9600. const links = {}
  9601. // link format:
  9602. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9603. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9604. links[type] = uri
  9605. })
  9606. return links
  9607. }
  9608. /***/ }),
  9609. /***/ 586:
  9610. /***/ (function(module, __unusedexports, __webpack_require__) {
  9611. module.exports = octokitRestApiEndpoints;
  9612. const ROUTES = __webpack_require__(705);
  9613. function octokitRestApiEndpoints(octokit) {
  9614. // Aliasing scopes for backward compatibility
  9615. // See https://github.com/octokit/rest.js/pull/1134
  9616. ROUTES.gitdata = ROUTES.git;
  9617. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9618. ROUTES.pullRequests = ROUTES.pulls;
  9619. octokit.registerEndpoints(ROUTES);
  9620. }
  9621. /***/ }),
  9622. /***/ 587:
  9623. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9624. "use strict";
  9625. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9626. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9627. return new (P || (P = Promise))(function (resolve, reject) {
  9628. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9629. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9630. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9631. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9632. });
  9633. };
  9634. var __importStar = (this && this.__importStar) || function (mod) {
  9635. if (mod && mod.__esModule) return mod;
  9636. var result = {};
  9637. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9638. result["default"] = mod;
  9639. return result;
  9640. };
  9641. Object.defineProperty(exports, "__esModule", { value: true });
  9642. const core = __importStar(__webpack_require__(470));
  9643. const defaultMaxAttempts = 3;
  9644. const defaultMinSeconds = 10;
  9645. const defaultMaxSeconds = 20;
  9646. class RetryHelper {
  9647. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9648. this.maxAttempts = maxAttempts;
  9649. this.minSeconds = Math.floor(minSeconds);
  9650. this.maxSeconds = Math.floor(maxSeconds);
  9651. if (this.minSeconds > this.maxSeconds) {
  9652. throw new Error('min seconds should be less than or equal to max seconds');
  9653. }
  9654. }
  9655. execute(action) {
  9656. return __awaiter(this, void 0, void 0, function* () {
  9657. let attempt = 1;
  9658. while (attempt < this.maxAttempts) {
  9659. // Try
  9660. try {
  9661. return yield action();
  9662. }
  9663. catch (err) {
  9664. core.info(err.message);
  9665. }
  9666. // Sleep
  9667. const seconds = this.getSleepAmount();
  9668. core.info(`Waiting ${seconds} seconds before trying again`);
  9669. yield this.sleep(seconds);
  9670. attempt++;
  9671. }
  9672. // Last attempt
  9673. return yield action();
  9674. });
  9675. }
  9676. getSleepAmount() {
  9677. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9678. this.minSeconds);
  9679. }
  9680. sleep(seconds) {
  9681. return __awaiter(this, void 0, void 0, function* () {
  9682. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9683. });
  9684. }
  9685. }
  9686. exports.RetryHelper = RetryHelper;
  9687. function execute(action) {
  9688. return __awaiter(this, void 0, void 0, function* () {
  9689. const retryHelper = new RetryHelper();
  9690. return yield retryHelper.execute(action);
  9691. });
  9692. }
  9693. exports.execute = execute;
  9694. /***/ }),
  9695. /***/ 605:
  9696. /***/ (function(module) {
  9697. module.exports = require("http");
  9698. /***/ }),
  9699. /***/ 614:
  9700. /***/ (function(module) {
  9701. module.exports = require("events");
  9702. /***/ }),
  9703. /***/ 618:
  9704. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9705. "use strict";
  9706. var __importStar = (this && this.__importStar) || function (mod) {
  9707. if (mod && mod.__esModule) return mod;
  9708. var result = {};
  9709. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9710. result["default"] = mod;
  9711. return result;
  9712. };
  9713. Object.defineProperty(exports, "__esModule", { value: true });
  9714. const fs = __importStar(__webpack_require__(747));
  9715. function directoryExistsSync(path, required) {
  9716. if (!path) {
  9717. throw new Error("Arg 'path' must not be empty");
  9718. }
  9719. let stats;
  9720. try {
  9721. stats = fs.statSync(path);
  9722. }
  9723. catch (error) {
  9724. if (error.code === 'ENOENT') {
  9725. if (!required) {
  9726. return false;
  9727. }
  9728. throw new Error(`Directory '${path}' does not exist`);
  9729. }
  9730. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9731. }
  9732. if (stats.isDirectory()) {
  9733. return true;
  9734. }
  9735. else if (!required) {
  9736. return false;
  9737. }
  9738. throw new Error(`Directory '${path}' does not exist`);
  9739. }
  9740. exports.directoryExistsSync = directoryExistsSync;
  9741. function existsSync(path) {
  9742. if (!path) {
  9743. throw new Error("Arg 'path' must not be empty");
  9744. }
  9745. try {
  9746. fs.statSync(path);
  9747. }
  9748. catch (error) {
  9749. if (error.code === 'ENOENT') {
  9750. return false;
  9751. }
  9752. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9753. }
  9754. return true;
  9755. }
  9756. exports.existsSync = existsSync;
  9757. function fileExistsSync(path) {
  9758. if (!path) {
  9759. throw new Error("Arg 'path' must not be empty");
  9760. }
  9761. let stats;
  9762. try {
  9763. stats = fs.statSync(path);
  9764. }
  9765. catch (error) {
  9766. if (error.code === 'ENOENT') {
  9767. return false;
  9768. }
  9769. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9770. }
  9771. if (!stats.isDirectory()) {
  9772. return true;
  9773. }
  9774. return false;
  9775. }
  9776. exports.fileExistsSync = fileExistsSync;
  9777. /***/ }),
  9778. /***/ 621:
  9779. /***/ (function(module, __unusedexports, __webpack_require__) {
  9780. "use strict";
  9781. const path = __webpack_require__(622);
  9782. const pathKey = __webpack_require__(39);
  9783. module.exports = opts => {
  9784. opts = Object.assign({
  9785. cwd: process.cwd(),
  9786. path: process.env[pathKey()]
  9787. }, opts);
  9788. let prev;
  9789. let pth = path.resolve(opts.cwd);
  9790. const ret = [];
  9791. while (prev !== pth) {
  9792. ret.push(path.join(pth, 'node_modules/.bin'));
  9793. prev = pth;
  9794. pth = path.resolve(pth, '..');
  9795. }
  9796. // ensure the running `node` binary is used
  9797. ret.push(path.dirname(process.execPath));
  9798. return ret.concat(opts.path).join(path.delimiter);
  9799. };
  9800. module.exports.env = opts => {
  9801. opts = Object.assign({
  9802. env: process.env
  9803. }, opts);
  9804. const env = Object.assign({}, opts.env);
  9805. const path = pathKey({env});
  9806. opts.path = env[path];
  9807. env[path] = module.exports(opts);
  9808. return env;
  9809. };
  9810. /***/ }),
  9811. /***/ 622:
  9812. /***/ (function(module) {
  9813. module.exports = require("path");
  9814. /***/ }),
  9815. /***/ 631:
  9816. /***/ (function(module) {
  9817. module.exports = require("net");
  9818. /***/ }),
  9819. /***/ 649:
  9820. /***/ (function(module, __unusedexports, __webpack_require__) {
  9821. module.exports = getLastPage
  9822. const getPage = __webpack_require__(265)
  9823. function getLastPage (octokit, link, headers) {
  9824. return getPage(octokit, link, 'last', headers)
  9825. }
  9826. /***/ }),
  9827. /***/ 654:
  9828. /***/ (function(module) {
  9829. // This is not the set of all possible signals.
  9830. //
  9831. // It IS, however, the set of all signals that trigger
  9832. // an exit on either Linux or BSD systems. Linux is a
  9833. // superset of the signal names supported on BSD, and
  9834. // the unknown signals just fail to register, so we can
  9835. // catch that easily enough.
  9836. //
  9837. // Don't bother with SIGKILL. It's uncatchable, which
  9838. // means that we can't fire any callbacks anyway.
  9839. //
  9840. // If a user does happen to register a handler on a non-
  9841. // fatal signal like SIGWINCH or something, and then
  9842. // exit, it'll end up firing `process.emit('exit')`, so
  9843. // the handler will be fired anyway.
  9844. //
  9845. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9846. // artificially, inherently leave the process in a
  9847. // state from which it is not safe to try and enter JS
  9848. // listeners.
  9849. module.exports = [
  9850. 'SIGABRT',
  9851. 'SIGALRM',
  9852. 'SIGHUP',
  9853. 'SIGINT',
  9854. 'SIGTERM'
  9855. ]
  9856. if (process.platform !== 'win32') {
  9857. module.exports.push(
  9858. 'SIGVTALRM',
  9859. 'SIGXCPU',
  9860. 'SIGXFSZ',
  9861. 'SIGUSR2',
  9862. 'SIGTRAP',
  9863. 'SIGSYS',
  9864. 'SIGQUIT',
  9865. 'SIGIOT'
  9866. // should detect profiler and enable/disable accordingly.
  9867. // see #21
  9868. // 'SIGPROF'
  9869. )
  9870. }
  9871. if (process.platform === 'linux') {
  9872. module.exports.push(
  9873. 'SIGIO',
  9874. 'SIGPOLL',
  9875. 'SIGPWR',
  9876. 'SIGSTKFLT',
  9877. 'SIGUNUSED'
  9878. )
  9879. }
  9880. /***/ }),
  9881. /***/ 656:
  9882. /***/ (function(module, exports) {
  9883. exports = module.exports = SemVer
  9884. var debug
  9885. /* istanbul ignore next */
  9886. if (typeof process === 'object' &&
  9887. process.env &&
  9888. process.env.NODE_DEBUG &&
  9889. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9890. debug = function () {
  9891. var args = Array.prototype.slice.call(arguments, 0)
  9892. args.unshift('SEMVER')
  9893. console.log.apply(console, args)
  9894. }
  9895. } else {
  9896. debug = function () {}
  9897. }
  9898. // Note: this is the semver.org version of the spec that it implements
  9899. // Not necessarily the package version of this code.
  9900. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9901. var MAX_LENGTH = 256
  9902. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9903. /* istanbul ignore next */ 9007199254740991
  9904. // Max safe segment length for coercion.
  9905. var MAX_SAFE_COMPONENT_LENGTH = 16
  9906. // The actual regexps go on exports.re
  9907. var re = exports.re = []
  9908. var src = exports.src = []
  9909. var t = exports.tokens = {}
  9910. var R = 0
  9911. function tok (n) {
  9912. t[n] = R++
  9913. }
  9914. // The following Regular Expressions can be used for tokenizing,
  9915. // validating, and parsing SemVer version strings.
  9916. // ## Numeric Identifier
  9917. // A single `0`, or a non-zero digit followed by zero or more digits.
  9918. tok('NUMERICIDENTIFIER')
  9919. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9920. tok('NUMERICIDENTIFIERLOOSE')
  9921. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9922. // ## Non-numeric Identifier
  9923. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9924. // more letters, digits, or hyphens.
  9925. tok('NONNUMERICIDENTIFIER')
  9926. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9927. // ## Main Version
  9928. // Three dot-separated numeric identifiers.
  9929. tok('MAINVERSION')
  9930. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9931. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9932. '(' + src[t.NUMERICIDENTIFIER] + ')'
  9933. tok('MAINVERSIONLOOSE')
  9934. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9935. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9936. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  9937. // ## Pre-release Version Identifier
  9938. // A numeric identifier, or a non-numeric identifier.
  9939. tok('PRERELEASEIDENTIFIER')
  9940. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  9941. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9942. tok('PRERELEASEIDENTIFIERLOOSE')
  9943. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  9944. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9945. // ## Pre-release Version
  9946. // Hyphen, followed by one or more dot-separated pre-release version
  9947. // identifiers.
  9948. tok('PRERELEASE')
  9949. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  9950. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  9951. tok('PRERELEASELOOSE')
  9952. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  9953. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  9954. // ## Build Metadata Identifier
  9955. // Any combination of digits, letters, or hyphens.
  9956. tok('BUILDIDENTIFIER')
  9957. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  9958. // ## Build Metadata
  9959. // Plus sign, followed by one or more period-separated build metadata
  9960. // identifiers.
  9961. tok('BUILD')
  9962. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  9963. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  9964. // ## Full Version String
  9965. // A main version, followed optionally by a pre-release version and
  9966. // build metadata.
  9967. // Note that the only major, minor, patch, and pre-release sections of
  9968. // the version string are capturing groups. The build metadata is not a
  9969. // capturing group, because it should not ever be used in version
  9970. // comparison.
  9971. tok('FULL')
  9972. tok('FULLPLAIN')
  9973. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  9974. src[t.PRERELEASE] + '?' +
  9975. src[t.BUILD] + '?'
  9976. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  9977. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  9978. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  9979. // common in the npm registry.
  9980. tok('LOOSEPLAIN')
  9981. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  9982. src[t.PRERELEASELOOSE] + '?' +
  9983. src[t.BUILD] + '?'
  9984. tok('LOOSE')
  9985. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  9986. tok('GTLT')
  9987. src[t.GTLT] = '((?:<|>)?=?)'
  9988. // Something like "2.*" or "1.2.x".
  9989. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  9990. // Only the first item is strictly required.
  9991. tok('XRANGEIDENTIFIERLOOSE')
  9992. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  9993. tok('XRANGEIDENTIFIER')
  9994. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  9995. tok('XRANGEPLAIN')
  9996. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  9997. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9998. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9999. '(?:' + src[t.PRERELEASE] + ')?' +
  10000. src[t.BUILD] + '?' +
  10001. ')?)?'
  10002. tok('XRANGEPLAINLOOSE')
  10003. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10004. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10005. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10006. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10007. src[t.BUILD] + '?' +
  10008. ')?)?'
  10009. tok('XRANGE')
  10010. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10011. tok('XRANGELOOSE')
  10012. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10013. // Coercion.
  10014. // Extract anything that could conceivably be a part of a valid semver
  10015. tok('COERCE')
  10016. src[t.COERCE] = '(^|[^\\d])' +
  10017. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10018. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10019. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10020. '(?:$|[^\\d])'
  10021. tok('COERCERTL')
  10022. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10023. // Tilde ranges.
  10024. // Meaning is "reasonably at or greater than"
  10025. tok('LONETILDE')
  10026. src[t.LONETILDE] = '(?:~>?)'
  10027. tok('TILDETRIM')
  10028. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10029. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10030. var tildeTrimReplace = '$1~'
  10031. tok('TILDE')
  10032. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10033. tok('TILDELOOSE')
  10034. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10035. // Caret ranges.
  10036. // Meaning is "at least and backwards compatible with"
  10037. tok('LONECARET')
  10038. src[t.LONECARET] = '(?:\\^)'
  10039. tok('CARETTRIM')
  10040. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10041. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10042. var caretTrimReplace = '$1^'
  10043. tok('CARET')
  10044. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10045. tok('CARETLOOSE')
  10046. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10047. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10048. tok('COMPARATORLOOSE')
  10049. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10050. tok('COMPARATOR')
  10051. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10052. // An expression to strip any whitespace between the gtlt and the thing
  10053. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10054. tok('COMPARATORTRIM')
  10055. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10056. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10057. // this one has to use the /g flag
  10058. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10059. var comparatorTrimReplace = '$1$2$3'
  10060. // Something like `1.2.3 - 1.2.4`
  10061. // Note that these all use the loose form, because they'll be
  10062. // checked against either the strict or loose comparator form
  10063. // later.
  10064. tok('HYPHENRANGE')
  10065. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10066. '\\s+-\\s+' +
  10067. '(' + src[t.XRANGEPLAIN] + ')' +
  10068. '\\s*$'
  10069. tok('HYPHENRANGELOOSE')
  10070. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10071. '\\s+-\\s+' +
  10072. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10073. '\\s*$'
  10074. // Star ranges basically just allow anything at all.
  10075. tok('STAR')
  10076. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10077. // Compile to actual regexp objects.
  10078. // All are flag-free, unless they were created above with a flag.
  10079. for (var i = 0; i < R; i++) {
  10080. debug(i, src[i])
  10081. if (!re[i]) {
  10082. re[i] = new RegExp(src[i])
  10083. }
  10084. }
  10085. exports.parse = parse
  10086. function parse (version, options) {
  10087. if (!options || typeof options !== 'object') {
  10088. options = {
  10089. loose: !!options,
  10090. includePrerelease: false
  10091. }
  10092. }
  10093. if (version instanceof SemVer) {
  10094. return version
  10095. }
  10096. if (typeof version !== 'string') {
  10097. return null
  10098. }
  10099. if (version.length > MAX_LENGTH) {
  10100. return null
  10101. }
  10102. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10103. if (!r.test(version)) {
  10104. return null
  10105. }
  10106. try {
  10107. return new SemVer(version, options)
  10108. } catch (er) {
  10109. return null
  10110. }
  10111. }
  10112. exports.valid = valid
  10113. function valid (version, options) {
  10114. var v = parse(version, options)
  10115. return v ? v.version : null
  10116. }
  10117. exports.clean = clean
  10118. function clean (version, options) {
  10119. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10120. return s ? s.version : null
  10121. }
  10122. exports.SemVer = SemVer
  10123. function SemVer (version, options) {
  10124. if (!options || typeof options !== 'object') {
  10125. options = {
  10126. loose: !!options,
  10127. includePrerelease: false
  10128. }
  10129. }
  10130. if (version instanceof SemVer) {
  10131. if (version.loose === options.loose) {
  10132. return version
  10133. } else {
  10134. version = version.version
  10135. }
  10136. } else if (typeof version !== 'string') {
  10137. throw new TypeError('Invalid Version: ' + version)
  10138. }
  10139. if (version.length > MAX_LENGTH) {
  10140. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10141. }
  10142. if (!(this instanceof SemVer)) {
  10143. return new SemVer(version, options)
  10144. }
  10145. debug('SemVer', version, options)
  10146. this.options = options
  10147. this.loose = !!options.loose
  10148. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10149. if (!m) {
  10150. throw new TypeError('Invalid Version: ' + version)
  10151. }
  10152. this.raw = version
  10153. // these are actually numbers
  10154. this.major = +m[1]
  10155. this.minor = +m[2]
  10156. this.patch = +m[3]
  10157. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10158. throw new TypeError('Invalid major version')
  10159. }
  10160. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10161. throw new TypeError('Invalid minor version')
  10162. }
  10163. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10164. throw new TypeError('Invalid patch version')
  10165. }
  10166. // numberify any prerelease numeric ids
  10167. if (!m[4]) {
  10168. this.prerelease = []
  10169. } else {
  10170. this.prerelease = m[4].split('.').map(function (id) {
  10171. if (/^[0-9]+$/.test(id)) {
  10172. var num = +id
  10173. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10174. return num
  10175. }
  10176. }
  10177. return id
  10178. })
  10179. }
  10180. this.build = m[5] ? m[5].split('.') : []
  10181. this.format()
  10182. }
  10183. SemVer.prototype.format = function () {
  10184. this.version = this.major + '.' + this.minor + '.' + this.patch
  10185. if (this.prerelease.length) {
  10186. this.version += '-' + this.prerelease.join('.')
  10187. }
  10188. return this.version
  10189. }
  10190. SemVer.prototype.toString = function () {
  10191. return this.version
  10192. }
  10193. SemVer.prototype.compare = function (other) {
  10194. debug('SemVer.compare', this.version, this.options, other)
  10195. if (!(other instanceof SemVer)) {
  10196. other = new SemVer(other, this.options)
  10197. }
  10198. return this.compareMain(other) || this.comparePre(other)
  10199. }
  10200. SemVer.prototype.compareMain = function (other) {
  10201. if (!(other instanceof SemVer)) {
  10202. other = new SemVer(other, this.options)
  10203. }
  10204. return compareIdentifiers(this.major, other.major) ||
  10205. compareIdentifiers(this.minor, other.minor) ||
  10206. compareIdentifiers(this.patch, other.patch)
  10207. }
  10208. SemVer.prototype.comparePre = function (other) {
  10209. if (!(other instanceof SemVer)) {
  10210. other = new SemVer(other, this.options)
  10211. }
  10212. // NOT having a prerelease is > having one
  10213. if (this.prerelease.length && !other.prerelease.length) {
  10214. return -1
  10215. } else if (!this.prerelease.length && other.prerelease.length) {
  10216. return 1
  10217. } else if (!this.prerelease.length && !other.prerelease.length) {
  10218. return 0
  10219. }
  10220. var i = 0
  10221. do {
  10222. var a = this.prerelease[i]
  10223. var b = other.prerelease[i]
  10224. debug('prerelease compare', i, a, b)
  10225. if (a === undefined && b === undefined) {
  10226. return 0
  10227. } else if (b === undefined) {
  10228. return 1
  10229. } else if (a === undefined) {
  10230. return -1
  10231. } else if (a === b) {
  10232. continue
  10233. } else {
  10234. return compareIdentifiers(a, b)
  10235. }
  10236. } while (++i)
  10237. }
  10238. SemVer.prototype.compareBuild = function (other) {
  10239. if (!(other instanceof SemVer)) {
  10240. other = new SemVer(other, this.options)
  10241. }
  10242. var i = 0
  10243. do {
  10244. var a = this.build[i]
  10245. var b = other.build[i]
  10246. debug('prerelease compare', i, a, b)
  10247. if (a === undefined && b === undefined) {
  10248. return 0
  10249. } else if (b === undefined) {
  10250. return 1
  10251. } else if (a === undefined) {
  10252. return -1
  10253. } else if (a === b) {
  10254. continue
  10255. } else {
  10256. return compareIdentifiers(a, b)
  10257. }
  10258. } while (++i)
  10259. }
  10260. // preminor will bump the version up to the next minor release, and immediately
  10261. // down to pre-release. premajor and prepatch work the same way.
  10262. SemVer.prototype.inc = function (release, identifier) {
  10263. switch (release) {
  10264. case 'premajor':
  10265. this.prerelease.length = 0
  10266. this.patch = 0
  10267. this.minor = 0
  10268. this.major++
  10269. this.inc('pre', identifier)
  10270. break
  10271. case 'preminor':
  10272. this.prerelease.length = 0
  10273. this.patch = 0
  10274. this.minor++
  10275. this.inc('pre', identifier)
  10276. break
  10277. case 'prepatch':
  10278. // If this is already a prerelease, it will bump to the next version
  10279. // drop any prereleases that might already exist, since they are not
  10280. // relevant at this point.
  10281. this.prerelease.length = 0
  10282. this.inc('patch', identifier)
  10283. this.inc('pre', identifier)
  10284. break
  10285. // If the input is a non-prerelease version, this acts the same as
  10286. // prepatch.
  10287. case 'prerelease':
  10288. if (this.prerelease.length === 0) {
  10289. this.inc('patch', identifier)
  10290. }
  10291. this.inc('pre', identifier)
  10292. break
  10293. case 'major':
  10294. // If this is a pre-major version, bump up to the same major version.
  10295. // Otherwise increment major.
  10296. // 1.0.0-5 bumps to 1.0.0
  10297. // 1.1.0 bumps to 2.0.0
  10298. if (this.minor !== 0 ||
  10299. this.patch !== 0 ||
  10300. this.prerelease.length === 0) {
  10301. this.major++
  10302. }
  10303. this.minor = 0
  10304. this.patch = 0
  10305. this.prerelease = []
  10306. break
  10307. case 'minor':
  10308. // If this is a pre-minor version, bump up to the same minor version.
  10309. // Otherwise increment minor.
  10310. // 1.2.0-5 bumps to 1.2.0
  10311. // 1.2.1 bumps to 1.3.0
  10312. if (this.patch !== 0 || this.prerelease.length === 0) {
  10313. this.minor++
  10314. }
  10315. this.patch = 0
  10316. this.prerelease = []
  10317. break
  10318. case 'patch':
  10319. // If this is not a pre-release version, it will increment the patch.
  10320. // If it is a pre-release it will bump up to the same patch version.
  10321. // 1.2.0-5 patches to 1.2.0
  10322. // 1.2.0 patches to 1.2.1
  10323. if (this.prerelease.length === 0) {
  10324. this.patch++
  10325. }
  10326. this.prerelease = []
  10327. break
  10328. // This probably shouldn't be used publicly.
  10329. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10330. case 'pre':
  10331. if (this.prerelease.length === 0) {
  10332. this.prerelease = [0]
  10333. } else {
  10334. var i = this.prerelease.length
  10335. while (--i >= 0) {
  10336. if (typeof this.prerelease[i] === 'number') {
  10337. this.prerelease[i]++
  10338. i = -2
  10339. }
  10340. }
  10341. if (i === -1) {
  10342. // didn't increment anything
  10343. this.prerelease.push(0)
  10344. }
  10345. }
  10346. if (identifier) {
  10347. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10348. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10349. if (this.prerelease[0] === identifier) {
  10350. if (isNaN(this.prerelease[1])) {
  10351. this.prerelease = [identifier, 0]
  10352. }
  10353. } else {
  10354. this.prerelease = [identifier, 0]
  10355. }
  10356. }
  10357. break
  10358. default:
  10359. throw new Error('invalid increment argument: ' + release)
  10360. }
  10361. this.format()
  10362. this.raw = this.version
  10363. return this
  10364. }
  10365. exports.inc = inc
  10366. function inc (version, release, loose, identifier) {
  10367. if (typeof (loose) === 'string') {
  10368. identifier = loose
  10369. loose = undefined
  10370. }
  10371. try {
  10372. return new SemVer(version, loose).inc(release, identifier).version
  10373. } catch (er) {
  10374. return null
  10375. }
  10376. }
  10377. exports.diff = diff
  10378. function diff (version1, version2) {
  10379. if (eq(version1, version2)) {
  10380. return null
  10381. } else {
  10382. var v1 = parse(version1)
  10383. var v2 = parse(version2)
  10384. var prefix = ''
  10385. if (v1.prerelease.length || v2.prerelease.length) {
  10386. prefix = 'pre'
  10387. var defaultResult = 'prerelease'
  10388. }
  10389. for (var key in v1) {
  10390. if (key === 'major' || key === 'minor' || key === 'patch') {
  10391. if (v1[key] !== v2[key]) {
  10392. return prefix + key
  10393. }
  10394. }
  10395. }
  10396. return defaultResult // may be undefined
  10397. }
  10398. }
  10399. exports.compareIdentifiers = compareIdentifiers
  10400. var numeric = /^[0-9]+$/
  10401. function compareIdentifiers (a, b) {
  10402. var anum = numeric.test(a)
  10403. var bnum = numeric.test(b)
  10404. if (anum && bnum) {
  10405. a = +a
  10406. b = +b
  10407. }
  10408. return a === b ? 0
  10409. : (anum && !bnum) ? -1
  10410. : (bnum && !anum) ? 1
  10411. : a < b ? -1
  10412. : 1
  10413. }
  10414. exports.rcompareIdentifiers = rcompareIdentifiers
  10415. function rcompareIdentifiers (a, b) {
  10416. return compareIdentifiers(b, a)
  10417. }
  10418. exports.major = major
  10419. function major (a, loose) {
  10420. return new SemVer(a, loose).major
  10421. }
  10422. exports.minor = minor
  10423. function minor (a, loose) {
  10424. return new SemVer(a, loose).minor
  10425. }
  10426. exports.patch = patch
  10427. function patch (a, loose) {
  10428. return new SemVer(a, loose).patch
  10429. }
  10430. exports.compare = compare
  10431. function compare (a, b, loose) {
  10432. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10433. }
  10434. exports.compareLoose = compareLoose
  10435. function compareLoose (a, b) {
  10436. return compare(a, b, true)
  10437. }
  10438. exports.compareBuild = compareBuild
  10439. function compareBuild (a, b, loose) {
  10440. var versionA = new SemVer(a, loose)
  10441. var versionB = new SemVer(b, loose)
  10442. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10443. }
  10444. exports.rcompare = rcompare
  10445. function rcompare (a, b, loose) {
  10446. return compare(b, a, loose)
  10447. }
  10448. exports.sort = sort
  10449. function sort (list, loose) {
  10450. return list.sort(function (a, b) {
  10451. return exports.compareBuild(a, b, loose)
  10452. })
  10453. }
  10454. exports.rsort = rsort
  10455. function rsort (list, loose) {
  10456. return list.sort(function (a, b) {
  10457. return exports.compareBuild(b, a, loose)
  10458. })
  10459. }
  10460. exports.gt = gt
  10461. function gt (a, b, loose) {
  10462. return compare(a, b, loose) > 0
  10463. }
  10464. exports.lt = lt
  10465. function lt (a, b, loose) {
  10466. return compare(a, b, loose) < 0
  10467. }
  10468. exports.eq = eq
  10469. function eq (a, b, loose) {
  10470. return compare(a, b, loose) === 0
  10471. }
  10472. exports.neq = neq
  10473. function neq (a, b, loose) {
  10474. return compare(a, b, loose) !== 0
  10475. }
  10476. exports.gte = gte
  10477. function gte (a, b, loose) {
  10478. return compare(a, b, loose) >= 0
  10479. }
  10480. exports.lte = lte
  10481. function lte (a, b, loose) {
  10482. return compare(a, b, loose) <= 0
  10483. }
  10484. exports.cmp = cmp
  10485. function cmp (a, op, b, loose) {
  10486. switch (op) {
  10487. case '===':
  10488. if (typeof a === 'object')
  10489. a = a.version
  10490. if (typeof b === 'object')
  10491. b = b.version
  10492. return a === b
  10493. case '!==':
  10494. if (typeof a === 'object')
  10495. a = a.version
  10496. if (typeof b === 'object')
  10497. b = b.version
  10498. return a !== b
  10499. case '':
  10500. case '=':
  10501. case '==':
  10502. return eq(a, b, loose)
  10503. case '!=':
  10504. return neq(a, b, loose)
  10505. case '>':
  10506. return gt(a, b, loose)
  10507. case '>=':
  10508. return gte(a, b, loose)
  10509. case '<':
  10510. return lt(a, b, loose)
  10511. case '<=':
  10512. return lte(a, b, loose)
  10513. default:
  10514. throw new TypeError('Invalid operator: ' + op)
  10515. }
  10516. }
  10517. exports.Comparator = Comparator
  10518. function Comparator (comp, options) {
  10519. if (!options || typeof options !== 'object') {
  10520. options = {
  10521. loose: !!options,
  10522. includePrerelease: false
  10523. }
  10524. }
  10525. if (comp instanceof Comparator) {
  10526. if (comp.loose === !!options.loose) {
  10527. return comp
  10528. } else {
  10529. comp = comp.value
  10530. }
  10531. }
  10532. if (!(this instanceof Comparator)) {
  10533. return new Comparator(comp, options)
  10534. }
  10535. debug('comparator', comp, options)
  10536. this.options = options
  10537. this.loose = !!options.loose
  10538. this.parse(comp)
  10539. if (this.semver === ANY) {
  10540. this.value = ''
  10541. } else {
  10542. this.value = this.operator + this.semver.version
  10543. }
  10544. debug('comp', this)
  10545. }
  10546. var ANY = {}
  10547. Comparator.prototype.parse = function (comp) {
  10548. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10549. var m = comp.match(r)
  10550. if (!m) {
  10551. throw new TypeError('Invalid comparator: ' + comp)
  10552. }
  10553. this.operator = m[1] !== undefined ? m[1] : ''
  10554. if (this.operator === '=') {
  10555. this.operator = ''
  10556. }
  10557. // if it literally is just '>' or '' then allow anything.
  10558. if (!m[2]) {
  10559. this.semver = ANY
  10560. } else {
  10561. this.semver = new SemVer(m[2], this.options.loose)
  10562. }
  10563. }
  10564. Comparator.prototype.toString = function () {
  10565. return this.value
  10566. }
  10567. Comparator.prototype.test = function (version) {
  10568. debug('Comparator.test', version, this.options.loose)
  10569. if (this.semver === ANY || version === ANY) {
  10570. return true
  10571. }
  10572. if (typeof version === 'string') {
  10573. try {
  10574. version = new SemVer(version, this.options)
  10575. } catch (er) {
  10576. return false
  10577. }
  10578. }
  10579. return cmp(version, this.operator, this.semver, this.options)
  10580. }
  10581. Comparator.prototype.intersects = function (comp, options) {
  10582. if (!(comp instanceof Comparator)) {
  10583. throw new TypeError('a Comparator is required')
  10584. }
  10585. if (!options || typeof options !== 'object') {
  10586. options = {
  10587. loose: !!options,
  10588. includePrerelease: false
  10589. }
  10590. }
  10591. var rangeTmp
  10592. if (this.operator === '') {
  10593. if (this.value === '') {
  10594. return true
  10595. }
  10596. rangeTmp = new Range(comp.value, options)
  10597. return satisfies(this.value, rangeTmp, options)
  10598. } else if (comp.operator === '') {
  10599. if (comp.value === '') {
  10600. return true
  10601. }
  10602. rangeTmp = new Range(this.value, options)
  10603. return satisfies(comp.semver, rangeTmp, options)
  10604. }
  10605. var sameDirectionIncreasing =
  10606. (this.operator === '>=' || this.operator === '>') &&
  10607. (comp.operator === '>=' || comp.operator === '>')
  10608. var sameDirectionDecreasing =
  10609. (this.operator === '<=' || this.operator === '<') &&
  10610. (comp.operator === '<=' || comp.operator === '<')
  10611. var sameSemVer = this.semver.version === comp.semver.version
  10612. var differentDirectionsInclusive =
  10613. (this.operator === '>=' || this.operator === '<=') &&
  10614. (comp.operator === '>=' || comp.operator === '<=')
  10615. var oppositeDirectionsLessThan =
  10616. cmp(this.semver, '<', comp.semver, options) &&
  10617. ((this.operator === '>=' || this.operator === '>') &&
  10618. (comp.operator === '<=' || comp.operator === '<'))
  10619. var oppositeDirectionsGreaterThan =
  10620. cmp(this.semver, '>', comp.semver, options) &&
  10621. ((this.operator === '<=' || this.operator === '<') &&
  10622. (comp.operator === '>=' || comp.operator === '>'))
  10623. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10624. (sameSemVer && differentDirectionsInclusive) ||
  10625. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10626. }
  10627. exports.Range = Range
  10628. function Range (range, options) {
  10629. if (!options || typeof options !== 'object') {
  10630. options = {
  10631. loose: !!options,
  10632. includePrerelease: false
  10633. }
  10634. }
  10635. if (range instanceof Range) {
  10636. if (range.loose === !!options.loose &&
  10637. range.includePrerelease === !!options.includePrerelease) {
  10638. return range
  10639. } else {
  10640. return new Range(range.raw, options)
  10641. }
  10642. }
  10643. if (range instanceof Comparator) {
  10644. return new Range(range.value, options)
  10645. }
  10646. if (!(this instanceof Range)) {
  10647. return new Range(range, options)
  10648. }
  10649. this.options = options
  10650. this.loose = !!options.loose
  10651. this.includePrerelease = !!options.includePrerelease
  10652. // First, split based on boolean or ||
  10653. this.raw = range
  10654. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10655. return this.parseRange(range.trim())
  10656. }, this).filter(function (c) {
  10657. // throw out any that are not relevant for whatever reason
  10658. return c.length
  10659. })
  10660. if (!this.set.length) {
  10661. throw new TypeError('Invalid SemVer Range: ' + range)
  10662. }
  10663. this.format()
  10664. }
  10665. Range.prototype.format = function () {
  10666. this.range = this.set.map(function (comps) {
  10667. return comps.join(' ').trim()
  10668. }).join('||').trim()
  10669. return this.range
  10670. }
  10671. Range.prototype.toString = function () {
  10672. return this.range
  10673. }
  10674. Range.prototype.parseRange = function (range) {
  10675. var loose = this.options.loose
  10676. range = range.trim()
  10677. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10678. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10679. range = range.replace(hr, hyphenReplace)
  10680. debug('hyphen replace', range)
  10681. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10682. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10683. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10684. // `~ 1.2.3` => `~1.2.3`
  10685. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10686. // `^ 1.2.3` => `^1.2.3`
  10687. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10688. // normalize spaces
  10689. range = range.split(/\s+/).join(' ')
  10690. // At this point, the range is completely trimmed and
  10691. // ready to be split into comparators.
  10692. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10693. var set = range.split(' ').map(function (comp) {
  10694. return parseComparator(comp, this.options)
  10695. }, this).join(' ').split(/\s+/)
  10696. if (this.options.loose) {
  10697. // in loose mode, throw out any that are not valid comparators
  10698. set = set.filter(function (comp) {
  10699. return !!comp.match(compRe)
  10700. })
  10701. }
  10702. set = set.map(function (comp) {
  10703. return new Comparator(comp, this.options)
  10704. }, this)
  10705. return set
  10706. }
  10707. Range.prototype.intersects = function (range, options) {
  10708. if (!(range instanceof Range)) {
  10709. throw new TypeError('a Range is required')
  10710. }
  10711. return this.set.some(function (thisComparators) {
  10712. return (
  10713. isSatisfiable(thisComparators, options) &&
  10714. range.set.some(function (rangeComparators) {
  10715. return (
  10716. isSatisfiable(rangeComparators, options) &&
  10717. thisComparators.every(function (thisComparator) {
  10718. return rangeComparators.every(function (rangeComparator) {
  10719. return thisComparator.intersects(rangeComparator, options)
  10720. })
  10721. })
  10722. )
  10723. })
  10724. )
  10725. })
  10726. }
  10727. // take a set of comparators and determine whether there
  10728. // exists a version which can satisfy it
  10729. function isSatisfiable (comparators, options) {
  10730. var result = true
  10731. var remainingComparators = comparators.slice()
  10732. var testComparator = remainingComparators.pop()
  10733. while (result && remainingComparators.length) {
  10734. result = remainingComparators.every(function (otherComparator) {
  10735. return testComparator.intersects(otherComparator, options)
  10736. })
  10737. testComparator = remainingComparators.pop()
  10738. }
  10739. return result
  10740. }
  10741. // Mostly just for testing and legacy API reasons
  10742. exports.toComparators = toComparators
  10743. function toComparators (range, options) {
  10744. return new Range(range, options).set.map(function (comp) {
  10745. return comp.map(function (c) {
  10746. return c.value
  10747. }).join(' ').trim().split(' ')
  10748. })
  10749. }
  10750. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10751. // already replaced the hyphen ranges
  10752. // turn into a set of JUST comparators.
  10753. function parseComparator (comp, options) {
  10754. debug('comp', comp, options)
  10755. comp = replaceCarets(comp, options)
  10756. debug('caret', comp)
  10757. comp = replaceTildes(comp, options)
  10758. debug('tildes', comp)
  10759. comp = replaceXRanges(comp, options)
  10760. debug('xrange', comp)
  10761. comp = replaceStars(comp, options)
  10762. debug('stars', comp)
  10763. return comp
  10764. }
  10765. function isX (id) {
  10766. return !id || id.toLowerCase() === 'x' || id === '*'
  10767. }
  10768. // ~, ~> --> * (any, kinda silly)
  10769. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10770. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10771. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10772. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10773. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10774. function replaceTildes (comp, options) {
  10775. return comp.trim().split(/\s+/).map(function (comp) {
  10776. return replaceTilde(comp, options)
  10777. }).join(' ')
  10778. }
  10779. function replaceTilde (comp, options) {
  10780. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10781. return comp.replace(r, function (_, M, m, p, pr) {
  10782. debug('tilde', comp, _, M, m, p, pr)
  10783. var ret
  10784. if (isX(M)) {
  10785. ret = ''
  10786. } else if (isX(m)) {
  10787. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10788. } else if (isX(p)) {
  10789. // ~1.2 == >=1.2.0 <1.3.0
  10790. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10791. } else if (pr) {
  10792. debug('replaceTilde pr', pr)
  10793. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10794. ' <' + M + '.' + (+m + 1) + '.0'
  10795. } else {
  10796. // ~1.2.3 == >=1.2.3 <1.3.0
  10797. ret = '>=' + M + '.' + m + '.' + p +
  10798. ' <' + M + '.' + (+m + 1) + '.0'
  10799. }
  10800. debug('tilde return', ret)
  10801. return ret
  10802. })
  10803. }
  10804. // ^ --> * (any, kinda silly)
  10805. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10806. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10807. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10808. // ^1.2.3 --> >=1.2.3 <2.0.0
  10809. // ^1.2.0 --> >=1.2.0 <2.0.0
  10810. function replaceCarets (comp, options) {
  10811. return comp.trim().split(/\s+/).map(function (comp) {
  10812. return replaceCaret(comp, options)
  10813. }).join(' ')
  10814. }
  10815. function replaceCaret (comp, options) {
  10816. debug('caret', comp, options)
  10817. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10818. return comp.replace(r, function (_, M, m, p, pr) {
  10819. debug('caret', comp, _, M, m, p, pr)
  10820. var ret
  10821. if (isX(M)) {
  10822. ret = ''
  10823. } else if (isX(m)) {
  10824. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10825. } else if (isX(p)) {
  10826. if (M === '0') {
  10827. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10828. } else {
  10829. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10830. }
  10831. } else if (pr) {
  10832. debug('replaceCaret pr', pr)
  10833. if (M === '0') {
  10834. if (m === '0') {
  10835. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10836. ' <' + M + '.' + m + '.' + (+p + 1)
  10837. } else {
  10838. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10839. ' <' + M + '.' + (+m + 1) + '.0'
  10840. }
  10841. } else {
  10842. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10843. ' <' + (+M + 1) + '.0.0'
  10844. }
  10845. } else {
  10846. debug('no pr')
  10847. if (M === '0') {
  10848. if (m === '0') {
  10849. ret = '>=' + M + '.' + m + '.' + p +
  10850. ' <' + M + '.' + m + '.' + (+p + 1)
  10851. } else {
  10852. ret = '>=' + M + '.' + m + '.' + p +
  10853. ' <' + M + '.' + (+m + 1) + '.0'
  10854. }
  10855. } else {
  10856. ret = '>=' + M + '.' + m + '.' + p +
  10857. ' <' + (+M + 1) + '.0.0'
  10858. }
  10859. }
  10860. debug('caret return', ret)
  10861. return ret
  10862. })
  10863. }
  10864. function replaceXRanges (comp, options) {
  10865. debug('replaceXRanges', comp, options)
  10866. return comp.split(/\s+/).map(function (comp) {
  10867. return replaceXRange(comp, options)
  10868. }).join(' ')
  10869. }
  10870. function replaceXRange (comp, options) {
  10871. comp = comp.trim()
  10872. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10873. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10874. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10875. var xM = isX(M)
  10876. var xm = xM || isX(m)
  10877. var xp = xm || isX(p)
  10878. var anyX = xp
  10879. if (gtlt === '=' && anyX) {
  10880. gtlt = ''
  10881. }
  10882. // if we're including prereleases in the match, then we need
  10883. // to fix this to -0, the lowest possible prerelease value
  10884. pr = options.includePrerelease ? '-0' : ''
  10885. if (xM) {
  10886. if (gtlt === '>' || gtlt === '<') {
  10887. // nothing is allowed
  10888. ret = '<0.0.0-0'
  10889. } else {
  10890. // nothing is forbidden
  10891. ret = '*'
  10892. }
  10893. } else if (gtlt && anyX) {
  10894. // we know patch is an x, because we have any x at all.
  10895. // replace X with 0
  10896. if (xm) {
  10897. m = 0
  10898. }
  10899. p = 0
  10900. if (gtlt === '>') {
  10901. // >1 => >=2.0.0
  10902. // >1.2 => >=1.3.0
  10903. // >1.2.3 => >= 1.2.4
  10904. gtlt = '>='
  10905. if (xm) {
  10906. M = +M + 1
  10907. m = 0
  10908. p = 0
  10909. } else {
  10910. m = +m + 1
  10911. p = 0
  10912. }
  10913. } else if (gtlt === '<=') {
  10914. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10915. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10916. gtlt = '<'
  10917. if (xm) {
  10918. M = +M + 1
  10919. } else {
  10920. m = +m + 1
  10921. }
  10922. }
  10923. ret = gtlt + M + '.' + m + '.' + p + pr
  10924. } else if (xm) {
  10925. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10926. } else if (xp) {
  10927. ret = '>=' + M + '.' + m + '.0' + pr +
  10928. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10929. }
  10930. debug('xRange return', ret)
  10931. return ret
  10932. })
  10933. }
  10934. // Because * is AND-ed with everything else in the comparator,
  10935. // and '' means "any version", just remove the *s entirely.
  10936. function replaceStars (comp, options) {
  10937. debug('replaceStars', comp, options)
  10938. // Looseness is ignored here. star is always as loose as it gets!
  10939. return comp.trim().replace(re[t.STAR], '')
  10940. }
  10941. // This function is passed to string.replace(re[t.HYPHENRANGE])
  10942. // M, m, patch, prerelease, build
  10943. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  10944. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  10945. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  10946. function hyphenReplace ($0,
  10947. from, fM, fm, fp, fpr, fb,
  10948. to, tM, tm, tp, tpr, tb) {
  10949. if (isX(fM)) {
  10950. from = ''
  10951. } else if (isX(fm)) {
  10952. from = '>=' + fM + '.0.0'
  10953. } else if (isX(fp)) {
  10954. from = '>=' + fM + '.' + fm + '.0'
  10955. } else {
  10956. from = '>=' + from
  10957. }
  10958. if (isX(tM)) {
  10959. to = ''
  10960. } else if (isX(tm)) {
  10961. to = '<' + (+tM + 1) + '.0.0'
  10962. } else if (isX(tp)) {
  10963. to = '<' + tM + '.' + (+tm + 1) + '.0'
  10964. } else if (tpr) {
  10965. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  10966. } else {
  10967. to = '<=' + to
  10968. }
  10969. return (from + ' ' + to).trim()
  10970. }
  10971. // if ANY of the sets match ALL of its comparators, then pass
  10972. Range.prototype.test = function (version) {
  10973. if (!version) {
  10974. return false
  10975. }
  10976. if (typeof version === 'string') {
  10977. try {
  10978. version = new SemVer(version, this.options)
  10979. } catch (er) {
  10980. return false
  10981. }
  10982. }
  10983. for (var i = 0; i < this.set.length; i++) {
  10984. if (testSet(this.set[i], version, this.options)) {
  10985. return true
  10986. }
  10987. }
  10988. return false
  10989. }
  10990. function testSet (set, version, options) {
  10991. for (var i = 0; i < set.length; i++) {
  10992. if (!set[i].test(version)) {
  10993. return false
  10994. }
  10995. }
  10996. if (version.prerelease.length && !options.includePrerelease) {
  10997. // Find the set of versions that are allowed to have prereleases
  10998. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  10999. // That should allow `1.2.3-pr.2` to pass.
  11000. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11001. // even though it's within the range set by the comparators.
  11002. for (i = 0; i < set.length; i++) {
  11003. debug(set[i].semver)
  11004. if (set[i].semver === ANY) {
  11005. continue
  11006. }
  11007. if (set[i].semver.prerelease.length > 0) {
  11008. var allowed = set[i].semver
  11009. if (allowed.major === version.major &&
  11010. allowed.minor === version.minor &&
  11011. allowed.patch === version.patch) {
  11012. return true
  11013. }
  11014. }
  11015. }
  11016. // Version has a -pre, but it's not one of the ones we like.
  11017. return false
  11018. }
  11019. return true
  11020. }
  11021. exports.satisfies = satisfies
  11022. function satisfies (version, range, options) {
  11023. try {
  11024. range = new Range(range, options)
  11025. } catch (er) {
  11026. return false
  11027. }
  11028. return range.test(version)
  11029. }
  11030. exports.maxSatisfying = maxSatisfying
  11031. function maxSatisfying (versions, range, options) {
  11032. var max = null
  11033. var maxSV = null
  11034. try {
  11035. var rangeObj = new Range(range, options)
  11036. } catch (er) {
  11037. return null
  11038. }
  11039. versions.forEach(function (v) {
  11040. if (rangeObj.test(v)) {
  11041. // satisfies(v, range, options)
  11042. if (!max || maxSV.compare(v) === -1) {
  11043. // compare(max, v, true)
  11044. max = v
  11045. maxSV = new SemVer(max, options)
  11046. }
  11047. }
  11048. })
  11049. return max
  11050. }
  11051. exports.minSatisfying = minSatisfying
  11052. function minSatisfying (versions, range, options) {
  11053. var min = null
  11054. var minSV = null
  11055. try {
  11056. var rangeObj = new Range(range, options)
  11057. } catch (er) {
  11058. return null
  11059. }
  11060. versions.forEach(function (v) {
  11061. if (rangeObj.test(v)) {
  11062. // satisfies(v, range, options)
  11063. if (!min || minSV.compare(v) === 1) {
  11064. // compare(min, v, true)
  11065. min = v
  11066. minSV = new SemVer(min, options)
  11067. }
  11068. }
  11069. })
  11070. return min
  11071. }
  11072. exports.minVersion = minVersion
  11073. function minVersion (range, loose) {
  11074. range = new Range(range, loose)
  11075. var minver = new SemVer('0.0.0')
  11076. if (range.test(minver)) {
  11077. return minver
  11078. }
  11079. minver = new SemVer('0.0.0-0')
  11080. if (range.test(minver)) {
  11081. return minver
  11082. }
  11083. minver = null
  11084. for (var i = 0; i < range.set.length; ++i) {
  11085. var comparators = range.set[i]
  11086. comparators.forEach(function (comparator) {
  11087. // Clone to avoid manipulating the comparator's semver object.
  11088. var compver = new SemVer(comparator.semver.version)
  11089. switch (comparator.operator) {
  11090. case '>':
  11091. if (compver.prerelease.length === 0) {
  11092. compver.patch++
  11093. } else {
  11094. compver.prerelease.push(0)
  11095. }
  11096. compver.raw = compver.format()
  11097. /* fallthrough */
  11098. case '':
  11099. case '>=':
  11100. if (!minver || gt(minver, compver)) {
  11101. minver = compver
  11102. }
  11103. break
  11104. case '<':
  11105. case '<=':
  11106. /* Ignore maximum versions */
  11107. break
  11108. /* istanbul ignore next */
  11109. default:
  11110. throw new Error('Unexpected operation: ' + comparator.operator)
  11111. }
  11112. })
  11113. }
  11114. if (minver && range.test(minver)) {
  11115. return minver
  11116. }
  11117. return null
  11118. }
  11119. exports.validRange = validRange
  11120. function validRange (range, options) {
  11121. try {
  11122. // Return '*' instead of '' so that truthiness works.
  11123. // This will throw if it's invalid anyway
  11124. return new Range(range, options).range || '*'
  11125. } catch (er) {
  11126. return null
  11127. }
  11128. }
  11129. // Determine if version is less than all the versions possible in the range
  11130. exports.ltr = ltr
  11131. function ltr (version, range, options) {
  11132. return outside(version, range, '<', options)
  11133. }
  11134. // Determine if version is greater than all the versions possible in the range.
  11135. exports.gtr = gtr
  11136. function gtr (version, range, options) {
  11137. return outside(version, range, '>', options)
  11138. }
  11139. exports.outside = outside
  11140. function outside (version, range, hilo, options) {
  11141. version = new SemVer(version, options)
  11142. range = new Range(range, options)
  11143. var gtfn, ltefn, ltfn, comp, ecomp
  11144. switch (hilo) {
  11145. case '>':
  11146. gtfn = gt
  11147. ltefn = lte
  11148. ltfn = lt
  11149. comp = '>'
  11150. ecomp = '>='
  11151. break
  11152. case '<':
  11153. gtfn = lt
  11154. ltefn = gte
  11155. ltfn = gt
  11156. comp = '<'
  11157. ecomp = '<='
  11158. break
  11159. default:
  11160. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11161. }
  11162. // If it satisifes the range it is not outside
  11163. if (satisfies(version, range, options)) {
  11164. return false
  11165. }
  11166. // From now on, variable terms are as if we're in "gtr" mode.
  11167. // but note that everything is flipped for the "ltr" function.
  11168. for (var i = 0; i < range.set.length; ++i) {
  11169. var comparators = range.set[i]
  11170. var high = null
  11171. var low = null
  11172. comparators.forEach(function (comparator) {
  11173. if (comparator.semver === ANY) {
  11174. comparator = new Comparator('>=0.0.0')
  11175. }
  11176. high = high || comparator
  11177. low = low || comparator
  11178. if (gtfn(comparator.semver, high.semver, options)) {
  11179. high = comparator
  11180. } else if (ltfn(comparator.semver, low.semver, options)) {
  11181. low = comparator
  11182. }
  11183. })
  11184. // If the edge version comparator has a operator then our version
  11185. // isn't outside it
  11186. if (high.operator === comp || high.operator === ecomp) {
  11187. return false
  11188. }
  11189. // If the lowest version comparator has an operator and our version
  11190. // is less than it then it isn't higher than the range
  11191. if ((!low.operator || low.operator === comp) &&
  11192. ltefn(version, low.semver)) {
  11193. return false
  11194. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11195. return false
  11196. }
  11197. }
  11198. return true
  11199. }
  11200. exports.prerelease = prerelease
  11201. function prerelease (version, options) {
  11202. var parsed = parse(version, options)
  11203. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11204. }
  11205. exports.intersects = intersects
  11206. function intersects (r1, r2, options) {
  11207. r1 = new Range(r1, options)
  11208. r2 = new Range(r2, options)
  11209. return r1.intersects(r2)
  11210. }
  11211. exports.coerce = coerce
  11212. function coerce (version, options) {
  11213. if (version instanceof SemVer) {
  11214. return version
  11215. }
  11216. if (typeof version === 'number') {
  11217. version = String(version)
  11218. }
  11219. if (typeof version !== 'string') {
  11220. return null
  11221. }
  11222. options = options || {}
  11223. var match = null
  11224. if (!options.rtl) {
  11225. match = version.match(re[t.COERCE])
  11226. } else {
  11227. // Find the right-most coercible string that does not share
  11228. // a terminus with a more left-ward coercible string.
  11229. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11230. //
  11231. // Walk through the string checking with a /g regexp
  11232. // Manually set the index so as to pick up overlapping matches.
  11233. // Stop when we get a match that ends at the string end, since no
  11234. // coercible string can be more right-ward without the same terminus.
  11235. var next
  11236. while ((next = re[t.COERCERTL].exec(version)) &&
  11237. (!match || match.index + match[0].length !== version.length)
  11238. ) {
  11239. if (!match ||
  11240. next.index + next[0].length !== match.index + match[0].length) {
  11241. match = next
  11242. }
  11243. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11244. }
  11245. // leave it in a clean state
  11246. re[t.COERCERTL].lastIndex = -1
  11247. }
  11248. if (match === null) {
  11249. return null
  11250. }
  11251. return parse(match[2] +
  11252. '.' + (match[3] || '0') +
  11253. '.' + (match[4] || '0'), options)
  11254. }
  11255. /***/ }),
  11256. /***/ 669:
  11257. /***/ (function(module) {
  11258. module.exports = require("util");
  11259. /***/ }),
  11260. /***/ 672:
  11261. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11262. "use strict";
  11263. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11264. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11265. return new (P || (P = Promise))(function (resolve, reject) {
  11266. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11267. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11268. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11269. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11270. });
  11271. };
  11272. var _a;
  11273. Object.defineProperty(exports, "__esModule", { value: true });
  11274. const assert_1 = __webpack_require__(357);
  11275. const fs = __webpack_require__(747);
  11276. const path = __webpack_require__(622);
  11277. _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;
  11278. exports.IS_WINDOWS = process.platform === 'win32';
  11279. function exists(fsPath) {
  11280. return __awaiter(this, void 0, void 0, function* () {
  11281. try {
  11282. yield exports.stat(fsPath);
  11283. }
  11284. catch (err) {
  11285. if (err.code === 'ENOENT') {
  11286. return false;
  11287. }
  11288. throw err;
  11289. }
  11290. return true;
  11291. });
  11292. }
  11293. exports.exists = exists;
  11294. function isDirectory(fsPath, useStat = false) {
  11295. return __awaiter(this, void 0, void 0, function* () {
  11296. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11297. return stats.isDirectory();
  11298. });
  11299. }
  11300. exports.isDirectory = isDirectory;
  11301. /**
  11302. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11303. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11304. */
  11305. function isRooted(p) {
  11306. p = normalizeSeparators(p);
  11307. if (!p) {
  11308. throw new Error('isRooted() parameter "p" cannot be empty');
  11309. }
  11310. if (exports.IS_WINDOWS) {
  11311. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11312. ); // e.g. C: or C:\hello
  11313. }
  11314. return p.startsWith('/');
  11315. }
  11316. exports.isRooted = isRooted;
  11317. /**
  11318. * Recursively create a directory at `fsPath`.
  11319. *
  11320. * This implementation is optimistic, meaning it attempts to create the full
  11321. * path first, and backs up the path stack from there.
  11322. *
  11323. * @param fsPath The path to create
  11324. * @param maxDepth The maximum recursion depth
  11325. * @param depth The current recursion depth
  11326. */
  11327. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11328. return __awaiter(this, void 0, void 0, function* () {
  11329. assert_1.ok(fsPath, 'a path argument must be provided');
  11330. fsPath = path.resolve(fsPath);
  11331. if (depth >= maxDepth)
  11332. return exports.mkdir(fsPath);
  11333. try {
  11334. yield exports.mkdir(fsPath);
  11335. return;
  11336. }
  11337. catch (err) {
  11338. switch (err.code) {
  11339. case 'ENOENT': {
  11340. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11341. yield exports.mkdir(fsPath);
  11342. return;
  11343. }
  11344. default: {
  11345. let stats;
  11346. try {
  11347. stats = yield exports.stat(fsPath);
  11348. }
  11349. catch (err2) {
  11350. throw err;
  11351. }
  11352. if (!stats.isDirectory())
  11353. throw err;
  11354. }
  11355. }
  11356. }
  11357. });
  11358. }
  11359. exports.mkdirP = mkdirP;
  11360. /**
  11361. * Best effort attempt to determine whether a file exists and is executable.
  11362. * @param filePath file path to check
  11363. * @param extensions additional file extensions to try
  11364. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11365. */
  11366. function tryGetExecutablePath(filePath, extensions) {
  11367. return __awaiter(this, void 0, void 0, function* () {
  11368. let stats = undefined;
  11369. try {
  11370. // test file exists
  11371. stats = yield exports.stat(filePath);
  11372. }
  11373. catch (err) {
  11374. if (err.code !== 'ENOENT') {
  11375. // eslint-disable-next-line no-console
  11376. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11377. }
  11378. }
  11379. if (stats && stats.isFile()) {
  11380. if (exports.IS_WINDOWS) {
  11381. // on Windows, test for valid extension
  11382. const upperExt = path.extname(filePath).toUpperCase();
  11383. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11384. return filePath;
  11385. }
  11386. }
  11387. else {
  11388. if (isUnixExecutable(stats)) {
  11389. return filePath;
  11390. }
  11391. }
  11392. }
  11393. // try each extension
  11394. const originalFilePath = filePath;
  11395. for (const extension of extensions) {
  11396. filePath = originalFilePath + extension;
  11397. stats = undefined;
  11398. try {
  11399. stats = yield exports.stat(filePath);
  11400. }
  11401. catch (err) {
  11402. if (err.code !== 'ENOENT') {
  11403. // eslint-disable-next-line no-console
  11404. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11405. }
  11406. }
  11407. if (stats && stats.isFile()) {
  11408. if (exports.IS_WINDOWS) {
  11409. // preserve the case of the actual file (since an extension was appended)
  11410. try {
  11411. const directory = path.dirname(filePath);
  11412. const upperName = path.basename(filePath).toUpperCase();
  11413. for (const actualName of yield exports.readdir(directory)) {
  11414. if (upperName === actualName.toUpperCase()) {
  11415. filePath = path.join(directory, actualName);
  11416. break;
  11417. }
  11418. }
  11419. }
  11420. catch (err) {
  11421. // eslint-disable-next-line no-console
  11422. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11423. }
  11424. return filePath;
  11425. }
  11426. else {
  11427. if (isUnixExecutable(stats)) {
  11428. return filePath;
  11429. }
  11430. }
  11431. }
  11432. }
  11433. return '';
  11434. });
  11435. }
  11436. exports.tryGetExecutablePath = tryGetExecutablePath;
  11437. function normalizeSeparators(p) {
  11438. p = p || '';
  11439. if (exports.IS_WINDOWS) {
  11440. // convert slashes on Windows
  11441. p = p.replace(/\//g, '\\');
  11442. // remove redundant slashes
  11443. return p.replace(/\\\\+/g, '\\');
  11444. }
  11445. // remove redundant slashes
  11446. return p.replace(/\/\/+/g, '/');
  11447. }
  11448. // on Mac/Linux, test the execute bit
  11449. // R W X R W X R W X
  11450. // 256 128 64 32 16 8 4 2 1
  11451. function isUnixExecutable(stats) {
  11452. return ((stats.mode & 1) > 0 ||
  11453. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11454. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11455. }
  11456. //# sourceMappingURL=io-util.js.map
  11457. /***/ }),
  11458. /***/ 674:
  11459. /***/ (function(module, __unusedexports, __webpack_require__) {
  11460. module.exports = authenticate;
  11461. const { Deprecation } = __webpack_require__(692);
  11462. const once = __webpack_require__(969);
  11463. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11464. function authenticate(state, options) {
  11465. deprecateAuthenticate(
  11466. state.octokit.log,
  11467. new Deprecation(
  11468. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11469. )
  11470. );
  11471. if (!options) {
  11472. state.auth = false;
  11473. return;
  11474. }
  11475. switch (options.type) {
  11476. case "basic":
  11477. if (!options.username || !options.password) {
  11478. throw new Error(
  11479. "Basic authentication requires both a username and password to be set"
  11480. );
  11481. }
  11482. break;
  11483. case "oauth":
  11484. if (!options.token && !(options.key && options.secret)) {
  11485. throw new Error(
  11486. "OAuth2 authentication requires a token or key & secret to be set"
  11487. );
  11488. }
  11489. break;
  11490. case "token":
  11491. case "app":
  11492. if (!options.token) {
  11493. throw new Error("Token authentication requires a token to be set");
  11494. }
  11495. break;
  11496. default:
  11497. throw new Error(
  11498. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11499. );
  11500. }
  11501. state.auth = options;
  11502. }
  11503. /***/ }),
  11504. /***/ 675:
  11505. /***/ (function(module) {
  11506. module.exports = function btoa(str) {
  11507. return new Buffer(str).toString('base64')
  11508. }
  11509. /***/ }),
  11510. /***/ 692:
  11511. /***/ (function(__unusedmodule, exports) {
  11512. "use strict";
  11513. Object.defineProperty(exports, '__esModule', { value: true });
  11514. class Deprecation extends Error {
  11515. constructor(message) {
  11516. super(message); // Maintains proper stack trace (only available on V8)
  11517. /* istanbul ignore next */
  11518. if (Error.captureStackTrace) {
  11519. Error.captureStackTrace(this, this.constructor);
  11520. }
  11521. this.name = 'Deprecation';
  11522. }
  11523. }
  11524. exports.Deprecation = Deprecation;
  11525. /***/ }),
  11526. /***/ 696:
  11527. /***/ (function(module) {
  11528. "use strict";
  11529. /*!
  11530. * isobject <https://github.com/jonschlinkert/isobject>
  11531. *
  11532. * Copyright (c) 2014-2017, Jon Schlinkert.
  11533. * Released under the MIT License.
  11534. */
  11535. function isObject(val) {
  11536. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11537. }
  11538. /*!
  11539. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11540. *
  11541. * Copyright (c) 2014-2017, Jon Schlinkert.
  11542. * Released under the MIT License.
  11543. */
  11544. function isObjectObject(o) {
  11545. return isObject(o) === true
  11546. && Object.prototype.toString.call(o) === '[object Object]';
  11547. }
  11548. function isPlainObject(o) {
  11549. var ctor,prot;
  11550. if (isObjectObject(o) === false) return false;
  11551. // If has modified constructor
  11552. ctor = o.constructor;
  11553. if (typeof ctor !== 'function') return false;
  11554. // If has modified prototype
  11555. prot = ctor.prototype;
  11556. if (isObjectObject(prot) === false) return false;
  11557. // If constructor does not have an Object-specific method
  11558. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11559. return false;
  11560. }
  11561. // Most likely a plain Object
  11562. return true;
  11563. }
  11564. module.exports = isPlainObject;
  11565. /***/ }),
  11566. /***/ 697:
  11567. /***/ (function(module) {
  11568. "use strict";
  11569. module.exports = (promise, onFinally) => {
  11570. onFinally = onFinally || (() => {});
  11571. return promise.then(
  11572. val => new Promise(resolve => {
  11573. resolve(onFinally());
  11574. }).then(() => val),
  11575. err => new Promise(resolve => {
  11576. resolve(onFinally());
  11577. }).then(() => {
  11578. throw err;
  11579. })
  11580. );
  11581. };
  11582. /***/ }),
  11583. /***/ 705:
  11584. /***/ (function(module) {
  11585. 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"}}};
  11586. /***/ }),
  11587. /***/ 722:
  11588. /***/ (function(module) {
  11589. /**
  11590. * Convert array of 16 byte values to UUID string format of the form:
  11591. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11592. */
  11593. var byteToHex = [];
  11594. for (var i = 0; i < 256; ++i) {
  11595. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11596. }
  11597. function bytesToUuid(buf, offset) {
  11598. var i = offset || 0;
  11599. var bth = byteToHex;
  11600. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11601. return ([bth[buf[i++]], bth[buf[i++]],
  11602. bth[buf[i++]], bth[buf[i++]], '-',
  11603. bth[buf[i++]], bth[buf[i++]], '-',
  11604. bth[buf[i++]], bth[buf[i++]], '-',
  11605. bth[buf[i++]], bth[buf[i++]], '-',
  11606. bth[buf[i++]], bth[buf[i++]],
  11607. bth[buf[i++]], bth[buf[i++]],
  11608. bth[buf[i++]], bth[buf[i++]]]).join('');
  11609. }
  11610. module.exports = bytesToUuid;
  11611. /***/ }),
  11612. /***/ 742:
  11613. /***/ (function(module, __unusedexports, __webpack_require__) {
  11614. var fs = __webpack_require__(747)
  11615. var core
  11616. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11617. core = __webpack_require__(818)
  11618. } else {
  11619. core = __webpack_require__(197)
  11620. }
  11621. module.exports = isexe
  11622. isexe.sync = sync
  11623. function isexe (path, options, cb) {
  11624. if (typeof options === 'function') {
  11625. cb = options
  11626. options = {}
  11627. }
  11628. if (!cb) {
  11629. if (typeof Promise !== 'function') {
  11630. throw new TypeError('callback not provided')
  11631. }
  11632. return new Promise(function (resolve, reject) {
  11633. isexe(path, options || {}, function (er, is) {
  11634. if (er) {
  11635. reject(er)
  11636. } else {
  11637. resolve(is)
  11638. }
  11639. })
  11640. })
  11641. }
  11642. core(path, options || {}, function (er, is) {
  11643. // ignore EACCES because that just means we aren't allowed to run it
  11644. if (er) {
  11645. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11646. er = null
  11647. is = false
  11648. }
  11649. }
  11650. cb(er, is)
  11651. })
  11652. }
  11653. function sync (path, options) {
  11654. // my kingdom for a filtered catch
  11655. try {
  11656. return core.sync(path, options || {})
  11657. } catch (er) {
  11658. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11659. return false
  11660. } else {
  11661. throw er
  11662. }
  11663. }
  11664. }
  11665. /***/ }),
  11666. /***/ 747:
  11667. /***/ (function(module) {
  11668. module.exports = require("fs");
  11669. /***/ }),
  11670. /***/ 753:
  11671. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11672. "use strict";
  11673. Object.defineProperty(exports, '__esModule', { value: true });
  11674. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11675. var endpoint = __webpack_require__(385);
  11676. var universalUserAgent = __webpack_require__(796);
  11677. var isPlainObject = _interopDefault(__webpack_require__(696));
  11678. var nodeFetch = _interopDefault(__webpack_require__(454));
  11679. var requestError = __webpack_require__(463);
  11680. const VERSION = "5.3.1";
  11681. function getBufferResponse(response) {
  11682. return response.arrayBuffer();
  11683. }
  11684. function fetchWrapper(requestOptions) {
  11685. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11686. requestOptions.body = JSON.stringify(requestOptions.body);
  11687. }
  11688. let headers = {};
  11689. let status;
  11690. let url;
  11691. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11692. return fetch(requestOptions.url, Object.assign({
  11693. method: requestOptions.method,
  11694. body: requestOptions.body,
  11695. headers: requestOptions.headers,
  11696. redirect: requestOptions.redirect
  11697. }, requestOptions.request)).then(response => {
  11698. url = response.url;
  11699. status = response.status;
  11700. for (const keyAndValue of response.headers) {
  11701. headers[keyAndValue[0]] = keyAndValue[1];
  11702. }
  11703. if (status === 204 || status === 205) {
  11704. return;
  11705. } // GitHub API returns 200 for HEAD requsets
  11706. if (requestOptions.method === "HEAD") {
  11707. if (status < 400) {
  11708. return;
  11709. }
  11710. throw new requestError.RequestError(response.statusText, status, {
  11711. headers,
  11712. request: requestOptions
  11713. });
  11714. }
  11715. if (status === 304) {
  11716. throw new requestError.RequestError("Not modified", status, {
  11717. headers,
  11718. request: requestOptions
  11719. });
  11720. }
  11721. if (status >= 400) {
  11722. return response.text().then(message => {
  11723. const error = new requestError.RequestError(message, status, {
  11724. headers,
  11725. request: requestOptions
  11726. });
  11727. try {
  11728. let responseBody = JSON.parse(error.message);
  11729. Object.assign(error, responseBody);
  11730. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11731. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11732. } catch (e) {// ignore, see octokit/rest.js#684
  11733. }
  11734. throw error;
  11735. });
  11736. }
  11737. const contentType = response.headers.get("content-type");
  11738. if (/application\/json/.test(contentType)) {
  11739. return response.json();
  11740. }
  11741. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11742. return response.text();
  11743. }
  11744. return getBufferResponse(response);
  11745. }).then(data => {
  11746. return {
  11747. status,
  11748. url,
  11749. headers,
  11750. data
  11751. };
  11752. }).catch(error => {
  11753. if (error instanceof requestError.RequestError) {
  11754. throw error;
  11755. }
  11756. throw new requestError.RequestError(error.message, 500, {
  11757. headers,
  11758. request: requestOptions
  11759. });
  11760. });
  11761. }
  11762. function withDefaults(oldEndpoint, newDefaults) {
  11763. const endpoint = oldEndpoint.defaults(newDefaults);
  11764. const newApi = function (route, parameters) {
  11765. const endpointOptions = endpoint.merge(route, parameters);
  11766. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11767. return fetchWrapper(endpoint.parse(endpointOptions));
  11768. }
  11769. const request = (route, parameters) => {
  11770. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11771. };
  11772. Object.assign(request, {
  11773. endpoint,
  11774. defaults: withDefaults.bind(null, endpoint)
  11775. });
  11776. return endpointOptions.request.hook(request, endpointOptions);
  11777. };
  11778. return Object.assign(newApi, {
  11779. endpoint,
  11780. defaults: withDefaults.bind(null, endpoint)
  11781. });
  11782. }
  11783. const request = withDefaults(endpoint.endpoint, {
  11784. headers: {
  11785. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11786. }
  11787. });
  11788. exports.request = request;
  11789. //# sourceMappingURL=index.js.map
  11790. /***/ }),
  11791. /***/ 761:
  11792. /***/ (function(module) {
  11793. module.exports = require("zlib");
  11794. /***/ }),
  11795. /***/ 763:
  11796. /***/ (function(module) {
  11797. module.exports = removeHook
  11798. function removeHook (state, name, method) {
  11799. if (!state.registry[name]) {
  11800. return
  11801. }
  11802. var index = state.registry[name]
  11803. .map(function (registered) { return registered.orig })
  11804. .indexOf(method)
  11805. if (index === -1) {
  11806. return
  11807. }
  11808. state.registry[name].splice(index, 1)
  11809. }
  11810. /***/ }),
  11811. /***/ 768:
  11812. /***/ (function(module) {
  11813. "use strict";
  11814. module.exports = function (x) {
  11815. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11816. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11817. if (x[x.length - 1] === lf) {
  11818. x = x.slice(0, x.length - 1);
  11819. }
  11820. if (x[x.length - 1] === cr) {
  11821. x = x.slice(0, x.length - 1);
  11822. }
  11823. return x;
  11824. };
  11825. /***/ }),
  11826. /***/ 777:
  11827. /***/ (function(module, __unusedexports, __webpack_require__) {
  11828. module.exports = getFirstPage
  11829. const getPage = __webpack_require__(265)
  11830. function getFirstPage (octokit, link, headers) {
  11831. return getPage(octokit, link, 'first', headers)
  11832. }
  11833. /***/ }),
  11834. /***/ 796:
  11835. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11836. "use strict";
  11837. Object.defineProperty(exports, '__esModule', { value: true });
  11838. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11839. var osName = _interopDefault(__webpack_require__(2));
  11840. function getUserAgent() {
  11841. try {
  11842. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  11843. } catch (error) {
  11844. if (/wmic os get Caption/.test(error.message)) {
  11845. return "Windows <version undetectable>";
  11846. }
  11847. throw error;
  11848. }
  11849. }
  11850. exports.getUserAgent = getUserAgent;
  11851. //# sourceMappingURL=index.js.map
  11852. /***/ }),
  11853. /***/ 807:
  11854. /***/ (function(module, __unusedexports, __webpack_require__) {
  11855. module.exports = paginate;
  11856. const iterator = __webpack_require__(8);
  11857. function paginate(octokit, route, options, mapFn) {
  11858. if (typeof options === "function") {
  11859. mapFn = options;
  11860. options = undefined;
  11861. }
  11862. options = octokit.request.endpoint.merge(route, options);
  11863. return gather(
  11864. octokit,
  11865. [],
  11866. iterator(octokit, options)[Symbol.asyncIterator](),
  11867. mapFn
  11868. );
  11869. }
  11870. function gather(octokit, results, iterator, mapFn) {
  11871. return iterator.next().then(result => {
  11872. if (result.done) {
  11873. return results;
  11874. }
  11875. let earlyExit = false;
  11876. function done() {
  11877. earlyExit = true;
  11878. }
  11879. results = results.concat(
  11880. mapFn ? mapFn(result.value, done) : result.value.data
  11881. );
  11882. if (earlyExit) {
  11883. return results;
  11884. }
  11885. return gather(octokit, results, iterator, mapFn);
  11886. });
  11887. }
  11888. /***/ }),
  11889. /***/ 813:
  11890. /***/ (function(__unusedmodule, exports) {
  11891. "use strict";
  11892. Object.defineProperty(exports, '__esModule', { value: true });
  11893. async function auth(token) {
  11894. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  11895. return {
  11896. type: "token",
  11897. token: token,
  11898. tokenType
  11899. };
  11900. }
  11901. /**
  11902. * Prefix token for usage in the Authorization header
  11903. *
  11904. * @param token OAuth token or JSON Web Token
  11905. */
  11906. function withAuthorizationPrefix(token) {
  11907. if (token.split(/\./).length === 3) {
  11908. return `bearer ${token}`;
  11909. }
  11910. return `token ${token}`;
  11911. }
  11912. async function hook(token, request, route, parameters) {
  11913. const endpoint = request.endpoint.merge(route, parameters);
  11914. endpoint.headers.authorization = withAuthorizationPrefix(token);
  11915. return request(endpoint);
  11916. }
  11917. const createTokenAuth = function createTokenAuth(token) {
  11918. if (!token) {
  11919. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  11920. }
  11921. if (typeof token !== "string") {
  11922. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  11923. }
  11924. token = token.replace(/^(token|bearer) +/i, "");
  11925. return Object.assign(auth.bind(null, token), {
  11926. hook: hook.bind(null, token)
  11927. });
  11928. };
  11929. exports.createTokenAuth = createTokenAuth;
  11930. //# sourceMappingURL=index.js.map
  11931. /***/ }),
  11932. /***/ 814:
  11933. /***/ (function(module, __unusedexports, __webpack_require__) {
  11934. module.exports = which
  11935. which.sync = whichSync
  11936. var isWindows = process.platform === 'win32' ||
  11937. process.env.OSTYPE === 'cygwin' ||
  11938. process.env.OSTYPE === 'msys'
  11939. var path = __webpack_require__(622)
  11940. var COLON = isWindows ? ';' : ':'
  11941. var isexe = __webpack_require__(742)
  11942. function getNotFoundError (cmd) {
  11943. var er = new Error('not found: ' + cmd)
  11944. er.code = 'ENOENT'
  11945. return er
  11946. }
  11947. function getPathInfo (cmd, opt) {
  11948. var colon = opt.colon || COLON
  11949. var pathEnv = opt.path || process.env.PATH || ''
  11950. var pathExt = ['']
  11951. pathEnv = pathEnv.split(colon)
  11952. var pathExtExe = ''
  11953. if (isWindows) {
  11954. pathEnv.unshift(process.cwd())
  11955. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  11956. pathExt = pathExtExe.split(colon)
  11957. // Always test the cmd itself first. isexe will check to make sure
  11958. // it's found in the pathExt set.
  11959. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  11960. pathExt.unshift('')
  11961. }
  11962. // If it has a slash, then we don't bother searching the pathenv.
  11963. // just check the file itself, and that's it.
  11964. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  11965. pathEnv = ['']
  11966. return {
  11967. env: pathEnv,
  11968. ext: pathExt,
  11969. extExe: pathExtExe
  11970. }
  11971. }
  11972. function which (cmd, opt, cb) {
  11973. if (typeof opt === 'function') {
  11974. cb = opt
  11975. opt = {}
  11976. }
  11977. var info = getPathInfo(cmd, opt)
  11978. var pathEnv = info.env
  11979. var pathExt = info.ext
  11980. var pathExtExe = info.extExe
  11981. var found = []
  11982. ;(function F (i, l) {
  11983. if (i === l) {
  11984. if (opt.all && found.length)
  11985. return cb(null, found)
  11986. else
  11987. return cb(getNotFoundError(cmd))
  11988. }
  11989. var pathPart = pathEnv[i]
  11990. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  11991. pathPart = pathPart.slice(1, -1)
  11992. var p = path.join(pathPart, cmd)
  11993. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  11994. p = cmd.slice(0, 2) + p
  11995. }
  11996. ;(function E (ii, ll) {
  11997. if (ii === ll) return F(i + 1, l)
  11998. var ext = pathExt[ii]
  11999. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12000. if (!er && is) {
  12001. if (opt.all)
  12002. found.push(p + ext)
  12003. else
  12004. return cb(null, p + ext)
  12005. }
  12006. return E(ii + 1, ll)
  12007. })
  12008. })(0, pathExt.length)
  12009. })(0, pathEnv.length)
  12010. }
  12011. function whichSync (cmd, opt) {
  12012. opt = opt || {}
  12013. var info = getPathInfo(cmd, opt)
  12014. var pathEnv = info.env
  12015. var pathExt = info.ext
  12016. var pathExtExe = info.extExe
  12017. var found = []
  12018. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12019. var pathPart = pathEnv[i]
  12020. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12021. pathPart = pathPart.slice(1, -1)
  12022. var p = path.join(pathPart, cmd)
  12023. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12024. p = cmd.slice(0, 2) + p
  12025. }
  12026. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12027. var cur = p + pathExt[j]
  12028. var is
  12029. try {
  12030. is = isexe.sync(cur, { pathExt: pathExtExe })
  12031. if (is) {
  12032. if (opt.all)
  12033. found.push(cur)
  12034. else
  12035. return cur
  12036. }
  12037. } catch (ex) {}
  12038. }
  12039. }
  12040. if (opt.all && found.length)
  12041. return found
  12042. if (opt.nothrow)
  12043. return null
  12044. throw getNotFoundError(cmd)
  12045. }
  12046. /***/ }),
  12047. /***/ 816:
  12048. /***/ (function(module) {
  12049. "use strict";
  12050. module.exports = /^#!.*/;
  12051. /***/ }),
  12052. /***/ 818:
  12053. /***/ (function(module, __unusedexports, __webpack_require__) {
  12054. module.exports = isexe
  12055. isexe.sync = sync
  12056. var fs = __webpack_require__(747)
  12057. function checkPathExt (path, options) {
  12058. var pathext = options.pathExt !== undefined ?
  12059. options.pathExt : process.env.PATHEXT
  12060. if (!pathext) {
  12061. return true
  12062. }
  12063. pathext = pathext.split(';')
  12064. if (pathext.indexOf('') !== -1) {
  12065. return true
  12066. }
  12067. for (var i = 0; i < pathext.length; i++) {
  12068. var p = pathext[i].toLowerCase()
  12069. if (p && path.substr(-p.length).toLowerCase() === p) {
  12070. return true
  12071. }
  12072. }
  12073. return false
  12074. }
  12075. function checkStat (stat, path, options) {
  12076. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12077. return false
  12078. }
  12079. return checkPathExt(path, options)
  12080. }
  12081. function isexe (path, options, cb) {
  12082. fs.stat(path, function (er, stat) {
  12083. cb(er, er ? false : checkStat(stat, path, options))
  12084. })
  12085. }
  12086. function sync (path, options) {
  12087. return checkStat(fs.statSync(path), path, options)
  12088. }
  12089. /***/ }),
  12090. /***/ 821:
  12091. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12092. "use strict";
  12093. var __importStar = (this && this.__importStar) || function (mod) {
  12094. if (mod && mod.__esModule) return mod;
  12095. var result = {};
  12096. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12097. result["default"] = mod;
  12098. return result;
  12099. };
  12100. Object.defineProperty(exports, "__esModule", { value: true });
  12101. const core = __importStar(__webpack_require__(470));
  12102. const fsHelper = __importStar(__webpack_require__(618));
  12103. const github = __importStar(__webpack_require__(469));
  12104. const path = __importStar(__webpack_require__(622));
  12105. function getInputs() {
  12106. const result = {};
  12107. // GitHub workspace
  12108. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12109. if (!githubWorkspacePath) {
  12110. throw new Error('GITHUB_WORKSPACE not defined');
  12111. }
  12112. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12113. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12114. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12115. // Qualified repository
  12116. const qualifiedRepository = core.getInput('repository') ||
  12117. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12118. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12119. const splitRepository = qualifiedRepository.split('/');
  12120. if (splitRepository.length !== 2 ||
  12121. !splitRepository[0] ||
  12122. !splitRepository[1]) {
  12123. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12124. }
  12125. result.repositoryOwner = splitRepository[0];
  12126. result.repositoryName = splitRepository[1];
  12127. // Repository path
  12128. result.repositoryPath = core.getInput('path') || '.';
  12129. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12130. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12131. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12132. }
  12133. // Workflow repository?
  12134. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12135. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12136. // Source branch, source version
  12137. result.ref = core.getInput('ref');
  12138. if (!result.ref) {
  12139. if (isWorkflowRepository) {
  12140. result.ref = github.context.ref;
  12141. result.commit = github.context.sha;
  12142. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12143. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12144. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12145. result.ref = `refs/heads/${result.ref}`;
  12146. }
  12147. }
  12148. if (!result.ref && !result.commit) {
  12149. result.ref = 'refs/heads/master';
  12150. }
  12151. }
  12152. // SHA?
  12153. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12154. result.commit = result.ref;
  12155. result.ref = '';
  12156. }
  12157. core.debug(`ref = '${result.ref}'`);
  12158. core.debug(`commit = '${result.commit}'`);
  12159. // Clean
  12160. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12161. core.debug(`clean = ${result.clean}`);
  12162. // Fetch depth
  12163. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12164. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12165. result.fetchDepth = 0;
  12166. }
  12167. core.debug(`fetch depth = ${result.fetchDepth}`);
  12168. // LFS
  12169. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12170. core.debug(`lfs = ${result.lfs}`);
  12171. // Submodules
  12172. result.submodules = false;
  12173. result.nestedSubmodules = false;
  12174. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12175. if (submodulesString == 'RECURSIVE') {
  12176. result.submodules = true;
  12177. result.nestedSubmodules = true;
  12178. }
  12179. else if (submodulesString == 'TRUE') {
  12180. result.submodules = true;
  12181. }
  12182. core.debug(`submodules = ${result.submodules}`);
  12183. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12184. // Auth token
  12185. result.authToken = core.getInput('token');
  12186. // SSH
  12187. result.sshKey = core.getInput('ssh-key');
  12188. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12189. result.sshStrict =
  12190. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12191. // Persist credentials
  12192. result.persistCredentials =
  12193. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12194. return result;
  12195. }
  12196. exports.getInputs = getInputs;
  12197. /***/ }),
  12198. /***/ 826:
  12199. /***/ (function(module, __unusedexports, __webpack_require__) {
  12200. var rng = __webpack_require__(139);
  12201. var bytesToUuid = __webpack_require__(722);
  12202. function v4(options, buf, offset) {
  12203. var i = buf && offset || 0;
  12204. if (typeof(options) == 'string') {
  12205. buf = options === 'binary' ? new Array(16) : null;
  12206. options = null;
  12207. }
  12208. options = options || {};
  12209. var rnds = options.random || (options.rng || rng)();
  12210. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12211. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12212. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12213. // Copy bytes to buffer, if provided
  12214. if (buf) {
  12215. for (var ii = 0; ii < 16; ++ii) {
  12216. buf[i + ii] = rnds[ii];
  12217. }
  12218. }
  12219. return buf || bytesToUuid(rnds);
  12220. }
  12221. module.exports = v4;
  12222. /***/ }),
  12223. /***/ 835:
  12224. /***/ (function(module) {
  12225. module.exports = require("url");
  12226. /***/ }),
  12227. /***/ 850:
  12228. /***/ (function(module, __unusedexports, __webpack_require__) {
  12229. module.exports = paginationMethodsPlugin
  12230. function paginationMethodsPlugin (octokit) {
  12231. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  12232. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  12233. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  12234. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  12235. octokit.hasFirstPage = __webpack_require__(536)
  12236. octokit.hasLastPage = __webpack_require__(336)
  12237. octokit.hasNextPage = __webpack_require__(929)
  12238. octokit.hasPreviousPage = __webpack_require__(558)
  12239. }
  12240. /***/ }),
  12241. /***/ 854:
  12242. /***/ (function(module) {
  12243. /**
  12244. * lodash (Custom Build) <https://lodash.com/>
  12245. * Build: `lodash modularize exports="npm" -o ./`
  12246. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12247. * Released under MIT license <https://lodash.com/license>
  12248. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12249. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12250. */
  12251. /** Used as the `TypeError` message for "Functions" methods. */
  12252. var FUNC_ERROR_TEXT = 'Expected a function';
  12253. /** Used to stand-in for `undefined` hash values. */
  12254. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12255. /** Used as references for various `Number` constants. */
  12256. var INFINITY = 1 / 0;
  12257. /** `Object#toString` result references. */
  12258. var funcTag = '[object Function]',
  12259. genTag = '[object GeneratorFunction]',
  12260. symbolTag = '[object Symbol]';
  12261. /** Used to match property names within property paths. */
  12262. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12263. reIsPlainProp = /^\w*$/,
  12264. reLeadingDot = /^\./,
  12265. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12266. /**
  12267. * Used to match `RegExp`
  12268. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12269. */
  12270. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12271. /** Used to match backslashes in property paths. */
  12272. var reEscapeChar = /\\(\\)?/g;
  12273. /** Used to detect host constructors (Safari). */
  12274. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12275. /** Detect free variable `global` from Node.js. */
  12276. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12277. /** Detect free variable `self`. */
  12278. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12279. /** Used as a reference to the global object. */
  12280. var root = freeGlobal || freeSelf || Function('return this')();
  12281. /**
  12282. * Gets the value at `key` of `object`.
  12283. *
  12284. * @private
  12285. * @param {Object} [object] The object to query.
  12286. * @param {string} key The key of the property to get.
  12287. * @returns {*} Returns the property value.
  12288. */
  12289. function getValue(object, key) {
  12290. return object == null ? undefined : object[key];
  12291. }
  12292. /**
  12293. * Checks if `value` is a host object in IE < 9.
  12294. *
  12295. * @private
  12296. * @param {*} value The value to check.
  12297. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12298. */
  12299. function isHostObject(value) {
  12300. // Many host objects are `Object` objects that can coerce to strings
  12301. // despite having improperly defined `toString` methods.
  12302. var result = false;
  12303. if (value != null && typeof value.toString != 'function') {
  12304. try {
  12305. result = !!(value + '');
  12306. } catch (e) {}
  12307. }
  12308. return result;
  12309. }
  12310. /** Used for built-in method references. */
  12311. var arrayProto = Array.prototype,
  12312. funcProto = Function.prototype,
  12313. objectProto = Object.prototype;
  12314. /** Used to detect overreaching core-js shims. */
  12315. var coreJsData = root['__core-js_shared__'];
  12316. /** Used to detect methods masquerading as native. */
  12317. var maskSrcKey = (function() {
  12318. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12319. return uid ? ('Symbol(src)_1.' + uid) : '';
  12320. }());
  12321. /** Used to resolve the decompiled source of functions. */
  12322. var funcToString = funcProto.toString;
  12323. /** Used to check objects for own properties. */
  12324. var hasOwnProperty = objectProto.hasOwnProperty;
  12325. /**
  12326. * Used to resolve the
  12327. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12328. * of values.
  12329. */
  12330. var objectToString = objectProto.toString;
  12331. /** Used to detect if a method is native. */
  12332. var reIsNative = RegExp('^' +
  12333. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12334. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12335. );
  12336. /** Built-in value references. */
  12337. var Symbol = root.Symbol,
  12338. splice = arrayProto.splice;
  12339. /* Built-in method references that are verified to be native. */
  12340. var Map = getNative(root, 'Map'),
  12341. nativeCreate = getNative(Object, 'create');
  12342. /** Used to convert symbols to primitives and strings. */
  12343. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12344. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12345. /**
  12346. * Creates a hash object.
  12347. *
  12348. * @private
  12349. * @constructor
  12350. * @param {Array} [entries] The key-value pairs to cache.
  12351. */
  12352. function Hash(entries) {
  12353. var index = -1,
  12354. length = entries ? entries.length : 0;
  12355. this.clear();
  12356. while (++index < length) {
  12357. var entry = entries[index];
  12358. this.set(entry[0], entry[1]);
  12359. }
  12360. }
  12361. /**
  12362. * Removes all key-value entries from the hash.
  12363. *
  12364. * @private
  12365. * @name clear
  12366. * @memberOf Hash
  12367. */
  12368. function hashClear() {
  12369. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12370. }
  12371. /**
  12372. * Removes `key` and its value from the hash.
  12373. *
  12374. * @private
  12375. * @name delete
  12376. * @memberOf Hash
  12377. * @param {Object} hash The hash to modify.
  12378. * @param {string} key The key of the value to remove.
  12379. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12380. */
  12381. function hashDelete(key) {
  12382. return this.has(key) && delete this.__data__[key];
  12383. }
  12384. /**
  12385. * Gets the hash value for `key`.
  12386. *
  12387. * @private
  12388. * @name get
  12389. * @memberOf Hash
  12390. * @param {string} key The key of the value to get.
  12391. * @returns {*} Returns the entry value.
  12392. */
  12393. function hashGet(key) {
  12394. var data = this.__data__;
  12395. if (nativeCreate) {
  12396. var result = data[key];
  12397. return result === HASH_UNDEFINED ? undefined : result;
  12398. }
  12399. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12400. }
  12401. /**
  12402. * Checks if a hash value for `key` exists.
  12403. *
  12404. * @private
  12405. * @name has
  12406. * @memberOf Hash
  12407. * @param {string} key The key of the entry to check.
  12408. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12409. */
  12410. function hashHas(key) {
  12411. var data = this.__data__;
  12412. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12413. }
  12414. /**
  12415. * Sets the hash `key` to `value`.
  12416. *
  12417. * @private
  12418. * @name set
  12419. * @memberOf Hash
  12420. * @param {string} key The key of the value to set.
  12421. * @param {*} value The value to set.
  12422. * @returns {Object} Returns the hash instance.
  12423. */
  12424. function hashSet(key, value) {
  12425. var data = this.__data__;
  12426. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12427. return this;
  12428. }
  12429. // Add methods to `Hash`.
  12430. Hash.prototype.clear = hashClear;
  12431. Hash.prototype['delete'] = hashDelete;
  12432. Hash.prototype.get = hashGet;
  12433. Hash.prototype.has = hashHas;
  12434. Hash.prototype.set = hashSet;
  12435. /**
  12436. * Creates an list cache object.
  12437. *
  12438. * @private
  12439. * @constructor
  12440. * @param {Array} [entries] The key-value pairs to cache.
  12441. */
  12442. function ListCache(entries) {
  12443. var index = -1,
  12444. length = entries ? entries.length : 0;
  12445. this.clear();
  12446. while (++index < length) {
  12447. var entry = entries[index];
  12448. this.set(entry[0], entry[1]);
  12449. }
  12450. }
  12451. /**
  12452. * Removes all key-value entries from the list cache.
  12453. *
  12454. * @private
  12455. * @name clear
  12456. * @memberOf ListCache
  12457. */
  12458. function listCacheClear() {
  12459. this.__data__ = [];
  12460. }
  12461. /**
  12462. * Removes `key` and its value from the list cache.
  12463. *
  12464. * @private
  12465. * @name delete
  12466. * @memberOf ListCache
  12467. * @param {string} key The key of the value to remove.
  12468. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12469. */
  12470. function listCacheDelete(key) {
  12471. var data = this.__data__,
  12472. index = assocIndexOf(data, key);
  12473. if (index < 0) {
  12474. return false;
  12475. }
  12476. var lastIndex = data.length - 1;
  12477. if (index == lastIndex) {
  12478. data.pop();
  12479. } else {
  12480. splice.call(data, index, 1);
  12481. }
  12482. return true;
  12483. }
  12484. /**
  12485. * Gets the list cache value for `key`.
  12486. *
  12487. * @private
  12488. * @name get
  12489. * @memberOf ListCache
  12490. * @param {string} key The key of the value to get.
  12491. * @returns {*} Returns the entry value.
  12492. */
  12493. function listCacheGet(key) {
  12494. var data = this.__data__,
  12495. index = assocIndexOf(data, key);
  12496. return index < 0 ? undefined : data[index][1];
  12497. }
  12498. /**
  12499. * Checks if a list cache value for `key` exists.
  12500. *
  12501. * @private
  12502. * @name has
  12503. * @memberOf ListCache
  12504. * @param {string} key The key of the entry to check.
  12505. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12506. */
  12507. function listCacheHas(key) {
  12508. return assocIndexOf(this.__data__, key) > -1;
  12509. }
  12510. /**
  12511. * Sets the list cache `key` to `value`.
  12512. *
  12513. * @private
  12514. * @name set
  12515. * @memberOf ListCache
  12516. * @param {string} key The key of the value to set.
  12517. * @param {*} value The value to set.
  12518. * @returns {Object} Returns the list cache instance.
  12519. */
  12520. function listCacheSet(key, value) {
  12521. var data = this.__data__,
  12522. index = assocIndexOf(data, key);
  12523. if (index < 0) {
  12524. data.push([key, value]);
  12525. } else {
  12526. data[index][1] = value;
  12527. }
  12528. return this;
  12529. }
  12530. // Add methods to `ListCache`.
  12531. ListCache.prototype.clear = listCacheClear;
  12532. ListCache.prototype['delete'] = listCacheDelete;
  12533. ListCache.prototype.get = listCacheGet;
  12534. ListCache.prototype.has = listCacheHas;
  12535. ListCache.prototype.set = listCacheSet;
  12536. /**
  12537. * Creates a map cache object to store key-value pairs.
  12538. *
  12539. * @private
  12540. * @constructor
  12541. * @param {Array} [entries] The key-value pairs to cache.
  12542. */
  12543. function MapCache(entries) {
  12544. var index = -1,
  12545. length = entries ? entries.length : 0;
  12546. this.clear();
  12547. while (++index < length) {
  12548. var entry = entries[index];
  12549. this.set(entry[0], entry[1]);
  12550. }
  12551. }
  12552. /**
  12553. * Removes all key-value entries from the map.
  12554. *
  12555. * @private
  12556. * @name clear
  12557. * @memberOf MapCache
  12558. */
  12559. function mapCacheClear() {
  12560. this.__data__ = {
  12561. 'hash': new Hash,
  12562. 'map': new (Map || ListCache),
  12563. 'string': new Hash
  12564. };
  12565. }
  12566. /**
  12567. * Removes `key` and its value from the map.
  12568. *
  12569. * @private
  12570. * @name delete
  12571. * @memberOf MapCache
  12572. * @param {string} key The key of the value to remove.
  12573. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12574. */
  12575. function mapCacheDelete(key) {
  12576. return getMapData(this, key)['delete'](key);
  12577. }
  12578. /**
  12579. * Gets the map value for `key`.
  12580. *
  12581. * @private
  12582. * @name get
  12583. * @memberOf MapCache
  12584. * @param {string} key The key of the value to get.
  12585. * @returns {*} Returns the entry value.
  12586. */
  12587. function mapCacheGet(key) {
  12588. return getMapData(this, key).get(key);
  12589. }
  12590. /**
  12591. * Checks if a map value for `key` exists.
  12592. *
  12593. * @private
  12594. * @name has
  12595. * @memberOf MapCache
  12596. * @param {string} key The key of the entry to check.
  12597. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12598. */
  12599. function mapCacheHas(key) {
  12600. return getMapData(this, key).has(key);
  12601. }
  12602. /**
  12603. * Sets the map `key` to `value`.
  12604. *
  12605. * @private
  12606. * @name set
  12607. * @memberOf MapCache
  12608. * @param {string} key The key of the value to set.
  12609. * @param {*} value The value to set.
  12610. * @returns {Object} Returns the map cache instance.
  12611. */
  12612. function mapCacheSet(key, value) {
  12613. getMapData(this, key).set(key, value);
  12614. return this;
  12615. }
  12616. // Add methods to `MapCache`.
  12617. MapCache.prototype.clear = mapCacheClear;
  12618. MapCache.prototype['delete'] = mapCacheDelete;
  12619. MapCache.prototype.get = mapCacheGet;
  12620. MapCache.prototype.has = mapCacheHas;
  12621. MapCache.prototype.set = mapCacheSet;
  12622. /**
  12623. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12624. *
  12625. * @private
  12626. * @param {Array} array The array to inspect.
  12627. * @param {*} key The key to search for.
  12628. * @returns {number} Returns the index of the matched value, else `-1`.
  12629. */
  12630. function assocIndexOf(array, key) {
  12631. var length = array.length;
  12632. while (length--) {
  12633. if (eq(array[length][0], key)) {
  12634. return length;
  12635. }
  12636. }
  12637. return -1;
  12638. }
  12639. /**
  12640. * The base implementation of `_.get` without support for default values.
  12641. *
  12642. * @private
  12643. * @param {Object} object The object to query.
  12644. * @param {Array|string} path The path of the property to get.
  12645. * @returns {*} Returns the resolved value.
  12646. */
  12647. function baseGet(object, path) {
  12648. path = isKey(path, object) ? [path] : castPath(path);
  12649. var index = 0,
  12650. length = path.length;
  12651. while (object != null && index < length) {
  12652. object = object[toKey(path[index++])];
  12653. }
  12654. return (index && index == length) ? object : undefined;
  12655. }
  12656. /**
  12657. * The base implementation of `_.isNative` without bad shim checks.
  12658. *
  12659. * @private
  12660. * @param {*} value The value to check.
  12661. * @returns {boolean} Returns `true` if `value` is a native function,
  12662. * else `false`.
  12663. */
  12664. function baseIsNative(value) {
  12665. if (!isObject(value) || isMasked(value)) {
  12666. return false;
  12667. }
  12668. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12669. return pattern.test(toSource(value));
  12670. }
  12671. /**
  12672. * The base implementation of `_.toString` which doesn't convert nullish
  12673. * values to empty strings.
  12674. *
  12675. * @private
  12676. * @param {*} value The value to process.
  12677. * @returns {string} Returns the string.
  12678. */
  12679. function baseToString(value) {
  12680. // Exit early for strings to avoid a performance hit in some environments.
  12681. if (typeof value == 'string') {
  12682. return value;
  12683. }
  12684. if (isSymbol(value)) {
  12685. return symbolToString ? symbolToString.call(value) : '';
  12686. }
  12687. var result = (value + '');
  12688. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12689. }
  12690. /**
  12691. * Casts `value` to a path array if it's not one.
  12692. *
  12693. * @private
  12694. * @param {*} value The value to inspect.
  12695. * @returns {Array} Returns the cast property path array.
  12696. */
  12697. function castPath(value) {
  12698. return isArray(value) ? value : stringToPath(value);
  12699. }
  12700. /**
  12701. * Gets the data for `map`.
  12702. *
  12703. * @private
  12704. * @param {Object} map The map to query.
  12705. * @param {string} key The reference key.
  12706. * @returns {*} Returns the map data.
  12707. */
  12708. function getMapData(map, key) {
  12709. var data = map.__data__;
  12710. return isKeyable(key)
  12711. ? data[typeof key == 'string' ? 'string' : 'hash']
  12712. : data.map;
  12713. }
  12714. /**
  12715. * Gets the native function at `key` of `object`.
  12716. *
  12717. * @private
  12718. * @param {Object} object The object to query.
  12719. * @param {string} key The key of the method to get.
  12720. * @returns {*} Returns the function if it's native, else `undefined`.
  12721. */
  12722. function getNative(object, key) {
  12723. var value = getValue(object, key);
  12724. return baseIsNative(value) ? value : undefined;
  12725. }
  12726. /**
  12727. * Checks if `value` is a property name and not a property path.
  12728. *
  12729. * @private
  12730. * @param {*} value The value to check.
  12731. * @param {Object} [object] The object to query keys on.
  12732. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12733. */
  12734. function isKey(value, object) {
  12735. if (isArray(value)) {
  12736. return false;
  12737. }
  12738. var type = typeof value;
  12739. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12740. value == null || isSymbol(value)) {
  12741. return true;
  12742. }
  12743. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12744. (object != null && value in Object(object));
  12745. }
  12746. /**
  12747. * Checks if `value` is suitable for use as unique object key.
  12748. *
  12749. * @private
  12750. * @param {*} value The value to check.
  12751. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12752. */
  12753. function isKeyable(value) {
  12754. var type = typeof value;
  12755. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12756. ? (value !== '__proto__')
  12757. : (value === null);
  12758. }
  12759. /**
  12760. * Checks if `func` has its source masked.
  12761. *
  12762. * @private
  12763. * @param {Function} func The function to check.
  12764. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12765. */
  12766. function isMasked(func) {
  12767. return !!maskSrcKey && (maskSrcKey in func);
  12768. }
  12769. /**
  12770. * Converts `string` to a property path array.
  12771. *
  12772. * @private
  12773. * @param {string} string The string to convert.
  12774. * @returns {Array} Returns the property path array.
  12775. */
  12776. var stringToPath = memoize(function(string) {
  12777. string = toString(string);
  12778. var result = [];
  12779. if (reLeadingDot.test(string)) {
  12780. result.push('');
  12781. }
  12782. string.replace(rePropName, function(match, number, quote, string) {
  12783. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  12784. });
  12785. return result;
  12786. });
  12787. /**
  12788. * Converts `value` to a string key if it's not a string or symbol.
  12789. *
  12790. * @private
  12791. * @param {*} value The value to inspect.
  12792. * @returns {string|symbol} Returns the key.
  12793. */
  12794. function toKey(value) {
  12795. if (typeof value == 'string' || isSymbol(value)) {
  12796. return value;
  12797. }
  12798. var result = (value + '');
  12799. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12800. }
  12801. /**
  12802. * Converts `func` to its source code.
  12803. *
  12804. * @private
  12805. * @param {Function} func The function to process.
  12806. * @returns {string} Returns the source code.
  12807. */
  12808. function toSource(func) {
  12809. if (func != null) {
  12810. try {
  12811. return funcToString.call(func);
  12812. } catch (e) {}
  12813. try {
  12814. return (func + '');
  12815. } catch (e) {}
  12816. }
  12817. return '';
  12818. }
  12819. /**
  12820. * Creates a function that memoizes the result of `func`. If `resolver` is
  12821. * provided, it determines the cache key for storing the result based on the
  12822. * arguments provided to the memoized function. By default, the first argument
  12823. * provided to the memoized function is used as the map cache key. The `func`
  12824. * is invoked with the `this` binding of the memoized function.
  12825. *
  12826. * **Note:** The cache is exposed as the `cache` property on the memoized
  12827. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  12828. * constructor with one whose instances implement the
  12829. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  12830. * method interface of `delete`, `get`, `has`, and `set`.
  12831. *
  12832. * @static
  12833. * @memberOf _
  12834. * @since 0.1.0
  12835. * @category Function
  12836. * @param {Function} func The function to have its output memoized.
  12837. * @param {Function} [resolver] The function to resolve the cache key.
  12838. * @returns {Function} Returns the new memoized function.
  12839. * @example
  12840. *
  12841. * var object = { 'a': 1, 'b': 2 };
  12842. * var other = { 'c': 3, 'd': 4 };
  12843. *
  12844. * var values = _.memoize(_.values);
  12845. * values(object);
  12846. * // => [1, 2]
  12847. *
  12848. * values(other);
  12849. * // => [3, 4]
  12850. *
  12851. * object.a = 2;
  12852. * values(object);
  12853. * // => [1, 2]
  12854. *
  12855. * // Modify the result cache.
  12856. * values.cache.set(object, ['a', 'b']);
  12857. * values(object);
  12858. * // => ['a', 'b']
  12859. *
  12860. * // Replace `_.memoize.Cache`.
  12861. * _.memoize.Cache = WeakMap;
  12862. */
  12863. function memoize(func, resolver) {
  12864. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  12865. throw new TypeError(FUNC_ERROR_TEXT);
  12866. }
  12867. var memoized = function() {
  12868. var args = arguments,
  12869. key = resolver ? resolver.apply(this, args) : args[0],
  12870. cache = memoized.cache;
  12871. if (cache.has(key)) {
  12872. return cache.get(key);
  12873. }
  12874. var result = func.apply(this, args);
  12875. memoized.cache = cache.set(key, result);
  12876. return result;
  12877. };
  12878. memoized.cache = new (memoize.Cache || MapCache);
  12879. return memoized;
  12880. }
  12881. // Assign cache to `_.memoize`.
  12882. memoize.Cache = MapCache;
  12883. /**
  12884. * Performs a
  12885. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12886. * comparison between two values to determine if they are equivalent.
  12887. *
  12888. * @static
  12889. * @memberOf _
  12890. * @since 4.0.0
  12891. * @category Lang
  12892. * @param {*} value The value to compare.
  12893. * @param {*} other The other value to compare.
  12894. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12895. * @example
  12896. *
  12897. * var object = { 'a': 1 };
  12898. * var other = { 'a': 1 };
  12899. *
  12900. * _.eq(object, object);
  12901. * // => true
  12902. *
  12903. * _.eq(object, other);
  12904. * // => false
  12905. *
  12906. * _.eq('a', 'a');
  12907. * // => true
  12908. *
  12909. * _.eq('a', Object('a'));
  12910. * // => false
  12911. *
  12912. * _.eq(NaN, NaN);
  12913. * // => true
  12914. */
  12915. function eq(value, other) {
  12916. return value === other || (value !== value && other !== other);
  12917. }
  12918. /**
  12919. * Checks if `value` is classified as an `Array` object.
  12920. *
  12921. * @static
  12922. * @memberOf _
  12923. * @since 0.1.0
  12924. * @category Lang
  12925. * @param {*} value The value to check.
  12926. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12927. * @example
  12928. *
  12929. * _.isArray([1, 2, 3]);
  12930. * // => true
  12931. *
  12932. * _.isArray(document.body.children);
  12933. * // => false
  12934. *
  12935. * _.isArray('abc');
  12936. * // => false
  12937. *
  12938. * _.isArray(_.noop);
  12939. * // => false
  12940. */
  12941. var isArray = Array.isArray;
  12942. /**
  12943. * Checks if `value` is classified as a `Function` object.
  12944. *
  12945. * @static
  12946. * @memberOf _
  12947. * @since 0.1.0
  12948. * @category Lang
  12949. * @param {*} value The value to check.
  12950. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12951. * @example
  12952. *
  12953. * _.isFunction(_);
  12954. * // => true
  12955. *
  12956. * _.isFunction(/abc/);
  12957. * // => false
  12958. */
  12959. function isFunction(value) {
  12960. // The use of `Object#toString` avoids issues with the `typeof` operator
  12961. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  12962. var tag = isObject(value) ? objectToString.call(value) : '';
  12963. return tag == funcTag || tag == genTag;
  12964. }
  12965. /**
  12966. * Checks if `value` is the
  12967. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12968. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12969. *
  12970. * @static
  12971. * @memberOf _
  12972. * @since 0.1.0
  12973. * @category Lang
  12974. * @param {*} value The value to check.
  12975. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12976. * @example
  12977. *
  12978. * _.isObject({});
  12979. * // => true
  12980. *
  12981. * _.isObject([1, 2, 3]);
  12982. * // => true
  12983. *
  12984. * _.isObject(_.noop);
  12985. * // => true
  12986. *
  12987. * _.isObject(null);
  12988. * // => false
  12989. */
  12990. function isObject(value) {
  12991. var type = typeof value;
  12992. return !!value && (type == 'object' || type == 'function');
  12993. }
  12994. /**
  12995. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12996. * and has a `typeof` result of "object".
  12997. *
  12998. * @static
  12999. * @memberOf _
  13000. * @since 4.0.0
  13001. * @category Lang
  13002. * @param {*} value The value to check.
  13003. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  13004. * @example
  13005. *
  13006. * _.isObjectLike({});
  13007. * // => true
  13008. *
  13009. * _.isObjectLike([1, 2, 3]);
  13010. * // => true
  13011. *
  13012. * _.isObjectLike(_.noop);
  13013. * // => false
  13014. *
  13015. * _.isObjectLike(null);
  13016. * // => false
  13017. */
  13018. function isObjectLike(value) {
  13019. return !!value && typeof value == 'object';
  13020. }
  13021. /**
  13022. * Checks if `value` is classified as a `Symbol` primitive or object.
  13023. *
  13024. * @static
  13025. * @memberOf _
  13026. * @since 4.0.0
  13027. * @category Lang
  13028. * @param {*} value The value to check.
  13029. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13030. * @example
  13031. *
  13032. * _.isSymbol(Symbol.iterator);
  13033. * // => true
  13034. *
  13035. * _.isSymbol('abc');
  13036. * // => false
  13037. */
  13038. function isSymbol(value) {
  13039. return typeof value == 'symbol' ||
  13040. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13041. }
  13042. /**
  13043. * Converts `value` to a string. An empty string is returned for `null`
  13044. * and `undefined` values. The sign of `-0` is preserved.
  13045. *
  13046. * @static
  13047. * @memberOf _
  13048. * @since 4.0.0
  13049. * @category Lang
  13050. * @param {*} value The value to process.
  13051. * @returns {string} Returns the string.
  13052. * @example
  13053. *
  13054. * _.toString(null);
  13055. * // => ''
  13056. *
  13057. * _.toString(-0);
  13058. * // => '-0'
  13059. *
  13060. * _.toString([1, 2, 3]);
  13061. * // => '1,2,3'
  13062. */
  13063. function toString(value) {
  13064. return value == null ? '' : baseToString(value);
  13065. }
  13066. /**
  13067. * Gets the value at `path` of `object`. If the resolved value is
  13068. * `undefined`, the `defaultValue` is returned in its place.
  13069. *
  13070. * @static
  13071. * @memberOf _
  13072. * @since 3.7.0
  13073. * @category Object
  13074. * @param {Object} object The object to query.
  13075. * @param {Array|string} path The path of the property to get.
  13076. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13077. * @returns {*} Returns the resolved value.
  13078. * @example
  13079. *
  13080. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13081. *
  13082. * _.get(object, 'a[0].b.c');
  13083. * // => 3
  13084. *
  13085. * _.get(object, ['a', '0', 'b', 'c']);
  13086. * // => 3
  13087. *
  13088. * _.get(object, 'a.b.c', 'default');
  13089. * // => 'default'
  13090. */
  13091. function get(object, path, defaultValue) {
  13092. var result = object == null ? undefined : baseGet(object, path);
  13093. return result === undefined ? defaultValue : result;
  13094. }
  13095. module.exports = get;
  13096. /***/ }),
  13097. /***/ 855:
  13098. /***/ (function(module, __unusedexports, __webpack_require__) {
  13099. module.exports = registerPlugin;
  13100. const factory = __webpack_require__(47);
  13101. function registerPlugin(plugins, pluginFunction) {
  13102. return factory(
  13103. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  13104. );
  13105. }
  13106. /***/ }),
  13107. /***/ 856:
  13108. /***/ (function(module, __unusedexports, __webpack_require__) {
  13109. module.exports = __webpack_require__(141);
  13110. /***/ }),
  13111. /***/ 863:
  13112. /***/ (function(module, __unusedexports, __webpack_require__) {
  13113. module.exports = authenticationBeforeRequest;
  13114. const btoa = __webpack_require__(675);
  13115. const withAuthorizationPrefix = __webpack_require__(143);
  13116. function authenticationBeforeRequest(state, options) {
  13117. if (typeof state.auth === "string") {
  13118. options.headers.authorization = withAuthorizationPrefix(state.auth);
  13119. return;
  13120. }
  13121. if (state.auth.username) {
  13122. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  13123. options.headers.authorization = `Basic ${hash}`;
  13124. if (state.otp) {
  13125. options.headers["x-github-otp"] = state.otp;
  13126. }
  13127. return;
  13128. }
  13129. if (state.auth.clientId) {
  13130. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  13131. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  13132. // URL though: `/applications/:client_id/tokens/:access_token`.
  13133. //
  13134. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  13135. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  13136. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  13137. //
  13138. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  13139. // as well as "/applications/123/tokens/token456"
  13140. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  13141. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  13142. options.headers.authorization = `Basic ${hash}`;
  13143. return;
  13144. }
  13145. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  13146. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  13147. return;
  13148. }
  13149. return Promise.resolve()
  13150. .then(() => {
  13151. return state.auth();
  13152. })
  13153. .then(authorization => {
  13154. options.headers.authorization = withAuthorizationPrefix(authorization);
  13155. });
  13156. }
  13157. /***/ }),
  13158. /***/ 866:
  13159. /***/ (function(module, __unusedexports, __webpack_require__) {
  13160. "use strict";
  13161. var shebangRegex = __webpack_require__(816);
  13162. module.exports = function (str) {
  13163. var match = str.match(shebangRegex);
  13164. if (!match) {
  13165. return null;
  13166. }
  13167. var arr = match[0].replace(/#! ?/, '').split(' ');
  13168. var bin = arr[0].split('/').pop();
  13169. var arg = arr[1];
  13170. return (bin === 'env' ?
  13171. arg :
  13172. bin + (arg ? ' ' + arg : '')
  13173. );
  13174. };
  13175. /***/ }),
  13176. /***/ 874:
  13177. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13178. "use strict";
  13179. // Copyright (c) Microsoft. All rights reserved.
  13180. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  13181. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13182. return new (P || (P = Promise))(function (resolve, reject) {
  13183. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13184. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13185. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  13186. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13187. });
  13188. };
  13189. Object.defineProperty(exports, "__esModule", { value: true });
  13190. const url = __webpack_require__(835);
  13191. const http = __webpack_require__(605);
  13192. const https = __webpack_require__(211);
  13193. let fs;
  13194. let tunnel;
  13195. var HttpCodes;
  13196. (function (HttpCodes) {
  13197. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  13198. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  13199. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  13200. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  13201. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  13202. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  13203. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  13204. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  13205. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  13206. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  13207. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  13208. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  13209. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  13210. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  13211. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  13212. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  13213. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  13214. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  13215. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  13216. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  13217. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  13218. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  13219. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  13220. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  13221. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  13222. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  13223. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  13224. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  13225. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  13226. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  13227. const ExponentialBackoffCeiling = 10;
  13228. const ExponentialBackoffTimeSlice = 5;
  13229. class HttpClientResponse {
  13230. constructor(message) {
  13231. this.message = message;
  13232. }
  13233. readBody() {
  13234. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  13235. let output = '';
  13236. this.message.on('data', (chunk) => {
  13237. output += chunk;
  13238. });
  13239. this.message.on('end', () => {
  13240. resolve(output);
  13241. });
  13242. }));
  13243. }
  13244. }
  13245. exports.HttpClientResponse = HttpClientResponse;
  13246. function isHttps(requestUrl) {
  13247. let parsedUrl = url.parse(requestUrl);
  13248. return parsedUrl.protocol === 'https:';
  13249. }
  13250. exports.isHttps = isHttps;
  13251. var EnvironmentVariables;
  13252. (function (EnvironmentVariables) {
  13253. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  13254. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  13255. })(EnvironmentVariables || (EnvironmentVariables = {}));
  13256. class HttpClient {
  13257. constructor(userAgent, handlers, requestOptions) {
  13258. this._ignoreSslError = false;
  13259. this._allowRedirects = true;
  13260. this._maxRedirects = 50;
  13261. this._allowRetries = false;
  13262. this._maxRetries = 1;
  13263. this._keepAlive = false;
  13264. this._disposed = false;
  13265. this.userAgent = userAgent;
  13266. this.handlers = handlers || [];
  13267. this.requestOptions = requestOptions;
  13268. if (requestOptions) {
  13269. if (requestOptions.ignoreSslError != null) {
  13270. this._ignoreSslError = requestOptions.ignoreSslError;
  13271. }
  13272. this._socketTimeout = requestOptions.socketTimeout;
  13273. this._httpProxy = requestOptions.proxy;
  13274. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  13275. this._httpProxyBypassHosts = [];
  13276. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  13277. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  13278. });
  13279. }
  13280. this._certConfig = requestOptions.cert;
  13281. if (this._certConfig) {
  13282. // If using cert, need fs
  13283. fs = __webpack_require__(747);
  13284. // cache the cert content into memory, so we don't have to read it from disk every time
  13285. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  13286. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  13287. }
  13288. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  13289. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  13290. }
  13291. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  13292. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  13293. }
  13294. }
  13295. if (requestOptions.allowRedirects != null) {
  13296. this._allowRedirects = requestOptions.allowRedirects;
  13297. }
  13298. if (requestOptions.maxRedirects != null) {
  13299. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  13300. }
  13301. if (requestOptions.keepAlive != null) {
  13302. this._keepAlive = requestOptions.keepAlive;
  13303. }
  13304. if (requestOptions.allowRetries != null) {
  13305. this._allowRetries = requestOptions.allowRetries;
  13306. }
  13307. if (requestOptions.maxRetries != null) {
  13308. this._maxRetries = requestOptions.maxRetries;
  13309. }
  13310. }
  13311. }
  13312. options(requestUrl, additionalHeaders) {
  13313. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  13314. }
  13315. get(requestUrl, additionalHeaders) {
  13316. return this.request('GET', requestUrl, null, additionalHeaders || {});
  13317. }
  13318. del(requestUrl, additionalHeaders) {
  13319. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  13320. }
  13321. post(requestUrl, data, additionalHeaders) {
  13322. return this.request('POST', requestUrl, data, additionalHeaders || {});
  13323. }
  13324. patch(requestUrl, data, additionalHeaders) {
  13325. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  13326. }
  13327. put(requestUrl, data, additionalHeaders) {
  13328. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  13329. }
  13330. head(requestUrl, additionalHeaders) {
  13331. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  13332. }
  13333. sendStream(verb, requestUrl, stream, additionalHeaders) {
  13334. return this.request(verb, requestUrl, stream, additionalHeaders);
  13335. }
  13336. /**
  13337. * Makes a raw http request.
  13338. * All other methods such as get, post, patch, and request ultimately call this.
  13339. * Prefer get, del, post and patch
  13340. */
  13341. request(verb, requestUrl, data, headers) {
  13342. return __awaiter(this, void 0, void 0, function* () {
  13343. if (this._disposed) {
  13344. throw new Error("Client has already been disposed.");
  13345. }
  13346. let info = this._prepareRequest(verb, requestUrl, headers);
  13347. // Only perform retries on reads since writes may not be idempotent.
  13348. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  13349. let numTries = 0;
  13350. let response;
  13351. while (numTries < maxTries) {
  13352. response = yield this.requestRaw(info, data);
  13353. // Check if it's an authentication challenge
  13354. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  13355. let authenticationHandler;
  13356. for (let i = 0; i < this.handlers.length; i++) {
  13357. if (this.handlers[i].canHandleAuthentication(response)) {
  13358. authenticationHandler = this.handlers[i];
  13359. break;
  13360. }
  13361. }
  13362. if (authenticationHandler) {
  13363. return authenticationHandler.handleAuthentication(this, info, data);
  13364. }
  13365. else {
  13366. // We have received an unauthorized response but have no handlers to handle it.
  13367. // Let the response return to the caller.
  13368. return response;
  13369. }
  13370. }
  13371. let redirectsRemaining = this._maxRedirects;
  13372. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  13373. && this._allowRedirects
  13374. && redirectsRemaining > 0) {
  13375. const redirectUrl = response.message.headers["location"];
  13376. if (!redirectUrl) {
  13377. // if there's no location to redirect to, we won't
  13378. break;
  13379. }
  13380. // we need to finish reading the response before reassigning response
  13381. // which will leak the open socket.
  13382. yield response.readBody();
  13383. // let's make the request with the new redirectUrl
  13384. info = this._prepareRequest(verb, redirectUrl, headers);
  13385. response = yield this.requestRaw(info, data);
  13386. redirectsRemaining--;
  13387. }
  13388. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  13389. // If not a retry code, return immediately instead of retrying
  13390. return response;
  13391. }
  13392. numTries += 1;
  13393. if (numTries < maxTries) {
  13394. yield response.readBody();
  13395. yield this._performExponentialBackoff(numTries);
  13396. }
  13397. }
  13398. return response;
  13399. });
  13400. }
  13401. /**
  13402. * Needs to be called if keepAlive is set to true in request options.
  13403. */
  13404. dispose() {
  13405. if (this._agent) {
  13406. this._agent.destroy();
  13407. }
  13408. this._disposed = true;
  13409. }
  13410. /**
  13411. * Raw request.
  13412. * @param info
  13413. * @param data
  13414. */
  13415. requestRaw(info, data) {
  13416. return new Promise((resolve, reject) => {
  13417. let callbackForResult = function (err, res) {
  13418. if (err) {
  13419. reject(err);
  13420. }
  13421. resolve(res);
  13422. };
  13423. this.requestRawWithCallback(info, data, callbackForResult);
  13424. });
  13425. }
  13426. /**
  13427. * Raw request with callback.
  13428. * @param info
  13429. * @param data
  13430. * @param onResult
  13431. */
  13432. requestRawWithCallback(info, data, onResult) {
  13433. let socket;
  13434. let isDataString = typeof (data) === 'string';
  13435. if (typeof (data) === 'string') {
  13436. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13437. }
  13438. let callbackCalled = false;
  13439. let handleResult = (err, res) => {
  13440. if (!callbackCalled) {
  13441. callbackCalled = true;
  13442. onResult(err, res);
  13443. }
  13444. };
  13445. let req = info.httpModule.request(info.options, (msg) => {
  13446. let res = new HttpClientResponse(msg);
  13447. handleResult(null, res);
  13448. });
  13449. req.on('socket', (sock) => {
  13450. socket = sock;
  13451. });
  13452. // If we ever get disconnected, we want the socket to timeout eventually
  13453. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13454. if (socket) {
  13455. socket.end();
  13456. }
  13457. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13458. });
  13459. req.on('error', function (err) {
  13460. // err has statusCode property
  13461. // res should have headers
  13462. handleResult(err, null);
  13463. });
  13464. if (data && typeof (data) === 'string') {
  13465. req.write(data, 'utf8');
  13466. }
  13467. if (data && typeof (data) !== 'string') {
  13468. data.on('close', function () {
  13469. req.end();
  13470. });
  13471. data.pipe(req);
  13472. }
  13473. else {
  13474. req.end();
  13475. }
  13476. }
  13477. _prepareRequest(method, requestUrl, headers) {
  13478. const info = {};
  13479. info.parsedUrl = url.parse(requestUrl);
  13480. const usingSsl = info.parsedUrl.protocol === 'https:';
  13481. info.httpModule = usingSsl ? https : http;
  13482. const defaultPort = usingSsl ? 443 : 80;
  13483. info.options = {};
  13484. info.options.host = info.parsedUrl.hostname;
  13485. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13486. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13487. info.options.method = method;
  13488. info.options.headers = this._mergeHeaders(headers);
  13489. info.options.headers["user-agent"] = this.userAgent;
  13490. info.options.agent = this._getAgent(requestUrl);
  13491. // gives handlers an opportunity to participate
  13492. if (this.handlers && !this._isPresigned(requestUrl)) {
  13493. this.handlers.forEach((handler) => {
  13494. handler.prepareRequest(info.options);
  13495. });
  13496. }
  13497. return info;
  13498. }
  13499. _isPresigned(requestUrl) {
  13500. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13501. const patterns = this.requestOptions.presignedUrlPatterns;
  13502. for (let i = 0; i < patterns.length; i++) {
  13503. if (requestUrl.match(patterns[i])) {
  13504. return true;
  13505. }
  13506. }
  13507. }
  13508. return false;
  13509. }
  13510. _mergeHeaders(headers) {
  13511. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13512. if (this.requestOptions && this.requestOptions.headers) {
  13513. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13514. }
  13515. return lowercaseKeys(headers || {});
  13516. }
  13517. _getAgent(requestUrl) {
  13518. let agent;
  13519. let proxy = this._getProxy(requestUrl);
  13520. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13521. if (this._keepAlive && useProxy) {
  13522. agent = this._proxyAgent;
  13523. }
  13524. if (this._keepAlive && !useProxy) {
  13525. agent = this._agent;
  13526. }
  13527. // if agent is already assigned use that agent.
  13528. if (!!agent) {
  13529. return agent;
  13530. }
  13531. let parsedUrl = url.parse(requestUrl);
  13532. const usingSsl = parsedUrl.protocol === 'https:';
  13533. let maxSockets = 100;
  13534. if (!!this.requestOptions) {
  13535. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13536. }
  13537. if (useProxy) {
  13538. // If using proxy, need tunnel
  13539. if (!tunnel) {
  13540. tunnel = __webpack_require__(856);
  13541. }
  13542. const agentOptions = {
  13543. maxSockets: maxSockets,
  13544. keepAlive: this._keepAlive,
  13545. proxy: {
  13546. proxyAuth: proxy.proxyAuth,
  13547. host: proxy.proxyUrl.hostname,
  13548. port: proxy.proxyUrl.port
  13549. },
  13550. };
  13551. let tunnelAgent;
  13552. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13553. if (usingSsl) {
  13554. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13555. }
  13556. else {
  13557. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13558. }
  13559. agent = tunnelAgent(agentOptions);
  13560. this._proxyAgent = agent;
  13561. }
  13562. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13563. if (this._keepAlive && !agent) {
  13564. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13565. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13566. this._agent = agent;
  13567. }
  13568. // if not using private agent and tunnel agent isn't setup then use global agent
  13569. if (!agent) {
  13570. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13571. }
  13572. if (usingSsl && this._ignoreSslError) {
  13573. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13574. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13575. // we have to cast it to any and change it directly
  13576. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13577. }
  13578. if (usingSsl && this._certConfig) {
  13579. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13580. }
  13581. return agent;
  13582. }
  13583. _getProxy(requestUrl) {
  13584. const parsedUrl = url.parse(requestUrl);
  13585. let usingSsl = parsedUrl.protocol === 'https:';
  13586. let proxyConfig = this._httpProxy;
  13587. // fallback to http_proxy and https_proxy env
  13588. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13589. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13590. if (!proxyConfig) {
  13591. if (https_proxy && usingSsl) {
  13592. proxyConfig = {
  13593. proxyUrl: https_proxy
  13594. };
  13595. }
  13596. else if (http_proxy) {
  13597. proxyConfig = {
  13598. proxyUrl: http_proxy
  13599. };
  13600. }
  13601. }
  13602. let proxyUrl;
  13603. let proxyAuth;
  13604. if (proxyConfig) {
  13605. if (proxyConfig.proxyUrl.length > 0) {
  13606. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13607. }
  13608. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13609. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13610. }
  13611. }
  13612. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13613. }
  13614. _isBypassProxy(requestUrl) {
  13615. if (!this._httpProxyBypassHosts) {
  13616. return false;
  13617. }
  13618. let bypass = false;
  13619. this._httpProxyBypassHosts.forEach(bypassHost => {
  13620. if (bypassHost.test(requestUrl)) {
  13621. bypass = true;
  13622. }
  13623. });
  13624. return bypass;
  13625. }
  13626. _performExponentialBackoff(retryNumber) {
  13627. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13628. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13629. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13630. }
  13631. }
  13632. exports.HttpClient = HttpClient;
  13633. /***/ }),
  13634. /***/ 881:
  13635. /***/ (function(module) {
  13636. "use strict";
  13637. const isWin = process.platform === 'win32';
  13638. function notFoundError(original, syscall) {
  13639. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13640. code: 'ENOENT',
  13641. errno: 'ENOENT',
  13642. syscall: `${syscall} ${original.command}`,
  13643. path: original.command,
  13644. spawnargs: original.args,
  13645. });
  13646. }
  13647. function hookChildProcess(cp, parsed) {
  13648. if (!isWin) {
  13649. return;
  13650. }
  13651. const originalEmit = cp.emit;
  13652. cp.emit = function (name, arg1) {
  13653. // If emitting "exit" event and exit code is 1, we need to check if
  13654. // the command exists and emit an "error" instead
  13655. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13656. if (name === 'exit') {
  13657. const err = verifyENOENT(arg1, parsed, 'spawn');
  13658. if (err) {
  13659. return originalEmit.call(cp, 'error', err);
  13660. }
  13661. }
  13662. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13663. };
  13664. }
  13665. function verifyENOENT(status, parsed) {
  13666. if (isWin && status === 1 && !parsed.file) {
  13667. return notFoundError(parsed.original, 'spawn');
  13668. }
  13669. return null;
  13670. }
  13671. function verifyENOENTSync(status, parsed) {
  13672. if (isWin && status === 1 && !parsed.file) {
  13673. return notFoundError(parsed.original, 'spawnSync');
  13674. }
  13675. return null;
  13676. }
  13677. module.exports = {
  13678. hookChildProcess,
  13679. verifyENOENT,
  13680. verifyENOENTSync,
  13681. notFoundError,
  13682. };
  13683. /***/ }),
  13684. /***/ 883:
  13685. /***/ (function(module) {
  13686. /**
  13687. * lodash (Custom Build) <https://lodash.com/>
  13688. * Build: `lodash modularize exports="npm" -o ./`
  13689. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13690. * Released under MIT license <https://lodash.com/license>
  13691. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13692. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13693. */
  13694. /** Used as the `TypeError` message for "Functions" methods. */
  13695. var FUNC_ERROR_TEXT = 'Expected a function';
  13696. /** Used to stand-in for `undefined` hash values. */
  13697. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13698. /** Used as references for various `Number` constants. */
  13699. var INFINITY = 1 / 0,
  13700. MAX_SAFE_INTEGER = 9007199254740991;
  13701. /** `Object#toString` result references. */
  13702. var funcTag = '[object Function]',
  13703. genTag = '[object GeneratorFunction]',
  13704. symbolTag = '[object Symbol]';
  13705. /** Used to match property names within property paths. */
  13706. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13707. reIsPlainProp = /^\w*$/,
  13708. reLeadingDot = /^\./,
  13709. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13710. /**
  13711. * Used to match `RegExp`
  13712. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13713. */
  13714. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13715. /** Used to match backslashes in property paths. */
  13716. var reEscapeChar = /\\(\\)?/g;
  13717. /** Used to detect host constructors (Safari). */
  13718. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13719. /** Used to detect unsigned integer values. */
  13720. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13721. /** Detect free variable `global` from Node.js. */
  13722. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13723. /** Detect free variable `self`. */
  13724. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13725. /** Used as a reference to the global object. */
  13726. var root = freeGlobal || freeSelf || Function('return this')();
  13727. /**
  13728. * Gets the value at `key` of `object`.
  13729. *
  13730. * @private
  13731. * @param {Object} [object] The object to query.
  13732. * @param {string} key The key of the property to get.
  13733. * @returns {*} Returns the property value.
  13734. */
  13735. function getValue(object, key) {
  13736. return object == null ? undefined : object[key];
  13737. }
  13738. /**
  13739. * Checks if `value` is a host object in IE < 9.
  13740. *
  13741. * @private
  13742. * @param {*} value The value to check.
  13743. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13744. */
  13745. function isHostObject(value) {
  13746. // Many host objects are `Object` objects that can coerce to strings
  13747. // despite having improperly defined `toString` methods.
  13748. var result = false;
  13749. if (value != null && typeof value.toString != 'function') {
  13750. try {
  13751. result = !!(value + '');
  13752. } catch (e) {}
  13753. }
  13754. return result;
  13755. }
  13756. /** Used for built-in method references. */
  13757. var arrayProto = Array.prototype,
  13758. funcProto = Function.prototype,
  13759. objectProto = Object.prototype;
  13760. /** Used to detect overreaching core-js shims. */
  13761. var coreJsData = root['__core-js_shared__'];
  13762. /** Used to detect methods masquerading as native. */
  13763. var maskSrcKey = (function() {
  13764. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  13765. return uid ? ('Symbol(src)_1.' + uid) : '';
  13766. }());
  13767. /** Used to resolve the decompiled source of functions. */
  13768. var funcToString = funcProto.toString;
  13769. /** Used to check objects for own properties. */
  13770. var hasOwnProperty = objectProto.hasOwnProperty;
  13771. /**
  13772. * Used to resolve the
  13773. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  13774. * of values.
  13775. */
  13776. var objectToString = objectProto.toString;
  13777. /** Used to detect if a method is native. */
  13778. var reIsNative = RegExp('^' +
  13779. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  13780. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  13781. );
  13782. /** Built-in value references. */
  13783. var Symbol = root.Symbol,
  13784. splice = arrayProto.splice;
  13785. /* Built-in method references that are verified to be native. */
  13786. var Map = getNative(root, 'Map'),
  13787. nativeCreate = getNative(Object, 'create');
  13788. /** Used to convert symbols to primitives and strings. */
  13789. var symbolProto = Symbol ? Symbol.prototype : undefined,
  13790. symbolToString = symbolProto ? symbolProto.toString : undefined;
  13791. /**
  13792. * Creates a hash object.
  13793. *
  13794. * @private
  13795. * @constructor
  13796. * @param {Array} [entries] The key-value pairs to cache.
  13797. */
  13798. function Hash(entries) {
  13799. var index = -1,
  13800. length = entries ? entries.length : 0;
  13801. this.clear();
  13802. while (++index < length) {
  13803. var entry = entries[index];
  13804. this.set(entry[0], entry[1]);
  13805. }
  13806. }
  13807. /**
  13808. * Removes all key-value entries from the hash.
  13809. *
  13810. * @private
  13811. * @name clear
  13812. * @memberOf Hash
  13813. */
  13814. function hashClear() {
  13815. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  13816. }
  13817. /**
  13818. * Removes `key` and its value from the hash.
  13819. *
  13820. * @private
  13821. * @name delete
  13822. * @memberOf Hash
  13823. * @param {Object} hash The hash to modify.
  13824. * @param {string} key The key of the value to remove.
  13825. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13826. */
  13827. function hashDelete(key) {
  13828. return this.has(key) && delete this.__data__[key];
  13829. }
  13830. /**
  13831. * Gets the hash value for `key`.
  13832. *
  13833. * @private
  13834. * @name get
  13835. * @memberOf Hash
  13836. * @param {string} key The key of the value to get.
  13837. * @returns {*} Returns the entry value.
  13838. */
  13839. function hashGet(key) {
  13840. var data = this.__data__;
  13841. if (nativeCreate) {
  13842. var result = data[key];
  13843. return result === HASH_UNDEFINED ? undefined : result;
  13844. }
  13845. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  13846. }
  13847. /**
  13848. * Checks if a hash value for `key` exists.
  13849. *
  13850. * @private
  13851. * @name has
  13852. * @memberOf Hash
  13853. * @param {string} key The key of the entry to check.
  13854. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13855. */
  13856. function hashHas(key) {
  13857. var data = this.__data__;
  13858. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  13859. }
  13860. /**
  13861. * Sets the hash `key` to `value`.
  13862. *
  13863. * @private
  13864. * @name set
  13865. * @memberOf Hash
  13866. * @param {string} key The key of the value to set.
  13867. * @param {*} value The value to set.
  13868. * @returns {Object} Returns the hash instance.
  13869. */
  13870. function hashSet(key, value) {
  13871. var data = this.__data__;
  13872. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  13873. return this;
  13874. }
  13875. // Add methods to `Hash`.
  13876. Hash.prototype.clear = hashClear;
  13877. Hash.prototype['delete'] = hashDelete;
  13878. Hash.prototype.get = hashGet;
  13879. Hash.prototype.has = hashHas;
  13880. Hash.prototype.set = hashSet;
  13881. /**
  13882. * Creates an list cache object.
  13883. *
  13884. * @private
  13885. * @constructor
  13886. * @param {Array} [entries] The key-value pairs to cache.
  13887. */
  13888. function ListCache(entries) {
  13889. var index = -1,
  13890. length = entries ? entries.length : 0;
  13891. this.clear();
  13892. while (++index < length) {
  13893. var entry = entries[index];
  13894. this.set(entry[0], entry[1]);
  13895. }
  13896. }
  13897. /**
  13898. * Removes all key-value entries from the list cache.
  13899. *
  13900. * @private
  13901. * @name clear
  13902. * @memberOf ListCache
  13903. */
  13904. function listCacheClear() {
  13905. this.__data__ = [];
  13906. }
  13907. /**
  13908. * Removes `key` and its value from the list cache.
  13909. *
  13910. * @private
  13911. * @name delete
  13912. * @memberOf ListCache
  13913. * @param {string} key The key of the value to remove.
  13914. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13915. */
  13916. function listCacheDelete(key) {
  13917. var data = this.__data__,
  13918. index = assocIndexOf(data, key);
  13919. if (index < 0) {
  13920. return false;
  13921. }
  13922. var lastIndex = data.length - 1;
  13923. if (index == lastIndex) {
  13924. data.pop();
  13925. } else {
  13926. splice.call(data, index, 1);
  13927. }
  13928. return true;
  13929. }
  13930. /**
  13931. * Gets the list cache value for `key`.
  13932. *
  13933. * @private
  13934. * @name get
  13935. * @memberOf ListCache
  13936. * @param {string} key The key of the value to get.
  13937. * @returns {*} Returns the entry value.
  13938. */
  13939. function listCacheGet(key) {
  13940. var data = this.__data__,
  13941. index = assocIndexOf(data, key);
  13942. return index < 0 ? undefined : data[index][1];
  13943. }
  13944. /**
  13945. * Checks if a list cache value for `key` exists.
  13946. *
  13947. * @private
  13948. * @name has
  13949. * @memberOf ListCache
  13950. * @param {string} key The key of the entry to check.
  13951. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13952. */
  13953. function listCacheHas(key) {
  13954. return assocIndexOf(this.__data__, key) > -1;
  13955. }
  13956. /**
  13957. * Sets the list cache `key` to `value`.
  13958. *
  13959. * @private
  13960. * @name set
  13961. * @memberOf ListCache
  13962. * @param {string} key The key of the value to set.
  13963. * @param {*} value The value to set.
  13964. * @returns {Object} Returns the list cache instance.
  13965. */
  13966. function listCacheSet(key, value) {
  13967. var data = this.__data__,
  13968. index = assocIndexOf(data, key);
  13969. if (index < 0) {
  13970. data.push([key, value]);
  13971. } else {
  13972. data[index][1] = value;
  13973. }
  13974. return this;
  13975. }
  13976. // Add methods to `ListCache`.
  13977. ListCache.prototype.clear = listCacheClear;
  13978. ListCache.prototype['delete'] = listCacheDelete;
  13979. ListCache.prototype.get = listCacheGet;
  13980. ListCache.prototype.has = listCacheHas;
  13981. ListCache.prototype.set = listCacheSet;
  13982. /**
  13983. * Creates a map cache object to store key-value pairs.
  13984. *
  13985. * @private
  13986. * @constructor
  13987. * @param {Array} [entries] The key-value pairs to cache.
  13988. */
  13989. function MapCache(entries) {
  13990. var index = -1,
  13991. length = entries ? entries.length : 0;
  13992. this.clear();
  13993. while (++index < length) {
  13994. var entry = entries[index];
  13995. this.set(entry[0], entry[1]);
  13996. }
  13997. }
  13998. /**
  13999. * Removes all key-value entries from the map.
  14000. *
  14001. * @private
  14002. * @name clear
  14003. * @memberOf MapCache
  14004. */
  14005. function mapCacheClear() {
  14006. this.__data__ = {
  14007. 'hash': new Hash,
  14008. 'map': new (Map || ListCache),
  14009. 'string': new Hash
  14010. };
  14011. }
  14012. /**
  14013. * Removes `key` and its value from the map.
  14014. *
  14015. * @private
  14016. * @name delete
  14017. * @memberOf MapCache
  14018. * @param {string} key The key of the value to remove.
  14019. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  14020. */
  14021. function mapCacheDelete(key) {
  14022. return getMapData(this, key)['delete'](key);
  14023. }
  14024. /**
  14025. * Gets the map value for `key`.
  14026. *
  14027. * @private
  14028. * @name get
  14029. * @memberOf MapCache
  14030. * @param {string} key The key of the value to get.
  14031. * @returns {*} Returns the entry value.
  14032. */
  14033. function mapCacheGet(key) {
  14034. return getMapData(this, key).get(key);
  14035. }
  14036. /**
  14037. * Checks if a map value for `key` exists.
  14038. *
  14039. * @private
  14040. * @name has
  14041. * @memberOf MapCache
  14042. * @param {string} key The key of the entry to check.
  14043. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14044. */
  14045. function mapCacheHas(key) {
  14046. return getMapData(this, key).has(key);
  14047. }
  14048. /**
  14049. * Sets the map `key` to `value`.
  14050. *
  14051. * @private
  14052. * @name set
  14053. * @memberOf MapCache
  14054. * @param {string} key The key of the value to set.
  14055. * @param {*} value The value to set.
  14056. * @returns {Object} Returns the map cache instance.
  14057. */
  14058. function mapCacheSet(key, value) {
  14059. getMapData(this, key).set(key, value);
  14060. return this;
  14061. }
  14062. // Add methods to `MapCache`.
  14063. MapCache.prototype.clear = mapCacheClear;
  14064. MapCache.prototype['delete'] = mapCacheDelete;
  14065. MapCache.prototype.get = mapCacheGet;
  14066. MapCache.prototype.has = mapCacheHas;
  14067. MapCache.prototype.set = mapCacheSet;
  14068. /**
  14069. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  14070. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14071. * for equality comparisons.
  14072. *
  14073. * @private
  14074. * @param {Object} object The object to modify.
  14075. * @param {string} key The key of the property to assign.
  14076. * @param {*} value The value to assign.
  14077. */
  14078. function assignValue(object, key, value) {
  14079. var objValue = object[key];
  14080. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  14081. (value === undefined && !(key in object))) {
  14082. object[key] = value;
  14083. }
  14084. }
  14085. /**
  14086. * Gets the index at which the `key` is found in `array` of key-value pairs.
  14087. *
  14088. * @private
  14089. * @param {Array} array The array to inspect.
  14090. * @param {*} key The key to search for.
  14091. * @returns {number} Returns the index of the matched value, else `-1`.
  14092. */
  14093. function assocIndexOf(array, key) {
  14094. var length = array.length;
  14095. while (length--) {
  14096. if (eq(array[length][0], key)) {
  14097. return length;
  14098. }
  14099. }
  14100. return -1;
  14101. }
  14102. /**
  14103. * The base implementation of `_.isNative` without bad shim checks.
  14104. *
  14105. * @private
  14106. * @param {*} value The value to check.
  14107. * @returns {boolean} Returns `true` if `value` is a native function,
  14108. * else `false`.
  14109. */
  14110. function baseIsNative(value) {
  14111. if (!isObject(value) || isMasked(value)) {
  14112. return false;
  14113. }
  14114. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  14115. return pattern.test(toSource(value));
  14116. }
  14117. /**
  14118. * The base implementation of `_.set`.
  14119. *
  14120. * @private
  14121. * @param {Object} object The object to modify.
  14122. * @param {Array|string} path The path of the property to set.
  14123. * @param {*} value The value to set.
  14124. * @param {Function} [customizer] The function to customize path creation.
  14125. * @returns {Object} Returns `object`.
  14126. */
  14127. function baseSet(object, path, value, customizer) {
  14128. if (!isObject(object)) {
  14129. return object;
  14130. }
  14131. path = isKey(path, object) ? [path] : castPath(path);
  14132. var index = -1,
  14133. length = path.length,
  14134. lastIndex = length - 1,
  14135. nested = object;
  14136. while (nested != null && ++index < length) {
  14137. var key = toKey(path[index]),
  14138. newValue = value;
  14139. if (index != lastIndex) {
  14140. var objValue = nested[key];
  14141. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  14142. if (newValue === undefined) {
  14143. newValue = isObject(objValue)
  14144. ? objValue
  14145. : (isIndex(path[index + 1]) ? [] : {});
  14146. }
  14147. }
  14148. assignValue(nested, key, newValue);
  14149. nested = nested[key];
  14150. }
  14151. return object;
  14152. }
  14153. /**
  14154. * The base implementation of `_.toString` which doesn't convert nullish
  14155. * values to empty strings.
  14156. *
  14157. * @private
  14158. * @param {*} value The value to process.
  14159. * @returns {string} Returns the string.
  14160. */
  14161. function baseToString(value) {
  14162. // Exit early for strings to avoid a performance hit in some environments.
  14163. if (typeof value == 'string') {
  14164. return value;
  14165. }
  14166. if (isSymbol(value)) {
  14167. return symbolToString ? symbolToString.call(value) : '';
  14168. }
  14169. var result = (value + '');
  14170. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14171. }
  14172. /**
  14173. * Casts `value` to a path array if it's not one.
  14174. *
  14175. * @private
  14176. * @param {*} value The value to inspect.
  14177. * @returns {Array} Returns the cast property path array.
  14178. */
  14179. function castPath(value) {
  14180. return isArray(value) ? value : stringToPath(value);
  14181. }
  14182. /**
  14183. * Gets the data for `map`.
  14184. *
  14185. * @private
  14186. * @param {Object} map The map to query.
  14187. * @param {string} key The reference key.
  14188. * @returns {*} Returns the map data.
  14189. */
  14190. function getMapData(map, key) {
  14191. var data = map.__data__;
  14192. return isKeyable(key)
  14193. ? data[typeof key == 'string' ? 'string' : 'hash']
  14194. : data.map;
  14195. }
  14196. /**
  14197. * Gets the native function at `key` of `object`.
  14198. *
  14199. * @private
  14200. * @param {Object} object The object to query.
  14201. * @param {string} key The key of the method to get.
  14202. * @returns {*} Returns the function if it's native, else `undefined`.
  14203. */
  14204. function getNative(object, key) {
  14205. var value = getValue(object, key);
  14206. return baseIsNative(value) ? value : undefined;
  14207. }
  14208. /**
  14209. * Checks if `value` is a valid array-like index.
  14210. *
  14211. * @private
  14212. * @param {*} value The value to check.
  14213. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  14214. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  14215. */
  14216. function isIndex(value, length) {
  14217. length = length == null ? MAX_SAFE_INTEGER : length;
  14218. return !!length &&
  14219. (typeof value == 'number' || reIsUint.test(value)) &&
  14220. (value > -1 && value % 1 == 0 && value < length);
  14221. }
  14222. /**
  14223. * Checks if `value` is a property name and not a property path.
  14224. *
  14225. * @private
  14226. * @param {*} value The value to check.
  14227. * @param {Object} [object] The object to query keys on.
  14228. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  14229. */
  14230. function isKey(value, object) {
  14231. if (isArray(value)) {
  14232. return false;
  14233. }
  14234. var type = typeof value;
  14235. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  14236. value == null || isSymbol(value)) {
  14237. return true;
  14238. }
  14239. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  14240. (object != null && value in Object(object));
  14241. }
  14242. /**
  14243. * Checks if `value` is suitable for use as unique object key.
  14244. *
  14245. * @private
  14246. * @param {*} value The value to check.
  14247. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  14248. */
  14249. function isKeyable(value) {
  14250. var type = typeof value;
  14251. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  14252. ? (value !== '__proto__')
  14253. : (value === null);
  14254. }
  14255. /**
  14256. * Checks if `func` has its source masked.
  14257. *
  14258. * @private
  14259. * @param {Function} func The function to check.
  14260. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  14261. */
  14262. function isMasked(func) {
  14263. return !!maskSrcKey && (maskSrcKey in func);
  14264. }
  14265. /**
  14266. * Converts `string` to a property path array.
  14267. *
  14268. * @private
  14269. * @param {string} string The string to convert.
  14270. * @returns {Array} Returns the property path array.
  14271. */
  14272. var stringToPath = memoize(function(string) {
  14273. string = toString(string);
  14274. var result = [];
  14275. if (reLeadingDot.test(string)) {
  14276. result.push('');
  14277. }
  14278. string.replace(rePropName, function(match, number, quote, string) {
  14279. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  14280. });
  14281. return result;
  14282. });
  14283. /**
  14284. * Converts `value` to a string key if it's not a string or symbol.
  14285. *
  14286. * @private
  14287. * @param {*} value The value to inspect.
  14288. * @returns {string|symbol} Returns the key.
  14289. */
  14290. function toKey(value) {
  14291. if (typeof value == 'string' || isSymbol(value)) {
  14292. return value;
  14293. }
  14294. var result = (value + '');
  14295. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14296. }
  14297. /**
  14298. * Converts `func` to its source code.
  14299. *
  14300. * @private
  14301. * @param {Function} func The function to process.
  14302. * @returns {string} Returns the source code.
  14303. */
  14304. function toSource(func) {
  14305. if (func != null) {
  14306. try {
  14307. return funcToString.call(func);
  14308. } catch (e) {}
  14309. try {
  14310. return (func + '');
  14311. } catch (e) {}
  14312. }
  14313. return '';
  14314. }
  14315. /**
  14316. * Creates a function that memoizes the result of `func`. If `resolver` is
  14317. * provided, it determines the cache key for storing the result based on the
  14318. * arguments provided to the memoized function. By default, the first argument
  14319. * provided to the memoized function is used as the map cache key. The `func`
  14320. * is invoked with the `this` binding of the memoized function.
  14321. *
  14322. * **Note:** The cache is exposed as the `cache` property on the memoized
  14323. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  14324. * constructor with one whose instances implement the
  14325. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  14326. * method interface of `delete`, `get`, `has`, and `set`.
  14327. *
  14328. * @static
  14329. * @memberOf _
  14330. * @since 0.1.0
  14331. * @category Function
  14332. * @param {Function} func The function to have its output memoized.
  14333. * @param {Function} [resolver] The function to resolve the cache key.
  14334. * @returns {Function} Returns the new memoized function.
  14335. * @example
  14336. *
  14337. * var object = { 'a': 1, 'b': 2 };
  14338. * var other = { 'c': 3, 'd': 4 };
  14339. *
  14340. * var values = _.memoize(_.values);
  14341. * values(object);
  14342. * // => [1, 2]
  14343. *
  14344. * values(other);
  14345. * // => [3, 4]
  14346. *
  14347. * object.a = 2;
  14348. * values(object);
  14349. * // => [1, 2]
  14350. *
  14351. * // Modify the result cache.
  14352. * values.cache.set(object, ['a', 'b']);
  14353. * values(object);
  14354. * // => ['a', 'b']
  14355. *
  14356. * // Replace `_.memoize.Cache`.
  14357. * _.memoize.Cache = WeakMap;
  14358. */
  14359. function memoize(func, resolver) {
  14360. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  14361. throw new TypeError(FUNC_ERROR_TEXT);
  14362. }
  14363. var memoized = function() {
  14364. var args = arguments,
  14365. key = resolver ? resolver.apply(this, args) : args[0],
  14366. cache = memoized.cache;
  14367. if (cache.has(key)) {
  14368. return cache.get(key);
  14369. }
  14370. var result = func.apply(this, args);
  14371. memoized.cache = cache.set(key, result);
  14372. return result;
  14373. };
  14374. memoized.cache = new (memoize.Cache || MapCache);
  14375. return memoized;
  14376. }
  14377. // Assign cache to `_.memoize`.
  14378. memoize.Cache = MapCache;
  14379. /**
  14380. * Performs a
  14381. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14382. * comparison between two values to determine if they are equivalent.
  14383. *
  14384. * @static
  14385. * @memberOf _
  14386. * @since 4.0.0
  14387. * @category Lang
  14388. * @param {*} value The value to compare.
  14389. * @param {*} other The other value to compare.
  14390. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  14391. * @example
  14392. *
  14393. * var object = { 'a': 1 };
  14394. * var other = { 'a': 1 };
  14395. *
  14396. * _.eq(object, object);
  14397. * // => true
  14398. *
  14399. * _.eq(object, other);
  14400. * // => false
  14401. *
  14402. * _.eq('a', 'a');
  14403. * // => true
  14404. *
  14405. * _.eq('a', Object('a'));
  14406. * // => false
  14407. *
  14408. * _.eq(NaN, NaN);
  14409. * // => true
  14410. */
  14411. function eq(value, other) {
  14412. return value === other || (value !== value && other !== other);
  14413. }
  14414. /**
  14415. * Checks if `value` is classified as an `Array` object.
  14416. *
  14417. * @static
  14418. * @memberOf _
  14419. * @since 0.1.0
  14420. * @category Lang
  14421. * @param {*} value The value to check.
  14422. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14423. * @example
  14424. *
  14425. * _.isArray([1, 2, 3]);
  14426. * // => true
  14427. *
  14428. * _.isArray(document.body.children);
  14429. * // => false
  14430. *
  14431. * _.isArray('abc');
  14432. * // => false
  14433. *
  14434. * _.isArray(_.noop);
  14435. * // => false
  14436. */
  14437. var isArray = Array.isArray;
  14438. /**
  14439. * Checks if `value` is classified as a `Function` object.
  14440. *
  14441. * @static
  14442. * @memberOf _
  14443. * @since 0.1.0
  14444. * @category Lang
  14445. * @param {*} value The value to check.
  14446. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14447. * @example
  14448. *
  14449. * _.isFunction(_);
  14450. * // => true
  14451. *
  14452. * _.isFunction(/abc/);
  14453. * // => false
  14454. */
  14455. function isFunction(value) {
  14456. // The use of `Object#toString` avoids issues with the `typeof` operator
  14457. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14458. var tag = isObject(value) ? objectToString.call(value) : '';
  14459. return tag == funcTag || tag == genTag;
  14460. }
  14461. /**
  14462. * Checks if `value` is the
  14463. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14464. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14465. *
  14466. * @static
  14467. * @memberOf _
  14468. * @since 0.1.0
  14469. * @category Lang
  14470. * @param {*} value The value to check.
  14471. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14472. * @example
  14473. *
  14474. * _.isObject({});
  14475. * // => true
  14476. *
  14477. * _.isObject([1, 2, 3]);
  14478. * // => true
  14479. *
  14480. * _.isObject(_.noop);
  14481. * // => true
  14482. *
  14483. * _.isObject(null);
  14484. * // => false
  14485. */
  14486. function isObject(value) {
  14487. var type = typeof value;
  14488. return !!value && (type == 'object' || type == 'function');
  14489. }
  14490. /**
  14491. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14492. * and has a `typeof` result of "object".
  14493. *
  14494. * @static
  14495. * @memberOf _
  14496. * @since 4.0.0
  14497. * @category Lang
  14498. * @param {*} value The value to check.
  14499. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14500. * @example
  14501. *
  14502. * _.isObjectLike({});
  14503. * // => true
  14504. *
  14505. * _.isObjectLike([1, 2, 3]);
  14506. * // => true
  14507. *
  14508. * _.isObjectLike(_.noop);
  14509. * // => false
  14510. *
  14511. * _.isObjectLike(null);
  14512. * // => false
  14513. */
  14514. function isObjectLike(value) {
  14515. return !!value && typeof value == 'object';
  14516. }
  14517. /**
  14518. * Checks if `value` is classified as a `Symbol` primitive or object.
  14519. *
  14520. * @static
  14521. * @memberOf _
  14522. * @since 4.0.0
  14523. * @category Lang
  14524. * @param {*} value The value to check.
  14525. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14526. * @example
  14527. *
  14528. * _.isSymbol(Symbol.iterator);
  14529. * // => true
  14530. *
  14531. * _.isSymbol('abc');
  14532. * // => false
  14533. */
  14534. function isSymbol(value) {
  14535. return typeof value == 'symbol' ||
  14536. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14537. }
  14538. /**
  14539. * Converts `value` to a string. An empty string is returned for `null`
  14540. * and `undefined` values. The sign of `-0` is preserved.
  14541. *
  14542. * @static
  14543. * @memberOf _
  14544. * @since 4.0.0
  14545. * @category Lang
  14546. * @param {*} value The value to process.
  14547. * @returns {string} Returns the string.
  14548. * @example
  14549. *
  14550. * _.toString(null);
  14551. * // => ''
  14552. *
  14553. * _.toString(-0);
  14554. * // => '-0'
  14555. *
  14556. * _.toString([1, 2, 3]);
  14557. * // => '1,2,3'
  14558. */
  14559. function toString(value) {
  14560. return value == null ? '' : baseToString(value);
  14561. }
  14562. /**
  14563. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14564. * it's created. Arrays are created for missing index properties while objects
  14565. * are created for all other missing properties. Use `_.setWith` to customize
  14566. * `path` creation.
  14567. *
  14568. * **Note:** This method mutates `object`.
  14569. *
  14570. * @static
  14571. * @memberOf _
  14572. * @since 3.7.0
  14573. * @category Object
  14574. * @param {Object} object The object to modify.
  14575. * @param {Array|string} path The path of the property to set.
  14576. * @param {*} value The value to set.
  14577. * @returns {Object} Returns `object`.
  14578. * @example
  14579. *
  14580. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14581. *
  14582. * _.set(object, 'a[0].b.c', 4);
  14583. * console.log(object.a[0].b.c);
  14584. * // => 4
  14585. *
  14586. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14587. * console.log(object.x[0].y.z);
  14588. * // => 5
  14589. */
  14590. function set(object, path, value) {
  14591. return object == null ? object : baseSet(object, path, value);
  14592. }
  14593. module.exports = set;
  14594. /***/ }),
  14595. /***/ 898:
  14596. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14597. "use strict";
  14598. Object.defineProperty(exports, '__esModule', { value: true });
  14599. var request = __webpack_require__(753);
  14600. var universalUserAgent = __webpack_require__(796);
  14601. const VERSION = "4.3.1";
  14602. class GraphqlError extends Error {
  14603. constructor(request, response) {
  14604. const message = response.data.errors[0].message;
  14605. super(message);
  14606. Object.assign(this, response.data);
  14607. this.name = "GraphqlError";
  14608. this.request = request; // Maintains proper stack trace (only available on V8)
  14609. /* istanbul ignore next */
  14610. if (Error.captureStackTrace) {
  14611. Error.captureStackTrace(this, this.constructor);
  14612. }
  14613. }
  14614. }
  14615. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14616. function graphql(request, query, options) {
  14617. options = typeof query === "string" ? options = Object.assign({
  14618. query
  14619. }, options) : options = query;
  14620. const requestOptions = Object.keys(options).reduce((result, key) => {
  14621. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14622. result[key] = options[key];
  14623. return result;
  14624. }
  14625. if (!result.variables) {
  14626. result.variables = {};
  14627. }
  14628. result.variables[key] = options[key];
  14629. return result;
  14630. }, {});
  14631. return request(requestOptions).then(response => {
  14632. if (response.data.errors) {
  14633. throw new GraphqlError(requestOptions, {
  14634. data: response.data
  14635. });
  14636. }
  14637. return response.data.data;
  14638. });
  14639. }
  14640. function withDefaults(request$1, newDefaults) {
  14641. const newRequest = request$1.defaults(newDefaults);
  14642. const newApi = (query, options) => {
  14643. return graphql(newRequest, query, options);
  14644. };
  14645. return Object.assign(newApi, {
  14646. defaults: withDefaults.bind(null, newRequest),
  14647. endpoint: request.request.endpoint
  14648. });
  14649. }
  14650. const graphql$1 = withDefaults(request.request, {
  14651. headers: {
  14652. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14653. },
  14654. method: "POST",
  14655. url: "/graphql"
  14656. });
  14657. function withCustomRequest(customRequest) {
  14658. return withDefaults(customRequest, {
  14659. method: "POST",
  14660. url: "/graphql"
  14661. });
  14662. }
  14663. exports.graphql = graphql$1;
  14664. exports.withCustomRequest = withCustomRequest;
  14665. //# sourceMappingURL=index.js.map
  14666. /***/ }),
  14667. /***/ 899:
  14668. /***/ (function(module, __unusedexports, __webpack_require__) {
  14669. module.exports = registerEndpoints;
  14670. const { Deprecation } = __webpack_require__(692);
  14671. function registerEndpoints(octokit, routes) {
  14672. Object.keys(routes).forEach(namespaceName => {
  14673. if (!octokit[namespaceName]) {
  14674. octokit[namespaceName] = {};
  14675. }
  14676. Object.keys(routes[namespaceName]).forEach(apiName => {
  14677. const apiOptions = routes[namespaceName][apiName];
  14678. const endpointDefaults = ["method", "url", "headers"].reduce(
  14679. (map, key) => {
  14680. if (typeof apiOptions[key] !== "undefined") {
  14681. map[key] = apiOptions[key];
  14682. }
  14683. return map;
  14684. },
  14685. {}
  14686. );
  14687. endpointDefaults.request = {
  14688. validate: apiOptions.params
  14689. };
  14690. let request = octokit.request.defaults(endpointDefaults);
  14691. // patch request & endpoint methods to support deprecated parameters.
  14692. // Not the most elegant solution, but we don’t want to move deprecation
  14693. // logic into octokit/endpoint.js as it’s out of scope
  14694. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14695. key => apiOptions.params[key].deprecated
  14696. );
  14697. if (hasDeprecatedParam) {
  14698. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14699. request = patch(
  14700. octokit.request.defaults(endpointDefaults),
  14701. `.${namespaceName}.${apiName}()`
  14702. );
  14703. request.endpoint = patch(
  14704. request.endpoint,
  14705. `.${namespaceName}.${apiName}.endpoint()`
  14706. );
  14707. request.endpoint.merge = patch(
  14708. request.endpoint.merge,
  14709. `.${namespaceName}.${apiName}.endpoint.merge()`
  14710. );
  14711. }
  14712. if (apiOptions.deprecated) {
  14713. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14714. octokit.log.warn(
  14715. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14716. );
  14717. octokit[namespaceName][apiName] = request;
  14718. return request.apply(null, arguments);
  14719. };
  14720. return;
  14721. }
  14722. octokit[namespaceName][apiName] = request;
  14723. });
  14724. });
  14725. }
  14726. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14727. const patchedMethod = options => {
  14728. options = Object.assign({}, options);
  14729. Object.keys(options).forEach(key => {
  14730. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14731. const aliasKey = apiOptions.params[key].alias;
  14732. octokit.log.warn(
  14733. new Deprecation(
  14734. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14735. )
  14736. );
  14737. if (!(aliasKey in options)) {
  14738. options[aliasKey] = options[key];
  14739. }
  14740. delete options[key];
  14741. }
  14742. });
  14743. return method(options);
  14744. };
  14745. Object.keys(method).forEach(key => {
  14746. patchedMethod[key] = method[key];
  14747. });
  14748. return patchedMethod;
  14749. }
  14750. /***/ }),
  14751. /***/ 929:
  14752. /***/ (function(module, __unusedexports, __webpack_require__) {
  14753. module.exports = hasNextPage
  14754. const deprecate = __webpack_require__(370)
  14755. const getPageLinks = __webpack_require__(577)
  14756. function hasNextPage (link) {
  14757. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  14758. return getPageLinks(link).next
  14759. }
  14760. /***/ }),
  14761. /***/ 948:
  14762. /***/ (function(module) {
  14763. "use strict";
  14764. /**
  14765. * Tries to execute a function and discards any error that occurs.
  14766. * @param {Function} fn - Function that might or might not throw an error.
  14767. * @returns {?*} Return-value of the function when no error occurred.
  14768. */
  14769. module.exports = function(fn) {
  14770. try { return fn() } catch (e) {}
  14771. }
  14772. /***/ }),
  14773. /***/ 950:
  14774. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14775. "use strict";
  14776. Object.defineProperty(exports, "__esModule", { value: true });
  14777. const url = __webpack_require__(835);
  14778. function getProxyUrl(reqUrl) {
  14779. let usingSsl = reqUrl.protocol === 'https:';
  14780. let proxyUrl;
  14781. if (checkBypass(reqUrl)) {
  14782. return proxyUrl;
  14783. }
  14784. let proxyVar;
  14785. if (usingSsl) {
  14786. proxyVar = process.env["https_proxy"] ||
  14787. process.env["HTTPS_PROXY"];
  14788. }
  14789. else {
  14790. proxyVar = process.env["http_proxy"] ||
  14791. process.env["HTTP_PROXY"];
  14792. }
  14793. if (proxyVar) {
  14794. proxyUrl = url.parse(proxyVar);
  14795. }
  14796. return proxyUrl;
  14797. }
  14798. exports.getProxyUrl = getProxyUrl;
  14799. function checkBypass(reqUrl) {
  14800. if (!reqUrl.hostname) {
  14801. return false;
  14802. }
  14803. let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
  14804. if (!noProxy) {
  14805. return false;
  14806. }
  14807. // Determine the request port
  14808. let reqPort;
  14809. if (reqUrl.port) {
  14810. reqPort = Number(reqUrl.port);
  14811. }
  14812. else if (reqUrl.protocol === 'http:') {
  14813. reqPort = 80;
  14814. }
  14815. else if (reqUrl.protocol === 'https:') {
  14816. reqPort = 443;
  14817. }
  14818. // Format the request hostname and hostname with port
  14819. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  14820. if (typeof reqPort === 'number') {
  14821. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  14822. }
  14823. // Compare request host against noproxy
  14824. for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
  14825. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  14826. return true;
  14827. }
  14828. }
  14829. return false;
  14830. }
  14831. exports.checkBypass = checkBypass;
  14832. /***/ }),
  14833. /***/ 954:
  14834. /***/ (function(module) {
  14835. module.exports = validateAuth;
  14836. function validateAuth(auth) {
  14837. if (typeof auth === "string") {
  14838. return;
  14839. }
  14840. if (typeof auth === "function") {
  14841. return;
  14842. }
  14843. if (auth.username && auth.password) {
  14844. return;
  14845. }
  14846. if (auth.clientId && auth.clientSecret) {
  14847. return;
  14848. }
  14849. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  14850. }
  14851. /***/ }),
  14852. /***/ 955:
  14853. /***/ (function(module, __unusedexports, __webpack_require__) {
  14854. "use strict";
  14855. const path = __webpack_require__(622);
  14856. const childProcess = __webpack_require__(129);
  14857. const crossSpawn = __webpack_require__(20);
  14858. const stripEof = __webpack_require__(768);
  14859. const npmRunPath = __webpack_require__(621);
  14860. const isStream = __webpack_require__(323);
  14861. const _getStream = __webpack_require__(145);
  14862. const pFinally = __webpack_require__(697);
  14863. const onExit = __webpack_require__(260);
  14864. const errname = __webpack_require__(427);
  14865. const stdio = __webpack_require__(168);
  14866. const TEN_MEGABYTES = 1000 * 1000 * 10;
  14867. function handleArgs(cmd, args, opts) {
  14868. let parsed;
  14869. opts = Object.assign({
  14870. extendEnv: true,
  14871. env: {}
  14872. }, opts);
  14873. if (opts.extendEnv) {
  14874. opts.env = Object.assign({}, process.env, opts.env);
  14875. }
  14876. if (opts.__winShell === true) {
  14877. delete opts.__winShell;
  14878. parsed = {
  14879. command: cmd,
  14880. args,
  14881. options: opts,
  14882. file: cmd,
  14883. original: {
  14884. cmd,
  14885. args
  14886. }
  14887. };
  14888. } else {
  14889. parsed = crossSpawn._parse(cmd, args, opts);
  14890. }
  14891. opts = Object.assign({
  14892. maxBuffer: TEN_MEGABYTES,
  14893. buffer: true,
  14894. stripEof: true,
  14895. preferLocal: true,
  14896. localDir: parsed.options.cwd || process.cwd(),
  14897. encoding: 'utf8',
  14898. reject: true,
  14899. cleanup: true
  14900. }, parsed.options);
  14901. opts.stdio = stdio(opts);
  14902. if (opts.preferLocal) {
  14903. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  14904. }
  14905. if (opts.detached) {
  14906. // #115
  14907. opts.cleanup = false;
  14908. }
  14909. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  14910. // #116
  14911. parsed.args.unshift('/q');
  14912. }
  14913. return {
  14914. cmd: parsed.command,
  14915. args: parsed.args,
  14916. opts,
  14917. parsed
  14918. };
  14919. }
  14920. function handleInput(spawned, input) {
  14921. if (input === null || input === undefined) {
  14922. return;
  14923. }
  14924. if (isStream(input)) {
  14925. input.pipe(spawned.stdin);
  14926. } else {
  14927. spawned.stdin.end(input);
  14928. }
  14929. }
  14930. function handleOutput(opts, val) {
  14931. if (val && opts.stripEof) {
  14932. val = stripEof(val);
  14933. }
  14934. return val;
  14935. }
  14936. function handleShell(fn, cmd, opts) {
  14937. let file = '/bin/sh';
  14938. let args = ['-c', cmd];
  14939. opts = Object.assign({}, opts);
  14940. if (process.platform === 'win32') {
  14941. opts.__winShell = true;
  14942. file = process.env.comspec || 'cmd.exe';
  14943. args = ['/s', '/c', `"${cmd}"`];
  14944. opts.windowsVerbatimArguments = true;
  14945. }
  14946. if (opts.shell) {
  14947. file = opts.shell;
  14948. delete opts.shell;
  14949. }
  14950. return fn(file, args, opts);
  14951. }
  14952. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  14953. if (!process[stream]) {
  14954. return null;
  14955. }
  14956. let ret;
  14957. if (!buffer) {
  14958. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  14959. ret = new Promise((resolve, reject) => {
  14960. process[stream]
  14961. .once('end', resolve)
  14962. .once('error', reject);
  14963. });
  14964. } else if (encoding) {
  14965. ret = _getStream(process[stream], {
  14966. encoding,
  14967. maxBuffer
  14968. });
  14969. } else {
  14970. ret = _getStream.buffer(process[stream], {maxBuffer});
  14971. }
  14972. return ret.catch(err => {
  14973. err.stream = stream;
  14974. err.message = `${stream} ${err.message}`;
  14975. throw err;
  14976. });
  14977. }
  14978. function makeError(result, options) {
  14979. const {stdout, stderr} = result;
  14980. let err = result.error;
  14981. const {code, signal} = result;
  14982. const {parsed, joinedCmd} = options;
  14983. const timedOut = options.timedOut || false;
  14984. if (!err) {
  14985. let output = '';
  14986. if (Array.isArray(parsed.opts.stdio)) {
  14987. if (parsed.opts.stdio[2] !== 'inherit') {
  14988. output += output.length > 0 ? stderr : `\n${stderr}`;
  14989. }
  14990. if (parsed.opts.stdio[1] !== 'inherit') {
  14991. output += `\n${stdout}`;
  14992. }
  14993. } else if (parsed.opts.stdio !== 'inherit') {
  14994. output = `\n${stderr}${stdout}`;
  14995. }
  14996. err = new Error(`Command failed: ${joinedCmd}${output}`);
  14997. err.code = code < 0 ? errname(code) : code;
  14998. }
  14999. err.stdout = stdout;
  15000. err.stderr = stderr;
  15001. err.failed = true;
  15002. err.signal = signal || null;
  15003. err.cmd = joinedCmd;
  15004. err.timedOut = timedOut;
  15005. return err;
  15006. }
  15007. function joinCmd(cmd, args) {
  15008. let joinedCmd = cmd;
  15009. if (Array.isArray(args) && args.length > 0) {
  15010. joinedCmd += ' ' + args.join(' ');
  15011. }
  15012. return joinedCmd;
  15013. }
  15014. module.exports = (cmd, args, opts) => {
  15015. const parsed = handleArgs(cmd, args, opts);
  15016. const {encoding, buffer, maxBuffer} = parsed.opts;
  15017. const joinedCmd = joinCmd(cmd, args);
  15018. let spawned;
  15019. try {
  15020. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  15021. } catch (err) {
  15022. return Promise.reject(err);
  15023. }
  15024. let removeExitHandler;
  15025. if (parsed.opts.cleanup) {
  15026. removeExitHandler = onExit(() => {
  15027. spawned.kill();
  15028. });
  15029. }
  15030. let timeoutId = null;
  15031. let timedOut = false;
  15032. const cleanup = () => {
  15033. if (timeoutId) {
  15034. clearTimeout(timeoutId);
  15035. timeoutId = null;
  15036. }
  15037. if (removeExitHandler) {
  15038. removeExitHandler();
  15039. }
  15040. };
  15041. if (parsed.opts.timeout > 0) {
  15042. timeoutId = setTimeout(() => {
  15043. timeoutId = null;
  15044. timedOut = true;
  15045. spawned.kill(parsed.opts.killSignal);
  15046. }, parsed.opts.timeout);
  15047. }
  15048. const processDone = new Promise(resolve => {
  15049. spawned.on('exit', (code, signal) => {
  15050. cleanup();
  15051. resolve({code, signal});
  15052. });
  15053. spawned.on('error', err => {
  15054. cleanup();
  15055. resolve({error: err});
  15056. });
  15057. if (spawned.stdin) {
  15058. spawned.stdin.on('error', err => {
  15059. cleanup();
  15060. resolve({error: err});
  15061. });
  15062. }
  15063. });
  15064. function destroy() {
  15065. if (spawned.stdout) {
  15066. spawned.stdout.destroy();
  15067. }
  15068. if (spawned.stderr) {
  15069. spawned.stderr.destroy();
  15070. }
  15071. }
  15072. const handlePromise = () => pFinally(Promise.all([
  15073. processDone,
  15074. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  15075. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  15076. ]).then(arr => {
  15077. const result = arr[0];
  15078. result.stdout = arr[1];
  15079. result.stderr = arr[2];
  15080. if (result.error || result.code !== 0 || result.signal !== null) {
  15081. const err = makeError(result, {
  15082. joinedCmd,
  15083. parsed,
  15084. timedOut
  15085. });
  15086. // TODO: missing some timeout logic for killed
  15087. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  15088. // err.killed = spawned.killed || killed;
  15089. err.killed = err.killed || spawned.killed;
  15090. if (!parsed.opts.reject) {
  15091. return err;
  15092. }
  15093. throw err;
  15094. }
  15095. return {
  15096. stdout: handleOutput(parsed.opts, result.stdout),
  15097. stderr: handleOutput(parsed.opts, result.stderr),
  15098. code: 0,
  15099. failed: false,
  15100. killed: false,
  15101. signal: null,
  15102. cmd: joinedCmd,
  15103. timedOut: false
  15104. };
  15105. }), destroy);
  15106. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  15107. handleInput(spawned, parsed.opts.input);
  15108. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  15109. spawned.catch = onrejected => handlePromise().catch(onrejected);
  15110. return spawned;
  15111. };
  15112. // TODO: set `stderr: 'ignore'` when that option is implemented
  15113. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  15114. // TODO: set `stdout: 'ignore'` when that option is implemented
  15115. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  15116. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  15117. module.exports.sync = (cmd, args, opts) => {
  15118. const parsed = handleArgs(cmd, args, opts);
  15119. const joinedCmd = joinCmd(cmd, args);
  15120. if (isStream(parsed.opts.input)) {
  15121. throw new TypeError('The `input` option cannot be a stream in sync mode');
  15122. }
  15123. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  15124. result.code = result.status;
  15125. if (result.error || result.status !== 0 || result.signal !== null) {
  15126. const err = makeError(result, {
  15127. joinedCmd,
  15128. parsed
  15129. });
  15130. if (!parsed.opts.reject) {
  15131. return err;
  15132. }
  15133. throw err;
  15134. }
  15135. return {
  15136. stdout: handleOutput(parsed.opts, result.stdout),
  15137. stderr: handleOutput(parsed.opts, result.stderr),
  15138. code: 0,
  15139. failed: false,
  15140. signal: null,
  15141. cmd: joinedCmd,
  15142. timedOut: false
  15143. };
  15144. };
  15145. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  15146. /***/ }),
  15147. /***/ 966:
  15148. /***/ (function(module, __unusedexports, __webpack_require__) {
  15149. "use strict";
  15150. const {PassThrough} = __webpack_require__(413);
  15151. module.exports = options => {
  15152. options = Object.assign({}, options);
  15153. const {array} = options;
  15154. let {encoding} = options;
  15155. const buffer = encoding === 'buffer';
  15156. let objectMode = false;
  15157. if (array) {
  15158. objectMode = !(encoding || buffer);
  15159. } else {
  15160. encoding = encoding || 'utf8';
  15161. }
  15162. if (buffer) {
  15163. encoding = null;
  15164. }
  15165. let len = 0;
  15166. const ret = [];
  15167. const stream = new PassThrough({objectMode});
  15168. if (encoding) {
  15169. stream.setEncoding(encoding);
  15170. }
  15171. stream.on('data', chunk => {
  15172. ret.push(chunk);
  15173. if (objectMode) {
  15174. len = ret.length;
  15175. } else {
  15176. len += chunk.length;
  15177. }
  15178. });
  15179. stream.getBufferedValue = () => {
  15180. if (array) {
  15181. return ret;
  15182. }
  15183. return buffer ? Buffer.concat(ret, len) : ret.join('');
  15184. };
  15185. stream.getBufferedLength = () => len;
  15186. return stream;
  15187. };
  15188. /***/ }),
  15189. /***/ 969:
  15190. /***/ (function(module, __unusedexports, __webpack_require__) {
  15191. var wrappy = __webpack_require__(11)
  15192. module.exports = wrappy(once)
  15193. module.exports.strict = wrappy(onceStrict)
  15194. once.proto = once(function () {
  15195. Object.defineProperty(Function.prototype, 'once', {
  15196. value: function () {
  15197. return once(this)
  15198. },
  15199. configurable: true
  15200. })
  15201. Object.defineProperty(Function.prototype, 'onceStrict', {
  15202. value: function () {
  15203. return onceStrict(this)
  15204. },
  15205. configurable: true
  15206. })
  15207. })
  15208. function once (fn) {
  15209. var f = function () {
  15210. if (f.called) return f.value
  15211. f.called = true
  15212. return f.value = fn.apply(this, arguments)
  15213. }
  15214. f.called = false
  15215. return f
  15216. }
  15217. function onceStrict (fn) {
  15218. var f = function () {
  15219. if (f.called)
  15220. throw new Error(f.onceError)
  15221. f.called = true
  15222. return f.value = fn.apply(this, arguments)
  15223. }
  15224. var name = fn.name || 'Function wrapped with `once`'
  15225. f.onceError = name + " shouldn't be called more than once"
  15226. f.called = false
  15227. return f
  15228. }
  15229. /***/ }),
  15230. /***/ 986:
  15231. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  15232. "use strict";
  15233. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  15234. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  15235. return new (P || (P = Promise))(function (resolve, reject) {
  15236. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  15237. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  15238. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  15239. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15240. });
  15241. };
  15242. Object.defineProperty(exports, "__esModule", { value: true });
  15243. const tr = __webpack_require__(9);
  15244. /**
  15245. * Exec a command.
  15246. * Output will be streamed to the live console.
  15247. * Returns promise with return code
  15248. *
  15249. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  15250. * @param args optional arguments for tool. Escaping is handled by the lib.
  15251. * @param options optional exec options. See ExecOptions
  15252. * @returns Promise<number> exit code
  15253. */
  15254. function exec(commandLine, args, options) {
  15255. return __awaiter(this, void 0, void 0, function* () {
  15256. const commandArgs = tr.argStringToArray(commandLine);
  15257. if (commandArgs.length === 0) {
  15258. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  15259. }
  15260. // Path to tool to execute should be first arg
  15261. const toolPath = commandArgs[0];
  15262. args = commandArgs.slice(1).concat(args || []);
  15263. const runner = new tr.ToolRunner(toolPath, args, options);
  15264. return runner.exec();
  15265. });
  15266. }
  15267. exports.exec = exec;
  15268. //# sourceMappingURL=exec.js.map
  15269. /***/ }),
  15270. /***/ 991:
  15271. /***/ (function(module, __unusedexports, __webpack_require__) {
  15272. module.exports = authenticationRequestError;
  15273. const { RequestError } = __webpack_require__(463);
  15274. function authenticationRequestError(state, error, options) {
  15275. if (!error.headers) throw error;
  15276. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  15277. // handle "2FA required" error only
  15278. if (error.status !== 401 || !otpRequired) {
  15279. throw error;
  15280. }
  15281. if (
  15282. error.status === 401 &&
  15283. otpRequired &&
  15284. error.request &&
  15285. error.request.headers["x-github-otp"]
  15286. ) {
  15287. if (state.otp) {
  15288. delete state.otp; // no longer valid, request again
  15289. } else {
  15290. throw new RequestError(
  15291. "Invalid one-time password for two-factor authentication",
  15292. 401,
  15293. {
  15294. headers: error.headers,
  15295. request: options
  15296. }
  15297. );
  15298. }
  15299. }
  15300. if (typeof state.auth.on2fa !== "function") {
  15301. throw new RequestError(
  15302. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  15303. 401,
  15304. {
  15305. headers: error.headers,
  15306. request: options
  15307. }
  15308. );
  15309. }
  15310. return Promise.resolve()
  15311. .then(() => {
  15312. return state.auth.on2fa();
  15313. })
  15314. .then(oneTimePassword => {
  15315. const newOptions = Object.assign(options, {
  15316. headers: Object.assign(options.headers, {
  15317. "x-github-otp": oneTimePassword
  15318. })
  15319. });
  15320. return state.octokit.request(newOptions).then(response => {
  15321. // If OTP still valid, then persist it for following requests
  15322. state.otp = oneTimePassword;
  15323. return response;
  15324. });
  15325. });
  15326. }
  15327. /***/ })
  15328. /******/ });