index.js 674 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635
  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. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5166. return;
  5167. }
  5168. // Save state for POST action
  5169. stateHelper.setRepositoryPath(settings.repositoryPath);
  5170. // Initialize the repository
  5171. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5172. yield git.init();
  5173. yield git.remoteAdd('origin', repositoryUrl);
  5174. }
  5175. // Disable automatic garbage collection
  5176. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5177. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5178. }
  5179. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5180. try {
  5181. // Configure auth
  5182. yield authHelper.configureAuth();
  5183. // LFS install
  5184. if (settings.lfs) {
  5185. yield git.lfsInstall();
  5186. }
  5187. // Fetch
  5188. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5189. yield git.fetch(settings.fetchDepth, refSpec);
  5190. // Checkout info
  5191. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5192. // LFS fetch
  5193. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5194. // Explicit lfs fetch will fetch lfs objects in parallel.
  5195. if (settings.lfs) {
  5196. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5197. }
  5198. // Checkout
  5199. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5200. // Submodules
  5201. if (settings.submodules) {
  5202. try {
  5203. // Temporarily override global config
  5204. yield authHelper.configureGlobalAuth();
  5205. // Checkout submodules
  5206. yield git.submoduleSync(settings.nestedSubmodules);
  5207. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5208. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5209. // Persist credentials
  5210. if (settings.persistCredentials) {
  5211. yield authHelper.configureSubmoduleAuth();
  5212. }
  5213. }
  5214. finally {
  5215. // Remove temporary global config override
  5216. yield authHelper.removeGlobalAuth();
  5217. }
  5218. }
  5219. // Dump some info about the checked out commit
  5220. yield git.log1();
  5221. }
  5222. finally {
  5223. // Remove auth
  5224. if (!settings.persistCredentials) {
  5225. yield authHelper.removeAuth();
  5226. }
  5227. }
  5228. });
  5229. }
  5230. exports.getSource = getSource;
  5231. function cleanup(repositoryPath) {
  5232. return __awaiter(this, void 0, void 0, function* () {
  5233. // Repo exists?
  5234. if (!repositoryPath ||
  5235. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5236. return;
  5237. }
  5238. let git;
  5239. try {
  5240. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5241. }
  5242. catch (_a) {
  5243. return;
  5244. }
  5245. // Remove auth
  5246. const authHelper = gitAuthHelper.createAuthHelper(git);
  5247. yield authHelper.removeAuth();
  5248. });
  5249. }
  5250. exports.cleanup = cleanup;
  5251. function getGitCommandManager(settings) {
  5252. return __awaiter(this, void 0, void 0, function* () {
  5253. core.info(`Working directory is '${settings.repositoryPath}'`);
  5254. try {
  5255. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5256. }
  5257. catch (err) {
  5258. // Git is required for LFS
  5259. if (settings.lfs) {
  5260. throw err;
  5261. }
  5262. // Otherwise fallback to REST API
  5263. return undefined;
  5264. }
  5265. });
  5266. }
  5267. /***/ }),
  5268. /***/ 294:
  5269. /***/ (function(module, __unusedexports, __webpack_require__) {
  5270. module.exports = parseOptions;
  5271. const { Deprecation } = __webpack_require__(692);
  5272. const { getUserAgent } = __webpack_require__(796);
  5273. const once = __webpack_require__(969);
  5274. const pkg = __webpack_require__(215);
  5275. const deprecateOptionsTimeout = once((log, deprecation) =>
  5276. log.warn(deprecation)
  5277. );
  5278. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5279. const deprecateOptionsHeaders = once((log, deprecation) =>
  5280. log.warn(deprecation)
  5281. );
  5282. function parseOptions(options, log, hook) {
  5283. if (options.headers) {
  5284. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5285. newObj[key.toLowerCase()] = options.headers[key];
  5286. return newObj;
  5287. }, {});
  5288. }
  5289. const clientDefaults = {
  5290. headers: options.headers || {},
  5291. request: options.request || {},
  5292. mediaType: {
  5293. previews: [],
  5294. format: ""
  5295. }
  5296. };
  5297. if (options.baseUrl) {
  5298. clientDefaults.baseUrl = options.baseUrl;
  5299. }
  5300. if (options.userAgent) {
  5301. clientDefaults.headers["user-agent"] = options.userAgent;
  5302. }
  5303. if (options.previews) {
  5304. clientDefaults.mediaType.previews = options.previews;
  5305. }
  5306. if (options.timeZone) {
  5307. clientDefaults.headers["time-zone"] = options.timeZone;
  5308. }
  5309. if (options.timeout) {
  5310. deprecateOptionsTimeout(
  5311. log,
  5312. new Deprecation(
  5313. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5314. )
  5315. );
  5316. clientDefaults.request.timeout = options.timeout;
  5317. }
  5318. if (options.agent) {
  5319. deprecateOptionsAgent(
  5320. log,
  5321. new Deprecation(
  5322. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5323. )
  5324. );
  5325. clientDefaults.request.agent = options.agent;
  5326. }
  5327. if (options.headers) {
  5328. deprecateOptionsHeaders(
  5329. log,
  5330. new Deprecation(
  5331. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5332. )
  5333. );
  5334. }
  5335. const userAgentOption = clientDefaults.headers["user-agent"];
  5336. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5337. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5338. .filter(Boolean)
  5339. .join(" ");
  5340. clientDefaults.request.hook = hook.bind(null, "request");
  5341. return clientDefaults;
  5342. }
  5343. /***/ }),
  5344. /***/ 297:
  5345. /***/ (function(module) {
  5346. module.exports = class HttpError extends Error {
  5347. constructor (message, code, headers) {
  5348. super(message)
  5349. // Maintains proper stack trace (only available on V8)
  5350. /* istanbul ignore next */
  5351. if (Error.captureStackTrace) {
  5352. Error.captureStackTrace(this, this.constructor)
  5353. }
  5354. this.name = 'HttpError'
  5355. this.code = code
  5356. this.headers = headers
  5357. }
  5358. }
  5359. /***/ }),
  5360. /***/ 301:
  5361. /***/ (function(module, __unusedexports, __webpack_require__) {
  5362. /**
  5363. * Some “list” response that can be paginated have a different response structure
  5364. *
  5365. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5366. * /installation/repositories also has `repository_selection`), as well as a key with
  5367. * the list of the items which name varies from endpoint to endpoint:
  5368. *
  5369. * - https://developer.github.com/v3/search/#example (key `items`)
  5370. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5371. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5372. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5373. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5374. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5375. *
  5376. * Octokit normalizes these responses so that paginated results are always returned following
  5377. * the same structure. One challenge is that if the list response has only one page, no Link
  5378. * header is provided, so this header alone is not sufficient to check wether a response is
  5379. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5380. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5381. * property because it also exists in the response of Get the combined status for a specific ref.
  5382. */
  5383. module.exports = normalizePaginatedListResponse;
  5384. const { Deprecation } = __webpack_require__(692);
  5385. const once = __webpack_require__(969);
  5386. const deprecateIncompleteResults = once((log, deprecation) =>
  5387. log.warn(deprecation)
  5388. );
  5389. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5390. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5391. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5392. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5393. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5394. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5395. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5396. function normalizePaginatedListResponse(octokit, url, response) {
  5397. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5398. if (
  5399. !REGEX_IS_SEARCH_PATH.test(path) &&
  5400. !REGEX_IS_CHECKS_PATH.test(path) &&
  5401. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5402. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5403. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5404. ) {
  5405. return;
  5406. }
  5407. // keep the additional properties intact to avoid a breaking change,
  5408. // but log a deprecation warning when accessed
  5409. const incompleteResults = response.data.incomplete_results;
  5410. const repositorySelection = response.data.repository_selection;
  5411. const totalCount = response.data.total_count;
  5412. delete response.data.incomplete_results;
  5413. delete response.data.repository_selection;
  5414. delete response.data.total_count;
  5415. const namespaceKey = Object.keys(response.data)[0];
  5416. response.data = response.data[namespaceKey];
  5417. Object.defineProperty(response.data, namespaceKey, {
  5418. get() {
  5419. deprecateNamespace(
  5420. octokit.log,
  5421. new Deprecation(
  5422. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5423. )
  5424. );
  5425. return response.data;
  5426. }
  5427. });
  5428. if (typeof incompleteResults !== "undefined") {
  5429. Object.defineProperty(response.data, "incomplete_results", {
  5430. get() {
  5431. deprecateIncompleteResults(
  5432. octokit.log,
  5433. new Deprecation(
  5434. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5435. )
  5436. );
  5437. return incompleteResults;
  5438. }
  5439. });
  5440. }
  5441. if (typeof repositorySelection !== "undefined") {
  5442. Object.defineProperty(response.data, "repository_selection", {
  5443. get() {
  5444. deprecateTotalCount(
  5445. octokit.log,
  5446. new Deprecation(
  5447. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5448. )
  5449. );
  5450. return repositorySelection;
  5451. }
  5452. });
  5453. }
  5454. Object.defineProperty(response.data, "total_count", {
  5455. get() {
  5456. deprecateTotalCount(
  5457. octokit.log,
  5458. new Deprecation(
  5459. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5460. )
  5461. );
  5462. return totalCount;
  5463. }
  5464. });
  5465. }
  5466. /***/ }),
  5467. /***/ 323:
  5468. /***/ (function(module) {
  5469. "use strict";
  5470. var isStream = module.exports = function (stream) {
  5471. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5472. };
  5473. isStream.writable = function (stream) {
  5474. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5475. };
  5476. isStream.readable = function (stream) {
  5477. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5478. };
  5479. isStream.duplex = function (stream) {
  5480. return isStream.writable(stream) && isStream.readable(stream);
  5481. };
  5482. isStream.transform = function (stream) {
  5483. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5484. };
  5485. /***/ }),
  5486. /***/ 335:
  5487. /***/ (function(module, __unusedexports, __webpack_require__) {
  5488. module.exports = __webpack_require__(179);
  5489. /***/ }),
  5490. /***/ 336:
  5491. /***/ (function(module, __unusedexports, __webpack_require__) {
  5492. module.exports = hasLastPage
  5493. const deprecate = __webpack_require__(370)
  5494. const getPageLinks = __webpack_require__(577)
  5495. function hasLastPage (link) {
  5496. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5497. return getPageLinks(link).last
  5498. }
  5499. /***/ }),
  5500. /***/ 348:
  5501. /***/ (function(module, __unusedexports, __webpack_require__) {
  5502. "use strict";
  5503. module.exports = validate;
  5504. const { RequestError } = __webpack_require__(463);
  5505. const get = __webpack_require__(854);
  5506. const set = __webpack_require__(883);
  5507. function validate(octokit, options) {
  5508. if (!options.request.validate) {
  5509. return;
  5510. }
  5511. const { validate: params } = options.request;
  5512. Object.keys(params).forEach(parameterName => {
  5513. const parameter = get(params, parameterName);
  5514. const expectedType = parameter.type;
  5515. let parentParameterName;
  5516. let parentValue;
  5517. let parentParamIsPresent = true;
  5518. let parentParameterIsArray = false;
  5519. if (/\./.test(parameterName)) {
  5520. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5521. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5522. if (parentParameterIsArray) {
  5523. parentParameterName = parentParameterName.slice(0, -2);
  5524. }
  5525. parentValue = get(options, parentParameterName);
  5526. parentParamIsPresent =
  5527. parentParameterName === "headers" ||
  5528. (typeof parentValue === "object" && parentValue !== null);
  5529. }
  5530. const values = parentParameterIsArray
  5531. ? (get(options, parentParameterName) || []).map(
  5532. value => value[parameterName.split(/\./).pop()]
  5533. )
  5534. : [get(options, parameterName)];
  5535. values.forEach((value, i) => {
  5536. const valueIsPresent = typeof value !== "undefined";
  5537. const valueIsNull = value === null;
  5538. const currentParameterName = parentParameterIsArray
  5539. ? parameterName.replace(/\[\]/, `[${i}]`)
  5540. : parameterName;
  5541. if (!parameter.required && !valueIsPresent) {
  5542. return;
  5543. }
  5544. // if the parent parameter is of type object but allows null
  5545. // then the child parameters can be ignored
  5546. if (!parentParamIsPresent) {
  5547. return;
  5548. }
  5549. if (parameter.allowNull && valueIsNull) {
  5550. return;
  5551. }
  5552. if (!parameter.allowNull && valueIsNull) {
  5553. throw new RequestError(
  5554. `'${currentParameterName}' cannot be null`,
  5555. 400,
  5556. {
  5557. request: options
  5558. }
  5559. );
  5560. }
  5561. if (parameter.required && !valueIsPresent) {
  5562. throw new RequestError(
  5563. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5564. value
  5565. )}`,
  5566. 400,
  5567. {
  5568. request: options
  5569. }
  5570. );
  5571. }
  5572. // parse to integer before checking for enum
  5573. // so that string "1" will match enum with number 1
  5574. if (expectedType === "integer") {
  5575. const unparsedValue = value;
  5576. value = parseInt(value, 10);
  5577. if (isNaN(value)) {
  5578. throw new RequestError(
  5579. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5580. unparsedValue
  5581. )} is NaN`,
  5582. 400,
  5583. {
  5584. request: options
  5585. }
  5586. );
  5587. }
  5588. }
  5589. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5590. throw new RequestError(
  5591. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5592. value
  5593. )}`,
  5594. 400,
  5595. {
  5596. request: options
  5597. }
  5598. );
  5599. }
  5600. if (parameter.validation) {
  5601. const regex = new RegExp(parameter.validation);
  5602. if (!regex.test(value)) {
  5603. throw new RequestError(
  5604. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5605. value
  5606. )}`,
  5607. 400,
  5608. {
  5609. request: options
  5610. }
  5611. );
  5612. }
  5613. }
  5614. if (expectedType === "object" && typeof value === "string") {
  5615. try {
  5616. value = JSON.parse(value);
  5617. } catch (exception) {
  5618. throw new RequestError(
  5619. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5620. value
  5621. )}`,
  5622. 400,
  5623. {
  5624. request: options
  5625. }
  5626. );
  5627. }
  5628. }
  5629. set(options, parameter.mapTo || currentParameterName, value);
  5630. });
  5631. });
  5632. return options;
  5633. }
  5634. /***/ }),
  5635. /***/ 349:
  5636. /***/ (function(module, __unusedexports, __webpack_require__) {
  5637. module.exports = authenticationRequestError;
  5638. const { RequestError } = __webpack_require__(463);
  5639. function authenticationRequestError(state, error, options) {
  5640. /* istanbul ignore next */
  5641. if (!error.headers) throw error;
  5642. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5643. // handle "2FA required" error only
  5644. if (error.status !== 401 || !otpRequired) {
  5645. throw error;
  5646. }
  5647. if (
  5648. error.status === 401 &&
  5649. otpRequired &&
  5650. error.request &&
  5651. error.request.headers["x-github-otp"]
  5652. ) {
  5653. throw new RequestError(
  5654. "Invalid one-time password for two-factor authentication",
  5655. 401,
  5656. {
  5657. headers: error.headers,
  5658. request: options
  5659. }
  5660. );
  5661. }
  5662. if (typeof state.auth.on2fa !== "function") {
  5663. throw new RequestError(
  5664. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5665. 401,
  5666. {
  5667. headers: error.headers,
  5668. request: options
  5669. }
  5670. );
  5671. }
  5672. return Promise.resolve()
  5673. .then(() => {
  5674. return state.auth.on2fa();
  5675. })
  5676. .then(oneTimePassword => {
  5677. const newOptions = Object.assign(options, {
  5678. headers: Object.assign(
  5679. { "x-github-otp": oneTimePassword },
  5680. options.headers
  5681. )
  5682. });
  5683. return state.octokit.request(newOptions);
  5684. });
  5685. }
  5686. /***/ }),
  5687. /***/ 357:
  5688. /***/ (function(module) {
  5689. module.exports = require("assert");
  5690. /***/ }),
  5691. /***/ 363:
  5692. /***/ (function(module) {
  5693. module.exports = register
  5694. function register (state, name, method, options) {
  5695. if (typeof method !== 'function') {
  5696. throw new Error('method for before hook must be a function')
  5697. }
  5698. if (!options) {
  5699. options = {}
  5700. }
  5701. if (Array.isArray(name)) {
  5702. return name.reverse().reduce(function (callback, name) {
  5703. return register.bind(null, state, name, callback, options)
  5704. }, method)()
  5705. }
  5706. return Promise.resolve()
  5707. .then(function () {
  5708. if (!state.registry[name]) {
  5709. return method(options)
  5710. }
  5711. return (state.registry[name]).reduce(function (method, registered) {
  5712. return registered.hook.bind(null, method, options)
  5713. }, method)()
  5714. })
  5715. }
  5716. /***/ }),
  5717. /***/ 368:
  5718. /***/ (function(module) {
  5719. module.exports = function atob(str) {
  5720. return Buffer.from(str, 'base64').toString('binary')
  5721. }
  5722. /***/ }),
  5723. /***/ 370:
  5724. /***/ (function(module) {
  5725. module.exports = deprecate
  5726. const loggedMessages = {}
  5727. function deprecate (message) {
  5728. if (loggedMessages[message]) {
  5729. return
  5730. }
  5731. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5732. loggedMessages[message] = 1
  5733. }
  5734. /***/ }),
  5735. /***/ 372:
  5736. /***/ (function(module) {
  5737. module.exports = octokitDebug;
  5738. function octokitDebug(octokit) {
  5739. octokit.hook.wrap("request", (request, options) => {
  5740. octokit.log.debug("request", options);
  5741. const start = Date.now();
  5742. const requestOptions = octokit.request.endpoint.parse(options);
  5743. const path = requestOptions.url.replace(options.baseUrl, "");
  5744. return request(options)
  5745. .then(response => {
  5746. octokit.log.info(
  5747. `${requestOptions.method} ${path} - ${
  5748. response.status
  5749. } in ${Date.now() - start}ms`
  5750. );
  5751. return response;
  5752. })
  5753. .catch(error => {
  5754. octokit.log.info(
  5755. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5756. start}ms`
  5757. );
  5758. throw error;
  5759. });
  5760. });
  5761. }
  5762. /***/ }),
  5763. /***/ 385:
  5764. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5765. "use strict";
  5766. Object.defineProperty(exports, '__esModule', { value: true });
  5767. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5768. var isPlainObject = _interopDefault(__webpack_require__(696));
  5769. var universalUserAgent = __webpack_require__(796);
  5770. function lowercaseKeys(object) {
  5771. if (!object) {
  5772. return {};
  5773. }
  5774. return Object.keys(object).reduce((newObj, key) => {
  5775. newObj[key.toLowerCase()] = object[key];
  5776. return newObj;
  5777. }, {});
  5778. }
  5779. function mergeDeep(defaults, options) {
  5780. const result = Object.assign({}, defaults);
  5781. Object.keys(options).forEach(key => {
  5782. if (isPlainObject(options[key])) {
  5783. if (!(key in defaults)) Object.assign(result, {
  5784. [key]: options[key]
  5785. });else result[key] = mergeDeep(defaults[key], options[key]);
  5786. } else {
  5787. Object.assign(result, {
  5788. [key]: options[key]
  5789. });
  5790. }
  5791. });
  5792. return result;
  5793. }
  5794. function merge(defaults, route, options) {
  5795. if (typeof route === "string") {
  5796. let [method, url] = route.split(" ");
  5797. options = Object.assign(url ? {
  5798. method,
  5799. url
  5800. } : {
  5801. url: method
  5802. }, options);
  5803. } else {
  5804. options = Object.assign({}, route);
  5805. } // lowercase header names before merging with defaults to avoid duplicates
  5806. options.headers = lowercaseKeys(options.headers);
  5807. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5808. if (defaults && defaults.mediaType.previews.length) {
  5809. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5810. }
  5811. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5812. return mergedOptions;
  5813. }
  5814. function addQueryParameters(url, parameters) {
  5815. const separator = /\?/.test(url) ? "&" : "?";
  5816. const names = Object.keys(parameters);
  5817. if (names.length === 0) {
  5818. return url;
  5819. }
  5820. return url + separator + names.map(name => {
  5821. if (name === "q") {
  5822. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5823. }
  5824. return `${name}=${encodeURIComponent(parameters[name])}`;
  5825. }).join("&");
  5826. }
  5827. const urlVariableRegex = /\{[^}]+\}/g;
  5828. function removeNonChars(variableName) {
  5829. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5830. }
  5831. function extractUrlVariableNames(url) {
  5832. const matches = url.match(urlVariableRegex);
  5833. if (!matches) {
  5834. return [];
  5835. }
  5836. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5837. }
  5838. function omit(object, keysToOmit) {
  5839. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5840. obj[key] = object[key];
  5841. return obj;
  5842. }, {});
  5843. }
  5844. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5845. // TODO: create separate package.
  5846. //
  5847. // Copyright (c) 2012-2014, Bram Stein
  5848. // All rights reserved.
  5849. // Redistribution and use in source and binary forms, with or without
  5850. // modification, are permitted provided that the following conditions
  5851. // are met:
  5852. // 1. Redistributions of source code must retain the above copyright
  5853. // notice, this list of conditions and the following disclaimer.
  5854. // 2. Redistributions in binary form must reproduce the above copyright
  5855. // notice, this list of conditions and the following disclaimer in the
  5856. // documentation and/or other materials provided with the distribution.
  5857. // 3. The name of the author may not be used to endorse or promote products
  5858. // derived from this software without specific prior written permission.
  5859. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5860. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5861. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5862. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5863. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5864. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5865. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5866. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5867. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5868. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5869. /* istanbul ignore file */
  5870. function encodeReserved(str) {
  5871. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5872. if (!/%[0-9A-Fa-f]/.test(part)) {
  5873. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5874. }
  5875. return part;
  5876. }).join("");
  5877. }
  5878. function encodeUnreserved(str) {
  5879. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5880. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5881. });
  5882. }
  5883. function encodeValue(operator, value, key) {
  5884. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5885. if (key) {
  5886. return encodeUnreserved(key) + "=" + value;
  5887. } else {
  5888. return value;
  5889. }
  5890. }
  5891. function isDefined(value) {
  5892. return value !== undefined && value !== null;
  5893. }
  5894. function isKeyOperator(operator) {
  5895. return operator === ";" || operator === "&" || operator === "?";
  5896. }
  5897. function getValues(context, operator, key, modifier) {
  5898. var value = context[key],
  5899. result = [];
  5900. if (isDefined(value) && value !== "") {
  5901. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5902. value = value.toString();
  5903. if (modifier && modifier !== "*") {
  5904. value = value.substring(0, parseInt(modifier, 10));
  5905. }
  5906. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5907. } else {
  5908. if (modifier === "*") {
  5909. if (Array.isArray(value)) {
  5910. value.filter(isDefined).forEach(function (value) {
  5911. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5912. });
  5913. } else {
  5914. Object.keys(value).forEach(function (k) {
  5915. if (isDefined(value[k])) {
  5916. result.push(encodeValue(operator, value[k], k));
  5917. }
  5918. });
  5919. }
  5920. } else {
  5921. const tmp = [];
  5922. if (Array.isArray(value)) {
  5923. value.filter(isDefined).forEach(function (value) {
  5924. tmp.push(encodeValue(operator, value));
  5925. });
  5926. } else {
  5927. Object.keys(value).forEach(function (k) {
  5928. if (isDefined(value[k])) {
  5929. tmp.push(encodeUnreserved(k));
  5930. tmp.push(encodeValue(operator, value[k].toString()));
  5931. }
  5932. });
  5933. }
  5934. if (isKeyOperator(operator)) {
  5935. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5936. } else if (tmp.length !== 0) {
  5937. result.push(tmp.join(","));
  5938. }
  5939. }
  5940. }
  5941. } else {
  5942. if (operator === ";") {
  5943. if (isDefined(value)) {
  5944. result.push(encodeUnreserved(key));
  5945. }
  5946. } else if (value === "" && (operator === "&" || operator === "?")) {
  5947. result.push(encodeUnreserved(key) + "=");
  5948. } else if (value === "") {
  5949. result.push("");
  5950. }
  5951. }
  5952. return result;
  5953. }
  5954. function parseUrl(template) {
  5955. return {
  5956. expand: expand.bind(null, template)
  5957. };
  5958. }
  5959. function expand(template, context) {
  5960. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5961. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5962. if (expression) {
  5963. let operator = "";
  5964. const values = [];
  5965. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5966. operator = expression.charAt(0);
  5967. expression = expression.substr(1);
  5968. }
  5969. expression.split(/,/g).forEach(function (variable) {
  5970. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5971. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5972. });
  5973. if (operator && operator !== "+") {
  5974. var separator = ",";
  5975. if (operator === "?") {
  5976. separator = "&";
  5977. } else if (operator !== "#") {
  5978. separator = operator;
  5979. }
  5980. return (values.length !== 0 ? operator : "") + values.join(separator);
  5981. } else {
  5982. return values.join(",");
  5983. }
  5984. } else {
  5985. return encodeReserved(literal);
  5986. }
  5987. });
  5988. }
  5989. function parse(options) {
  5990. // https://fetch.spec.whatwg.org/#methods
  5991. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5992. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5993. let headers = Object.assign({}, options.headers);
  5994. let body;
  5995. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5996. const urlVariableNames = extractUrlVariableNames(url);
  5997. url = parseUrl(url).expand(parameters);
  5998. if (!/^http/.test(url)) {
  5999. url = options.baseUrl + url;
  6000. }
  6001. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6002. const remainingParameters = omit(parameters, omittedParameters);
  6003. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6004. if (!isBinaryRequset) {
  6005. if (options.mediaType.format) {
  6006. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6007. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6008. }
  6009. if (options.mediaType.previews.length) {
  6010. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6011. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6012. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6013. return `application/vnd.github.${preview}-preview${format}`;
  6014. }).join(",");
  6015. }
  6016. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6017. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6018. if (["GET", "HEAD"].includes(method)) {
  6019. url = addQueryParameters(url, remainingParameters);
  6020. } else {
  6021. if ("data" in remainingParameters) {
  6022. body = remainingParameters.data;
  6023. } else {
  6024. if (Object.keys(remainingParameters).length) {
  6025. body = remainingParameters;
  6026. } else {
  6027. headers["content-length"] = 0;
  6028. }
  6029. }
  6030. } // default content-type for JSON if body is set
  6031. if (!headers["content-type"] && typeof body !== "undefined") {
  6032. headers["content-type"] = "application/json; charset=utf-8";
  6033. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6034. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6035. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6036. body = "";
  6037. } // Only return body/request keys if present
  6038. return Object.assign({
  6039. method,
  6040. url,
  6041. headers
  6042. }, typeof body !== "undefined" ? {
  6043. body
  6044. } : null, options.request ? {
  6045. request: options.request
  6046. } : null);
  6047. }
  6048. function endpointWithDefaults(defaults, route, options) {
  6049. return parse(merge(defaults, route, options));
  6050. }
  6051. function withDefaults(oldDefaults, newDefaults) {
  6052. const DEFAULTS = merge(oldDefaults, newDefaults);
  6053. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6054. return Object.assign(endpoint, {
  6055. DEFAULTS,
  6056. defaults: withDefaults.bind(null, DEFAULTS),
  6057. merge: merge.bind(null, DEFAULTS),
  6058. parse
  6059. });
  6060. }
  6061. const VERSION = "5.5.1";
  6062. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6063. // So we use RequestParameters and add method as additional required property.
  6064. const DEFAULTS = {
  6065. method: "GET",
  6066. baseUrl: "https://api.github.com",
  6067. headers: {
  6068. accept: "application/vnd.github.v3+json",
  6069. "user-agent": userAgent
  6070. },
  6071. mediaType: {
  6072. format: "",
  6073. previews: []
  6074. }
  6075. };
  6076. const endpoint = withDefaults(null, DEFAULTS);
  6077. exports.endpoint = endpoint;
  6078. //# sourceMappingURL=index.js.map
  6079. /***/ }),
  6080. /***/ 389:
  6081. /***/ (function(module, __unusedexports, __webpack_require__) {
  6082. "use strict";
  6083. const fs = __webpack_require__(747);
  6084. const shebangCommand = __webpack_require__(866);
  6085. function readShebang(command) {
  6086. // Read the first 150 bytes from the file
  6087. const size = 150;
  6088. let buffer;
  6089. if (Buffer.alloc) {
  6090. // Node.js v4.5+ / v5.10+
  6091. buffer = Buffer.alloc(size);
  6092. } else {
  6093. // Old Node.js API
  6094. buffer = new Buffer(size);
  6095. buffer.fill(0); // zero-fill
  6096. }
  6097. let fd;
  6098. try {
  6099. fd = fs.openSync(command, 'r');
  6100. fs.readSync(fd, buffer, 0, size, 0);
  6101. fs.closeSync(fd);
  6102. } catch (e) { /* Empty */ }
  6103. // Attempt to extract shebang (null is returned if not a shebang)
  6104. return shebangCommand(buffer.toString());
  6105. }
  6106. module.exports = readShebang;
  6107. /***/ }),
  6108. /***/ 402:
  6109. /***/ (function(module, __unusedexports, __webpack_require__) {
  6110. module.exports = Octokit;
  6111. const { request } = __webpack_require__(753);
  6112. const Hook = __webpack_require__(523);
  6113. const parseClientOptions = __webpack_require__(294);
  6114. function Octokit(plugins, options) {
  6115. options = options || {};
  6116. const hook = new Hook.Collection();
  6117. const log = Object.assign(
  6118. {
  6119. debug: () => {},
  6120. info: () => {},
  6121. warn: console.warn,
  6122. error: console.error
  6123. },
  6124. options && options.log
  6125. );
  6126. const api = {
  6127. hook,
  6128. log,
  6129. request: request.defaults(parseClientOptions(options, log, hook))
  6130. };
  6131. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6132. return api;
  6133. }
  6134. /***/ }),
  6135. /***/ 413:
  6136. /***/ (function(module) {
  6137. module.exports = require("stream");
  6138. /***/ }),
  6139. /***/ 417:
  6140. /***/ (function(module) {
  6141. module.exports = require("crypto");
  6142. /***/ }),
  6143. /***/ 427:
  6144. /***/ (function(module, __unusedexports, __webpack_require__) {
  6145. "use strict";
  6146. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6147. // In that case, fall back to a deprecated internal.
  6148. const util = __webpack_require__(669);
  6149. let uv;
  6150. if (typeof util.getSystemErrorName === 'function') {
  6151. module.exports = util.getSystemErrorName;
  6152. } else {
  6153. try {
  6154. uv = process.binding('uv');
  6155. if (typeof uv.errname !== 'function') {
  6156. throw new TypeError('uv.errname is not a function');
  6157. }
  6158. } catch (err) {
  6159. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6160. uv = null;
  6161. }
  6162. module.exports = code => errname(uv, code);
  6163. }
  6164. // Used for testing the fallback behavior
  6165. module.exports.__test__ = errname;
  6166. function errname(uv, code) {
  6167. if (uv) {
  6168. return uv.errname(code);
  6169. }
  6170. if (!(code < 0)) {
  6171. throw new Error('err >= 0');
  6172. }
  6173. return `Unknown system error ${code}`;
  6174. }
  6175. /***/ }),
  6176. /***/ 430:
  6177. /***/ (function(module, __unusedexports, __webpack_require__) {
  6178. module.exports = octokitValidate;
  6179. const validate = __webpack_require__(348);
  6180. function octokitValidate(octokit) {
  6181. octokit.hook.before("request", validate.bind(null, octokit));
  6182. }
  6183. /***/ }),
  6184. /***/ 431:
  6185. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6186. "use strict";
  6187. Object.defineProperty(exports, "__esModule", { value: true });
  6188. const os = __webpack_require__(87);
  6189. /**
  6190. * Commands
  6191. *
  6192. * Command Format:
  6193. * ##[name key=value;key=value]message
  6194. *
  6195. * Examples:
  6196. * ##[warning]This is the user warning message
  6197. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6198. */
  6199. function issueCommand(command, properties, message) {
  6200. const cmd = new Command(command, properties, message);
  6201. process.stdout.write(cmd.toString() + os.EOL);
  6202. }
  6203. exports.issueCommand = issueCommand;
  6204. function issue(name, message = '') {
  6205. issueCommand(name, {}, message);
  6206. }
  6207. exports.issue = issue;
  6208. const CMD_STRING = '::';
  6209. class Command {
  6210. constructor(command, properties, message) {
  6211. if (!command) {
  6212. command = 'missing.command';
  6213. }
  6214. this.command = command;
  6215. this.properties = properties;
  6216. this.message = message;
  6217. }
  6218. toString() {
  6219. let cmdStr = CMD_STRING + this.command;
  6220. if (this.properties && Object.keys(this.properties).length > 0) {
  6221. cmdStr += ' ';
  6222. for (const key in this.properties) {
  6223. if (this.properties.hasOwnProperty(key)) {
  6224. const val = this.properties[key];
  6225. if (val) {
  6226. // safely append the val - avoid blowing up when attempting to
  6227. // call .replace() if message is not a string for some reason
  6228. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6229. }
  6230. }
  6231. }
  6232. }
  6233. cmdStr += CMD_STRING;
  6234. // safely append the message - avoid blowing up when attempting to
  6235. // call .replace() if message is not a string for some reason
  6236. const message = `${this.message || ''}`;
  6237. cmdStr += escapeData(message);
  6238. return cmdStr;
  6239. }
  6240. }
  6241. function escapeData(s) {
  6242. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6243. }
  6244. function escape(s) {
  6245. return s
  6246. .replace(/\r/g, '%0D')
  6247. .replace(/\n/g, '%0A')
  6248. .replace(/]/g, '%5D')
  6249. .replace(/;/g, '%3B');
  6250. }
  6251. //# sourceMappingURL=command.js.map
  6252. /***/ }),
  6253. /***/ 438:
  6254. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6255. "use strict";
  6256. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6257. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6258. return new (P || (P = Promise))(function (resolve, reject) {
  6259. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6260. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6261. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6262. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6263. });
  6264. };
  6265. var __importStar = (this && this.__importStar) || function (mod) {
  6266. if (mod && mod.__esModule) return mod;
  6267. var result = {};
  6268. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6269. result["default"] = mod;
  6270. return result;
  6271. };
  6272. Object.defineProperty(exports, "__esModule", { value: true });
  6273. const core = __importStar(__webpack_require__(470));
  6274. const fs = __importStar(__webpack_require__(747));
  6275. const fsHelper = __importStar(__webpack_require__(618));
  6276. const io = __importStar(__webpack_require__(1));
  6277. const path = __importStar(__webpack_require__(622));
  6278. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  6279. return __awaiter(this, void 0, void 0, function* () {
  6280. let remove = false;
  6281. // Check whether using git or REST API
  6282. if (!git) {
  6283. remove = true;
  6284. }
  6285. // Fetch URL does not match
  6286. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6287. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6288. remove = true;
  6289. }
  6290. else {
  6291. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6292. const lockPaths = [
  6293. path.join(repositoryPath, '.git', 'index.lock'),
  6294. path.join(repositoryPath, '.git', 'shallow.lock')
  6295. ];
  6296. for (const lockPath of lockPaths) {
  6297. try {
  6298. yield io.rmRF(lockPath);
  6299. }
  6300. catch (error) {
  6301. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6302. }
  6303. }
  6304. try {
  6305. // Checkout detached HEAD
  6306. if (!(yield git.isDetached())) {
  6307. yield git.checkoutDetach();
  6308. }
  6309. // Remove all refs/heads/*
  6310. let branches = yield git.branchList(false);
  6311. for (const branch of branches) {
  6312. yield git.branchDelete(false, branch);
  6313. }
  6314. // Remove all refs/remotes/origin/* to avoid conflicts
  6315. branches = yield git.branchList(true);
  6316. for (const branch of branches) {
  6317. yield git.branchDelete(true, branch);
  6318. }
  6319. // Clean
  6320. if (clean) {
  6321. if (!(yield git.tryClean())) {
  6322. 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}'.`);
  6323. remove = true;
  6324. }
  6325. else if (!(yield git.tryReset())) {
  6326. remove = true;
  6327. }
  6328. if (remove) {
  6329. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6330. }
  6331. }
  6332. }
  6333. catch (error) {
  6334. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6335. remove = true;
  6336. }
  6337. }
  6338. if (remove) {
  6339. // Delete the contents of the directory. Don't delete the directory itself
  6340. // since it might be the current working directory.
  6341. core.info(`Deleting the contents of '${repositoryPath}'`);
  6342. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6343. yield io.rmRF(path.join(repositoryPath, file));
  6344. }
  6345. }
  6346. });
  6347. }
  6348. exports.prepareExistingDirectory = prepareExistingDirectory;
  6349. /***/ }),
  6350. /***/ 453:
  6351. /***/ (function(module, __unusedexports, __webpack_require__) {
  6352. var once = __webpack_require__(969)
  6353. var eos = __webpack_require__(562)
  6354. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6355. var noop = function () {}
  6356. var ancient = /^v?\.0/.test(process.version)
  6357. var isFn = function (fn) {
  6358. return typeof fn === 'function'
  6359. }
  6360. var isFS = function (stream) {
  6361. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6362. if (!fs) return false // browser
  6363. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6364. }
  6365. var isRequest = function (stream) {
  6366. return stream.setHeader && isFn(stream.abort)
  6367. }
  6368. var destroyer = function (stream, reading, writing, callback) {
  6369. callback = once(callback)
  6370. var closed = false
  6371. stream.on('close', function () {
  6372. closed = true
  6373. })
  6374. eos(stream, {readable: reading, writable: writing}, function (err) {
  6375. if (err) return callback(err)
  6376. closed = true
  6377. callback()
  6378. })
  6379. var destroyed = false
  6380. return function (err) {
  6381. if (closed) return
  6382. if (destroyed) return
  6383. destroyed = true
  6384. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6385. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6386. if (isFn(stream.destroy)) return stream.destroy()
  6387. callback(err || new Error('stream was destroyed'))
  6388. }
  6389. }
  6390. var call = function (fn) {
  6391. fn()
  6392. }
  6393. var pipe = function (from, to) {
  6394. return from.pipe(to)
  6395. }
  6396. var pump = function () {
  6397. var streams = Array.prototype.slice.call(arguments)
  6398. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6399. if (Array.isArray(streams[0])) streams = streams[0]
  6400. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6401. var error
  6402. var destroys = streams.map(function (stream, i) {
  6403. var reading = i < streams.length - 1
  6404. var writing = i > 0
  6405. return destroyer(stream, reading, writing, function (err) {
  6406. if (!error) error = err
  6407. if (err) destroys.forEach(call)
  6408. if (reading) return
  6409. destroys.forEach(call)
  6410. callback(error)
  6411. })
  6412. })
  6413. return streams.reduce(pipe)
  6414. }
  6415. module.exports = pump
  6416. /***/ }),
  6417. /***/ 454:
  6418. /***/ (function(module, exports, __webpack_require__) {
  6419. "use strict";
  6420. Object.defineProperty(exports, '__esModule', { value: true });
  6421. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6422. var Stream = _interopDefault(__webpack_require__(413));
  6423. var http = _interopDefault(__webpack_require__(605));
  6424. var Url = _interopDefault(__webpack_require__(835));
  6425. var https = _interopDefault(__webpack_require__(211));
  6426. var zlib = _interopDefault(__webpack_require__(761));
  6427. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6428. // fix for "Readable" isn't a named export issue
  6429. const Readable = Stream.Readable;
  6430. const BUFFER = Symbol('buffer');
  6431. const TYPE = Symbol('type');
  6432. class Blob {
  6433. constructor() {
  6434. this[TYPE] = '';
  6435. const blobParts = arguments[0];
  6436. const options = arguments[1];
  6437. const buffers = [];
  6438. let size = 0;
  6439. if (blobParts) {
  6440. const a = blobParts;
  6441. const length = Number(a.length);
  6442. for (let i = 0; i < length; i++) {
  6443. const element = a[i];
  6444. let buffer;
  6445. if (element instanceof Buffer) {
  6446. buffer = element;
  6447. } else if (ArrayBuffer.isView(element)) {
  6448. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6449. } else if (element instanceof ArrayBuffer) {
  6450. buffer = Buffer.from(element);
  6451. } else if (element instanceof Blob) {
  6452. buffer = element[BUFFER];
  6453. } else {
  6454. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6455. }
  6456. size += buffer.length;
  6457. buffers.push(buffer);
  6458. }
  6459. }
  6460. this[BUFFER] = Buffer.concat(buffers);
  6461. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6462. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6463. this[TYPE] = type;
  6464. }
  6465. }
  6466. get size() {
  6467. return this[BUFFER].length;
  6468. }
  6469. get type() {
  6470. return this[TYPE];
  6471. }
  6472. text() {
  6473. return Promise.resolve(this[BUFFER].toString());
  6474. }
  6475. arrayBuffer() {
  6476. const buf = this[BUFFER];
  6477. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6478. return Promise.resolve(ab);
  6479. }
  6480. stream() {
  6481. const readable = new Readable();
  6482. readable._read = function () {};
  6483. readable.push(this[BUFFER]);
  6484. readable.push(null);
  6485. return readable;
  6486. }
  6487. toString() {
  6488. return '[object Blob]';
  6489. }
  6490. slice() {
  6491. const size = this.size;
  6492. const start = arguments[0];
  6493. const end = arguments[1];
  6494. let relativeStart, relativeEnd;
  6495. if (start === undefined) {
  6496. relativeStart = 0;
  6497. } else if (start < 0) {
  6498. relativeStart = Math.max(size + start, 0);
  6499. } else {
  6500. relativeStart = Math.min(start, size);
  6501. }
  6502. if (end === undefined) {
  6503. relativeEnd = size;
  6504. } else if (end < 0) {
  6505. relativeEnd = Math.max(size + end, 0);
  6506. } else {
  6507. relativeEnd = Math.min(end, size);
  6508. }
  6509. const span = Math.max(relativeEnd - relativeStart, 0);
  6510. const buffer = this[BUFFER];
  6511. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6512. const blob = new Blob([], { type: arguments[2] });
  6513. blob[BUFFER] = slicedBuffer;
  6514. return blob;
  6515. }
  6516. }
  6517. Object.defineProperties(Blob.prototype, {
  6518. size: { enumerable: true },
  6519. type: { enumerable: true },
  6520. slice: { enumerable: true }
  6521. });
  6522. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6523. value: 'Blob',
  6524. writable: false,
  6525. enumerable: false,
  6526. configurable: true
  6527. });
  6528. /**
  6529. * fetch-error.js
  6530. *
  6531. * FetchError interface for operational errors
  6532. */
  6533. /**
  6534. * Create FetchError instance
  6535. *
  6536. * @param String message Error message for human
  6537. * @param String type Error type for machine
  6538. * @param String systemError For Node.js system error
  6539. * @return FetchError
  6540. */
  6541. function FetchError(message, type, systemError) {
  6542. Error.call(this, message);
  6543. this.message = message;
  6544. this.type = type;
  6545. // when err.type is `system`, err.code contains system error code
  6546. if (systemError) {
  6547. this.code = this.errno = systemError.code;
  6548. }
  6549. // hide custom error implementation details from end-users
  6550. Error.captureStackTrace(this, this.constructor);
  6551. }
  6552. FetchError.prototype = Object.create(Error.prototype);
  6553. FetchError.prototype.constructor = FetchError;
  6554. FetchError.prototype.name = 'FetchError';
  6555. let convert;
  6556. try {
  6557. convert = __webpack_require__(18).convert;
  6558. } catch (e) {}
  6559. const INTERNALS = Symbol('Body internals');
  6560. // fix an issue where "PassThrough" isn't a named export for node <10
  6561. const PassThrough = Stream.PassThrough;
  6562. /**
  6563. * Body mixin
  6564. *
  6565. * Ref: https://fetch.spec.whatwg.org/#body
  6566. *
  6567. * @param Stream body Readable stream
  6568. * @param Object opts Response options
  6569. * @return Void
  6570. */
  6571. function Body(body) {
  6572. var _this = this;
  6573. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6574. _ref$size = _ref.size;
  6575. let size = _ref$size === undefined ? 0 : _ref$size;
  6576. var _ref$timeout = _ref.timeout;
  6577. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6578. if (body == null) {
  6579. // body is undefined or null
  6580. body = null;
  6581. } else if (isURLSearchParams(body)) {
  6582. // body is a URLSearchParams
  6583. body = Buffer.from(body.toString());
  6584. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6585. // body is ArrayBuffer
  6586. body = Buffer.from(body);
  6587. } else if (ArrayBuffer.isView(body)) {
  6588. // body is ArrayBufferView
  6589. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6590. } else if (body instanceof Stream) ; else {
  6591. // none of the above
  6592. // coerce to string then buffer
  6593. body = Buffer.from(String(body));
  6594. }
  6595. this[INTERNALS] = {
  6596. body,
  6597. disturbed: false,
  6598. error: null
  6599. };
  6600. this.size = size;
  6601. this.timeout = timeout;
  6602. if (body instanceof Stream) {
  6603. body.on('error', function (err) {
  6604. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6605. _this[INTERNALS].error = error;
  6606. });
  6607. }
  6608. }
  6609. Body.prototype = {
  6610. get body() {
  6611. return this[INTERNALS].body;
  6612. },
  6613. get bodyUsed() {
  6614. return this[INTERNALS].disturbed;
  6615. },
  6616. /**
  6617. * Decode response as ArrayBuffer
  6618. *
  6619. * @return Promise
  6620. */
  6621. arrayBuffer() {
  6622. return consumeBody.call(this).then(function (buf) {
  6623. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6624. });
  6625. },
  6626. /**
  6627. * Return raw response as Blob
  6628. *
  6629. * @return Promise
  6630. */
  6631. blob() {
  6632. let ct = this.headers && this.headers.get('content-type') || '';
  6633. return consumeBody.call(this).then(function (buf) {
  6634. return Object.assign(
  6635. // Prevent copying
  6636. new Blob([], {
  6637. type: ct.toLowerCase()
  6638. }), {
  6639. [BUFFER]: buf
  6640. });
  6641. });
  6642. },
  6643. /**
  6644. * Decode response as json
  6645. *
  6646. * @return Promise
  6647. */
  6648. json() {
  6649. var _this2 = this;
  6650. return consumeBody.call(this).then(function (buffer) {
  6651. try {
  6652. return JSON.parse(buffer.toString());
  6653. } catch (err) {
  6654. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6655. }
  6656. });
  6657. },
  6658. /**
  6659. * Decode response as text
  6660. *
  6661. * @return Promise
  6662. */
  6663. text() {
  6664. return consumeBody.call(this).then(function (buffer) {
  6665. return buffer.toString();
  6666. });
  6667. },
  6668. /**
  6669. * Decode response as buffer (non-spec api)
  6670. *
  6671. * @return Promise
  6672. */
  6673. buffer() {
  6674. return consumeBody.call(this);
  6675. },
  6676. /**
  6677. * Decode response as text, while automatically detecting the encoding and
  6678. * trying to decode to UTF-8 (non-spec api)
  6679. *
  6680. * @return Promise
  6681. */
  6682. textConverted() {
  6683. var _this3 = this;
  6684. return consumeBody.call(this).then(function (buffer) {
  6685. return convertBody(buffer, _this3.headers);
  6686. });
  6687. }
  6688. };
  6689. // In browsers, all properties are enumerable.
  6690. Object.defineProperties(Body.prototype, {
  6691. body: { enumerable: true },
  6692. bodyUsed: { enumerable: true },
  6693. arrayBuffer: { enumerable: true },
  6694. blob: { enumerable: true },
  6695. json: { enumerable: true },
  6696. text: { enumerable: true }
  6697. });
  6698. Body.mixIn = function (proto) {
  6699. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6700. // istanbul ignore else: future proof
  6701. if (!(name in proto)) {
  6702. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6703. Object.defineProperty(proto, name, desc);
  6704. }
  6705. }
  6706. };
  6707. /**
  6708. * Consume and convert an entire Body to a Buffer.
  6709. *
  6710. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6711. *
  6712. * @return Promise
  6713. */
  6714. function consumeBody() {
  6715. var _this4 = this;
  6716. if (this[INTERNALS].disturbed) {
  6717. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6718. }
  6719. this[INTERNALS].disturbed = true;
  6720. if (this[INTERNALS].error) {
  6721. return Body.Promise.reject(this[INTERNALS].error);
  6722. }
  6723. let body = this.body;
  6724. // body is null
  6725. if (body === null) {
  6726. return Body.Promise.resolve(Buffer.alloc(0));
  6727. }
  6728. // body is blob
  6729. if (isBlob(body)) {
  6730. body = body.stream();
  6731. }
  6732. // body is buffer
  6733. if (Buffer.isBuffer(body)) {
  6734. return Body.Promise.resolve(body);
  6735. }
  6736. // istanbul ignore if: should never happen
  6737. if (!(body instanceof Stream)) {
  6738. return Body.Promise.resolve(Buffer.alloc(0));
  6739. }
  6740. // body is stream
  6741. // get ready to actually consume the body
  6742. let accum = [];
  6743. let accumBytes = 0;
  6744. let abort = false;
  6745. return new Body.Promise(function (resolve, reject) {
  6746. let resTimeout;
  6747. // allow timeout on slow response body
  6748. if (_this4.timeout) {
  6749. resTimeout = setTimeout(function () {
  6750. abort = true;
  6751. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6752. }, _this4.timeout);
  6753. }
  6754. // handle stream errors
  6755. body.on('error', function (err) {
  6756. if (err.name === 'AbortError') {
  6757. // if the request was aborted, reject with this Error
  6758. abort = true;
  6759. reject(err);
  6760. } else {
  6761. // other errors, such as incorrect content-encoding
  6762. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6763. }
  6764. });
  6765. body.on('data', function (chunk) {
  6766. if (abort || chunk === null) {
  6767. return;
  6768. }
  6769. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6770. abort = true;
  6771. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6772. return;
  6773. }
  6774. accumBytes += chunk.length;
  6775. accum.push(chunk);
  6776. });
  6777. body.on('end', function () {
  6778. if (abort) {
  6779. return;
  6780. }
  6781. clearTimeout(resTimeout);
  6782. try {
  6783. resolve(Buffer.concat(accum, accumBytes));
  6784. } catch (err) {
  6785. // handle streams that have accumulated too much data (issue #414)
  6786. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6787. }
  6788. });
  6789. });
  6790. }
  6791. /**
  6792. * Detect buffer encoding and convert to target encoding
  6793. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6794. *
  6795. * @param Buffer buffer Incoming buffer
  6796. * @param String encoding Target encoding
  6797. * @return String
  6798. */
  6799. function convertBody(buffer, headers) {
  6800. if (typeof convert !== 'function') {
  6801. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6802. }
  6803. const ct = headers.get('content-type');
  6804. let charset = 'utf-8';
  6805. let res, str;
  6806. // header
  6807. if (ct) {
  6808. res = /charset=([^;]*)/i.exec(ct);
  6809. }
  6810. // no charset in content type, peek at response body for at most 1024 bytes
  6811. str = buffer.slice(0, 1024).toString();
  6812. // html5
  6813. if (!res && str) {
  6814. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6815. }
  6816. // html4
  6817. if (!res && str) {
  6818. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6819. if (res) {
  6820. res = /charset=(.*)/i.exec(res.pop());
  6821. }
  6822. }
  6823. // xml
  6824. if (!res && str) {
  6825. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6826. }
  6827. // found charset
  6828. if (res) {
  6829. charset = res.pop();
  6830. // prevent decode issues when sites use incorrect encoding
  6831. // ref: https://hsivonen.fi/encoding-menu/
  6832. if (charset === 'gb2312' || charset === 'gbk') {
  6833. charset = 'gb18030';
  6834. }
  6835. }
  6836. // turn raw buffers into a single utf-8 buffer
  6837. return convert(buffer, 'UTF-8', charset).toString();
  6838. }
  6839. /**
  6840. * Detect a URLSearchParams object
  6841. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6842. *
  6843. * @param Object obj Object to detect by type or brand
  6844. * @return String
  6845. */
  6846. function isURLSearchParams(obj) {
  6847. // Duck-typing as a necessary condition.
  6848. 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') {
  6849. return false;
  6850. }
  6851. // Brand-checking and more duck-typing as optional condition.
  6852. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6853. }
  6854. /**
  6855. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6856. * @param {*} obj
  6857. * @return {boolean}
  6858. */
  6859. function isBlob(obj) {
  6860. 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]);
  6861. }
  6862. /**
  6863. * Clone body given Res/Req instance
  6864. *
  6865. * @param Mixed instance Response or Request instance
  6866. * @return Mixed
  6867. */
  6868. function clone(instance) {
  6869. let p1, p2;
  6870. let body = instance.body;
  6871. // don't allow cloning a used body
  6872. if (instance.bodyUsed) {
  6873. throw new Error('cannot clone body after it is used');
  6874. }
  6875. // check that body is a stream and not form-data object
  6876. // note: we can't clone the form-data object without having it as a dependency
  6877. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6878. // tee instance body
  6879. p1 = new PassThrough();
  6880. p2 = new PassThrough();
  6881. body.pipe(p1);
  6882. body.pipe(p2);
  6883. // set instance body to teed body and return the other teed body
  6884. instance[INTERNALS].body = p1;
  6885. body = p2;
  6886. }
  6887. return body;
  6888. }
  6889. /**
  6890. * Performs the operation "extract a `Content-Type` value from |object|" as
  6891. * specified in the specification:
  6892. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6893. *
  6894. * This function assumes that instance.body is present.
  6895. *
  6896. * @param Mixed instance Any options.body input
  6897. */
  6898. function extractContentType(body) {
  6899. if (body === null) {
  6900. // body is null
  6901. return null;
  6902. } else if (typeof body === 'string') {
  6903. // body is string
  6904. return 'text/plain;charset=UTF-8';
  6905. } else if (isURLSearchParams(body)) {
  6906. // body is a URLSearchParams
  6907. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6908. } else if (isBlob(body)) {
  6909. // body is blob
  6910. return body.type || null;
  6911. } else if (Buffer.isBuffer(body)) {
  6912. // body is buffer
  6913. return null;
  6914. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6915. // body is ArrayBuffer
  6916. return null;
  6917. } else if (ArrayBuffer.isView(body)) {
  6918. // body is ArrayBufferView
  6919. return null;
  6920. } else if (typeof body.getBoundary === 'function') {
  6921. // detect form data input from form-data module
  6922. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6923. } else if (body instanceof Stream) {
  6924. // body is stream
  6925. // can't really do much about this
  6926. return null;
  6927. } else {
  6928. // Body constructor defaults other things to string
  6929. return 'text/plain;charset=UTF-8';
  6930. }
  6931. }
  6932. /**
  6933. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6934. * For us, we have to explicitly get it with a function.
  6935. *
  6936. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6937. *
  6938. * @param Body instance Instance of Body
  6939. * @return Number? Number of bytes, or null if not possible
  6940. */
  6941. function getTotalBytes(instance) {
  6942. const body = instance.body;
  6943. if (body === null) {
  6944. // body is null
  6945. return 0;
  6946. } else if (isBlob(body)) {
  6947. return body.size;
  6948. } else if (Buffer.isBuffer(body)) {
  6949. // body is buffer
  6950. return body.length;
  6951. } else if (body && typeof body.getLengthSync === 'function') {
  6952. // detect form data input from form-data module
  6953. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6954. body.hasKnownLength && body.hasKnownLength()) {
  6955. // 2.x
  6956. return body.getLengthSync();
  6957. }
  6958. return null;
  6959. } else {
  6960. // body is stream
  6961. return null;
  6962. }
  6963. }
  6964. /**
  6965. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6966. *
  6967. * @param Body instance Instance of Body
  6968. * @return Void
  6969. */
  6970. function writeToStream(dest, instance) {
  6971. const body = instance.body;
  6972. if (body === null) {
  6973. // body is null
  6974. dest.end();
  6975. } else if (isBlob(body)) {
  6976. body.stream().pipe(dest);
  6977. } else if (Buffer.isBuffer(body)) {
  6978. // body is buffer
  6979. dest.write(body);
  6980. dest.end();
  6981. } else {
  6982. // body is stream
  6983. body.pipe(dest);
  6984. }
  6985. }
  6986. // expose Promise
  6987. Body.Promise = global.Promise;
  6988. /**
  6989. * headers.js
  6990. *
  6991. * Headers class offers convenient helpers
  6992. */
  6993. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6994. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6995. function validateName(name) {
  6996. name = `${name}`;
  6997. if (invalidTokenRegex.test(name) || name === '') {
  6998. throw new TypeError(`${name} is not a legal HTTP header name`);
  6999. }
  7000. }
  7001. function validateValue(value) {
  7002. value = `${value}`;
  7003. if (invalidHeaderCharRegex.test(value)) {
  7004. throw new TypeError(`${value} is not a legal HTTP header value`);
  7005. }
  7006. }
  7007. /**
  7008. * Find the key in the map object given a header name.
  7009. *
  7010. * Returns undefined if not found.
  7011. *
  7012. * @param String name Header name
  7013. * @return String|Undefined
  7014. */
  7015. function find(map, name) {
  7016. name = name.toLowerCase();
  7017. for (const key in map) {
  7018. if (key.toLowerCase() === name) {
  7019. return key;
  7020. }
  7021. }
  7022. return undefined;
  7023. }
  7024. const MAP = Symbol('map');
  7025. class Headers {
  7026. /**
  7027. * Headers class
  7028. *
  7029. * @param Object headers Response headers
  7030. * @return Void
  7031. */
  7032. constructor() {
  7033. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7034. this[MAP] = Object.create(null);
  7035. if (init instanceof Headers) {
  7036. const rawHeaders = init.raw();
  7037. const headerNames = Object.keys(rawHeaders);
  7038. for (const headerName of headerNames) {
  7039. for (const value of rawHeaders[headerName]) {
  7040. this.append(headerName, value);
  7041. }
  7042. }
  7043. return;
  7044. }
  7045. // We don't worry about converting prop to ByteString here as append()
  7046. // will handle it.
  7047. if (init == null) ; else if (typeof init === 'object') {
  7048. const method = init[Symbol.iterator];
  7049. if (method != null) {
  7050. if (typeof method !== 'function') {
  7051. throw new TypeError('Header pairs must be iterable');
  7052. }
  7053. // sequence<sequence<ByteString>>
  7054. // Note: per spec we have to first exhaust the lists then process them
  7055. const pairs = [];
  7056. for (const pair of init) {
  7057. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7058. throw new TypeError('Each header pair must be iterable');
  7059. }
  7060. pairs.push(Array.from(pair));
  7061. }
  7062. for (const pair of pairs) {
  7063. if (pair.length !== 2) {
  7064. throw new TypeError('Each header pair must be a name/value tuple');
  7065. }
  7066. this.append(pair[0], pair[1]);
  7067. }
  7068. } else {
  7069. // record<ByteString, ByteString>
  7070. for (const key of Object.keys(init)) {
  7071. const value = init[key];
  7072. this.append(key, value);
  7073. }
  7074. }
  7075. } else {
  7076. throw new TypeError('Provided initializer must be an object');
  7077. }
  7078. }
  7079. /**
  7080. * Return combined header value given name
  7081. *
  7082. * @param String name Header name
  7083. * @return Mixed
  7084. */
  7085. get(name) {
  7086. name = `${name}`;
  7087. validateName(name);
  7088. const key = find(this[MAP], name);
  7089. if (key === undefined) {
  7090. return null;
  7091. }
  7092. return this[MAP][key].join(', ');
  7093. }
  7094. /**
  7095. * Iterate over all headers
  7096. *
  7097. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7098. * @param Boolean thisArg `this` context for callback function
  7099. * @return Void
  7100. */
  7101. forEach(callback) {
  7102. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7103. let pairs = getHeaders(this);
  7104. let i = 0;
  7105. while (i < pairs.length) {
  7106. var _pairs$i = pairs[i];
  7107. const name = _pairs$i[0],
  7108. value = _pairs$i[1];
  7109. callback.call(thisArg, value, name, this);
  7110. pairs = getHeaders(this);
  7111. i++;
  7112. }
  7113. }
  7114. /**
  7115. * Overwrite header values given name
  7116. *
  7117. * @param String name Header name
  7118. * @param String value Header value
  7119. * @return Void
  7120. */
  7121. set(name, value) {
  7122. name = `${name}`;
  7123. value = `${value}`;
  7124. validateName(name);
  7125. validateValue(value);
  7126. const key = find(this[MAP], name);
  7127. this[MAP][key !== undefined ? key : name] = [value];
  7128. }
  7129. /**
  7130. * Append a value onto existing header
  7131. *
  7132. * @param String name Header name
  7133. * @param String value Header value
  7134. * @return Void
  7135. */
  7136. append(name, value) {
  7137. name = `${name}`;
  7138. value = `${value}`;
  7139. validateName(name);
  7140. validateValue(value);
  7141. const key = find(this[MAP], name);
  7142. if (key !== undefined) {
  7143. this[MAP][key].push(value);
  7144. } else {
  7145. this[MAP][name] = [value];
  7146. }
  7147. }
  7148. /**
  7149. * Check for header name existence
  7150. *
  7151. * @param String name Header name
  7152. * @return Boolean
  7153. */
  7154. has(name) {
  7155. name = `${name}`;
  7156. validateName(name);
  7157. return find(this[MAP], name) !== undefined;
  7158. }
  7159. /**
  7160. * Delete all header values given name
  7161. *
  7162. * @param String name Header name
  7163. * @return Void
  7164. */
  7165. delete(name) {
  7166. name = `${name}`;
  7167. validateName(name);
  7168. const key = find(this[MAP], name);
  7169. if (key !== undefined) {
  7170. delete this[MAP][key];
  7171. }
  7172. }
  7173. /**
  7174. * Return raw headers (non-spec api)
  7175. *
  7176. * @return Object
  7177. */
  7178. raw() {
  7179. return this[MAP];
  7180. }
  7181. /**
  7182. * Get an iterator on keys.
  7183. *
  7184. * @return Iterator
  7185. */
  7186. keys() {
  7187. return createHeadersIterator(this, 'key');
  7188. }
  7189. /**
  7190. * Get an iterator on values.
  7191. *
  7192. * @return Iterator
  7193. */
  7194. values() {
  7195. return createHeadersIterator(this, 'value');
  7196. }
  7197. /**
  7198. * Get an iterator on entries.
  7199. *
  7200. * This is the default iterator of the Headers object.
  7201. *
  7202. * @return Iterator
  7203. */
  7204. [Symbol.iterator]() {
  7205. return createHeadersIterator(this, 'key+value');
  7206. }
  7207. }
  7208. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7209. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7210. value: 'Headers',
  7211. writable: false,
  7212. enumerable: false,
  7213. configurable: true
  7214. });
  7215. Object.defineProperties(Headers.prototype, {
  7216. get: { enumerable: true },
  7217. forEach: { enumerable: true },
  7218. set: { enumerable: true },
  7219. append: { enumerable: true },
  7220. has: { enumerable: true },
  7221. delete: { enumerable: true },
  7222. keys: { enumerable: true },
  7223. values: { enumerable: true },
  7224. entries: { enumerable: true }
  7225. });
  7226. function getHeaders(headers) {
  7227. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7228. const keys = Object.keys(headers[MAP]).sort();
  7229. return keys.map(kind === 'key' ? function (k) {
  7230. return k.toLowerCase();
  7231. } : kind === 'value' ? function (k) {
  7232. return headers[MAP][k].join(', ');
  7233. } : function (k) {
  7234. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7235. });
  7236. }
  7237. const INTERNAL = Symbol('internal');
  7238. function createHeadersIterator(target, kind) {
  7239. const iterator = Object.create(HeadersIteratorPrototype);
  7240. iterator[INTERNAL] = {
  7241. target,
  7242. kind,
  7243. index: 0
  7244. };
  7245. return iterator;
  7246. }
  7247. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7248. next() {
  7249. // istanbul ignore if
  7250. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7251. throw new TypeError('Value of `this` is not a HeadersIterator');
  7252. }
  7253. var _INTERNAL = this[INTERNAL];
  7254. const target = _INTERNAL.target,
  7255. kind = _INTERNAL.kind,
  7256. index = _INTERNAL.index;
  7257. const values = getHeaders(target, kind);
  7258. const len = values.length;
  7259. if (index >= len) {
  7260. return {
  7261. value: undefined,
  7262. done: true
  7263. };
  7264. }
  7265. this[INTERNAL].index = index + 1;
  7266. return {
  7267. value: values[index],
  7268. done: false
  7269. };
  7270. }
  7271. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7272. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7273. value: 'HeadersIterator',
  7274. writable: false,
  7275. enumerable: false,
  7276. configurable: true
  7277. });
  7278. /**
  7279. * Export the Headers object in a form that Node.js can consume.
  7280. *
  7281. * @param Headers headers
  7282. * @return Object
  7283. */
  7284. function exportNodeCompatibleHeaders(headers) {
  7285. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7286. // http.request() only supports string as Host header. This hack makes
  7287. // specifying custom Host header possible.
  7288. const hostHeaderKey = find(headers[MAP], 'Host');
  7289. if (hostHeaderKey !== undefined) {
  7290. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7291. }
  7292. return obj;
  7293. }
  7294. /**
  7295. * Create a Headers object from an object of headers, ignoring those that do
  7296. * not conform to HTTP grammar productions.
  7297. *
  7298. * @param Object obj Object of headers
  7299. * @return Headers
  7300. */
  7301. function createHeadersLenient(obj) {
  7302. const headers = new Headers();
  7303. for (const name of Object.keys(obj)) {
  7304. if (invalidTokenRegex.test(name)) {
  7305. continue;
  7306. }
  7307. if (Array.isArray(obj[name])) {
  7308. for (const val of obj[name]) {
  7309. if (invalidHeaderCharRegex.test(val)) {
  7310. continue;
  7311. }
  7312. if (headers[MAP][name] === undefined) {
  7313. headers[MAP][name] = [val];
  7314. } else {
  7315. headers[MAP][name].push(val);
  7316. }
  7317. }
  7318. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7319. headers[MAP][name] = [obj[name]];
  7320. }
  7321. }
  7322. return headers;
  7323. }
  7324. const INTERNALS$1 = Symbol('Response internals');
  7325. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7326. const STATUS_CODES = http.STATUS_CODES;
  7327. /**
  7328. * Response class
  7329. *
  7330. * @param Stream body Readable stream
  7331. * @param Object opts Response options
  7332. * @return Void
  7333. */
  7334. class Response {
  7335. constructor() {
  7336. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7337. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7338. Body.call(this, body, opts);
  7339. const status = opts.status || 200;
  7340. const headers = new Headers(opts.headers);
  7341. if (body != null && !headers.has('Content-Type')) {
  7342. const contentType = extractContentType(body);
  7343. if (contentType) {
  7344. headers.append('Content-Type', contentType);
  7345. }
  7346. }
  7347. this[INTERNALS$1] = {
  7348. url: opts.url,
  7349. status,
  7350. statusText: opts.statusText || STATUS_CODES[status],
  7351. headers,
  7352. counter: opts.counter
  7353. };
  7354. }
  7355. get url() {
  7356. return this[INTERNALS$1].url || '';
  7357. }
  7358. get status() {
  7359. return this[INTERNALS$1].status;
  7360. }
  7361. /**
  7362. * Convenience property representing if the request ended normally
  7363. */
  7364. get ok() {
  7365. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7366. }
  7367. get redirected() {
  7368. return this[INTERNALS$1].counter > 0;
  7369. }
  7370. get statusText() {
  7371. return this[INTERNALS$1].statusText;
  7372. }
  7373. get headers() {
  7374. return this[INTERNALS$1].headers;
  7375. }
  7376. /**
  7377. * Clone this response
  7378. *
  7379. * @return Response
  7380. */
  7381. clone() {
  7382. return new Response(clone(this), {
  7383. url: this.url,
  7384. status: this.status,
  7385. statusText: this.statusText,
  7386. headers: this.headers,
  7387. ok: this.ok,
  7388. redirected: this.redirected
  7389. });
  7390. }
  7391. }
  7392. Body.mixIn(Response.prototype);
  7393. Object.defineProperties(Response.prototype, {
  7394. url: { enumerable: true },
  7395. status: { enumerable: true },
  7396. ok: { enumerable: true },
  7397. redirected: { enumerable: true },
  7398. statusText: { enumerable: true },
  7399. headers: { enumerable: true },
  7400. clone: { enumerable: true }
  7401. });
  7402. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7403. value: 'Response',
  7404. writable: false,
  7405. enumerable: false,
  7406. configurable: true
  7407. });
  7408. const INTERNALS$2 = Symbol('Request internals');
  7409. // fix an issue where "format", "parse" aren't a named export for node <10
  7410. const parse_url = Url.parse;
  7411. const format_url = Url.format;
  7412. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7413. /**
  7414. * Check if a value is an instance of Request.
  7415. *
  7416. * @param Mixed input
  7417. * @return Boolean
  7418. */
  7419. function isRequest(input) {
  7420. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7421. }
  7422. function isAbortSignal(signal) {
  7423. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7424. return !!(proto && proto.constructor.name === 'AbortSignal');
  7425. }
  7426. /**
  7427. * Request class
  7428. *
  7429. * @param Mixed input Url or Request instance
  7430. * @param Object init Custom options
  7431. * @return Void
  7432. */
  7433. class Request {
  7434. constructor(input) {
  7435. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7436. let parsedURL;
  7437. // normalize input
  7438. if (!isRequest(input)) {
  7439. if (input && input.href) {
  7440. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7441. // will fall into this branch also (since their `toString()` will return
  7442. // `href` property anyway)
  7443. parsedURL = parse_url(input.href);
  7444. } else {
  7445. // coerce input to a string before attempting to parse
  7446. parsedURL = parse_url(`${input}`);
  7447. }
  7448. input = {};
  7449. } else {
  7450. parsedURL = parse_url(input.url);
  7451. }
  7452. let method = init.method || input.method || 'GET';
  7453. method = method.toUpperCase();
  7454. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7455. throw new TypeError('Request with GET/HEAD method cannot have body');
  7456. }
  7457. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7458. Body.call(this, inputBody, {
  7459. timeout: init.timeout || input.timeout || 0,
  7460. size: init.size || input.size || 0
  7461. });
  7462. const headers = new Headers(init.headers || input.headers || {});
  7463. if (inputBody != null && !headers.has('Content-Type')) {
  7464. const contentType = extractContentType(inputBody);
  7465. if (contentType) {
  7466. headers.append('Content-Type', contentType);
  7467. }
  7468. }
  7469. let signal = isRequest(input) ? input.signal : null;
  7470. if ('signal' in init) signal = init.signal;
  7471. if (signal != null && !isAbortSignal(signal)) {
  7472. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7473. }
  7474. this[INTERNALS$2] = {
  7475. method,
  7476. redirect: init.redirect || input.redirect || 'follow',
  7477. headers,
  7478. parsedURL,
  7479. signal
  7480. };
  7481. // node-fetch-only options
  7482. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7483. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7484. this.counter = init.counter || input.counter || 0;
  7485. this.agent = init.agent || input.agent;
  7486. }
  7487. get method() {
  7488. return this[INTERNALS$2].method;
  7489. }
  7490. get url() {
  7491. return format_url(this[INTERNALS$2].parsedURL);
  7492. }
  7493. get headers() {
  7494. return this[INTERNALS$2].headers;
  7495. }
  7496. get redirect() {
  7497. return this[INTERNALS$2].redirect;
  7498. }
  7499. get signal() {
  7500. return this[INTERNALS$2].signal;
  7501. }
  7502. /**
  7503. * Clone this request
  7504. *
  7505. * @return Request
  7506. */
  7507. clone() {
  7508. return new Request(this);
  7509. }
  7510. }
  7511. Body.mixIn(Request.prototype);
  7512. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7513. value: 'Request',
  7514. writable: false,
  7515. enumerable: false,
  7516. configurable: true
  7517. });
  7518. Object.defineProperties(Request.prototype, {
  7519. method: { enumerable: true },
  7520. url: { enumerable: true },
  7521. headers: { enumerable: true },
  7522. redirect: { enumerable: true },
  7523. clone: { enumerable: true },
  7524. signal: { enumerable: true }
  7525. });
  7526. /**
  7527. * Convert a Request to Node.js http request options.
  7528. *
  7529. * @param Request A Request instance
  7530. * @return Object The options object to be passed to http.request
  7531. */
  7532. function getNodeRequestOptions(request) {
  7533. const parsedURL = request[INTERNALS$2].parsedURL;
  7534. const headers = new Headers(request[INTERNALS$2].headers);
  7535. // fetch step 1.3
  7536. if (!headers.has('Accept')) {
  7537. headers.set('Accept', '*/*');
  7538. }
  7539. // Basic fetch
  7540. if (!parsedURL.protocol || !parsedURL.hostname) {
  7541. throw new TypeError('Only absolute URLs are supported');
  7542. }
  7543. if (!/^https?:$/.test(parsedURL.protocol)) {
  7544. throw new TypeError('Only HTTP(S) protocols are supported');
  7545. }
  7546. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7547. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7548. }
  7549. // HTTP-network-or-cache fetch steps 2.4-2.7
  7550. let contentLengthValue = null;
  7551. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7552. contentLengthValue = '0';
  7553. }
  7554. if (request.body != null) {
  7555. const totalBytes = getTotalBytes(request);
  7556. if (typeof totalBytes === 'number') {
  7557. contentLengthValue = String(totalBytes);
  7558. }
  7559. }
  7560. if (contentLengthValue) {
  7561. headers.set('Content-Length', contentLengthValue);
  7562. }
  7563. // HTTP-network-or-cache fetch step 2.11
  7564. if (!headers.has('User-Agent')) {
  7565. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7566. }
  7567. // HTTP-network-or-cache fetch step 2.15
  7568. if (request.compress && !headers.has('Accept-Encoding')) {
  7569. headers.set('Accept-Encoding', 'gzip,deflate');
  7570. }
  7571. let agent = request.agent;
  7572. if (typeof agent === 'function') {
  7573. agent = agent(parsedURL);
  7574. }
  7575. if (!headers.has('Connection') && !agent) {
  7576. headers.set('Connection', 'close');
  7577. }
  7578. // HTTP-network fetch step 4.2
  7579. // chunked encoding is handled by Node.js
  7580. return Object.assign({}, parsedURL, {
  7581. method: request.method,
  7582. headers: exportNodeCompatibleHeaders(headers),
  7583. agent
  7584. });
  7585. }
  7586. /**
  7587. * abort-error.js
  7588. *
  7589. * AbortError interface for cancelled requests
  7590. */
  7591. /**
  7592. * Create AbortError instance
  7593. *
  7594. * @param String message Error message for human
  7595. * @return AbortError
  7596. */
  7597. function AbortError(message) {
  7598. Error.call(this, message);
  7599. this.type = 'aborted';
  7600. this.message = message;
  7601. // hide custom error implementation details from end-users
  7602. Error.captureStackTrace(this, this.constructor);
  7603. }
  7604. AbortError.prototype = Object.create(Error.prototype);
  7605. AbortError.prototype.constructor = AbortError;
  7606. AbortError.prototype.name = 'AbortError';
  7607. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7608. const PassThrough$1 = Stream.PassThrough;
  7609. const resolve_url = Url.resolve;
  7610. /**
  7611. * Fetch function
  7612. *
  7613. * @param Mixed url Absolute url or Request instance
  7614. * @param Object opts Fetch options
  7615. * @return Promise
  7616. */
  7617. function fetch(url, opts) {
  7618. // allow custom promise
  7619. if (!fetch.Promise) {
  7620. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7621. }
  7622. Body.Promise = fetch.Promise;
  7623. // wrap http.request into fetch
  7624. return new fetch.Promise(function (resolve, reject) {
  7625. // build request object
  7626. const request = new Request(url, opts);
  7627. const options = getNodeRequestOptions(request);
  7628. const send = (options.protocol === 'https:' ? https : http).request;
  7629. const signal = request.signal;
  7630. let response = null;
  7631. const abort = function abort() {
  7632. let error = new AbortError('The user aborted a request.');
  7633. reject(error);
  7634. if (request.body && request.body instanceof Stream.Readable) {
  7635. request.body.destroy(error);
  7636. }
  7637. if (!response || !response.body) return;
  7638. response.body.emit('error', error);
  7639. };
  7640. if (signal && signal.aborted) {
  7641. abort();
  7642. return;
  7643. }
  7644. const abortAndFinalize = function abortAndFinalize() {
  7645. abort();
  7646. finalize();
  7647. };
  7648. // send request
  7649. const req = send(options);
  7650. let reqTimeout;
  7651. if (signal) {
  7652. signal.addEventListener('abort', abortAndFinalize);
  7653. }
  7654. function finalize() {
  7655. req.abort();
  7656. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7657. clearTimeout(reqTimeout);
  7658. }
  7659. if (request.timeout) {
  7660. req.once('socket', function (socket) {
  7661. reqTimeout = setTimeout(function () {
  7662. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7663. finalize();
  7664. }, request.timeout);
  7665. });
  7666. }
  7667. req.on('error', function (err) {
  7668. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7669. finalize();
  7670. });
  7671. req.on('response', function (res) {
  7672. clearTimeout(reqTimeout);
  7673. const headers = createHeadersLenient(res.headers);
  7674. // HTTP fetch step 5
  7675. if (fetch.isRedirect(res.statusCode)) {
  7676. // HTTP fetch step 5.2
  7677. const location = headers.get('Location');
  7678. // HTTP fetch step 5.3
  7679. const locationURL = location === null ? null : resolve_url(request.url, location);
  7680. // HTTP fetch step 5.5
  7681. switch (request.redirect) {
  7682. case 'error':
  7683. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7684. finalize();
  7685. return;
  7686. case 'manual':
  7687. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7688. if (locationURL !== null) {
  7689. // handle corrupted header
  7690. try {
  7691. headers.set('Location', locationURL);
  7692. } catch (err) {
  7693. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7694. reject(err);
  7695. }
  7696. }
  7697. break;
  7698. case 'follow':
  7699. // HTTP-redirect fetch step 2
  7700. if (locationURL === null) {
  7701. break;
  7702. }
  7703. // HTTP-redirect fetch step 5
  7704. if (request.counter >= request.follow) {
  7705. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7706. finalize();
  7707. return;
  7708. }
  7709. // HTTP-redirect fetch step 6 (counter increment)
  7710. // Create a new Request object.
  7711. const requestOpts = {
  7712. headers: new Headers(request.headers),
  7713. follow: request.follow,
  7714. counter: request.counter + 1,
  7715. agent: request.agent,
  7716. compress: request.compress,
  7717. method: request.method,
  7718. body: request.body,
  7719. signal: request.signal,
  7720. timeout: request.timeout
  7721. };
  7722. // HTTP-redirect fetch step 9
  7723. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7724. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7725. finalize();
  7726. return;
  7727. }
  7728. // HTTP-redirect fetch step 11
  7729. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7730. requestOpts.method = 'GET';
  7731. requestOpts.body = undefined;
  7732. requestOpts.headers.delete('content-length');
  7733. }
  7734. // HTTP-redirect fetch step 15
  7735. resolve(fetch(new Request(locationURL, requestOpts)));
  7736. finalize();
  7737. return;
  7738. }
  7739. }
  7740. // prepare response
  7741. res.once('end', function () {
  7742. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7743. });
  7744. let body = res.pipe(new PassThrough$1());
  7745. const response_options = {
  7746. url: request.url,
  7747. status: res.statusCode,
  7748. statusText: res.statusMessage,
  7749. headers: headers,
  7750. size: request.size,
  7751. timeout: request.timeout,
  7752. counter: request.counter
  7753. };
  7754. // HTTP-network fetch step 12.1.1.3
  7755. const codings = headers.get('Content-Encoding');
  7756. // HTTP-network fetch step 12.1.1.4: handle content codings
  7757. // in following scenarios we ignore compression support
  7758. // 1. compression support is disabled
  7759. // 2. HEAD request
  7760. // 3. no Content-Encoding header
  7761. // 4. no content response (204)
  7762. // 5. content not modified response (304)
  7763. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7764. response = new Response(body, response_options);
  7765. resolve(response);
  7766. return;
  7767. }
  7768. // For Node v6+
  7769. // Be less strict when decoding compressed responses, since sometimes
  7770. // servers send slightly invalid responses that are still accepted
  7771. // by common browsers.
  7772. // Always using Z_SYNC_FLUSH is what cURL does.
  7773. const zlibOptions = {
  7774. flush: zlib.Z_SYNC_FLUSH,
  7775. finishFlush: zlib.Z_SYNC_FLUSH
  7776. };
  7777. // for gzip
  7778. if (codings == 'gzip' || codings == 'x-gzip') {
  7779. body = body.pipe(zlib.createGunzip(zlibOptions));
  7780. response = new Response(body, response_options);
  7781. resolve(response);
  7782. return;
  7783. }
  7784. // for deflate
  7785. if (codings == 'deflate' || codings == 'x-deflate') {
  7786. // handle the infamous raw deflate response from old servers
  7787. // a hack for old IIS and Apache servers
  7788. const raw = res.pipe(new PassThrough$1());
  7789. raw.once('data', function (chunk) {
  7790. // see http://stackoverflow.com/questions/37519828
  7791. if ((chunk[0] & 0x0F) === 0x08) {
  7792. body = body.pipe(zlib.createInflate());
  7793. } else {
  7794. body = body.pipe(zlib.createInflateRaw());
  7795. }
  7796. response = new Response(body, response_options);
  7797. resolve(response);
  7798. });
  7799. return;
  7800. }
  7801. // for br
  7802. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7803. body = body.pipe(zlib.createBrotliDecompress());
  7804. response = new Response(body, response_options);
  7805. resolve(response);
  7806. return;
  7807. }
  7808. // otherwise, use response as-is
  7809. response = new Response(body, response_options);
  7810. resolve(response);
  7811. });
  7812. writeToStream(req, request);
  7813. });
  7814. }
  7815. /**
  7816. * Redirect code matching
  7817. *
  7818. * @param Number code Status code
  7819. * @return Boolean
  7820. */
  7821. fetch.isRedirect = function (code) {
  7822. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7823. };
  7824. // expose Promise
  7825. fetch.Promise = global.Promise;
  7826. module.exports = exports = fetch;
  7827. Object.defineProperty(exports, "__esModule", { value: true });
  7828. exports.default = exports;
  7829. exports.Headers = Headers;
  7830. exports.Request = Request;
  7831. exports.Response = Response;
  7832. exports.FetchError = FetchError;
  7833. /***/ }),
  7834. /***/ 462:
  7835. /***/ (function(module) {
  7836. "use strict";
  7837. // See http://www.robvanderwoude.com/escapechars.php
  7838. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7839. function escapeCommand(arg) {
  7840. // Escape meta chars
  7841. arg = arg.replace(metaCharsRegExp, '^$1');
  7842. return arg;
  7843. }
  7844. function escapeArgument(arg, doubleEscapeMetaChars) {
  7845. // Convert to string
  7846. arg = `${arg}`;
  7847. // Algorithm below is based on https://qntm.org/cmd
  7848. // Sequence of backslashes followed by a double quote:
  7849. // double up all the backslashes and escape the double quote
  7850. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7851. // Sequence of backslashes followed by the end of the string
  7852. // (which will become a double quote later):
  7853. // double up all the backslashes
  7854. arg = arg.replace(/(\\*)$/, '$1$1');
  7855. // All other backslashes occur literally
  7856. // Quote the whole thing:
  7857. arg = `"${arg}"`;
  7858. // Escape meta chars
  7859. arg = arg.replace(metaCharsRegExp, '^$1');
  7860. // Double escape meta chars if necessary
  7861. if (doubleEscapeMetaChars) {
  7862. arg = arg.replace(metaCharsRegExp, '^$1');
  7863. }
  7864. return arg;
  7865. }
  7866. module.exports.command = escapeCommand;
  7867. module.exports.argument = escapeArgument;
  7868. /***/ }),
  7869. /***/ 463:
  7870. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7871. "use strict";
  7872. Object.defineProperty(exports, '__esModule', { value: true });
  7873. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7874. var deprecation = __webpack_require__(692);
  7875. var once = _interopDefault(__webpack_require__(969));
  7876. const logOnce = once(deprecation => console.warn(deprecation));
  7877. /**
  7878. * Error with extra properties to help with debugging
  7879. */
  7880. class RequestError extends Error {
  7881. constructor(message, statusCode, options) {
  7882. super(message); // Maintains proper stack trace (only available on V8)
  7883. /* istanbul ignore next */
  7884. if (Error.captureStackTrace) {
  7885. Error.captureStackTrace(this, this.constructor);
  7886. }
  7887. this.name = "HttpError";
  7888. this.status = statusCode;
  7889. Object.defineProperty(this, "code", {
  7890. get() {
  7891. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7892. return statusCode;
  7893. }
  7894. });
  7895. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7896. const requestCopy = Object.assign({}, options.request);
  7897. if (options.request.headers.authorization) {
  7898. requestCopy.headers = Object.assign({}, options.request.headers, {
  7899. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7900. });
  7901. }
  7902. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7903. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7904. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7905. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7906. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7907. this.request = requestCopy;
  7908. }
  7909. }
  7910. exports.RequestError = RequestError;
  7911. //# sourceMappingURL=index.js.map
  7912. /***/ }),
  7913. /***/ 464:
  7914. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7915. "use strict";
  7916. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7917. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7918. return new (P || (P = Promise))(function (resolve, reject) {
  7919. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7920. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7921. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7922. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7923. });
  7924. };
  7925. var __importStar = (this && this.__importStar) || function (mod) {
  7926. if (mod && mod.__esModule) return mod;
  7927. var result = {};
  7928. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7929. result["default"] = mod;
  7930. return result;
  7931. };
  7932. var __importDefault = (this && this.__importDefault) || function (mod) {
  7933. return (mod && mod.__esModule) ? mod : { "default": mod };
  7934. };
  7935. Object.defineProperty(exports, "__esModule", { value: true });
  7936. const assert = __importStar(__webpack_require__(357));
  7937. const core = __importStar(__webpack_require__(470));
  7938. const fs = __importStar(__webpack_require__(747));
  7939. const github = __importStar(__webpack_require__(469));
  7940. const io = __importStar(__webpack_require__(1));
  7941. const path = __importStar(__webpack_require__(622));
  7942. const retryHelper = __importStar(__webpack_require__(587));
  7943. const toolCache = __importStar(__webpack_require__(533));
  7944. const v4_1 = __importDefault(__webpack_require__(826));
  7945. const IS_WINDOWS = process.platform === 'win32';
  7946. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  7947. return __awaiter(this, void 0, void 0, function* () {
  7948. // Download the archive
  7949. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7950. core.info('Downloading the archive');
  7951. return yield downloadArchive(authToken, owner, repo, ref, commit);
  7952. }));
  7953. // Write archive to disk
  7954. core.info('Writing archive to disk');
  7955. const uniqueId = v4_1.default();
  7956. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  7957. yield fs.promises.writeFile(archivePath, archiveData);
  7958. archiveData = Buffer.from(''); // Free memory
  7959. // Extract archive
  7960. core.info('Extracting the archive');
  7961. const extractPath = path.join(repositoryPath, uniqueId);
  7962. yield io.mkdirP(extractPath);
  7963. if (IS_WINDOWS) {
  7964. yield toolCache.extractZip(archivePath, extractPath);
  7965. }
  7966. else {
  7967. yield toolCache.extractTar(archivePath, extractPath);
  7968. }
  7969. io.rmRF(archivePath);
  7970. // Determine the path of the repository content. The archive contains
  7971. // a top-level folder and the repository content is inside.
  7972. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7973. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7974. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  7975. core.info(`Resolved version ${archiveVersion}`);
  7976. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  7977. // Move the files
  7978. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  7979. const sourcePath = path.join(tempRepositoryPath, fileName);
  7980. const targetPath = path.join(repositoryPath, fileName);
  7981. if (IS_WINDOWS) {
  7982. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  7983. }
  7984. else {
  7985. yield io.mv(sourcePath, targetPath);
  7986. }
  7987. }
  7988. io.rmRF(extractPath);
  7989. });
  7990. }
  7991. exports.downloadRepository = downloadRepository;
  7992. function downloadArchive(authToken, owner, repo, ref, commit) {
  7993. return __awaiter(this, void 0, void 0, function* () {
  7994. const octokit = new github.GitHub(authToken);
  7995. const params = {
  7996. owner: owner,
  7997. repo: repo,
  7998. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7999. ref: commit || ref
  8000. };
  8001. const response = yield octokit.repos.getArchiveLink(params);
  8002. if (response.status != 200) {
  8003. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8004. }
  8005. return Buffer.from(response.data); // response.data is ArrayBuffer
  8006. });
  8007. }
  8008. /***/ }),
  8009. /***/ 469:
  8010. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8011. "use strict";
  8012. var __importDefault = (this && this.__importDefault) || function (mod) {
  8013. return (mod && mod.__esModule) ? mod : { "default": mod };
  8014. };
  8015. var __importStar = (this && this.__importStar) || function (mod) {
  8016. if (mod && mod.__esModule) return mod;
  8017. var result = {};
  8018. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8019. result["default"] = mod;
  8020. return result;
  8021. };
  8022. Object.defineProperty(exports, "__esModule", { value: true });
  8023. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8024. const graphql_1 = __webpack_require__(898);
  8025. const rest_1 = __importDefault(__webpack_require__(0));
  8026. const Context = __importStar(__webpack_require__(262));
  8027. const httpClient = __importStar(__webpack_require__(539));
  8028. // We need this in order to extend Octokit
  8029. rest_1.default.prototype = new rest_1.default();
  8030. exports.context = new Context.Context();
  8031. class GitHub extends rest_1.default {
  8032. constructor(token, opts) {
  8033. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8034. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8035. }
  8036. /**
  8037. * Disambiguates the constructor overload parameters
  8038. */
  8039. static disambiguate(token, opts) {
  8040. return [
  8041. typeof token === 'string' ? token : '',
  8042. typeof token === 'object' ? token : opts || {}
  8043. ];
  8044. }
  8045. static getOctokitOptions(args) {
  8046. const token = args[0];
  8047. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8048. // Auth
  8049. const auth = GitHub.getAuthString(token, options);
  8050. if (auth) {
  8051. options.auth = auth;
  8052. }
  8053. // Proxy
  8054. const agent = GitHub.getProxyAgent(options);
  8055. if (agent) {
  8056. // Shallow clone - don't mutate the object provided by the caller
  8057. options.request = options.request ? Object.assign({}, options.request) : {};
  8058. // Set the agent
  8059. options.request.agent = agent;
  8060. }
  8061. return options;
  8062. }
  8063. static getGraphQL(args) {
  8064. const defaults = {};
  8065. const token = args[0];
  8066. const options = args[1];
  8067. // Authorization
  8068. const auth = this.getAuthString(token, options);
  8069. if (auth) {
  8070. defaults.headers = {
  8071. authorization: auth
  8072. };
  8073. }
  8074. // Proxy
  8075. const agent = GitHub.getProxyAgent(options);
  8076. if (agent) {
  8077. defaults.request = { agent };
  8078. }
  8079. return graphql_1.graphql.defaults(defaults);
  8080. }
  8081. static getAuthString(token, options) {
  8082. // Validate args
  8083. if (!token && !options.auth) {
  8084. throw new Error('Parameter token or opts.auth is required');
  8085. }
  8086. else if (token && options.auth) {
  8087. throw new Error('Parameters token and opts.auth may not both be specified');
  8088. }
  8089. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8090. }
  8091. static getProxyAgent(options) {
  8092. var _a;
  8093. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8094. const serverUrl = 'https://api.github.com';
  8095. if (httpClient.getProxyUrl(serverUrl)) {
  8096. const hc = new httpClient.HttpClient();
  8097. return hc.getAgent(serverUrl);
  8098. }
  8099. }
  8100. return undefined;
  8101. }
  8102. }
  8103. exports.GitHub = GitHub;
  8104. //# sourceMappingURL=github.js.map
  8105. /***/ }),
  8106. /***/ 470:
  8107. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8108. "use strict";
  8109. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8110. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8111. return new (P || (P = Promise))(function (resolve, reject) {
  8112. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8113. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8114. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8115. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8116. });
  8117. };
  8118. Object.defineProperty(exports, "__esModule", { value: true });
  8119. const command_1 = __webpack_require__(431);
  8120. const os = __webpack_require__(87);
  8121. const path = __webpack_require__(622);
  8122. /**
  8123. * The code to exit an action
  8124. */
  8125. var ExitCode;
  8126. (function (ExitCode) {
  8127. /**
  8128. * A code indicating that the action was successful
  8129. */
  8130. ExitCode[ExitCode["Success"] = 0] = "Success";
  8131. /**
  8132. * A code indicating that the action was a failure
  8133. */
  8134. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8135. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8136. //-----------------------------------------------------------------------
  8137. // Variables
  8138. //-----------------------------------------------------------------------
  8139. /**
  8140. * Sets env variable for this action and future actions in the job
  8141. * @param name the name of the variable to set
  8142. * @param val the value of the variable
  8143. */
  8144. function exportVariable(name, val) {
  8145. process.env[name] = val;
  8146. command_1.issueCommand('set-env', { name }, val);
  8147. }
  8148. exports.exportVariable = exportVariable;
  8149. /**
  8150. * Registers a secret which will get masked from logs
  8151. * @param secret value of the secret
  8152. */
  8153. function setSecret(secret) {
  8154. command_1.issueCommand('add-mask', {}, secret);
  8155. }
  8156. exports.setSecret = setSecret;
  8157. /**
  8158. * Prepends inputPath to the PATH (for this action and future actions)
  8159. * @param inputPath
  8160. */
  8161. function addPath(inputPath) {
  8162. command_1.issueCommand('add-path', {}, inputPath);
  8163. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8164. }
  8165. exports.addPath = addPath;
  8166. /**
  8167. * Gets the value of an input. The value is also trimmed.
  8168. *
  8169. * @param name name of the input to get
  8170. * @param options optional. See InputOptions.
  8171. * @returns string
  8172. */
  8173. function getInput(name, options) {
  8174. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8175. if (options && options.required && !val) {
  8176. throw new Error(`Input required and not supplied: ${name}`);
  8177. }
  8178. return val.trim();
  8179. }
  8180. exports.getInput = getInput;
  8181. /**
  8182. * Sets the value of an output.
  8183. *
  8184. * @param name name of the output to set
  8185. * @param value value to store
  8186. */
  8187. function setOutput(name, value) {
  8188. command_1.issueCommand('set-output', { name }, value);
  8189. }
  8190. exports.setOutput = setOutput;
  8191. //-----------------------------------------------------------------------
  8192. // Results
  8193. //-----------------------------------------------------------------------
  8194. /**
  8195. * Sets the action status to failed.
  8196. * When the action exits it will be with an exit code of 1
  8197. * @param message add error issue message
  8198. */
  8199. function setFailed(message) {
  8200. process.exitCode = ExitCode.Failure;
  8201. error(message);
  8202. }
  8203. exports.setFailed = setFailed;
  8204. //-----------------------------------------------------------------------
  8205. // Logging Commands
  8206. //-----------------------------------------------------------------------
  8207. /**
  8208. * Writes debug message to user log
  8209. * @param message debug message
  8210. */
  8211. function debug(message) {
  8212. command_1.issueCommand('debug', {}, message);
  8213. }
  8214. exports.debug = debug;
  8215. /**
  8216. * Adds an error issue
  8217. * @param message error issue message
  8218. */
  8219. function error(message) {
  8220. command_1.issue('error', message);
  8221. }
  8222. exports.error = error;
  8223. /**
  8224. * Adds an warning issue
  8225. * @param message warning issue message
  8226. */
  8227. function warning(message) {
  8228. command_1.issue('warning', message);
  8229. }
  8230. exports.warning = warning;
  8231. /**
  8232. * Writes info to log with console.log.
  8233. * @param message info message
  8234. */
  8235. function info(message) {
  8236. process.stdout.write(message + os.EOL);
  8237. }
  8238. exports.info = info;
  8239. /**
  8240. * Begin an output group.
  8241. *
  8242. * Output until the next `groupEnd` will be foldable in this group
  8243. *
  8244. * @param name The name of the output group
  8245. */
  8246. function startGroup(name) {
  8247. command_1.issue('group', name);
  8248. }
  8249. exports.startGroup = startGroup;
  8250. /**
  8251. * End an output group.
  8252. */
  8253. function endGroup() {
  8254. command_1.issue('endgroup');
  8255. }
  8256. exports.endGroup = endGroup;
  8257. /**
  8258. * Wrap an asynchronous function call in a group.
  8259. *
  8260. * Returns the same type as the function itself.
  8261. *
  8262. * @param name The name of the group
  8263. * @param fn The function to wrap in the group
  8264. */
  8265. function group(name, fn) {
  8266. return __awaiter(this, void 0, void 0, function* () {
  8267. startGroup(name);
  8268. let result;
  8269. try {
  8270. result = yield fn();
  8271. }
  8272. finally {
  8273. endGroup();
  8274. }
  8275. return result;
  8276. });
  8277. }
  8278. exports.group = group;
  8279. //# sourceMappingURL=core.js.map
  8280. /***/ }),
  8281. /***/ 471:
  8282. /***/ (function(module, __unusedexports, __webpack_require__) {
  8283. module.exports = authenticationBeforeRequest;
  8284. const btoa = __webpack_require__(675);
  8285. const uniq = __webpack_require__(126);
  8286. function authenticationBeforeRequest(state, options) {
  8287. if (!state.auth.type) {
  8288. return;
  8289. }
  8290. if (state.auth.type === "basic") {
  8291. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8292. options.headers.authorization = `Basic ${hash}`;
  8293. return;
  8294. }
  8295. if (state.auth.type === "token") {
  8296. options.headers.authorization = `token ${state.auth.token}`;
  8297. return;
  8298. }
  8299. if (state.auth.type === "app") {
  8300. options.headers.authorization = `Bearer ${state.auth.token}`;
  8301. const acceptHeaders = options.headers.accept
  8302. .split(",")
  8303. .concat("application/vnd.github.machine-man-preview+json");
  8304. options.headers.accept = uniq(acceptHeaders)
  8305. .filter(Boolean)
  8306. .join(",");
  8307. return;
  8308. }
  8309. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8310. if (state.auth.token) {
  8311. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8312. return;
  8313. }
  8314. const key = encodeURIComponent(state.auth.key);
  8315. const secret = encodeURIComponent(state.auth.secret);
  8316. options.url += `client_id=${key}&client_secret=${secret}`;
  8317. }
  8318. /***/ }),
  8319. /***/ 489:
  8320. /***/ (function(module, __unusedexports, __webpack_require__) {
  8321. "use strict";
  8322. const path = __webpack_require__(622);
  8323. const which = __webpack_require__(814);
  8324. const pathKey = __webpack_require__(39)();
  8325. function resolveCommandAttempt(parsed, withoutPathExt) {
  8326. const cwd = process.cwd();
  8327. const hasCustomCwd = parsed.options.cwd != null;
  8328. // If a custom `cwd` was specified, we need to change the process cwd
  8329. // because `which` will do stat calls but does not support a custom cwd
  8330. if (hasCustomCwd) {
  8331. try {
  8332. process.chdir(parsed.options.cwd);
  8333. } catch (err) {
  8334. /* Empty */
  8335. }
  8336. }
  8337. let resolved;
  8338. try {
  8339. resolved = which.sync(parsed.command, {
  8340. path: (parsed.options.env || process.env)[pathKey],
  8341. pathExt: withoutPathExt ? path.delimiter : undefined,
  8342. });
  8343. } catch (e) {
  8344. /* Empty */
  8345. } finally {
  8346. process.chdir(cwd);
  8347. }
  8348. // If we successfully resolved, ensure that an absolute path is returned
  8349. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8350. if (resolved) {
  8351. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8352. }
  8353. return resolved;
  8354. }
  8355. function resolveCommand(parsed) {
  8356. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8357. }
  8358. module.exports = resolveCommand;
  8359. /***/ }),
  8360. /***/ 510:
  8361. /***/ (function(module) {
  8362. module.exports = addHook
  8363. function addHook (state, kind, name, hook) {
  8364. var orig = hook
  8365. if (!state.registry[name]) {
  8366. state.registry[name] = []
  8367. }
  8368. if (kind === 'before') {
  8369. hook = function (method, options) {
  8370. return Promise.resolve()
  8371. .then(orig.bind(null, options))
  8372. .then(method.bind(null, options))
  8373. }
  8374. }
  8375. if (kind === 'after') {
  8376. hook = function (method, options) {
  8377. var result
  8378. return Promise.resolve()
  8379. .then(method.bind(null, options))
  8380. .then(function (result_) {
  8381. result = result_
  8382. return orig(result, options)
  8383. })
  8384. .then(function () {
  8385. return result
  8386. })
  8387. }
  8388. }
  8389. if (kind === 'error') {
  8390. hook = function (method, options) {
  8391. return Promise.resolve()
  8392. .then(method.bind(null, options))
  8393. .catch(function (error) {
  8394. return orig(error, options)
  8395. })
  8396. }
  8397. }
  8398. state.registry[name].push({
  8399. hook: hook,
  8400. orig: orig
  8401. })
  8402. }
  8403. /***/ }),
  8404. /***/ 523:
  8405. /***/ (function(module, __unusedexports, __webpack_require__) {
  8406. var register = __webpack_require__(363)
  8407. var addHook = __webpack_require__(510)
  8408. var removeHook = __webpack_require__(763)
  8409. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8410. var bind = Function.bind
  8411. var bindable = bind.bind(bind)
  8412. function bindApi (hook, state, name) {
  8413. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8414. hook.api = { remove: removeHookRef }
  8415. hook.remove = removeHookRef
  8416. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8417. var args = name ? [state, kind, name] : [state, kind]
  8418. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8419. })
  8420. }
  8421. function HookSingular () {
  8422. var singularHookName = 'h'
  8423. var singularHookState = {
  8424. registry: {}
  8425. }
  8426. var singularHook = register.bind(null, singularHookState, singularHookName)
  8427. bindApi(singularHook, singularHookState, singularHookName)
  8428. return singularHook
  8429. }
  8430. function HookCollection () {
  8431. var state = {
  8432. registry: {}
  8433. }
  8434. var hook = register.bind(null, state)
  8435. bindApi(hook, state)
  8436. return hook
  8437. }
  8438. var collectionHookDeprecationMessageDisplayed = false
  8439. function Hook () {
  8440. if (!collectionHookDeprecationMessageDisplayed) {
  8441. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8442. collectionHookDeprecationMessageDisplayed = true
  8443. }
  8444. return HookCollection()
  8445. }
  8446. Hook.Singular = HookSingular.bind()
  8447. Hook.Collection = HookCollection.bind()
  8448. module.exports = Hook
  8449. // expose constructors as a named property for TypeScript
  8450. module.exports.Hook = Hook
  8451. module.exports.Singular = Hook.Singular
  8452. module.exports.Collection = Hook.Collection
  8453. /***/ }),
  8454. /***/ 528:
  8455. /***/ (function(__unusedmodule, exports) {
  8456. "use strict";
  8457. Object.defineProperty(exports, "__esModule", { value: true });
  8458. function escape(value) {
  8459. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8460. return `\\${x}`;
  8461. });
  8462. }
  8463. exports.escape = escape;
  8464. /***/ }),
  8465. /***/ 529:
  8466. /***/ (function(module, __unusedexports, __webpack_require__) {
  8467. const factory = __webpack_require__(47);
  8468. module.exports = factory();
  8469. /***/ }),
  8470. /***/ 533:
  8471. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8472. "use strict";
  8473. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8474. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8475. return new (P || (P = Promise))(function (resolve, reject) {
  8476. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8477. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8478. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8479. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8480. });
  8481. };
  8482. Object.defineProperty(exports, "__esModule", { value: true });
  8483. const core = __webpack_require__(470);
  8484. const io = __webpack_require__(1);
  8485. const fs = __webpack_require__(747);
  8486. const os = __webpack_require__(87);
  8487. const path = __webpack_require__(622);
  8488. const httpm = __webpack_require__(874);
  8489. const semver = __webpack_require__(656);
  8490. const uuidV4 = __webpack_require__(826);
  8491. const exec_1 = __webpack_require__(986);
  8492. const assert_1 = __webpack_require__(357);
  8493. class HTTPError extends Error {
  8494. constructor(httpStatusCode) {
  8495. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8496. this.httpStatusCode = httpStatusCode;
  8497. Object.setPrototypeOf(this, new.target.prototype);
  8498. }
  8499. }
  8500. exports.HTTPError = HTTPError;
  8501. const IS_WINDOWS = process.platform === 'win32';
  8502. const userAgent = 'actions/tool-cache';
  8503. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8504. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8505. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8506. // If directories not found, place them in common temp locations
  8507. if (!tempDirectory || !cacheRoot) {
  8508. let baseLocation;
  8509. if (IS_WINDOWS) {
  8510. // On windows use the USERPROFILE env variable
  8511. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8512. }
  8513. else {
  8514. if (process.platform === 'darwin') {
  8515. baseLocation = '/Users';
  8516. }
  8517. else {
  8518. baseLocation = '/home';
  8519. }
  8520. }
  8521. if (!tempDirectory) {
  8522. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8523. }
  8524. if (!cacheRoot) {
  8525. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8526. }
  8527. }
  8528. /**
  8529. * Download a tool from an url and stream it into a file
  8530. *
  8531. * @param url url of tool to download
  8532. * @returns path to downloaded tool
  8533. */
  8534. function downloadTool(url) {
  8535. return __awaiter(this, void 0, void 0, function* () {
  8536. // Wrap in a promise so that we can resolve from within stream callbacks
  8537. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8538. try {
  8539. const http = new httpm.HttpClient(userAgent, [], {
  8540. allowRetries: true,
  8541. maxRetries: 3
  8542. });
  8543. const destPath = path.join(tempDirectory, uuidV4());
  8544. yield io.mkdirP(tempDirectory);
  8545. core.debug(`Downloading ${url}`);
  8546. core.debug(`Downloading ${destPath}`);
  8547. if (fs.existsSync(destPath)) {
  8548. throw new Error(`Destination file path ${destPath} already exists`);
  8549. }
  8550. const response = yield http.get(url);
  8551. if (response.message.statusCode !== 200) {
  8552. const err = new HTTPError(response.message.statusCode);
  8553. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8554. throw err;
  8555. }
  8556. const file = fs.createWriteStream(destPath);
  8557. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8558. try {
  8559. const stream = response.message.pipe(file);
  8560. stream.on('close', () => {
  8561. core.debug('download complete');
  8562. resolve(destPath);
  8563. });
  8564. }
  8565. catch (err) {
  8566. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8567. reject(err);
  8568. }
  8569. }));
  8570. file.on('error', err => {
  8571. file.end();
  8572. reject(err);
  8573. });
  8574. }
  8575. catch (err) {
  8576. reject(err);
  8577. }
  8578. }));
  8579. });
  8580. }
  8581. exports.downloadTool = downloadTool;
  8582. /**
  8583. * Extract a .7z file
  8584. *
  8585. * @param file path to the .7z file
  8586. * @param dest destination directory. Optional.
  8587. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8588. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8589. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8590. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8591. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8592. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8593. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8594. * to 7zr.exe can be pass to this function.
  8595. * @returns path to the destination directory
  8596. */
  8597. function extract7z(file, dest, _7zPath) {
  8598. return __awaiter(this, void 0, void 0, function* () {
  8599. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8600. assert_1.ok(file, 'parameter "file" is required');
  8601. dest = dest || (yield _createExtractFolder(dest));
  8602. const originalCwd = process.cwd();
  8603. process.chdir(dest);
  8604. if (_7zPath) {
  8605. try {
  8606. const args = [
  8607. 'x',
  8608. '-bb1',
  8609. '-bd',
  8610. '-sccUTF-8',
  8611. file
  8612. ];
  8613. const options = {
  8614. silent: true
  8615. };
  8616. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8617. }
  8618. finally {
  8619. process.chdir(originalCwd);
  8620. }
  8621. }
  8622. else {
  8623. const escapedScript = path
  8624. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8625. .replace(/'/g, "''")
  8626. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8627. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8628. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8629. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8630. const args = [
  8631. '-NoLogo',
  8632. '-Sta',
  8633. '-NoProfile',
  8634. '-NonInteractive',
  8635. '-ExecutionPolicy',
  8636. 'Unrestricted',
  8637. '-Command',
  8638. command
  8639. ];
  8640. const options = {
  8641. silent: true
  8642. };
  8643. try {
  8644. const powershellPath = yield io.which('powershell', true);
  8645. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8646. }
  8647. finally {
  8648. process.chdir(originalCwd);
  8649. }
  8650. }
  8651. return dest;
  8652. });
  8653. }
  8654. exports.extract7z = extract7z;
  8655. /**
  8656. * Extract a tar
  8657. *
  8658. * @param file path to the tar
  8659. * @param dest destination directory. Optional.
  8660. * @param flags flags for the tar. Optional.
  8661. * @returns path to the destination directory
  8662. */
  8663. function extractTar(file, dest, flags = 'xz') {
  8664. return __awaiter(this, void 0, void 0, function* () {
  8665. if (!file) {
  8666. throw new Error("parameter 'file' is required");
  8667. }
  8668. dest = dest || (yield _createExtractFolder(dest));
  8669. const tarPath = yield io.which('tar', true);
  8670. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8671. return dest;
  8672. });
  8673. }
  8674. exports.extractTar = extractTar;
  8675. /**
  8676. * Extract a zip
  8677. *
  8678. * @param file path to the zip
  8679. * @param dest destination directory. Optional.
  8680. * @returns path to the destination directory
  8681. */
  8682. function extractZip(file, dest) {
  8683. return __awaiter(this, void 0, void 0, function* () {
  8684. if (!file) {
  8685. throw new Error("parameter 'file' is required");
  8686. }
  8687. dest = dest || (yield _createExtractFolder(dest));
  8688. if (IS_WINDOWS) {
  8689. yield extractZipWin(file, dest);
  8690. }
  8691. else {
  8692. yield extractZipNix(file, dest);
  8693. }
  8694. return dest;
  8695. });
  8696. }
  8697. exports.extractZip = extractZip;
  8698. function extractZipWin(file, dest) {
  8699. return __awaiter(this, void 0, void 0, function* () {
  8700. // build the powershell command
  8701. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8702. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8703. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8704. // run powershell
  8705. const powershellPath = yield io.which('powershell');
  8706. const args = [
  8707. '-NoLogo',
  8708. '-Sta',
  8709. '-NoProfile',
  8710. '-NonInteractive',
  8711. '-ExecutionPolicy',
  8712. 'Unrestricted',
  8713. '-Command',
  8714. command
  8715. ];
  8716. yield exec_1.exec(`"${powershellPath}"`, args);
  8717. });
  8718. }
  8719. function extractZipNix(file, dest) {
  8720. return __awaiter(this, void 0, void 0, function* () {
  8721. const unzipPath = yield io.which('unzip');
  8722. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8723. });
  8724. }
  8725. /**
  8726. * Caches a directory and installs it into the tool cacheDir
  8727. *
  8728. * @param sourceDir the directory to cache into tools
  8729. * @param tool tool name
  8730. * @param version version of the tool. semver format
  8731. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8732. */
  8733. function cacheDir(sourceDir, tool, version, arch) {
  8734. return __awaiter(this, void 0, void 0, function* () {
  8735. version = semver.clean(version) || version;
  8736. arch = arch || os.arch();
  8737. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8738. core.debug(`source dir: ${sourceDir}`);
  8739. if (!fs.statSync(sourceDir).isDirectory()) {
  8740. throw new Error('sourceDir is not a directory');
  8741. }
  8742. // Create the tool dir
  8743. const destPath = yield _createToolPath(tool, version, arch);
  8744. // copy each child item. do not move. move can fail on Windows
  8745. // due to anti-virus software having an open handle on a file.
  8746. for (const itemName of fs.readdirSync(sourceDir)) {
  8747. const s = path.join(sourceDir, itemName);
  8748. yield io.cp(s, destPath, { recursive: true });
  8749. }
  8750. // write .complete
  8751. _completeToolPath(tool, version, arch);
  8752. return destPath;
  8753. });
  8754. }
  8755. exports.cacheDir = cacheDir;
  8756. /**
  8757. * Caches a downloaded file (GUID) and installs it
  8758. * into the tool cache with a given targetName
  8759. *
  8760. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8761. * @param targetFile the name of the file name in the tools directory
  8762. * @param tool tool name
  8763. * @param version version of the tool. semver format
  8764. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8765. */
  8766. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8767. return __awaiter(this, void 0, void 0, function* () {
  8768. version = semver.clean(version) || version;
  8769. arch = arch || os.arch();
  8770. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8771. core.debug(`source file: ${sourceFile}`);
  8772. if (!fs.statSync(sourceFile).isFile()) {
  8773. throw new Error('sourceFile is not a file');
  8774. }
  8775. // create the tool dir
  8776. const destFolder = yield _createToolPath(tool, version, arch);
  8777. // copy instead of move. move can fail on Windows due to
  8778. // anti-virus software having an open handle on a file.
  8779. const destPath = path.join(destFolder, targetFile);
  8780. core.debug(`destination file ${destPath}`);
  8781. yield io.cp(sourceFile, destPath);
  8782. // write .complete
  8783. _completeToolPath(tool, version, arch);
  8784. return destFolder;
  8785. });
  8786. }
  8787. exports.cacheFile = cacheFile;
  8788. /**
  8789. * Finds the path to a tool version in the local installed tool cache
  8790. *
  8791. * @param toolName name of the tool
  8792. * @param versionSpec version of the tool
  8793. * @param arch optional arch. defaults to arch of computer
  8794. */
  8795. function find(toolName, versionSpec, arch) {
  8796. if (!toolName) {
  8797. throw new Error('toolName parameter is required');
  8798. }
  8799. if (!versionSpec) {
  8800. throw new Error('versionSpec parameter is required');
  8801. }
  8802. arch = arch || os.arch();
  8803. // attempt to resolve an explicit version
  8804. if (!_isExplicitVersion(versionSpec)) {
  8805. const localVersions = findAllVersions(toolName, arch);
  8806. const match = _evaluateVersions(localVersions, versionSpec);
  8807. versionSpec = match;
  8808. }
  8809. // check for the explicit version in the cache
  8810. let toolPath = '';
  8811. if (versionSpec) {
  8812. versionSpec = semver.clean(versionSpec) || '';
  8813. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8814. core.debug(`checking cache: ${cachePath}`);
  8815. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8816. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8817. toolPath = cachePath;
  8818. }
  8819. else {
  8820. core.debug('not found');
  8821. }
  8822. }
  8823. return toolPath;
  8824. }
  8825. exports.find = find;
  8826. /**
  8827. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8828. *
  8829. * @param toolName name of the tool
  8830. * @param arch optional arch. defaults to arch of computer
  8831. */
  8832. function findAllVersions(toolName, arch) {
  8833. const versions = [];
  8834. arch = arch || os.arch();
  8835. const toolPath = path.join(cacheRoot, toolName);
  8836. if (fs.existsSync(toolPath)) {
  8837. const children = fs.readdirSync(toolPath);
  8838. for (const child of children) {
  8839. if (_isExplicitVersion(child)) {
  8840. const fullPath = path.join(toolPath, child, arch || '');
  8841. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8842. versions.push(child);
  8843. }
  8844. }
  8845. }
  8846. }
  8847. return versions;
  8848. }
  8849. exports.findAllVersions = findAllVersions;
  8850. function _createExtractFolder(dest) {
  8851. return __awaiter(this, void 0, void 0, function* () {
  8852. if (!dest) {
  8853. // create a temp dir
  8854. dest = path.join(tempDirectory, uuidV4());
  8855. }
  8856. yield io.mkdirP(dest);
  8857. return dest;
  8858. });
  8859. }
  8860. function _createToolPath(tool, version, arch) {
  8861. return __awaiter(this, void 0, void 0, function* () {
  8862. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8863. core.debug(`destination ${folderPath}`);
  8864. const markerPath = `${folderPath}.complete`;
  8865. yield io.rmRF(folderPath);
  8866. yield io.rmRF(markerPath);
  8867. yield io.mkdirP(folderPath);
  8868. return folderPath;
  8869. });
  8870. }
  8871. function _completeToolPath(tool, version, arch) {
  8872. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8873. const markerPath = `${folderPath}.complete`;
  8874. fs.writeFileSync(markerPath, '');
  8875. core.debug('finished caching tool');
  8876. }
  8877. function _isExplicitVersion(versionSpec) {
  8878. const c = semver.clean(versionSpec) || '';
  8879. core.debug(`isExplicit: ${c}`);
  8880. const valid = semver.valid(c) != null;
  8881. core.debug(`explicit? ${valid}`);
  8882. return valid;
  8883. }
  8884. function _evaluateVersions(versions, versionSpec) {
  8885. let version = '';
  8886. core.debug(`evaluating ${versions.length} versions`);
  8887. versions = versions.sort((a, b) => {
  8888. if (semver.gt(a, b)) {
  8889. return 1;
  8890. }
  8891. return -1;
  8892. });
  8893. for (let i = versions.length - 1; i >= 0; i--) {
  8894. const potential = versions[i];
  8895. const satisfied = semver.satisfies(potential, versionSpec);
  8896. if (satisfied) {
  8897. version = potential;
  8898. break;
  8899. }
  8900. }
  8901. if (version) {
  8902. core.debug(`matched: ${version}`);
  8903. }
  8904. else {
  8905. core.debug('match not found');
  8906. }
  8907. return version;
  8908. }
  8909. //# sourceMappingURL=tool-cache.js.map
  8910. /***/ }),
  8911. /***/ 536:
  8912. /***/ (function(module, __unusedexports, __webpack_require__) {
  8913. module.exports = hasFirstPage
  8914. const deprecate = __webpack_require__(370)
  8915. const getPageLinks = __webpack_require__(577)
  8916. function hasFirstPage (link) {
  8917. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8918. return getPageLinks(link).first
  8919. }
  8920. /***/ }),
  8921. /***/ 539:
  8922. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8923. "use strict";
  8924. Object.defineProperty(exports, "__esModule", { value: true });
  8925. const url = __webpack_require__(835);
  8926. const http = __webpack_require__(605);
  8927. const https = __webpack_require__(211);
  8928. const pm = __webpack_require__(950);
  8929. let tunnel;
  8930. var HttpCodes;
  8931. (function (HttpCodes) {
  8932. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  8933. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  8934. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  8935. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  8936. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  8937. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  8938. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  8939. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  8940. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  8941. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  8942. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  8943. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  8944. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  8945. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  8946. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  8947. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  8948. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  8949. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  8950. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  8951. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  8952. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  8953. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  8954. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  8955. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  8956. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  8957. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  8958. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  8959. /**
  8960. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  8961. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  8962. */
  8963. function getProxyUrl(serverUrl) {
  8964. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  8965. return proxyUrl ? proxyUrl.href : '';
  8966. }
  8967. exports.getProxyUrl = getProxyUrl;
  8968. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  8969. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  8970. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  8971. const ExponentialBackoffCeiling = 10;
  8972. const ExponentialBackoffTimeSlice = 5;
  8973. class HttpClientResponse {
  8974. constructor(message) {
  8975. this.message = message;
  8976. }
  8977. readBody() {
  8978. return new Promise(async (resolve, reject) => {
  8979. let output = Buffer.alloc(0);
  8980. this.message.on('data', (chunk) => {
  8981. output = Buffer.concat([output, chunk]);
  8982. });
  8983. this.message.on('end', () => {
  8984. resolve(output.toString());
  8985. });
  8986. });
  8987. }
  8988. }
  8989. exports.HttpClientResponse = HttpClientResponse;
  8990. function isHttps(requestUrl) {
  8991. let parsedUrl = url.parse(requestUrl);
  8992. return parsedUrl.protocol === 'https:';
  8993. }
  8994. exports.isHttps = isHttps;
  8995. class HttpClient {
  8996. constructor(userAgent, handlers, requestOptions) {
  8997. this._ignoreSslError = false;
  8998. this._allowRedirects = true;
  8999. this._allowRedirectDowngrade = false;
  9000. this._maxRedirects = 50;
  9001. this._allowRetries = false;
  9002. this._maxRetries = 1;
  9003. this._keepAlive = false;
  9004. this._disposed = false;
  9005. this.userAgent = userAgent;
  9006. this.handlers = handlers || [];
  9007. this.requestOptions = requestOptions;
  9008. if (requestOptions) {
  9009. if (requestOptions.ignoreSslError != null) {
  9010. this._ignoreSslError = requestOptions.ignoreSslError;
  9011. }
  9012. this._socketTimeout = requestOptions.socketTimeout;
  9013. if (requestOptions.allowRedirects != null) {
  9014. this._allowRedirects = requestOptions.allowRedirects;
  9015. }
  9016. if (requestOptions.allowRedirectDowngrade != null) {
  9017. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9018. }
  9019. if (requestOptions.maxRedirects != null) {
  9020. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9021. }
  9022. if (requestOptions.keepAlive != null) {
  9023. this._keepAlive = requestOptions.keepAlive;
  9024. }
  9025. if (requestOptions.allowRetries != null) {
  9026. this._allowRetries = requestOptions.allowRetries;
  9027. }
  9028. if (requestOptions.maxRetries != null) {
  9029. this._maxRetries = requestOptions.maxRetries;
  9030. }
  9031. }
  9032. }
  9033. options(requestUrl, additionalHeaders) {
  9034. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9035. }
  9036. get(requestUrl, additionalHeaders) {
  9037. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9038. }
  9039. del(requestUrl, additionalHeaders) {
  9040. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9041. }
  9042. post(requestUrl, data, additionalHeaders) {
  9043. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9044. }
  9045. patch(requestUrl, data, additionalHeaders) {
  9046. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9047. }
  9048. put(requestUrl, data, additionalHeaders) {
  9049. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9050. }
  9051. head(requestUrl, additionalHeaders) {
  9052. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9053. }
  9054. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9055. return this.request(verb, requestUrl, stream, additionalHeaders);
  9056. }
  9057. /**
  9058. * Makes a raw http request.
  9059. * All other methods such as get, post, patch, and request ultimately call this.
  9060. * Prefer get, del, post and patch
  9061. */
  9062. async request(verb, requestUrl, data, headers) {
  9063. if (this._disposed) {
  9064. throw new Error("Client has already been disposed.");
  9065. }
  9066. let parsedUrl = url.parse(requestUrl);
  9067. let info = this._prepareRequest(verb, parsedUrl, headers);
  9068. // Only perform retries on reads since writes may not be idempotent.
  9069. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  9070. let numTries = 0;
  9071. let response;
  9072. while (numTries < maxTries) {
  9073. response = await this.requestRaw(info, data);
  9074. // Check if it's an authentication challenge
  9075. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  9076. let authenticationHandler;
  9077. for (let i = 0; i < this.handlers.length; i++) {
  9078. if (this.handlers[i].canHandleAuthentication(response)) {
  9079. authenticationHandler = this.handlers[i];
  9080. break;
  9081. }
  9082. }
  9083. if (authenticationHandler) {
  9084. return authenticationHandler.handleAuthentication(this, info, data);
  9085. }
  9086. else {
  9087. // We have received an unauthorized response but have no handlers to handle it.
  9088. // Let the response return to the caller.
  9089. return response;
  9090. }
  9091. }
  9092. let redirectsRemaining = this._maxRedirects;
  9093. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  9094. && this._allowRedirects
  9095. && redirectsRemaining > 0) {
  9096. const redirectUrl = response.message.headers["location"];
  9097. if (!redirectUrl) {
  9098. // if there's no location to redirect to, we won't
  9099. break;
  9100. }
  9101. let parsedRedirectUrl = url.parse(redirectUrl);
  9102. if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
  9103. 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.");
  9104. }
  9105. // we need to finish reading the response before reassigning response
  9106. // which will leak the open socket.
  9107. await response.readBody();
  9108. // let's make the request with the new redirectUrl
  9109. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9110. response = await this.requestRaw(info, data);
  9111. redirectsRemaining--;
  9112. }
  9113. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9114. // If not a retry code, return immediately instead of retrying
  9115. return response;
  9116. }
  9117. numTries += 1;
  9118. if (numTries < maxTries) {
  9119. await response.readBody();
  9120. await this._performExponentialBackoff(numTries);
  9121. }
  9122. }
  9123. return response;
  9124. }
  9125. /**
  9126. * Needs to be called if keepAlive is set to true in request options.
  9127. */
  9128. dispose() {
  9129. if (this._agent) {
  9130. this._agent.destroy();
  9131. }
  9132. this._disposed = true;
  9133. }
  9134. /**
  9135. * Raw request.
  9136. * @param info
  9137. * @param data
  9138. */
  9139. requestRaw(info, data) {
  9140. return new Promise((resolve, reject) => {
  9141. let callbackForResult = function (err, res) {
  9142. if (err) {
  9143. reject(err);
  9144. }
  9145. resolve(res);
  9146. };
  9147. this.requestRawWithCallback(info, data, callbackForResult);
  9148. });
  9149. }
  9150. /**
  9151. * Raw request with callback.
  9152. * @param info
  9153. * @param data
  9154. * @param onResult
  9155. */
  9156. requestRawWithCallback(info, data, onResult) {
  9157. let socket;
  9158. if (typeof (data) === 'string') {
  9159. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  9160. }
  9161. let callbackCalled = false;
  9162. let handleResult = (err, res) => {
  9163. if (!callbackCalled) {
  9164. callbackCalled = true;
  9165. onResult(err, res);
  9166. }
  9167. };
  9168. let req = info.httpModule.request(info.options, (msg) => {
  9169. let res = new HttpClientResponse(msg);
  9170. handleResult(null, res);
  9171. });
  9172. req.on('socket', (sock) => {
  9173. socket = sock;
  9174. });
  9175. // If we ever get disconnected, we want the socket to timeout eventually
  9176. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9177. if (socket) {
  9178. socket.end();
  9179. }
  9180. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9181. });
  9182. req.on('error', function (err) {
  9183. // err has statusCode property
  9184. // res should have headers
  9185. handleResult(err, null);
  9186. });
  9187. if (data && typeof (data) === 'string') {
  9188. req.write(data, 'utf8');
  9189. }
  9190. if (data && typeof (data) !== 'string') {
  9191. data.on('close', function () {
  9192. req.end();
  9193. });
  9194. data.pipe(req);
  9195. }
  9196. else {
  9197. req.end();
  9198. }
  9199. }
  9200. /**
  9201. * Gets an http agent. This function is useful when you need an http agent that handles
  9202. * routing through a proxy server - depending upon the url and proxy environment variables.
  9203. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9204. */
  9205. getAgent(serverUrl) {
  9206. let parsedUrl = url.parse(serverUrl);
  9207. return this._getAgent(parsedUrl);
  9208. }
  9209. _prepareRequest(method, requestUrl, headers) {
  9210. const info = {};
  9211. info.parsedUrl = requestUrl;
  9212. const usingSsl = info.parsedUrl.protocol === 'https:';
  9213. info.httpModule = usingSsl ? https : http;
  9214. const defaultPort = usingSsl ? 443 : 80;
  9215. info.options = {};
  9216. info.options.host = info.parsedUrl.hostname;
  9217. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  9218. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9219. info.options.method = method;
  9220. info.options.headers = this._mergeHeaders(headers);
  9221. if (this.userAgent != null) {
  9222. info.options.headers["user-agent"] = this.userAgent;
  9223. }
  9224. info.options.agent = this._getAgent(info.parsedUrl);
  9225. // gives handlers an opportunity to participate
  9226. if (this.handlers) {
  9227. this.handlers.forEach((handler) => {
  9228. handler.prepareRequest(info.options);
  9229. });
  9230. }
  9231. return info;
  9232. }
  9233. _mergeHeaders(headers) {
  9234. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  9235. if (this.requestOptions && this.requestOptions.headers) {
  9236. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9237. }
  9238. return lowercaseKeys(headers || {});
  9239. }
  9240. _getAgent(parsedUrl) {
  9241. let agent;
  9242. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9243. let useProxy = proxyUrl && proxyUrl.hostname;
  9244. if (this._keepAlive && useProxy) {
  9245. agent = this._proxyAgent;
  9246. }
  9247. if (this._keepAlive && !useProxy) {
  9248. agent = this._agent;
  9249. }
  9250. // if agent is already assigned use that agent.
  9251. if (!!agent) {
  9252. return agent;
  9253. }
  9254. const usingSsl = parsedUrl.protocol === 'https:';
  9255. let maxSockets = 100;
  9256. if (!!this.requestOptions) {
  9257. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9258. }
  9259. if (useProxy) {
  9260. // If using proxy, need tunnel
  9261. if (!tunnel) {
  9262. tunnel = __webpack_require__(335);
  9263. }
  9264. const agentOptions = {
  9265. maxSockets: maxSockets,
  9266. keepAlive: this._keepAlive,
  9267. proxy: {
  9268. proxyAuth: proxyUrl.auth,
  9269. host: proxyUrl.hostname,
  9270. port: proxyUrl.port
  9271. },
  9272. };
  9273. let tunnelAgent;
  9274. const overHttps = proxyUrl.protocol === 'https:';
  9275. if (usingSsl) {
  9276. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9277. }
  9278. else {
  9279. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9280. }
  9281. agent = tunnelAgent(agentOptions);
  9282. this._proxyAgent = agent;
  9283. }
  9284. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9285. if (this._keepAlive && !agent) {
  9286. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9287. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9288. this._agent = agent;
  9289. }
  9290. // if not using private agent and tunnel agent isn't setup then use global agent
  9291. if (!agent) {
  9292. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9293. }
  9294. if (usingSsl && this._ignoreSslError) {
  9295. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9296. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9297. // we have to cast it to any and change it directly
  9298. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  9299. }
  9300. return agent;
  9301. }
  9302. _performExponentialBackoff(retryNumber) {
  9303. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9304. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9305. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9306. }
  9307. }
  9308. exports.HttpClient = HttpClient;
  9309. /***/ }),
  9310. /***/ 550:
  9311. /***/ (function(module, __unusedexports, __webpack_require__) {
  9312. module.exports = getNextPage
  9313. const getPage = __webpack_require__(265)
  9314. function getNextPage (octokit, link, headers) {
  9315. return getPage(octokit, link, 'next', headers)
  9316. }
  9317. /***/ }),
  9318. /***/ 558:
  9319. /***/ (function(module, __unusedexports, __webpack_require__) {
  9320. module.exports = hasPreviousPage
  9321. const deprecate = __webpack_require__(370)
  9322. const getPageLinks = __webpack_require__(577)
  9323. function hasPreviousPage (link) {
  9324. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9325. return getPageLinks(link).prev
  9326. }
  9327. /***/ }),
  9328. /***/ 559:
  9329. /***/ (function(__unusedmodule, exports) {
  9330. "use strict";
  9331. Object.defineProperty(exports, "__esModule", { value: true });
  9332. class GitVersion {
  9333. /**
  9334. * Used for comparing the version of git and git-lfs against the minimum required version
  9335. * @param version the version string, e.g. 1.2 or 1.2.3
  9336. */
  9337. constructor(version) {
  9338. this.major = NaN;
  9339. this.minor = NaN;
  9340. this.patch = NaN;
  9341. if (version) {
  9342. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9343. if (match) {
  9344. this.major = Number(match[1]);
  9345. this.minor = Number(match[2]);
  9346. if (match[4]) {
  9347. this.patch = Number(match[4]);
  9348. }
  9349. }
  9350. }
  9351. }
  9352. /**
  9353. * Compares the instance against a minimum required version
  9354. * @param minimum Minimum version
  9355. */
  9356. checkMinimum(minimum) {
  9357. if (!minimum.isValid()) {
  9358. throw new Error('Arg minimum is not a valid version');
  9359. }
  9360. // Major is insufficient
  9361. if (this.major < minimum.major) {
  9362. return false;
  9363. }
  9364. // Major is equal
  9365. if (this.major === minimum.major) {
  9366. // Minor is insufficient
  9367. if (this.minor < minimum.minor) {
  9368. return false;
  9369. }
  9370. // Minor is equal
  9371. if (this.minor === minimum.minor) {
  9372. // Patch is insufficient
  9373. if (this.patch && this.patch < (minimum.patch || 0)) {
  9374. return false;
  9375. }
  9376. }
  9377. }
  9378. return true;
  9379. }
  9380. /**
  9381. * Indicates whether the instance was constructed from a valid version string
  9382. */
  9383. isValid() {
  9384. return !isNaN(this.major);
  9385. }
  9386. /**
  9387. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9388. */
  9389. toString() {
  9390. let result = '';
  9391. if (this.isValid()) {
  9392. result = `${this.major}.${this.minor}`;
  9393. if (!isNaN(this.patch)) {
  9394. result += `.${this.patch}`;
  9395. }
  9396. }
  9397. return result;
  9398. }
  9399. }
  9400. exports.GitVersion = GitVersion;
  9401. /***/ }),
  9402. /***/ 562:
  9403. /***/ (function(module, __unusedexports, __webpack_require__) {
  9404. var once = __webpack_require__(969);
  9405. var noop = function() {};
  9406. var isRequest = function(stream) {
  9407. return stream.setHeader && typeof stream.abort === 'function';
  9408. };
  9409. var isChildProcess = function(stream) {
  9410. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9411. };
  9412. var eos = function(stream, opts, callback) {
  9413. if (typeof opts === 'function') return eos(stream, null, opts);
  9414. if (!opts) opts = {};
  9415. callback = once(callback || noop);
  9416. var ws = stream._writableState;
  9417. var rs = stream._readableState;
  9418. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9419. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9420. var cancelled = false;
  9421. var onlegacyfinish = function() {
  9422. if (!stream.writable) onfinish();
  9423. };
  9424. var onfinish = function() {
  9425. writable = false;
  9426. if (!readable) callback.call(stream);
  9427. };
  9428. var onend = function() {
  9429. readable = false;
  9430. if (!writable) callback.call(stream);
  9431. };
  9432. var onexit = function(exitCode) {
  9433. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9434. };
  9435. var onerror = function(err) {
  9436. callback.call(stream, err);
  9437. };
  9438. var onclose = function() {
  9439. process.nextTick(onclosenexttick);
  9440. };
  9441. var onclosenexttick = function() {
  9442. if (cancelled) return;
  9443. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9444. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9445. };
  9446. var onrequest = function() {
  9447. stream.req.on('finish', onfinish);
  9448. };
  9449. if (isRequest(stream)) {
  9450. stream.on('complete', onfinish);
  9451. stream.on('abort', onclose);
  9452. if (stream.req) onrequest();
  9453. else stream.on('request', onrequest);
  9454. } else if (writable && !ws) { // legacy streams
  9455. stream.on('end', onlegacyfinish);
  9456. stream.on('close', onlegacyfinish);
  9457. }
  9458. if (isChildProcess(stream)) stream.on('exit', onexit);
  9459. stream.on('end', onend);
  9460. stream.on('finish', onfinish);
  9461. if (opts.error !== false) stream.on('error', onerror);
  9462. stream.on('close', onclose);
  9463. return function() {
  9464. cancelled = true;
  9465. stream.removeListener('complete', onfinish);
  9466. stream.removeListener('abort', onclose);
  9467. stream.removeListener('request', onrequest);
  9468. if (stream.req) stream.req.removeListener('finish', onfinish);
  9469. stream.removeListener('end', onlegacyfinish);
  9470. stream.removeListener('close', onlegacyfinish);
  9471. stream.removeListener('finish', onfinish);
  9472. stream.removeListener('exit', onexit);
  9473. stream.removeListener('end', onend);
  9474. stream.removeListener('error', onerror);
  9475. stream.removeListener('close', onclose);
  9476. };
  9477. };
  9478. module.exports = eos;
  9479. /***/ }),
  9480. /***/ 563:
  9481. /***/ (function(module, __unusedexports, __webpack_require__) {
  9482. module.exports = getPreviousPage
  9483. const getPage = __webpack_require__(265)
  9484. function getPreviousPage (octokit, link, headers) {
  9485. return getPage(octokit, link, 'prev', headers)
  9486. }
  9487. /***/ }),
  9488. /***/ 568:
  9489. /***/ (function(module, __unusedexports, __webpack_require__) {
  9490. "use strict";
  9491. const path = __webpack_require__(622);
  9492. const niceTry = __webpack_require__(948);
  9493. const resolveCommand = __webpack_require__(489);
  9494. const escape = __webpack_require__(462);
  9495. const readShebang = __webpack_require__(389);
  9496. const semver = __webpack_require__(280);
  9497. const isWin = process.platform === 'win32';
  9498. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9499. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9500. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9501. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9502. function detectShebang(parsed) {
  9503. parsed.file = resolveCommand(parsed);
  9504. const shebang = parsed.file && readShebang(parsed.file);
  9505. if (shebang) {
  9506. parsed.args.unshift(parsed.file);
  9507. parsed.command = shebang;
  9508. return resolveCommand(parsed);
  9509. }
  9510. return parsed.file;
  9511. }
  9512. function parseNonShell(parsed) {
  9513. if (!isWin) {
  9514. return parsed;
  9515. }
  9516. // Detect & add support for shebangs
  9517. const commandFile = detectShebang(parsed);
  9518. // We don't need a shell if the command filename is an executable
  9519. const needsShell = !isExecutableRegExp.test(commandFile);
  9520. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9521. // Note that `forceShell` is an hidden option used only in tests
  9522. if (parsed.options.forceShell || needsShell) {
  9523. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9524. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9525. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9526. // we need to double escape them
  9527. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9528. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9529. // This is necessary otherwise it will always fail with ENOENT in those cases
  9530. parsed.command = path.normalize(parsed.command);
  9531. // Escape command & arguments
  9532. parsed.command = escape.command(parsed.command);
  9533. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9534. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9535. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9536. parsed.command = process.env.comspec || 'cmd.exe';
  9537. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9538. }
  9539. return parsed;
  9540. }
  9541. function parseShell(parsed) {
  9542. // If node supports the shell option, there's no need to mimic its behavior
  9543. if (supportsShellOption) {
  9544. return parsed;
  9545. }
  9546. // Mimic node shell option
  9547. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9548. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9549. if (isWin) {
  9550. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9551. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9552. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9553. } else {
  9554. if (typeof parsed.options.shell === 'string') {
  9555. parsed.command = parsed.options.shell;
  9556. } else if (process.platform === 'android') {
  9557. parsed.command = '/system/bin/sh';
  9558. } else {
  9559. parsed.command = '/bin/sh';
  9560. }
  9561. parsed.args = ['-c', shellCommand];
  9562. }
  9563. return parsed;
  9564. }
  9565. function parse(command, args, options) {
  9566. // Normalize arguments, similar to nodejs
  9567. if (args && !Array.isArray(args)) {
  9568. options = args;
  9569. args = null;
  9570. }
  9571. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9572. options = Object.assign({}, options); // Clone object to avoid changing the original
  9573. // Build our parsed object
  9574. const parsed = {
  9575. command,
  9576. args,
  9577. options,
  9578. file: undefined,
  9579. original: {
  9580. command,
  9581. args,
  9582. },
  9583. };
  9584. // Delegate further parsing to shell or non-shell
  9585. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9586. }
  9587. module.exports = parse;
  9588. /***/ }),
  9589. /***/ 577:
  9590. /***/ (function(module) {
  9591. module.exports = getPageLinks
  9592. function getPageLinks (link) {
  9593. link = link.link || link.headers.link || ''
  9594. const links = {}
  9595. // link format:
  9596. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9597. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9598. links[type] = uri
  9599. })
  9600. return links
  9601. }
  9602. /***/ }),
  9603. /***/ 586:
  9604. /***/ (function(module, __unusedexports, __webpack_require__) {
  9605. module.exports = octokitRestApiEndpoints;
  9606. const ROUTES = __webpack_require__(705);
  9607. function octokitRestApiEndpoints(octokit) {
  9608. // Aliasing scopes for backward compatibility
  9609. // See https://github.com/octokit/rest.js/pull/1134
  9610. ROUTES.gitdata = ROUTES.git;
  9611. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9612. ROUTES.pullRequests = ROUTES.pulls;
  9613. octokit.registerEndpoints(ROUTES);
  9614. }
  9615. /***/ }),
  9616. /***/ 587:
  9617. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9618. "use strict";
  9619. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9620. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9621. return new (P || (P = Promise))(function (resolve, reject) {
  9622. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9623. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9624. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9625. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9626. });
  9627. };
  9628. var __importStar = (this && this.__importStar) || function (mod) {
  9629. if (mod && mod.__esModule) return mod;
  9630. var result = {};
  9631. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9632. result["default"] = mod;
  9633. return result;
  9634. };
  9635. Object.defineProperty(exports, "__esModule", { value: true });
  9636. const core = __importStar(__webpack_require__(470));
  9637. const defaultMaxAttempts = 3;
  9638. const defaultMinSeconds = 10;
  9639. const defaultMaxSeconds = 20;
  9640. class RetryHelper {
  9641. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9642. this.maxAttempts = maxAttempts;
  9643. this.minSeconds = Math.floor(minSeconds);
  9644. this.maxSeconds = Math.floor(maxSeconds);
  9645. if (this.minSeconds > this.maxSeconds) {
  9646. throw new Error('min seconds should be less than or equal to max seconds');
  9647. }
  9648. }
  9649. execute(action) {
  9650. return __awaiter(this, void 0, void 0, function* () {
  9651. let attempt = 1;
  9652. while (attempt < this.maxAttempts) {
  9653. // Try
  9654. try {
  9655. return yield action();
  9656. }
  9657. catch (err) {
  9658. core.info(err.message);
  9659. }
  9660. // Sleep
  9661. const seconds = this.getSleepAmount();
  9662. core.info(`Waiting ${seconds} seconds before trying again`);
  9663. yield this.sleep(seconds);
  9664. attempt++;
  9665. }
  9666. // Last attempt
  9667. return yield action();
  9668. });
  9669. }
  9670. getSleepAmount() {
  9671. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9672. this.minSeconds);
  9673. }
  9674. sleep(seconds) {
  9675. return __awaiter(this, void 0, void 0, function* () {
  9676. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9677. });
  9678. }
  9679. }
  9680. exports.RetryHelper = RetryHelper;
  9681. function execute(action) {
  9682. return __awaiter(this, void 0, void 0, function* () {
  9683. const retryHelper = new RetryHelper();
  9684. return yield retryHelper.execute(action);
  9685. });
  9686. }
  9687. exports.execute = execute;
  9688. /***/ }),
  9689. /***/ 605:
  9690. /***/ (function(module) {
  9691. module.exports = require("http");
  9692. /***/ }),
  9693. /***/ 614:
  9694. /***/ (function(module) {
  9695. module.exports = require("events");
  9696. /***/ }),
  9697. /***/ 618:
  9698. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9699. "use strict";
  9700. var __importStar = (this && this.__importStar) || function (mod) {
  9701. if (mod && mod.__esModule) return mod;
  9702. var result = {};
  9703. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9704. result["default"] = mod;
  9705. return result;
  9706. };
  9707. Object.defineProperty(exports, "__esModule", { value: true });
  9708. const fs = __importStar(__webpack_require__(747));
  9709. function directoryExistsSync(path, required) {
  9710. if (!path) {
  9711. throw new Error("Arg 'path' must not be empty");
  9712. }
  9713. let stats;
  9714. try {
  9715. stats = fs.statSync(path);
  9716. }
  9717. catch (error) {
  9718. if (error.code === 'ENOENT') {
  9719. if (!required) {
  9720. return false;
  9721. }
  9722. throw new Error(`Directory '${path}' does not exist`);
  9723. }
  9724. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9725. }
  9726. if (stats.isDirectory()) {
  9727. return true;
  9728. }
  9729. else if (!required) {
  9730. return false;
  9731. }
  9732. throw new Error(`Directory '${path}' does not exist`);
  9733. }
  9734. exports.directoryExistsSync = directoryExistsSync;
  9735. function existsSync(path) {
  9736. if (!path) {
  9737. throw new Error("Arg 'path' must not be empty");
  9738. }
  9739. try {
  9740. fs.statSync(path);
  9741. }
  9742. catch (error) {
  9743. if (error.code === 'ENOENT') {
  9744. return false;
  9745. }
  9746. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9747. }
  9748. return true;
  9749. }
  9750. exports.existsSync = existsSync;
  9751. function fileExistsSync(path) {
  9752. if (!path) {
  9753. throw new Error("Arg 'path' must not be empty");
  9754. }
  9755. let stats;
  9756. try {
  9757. stats = fs.statSync(path);
  9758. }
  9759. catch (error) {
  9760. if (error.code === 'ENOENT') {
  9761. return false;
  9762. }
  9763. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9764. }
  9765. if (!stats.isDirectory()) {
  9766. return true;
  9767. }
  9768. return false;
  9769. }
  9770. exports.fileExistsSync = fileExistsSync;
  9771. /***/ }),
  9772. /***/ 621:
  9773. /***/ (function(module, __unusedexports, __webpack_require__) {
  9774. "use strict";
  9775. const path = __webpack_require__(622);
  9776. const pathKey = __webpack_require__(39);
  9777. module.exports = opts => {
  9778. opts = Object.assign({
  9779. cwd: process.cwd(),
  9780. path: process.env[pathKey()]
  9781. }, opts);
  9782. let prev;
  9783. let pth = path.resolve(opts.cwd);
  9784. const ret = [];
  9785. while (prev !== pth) {
  9786. ret.push(path.join(pth, 'node_modules/.bin'));
  9787. prev = pth;
  9788. pth = path.resolve(pth, '..');
  9789. }
  9790. // ensure the running `node` binary is used
  9791. ret.push(path.dirname(process.execPath));
  9792. return ret.concat(opts.path).join(path.delimiter);
  9793. };
  9794. module.exports.env = opts => {
  9795. opts = Object.assign({
  9796. env: process.env
  9797. }, opts);
  9798. const env = Object.assign({}, opts.env);
  9799. const path = pathKey({env});
  9800. opts.path = env[path];
  9801. env[path] = module.exports(opts);
  9802. return env;
  9803. };
  9804. /***/ }),
  9805. /***/ 622:
  9806. /***/ (function(module) {
  9807. module.exports = require("path");
  9808. /***/ }),
  9809. /***/ 631:
  9810. /***/ (function(module) {
  9811. module.exports = require("net");
  9812. /***/ }),
  9813. /***/ 649:
  9814. /***/ (function(module, __unusedexports, __webpack_require__) {
  9815. module.exports = getLastPage
  9816. const getPage = __webpack_require__(265)
  9817. function getLastPage (octokit, link, headers) {
  9818. return getPage(octokit, link, 'last', headers)
  9819. }
  9820. /***/ }),
  9821. /***/ 654:
  9822. /***/ (function(module) {
  9823. // This is not the set of all possible signals.
  9824. //
  9825. // It IS, however, the set of all signals that trigger
  9826. // an exit on either Linux or BSD systems. Linux is a
  9827. // superset of the signal names supported on BSD, and
  9828. // the unknown signals just fail to register, so we can
  9829. // catch that easily enough.
  9830. //
  9831. // Don't bother with SIGKILL. It's uncatchable, which
  9832. // means that we can't fire any callbacks anyway.
  9833. //
  9834. // If a user does happen to register a handler on a non-
  9835. // fatal signal like SIGWINCH or something, and then
  9836. // exit, it'll end up firing `process.emit('exit')`, so
  9837. // the handler will be fired anyway.
  9838. //
  9839. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9840. // artificially, inherently leave the process in a
  9841. // state from which it is not safe to try and enter JS
  9842. // listeners.
  9843. module.exports = [
  9844. 'SIGABRT',
  9845. 'SIGALRM',
  9846. 'SIGHUP',
  9847. 'SIGINT',
  9848. 'SIGTERM'
  9849. ]
  9850. if (process.platform !== 'win32') {
  9851. module.exports.push(
  9852. 'SIGVTALRM',
  9853. 'SIGXCPU',
  9854. 'SIGXFSZ',
  9855. 'SIGUSR2',
  9856. 'SIGTRAP',
  9857. 'SIGSYS',
  9858. 'SIGQUIT',
  9859. 'SIGIOT'
  9860. // should detect profiler and enable/disable accordingly.
  9861. // see #21
  9862. // 'SIGPROF'
  9863. )
  9864. }
  9865. if (process.platform === 'linux') {
  9866. module.exports.push(
  9867. 'SIGIO',
  9868. 'SIGPOLL',
  9869. 'SIGPWR',
  9870. 'SIGSTKFLT',
  9871. 'SIGUNUSED'
  9872. )
  9873. }
  9874. /***/ }),
  9875. /***/ 656:
  9876. /***/ (function(module, exports) {
  9877. exports = module.exports = SemVer
  9878. var debug
  9879. /* istanbul ignore next */
  9880. if (typeof process === 'object' &&
  9881. process.env &&
  9882. process.env.NODE_DEBUG &&
  9883. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9884. debug = function () {
  9885. var args = Array.prototype.slice.call(arguments, 0)
  9886. args.unshift('SEMVER')
  9887. console.log.apply(console, args)
  9888. }
  9889. } else {
  9890. debug = function () {}
  9891. }
  9892. // Note: this is the semver.org version of the spec that it implements
  9893. // Not necessarily the package version of this code.
  9894. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9895. var MAX_LENGTH = 256
  9896. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9897. /* istanbul ignore next */ 9007199254740991
  9898. // Max safe segment length for coercion.
  9899. var MAX_SAFE_COMPONENT_LENGTH = 16
  9900. // The actual regexps go on exports.re
  9901. var re = exports.re = []
  9902. var src = exports.src = []
  9903. var t = exports.tokens = {}
  9904. var R = 0
  9905. function tok (n) {
  9906. t[n] = R++
  9907. }
  9908. // The following Regular Expressions can be used for tokenizing,
  9909. // validating, and parsing SemVer version strings.
  9910. // ## Numeric Identifier
  9911. // A single `0`, or a non-zero digit followed by zero or more digits.
  9912. tok('NUMERICIDENTIFIER')
  9913. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9914. tok('NUMERICIDENTIFIERLOOSE')
  9915. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9916. // ## Non-numeric Identifier
  9917. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9918. // more letters, digits, or hyphens.
  9919. tok('NONNUMERICIDENTIFIER')
  9920. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9921. // ## Main Version
  9922. // Three dot-separated numeric identifiers.
  9923. tok('MAINVERSION')
  9924. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9925. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9926. '(' + src[t.NUMERICIDENTIFIER] + ')'
  9927. tok('MAINVERSIONLOOSE')
  9928. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9929. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9930. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  9931. // ## Pre-release Version Identifier
  9932. // A numeric identifier, or a non-numeric identifier.
  9933. tok('PRERELEASEIDENTIFIER')
  9934. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  9935. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9936. tok('PRERELEASEIDENTIFIERLOOSE')
  9937. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  9938. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9939. // ## Pre-release Version
  9940. // Hyphen, followed by one or more dot-separated pre-release version
  9941. // identifiers.
  9942. tok('PRERELEASE')
  9943. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  9944. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  9945. tok('PRERELEASELOOSE')
  9946. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  9947. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  9948. // ## Build Metadata Identifier
  9949. // Any combination of digits, letters, or hyphens.
  9950. tok('BUILDIDENTIFIER')
  9951. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  9952. // ## Build Metadata
  9953. // Plus sign, followed by one or more period-separated build metadata
  9954. // identifiers.
  9955. tok('BUILD')
  9956. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  9957. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  9958. // ## Full Version String
  9959. // A main version, followed optionally by a pre-release version and
  9960. // build metadata.
  9961. // Note that the only major, minor, patch, and pre-release sections of
  9962. // the version string are capturing groups. The build metadata is not a
  9963. // capturing group, because it should not ever be used in version
  9964. // comparison.
  9965. tok('FULL')
  9966. tok('FULLPLAIN')
  9967. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  9968. src[t.PRERELEASE] + '?' +
  9969. src[t.BUILD] + '?'
  9970. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  9971. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  9972. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  9973. // common in the npm registry.
  9974. tok('LOOSEPLAIN')
  9975. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  9976. src[t.PRERELEASELOOSE] + '?' +
  9977. src[t.BUILD] + '?'
  9978. tok('LOOSE')
  9979. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  9980. tok('GTLT')
  9981. src[t.GTLT] = '((?:<|>)?=?)'
  9982. // Something like "2.*" or "1.2.x".
  9983. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  9984. // Only the first item is strictly required.
  9985. tok('XRANGEIDENTIFIERLOOSE')
  9986. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  9987. tok('XRANGEIDENTIFIER')
  9988. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  9989. tok('XRANGEPLAIN')
  9990. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  9991. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9992. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9993. '(?:' + src[t.PRERELEASE] + ')?' +
  9994. src[t.BUILD] + '?' +
  9995. ')?)?'
  9996. tok('XRANGEPLAINLOOSE')
  9997. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9998. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9999. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10000. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10001. src[t.BUILD] + '?' +
  10002. ')?)?'
  10003. tok('XRANGE')
  10004. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10005. tok('XRANGELOOSE')
  10006. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10007. // Coercion.
  10008. // Extract anything that could conceivably be a part of a valid semver
  10009. tok('COERCE')
  10010. src[t.COERCE] = '(^|[^\\d])' +
  10011. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10012. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10013. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10014. '(?:$|[^\\d])'
  10015. tok('COERCERTL')
  10016. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10017. // Tilde ranges.
  10018. // Meaning is "reasonably at or greater than"
  10019. tok('LONETILDE')
  10020. src[t.LONETILDE] = '(?:~>?)'
  10021. tok('TILDETRIM')
  10022. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10023. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10024. var tildeTrimReplace = '$1~'
  10025. tok('TILDE')
  10026. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10027. tok('TILDELOOSE')
  10028. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10029. // Caret ranges.
  10030. // Meaning is "at least and backwards compatible with"
  10031. tok('LONECARET')
  10032. src[t.LONECARET] = '(?:\\^)'
  10033. tok('CARETTRIM')
  10034. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10035. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10036. var caretTrimReplace = '$1^'
  10037. tok('CARET')
  10038. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10039. tok('CARETLOOSE')
  10040. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10041. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10042. tok('COMPARATORLOOSE')
  10043. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10044. tok('COMPARATOR')
  10045. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10046. // An expression to strip any whitespace between the gtlt and the thing
  10047. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10048. tok('COMPARATORTRIM')
  10049. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10050. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10051. // this one has to use the /g flag
  10052. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10053. var comparatorTrimReplace = '$1$2$3'
  10054. // Something like `1.2.3 - 1.2.4`
  10055. // Note that these all use the loose form, because they'll be
  10056. // checked against either the strict or loose comparator form
  10057. // later.
  10058. tok('HYPHENRANGE')
  10059. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10060. '\\s+-\\s+' +
  10061. '(' + src[t.XRANGEPLAIN] + ')' +
  10062. '\\s*$'
  10063. tok('HYPHENRANGELOOSE')
  10064. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10065. '\\s+-\\s+' +
  10066. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10067. '\\s*$'
  10068. // Star ranges basically just allow anything at all.
  10069. tok('STAR')
  10070. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10071. // Compile to actual regexp objects.
  10072. // All are flag-free, unless they were created above with a flag.
  10073. for (var i = 0; i < R; i++) {
  10074. debug(i, src[i])
  10075. if (!re[i]) {
  10076. re[i] = new RegExp(src[i])
  10077. }
  10078. }
  10079. exports.parse = parse
  10080. function parse (version, options) {
  10081. if (!options || typeof options !== 'object') {
  10082. options = {
  10083. loose: !!options,
  10084. includePrerelease: false
  10085. }
  10086. }
  10087. if (version instanceof SemVer) {
  10088. return version
  10089. }
  10090. if (typeof version !== 'string') {
  10091. return null
  10092. }
  10093. if (version.length > MAX_LENGTH) {
  10094. return null
  10095. }
  10096. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10097. if (!r.test(version)) {
  10098. return null
  10099. }
  10100. try {
  10101. return new SemVer(version, options)
  10102. } catch (er) {
  10103. return null
  10104. }
  10105. }
  10106. exports.valid = valid
  10107. function valid (version, options) {
  10108. var v = parse(version, options)
  10109. return v ? v.version : null
  10110. }
  10111. exports.clean = clean
  10112. function clean (version, options) {
  10113. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10114. return s ? s.version : null
  10115. }
  10116. exports.SemVer = SemVer
  10117. function SemVer (version, options) {
  10118. if (!options || typeof options !== 'object') {
  10119. options = {
  10120. loose: !!options,
  10121. includePrerelease: false
  10122. }
  10123. }
  10124. if (version instanceof SemVer) {
  10125. if (version.loose === options.loose) {
  10126. return version
  10127. } else {
  10128. version = version.version
  10129. }
  10130. } else if (typeof version !== 'string') {
  10131. throw new TypeError('Invalid Version: ' + version)
  10132. }
  10133. if (version.length > MAX_LENGTH) {
  10134. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10135. }
  10136. if (!(this instanceof SemVer)) {
  10137. return new SemVer(version, options)
  10138. }
  10139. debug('SemVer', version, options)
  10140. this.options = options
  10141. this.loose = !!options.loose
  10142. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10143. if (!m) {
  10144. throw new TypeError('Invalid Version: ' + version)
  10145. }
  10146. this.raw = version
  10147. // these are actually numbers
  10148. this.major = +m[1]
  10149. this.minor = +m[2]
  10150. this.patch = +m[3]
  10151. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10152. throw new TypeError('Invalid major version')
  10153. }
  10154. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10155. throw new TypeError('Invalid minor version')
  10156. }
  10157. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10158. throw new TypeError('Invalid patch version')
  10159. }
  10160. // numberify any prerelease numeric ids
  10161. if (!m[4]) {
  10162. this.prerelease = []
  10163. } else {
  10164. this.prerelease = m[4].split('.').map(function (id) {
  10165. if (/^[0-9]+$/.test(id)) {
  10166. var num = +id
  10167. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10168. return num
  10169. }
  10170. }
  10171. return id
  10172. })
  10173. }
  10174. this.build = m[5] ? m[5].split('.') : []
  10175. this.format()
  10176. }
  10177. SemVer.prototype.format = function () {
  10178. this.version = this.major + '.' + this.minor + '.' + this.patch
  10179. if (this.prerelease.length) {
  10180. this.version += '-' + this.prerelease.join('.')
  10181. }
  10182. return this.version
  10183. }
  10184. SemVer.prototype.toString = function () {
  10185. return this.version
  10186. }
  10187. SemVer.prototype.compare = function (other) {
  10188. debug('SemVer.compare', this.version, this.options, other)
  10189. if (!(other instanceof SemVer)) {
  10190. other = new SemVer(other, this.options)
  10191. }
  10192. return this.compareMain(other) || this.comparePre(other)
  10193. }
  10194. SemVer.prototype.compareMain = function (other) {
  10195. if (!(other instanceof SemVer)) {
  10196. other = new SemVer(other, this.options)
  10197. }
  10198. return compareIdentifiers(this.major, other.major) ||
  10199. compareIdentifiers(this.minor, other.minor) ||
  10200. compareIdentifiers(this.patch, other.patch)
  10201. }
  10202. SemVer.prototype.comparePre = function (other) {
  10203. if (!(other instanceof SemVer)) {
  10204. other = new SemVer(other, this.options)
  10205. }
  10206. // NOT having a prerelease is > having one
  10207. if (this.prerelease.length && !other.prerelease.length) {
  10208. return -1
  10209. } else if (!this.prerelease.length && other.prerelease.length) {
  10210. return 1
  10211. } else if (!this.prerelease.length && !other.prerelease.length) {
  10212. return 0
  10213. }
  10214. var i = 0
  10215. do {
  10216. var a = this.prerelease[i]
  10217. var b = other.prerelease[i]
  10218. debug('prerelease compare', i, a, b)
  10219. if (a === undefined && b === undefined) {
  10220. return 0
  10221. } else if (b === undefined) {
  10222. return 1
  10223. } else if (a === undefined) {
  10224. return -1
  10225. } else if (a === b) {
  10226. continue
  10227. } else {
  10228. return compareIdentifiers(a, b)
  10229. }
  10230. } while (++i)
  10231. }
  10232. SemVer.prototype.compareBuild = function (other) {
  10233. if (!(other instanceof SemVer)) {
  10234. other = new SemVer(other, this.options)
  10235. }
  10236. var i = 0
  10237. do {
  10238. var a = this.build[i]
  10239. var b = other.build[i]
  10240. debug('prerelease compare', i, a, b)
  10241. if (a === undefined && b === undefined) {
  10242. return 0
  10243. } else if (b === undefined) {
  10244. return 1
  10245. } else if (a === undefined) {
  10246. return -1
  10247. } else if (a === b) {
  10248. continue
  10249. } else {
  10250. return compareIdentifiers(a, b)
  10251. }
  10252. } while (++i)
  10253. }
  10254. // preminor will bump the version up to the next minor release, and immediately
  10255. // down to pre-release. premajor and prepatch work the same way.
  10256. SemVer.prototype.inc = function (release, identifier) {
  10257. switch (release) {
  10258. case 'premajor':
  10259. this.prerelease.length = 0
  10260. this.patch = 0
  10261. this.minor = 0
  10262. this.major++
  10263. this.inc('pre', identifier)
  10264. break
  10265. case 'preminor':
  10266. this.prerelease.length = 0
  10267. this.patch = 0
  10268. this.minor++
  10269. this.inc('pre', identifier)
  10270. break
  10271. case 'prepatch':
  10272. // If this is already a prerelease, it will bump to the next version
  10273. // drop any prereleases that might already exist, since they are not
  10274. // relevant at this point.
  10275. this.prerelease.length = 0
  10276. this.inc('patch', identifier)
  10277. this.inc('pre', identifier)
  10278. break
  10279. // If the input is a non-prerelease version, this acts the same as
  10280. // prepatch.
  10281. case 'prerelease':
  10282. if (this.prerelease.length === 0) {
  10283. this.inc('patch', identifier)
  10284. }
  10285. this.inc('pre', identifier)
  10286. break
  10287. case 'major':
  10288. // If this is a pre-major version, bump up to the same major version.
  10289. // Otherwise increment major.
  10290. // 1.0.0-5 bumps to 1.0.0
  10291. // 1.1.0 bumps to 2.0.0
  10292. if (this.minor !== 0 ||
  10293. this.patch !== 0 ||
  10294. this.prerelease.length === 0) {
  10295. this.major++
  10296. }
  10297. this.minor = 0
  10298. this.patch = 0
  10299. this.prerelease = []
  10300. break
  10301. case 'minor':
  10302. // If this is a pre-minor version, bump up to the same minor version.
  10303. // Otherwise increment minor.
  10304. // 1.2.0-5 bumps to 1.2.0
  10305. // 1.2.1 bumps to 1.3.0
  10306. if (this.patch !== 0 || this.prerelease.length === 0) {
  10307. this.minor++
  10308. }
  10309. this.patch = 0
  10310. this.prerelease = []
  10311. break
  10312. case 'patch':
  10313. // If this is not a pre-release version, it will increment the patch.
  10314. // If it is a pre-release it will bump up to the same patch version.
  10315. // 1.2.0-5 patches to 1.2.0
  10316. // 1.2.0 patches to 1.2.1
  10317. if (this.prerelease.length === 0) {
  10318. this.patch++
  10319. }
  10320. this.prerelease = []
  10321. break
  10322. // This probably shouldn't be used publicly.
  10323. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10324. case 'pre':
  10325. if (this.prerelease.length === 0) {
  10326. this.prerelease = [0]
  10327. } else {
  10328. var i = this.prerelease.length
  10329. while (--i >= 0) {
  10330. if (typeof this.prerelease[i] === 'number') {
  10331. this.prerelease[i]++
  10332. i = -2
  10333. }
  10334. }
  10335. if (i === -1) {
  10336. // didn't increment anything
  10337. this.prerelease.push(0)
  10338. }
  10339. }
  10340. if (identifier) {
  10341. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10342. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10343. if (this.prerelease[0] === identifier) {
  10344. if (isNaN(this.prerelease[1])) {
  10345. this.prerelease = [identifier, 0]
  10346. }
  10347. } else {
  10348. this.prerelease = [identifier, 0]
  10349. }
  10350. }
  10351. break
  10352. default:
  10353. throw new Error('invalid increment argument: ' + release)
  10354. }
  10355. this.format()
  10356. this.raw = this.version
  10357. return this
  10358. }
  10359. exports.inc = inc
  10360. function inc (version, release, loose, identifier) {
  10361. if (typeof (loose) === 'string') {
  10362. identifier = loose
  10363. loose = undefined
  10364. }
  10365. try {
  10366. return new SemVer(version, loose).inc(release, identifier).version
  10367. } catch (er) {
  10368. return null
  10369. }
  10370. }
  10371. exports.diff = diff
  10372. function diff (version1, version2) {
  10373. if (eq(version1, version2)) {
  10374. return null
  10375. } else {
  10376. var v1 = parse(version1)
  10377. var v2 = parse(version2)
  10378. var prefix = ''
  10379. if (v1.prerelease.length || v2.prerelease.length) {
  10380. prefix = 'pre'
  10381. var defaultResult = 'prerelease'
  10382. }
  10383. for (var key in v1) {
  10384. if (key === 'major' || key === 'minor' || key === 'patch') {
  10385. if (v1[key] !== v2[key]) {
  10386. return prefix + key
  10387. }
  10388. }
  10389. }
  10390. return defaultResult // may be undefined
  10391. }
  10392. }
  10393. exports.compareIdentifiers = compareIdentifiers
  10394. var numeric = /^[0-9]+$/
  10395. function compareIdentifiers (a, b) {
  10396. var anum = numeric.test(a)
  10397. var bnum = numeric.test(b)
  10398. if (anum && bnum) {
  10399. a = +a
  10400. b = +b
  10401. }
  10402. return a === b ? 0
  10403. : (anum && !bnum) ? -1
  10404. : (bnum && !anum) ? 1
  10405. : a < b ? -1
  10406. : 1
  10407. }
  10408. exports.rcompareIdentifiers = rcompareIdentifiers
  10409. function rcompareIdentifiers (a, b) {
  10410. return compareIdentifiers(b, a)
  10411. }
  10412. exports.major = major
  10413. function major (a, loose) {
  10414. return new SemVer(a, loose).major
  10415. }
  10416. exports.minor = minor
  10417. function minor (a, loose) {
  10418. return new SemVer(a, loose).minor
  10419. }
  10420. exports.patch = patch
  10421. function patch (a, loose) {
  10422. return new SemVer(a, loose).patch
  10423. }
  10424. exports.compare = compare
  10425. function compare (a, b, loose) {
  10426. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10427. }
  10428. exports.compareLoose = compareLoose
  10429. function compareLoose (a, b) {
  10430. return compare(a, b, true)
  10431. }
  10432. exports.compareBuild = compareBuild
  10433. function compareBuild (a, b, loose) {
  10434. var versionA = new SemVer(a, loose)
  10435. var versionB = new SemVer(b, loose)
  10436. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10437. }
  10438. exports.rcompare = rcompare
  10439. function rcompare (a, b, loose) {
  10440. return compare(b, a, loose)
  10441. }
  10442. exports.sort = sort
  10443. function sort (list, loose) {
  10444. return list.sort(function (a, b) {
  10445. return exports.compareBuild(a, b, loose)
  10446. })
  10447. }
  10448. exports.rsort = rsort
  10449. function rsort (list, loose) {
  10450. return list.sort(function (a, b) {
  10451. return exports.compareBuild(b, a, loose)
  10452. })
  10453. }
  10454. exports.gt = gt
  10455. function gt (a, b, loose) {
  10456. return compare(a, b, loose) > 0
  10457. }
  10458. exports.lt = lt
  10459. function lt (a, b, loose) {
  10460. return compare(a, b, loose) < 0
  10461. }
  10462. exports.eq = eq
  10463. function eq (a, b, loose) {
  10464. return compare(a, b, loose) === 0
  10465. }
  10466. exports.neq = neq
  10467. function neq (a, b, loose) {
  10468. return compare(a, b, loose) !== 0
  10469. }
  10470. exports.gte = gte
  10471. function gte (a, b, loose) {
  10472. return compare(a, b, loose) >= 0
  10473. }
  10474. exports.lte = lte
  10475. function lte (a, b, loose) {
  10476. return compare(a, b, loose) <= 0
  10477. }
  10478. exports.cmp = cmp
  10479. function cmp (a, op, b, loose) {
  10480. switch (op) {
  10481. case '===':
  10482. if (typeof a === 'object')
  10483. a = a.version
  10484. if (typeof b === 'object')
  10485. b = b.version
  10486. return a === b
  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. case '=':
  10495. case '==':
  10496. return eq(a, b, loose)
  10497. case '!=':
  10498. return neq(a, b, loose)
  10499. case '>':
  10500. return gt(a, b, loose)
  10501. case '>=':
  10502. return gte(a, b, loose)
  10503. case '<':
  10504. return lt(a, b, loose)
  10505. case '<=':
  10506. return lte(a, b, loose)
  10507. default:
  10508. throw new TypeError('Invalid operator: ' + op)
  10509. }
  10510. }
  10511. exports.Comparator = Comparator
  10512. function Comparator (comp, options) {
  10513. if (!options || typeof options !== 'object') {
  10514. options = {
  10515. loose: !!options,
  10516. includePrerelease: false
  10517. }
  10518. }
  10519. if (comp instanceof Comparator) {
  10520. if (comp.loose === !!options.loose) {
  10521. return comp
  10522. } else {
  10523. comp = comp.value
  10524. }
  10525. }
  10526. if (!(this instanceof Comparator)) {
  10527. return new Comparator(comp, options)
  10528. }
  10529. debug('comparator', comp, options)
  10530. this.options = options
  10531. this.loose = !!options.loose
  10532. this.parse(comp)
  10533. if (this.semver === ANY) {
  10534. this.value = ''
  10535. } else {
  10536. this.value = this.operator + this.semver.version
  10537. }
  10538. debug('comp', this)
  10539. }
  10540. var ANY = {}
  10541. Comparator.prototype.parse = function (comp) {
  10542. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10543. var m = comp.match(r)
  10544. if (!m) {
  10545. throw new TypeError('Invalid comparator: ' + comp)
  10546. }
  10547. this.operator = m[1] !== undefined ? m[1] : ''
  10548. if (this.operator === '=') {
  10549. this.operator = ''
  10550. }
  10551. // if it literally is just '>' or '' then allow anything.
  10552. if (!m[2]) {
  10553. this.semver = ANY
  10554. } else {
  10555. this.semver = new SemVer(m[2], this.options.loose)
  10556. }
  10557. }
  10558. Comparator.prototype.toString = function () {
  10559. return this.value
  10560. }
  10561. Comparator.prototype.test = function (version) {
  10562. debug('Comparator.test', version, this.options.loose)
  10563. if (this.semver === ANY || version === ANY) {
  10564. return true
  10565. }
  10566. if (typeof version === 'string') {
  10567. try {
  10568. version = new SemVer(version, this.options)
  10569. } catch (er) {
  10570. return false
  10571. }
  10572. }
  10573. return cmp(version, this.operator, this.semver, this.options)
  10574. }
  10575. Comparator.prototype.intersects = function (comp, options) {
  10576. if (!(comp instanceof Comparator)) {
  10577. throw new TypeError('a Comparator is required')
  10578. }
  10579. if (!options || typeof options !== 'object') {
  10580. options = {
  10581. loose: !!options,
  10582. includePrerelease: false
  10583. }
  10584. }
  10585. var rangeTmp
  10586. if (this.operator === '') {
  10587. if (this.value === '') {
  10588. return true
  10589. }
  10590. rangeTmp = new Range(comp.value, options)
  10591. return satisfies(this.value, rangeTmp, options)
  10592. } else if (comp.operator === '') {
  10593. if (comp.value === '') {
  10594. return true
  10595. }
  10596. rangeTmp = new Range(this.value, options)
  10597. return satisfies(comp.semver, rangeTmp, options)
  10598. }
  10599. var sameDirectionIncreasing =
  10600. (this.operator === '>=' || this.operator === '>') &&
  10601. (comp.operator === '>=' || comp.operator === '>')
  10602. var sameDirectionDecreasing =
  10603. (this.operator === '<=' || this.operator === '<') &&
  10604. (comp.operator === '<=' || comp.operator === '<')
  10605. var sameSemVer = this.semver.version === comp.semver.version
  10606. var differentDirectionsInclusive =
  10607. (this.operator === '>=' || this.operator === '<=') &&
  10608. (comp.operator === '>=' || comp.operator === '<=')
  10609. var oppositeDirectionsLessThan =
  10610. cmp(this.semver, '<', comp.semver, options) &&
  10611. ((this.operator === '>=' || this.operator === '>') &&
  10612. (comp.operator === '<=' || comp.operator === '<'))
  10613. var oppositeDirectionsGreaterThan =
  10614. cmp(this.semver, '>', comp.semver, options) &&
  10615. ((this.operator === '<=' || this.operator === '<') &&
  10616. (comp.operator === '>=' || comp.operator === '>'))
  10617. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10618. (sameSemVer && differentDirectionsInclusive) ||
  10619. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10620. }
  10621. exports.Range = Range
  10622. function Range (range, options) {
  10623. if (!options || typeof options !== 'object') {
  10624. options = {
  10625. loose: !!options,
  10626. includePrerelease: false
  10627. }
  10628. }
  10629. if (range instanceof Range) {
  10630. if (range.loose === !!options.loose &&
  10631. range.includePrerelease === !!options.includePrerelease) {
  10632. return range
  10633. } else {
  10634. return new Range(range.raw, options)
  10635. }
  10636. }
  10637. if (range instanceof Comparator) {
  10638. return new Range(range.value, options)
  10639. }
  10640. if (!(this instanceof Range)) {
  10641. return new Range(range, options)
  10642. }
  10643. this.options = options
  10644. this.loose = !!options.loose
  10645. this.includePrerelease = !!options.includePrerelease
  10646. // First, split based on boolean or ||
  10647. this.raw = range
  10648. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10649. return this.parseRange(range.trim())
  10650. }, this).filter(function (c) {
  10651. // throw out any that are not relevant for whatever reason
  10652. return c.length
  10653. })
  10654. if (!this.set.length) {
  10655. throw new TypeError('Invalid SemVer Range: ' + range)
  10656. }
  10657. this.format()
  10658. }
  10659. Range.prototype.format = function () {
  10660. this.range = this.set.map(function (comps) {
  10661. return comps.join(' ').trim()
  10662. }).join('||').trim()
  10663. return this.range
  10664. }
  10665. Range.prototype.toString = function () {
  10666. return this.range
  10667. }
  10668. Range.prototype.parseRange = function (range) {
  10669. var loose = this.options.loose
  10670. range = range.trim()
  10671. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10672. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10673. range = range.replace(hr, hyphenReplace)
  10674. debug('hyphen replace', range)
  10675. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10676. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10677. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10678. // `~ 1.2.3` => `~1.2.3`
  10679. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10680. // `^ 1.2.3` => `^1.2.3`
  10681. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10682. // normalize spaces
  10683. range = range.split(/\s+/).join(' ')
  10684. // At this point, the range is completely trimmed and
  10685. // ready to be split into comparators.
  10686. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10687. var set = range.split(' ').map(function (comp) {
  10688. return parseComparator(comp, this.options)
  10689. }, this).join(' ').split(/\s+/)
  10690. if (this.options.loose) {
  10691. // in loose mode, throw out any that are not valid comparators
  10692. set = set.filter(function (comp) {
  10693. return !!comp.match(compRe)
  10694. })
  10695. }
  10696. set = set.map(function (comp) {
  10697. return new Comparator(comp, this.options)
  10698. }, this)
  10699. return set
  10700. }
  10701. Range.prototype.intersects = function (range, options) {
  10702. if (!(range instanceof Range)) {
  10703. throw new TypeError('a Range is required')
  10704. }
  10705. return this.set.some(function (thisComparators) {
  10706. return (
  10707. isSatisfiable(thisComparators, options) &&
  10708. range.set.some(function (rangeComparators) {
  10709. return (
  10710. isSatisfiable(rangeComparators, options) &&
  10711. thisComparators.every(function (thisComparator) {
  10712. return rangeComparators.every(function (rangeComparator) {
  10713. return thisComparator.intersects(rangeComparator, options)
  10714. })
  10715. })
  10716. )
  10717. })
  10718. )
  10719. })
  10720. }
  10721. // take a set of comparators and determine whether there
  10722. // exists a version which can satisfy it
  10723. function isSatisfiable (comparators, options) {
  10724. var result = true
  10725. var remainingComparators = comparators.slice()
  10726. var testComparator = remainingComparators.pop()
  10727. while (result && remainingComparators.length) {
  10728. result = remainingComparators.every(function (otherComparator) {
  10729. return testComparator.intersects(otherComparator, options)
  10730. })
  10731. testComparator = remainingComparators.pop()
  10732. }
  10733. return result
  10734. }
  10735. // Mostly just for testing and legacy API reasons
  10736. exports.toComparators = toComparators
  10737. function toComparators (range, options) {
  10738. return new Range(range, options).set.map(function (comp) {
  10739. return comp.map(function (c) {
  10740. return c.value
  10741. }).join(' ').trim().split(' ')
  10742. })
  10743. }
  10744. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10745. // already replaced the hyphen ranges
  10746. // turn into a set of JUST comparators.
  10747. function parseComparator (comp, options) {
  10748. debug('comp', comp, options)
  10749. comp = replaceCarets(comp, options)
  10750. debug('caret', comp)
  10751. comp = replaceTildes(comp, options)
  10752. debug('tildes', comp)
  10753. comp = replaceXRanges(comp, options)
  10754. debug('xrange', comp)
  10755. comp = replaceStars(comp, options)
  10756. debug('stars', comp)
  10757. return comp
  10758. }
  10759. function isX (id) {
  10760. return !id || id.toLowerCase() === 'x' || id === '*'
  10761. }
  10762. // ~, ~> --> * (any, kinda silly)
  10763. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10764. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10765. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10766. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10767. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10768. function replaceTildes (comp, options) {
  10769. return comp.trim().split(/\s+/).map(function (comp) {
  10770. return replaceTilde(comp, options)
  10771. }).join(' ')
  10772. }
  10773. function replaceTilde (comp, options) {
  10774. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10775. return comp.replace(r, function (_, M, m, p, pr) {
  10776. debug('tilde', comp, _, M, m, p, pr)
  10777. var ret
  10778. if (isX(M)) {
  10779. ret = ''
  10780. } else if (isX(m)) {
  10781. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10782. } else if (isX(p)) {
  10783. // ~1.2 == >=1.2.0 <1.3.0
  10784. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10785. } else if (pr) {
  10786. debug('replaceTilde pr', pr)
  10787. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10788. ' <' + M + '.' + (+m + 1) + '.0'
  10789. } else {
  10790. // ~1.2.3 == >=1.2.3 <1.3.0
  10791. ret = '>=' + M + '.' + m + '.' + p +
  10792. ' <' + M + '.' + (+m + 1) + '.0'
  10793. }
  10794. debug('tilde return', ret)
  10795. return ret
  10796. })
  10797. }
  10798. // ^ --> * (any, kinda silly)
  10799. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10800. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10801. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10802. // ^1.2.3 --> >=1.2.3 <2.0.0
  10803. // ^1.2.0 --> >=1.2.0 <2.0.0
  10804. function replaceCarets (comp, options) {
  10805. return comp.trim().split(/\s+/).map(function (comp) {
  10806. return replaceCaret(comp, options)
  10807. }).join(' ')
  10808. }
  10809. function replaceCaret (comp, options) {
  10810. debug('caret', comp, options)
  10811. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10812. return comp.replace(r, function (_, M, m, p, pr) {
  10813. debug('caret', comp, _, M, m, p, pr)
  10814. var ret
  10815. if (isX(M)) {
  10816. ret = ''
  10817. } else if (isX(m)) {
  10818. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10819. } else if (isX(p)) {
  10820. if (M === '0') {
  10821. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10822. } else {
  10823. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10824. }
  10825. } else if (pr) {
  10826. debug('replaceCaret pr', pr)
  10827. if (M === '0') {
  10828. if (m === '0') {
  10829. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10830. ' <' + M + '.' + m + '.' + (+p + 1)
  10831. } else {
  10832. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10833. ' <' + M + '.' + (+m + 1) + '.0'
  10834. }
  10835. } else {
  10836. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10837. ' <' + (+M + 1) + '.0.0'
  10838. }
  10839. } else {
  10840. debug('no pr')
  10841. if (M === '0') {
  10842. if (m === '0') {
  10843. ret = '>=' + M + '.' + m + '.' + p +
  10844. ' <' + M + '.' + m + '.' + (+p + 1)
  10845. } else {
  10846. ret = '>=' + M + '.' + m + '.' + p +
  10847. ' <' + M + '.' + (+m + 1) + '.0'
  10848. }
  10849. } else {
  10850. ret = '>=' + M + '.' + m + '.' + p +
  10851. ' <' + (+M + 1) + '.0.0'
  10852. }
  10853. }
  10854. debug('caret return', ret)
  10855. return ret
  10856. })
  10857. }
  10858. function replaceXRanges (comp, options) {
  10859. debug('replaceXRanges', comp, options)
  10860. return comp.split(/\s+/).map(function (comp) {
  10861. return replaceXRange(comp, options)
  10862. }).join(' ')
  10863. }
  10864. function replaceXRange (comp, options) {
  10865. comp = comp.trim()
  10866. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10867. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10868. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10869. var xM = isX(M)
  10870. var xm = xM || isX(m)
  10871. var xp = xm || isX(p)
  10872. var anyX = xp
  10873. if (gtlt === '=' && anyX) {
  10874. gtlt = ''
  10875. }
  10876. // if we're including prereleases in the match, then we need
  10877. // to fix this to -0, the lowest possible prerelease value
  10878. pr = options.includePrerelease ? '-0' : ''
  10879. if (xM) {
  10880. if (gtlt === '>' || gtlt === '<') {
  10881. // nothing is allowed
  10882. ret = '<0.0.0-0'
  10883. } else {
  10884. // nothing is forbidden
  10885. ret = '*'
  10886. }
  10887. } else if (gtlt && anyX) {
  10888. // we know patch is an x, because we have any x at all.
  10889. // replace X with 0
  10890. if (xm) {
  10891. m = 0
  10892. }
  10893. p = 0
  10894. if (gtlt === '>') {
  10895. // >1 => >=2.0.0
  10896. // >1.2 => >=1.3.0
  10897. // >1.2.3 => >= 1.2.4
  10898. gtlt = '>='
  10899. if (xm) {
  10900. M = +M + 1
  10901. m = 0
  10902. p = 0
  10903. } else {
  10904. m = +m + 1
  10905. p = 0
  10906. }
  10907. } else if (gtlt === '<=') {
  10908. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10909. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10910. gtlt = '<'
  10911. if (xm) {
  10912. M = +M + 1
  10913. } else {
  10914. m = +m + 1
  10915. }
  10916. }
  10917. ret = gtlt + M + '.' + m + '.' + p + pr
  10918. } else if (xm) {
  10919. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10920. } else if (xp) {
  10921. ret = '>=' + M + '.' + m + '.0' + pr +
  10922. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10923. }
  10924. debug('xRange return', ret)
  10925. return ret
  10926. })
  10927. }
  10928. // Because * is AND-ed with everything else in the comparator,
  10929. // and '' means "any version", just remove the *s entirely.
  10930. function replaceStars (comp, options) {
  10931. debug('replaceStars', comp, options)
  10932. // Looseness is ignored here. star is always as loose as it gets!
  10933. return comp.trim().replace(re[t.STAR], '')
  10934. }
  10935. // This function is passed to string.replace(re[t.HYPHENRANGE])
  10936. // M, m, patch, prerelease, build
  10937. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  10938. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  10939. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  10940. function hyphenReplace ($0,
  10941. from, fM, fm, fp, fpr, fb,
  10942. to, tM, tm, tp, tpr, tb) {
  10943. if (isX(fM)) {
  10944. from = ''
  10945. } else if (isX(fm)) {
  10946. from = '>=' + fM + '.0.0'
  10947. } else if (isX(fp)) {
  10948. from = '>=' + fM + '.' + fm + '.0'
  10949. } else {
  10950. from = '>=' + from
  10951. }
  10952. if (isX(tM)) {
  10953. to = ''
  10954. } else if (isX(tm)) {
  10955. to = '<' + (+tM + 1) + '.0.0'
  10956. } else if (isX(tp)) {
  10957. to = '<' + tM + '.' + (+tm + 1) + '.0'
  10958. } else if (tpr) {
  10959. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  10960. } else {
  10961. to = '<=' + to
  10962. }
  10963. return (from + ' ' + to).trim()
  10964. }
  10965. // if ANY of the sets match ALL of its comparators, then pass
  10966. Range.prototype.test = function (version) {
  10967. if (!version) {
  10968. return false
  10969. }
  10970. if (typeof version === 'string') {
  10971. try {
  10972. version = new SemVer(version, this.options)
  10973. } catch (er) {
  10974. return false
  10975. }
  10976. }
  10977. for (var i = 0; i < this.set.length; i++) {
  10978. if (testSet(this.set[i], version, this.options)) {
  10979. return true
  10980. }
  10981. }
  10982. return false
  10983. }
  10984. function testSet (set, version, options) {
  10985. for (var i = 0; i < set.length; i++) {
  10986. if (!set[i].test(version)) {
  10987. return false
  10988. }
  10989. }
  10990. if (version.prerelease.length && !options.includePrerelease) {
  10991. // Find the set of versions that are allowed to have prereleases
  10992. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  10993. // That should allow `1.2.3-pr.2` to pass.
  10994. // However, `1.2.4-alpha.notready` should NOT be allowed,
  10995. // even though it's within the range set by the comparators.
  10996. for (i = 0; i < set.length; i++) {
  10997. debug(set[i].semver)
  10998. if (set[i].semver === ANY) {
  10999. continue
  11000. }
  11001. if (set[i].semver.prerelease.length > 0) {
  11002. var allowed = set[i].semver
  11003. if (allowed.major === version.major &&
  11004. allowed.minor === version.minor &&
  11005. allowed.patch === version.patch) {
  11006. return true
  11007. }
  11008. }
  11009. }
  11010. // Version has a -pre, but it's not one of the ones we like.
  11011. return false
  11012. }
  11013. return true
  11014. }
  11015. exports.satisfies = satisfies
  11016. function satisfies (version, range, options) {
  11017. try {
  11018. range = new Range(range, options)
  11019. } catch (er) {
  11020. return false
  11021. }
  11022. return range.test(version)
  11023. }
  11024. exports.maxSatisfying = maxSatisfying
  11025. function maxSatisfying (versions, range, options) {
  11026. var max = null
  11027. var maxSV = null
  11028. try {
  11029. var rangeObj = new Range(range, options)
  11030. } catch (er) {
  11031. return null
  11032. }
  11033. versions.forEach(function (v) {
  11034. if (rangeObj.test(v)) {
  11035. // satisfies(v, range, options)
  11036. if (!max || maxSV.compare(v) === -1) {
  11037. // compare(max, v, true)
  11038. max = v
  11039. maxSV = new SemVer(max, options)
  11040. }
  11041. }
  11042. })
  11043. return max
  11044. }
  11045. exports.minSatisfying = minSatisfying
  11046. function minSatisfying (versions, range, options) {
  11047. var min = null
  11048. var minSV = null
  11049. try {
  11050. var rangeObj = new Range(range, options)
  11051. } catch (er) {
  11052. return null
  11053. }
  11054. versions.forEach(function (v) {
  11055. if (rangeObj.test(v)) {
  11056. // satisfies(v, range, options)
  11057. if (!min || minSV.compare(v) === 1) {
  11058. // compare(min, v, true)
  11059. min = v
  11060. minSV = new SemVer(min, options)
  11061. }
  11062. }
  11063. })
  11064. return min
  11065. }
  11066. exports.minVersion = minVersion
  11067. function minVersion (range, loose) {
  11068. range = new Range(range, loose)
  11069. var minver = new SemVer('0.0.0')
  11070. if (range.test(minver)) {
  11071. return minver
  11072. }
  11073. minver = new SemVer('0.0.0-0')
  11074. if (range.test(minver)) {
  11075. return minver
  11076. }
  11077. minver = null
  11078. for (var i = 0; i < range.set.length; ++i) {
  11079. var comparators = range.set[i]
  11080. comparators.forEach(function (comparator) {
  11081. // Clone to avoid manipulating the comparator's semver object.
  11082. var compver = new SemVer(comparator.semver.version)
  11083. switch (comparator.operator) {
  11084. case '>':
  11085. if (compver.prerelease.length === 0) {
  11086. compver.patch++
  11087. } else {
  11088. compver.prerelease.push(0)
  11089. }
  11090. compver.raw = compver.format()
  11091. /* fallthrough */
  11092. case '':
  11093. case '>=':
  11094. if (!minver || gt(minver, compver)) {
  11095. minver = compver
  11096. }
  11097. break
  11098. case '<':
  11099. case '<=':
  11100. /* Ignore maximum versions */
  11101. break
  11102. /* istanbul ignore next */
  11103. default:
  11104. throw new Error('Unexpected operation: ' + comparator.operator)
  11105. }
  11106. })
  11107. }
  11108. if (minver && range.test(minver)) {
  11109. return minver
  11110. }
  11111. return null
  11112. }
  11113. exports.validRange = validRange
  11114. function validRange (range, options) {
  11115. try {
  11116. // Return '*' instead of '' so that truthiness works.
  11117. // This will throw if it's invalid anyway
  11118. return new Range(range, options).range || '*'
  11119. } catch (er) {
  11120. return null
  11121. }
  11122. }
  11123. // Determine if version is less than all the versions possible in the range
  11124. exports.ltr = ltr
  11125. function ltr (version, range, options) {
  11126. return outside(version, range, '<', options)
  11127. }
  11128. // Determine if version is greater than all the versions possible in the range.
  11129. exports.gtr = gtr
  11130. function gtr (version, range, options) {
  11131. return outside(version, range, '>', options)
  11132. }
  11133. exports.outside = outside
  11134. function outside (version, range, hilo, options) {
  11135. version = new SemVer(version, options)
  11136. range = new Range(range, options)
  11137. var gtfn, ltefn, ltfn, comp, ecomp
  11138. switch (hilo) {
  11139. case '>':
  11140. gtfn = gt
  11141. ltefn = lte
  11142. ltfn = lt
  11143. comp = '>'
  11144. ecomp = '>='
  11145. break
  11146. case '<':
  11147. gtfn = lt
  11148. ltefn = gte
  11149. ltfn = gt
  11150. comp = '<'
  11151. ecomp = '<='
  11152. break
  11153. default:
  11154. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11155. }
  11156. // If it satisifes the range it is not outside
  11157. if (satisfies(version, range, options)) {
  11158. return false
  11159. }
  11160. // From now on, variable terms are as if we're in "gtr" mode.
  11161. // but note that everything is flipped for the "ltr" function.
  11162. for (var i = 0; i < range.set.length; ++i) {
  11163. var comparators = range.set[i]
  11164. var high = null
  11165. var low = null
  11166. comparators.forEach(function (comparator) {
  11167. if (comparator.semver === ANY) {
  11168. comparator = new Comparator('>=0.0.0')
  11169. }
  11170. high = high || comparator
  11171. low = low || comparator
  11172. if (gtfn(comparator.semver, high.semver, options)) {
  11173. high = comparator
  11174. } else if (ltfn(comparator.semver, low.semver, options)) {
  11175. low = comparator
  11176. }
  11177. })
  11178. // If the edge version comparator has a operator then our version
  11179. // isn't outside it
  11180. if (high.operator === comp || high.operator === ecomp) {
  11181. return false
  11182. }
  11183. // If the lowest version comparator has an operator and our version
  11184. // is less than it then it isn't higher than the range
  11185. if ((!low.operator || low.operator === comp) &&
  11186. ltefn(version, low.semver)) {
  11187. return false
  11188. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11189. return false
  11190. }
  11191. }
  11192. return true
  11193. }
  11194. exports.prerelease = prerelease
  11195. function prerelease (version, options) {
  11196. var parsed = parse(version, options)
  11197. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11198. }
  11199. exports.intersects = intersects
  11200. function intersects (r1, r2, options) {
  11201. r1 = new Range(r1, options)
  11202. r2 = new Range(r2, options)
  11203. return r1.intersects(r2)
  11204. }
  11205. exports.coerce = coerce
  11206. function coerce (version, options) {
  11207. if (version instanceof SemVer) {
  11208. return version
  11209. }
  11210. if (typeof version === 'number') {
  11211. version = String(version)
  11212. }
  11213. if (typeof version !== 'string') {
  11214. return null
  11215. }
  11216. options = options || {}
  11217. var match = null
  11218. if (!options.rtl) {
  11219. match = version.match(re[t.COERCE])
  11220. } else {
  11221. // Find the right-most coercible string that does not share
  11222. // a terminus with a more left-ward coercible string.
  11223. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11224. //
  11225. // Walk through the string checking with a /g regexp
  11226. // Manually set the index so as to pick up overlapping matches.
  11227. // Stop when we get a match that ends at the string end, since no
  11228. // coercible string can be more right-ward without the same terminus.
  11229. var next
  11230. while ((next = re[t.COERCERTL].exec(version)) &&
  11231. (!match || match.index + match[0].length !== version.length)
  11232. ) {
  11233. if (!match ||
  11234. next.index + next[0].length !== match.index + match[0].length) {
  11235. match = next
  11236. }
  11237. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11238. }
  11239. // leave it in a clean state
  11240. re[t.COERCERTL].lastIndex = -1
  11241. }
  11242. if (match === null) {
  11243. return null
  11244. }
  11245. return parse(match[2] +
  11246. '.' + (match[3] || '0') +
  11247. '.' + (match[4] || '0'), options)
  11248. }
  11249. /***/ }),
  11250. /***/ 669:
  11251. /***/ (function(module) {
  11252. module.exports = require("util");
  11253. /***/ }),
  11254. /***/ 672:
  11255. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11256. "use strict";
  11257. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11258. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11259. return new (P || (P = Promise))(function (resolve, reject) {
  11260. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11261. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11262. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11263. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11264. });
  11265. };
  11266. var _a;
  11267. Object.defineProperty(exports, "__esModule", { value: true });
  11268. const assert_1 = __webpack_require__(357);
  11269. const fs = __webpack_require__(747);
  11270. const path = __webpack_require__(622);
  11271. _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;
  11272. exports.IS_WINDOWS = process.platform === 'win32';
  11273. function exists(fsPath) {
  11274. return __awaiter(this, void 0, void 0, function* () {
  11275. try {
  11276. yield exports.stat(fsPath);
  11277. }
  11278. catch (err) {
  11279. if (err.code === 'ENOENT') {
  11280. return false;
  11281. }
  11282. throw err;
  11283. }
  11284. return true;
  11285. });
  11286. }
  11287. exports.exists = exists;
  11288. function isDirectory(fsPath, useStat = false) {
  11289. return __awaiter(this, void 0, void 0, function* () {
  11290. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11291. return stats.isDirectory();
  11292. });
  11293. }
  11294. exports.isDirectory = isDirectory;
  11295. /**
  11296. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11297. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11298. */
  11299. function isRooted(p) {
  11300. p = normalizeSeparators(p);
  11301. if (!p) {
  11302. throw new Error('isRooted() parameter "p" cannot be empty');
  11303. }
  11304. if (exports.IS_WINDOWS) {
  11305. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11306. ); // e.g. C: or C:\hello
  11307. }
  11308. return p.startsWith('/');
  11309. }
  11310. exports.isRooted = isRooted;
  11311. /**
  11312. * Recursively create a directory at `fsPath`.
  11313. *
  11314. * This implementation is optimistic, meaning it attempts to create the full
  11315. * path first, and backs up the path stack from there.
  11316. *
  11317. * @param fsPath The path to create
  11318. * @param maxDepth The maximum recursion depth
  11319. * @param depth The current recursion depth
  11320. */
  11321. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11322. return __awaiter(this, void 0, void 0, function* () {
  11323. assert_1.ok(fsPath, 'a path argument must be provided');
  11324. fsPath = path.resolve(fsPath);
  11325. if (depth >= maxDepth)
  11326. return exports.mkdir(fsPath);
  11327. try {
  11328. yield exports.mkdir(fsPath);
  11329. return;
  11330. }
  11331. catch (err) {
  11332. switch (err.code) {
  11333. case 'ENOENT': {
  11334. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11335. yield exports.mkdir(fsPath);
  11336. return;
  11337. }
  11338. default: {
  11339. let stats;
  11340. try {
  11341. stats = yield exports.stat(fsPath);
  11342. }
  11343. catch (err2) {
  11344. throw err;
  11345. }
  11346. if (!stats.isDirectory())
  11347. throw err;
  11348. }
  11349. }
  11350. }
  11351. });
  11352. }
  11353. exports.mkdirP = mkdirP;
  11354. /**
  11355. * Best effort attempt to determine whether a file exists and is executable.
  11356. * @param filePath file path to check
  11357. * @param extensions additional file extensions to try
  11358. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11359. */
  11360. function tryGetExecutablePath(filePath, extensions) {
  11361. return __awaiter(this, void 0, void 0, function* () {
  11362. let stats = undefined;
  11363. try {
  11364. // test file exists
  11365. stats = yield exports.stat(filePath);
  11366. }
  11367. catch (err) {
  11368. if (err.code !== 'ENOENT') {
  11369. // eslint-disable-next-line no-console
  11370. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11371. }
  11372. }
  11373. if (stats && stats.isFile()) {
  11374. if (exports.IS_WINDOWS) {
  11375. // on Windows, test for valid extension
  11376. const upperExt = path.extname(filePath).toUpperCase();
  11377. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11378. return filePath;
  11379. }
  11380. }
  11381. else {
  11382. if (isUnixExecutable(stats)) {
  11383. return filePath;
  11384. }
  11385. }
  11386. }
  11387. // try each extension
  11388. const originalFilePath = filePath;
  11389. for (const extension of extensions) {
  11390. filePath = originalFilePath + extension;
  11391. stats = undefined;
  11392. try {
  11393. stats = yield exports.stat(filePath);
  11394. }
  11395. catch (err) {
  11396. if (err.code !== 'ENOENT') {
  11397. // eslint-disable-next-line no-console
  11398. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11399. }
  11400. }
  11401. if (stats && stats.isFile()) {
  11402. if (exports.IS_WINDOWS) {
  11403. // preserve the case of the actual file (since an extension was appended)
  11404. try {
  11405. const directory = path.dirname(filePath);
  11406. const upperName = path.basename(filePath).toUpperCase();
  11407. for (const actualName of yield exports.readdir(directory)) {
  11408. if (upperName === actualName.toUpperCase()) {
  11409. filePath = path.join(directory, actualName);
  11410. break;
  11411. }
  11412. }
  11413. }
  11414. catch (err) {
  11415. // eslint-disable-next-line no-console
  11416. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11417. }
  11418. return filePath;
  11419. }
  11420. else {
  11421. if (isUnixExecutable(stats)) {
  11422. return filePath;
  11423. }
  11424. }
  11425. }
  11426. }
  11427. return '';
  11428. });
  11429. }
  11430. exports.tryGetExecutablePath = tryGetExecutablePath;
  11431. function normalizeSeparators(p) {
  11432. p = p || '';
  11433. if (exports.IS_WINDOWS) {
  11434. // convert slashes on Windows
  11435. p = p.replace(/\//g, '\\');
  11436. // remove redundant slashes
  11437. return p.replace(/\\\\+/g, '\\');
  11438. }
  11439. // remove redundant slashes
  11440. return p.replace(/\/\/+/g, '/');
  11441. }
  11442. // on Mac/Linux, test the execute bit
  11443. // R W X R W X R W X
  11444. // 256 128 64 32 16 8 4 2 1
  11445. function isUnixExecutable(stats) {
  11446. return ((stats.mode & 1) > 0 ||
  11447. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11448. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11449. }
  11450. //# sourceMappingURL=io-util.js.map
  11451. /***/ }),
  11452. /***/ 674:
  11453. /***/ (function(module, __unusedexports, __webpack_require__) {
  11454. module.exports = authenticate;
  11455. const { Deprecation } = __webpack_require__(692);
  11456. const once = __webpack_require__(969);
  11457. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11458. function authenticate(state, options) {
  11459. deprecateAuthenticate(
  11460. state.octokit.log,
  11461. new Deprecation(
  11462. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11463. )
  11464. );
  11465. if (!options) {
  11466. state.auth = false;
  11467. return;
  11468. }
  11469. switch (options.type) {
  11470. case "basic":
  11471. if (!options.username || !options.password) {
  11472. throw new Error(
  11473. "Basic authentication requires both a username and password to be set"
  11474. );
  11475. }
  11476. break;
  11477. case "oauth":
  11478. if (!options.token && !(options.key && options.secret)) {
  11479. throw new Error(
  11480. "OAuth2 authentication requires a token or key & secret to be set"
  11481. );
  11482. }
  11483. break;
  11484. case "token":
  11485. case "app":
  11486. if (!options.token) {
  11487. throw new Error("Token authentication requires a token to be set");
  11488. }
  11489. break;
  11490. default:
  11491. throw new Error(
  11492. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11493. );
  11494. }
  11495. state.auth = options;
  11496. }
  11497. /***/ }),
  11498. /***/ 675:
  11499. /***/ (function(module) {
  11500. module.exports = function btoa(str) {
  11501. return new Buffer(str).toString('base64')
  11502. }
  11503. /***/ }),
  11504. /***/ 692:
  11505. /***/ (function(__unusedmodule, exports) {
  11506. "use strict";
  11507. Object.defineProperty(exports, '__esModule', { value: true });
  11508. class Deprecation extends Error {
  11509. constructor(message) {
  11510. super(message); // Maintains proper stack trace (only available on V8)
  11511. /* istanbul ignore next */
  11512. if (Error.captureStackTrace) {
  11513. Error.captureStackTrace(this, this.constructor);
  11514. }
  11515. this.name = 'Deprecation';
  11516. }
  11517. }
  11518. exports.Deprecation = Deprecation;
  11519. /***/ }),
  11520. /***/ 696:
  11521. /***/ (function(module) {
  11522. "use strict";
  11523. /*!
  11524. * isobject <https://github.com/jonschlinkert/isobject>
  11525. *
  11526. * Copyright (c) 2014-2017, Jon Schlinkert.
  11527. * Released under the MIT License.
  11528. */
  11529. function isObject(val) {
  11530. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11531. }
  11532. /*!
  11533. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11534. *
  11535. * Copyright (c) 2014-2017, Jon Schlinkert.
  11536. * Released under the MIT License.
  11537. */
  11538. function isObjectObject(o) {
  11539. return isObject(o) === true
  11540. && Object.prototype.toString.call(o) === '[object Object]';
  11541. }
  11542. function isPlainObject(o) {
  11543. var ctor,prot;
  11544. if (isObjectObject(o) === false) return false;
  11545. // If has modified constructor
  11546. ctor = o.constructor;
  11547. if (typeof ctor !== 'function') return false;
  11548. // If has modified prototype
  11549. prot = ctor.prototype;
  11550. if (isObjectObject(prot) === false) return false;
  11551. // If constructor does not have an Object-specific method
  11552. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11553. return false;
  11554. }
  11555. // Most likely a plain Object
  11556. return true;
  11557. }
  11558. module.exports = isPlainObject;
  11559. /***/ }),
  11560. /***/ 697:
  11561. /***/ (function(module) {
  11562. "use strict";
  11563. module.exports = (promise, onFinally) => {
  11564. onFinally = onFinally || (() => {});
  11565. return promise.then(
  11566. val => new Promise(resolve => {
  11567. resolve(onFinally());
  11568. }).then(() => val),
  11569. err => new Promise(resolve => {
  11570. resolve(onFinally());
  11571. }).then(() => {
  11572. throw err;
  11573. })
  11574. );
  11575. };
  11576. /***/ }),
  11577. /***/ 705:
  11578. /***/ (function(module) {
  11579. 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"}}};
  11580. /***/ }),
  11581. /***/ 722:
  11582. /***/ (function(module) {
  11583. /**
  11584. * Convert array of 16 byte values to UUID string format of the form:
  11585. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11586. */
  11587. var byteToHex = [];
  11588. for (var i = 0; i < 256; ++i) {
  11589. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11590. }
  11591. function bytesToUuid(buf, offset) {
  11592. var i = offset || 0;
  11593. var bth = byteToHex;
  11594. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11595. return ([bth[buf[i++]], bth[buf[i++]],
  11596. bth[buf[i++]], bth[buf[i++]], '-',
  11597. bth[buf[i++]], bth[buf[i++]], '-',
  11598. bth[buf[i++]], bth[buf[i++]], '-',
  11599. bth[buf[i++]], bth[buf[i++]], '-',
  11600. bth[buf[i++]], bth[buf[i++]],
  11601. bth[buf[i++]], bth[buf[i++]],
  11602. bth[buf[i++]], bth[buf[i++]]]).join('');
  11603. }
  11604. module.exports = bytesToUuid;
  11605. /***/ }),
  11606. /***/ 742:
  11607. /***/ (function(module, __unusedexports, __webpack_require__) {
  11608. var fs = __webpack_require__(747)
  11609. var core
  11610. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11611. core = __webpack_require__(818)
  11612. } else {
  11613. core = __webpack_require__(197)
  11614. }
  11615. module.exports = isexe
  11616. isexe.sync = sync
  11617. function isexe (path, options, cb) {
  11618. if (typeof options === 'function') {
  11619. cb = options
  11620. options = {}
  11621. }
  11622. if (!cb) {
  11623. if (typeof Promise !== 'function') {
  11624. throw new TypeError('callback not provided')
  11625. }
  11626. return new Promise(function (resolve, reject) {
  11627. isexe(path, options || {}, function (er, is) {
  11628. if (er) {
  11629. reject(er)
  11630. } else {
  11631. resolve(is)
  11632. }
  11633. })
  11634. })
  11635. }
  11636. core(path, options || {}, function (er, is) {
  11637. // ignore EACCES because that just means we aren't allowed to run it
  11638. if (er) {
  11639. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11640. er = null
  11641. is = false
  11642. }
  11643. }
  11644. cb(er, is)
  11645. })
  11646. }
  11647. function sync (path, options) {
  11648. // my kingdom for a filtered catch
  11649. try {
  11650. return core.sync(path, options || {})
  11651. } catch (er) {
  11652. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11653. return false
  11654. } else {
  11655. throw er
  11656. }
  11657. }
  11658. }
  11659. /***/ }),
  11660. /***/ 747:
  11661. /***/ (function(module) {
  11662. module.exports = require("fs");
  11663. /***/ }),
  11664. /***/ 753:
  11665. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11666. "use strict";
  11667. Object.defineProperty(exports, '__esModule', { value: true });
  11668. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11669. var endpoint = __webpack_require__(385);
  11670. var universalUserAgent = __webpack_require__(796);
  11671. var isPlainObject = _interopDefault(__webpack_require__(696));
  11672. var nodeFetch = _interopDefault(__webpack_require__(454));
  11673. var requestError = __webpack_require__(463);
  11674. const VERSION = "5.3.1";
  11675. function getBufferResponse(response) {
  11676. return response.arrayBuffer();
  11677. }
  11678. function fetchWrapper(requestOptions) {
  11679. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11680. requestOptions.body = JSON.stringify(requestOptions.body);
  11681. }
  11682. let headers = {};
  11683. let status;
  11684. let url;
  11685. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11686. return fetch(requestOptions.url, Object.assign({
  11687. method: requestOptions.method,
  11688. body: requestOptions.body,
  11689. headers: requestOptions.headers,
  11690. redirect: requestOptions.redirect
  11691. }, requestOptions.request)).then(response => {
  11692. url = response.url;
  11693. status = response.status;
  11694. for (const keyAndValue of response.headers) {
  11695. headers[keyAndValue[0]] = keyAndValue[1];
  11696. }
  11697. if (status === 204 || status === 205) {
  11698. return;
  11699. } // GitHub API returns 200 for HEAD requsets
  11700. if (requestOptions.method === "HEAD") {
  11701. if (status < 400) {
  11702. return;
  11703. }
  11704. throw new requestError.RequestError(response.statusText, status, {
  11705. headers,
  11706. request: requestOptions
  11707. });
  11708. }
  11709. if (status === 304) {
  11710. throw new requestError.RequestError("Not modified", status, {
  11711. headers,
  11712. request: requestOptions
  11713. });
  11714. }
  11715. if (status >= 400) {
  11716. return response.text().then(message => {
  11717. const error = new requestError.RequestError(message, status, {
  11718. headers,
  11719. request: requestOptions
  11720. });
  11721. try {
  11722. let responseBody = JSON.parse(error.message);
  11723. Object.assign(error, responseBody);
  11724. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11725. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11726. } catch (e) {// ignore, see octokit/rest.js#684
  11727. }
  11728. throw error;
  11729. });
  11730. }
  11731. const contentType = response.headers.get("content-type");
  11732. if (/application\/json/.test(contentType)) {
  11733. return response.json();
  11734. }
  11735. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11736. return response.text();
  11737. }
  11738. return getBufferResponse(response);
  11739. }).then(data => {
  11740. return {
  11741. status,
  11742. url,
  11743. headers,
  11744. data
  11745. };
  11746. }).catch(error => {
  11747. if (error instanceof requestError.RequestError) {
  11748. throw error;
  11749. }
  11750. throw new requestError.RequestError(error.message, 500, {
  11751. headers,
  11752. request: requestOptions
  11753. });
  11754. });
  11755. }
  11756. function withDefaults(oldEndpoint, newDefaults) {
  11757. const endpoint = oldEndpoint.defaults(newDefaults);
  11758. const newApi = function (route, parameters) {
  11759. const endpointOptions = endpoint.merge(route, parameters);
  11760. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11761. return fetchWrapper(endpoint.parse(endpointOptions));
  11762. }
  11763. const request = (route, parameters) => {
  11764. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11765. };
  11766. Object.assign(request, {
  11767. endpoint,
  11768. defaults: withDefaults.bind(null, endpoint)
  11769. });
  11770. return endpointOptions.request.hook(request, endpointOptions);
  11771. };
  11772. return Object.assign(newApi, {
  11773. endpoint,
  11774. defaults: withDefaults.bind(null, endpoint)
  11775. });
  11776. }
  11777. const request = withDefaults(endpoint.endpoint, {
  11778. headers: {
  11779. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11780. }
  11781. });
  11782. exports.request = request;
  11783. //# sourceMappingURL=index.js.map
  11784. /***/ }),
  11785. /***/ 761:
  11786. /***/ (function(module) {
  11787. module.exports = require("zlib");
  11788. /***/ }),
  11789. /***/ 763:
  11790. /***/ (function(module) {
  11791. module.exports = removeHook
  11792. function removeHook (state, name, method) {
  11793. if (!state.registry[name]) {
  11794. return
  11795. }
  11796. var index = state.registry[name]
  11797. .map(function (registered) { return registered.orig })
  11798. .indexOf(method)
  11799. if (index === -1) {
  11800. return
  11801. }
  11802. state.registry[name].splice(index, 1)
  11803. }
  11804. /***/ }),
  11805. /***/ 768:
  11806. /***/ (function(module) {
  11807. "use strict";
  11808. module.exports = function (x) {
  11809. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11810. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11811. if (x[x.length - 1] === lf) {
  11812. x = x.slice(0, x.length - 1);
  11813. }
  11814. if (x[x.length - 1] === cr) {
  11815. x = x.slice(0, x.length - 1);
  11816. }
  11817. return x;
  11818. };
  11819. /***/ }),
  11820. /***/ 777:
  11821. /***/ (function(module, __unusedexports, __webpack_require__) {
  11822. module.exports = getFirstPage
  11823. const getPage = __webpack_require__(265)
  11824. function getFirstPage (octokit, link, headers) {
  11825. return getPage(octokit, link, 'first', headers)
  11826. }
  11827. /***/ }),
  11828. /***/ 796:
  11829. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11830. "use strict";
  11831. Object.defineProperty(exports, '__esModule', { value: true });
  11832. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11833. var osName = _interopDefault(__webpack_require__(2));
  11834. function getUserAgent() {
  11835. try {
  11836. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  11837. } catch (error) {
  11838. if (/wmic os get Caption/.test(error.message)) {
  11839. return "Windows <version undetectable>";
  11840. }
  11841. throw error;
  11842. }
  11843. }
  11844. exports.getUserAgent = getUserAgent;
  11845. //# sourceMappingURL=index.js.map
  11846. /***/ }),
  11847. /***/ 807:
  11848. /***/ (function(module, __unusedexports, __webpack_require__) {
  11849. module.exports = paginate;
  11850. const iterator = __webpack_require__(8);
  11851. function paginate(octokit, route, options, mapFn) {
  11852. if (typeof options === "function") {
  11853. mapFn = options;
  11854. options = undefined;
  11855. }
  11856. options = octokit.request.endpoint.merge(route, options);
  11857. return gather(
  11858. octokit,
  11859. [],
  11860. iterator(octokit, options)[Symbol.asyncIterator](),
  11861. mapFn
  11862. );
  11863. }
  11864. function gather(octokit, results, iterator, mapFn) {
  11865. return iterator.next().then(result => {
  11866. if (result.done) {
  11867. return results;
  11868. }
  11869. let earlyExit = false;
  11870. function done() {
  11871. earlyExit = true;
  11872. }
  11873. results = results.concat(
  11874. mapFn ? mapFn(result.value, done) : result.value.data
  11875. );
  11876. if (earlyExit) {
  11877. return results;
  11878. }
  11879. return gather(octokit, results, iterator, mapFn);
  11880. });
  11881. }
  11882. /***/ }),
  11883. /***/ 813:
  11884. /***/ (function(__unusedmodule, exports) {
  11885. "use strict";
  11886. Object.defineProperty(exports, '__esModule', { value: true });
  11887. async function auth(token) {
  11888. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  11889. return {
  11890. type: "token",
  11891. token: token,
  11892. tokenType
  11893. };
  11894. }
  11895. /**
  11896. * Prefix token for usage in the Authorization header
  11897. *
  11898. * @param token OAuth token or JSON Web Token
  11899. */
  11900. function withAuthorizationPrefix(token) {
  11901. if (token.split(/\./).length === 3) {
  11902. return `bearer ${token}`;
  11903. }
  11904. return `token ${token}`;
  11905. }
  11906. async function hook(token, request, route, parameters) {
  11907. const endpoint = request.endpoint.merge(route, parameters);
  11908. endpoint.headers.authorization = withAuthorizationPrefix(token);
  11909. return request(endpoint);
  11910. }
  11911. const createTokenAuth = function createTokenAuth(token) {
  11912. if (!token) {
  11913. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  11914. }
  11915. if (typeof token !== "string") {
  11916. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  11917. }
  11918. token = token.replace(/^(token|bearer) +/i, "");
  11919. return Object.assign(auth.bind(null, token), {
  11920. hook: hook.bind(null, token)
  11921. });
  11922. };
  11923. exports.createTokenAuth = createTokenAuth;
  11924. //# sourceMappingURL=index.js.map
  11925. /***/ }),
  11926. /***/ 814:
  11927. /***/ (function(module, __unusedexports, __webpack_require__) {
  11928. module.exports = which
  11929. which.sync = whichSync
  11930. var isWindows = process.platform === 'win32' ||
  11931. process.env.OSTYPE === 'cygwin' ||
  11932. process.env.OSTYPE === 'msys'
  11933. var path = __webpack_require__(622)
  11934. var COLON = isWindows ? ';' : ':'
  11935. var isexe = __webpack_require__(742)
  11936. function getNotFoundError (cmd) {
  11937. var er = new Error('not found: ' + cmd)
  11938. er.code = 'ENOENT'
  11939. return er
  11940. }
  11941. function getPathInfo (cmd, opt) {
  11942. var colon = opt.colon || COLON
  11943. var pathEnv = opt.path || process.env.PATH || ''
  11944. var pathExt = ['']
  11945. pathEnv = pathEnv.split(colon)
  11946. var pathExtExe = ''
  11947. if (isWindows) {
  11948. pathEnv.unshift(process.cwd())
  11949. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  11950. pathExt = pathExtExe.split(colon)
  11951. // Always test the cmd itself first. isexe will check to make sure
  11952. // it's found in the pathExt set.
  11953. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  11954. pathExt.unshift('')
  11955. }
  11956. // If it has a slash, then we don't bother searching the pathenv.
  11957. // just check the file itself, and that's it.
  11958. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  11959. pathEnv = ['']
  11960. return {
  11961. env: pathEnv,
  11962. ext: pathExt,
  11963. extExe: pathExtExe
  11964. }
  11965. }
  11966. function which (cmd, opt, cb) {
  11967. if (typeof opt === 'function') {
  11968. cb = opt
  11969. opt = {}
  11970. }
  11971. var info = getPathInfo(cmd, opt)
  11972. var pathEnv = info.env
  11973. var pathExt = info.ext
  11974. var pathExtExe = info.extExe
  11975. var found = []
  11976. ;(function F (i, l) {
  11977. if (i === l) {
  11978. if (opt.all && found.length)
  11979. return cb(null, found)
  11980. else
  11981. return cb(getNotFoundError(cmd))
  11982. }
  11983. var pathPart = pathEnv[i]
  11984. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  11985. pathPart = pathPart.slice(1, -1)
  11986. var p = path.join(pathPart, cmd)
  11987. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  11988. p = cmd.slice(0, 2) + p
  11989. }
  11990. ;(function E (ii, ll) {
  11991. if (ii === ll) return F(i + 1, l)
  11992. var ext = pathExt[ii]
  11993. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  11994. if (!er && is) {
  11995. if (opt.all)
  11996. found.push(p + ext)
  11997. else
  11998. return cb(null, p + ext)
  11999. }
  12000. return E(ii + 1, ll)
  12001. })
  12002. })(0, pathExt.length)
  12003. })(0, pathEnv.length)
  12004. }
  12005. function whichSync (cmd, opt) {
  12006. opt = opt || {}
  12007. var info = getPathInfo(cmd, opt)
  12008. var pathEnv = info.env
  12009. var pathExt = info.ext
  12010. var pathExtExe = info.extExe
  12011. var found = []
  12012. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12013. var pathPart = pathEnv[i]
  12014. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12015. pathPart = pathPart.slice(1, -1)
  12016. var p = path.join(pathPart, cmd)
  12017. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12018. p = cmd.slice(0, 2) + p
  12019. }
  12020. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12021. var cur = p + pathExt[j]
  12022. var is
  12023. try {
  12024. is = isexe.sync(cur, { pathExt: pathExtExe })
  12025. if (is) {
  12026. if (opt.all)
  12027. found.push(cur)
  12028. else
  12029. return cur
  12030. }
  12031. } catch (ex) {}
  12032. }
  12033. }
  12034. if (opt.all && found.length)
  12035. return found
  12036. if (opt.nothrow)
  12037. return null
  12038. throw getNotFoundError(cmd)
  12039. }
  12040. /***/ }),
  12041. /***/ 816:
  12042. /***/ (function(module) {
  12043. "use strict";
  12044. module.exports = /^#!.*/;
  12045. /***/ }),
  12046. /***/ 818:
  12047. /***/ (function(module, __unusedexports, __webpack_require__) {
  12048. module.exports = isexe
  12049. isexe.sync = sync
  12050. var fs = __webpack_require__(747)
  12051. function checkPathExt (path, options) {
  12052. var pathext = options.pathExt !== undefined ?
  12053. options.pathExt : process.env.PATHEXT
  12054. if (!pathext) {
  12055. return true
  12056. }
  12057. pathext = pathext.split(';')
  12058. if (pathext.indexOf('') !== -1) {
  12059. return true
  12060. }
  12061. for (var i = 0; i < pathext.length; i++) {
  12062. var p = pathext[i].toLowerCase()
  12063. if (p && path.substr(-p.length).toLowerCase() === p) {
  12064. return true
  12065. }
  12066. }
  12067. return false
  12068. }
  12069. function checkStat (stat, path, options) {
  12070. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12071. return false
  12072. }
  12073. return checkPathExt(path, options)
  12074. }
  12075. function isexe (path, options, cb) {
  12076. fs.stat(path, function (er, stat) {
  12077. cb(er, er ? false : checkStat(stat, path, options))
  12078. })
  12079. }
  12080. function sync (path, options) {
  12081. return checkStat(fs.statSync(path), path, options)
  12082. }
  12083. /***/ }),
  12084. /***/ 821:
  12085. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12086. "use strict";
  12087. var __importStar = (this && this.__importStar) || function (mod) {
  12088. if (mod && mod.__esModule) return mod;
  12089. var result = {};
  12090. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12091. result["default"] = mod;
  12092. return result;
  12093. };
  12094. Object.defineProperty(exports, "__esModule", { value: true });
  12095. const core = __importStar(__webpack_require__(470));
  12096. const fsHelper = __importStar(__webpack_require__(618));
  12097. const github = __importStar(__webpack_require__(469));
  12098. const path = __importStar(__webpack_require__(622));
  12099. function getInputs() {
  12100. const result = {};
  12101. // GitHub workspace
  12102. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12103. if (!githubWorkspacePath) {
  12104. throw new Error('GITHUB_WORKSPACE not defined');
  12105. }
  12106. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12107. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12108. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12109. // Qualified repository
  12110. const qualifiedRepository = core.getInput('repository') ||
  12111. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12112. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12113. const splitRepository = qualifiedRepository.split('/');
  12114. if (splitRepository.length !== 2 ||
  12115. !splitRepository[0] ||
  12116. !splitRepository[1]) {
  12117. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12118. }
  12119. result.repositoryOwner = splitRepository[0];
  12120. result.repositoryName = splitRepository[1];
  12121. // Repository path
  12122. result.repositoryPath = core.getInput('path') || '.';
  12123. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12124. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12125. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12126. }
  12127. // Workflow repository?
  12128. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12129. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12130. // Source branch, source version
  12131. result.ref = core.getInput('ref');
  12132. if (!result.ref) {
  12133. if (isWorkflowRepository) {
  12134. result.ref = github.context.ref;
  12135. result.commit = github.context.sha;
  12136. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12137. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12138. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12139. result.ref = `refs/heads/${result.ref}`;
  12140. }
  12141. }
  12142. if (!result.ref && !result.commit) {
  12143. result.ref = 'refs/heads/master';
  12144. }
  12145. }
  12146. // SHA?
  12147. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12148. result.commit = result.ref;
  12149. result.ref = '';
  12150. }
  12151. core.debug(`ref = '${result.ref}'`);
  12152. core.debug(`commit = '${result.commit}'`);
  12153. // Clean
  12154. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12155. core.debug(`clean = ${result.clean}`);
  12156. // Fetch depth
  12157. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12158. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12159. result.fetchDepth = 0;
  12160. }
  12161. core.debug(`fetch depth = ${result.fetchDepth}`);
  12162. // LFS
  12163. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12164. core.debug(`lfs = ${result.lfs}`);
  12165. // Submodules
  12166. result.submodules = false;
  12167. result.nestedSubmodules = false;
  12168. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12169. if (submodulesString == 'RECURSIVE') {
  12170. result.submodules = true;
  12171. result.nestedSubmodules = true;
  12172. }
  12173. else if (submodulesString == 'TRUE') {
  12174. result.submodules = true;
  12175. }
  12176. core.debug(`submodules = ${result.submodules}`);
  12177. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12178. // Auth token
  12179. result.authToken = core.getInput('token');
  12180. // SSH
  12181. result.sshKey = core.getInput('ssh-key');
  12182. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12183. result.sshStrict =
  12184. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12185. // Persist credentials
  12186. result.persistCredentials =
  12187. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12188. return result;
  12189. }
  12190. exports.getInputs = getInputs;
  12191. /***/ }),
  12192. /***/ 826:
  12193. /***/ (function(module, __unusedexports, __webpack_require__) {
  12194. var rng = __webpack_require__(139);
  12195. var bytesToUuid = __webpack_require__(722);
  12196. function v4(options, buf, offset) {
  12197. var i = buf && offset || 0;
  12198. if (typeof(options) == 'string') {
  12199. buf = options === 'binary' ? new Array(16) : null;
  12200. options = null;
  12201. }
  12202. options = options || {};
  12203. var rnds = options.random || (options.rng || rng)();
  12204. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12205. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12206. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12207. // Copy bytes to buffer, if provided
  12208. if (buf) {
  12209. for (var ii = 0; ii < 16; ++ii) {
  12210. buf[i + ii] = rnds[ii];
  12211. }
  12212. }
  12213. return buf || bytesToUuid(rnds);
  12214. }
  12215. module.exports = v4;
  12216. /***/ }),
  12217. /***/ 835:
  12218. /***/ (function(module) {
  12219. module.exports = require("url");
  12220. /***/ }),
  12221. /***/ 850:
  12222. /***/ (function(module, __unusedexports, __webpack_require__) {
  12223. module.exports = paginationMethodsPlugin
  12224. function paginationMethodsPlugin (octokit) {
  12225. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  12226. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  12227. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  12228. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  12229. octokit.hasFirstPage = __webpack_require__(536)
  12230. octokit.hasLastPage = __webpack_require__(336)
  12231. octokit.hasNextPage = __webpack_require__(929)
  12232. octokit.hasPreviousPage = __webpack_require__(558)
  12233. }
  12234. /***/ }),
  12235. /***/ 854:
  12236. /***/ (function(module) {
  12237. /**
  12238. * lodash (Custom Build) <https://lodash.com/>
  12239. * Build: `lodash modularize exports="npm" -o ./`
  12240. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12241. * Released under MIT license <https://lodash.com/license>
  12242. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12243. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12244. */
  12245. /** Used as the `TypeError` message for "Functions" methods. */
  12246. var FUNC_ERROR_TEXT = 'Expected a function';
  12247. /** Used to stand-in for `undefined` hash values. */
  12248. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12249. /** Used as references for various `Number` constants. */
  12250. var INFINITY = 1 / 0;
  12251. /** `Object#toString` result references. */
  12252. var funcTag = '[object Function]',
  12253. genTag = '[object GeneratorFunction]',
  12254. symbolTag = '[object Symbol]';
  12255. /** Used to match property names within property paths. */
  12256. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12257. reIsPlainProp = /^\w*$/,
  12258. reLeadingDot = /^\./,
  12259. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12260. /**
  12261. * Used to match `RegExp`
  12262. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12263. */
  12264. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12265. /** Used to match backslashes in property paths. */
  12266. var reEscapeChar = /\\(\\)?/g;
  12267. /** Used to detect host constructors (Safari). */
  12268. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12269. /** Detect free variable `global` from Node.js. */
  12270. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12271. /** Detect free variable `self`. */
  12272. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12273. /** Used as a reference to the global object. */
  12274. var root = freeGlobal || freeSelf || Function('return this')();
  12275. /**
  12276. * Gets the value at `key` of `object`.
  12277. *
  12278. * @private
  12279. * @param {Object} [object] The object to query.
  12280. * @param {string} key The key of the property to get.
  12281. * @returns {*} Returns the property value.
  12282. */
  12283. function getValue(object, key) {
  12284. return object == null ? undefined : object[key];
  12285. }
  12286. /**
  12287. * Checks if `value` is a host object in IE < 9.
  12288. *
  12289. * @private
  12290. * @param {*} value The value to check.
  12291. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12292. */
  12293. function isHostObject(value) {
  12294. // Many host objects are `Object` objects that can coerce to strings
  12295. // despite having improperly defined `toString` methods.
  12296. var result = false;
  12297. if (value != null && typeof value.toString != 'function') {
  12298. try {
  12299. result = !!(value + '');
  12300. } catch (e) {}
  12301. }
  12302. return result;
  12303. }
  12304. /** Used for built-in method references. */
  12305. var arrayProto = Array.prototype,
  12306. funcProto = Function.prototype,
  12307. objectProto = Object.prototype;
  12308. /** Used to detect overreaching core-js shims. */
  12309. var coreJsData = root['__core-js_shared__'];
  12310. /** Used to detect methods masquerading as native. */
  12311. var maskSrcKey = (function() {
  12312. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12313. return uid ? ('Symbol(src)_1.' + uid) : '';
  12314. }());
  12315. /** Used to resolve the decompiled source of functions. */
  12316. var funcToString = funcProto.toString;
  12317. /** Used to check objects for own properties. */
  12318. var hasOwnProperty = objectProto.hasOwnProperty;
  12319. /**
  12320. * Used to resolve the
  12321. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12322. * of values.
  12323. */
  12324. var objectToString = objectProto.toString;
  12325. /** Used to detect if a method is native. */
  12326. var reIsNative = RegExp('^' +
  12327. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12328. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12329. );
  12330. /** Built-in value references. */
  12331. var Symbol = root.Symbol,
  12332. splice = arrayProto.splice;
  12333. /* Built-in method references that are verified to be native. */
  12334. var Map = getNative(root, 'Map'),
  12335. nativeCreate = getNative(Object, 'create');
  12336. /** Used to convert symbols to primitives and strings. */
  12337. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12338. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12339. /**
  12340. * Creates a hash object.
  12341. *
  12342. * @private
  12343. * @constructor
  12344. * @param {Array} [entries] The key-value pairs to cache.
  12345. */
  12346. function Hash(entries) {
  12347. var index = -1,
  12348. length = entries ? entries.length : 0;
  12349. this.clear();
  12350. while (++index < length) {
  12351. var entry = entries[index];
  12352. this.set(entry[0], entry[1]);
  12353. }
  12354. }
  12355. /**
  12356. * Removes all key-value entries from the hash.
  12357. *
  12358. * @private
  12359. * @name clear
  12360. * @memberOf Hash
  12361. */
  12362. function hashClear() {
  12363. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12364. }
  12365. /**
  12366. * Removes `key` and its value from the hash.
  12367. *
  12368. * @private
  12369. * @name delete
  12370. * @memberOf Hash
  12371. * @param {Object} hash The hash to modify.
  12372. * @param {string} key The key of the value to remove.
  12373. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12374. */
  12375. function hashDelete(key) {
  12376. return this.has(key) && delete this.__data__[key];
  12377. }
  12378. /**
  12379. * Gets the hash value for `key`.
  12380. *
  12381. * @private
  12382. * @name get
  12383. * @memberOf Hash
  12384. * @param {string} key The key of the value to get.
  12385. * @returns {*} Returns the entry value.
  12386. */
  12387. function hashGet(key) {
  12388. var data = this.__data__;
  12389. if (nativeCreate) {
  12390. var result = data[key];
  12391. return result === HASH_UNDEFINED ? undefined : result;
  12392. }
  12393. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12394. }
  12395. /**
  12396. * Checks if a hash value for `key` exists.
  12397. *
  12398. * @private
  12399. * @name has
  12400. * @memberOf Hash
  12401. * @param {string} key The key of the entry to check.
  12402. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12403. */
  12404. function hashHas(key) {
  12405. var data = this.__data__;
  12406. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12407. }
  12408. /**
  12409. * Sets the hash `key` to `value`.
  12410. *
  12411. * @private
  12412. * @name set
  12413. * @memberOf Hash
  12414. * @param {string} key The key of the value to set.
  12415. * @param {*} value The value to set.
  12416. * @returns {Object} Returns the hash instance.
  12417. */
  12418. function hashSet(key, value) {
  12419. var data = this.__data__;
  12420. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12421. return this;
  12422. }
  12423. // Add methods to `Hash`.
  12424. Hash.prototype.clear = hashClear;
  12425. Hash.prototype['delete'] = hashDelete;
  12426. Hash.prototype.get = hashGet;
  12427. Hash.prototype.has = hashHas;
  12428. Hash.prototype.set = hashSet;
  12429. /**
  12430. * Creates an list cache object.
  12431. *
  12432. * @private
  12433. * @constructor
  12434. * @param {Array} [entries] The key-value pairs to cache.
  12435. */
  12436. function ListCache(entries) {
  12437. var index = -1,
  12438. length = entries ? entries.length : 0;
  12439. this.clear();
  12440. while (++index < length) {
  12441. var entry = entries[index];
  12442. this.set(entry[0], entry[1]);
  12443. }
  12444. }
  12445. /**
  12446. * Removes all key-value entries from the list cache.
  12447. *
  12448. * @private
  12449. * @name clear
  12450. * @memberOf ListCache
  12451. */
  12452. function listCacheClear() {
  12453. this.__data__ = [];
  12454. }
  12455. /**
  12456. * Removes `key` and its value from the list cache.
  12457. *
  12458. * @private
  12459. * @name delete
  12460. * @memberOf ListCache
  12461. * @param {string} key The key of the value to remove.
  12462. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12463. */
  12464. function listCacheDelete(key) {
  12465. var data = this.__data__,
  12466. index = assocIndexOf(data, key);
  12467. if (index < 0) {
  12468. return false;
  12469. }
  12470. var lastIndex = data.length - 1;
  12471. if (index == lastIndex) {
  12472. data.pop();
  12473. } else {
  12474. splice.call(data, index, 1);
  12475. }
  12476. return true;
  12477. }
  12478. /**
  12479. * Gets the list cache value for `key`.
  12480. *
  12481. * @private
  12482. * @name get
  12483. * @memberOf ListCache
  12484. * @param {string} key The key of the value to get.
  12485. * @returns {*} Returns the entry value.
  12486. */
  12487. function listCacheGet(key) {
  12488. var data = this.__data__,
  12489. index = assocIndexOf(data, key);
  12490. return index < 0 ? undefined : data[index][1];
  12491. }
  12492. /**
  12493. * Checks if a list cache value for `key` exists.
  12494. *
  12495. * @private
  12496. * @name has
  12497. * @memberOf ListCache
  12498. * @param {string} key The key of the entry to check.
  12499. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12500. */
  12501. function listCacheHas(key) {
  12502. return assocIndexOf(this.__data__, key) > -1;
  12503. }
  12504. /**
  12505. * Sets the list cache `key` to `value`.
  12506. *
  12507. * @private
  12508. * @name set
  12509. * @memberOf ListCache
  12510. * @param {string} key The key of the value to set.
  12511. * @param {*} value The value to set.
  12512. * @returns {Object} Returns the list cache instance.
  12513. */
  12514. function listCacheSet(key, value) {
  12515. var data = this.__data__,
  12516. index = assocIndexOf(data, key);
  12517. if (index < 0) {
  12518. data.push([key, value]);
  12519. } else {
  12520. data[index][1] = value;
  12521. }
  12522. return this;
  12523. }
  12524. // Add methods to `ListCache`.
  12525. ListCache.prototype.clear = listCacheClear;
  12526. ListCache.prototype['delete'] = listCacheDelete;
  12527. ListCache.prototype.get = listCacheGet;
  12528. ListCache.prototype.has = listCacheHas;
  12529. ListCache.prototype.set = listCacheSet;
  12530. /**
  12531. * Creates a map cache object to store key-value pairs.
  12532. *
  12533. * @private
  12534. * @constructor
  12535. * @param {Array} [entries] The key-value pairs to cache.
  12536. */
  12537. function MapCache(entries) {
  12538. var index = -1,
  12539. length = entries ? entries.length : 0;
  12540. this.clear();
  12541. while (++index < length) {
  12542. var entry = entries[index];
  12543. this.set(entry[0], entry[1]);
  12544. }
  12545. }
  12546. /**
  12547. * Removes all key-value entries from the map.
  12548. *
  12549. * @private
  12550. * @name clear
  12551. * @memberOf MapCache
  12552. */
  12553. function mapCacheClear() {
  12554. this.__data__ = {
  12555. 'hash': new Hash,
  12556. 'map': new (Map || ListCache),
  12557. 'string': new Hash
  12558. };
  12559. }
  12560. /**
  12561. * Removes `key` and its value from the map.
  12562. *
  12563. * @private
  12564. * @name delete
  12565. * @memberOf MapCache
  12566. * @param {string} key The key of the value to remove.
  12567. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12568. */
  12569. function mapCacheDelete(key) {
  12570. return getMapData(this, key)['delete'](key);
  12571. }
  12572. /**
  12573. * Gets the map value for `key`.
  12574. *
  12575. * @private
  12576. * @name get
  12577. * @memberOf MapCache
  12578. * @param {string} key The key of the value to get.
  12579. * @returns {*} Returns the entry value.
  12580. */
  12581. function mapCacheGet(key) {
  12582. return getMapData(this, key).get(key);
  12583. }
  12584. /**
  12585. * Checks if a map value for `key` exists.
  12586. *
  12587. * @private
  12588. * @name has
  12589. * @memberOf MapCache
  12590. * @param {string} key The key of the entry to check.
  12591. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12592. */
  12593. function mapCacheHas(key) {
  12594. return getMapData(this, key).has(key);
  12595. }
  12596. /**
  12597. * Sets the map `key` to `value`.
  12598. *
  12599. * @private
  12600. * @name set
  12601. * @memberOf MapCache
  12602. * @param {string} key The key of the value to set.
  12603. * @param {*} value The value to set.
  12604. * @returns {Object} Returns the map cache instance.
  12605. */
  12606. function mapCacheSet(key, value) {
  12607. getMapData(this, key).set(key, value);
  12608. return this;
  12609. }
  12610. // Add methods to `MapCache`.
  12611. MapCache.prototype.clear = mapCacheClear;
  12612. MapCache.prototype['delete'] = mapCacheDelete;
  12613. MapCache.prototype.get = mapCacheGet;
  12614. MapCache.prototype.has = mapCacheHas;
  12615. MapCache.prototype.set = mapCacheSet;
  12616. /**
  12617. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12618. *
  12619. * @private
  12620. * @param {Array} array The array to inspect.
  12621. * @param {*} key The key to search for.
  12622. * @returns {number} Returns the index of the matched value, else `-1`.
  12623. */
  12624. function assocIndexOf(array, key) {
  12625. var length = array.length;
  12626. while (length--) {
  12627. if (eq(array[length][0], key)) {
  12628. return length;
  12629. }
  12630. }
  12631. return -1;
  12632. }
  12633. /**
  12634. * The base implementation of `_.get` without support for default values.
  12635. *
  12636. * @private
  12637. * @param {Object} object The object to query.
  12638. * @param {Array|string} path The path of the property to get.
  12639. * @returns {*} Returns the resolved value.
  12640. */
  12641. function baseGet(object, path) {
  12642. path = isKey(path, object) ? [path] : castPath(path);
  12643. var index = 0,
  12644. length = path.length;
  12645. while (object != null && index < length) {
  12646. object = object[toKey(path[index++])];
  12647. }
  12648. return (index && index == length) ? object : undefined;
  12649. }
  12650. /**
  12651. * The base implementation of `_.isNative` without bad shim checks.
  12652. *
  12653. * @private
  12654. * @param {*} value The value to check.
  12655. * @returns {boolean} Returns `true` if `value` is a native function,
  12656. * else `false`.
  12657. */
  12658. function baseIsNative(value) {
  12659. if (!isObject(value) || isMasked(value)) {
  12660. return false;
  12661. }
  12662. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12663. return pattern.test(toSource(value));
  12664. }
  12665. /**
  12666. * The base implementation of `_.toString` which doesn't convert nullish
  12667. * values to empty strings.
  12668. *
  12669. * @private
  12670. * @param {*} value The value to process.
  12671. * @returns {string} Returns the string.
  12672. */
  12673. function baseToString(value) {
  12674. // Exit early for strings to avoid a performance hit in some environments.
  12675. if (typeof value == 'string') {
  12676. return value;
  12677. }
  12678. if (isSymbol(value)) {
  12679. return symbolToString ? symbolToString.call(value) : '';
  12680. }
  12681. var result = (value + '');
  12682. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12683. }
  12684. /**
  12685. * Casts `value` to a path array if it's not one.
  12686. *
  12687. * @private
  12688. * @param {*} value The value to inspect.
  12689. * @returns {Array} Returns the cast property path array.
  12690. */
  12691. function castPath(value) {
  12692. return isArray(value) ? value : stringToPath(value);
  12693. }
  12694. /**
  12695. * Gets the data for `map`.
  12696. *
  12697. * @private
  12698. * @param {Object} map The map to query.
  12699. * @param {string} key The reference key.
  12700. * @returns {*} Returns the map data.
  12701. */
  12702. function getMapData(map, key) {
  12703. var data = map.__data__;
  12704. return isKeyable(key)
  12705. ? data[typeof key == 'string' ? 'string' : 'hash']
  12706. : data.map;
  12707. }
  12708. /**
  12709. * Gets the native function at `key` of `object`.
  12710. *
  12711. * @private
  12712. * @param {Object} object The object to query.
  12713. * @param {string} key The key of the method to get.
  12714. * @returns {*} Returns the function if it's native, else `undefined`.
  12715. */
  12716. function getNative(object, key) {
  12717. var value = getValue(object, key);
  12718. return baseIsNative(value) ? value : undefined;
  12719. }
  12720. /**
  12721. * Checks if `value` is a property name and not a property path.
  12722. *
  12723. * @private
  12724. * @param {*} value The value to check.
  12725. * @param {Object} [object] The object to query keys on.
  12726. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12727. */
  12728. function isKey(value, object) {
  12729. if (isArray(value)) {
  12730. return false;
  12731. }
  12732. var type = typeof value;
  12733. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12734. value == null || isSymbol(value)) {
  12735. return true;
  12736. }
  12737. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12738. (object != null && value in Object(object));
  12739. }
  12740. /**
  12741. * Checks if `value` is suitable for use as unique object key.
  12742. *
  12743. * @private
  12744. * @param {*} value The value to check.
  12745. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12746. */
  12747. function isKeyable(value) {
  12748. var type = typeof value;
  12749. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12750. ? (value !== '__proto__')
  12751. : (value === null);
  12752. }
  12753. /**
  12754. * Checks if `func` has its source masked.
  12755. *
  12756. * @private
  12757. * @param {Function} func The function to check.
  12758. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12759. */
  12760. function isMasked(func) {
  12761. return !!maskSrcKey && (maskSrcKey in func);
  12762. }
  12763. /**
  12764. * Converts `string` to a property path array.
  12765. *
  12766. * @private
  12767. * @param {string} string The string to convert.
  12768. * @returns {Array} Returns the property path array.
  12769. */
  12770. var stringToPath = memoize(function(string) {
  12771. string = toString(string);
  12772. var result = [];
  12773. if (reLeadingDot.test(string)) {
  12774. result.push('');
  12775. }
  12776. string.replace(rePropName, function(match, number, quote, string) {
  12777. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  12778. });
  12779. return result;
  12780. });
  12781. /**
  12782. * Converts `value` to a string key if it's not a string or symbol.
  12783. *
  12784. * @private
  12785. * @param {*} value The value to inspect.
  12786. * @returns {string|symbol} Returns the key.
  12787. */
  12788. function toKey(value) {
  12789. if (typeof value == 'string' || isSymbol(value)) {
  12790. return value;
  12791. }
  12792. var result = (value + '');
  12793. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12794. }
  12795. /**
  12796. * Converts `func` to its source code.
  12797. *
  12798. * @private
  12799. * @param {Function} func The function to process.
  12800. * @returns {string} Returns the source code.
  12801. */
  12802. function toSource(func) {
  12803. if (func != null) {
  12804. try {
  12805. return funcToString.call(func);
  12806. } catch (e) {}
  12807. try {
  12808. return (func + '');
  12809. } catch (e) {}
  12810. }
  12811. return '';
  12812. }
  12813. /**
  12814. * Creates a function that memoizes the result of `func`. If `resolver` is
  12815. * provided, it determines the cache key for storing the result based on the
  12816. * arguments provided to the memoized function. By default, the first argument
  12817. * provided to the memoized function is used as the map cache key. The `func`
  12818. * is invoked with the `this` binding of the memoized function.
  12819. *
  12820. * **Note:** The cache is exposed as the `cache` property on the memoized
  12821. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  12822. * constructor with one whose instances implement the
  12823. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  12824. * method interface of `delete`, `get`, `has`, and `set`.
  12825. *
  12826. * @static
  12827. * @memberOf _
  12828. * @since 0.1.0
  12829. * @category Function
  12830. * @param {Function} func The function to have its output memoized.
  12831. * @param {Function} [resolver] The function to resolve the cache key.
  12832. * @returns {Function} Returns the new memoized function.
  12833. * @example
  12834. *
  12835. * var object = { 'a': 1, 'b': 2 };
  12836. * var other = { 'c': 3, 'd': 4 };
  12837. *
  12838. * var values = _.memoize(_.values);
  12839. * values(object);
  12840. * // => [1, 2]
  12841. *
  12842. * values(other);
  12843. * // => [3, 4]
  12844. *
  12845. * object.a = 2;
  12846. * values(object);
  12847. * // => [1, 2]
  12848. *
  12849. * // Modify the result cache.
  12850. * values.cache.set(object, ['a', 'b']);
  12851. * values(object);
  12852. * // => ['a', 'b']
  12853. *
  12854. * // Replace `_.memoize.Cache`.
  12855. * _.memoize.Cache = WeakMap;
  12856. */
  12857. function memoize(func, resolver) {
  12858. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  12859. throw new TypeError(FUNC_ERROR_TEXT);
  12860. }
  12861. var memoized = function() {
  12862. var args = arguments,
  12863. key = resolver ? resolver.apply(this, args) : args[0],
  12864. cache = memoized.cache;
  12865. if (cache.has(key)) {
  12866. return cache.get(key);
  12867. }
  12868. var result = func.apply(this, args);
  12869. memoized.cache = cache.set(key, result);
  12870. return result;
  12871. };
  12872. memoized.cache = new (memoize.Cache || MapCache);
  12873. return memoized;
  12874. }
  12875. // Assign cache to `_.memoize`.
  12876. memoize.Cache = MapCache;
  12877. /**
  12878. * Performs a
  12879. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12880. * comparison between two values to determine if they are equivalent.
  12881. *
  12882. * @static
  12883. * @memberOf _
  12884. * @since 4.0.0
  12885. * @category Lang
  12886. * @param {*} value The value to compare.
  12887. * @param {*} other The other value to compare.
  12888. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12889. * @example
  12890. *
  12891. * var object = { 'a': 1 };
  12892. * var other = { 'a': 1 };
  12893. *
  12894. * _.eq(object, object);
  12895. * // => true
  12896. *
  12897. * _.eq(object, other);
  12898. * // => false
  12899. *
  12900. * _.eq('a', 'a');
  12901. * // => true
  12902. *
  12903. * _.eq('a', Object('a'));
  12904. * // => false
  12905. *
  12906. * _.eq(NaN, NaN);
  12907. * // => true
  12908. */
  12909. function eq(value, other) {
  12910. return value === other || (value !== value && other !== other);
  12911. }
  12912. /**
  12913. * Checks if `value` is classified as an `Array` object.
  12914. *
  12915. * @static
  12916. * @memberOf _
  12917. * @since 0.1.0
  12918. * @category Lang
  12919. * @param {*} value The value to check.
  12920. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12921. * @example
  12922. *
  12923. * _.isArray([1, 2, 3]);
  12924. * // => true
  12925. *
  12926. * _.isArray(document.body.children);
  12927. * // => false
  12928. *
  12929. * _.isArray('abc');
  12930. * // => false
  12931. *
  12932. * _.isArray(_.noop);
  12933. * // => false
  12934. */
  12935. var isArray = Array.isArray;
  12936. /**
  12937. * Checks if `value` is classified as a `Function` object.
  12938. *
  12939. * @static
  12940. * @memberOf _
  12941. * @since 0.1.0
  12942. * @category Lang
  12943. * @param {*} value The value to check.
  12944. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12945. * @example
  12946. *
  12947. * _.isFunction(_);
  12948. * // => true
  12949. *
  12950. * _.isFunction(/abc/);
  12951. * // => false
  12952. */
  12953. function isFunction(value) {
  12954. // The use of `Object#toString` avoids issues with the `typeof` operator
  12955. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  12956. var tag = isObject(value) ? objectToString.call(value) : '';
  12957. return tag == funcTag || tag == genTag;
  12958. }
  12959. /**
  12960. * Checks if `value` is the
  12961. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12962. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12963. *
  12964. * @static
  12965. * @memberOf _
  12966. * @since 0.1.0
  12967. * @category Lang
  12968. * @param {*} value The value to check.
  12969. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12970. * @example
  12971. *
  12972. * _.isObject({});
  12973. * // => true
  12974. *
  12975. * _.isObject([1, 2, 3]);
  12976. * // => true
  12977. *
  12978. * _.isObject(_.noop);
  12979. * // => true
  12980. *
  12981. * _.isObject(null);
  12982. * // => false
  12983. */
  12984. function isObject(value) {
  12985. var type = typeof value;
  12986. return !!value && (type == 'object' || type == 'function');
  12987. }
  12988. /**
  12989. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12990. * and has a `typeof` result of "object".
  12991. *
  12992. * @static
  12993. * @memberOf _
  12994. * @since 4.0.0
  12995. * @category Lang
  12996. * @param {*} value The value to check.
  12997. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12998. * @example
  12999. *
  13000. * _.isObjectLike({});
  13001. * // => true
  13002. *
  13003. * _.isObjectLike([1, 2, 3]);
  13004. * // => true
  13005. *
  13006. * _.isObjectLike(_.noop);
  13007. * // => false
  13008. *
  13009. * _.isObjectLike(null);
  13010. * // => false
  13011. */
  13012. function isObjectLike(value) {
  13013. return !!value && typeof value == 'object';
  13014. }
  13015. /**
  13016. * Checks if `value` is classified as a `Symbol` primitive or object.
  13017. *
  13018. * @static
  13019. * @memberOf _
  13020. * @since 4.0.0
  13021. * @category Lang
  13022. * @param {*} value The value to check.
  13023. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13024. * @example
  13025. *
  13026. * _.isSymbol(Symbol.iterator);
  13027. * // => true
  13028. *
  13029. * _.isSymbol('abc');
  13030. * // => false
  13031. */
  13032. function isSymbol(value) {
  13033. return typeof value == 'symbol' ||
  13034. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13035. }
  13036. /**
  13037. * Converts `value` to a string. An empty string is returned for `null`
  13038. * and `undefined` values. The sign of `-0` is preserved.
  13039. *
  13040. * @static
  13041. * @memberOf _
  13042. * @since 4.0.0
  13043. * @category Lang
  13044. * @param {*} value The value to process.
  13045. * @returns {string} Returns the string.
  13046. * @example
  13047. *
  13048. * _.toString(null);
  13049. * // => ''
  13050. *
  13051. * _.toString(-0);
  13052. * // => '-0'
  13053. *
  13054. * _.toString([1, 2, 3]);
  13055. * // => '1,2,3'
  13056. */
  13057. function toString(value) {
  13058. return value == null ? '' : baseToString(value);
  13059. }
  13060. /**
  13061. * Gets the value at `path` of `object`. If the resolved value is
  13062. * `undefined`, the `defaultValue` is returned in its place.
  13063. *
  13064. * @static
  13065. * @memberOf _
  13066. * @since 3.7.0
  13067. * @category Object
  13068. * @param {Object} object The object to query.
  13069. * @param {Array|string} path The path of the property to get.
  13070. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13071. * @returns {*} Returns the resolved value.
  13072. * @example
  13073. *
  13074. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13075. *
  13076. * _.get(object, 'a[0].b.c');
  13077. * // => 3
  13078. *
  13079. * _.get(object, ['a', '0', 'b', 'c']);
  13080. * // => 3
  13081. *
  13082. * _.get(object, 'a.b.c', 'default');
  13083. * // => 'default'
  13084. */
  13085. function get(object, path, defaultValue) {
  13086. var result = object == null ? undefined : baseGet(object, path);
  13087. return result === undefined ? defaultValue : result;
  13088. }
  13089. module.exports = get;
  13090. /***/ }),
  13091. /***/ 855:
  13092. /***/ (function(module, __unusedexports, __webpack_require__) {
  13093. module.exports = registerPlugin;
  13094. const factory = __webpack_require__(47);
  13095. function registerPlugin(plugins, pluginFunction) {
  13096. return factory(
  13097. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  13098. );
  13099. }
  13100. /***/ }),
  13101. /***/ 856:
  13102. /***/ (function(module, __unusedexports, __webpack_require__) {
  13103. module.exports = __webpack_require__(141);
  13104. /***/ }),
  13105. /***/ 863:
  13106. /***/ (function(module, __unusedexports, __webpack_require__) {
  13107. module.exports = authenticationBeforeRequest;
  13108. const btoa = __webpack_require__(675);
  13109. const withAuthorizationPrefix = __webpack_require__(143);
  13110. function authenticationBeforeRequest(state, options) {
  13111. if (typeof state.auth === "string") {
  13112. options.headers.authorization = withAuthorizationPrefix(state.auth);
  13113. return;
  13114. }
  13115. if (state.auth.username) {
  13116. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  13117. options.headers.authorization = `Basic ${hash}`;
  13118. if (state.otp) {
  13119. options.headers["x-github-otp"] = state.otp;
  13120. }
  13121. return;
  13122. }
  13123. if (state.auth.clientId) {
  13124. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  13125. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  13126. // URL though: `/applications/:client_id/tokens/:access_token`.
  13127. //
  13128. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  13129. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  13130. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  13131. //
  13132. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  13133. // as well as "/applications/123/tokens/token456"
  13134. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  13135. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  13136. options.headers.authorization = `Basic ${hash}`;
  13137. return;
  13138. }
  13139. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  13140. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  13141. return;
  13142. }
  13143. return Promise.resolve()
  13144. .then(() => {
  13145. return state.auth();
  13146. })
  13147. .then(authorization => {
  13148. options.headers.authorization = withAuthorizationPrefix(authorization);
  13149. });
  13150. }
  13151. /***/ }),
  13152. /***/ 866:
  13153. /***/ (function(module, __unusedexports, __webpack_require__) {
  13154. "use strict";
  13155. var shebangRegex = __webpack_require__(816);
  13156. module.exports = function (str) {
  13157. var match = str.match(shebangRegex);
  13158. if (!match) {
  13159. return null;
  13160. }
  13161. var arr = match[0].replace(/#! ?/, '').split(' ');
  13162. var bin = arr[0].split('/').pop();
  13163. var arg = arr[1];
  13164. return (bin === 'env' ?
  13165. arg :
  13166. bin + (arg ? ' ' + arg : '')
  13167. );
  13168. };
  13169. /***/ }),
  13170. /***/ 874:
  13171. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13172. "use strict";
  13173. // Copyright (c) Microsoft. All rights reserved.
  13174. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  13175. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13176. return new (P || (P = Promise))(function (resolve, reject) {
  13177. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13178. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13179. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  13180. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13181. });
  13182. };
  13183. Object.defineProperty(exports, "__esModule", { value: true });
  13184. const url = __webpack_require__(835);
  13185. const http = __webpack_require__(605);
  13186. const https = __webpack_require__(211);
  13187. let fs;
  13188. let tunnel;
  13189. var HttpCodes;
  13190. (function (HttpCodes) {
  13191. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  13192. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  13193. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  13194. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  13195. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  13196. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  13197. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  13198. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  13199. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  13200. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  13201. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  13202. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  13203. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  13204. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  13205. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  13206. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  13207. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  13208. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  13209. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  13210. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  13211. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  13212. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  13213. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  13214. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  13215. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  13216. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  13217. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  13218. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  13219. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  13220. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  13221. const ExponentialBackoffCeiling = 10;
  13222. const ExponentialBackoffTimeSlice = 5;
  13223. class HttpClientResponse {
  13224. constructor(message) {
  13225. this.message = message;
  13226. }
  13227. readBody() {
  13228. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  13229. let output = '';
  13230. this.message.on('data', (chunk) => {
  13231. output += chunk;
  13232. });
  13233. this.message.on('end', () => {
  13234. resolve(output);
  13235. });
  13236. }));
  13237. }
  13238. }
  13239. exports.HttpClientResponse = HttpClientResponse;
  13240. function isHttps(requestUrl) {
  13241. let parsedUrl = url.parse(requestUrl);
  13242. return parsedUrl.protocol === 'https:';
  13243. }
  13244. exports.isHttps = isHttps;
  13245. var EnvironmentVariables;
  13246. (function (EnvironmentVariables) {
  13247. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  13248. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  13249. })(EnvironmentVariables || (EnvironmentVariables = {}));
  13250. class HttpClient {
  13251. constructor(userAgent, handlers, requestOptions) {
  13252. this._ignoreSslError = false;
  13253. this._allowRedirects = true;
  13254. this._maxRedirects = 50;
  13255. this._allowRetries = false;
  13256. this._maxRetries = 1;
  13257. this._keepAlive = false;
  13258. this._disposed = false;
  13259. this.userAgent = userAgent;
  13260. this.handlers = handlers || [];
  13261. this.requestOptions = requestOptions;
  13262. if (requestOptions) {
  13263. if (requestOptions.ignoreSslError != null) {
  13264. this._ignoreSslError = requestOptions.ignoreSslError;
  13265. }
  13266. this._socketTimeout = requestOptions.socketTimeout;
  13267. this._httpProxy = requestOptions.proxy;
  13268. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  13269. this._httpProxyBypassHosts = [];
  13270. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  13271. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  13272. });
  13273. }
  13274. this._certConfig = requestOptions.cert;
  13275. if (this._certConfig) {
  13276. // If using cert, need fs
  13277. fs = __webpack_require__(747);
  13278. // cache the cert content into memory, so we don't have to read it from disk every time
  13279. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  13280. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  13281. }
  13282. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  13283. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  13284. }
  13285. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  13286. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  13287. }
  13288. }
  13289. if (requestOptions.allowRedirects != null) {
  13290. this._allowRedirects = requestOptions.allowRedirects;
  13291. }
  13292. if (requestOptions.maxRedirects != null) {
  13293. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  13294. }
  13295. if (requestOptions.keepAlive != null) {
  13296. this._keepAlive = requestOptions.keepAlive;
  13297. }
  13298. if (requestOptions.allowRetries != null) {
  13299. this._allowRetries = requestOptions.allowRetries;
  13300. }
  13301. if (requestOptions.maxRetries != null) {
  13302. this._maxRetries = requestOptions.maxRetries;
  13303. }
  13304. }
  13305. }
  13306. options(requestUrl, additionalHeaders) {
  13307. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  13308. }
  13309. get(requestUrl, additionalHeaders) {
  13310. return this.request('GET', requestUrl, null, additionalHeaders || {});
  13311. }
  13312. del(requestUrl, additionalHeaders) {
  13313. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  13314. }
  13315. post(requestUrl, data, additionalHeaders) {
  13316. return this.request('POST', requestUrl, data, additionalHeaders || {});
  13317. }
  13318. patch(requestUrl, data, additionalHeaders) {
  13319. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  13320. }
  13321. put(requestUrl, data, additionalHeaders) {
  13322. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  13323. }
  13324. head(requestUrl, additionalHeaders) {
  13325. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  13326. }
  13327. sendStream(verb, requestUrl, stream, additionalHeaders) {
  13328. return this.request(verb, requestUrl, stream, additionalHeaders);
  13329. }
  13330. /**
  13331. * Makes a raw http request.
  13332. * All other methods such as get, post, patch, and request ultimately call this.
  13333. * Prefer get, del, post and patch
  13334. */
  13335. request(verb, requestUrl, data, headers) {
  13336. return __awaiter(this, void 0, void 0, function* () {
  13337. if (this._disposed) {
  13338. throw new Error("Client has already been disposed.");
  13339. }
  13340. let info = this._prepareRequest(verb, requestUrl, headers);
  13341. // Only perform retries on reads since writes may not be idempotent.
  13342. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  13343. let numTries = 0;
  13344. let response;
  13345. while (numTries < maxTries) {
  13346. response = yield this.requestRaw(info, data);
  13347. // Check if it's an authentication challenge
  13348. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  13349. let authenticationHandler;
  13350. for (let i = 0; i < this.handlers.length; i++) {
  13351. if (this.handlers[i].canHandleAuthentication(response)) {
  13352. authenticationHandler = this.handlers[i];
  13353. break;
  13354. }
  13355. }
  13356. if (authenticationHandler) {
  13357. return authenticationHandler.handleAuthentication(this, info, data);
  13358. }
  13359. else {
  13360. // We have received an unauthorized response but have no handlers to handle it.
  13361. // Let the response return to the caller.
  13362. return response;
  13363. }
  13364. }
  13365. let redirectsRemaining = this._maxRedirects;
  13366. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  13367. && this._allowRedirects
  13368. && redirectsRemaining > 0) {
  13369. const redirectUrl = response.message.headers["location"];
  13370. if (!redirectUrl) {
  13371. // if there's no location to redirect to, we won't
  13372. break;
  13373. }
  13374. // we need to finish reading the response before reassigning response
  13375. // which will leak the open socket.
  13376. yield response.readBody();
  13377. // let's make the request with the new redirectUrl
  13378. info = this._prepareRequest(verb, redirectUrl, headers);
  13379. response = yield this.requestRaw(info, data);
  13380. redirectsRemaining--;
  13381. }
  13382. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  13383. // If not a retry code, return immediately instead of retrying
  13384. return response;
  13385. }
  13386. numTries += 1;
  13387. if (numTries < maxTries) {
  13388. yield response.readBody();
  13389. yield this._performExponentialBackoff(numTries);
  13390. }
  13391. }
  13392. return response;
  13393. });
  13394. }
  13395. /**
  13396. * Needs to be called if keepAlive is set to true in request options.
  13397. */
  13398. dispose() {
  13399. if (this._agent) {
  13400. this._agent.destroy();
  13401. }
  13402. this._disposed = true;
  13403. }
  13404. /**
  13405. * Raw request.
  13406. * @param info
  13407. * @param data
  13408. */
  13409. requestRaw(info, data) {
  13410. return new Promise((resolve, reject) => {
  13411. let callbackForResult = function (err, res) {
  13412. if (err) {
  13413. reject(err);
  13414. }
  13415. resolve(res);
  13416. };
  13417. this.requestRawWithCallback(info, data, callbackForResult);
  13418. });
  13419. }
  13420. /**
  13421. * Raw request with callback.
  13422. * @param info
  13423. * @param data
  13424. * @param onResult
  13425. */
  13426. requestRawWithCallback(info, data, onResult) {
  13427. let socket;
  13428. let isDataString = typeof (data) === 'string';
  13429. if (typeof (data) === 'string') {
  13430. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13431. }
  13432. let callbackCalled = false;
  13433. let handleResult = (err, res) => {
  13434. if (!callbackCalled) {
  13435. callbackCalled = true;
  13436. onResult(err, res);
  13437. }
  13438. };
  13439. let req = info.httpModule.request(info.options, (msg) => {
  13440. let res = new HttpClientResponse(msg);
  13441. handleResult(null, res);
  13442. });
  13443. req.on('socket', (sock) => {
  13444. socket = sock;
  13445. });
  13446. // If we ever get disconnected, we want the socket to timeout eventually
  13447. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13448. if (socket) {
  13449. socket.end();
  13450. }
  13451. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13452. });
  13453. req.on('error', function (err) {
  13454. // err has statusCode property
  13455. // res should have headers
  13456. handleResult(err, null);
  13457. });
  13458. if (data && typeof (data) === 'string') {
  13459. req.write(data, 'utf8');
  13460. }
  13461. if (data && typeof (data) !== 'string') {
  13462. data.on('close', function () {
  13463. req.end();
  13464. });
  13465. data.pipe(req);
  13466. }
  13467. else {
  13468. req.end();
  13469. }
  13470. }
  13471. _prepareRequest(method, requestUrl, headers) {
  13472. const info = {};
  13473. info.parsedUrl = url.parse(requestUrl);
  13474. const usingSsl = info.parsedUrl.protocol === 'https:';
  13475. info.httpModule = usingSsl ? https : http;
  13476. const defaultPort = usingSsl ? 443 : 80;
  13477. info.options = {};
  13478. info.options.host = info.parsedUrl.hostname;
  13479. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13480. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13481. info.options.method = method;
  13482. info.options.headers = this._mergeHeaders(headers);
  13483. info.options.headers["user-agent"] = this.userAgent;
  13484. info.options.agent = this._getAgent(requestUrl);
  13485. // gives handlers an opportunity to participate
  13486. if (this.handlers && !this._isPresigned(requestUrl)) {
  13487. this.handlers.forEach((handler) => {
  13488. handler.prepareRequest(info.options);
  13489. });
  13490. }
  13491. return info;
  13492. }
  13493. _isPresigned(requestUrl) {
  13494. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13495. const patterns = this.requestOptions.presignedUrlPatterns;
  13496. for (let i = 0; i < patterns.length; i++) {
  13497. if (requestUrl.match(patterns[i])) {
  13498. return true;
  13499. }
  13500. }
  13501. }
  13502. return false;
  13503. }
  13504. _mergeHeaders(headers) {
  13505. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13506. if (this.requestOptions && this.requestOptions.headers) {
  13507. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13508. }
  13509. return lowercaseKeys(headers || {});
  13510. }
  13511. _getAgent(requestUrl) {
  13512. let agent;
  13513. let proxy = this._getProxy(requestUrl);
  13514. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13515. if (this._keepAlive && useProxy) {
  13516. agent = this._proxyAgent;
  13517. }
  13518. if (this._keepAlive && !useProxy) {
  13519. agent = this._agent;
  13520. }
  13521. // if agent is already assigned use that agent.
  13522. if (!!agent) {
  13523. return agent;
  13524. }
  13525. let parsedUrl = url.parse(requestUrl);
  13526. const usingSsl = parsedUrl.protocol === 'https:';
  13527. let maxSockets = 100;
  13528. if (!!this.requestOptions) {
  13529. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13530. }
  13531. if (useProxy) {
  13532. // If using proxy, need tunnel
  13533. if (!tunnel) {
  13534. tunnel = __webpack_require__(856);
  13535. }
  13536. const agentOptions = {
  13537. maxSockets: maxSockets,
  13538. keepAlive: this._keepAlive,
  13539. proxy: {
  13540. proxyAuth: proxy.proxyAuth,
  13541. host: proxy.proxyUrl.hostname,
  13542. port: proxy.proxyUrl.port
  13543. },
  13544. };
  13545. let tunnelAgent;
  13546. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13547. if (usingSsl) {
  13548. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13549. }
  13550. else {
  13551. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13552. }
  13553. agent = tunnelAgent(agentOptions);
  13554. this._proxyAgent = agent;
  13555. }
  13556. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13557. if (this._keepAlive && !agent) {
  13558. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13559. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13560. this._agent = agent;
  13561. }
  13562. // if not using private agent and tunnel agent isn't setup then use global agent
  13563. if (!agent) {
  13564. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13565. }
  13566. if (usingSsl && this._ignoreSslError) {
  13567. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13568. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13569. // we have to cast it to any and change it directly
  13570. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13571. }
  13572. if (usingSsl && this._certConfig) {
  13573. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13574. }
  13575. return agent;
  13576. }
  13577. _getProxy(requestUrl) {
  13578. const parsedUrl = url.parse(requestUrl);
  13579. let usingSsl = parsedUrl.protocol === 'https:';
  13580. let proxyConfig = this._httpProxy;
  13581. // fallback to http_proxy and https_proxy env
  13582. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13583. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13584. if (!proxyConfig) {
  13585. if (https_proxy && usingSsl) {
  13586. proxyConfig = {
  13587. proxyUrl: https_proxy
  13588. };
  13589. }
  13590. else if (http_proxy) {
  13591. proxyConfig = {
  13592. proxyUrl: http_proxy
  13593. };
  13594. }
  13595. }
  13596. let proxyUrl;
  13597. let proxyAuth;
  13598. if (proxyConfig) {
  13599. if (proxyConfig.proxyUrl.length > 0) {
  13600. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13601. }
  13602. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13603. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13604. }
  13605. }
  13606. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13607. }
  13608. _isBypassProxy(requestUrl) {
  13609. if (!this._httpProxyBypassHosts) {
  13610. return false;
  13611. }
  13612. let bypass = false;
  13613. this._httpProxyBypassHosts.forEach(bypassHost => {
  13614. if (bypassHost.test(requestUrl)) {
  13615. bypass = true;
  13616. }
  13617. });
  13618. return bypass;
  13619. }
  13620. _performExponentialBackoff(retryNumber) {
  13621. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13622. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13623. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13624. }
  13625. }
  13626. exports.HttpClient = HttpClient;
  13627. /***/ }),
  13628. /***/ 881:
  13629. /***/ (function(module) {
  13630. "use strict";
  13631. const isWin = process.platform === 'win32';
  13632. function notFoundError(original, syscall) {
  13633. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13634. code: 'ENOENT',
  13635. errno: 'ENOENT',
  13636. syscall: `${syscall} ${original.command}`,
  13637. path: original.command,
  13638. spawnargs: original.args,
  13639. });
  13640. }
  13641. function hookChildProcess(cp, parsed) {
  13642. if (!isWin) {
  13643. return;
  13644. }
  13645. const originalEmit = cp.emit;
  13646. cp.emit = function (name, arg1) {
  13647. // If emitting "exit" event and exit code is 1, we need to check if
  13648. // the command exists and emit an "error" instead
  13649. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13650. if (name === 'exit') {
  13651. const err = verifyENOENT(arg1, parsed, 'spawn');
  13652. if (err) {
  13653. return originalEmit.call(cp, 'error', err);
  13654. }
  13655. }
  13656. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13657. };
  13658. }
  13659. function verifyENOENT(status, parsed) {
  13660. if (isWin && status === 1 && !parsed.file) {
  13661. return notFoundError(parsed.original, 'spawn');
  13662. }
  13663. return null;
  13664. }
  13665. function verifyENOENTSync(status, parsed) {
  13666. if (isWin && status === 1 && !parsed.file) {
  13667. return notFoundError(parsed.original, 'spawnSync');
  13668. }
  13669. return null;
  13670. }
  13671. module.exports = {
  13672. hookChildProcess,
  13673. verifyENOENT,
  13674. verifyENOENTSync,
  13675. notFoundError,
  13676. };
  13677. /***/ }),
  13678. /***/ 883:
  13679. /***/ (function(module) {
  13680. /**
  13681. * lodash (Custom Build) <https://lodash.com/>
  13682. * Build: `lodash modularize exports="npm" -o ./`
  13683. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13684. * Released under MIT license <https://lodash.com/license>
  13685. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13686. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13687. */
  13688. /** Used as the `TypeError` message for "Functions" methods. */
  13689. var FUNC_ERROR_TEXT = 'Expected a function';
  13690. /** Used to stand-in for `undefined` hash values. */
  13691. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13692. /** Used as references for various `Number` constants. */
  13693. var INFINITY = 1 / 0,
  13694. MAX_SAFE_INTEGER = 9007199254740991;
  13695. /** `Object#toString` result references. */
  13696. var funcTag = '[object Function]',
  13697. genTag = '[object GeneratorFunction]',
  13698. symbolTag = '[object Symbol]';
  13699. /** Used to match property names within property paths. */
  13700. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13701. reIsPlainProp = /^\w*$/,
  13702. reLeadingDot = /^\./,
  13703. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13704. /**
  13705. * Used to match `RegExp`
  13706. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13707. */
  13708. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13709. /** Used to match backslashes in property paths. */
  13710. var reEscapeChar = /\\(\\)?/g;
  13711. /** Used to detect host constructors (Safari). */
  13712. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13713. /** Used to detect unsigned integer values. */
  13714. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13715. /** Detect free variable `global` from Node.js. */
  13716. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13717. /** Detect free variable `self`. */
  13718. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13719. /** Used as a reference to the global object. */
  13720. var root = freeGlobal || freeSelf || Function('return this')();
  13721. /**
  13722. * Gets the value at `key` of `object`.
  13723. *
  13724. * @private
  13725. * @param {Object} [object] The object to query.
  13726. * @param {string} key The key of the property to get.
  13727. * @returns {*} Returns the property value.
  13728. */
  13729. function getValue(object, key) {
  13730. return object == null ? undefined : object[key];
  13731. }
  13732. /**
  13733. * Checks if `value` is a host object in IE < 9.
  13734. *
  13735. * @private
  13736. * @param {*} value The value to check.
  13737. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13738. */
  13739. function isHostObject(value) {
  13740. // Many host objects are `Object` objects that can coerce to strings
  13741. // despite having improperly defined `toString` methods.
  13742. var result = false;
  13743. if (value != null && typeof value.toString != 'function') {
  13744. try {
  13745. result = !!(value + '');
  13746. } catch (e) {}
  13747. }
  13748. return result;
  13749. }
  13750. /** Used for built-in method references. */
  13751. var arrayProto = Array.prototype,
  13752. funcProto = Function.prototype,
  13753. objectProto = Object.prototype;
  13754. /** Used to detect overreaching core-js shims. */
  13755. var coreJsData = root['__core-js_shared__'];
  13756. /** Used to detect methods masquerading as native. */
  13757. var maskSrcKey = (function() {
  13758. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  13759. return uid ? ('Symbol(src)_1.' + uid) : '';
  13760. }());
  13761. /** Used to resolve the decompiled source of functions. */
  13762. var funcToString = funcProto.toString;
  13763. /** Used to check objects for own properties. */
  13764. var hasOwnProperty = objectProto.hasOwnProperty;
  13765. /**
  13766. * Used to resolve the
  13767. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  13768. * of values.
  13769. */
  13770. var objectToString = objectProto.toString;
  13771. /** Used to detect if a method is native. */
  13772. var reIsNative = RegExp('^' +
  13773. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  13774. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  13775. );
  13776. /** Built-in value references. */
  13777. var Symbol = root.Symbol,
  13778. splice = arrayProto.splice;
  13779. /* Built-in method references that are verified to be native. */
  13780. var Map = getNative(root, 'Map'),
  13781. nativeCreate = getNative(Object, 'create');
  13782. /** Used to convert symbols to primitives and strings. */
  13783. var symbolProto = Symbol ? Symbol.prototype : undefined,
  13784. symbolToString = symbolProto ? symbolProto.toString : undefined;
  13785. /**
  13786. * Creates a hash object.
  13787. *
  13788. * @private
  13789. * @constructor
  13790. * @param {Array} [entries] The key-value pairs to cache.
  13791. */
  13792. function Hash(entries) {
  13793. var index = -1,
  13794. length = entries ? entries.length : 0;
  13795. this.clear();
  13796. while (++index < length) {
  13797. var entry = entries[index];
  13798. this.set(entry[0], entry[1]);
  13799. }
  13800. }
  13801. /**
  13802. * Removes all key-value entries from the hash.
  13803. *
  13804. * @private
  13805. * @name clear
  13806. * @memberOf Hash
  13807. */
  13808. function hashClear() {
  13809. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  13810. }
  13811. /**
  13812. * Removes `key` and its value from the hash.
  13813. *
  13814. * @private
  13815. * @name delete
  13816. * @memberOf Hash
  13817. * @param {Object} hash The hash to modify.
  13818. * @param {string} key The key of the value to remove.
  13819. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13820. */
  13821. function hashDelete(key) {
  13822. return this.has(key) && delete this.__data__[key];
  13823. }
  13824. /**
  13825. * Gets the hash value for `key`.
  13826. *
  13827. * @private
  13828. * @name get
  13829. * @memberOf Hash
  13830. * @param {string} key The key of the value to get.
  13831. * @returns {*} Returns the entry value.
  13832. */
  13833. function hashGet(key) {
  13834. var data = this.__data__;
  13835. if (nativeCreate) {
  13836. var result = data[key];
  13837. return result === HASH_UNDEFINED ? undefined : result;
  13838. }
  13839. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  13840. }
  13841. /**
  13842. * Checks if a hash value for `key` exists.
  13843. *
  13844. * @private
  13845. * @name has
  13846. * @memberOf Hash
  13847. * @param {string} key The key of the entry to check.
  13848. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13849. */
  13850. function hashHas(key) {
  13851. var data = this.__data__;
  13852. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  13853. }
  13854. /**
  13855. * Sets the hash `key` to `value`.
  13856. *
  13857. * @private
  13858. * @name set
  13859. * @memberOf Hash
  13860. * @param {string} key The key of the value to set.
  13861. * @param {*} value The value to set.
  13862. * @returns {Object} Returns the hash instance.
  13863. */
  13864. function hashSet(key, value) {
  13865. var data = this.__data__;
  13866. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  13867. return this;
  13868. }
  13869. // Add methods to `Hash`.
  13870. Hash.prototype.clear = hashClear;
  13871. Hash.prototype['delete'] = hashDelete;
  13872. Hash.prototype.get = hashGet;
  13873. Hash.prototype.has = hashHas;
  13874. Hash.prototype.set = hashSet;
  13875. /**
  13876. * Creates an list cache object.
  13877. *
  13878. * @private
  13879. * @constructor
  13880. * @param {Array} [entries] The key-value pairs to cache.
  13881. */
  13882. function ListCache(entries) {
  13883. var index = -1,
  13884. length = entries ? entries.length : 0;
  13885. this.clear();
  13886. while (++index < length) {
  13887. var entry = entries[index];
  13888. this.set(entry[0], entry[1]);
  13889. }
  13890. }
  13891. /**
  13892. * Removes all key-value entries from the list cache.
  13893. *
  13894. * @private
  13895. * @name clear
  13896. * @memberOf ListCache
  13897. */
  13898. function listCacheClear() {
  13899. this.__data__ = [];
  13900. }
  13901. /**
  13902. * Removes `key` and its value from the list cache.
  13903. *
  13904. * @private
  13905. * @name delete
  13906. * @memberOf ListCache
  13907. * @param {string} key The key of the value to remove.
  13908. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13909. */
  13910. function listCacheDelete(key) {
  13911. var data = this.__data__,
  13912. index = assocIndexOf(data, key);
  13913. if (index < 0) {
  13914. return false;
  13915. }
  13916. var lastIndex = data.length - 1;
  13917. if (index == lastIndex) {
  13918. data.pop();
  13919. } else {
  13920. splice.call(data, index, 1);
  13921. }
  13922. return true;
  13923. }
  13924. /**
  13925. * Gets the list cache value for `key`.
  13926. *
  13927. * @private
  13928. * @name get
  13929. * @memberOf ListCache
  13930. * @param {string} key The key of the value to get.
  13931. * @returns {*} Returns the entry value.
  13932. */
  13933. function listCacheGet(key) {
  13934. var data = this.__data__,
  13935. index = assocIndexOf(data, key);
  13936. return index < 0 ? undefined : data[index][1];
  13937. }
  13938. /**
  13939. * Checks if a list cache value for `key` exists.
  13940. *
  13941. * @private
  13942. * @name has
  13943. * @memberOf ListCache
  13944. * @param {string} key The key of the entry to check.
  13945. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13946. */
  13947. function listCacheHas(key) {
  13948. return assocIndexOf(this.__data__, key) > -1;
  13949. }
  13950. /**
  13951. * Sets the list cache `key` to `value`.
  13952. *
  13953. * @private
  13954. * @name set
  13955. * @memberOf ListCache
  13956. * @param {string} key The key of the value to set.
  13957. * @param {*} value The value to set.
  13958. * @returns {Object} Returns the list cache instance.
  13959. */
  13960. function listCacheSet(key, value) {
  13961. var data = this.__data__,
  13962. index = assocIndexOf(data, key);
  13963. if (index < 0) {
  13964. data.push([key, value]);
  13965. } else {
  13966. data[index][1] = value;
  13967. }
  13968. return this;
  13969. }
  13970. // Add methods to `ListCache`.
  13971. ListCache.prototype.clear = listCacheClear;
  13972. ListCache.prototype['delete'] = listCacheDelete;
  13973. ListCache.prototype.get = listCacheGet;
  13974. ListCache.prototype.has = listCacheHas;
  13975. ListCache.prototype.set = listCacheSet;
  13976. /**
  13977. * Creates a map cache object to store key-value pairs.
  13978. *
  13979. * @private
  13980. * @constructor
  13981. * @param {Array} [entries] The key-value pairs to cache.
  13982. */
  13983. function MapCache(entries) {
  13984. var index = -1,
  13985. length = entries ? entries.length : 0;
  13986. this.clear();
  13987. while (++index < length) {
  13988. var entry = entries[index];
  13989. this.set(entry[0], entry[1]);
  13990. }
  13991. }
  13992. /**
  13993. * Removes all key-value entries from the map.
  13994. *
  13995. * @private
  13996. * @name clear
  13997. * @memberOf MapCache
  13998. */
  13999. function mapCacheClear() {
  14000. this.__data__ = {
  14001. 'hash': new Hash,
  14002. 'map': new (Map || ListCache),
  14003. 'string': new Hash
  14004. };
  14005. }
  14006. /**
  14007. * Removes `key` and its value from the map.
  14008. *
  14009. * @private
  14010. * @name delete
  14011. * @memberOf MapCache
  14012. * @param {string} key The key of the value to remove.
  14013. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  14014. */
  14015. function mapCacheDelete(key) {
  14016. return getMapData(this, key)['delete'](key);
  14017. }
  14018. /**
  14019. * Gets the map value for `key`.
  14020. *
  14021. * @private
  14022. * @name get
  14023. * @memberOf MapCache
  14024. * @param {string} key The key of the value to get.
  14025. * @returns {*} Returns the entry value.
  14026. */
  14027. function mapCacheGet(key) {
  14028. return getMapData(this, key).get(key);
  14029. }
  14030. /**
  14031. * Checks if a map value for `key` exists.
  14032. *
  14033. * @private
  14034. * @name has
  14035. * @memberOf MapCache
  14036. * @param {string} key The key of the entry to check.
  14037. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14038. */
  14039. function mapCacheHas(key) {
  14040. return getMapData(this, key).has(key);
  14041. }
  14042. /**
  14043. * Sets the map `key` to `value`.
  14044. *
  14045. * @private
  14046. * @name set
  14047. * @memberOf MapCache
  14048. * @param {string} key The key of the value to set.
  14049. * @param {*} value The value to set.
  14050. * @returns {Object} Returns the map cache instance.
  14051. */
  14052. function mapCacheSet(key, value) {
  14053. getMapData(this, key).set(key, value);
  14054. return this;
  14055. }
  14056. // Add methods to `MapCache`.
  14057. MapCache.prototype.clear = mapCacheClear;
  14058. MapCache.prototype['delete'] = mapCacheDelete;
  14059. MapCache.prototype.get = mapCacheGet;
  14060. MapCache.prototype.has = mapCacheHas;
  14061. MapCache.prototype.set = mapCacheSet;
  14062. /**
  14063. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  14064. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14065. * for equality comparisons.
  14066. *
  14067. * @private
  14068. * @param {Object} object The object to modify.
  14069. * @param {string} key The key of the property to assign.
  14070. * @param {*} value The value to assign.
  14071. */
  14072. function assignValue(object, key, value) {
  14073. var objValue = object[key];
  14074. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  14075. (value === undefined && !(key in object))) {
  14076. object[key] = value;
  14077. }
  14078. }
  14079. /**
  14080. * Gets the index at which the `key` is found in `array` of key-value pairs.
  14081. *
  14082. * @private
  14083. * @param {Array} array The array to inspect.
  14084. * @param {*} key The key to search for.
  14085. * @returns {number} Returns the index of the matched value, else `-1`.
  14086. */
  14087. function assocIndexOf(array, key) {
  14088. var length = array.length;
  14089. while (length--) {
  14090. if (eq(array[length][0], key)) {
  14091. return length;
  14092. }
  14093. }
  14094. return -1;
  14095. }
  14096. /**
  14097. * The base implementation of `_.isNative` without bad shim checks.
  14098. *
  14099. * @private
  14100. * @param {*} value The value to check.
  14101. * @returns {boolean} Returns `true` if `value` is a native function,
  14102. * else `false`.
  14103. */
  14104. function baseIsNative(value) {
  14105. if (!isObject(value) || isMasked(value)) {
  14106. return false;
  14107. }
  14108. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  14109. return pattern.test(toSource(value));
  14110. }
  14111. /**
  14112. * The base implementation of `_.set`.
  14113. *
  14114. * @private
  14115. * @param {Object} object The object to modify.
  14116. * @param {Array|string} path The path of the property to set.
  14117. * @param {*} value The value to set.
  14118. * @param {Function} [customizer] The function to customize path creation.
  14119. * @returns {Object} Returns `object`.
  14120. */
  14121. function baseSet(object, path, value, customizer) {
  14122. if (!isObject(object)) {
  14123. return object;
  14124. }
  14125. path = isKey(path, object) ? [path] : castPath(path);
  14126. var index = -1,
  14127. length = path.length,
  14128. lastIndex = length - 1,
  14129. nested = object;
  14130. while (nested != null && ++index < length) {
  14131. var key = toKey(path[index]),
  14132. newValue = value;
  14133. if (index != lastIndex) {
  14134. var objValue = nested[key];
  14135. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  14136. if (newValue === undefined) {
  14137. newValue = isObject(objValue)
  14138. ? objValue
  14139. : (isIndex(path[index + 1]) ? [] : {});
  14140. }
  14141. }
  14142. assignValue(nested, key, newValue);
  14143. nested = nested[key];
  14144. }
  14145. return object;
  14146. }
  14147. /**
  14148. * The base implementation of `_.toString` which doesn't convert nullish
  14149. * values to empty strings.
  14150. *
  14151. * @private
  14152. * @param {*} value The value to process.
  14153. * @returns {string} Returns the string.
  14154. */
  14155. function baseToString(value) {
  14156. // Exit early for strings to avoid a performance hit in some environments.
  14157. if (typeof value == 'string') {
  14158. return value;
  14159. }
  14160. if (isSymbol(value)) {
  14161. return symbolToString ? symbolToString.call(value) : '';
  14162. }
  14163. var result = (value + '');
  14164. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14165. }
  14166. /**
  14167. * Casts `value` to a path array if it's not one.
  14168. *
  14169. * @private
  14170. * @param {*} value The value to inspect.
  14171. * @returns {Array} Returns the cast property path array.
  14172. */
  14173. function castPath(value) {
  14174. return isArray(value) ? value : stringToPath(value);
  14175. }
  14176. /**
  14177. * Gets the data for `map`.
  14178. *
  14179. * @private
  14180. * @param {Object} map The map to query.
  14181. * @param {string} key The reference key.
  14182. * @returns {*} Returns the map data.
  14183. */
  14184. function getMapData(map, key) {
  14185. var data = map.__data__;
  14186. return isKeyable(key)
  14187. ? data[typeof key == 'string' ? 'string' : 'hash']
  14188. : data.map;
  14189. }
  14190. /**
  14191. * Gets the native function at `key` of `object`.
  14192. *
  14193. * @private
  14194. * @param {Object} object The object to query.
  14195. * @param {string} key The key of the method to get.
  14196. * @returns {*} Returns the function if it's native, else `undefined`.
  14197. */
  14198. function getNative(object, key) {
  14199. var value = getValue(object, key);
  14200. return baseIsNative(value) ? value : undefined;
  14201. }
  14202. /**
  14203. * Checks if `value` is a valid array-like index.
  14204. *
  14205. * @private
  14206. * @param {*} value The value to check.
  14207. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  14208. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  14209. */
  14210. function isIndex(value, length) {
  14211. length = length == null ? MAX_SAFE_INTEGER : length;
  14212. return !!length &&
  14213. (typeof value == 'number' || reIsUint.test(value)) &&
  14214. (value > -1 && value % 1 == 0 && value < length);
  14215. }
  14216. /**
  14217. * Checks if `value` is a property name and not a property path.
  14218. *
  14219. * @private
  14220. * @param {*} value The value to check.
  14221. * @param {Object} [object] The object to query keys on.
  14222. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  14223. */
  14224. function isKey(value, object) {
  14225. if (isArray(value)) {
  14226. return false;
  14227. }
  14228. var type = typeof value;
  14229. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  14230. value == null || isSymbol(value)) {
  14231. return true;
  14232. }
  14233. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  14234. (object != null && value in Object(object));
  14235. }
  14236. /**
  14237. * Checks if `value` is suitable for use as unique object key.
  14238. *
  14239. * @private
  14240. * @param {*} value The value to check.
  14241. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  14242. */
  14243. function isKeyable(value) {
  14244. var type = typeof value;
  14245. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  14246. ? (value !== '__proto__')
  14247. : (value === null);
  14248. }
  14249. /**
  14250. * Checks if `func` has its source masked.
  14251. *
  14252. * @private
  14253. * @param {Function} func The function to check.
  14254. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  14255. */
  14256. function isMasked(func) {
  14257. return !!maskSrcKey && (maskSrcKey in func);
  14258. }
  14259. /**
  14260. * Converts `string` to a property path array.
  14261. *
  14262. * @private
  14263. * @param {string} string The string to convert.
  14264. * @returns {Array} Returns the property path array.
  14265. */
  14266. var stringToPath = memoize(function(string) {
  14267. string = toString(string);
  14268. var result = [];
  14269. if (reLeadingDot.test(string)) {
  14270. result.push('');
  14271. }
  14272. string.replace(rePropName, function(match, number, quote, string) {
  14273. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  14274. });
  14275. return result;
  14276. });
  14277. /**
  14278. * Converts `value` to a string key if it's not a string or symbol.
  14279. *
  14280. * @private
  14281. * @param {*} value The value to inspect.
  14282. * @returns {string|symbol} Returns the key.
  14283. */
  14284. function toKey(value) {
  14285. if (typeof value == 'string' || isSymbol(value)) {
  14286. return value;
  14287. }
  14288. var result = (value + '');
  14289. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14290. }
  14291. /**
  14292. * Converts `func` to its source code.
  14293. *
  14294. * @private
  14295. * @param {Function} func The function to process.
  14296. * @returns {string} Returns the source code.
  14297. */
  14298. function toSource(func) {
  14299. if (func != null) {
  14300. try {
  14301. return funcToString.call(func);
  14302. } catch (e) {}
  14303. try {
  14304. return (func + '');
  14305. } catch (e) {}
  14306. }
  14307. return '';
  14308. }
  14309. /**
  14310. * Creates a function that memoizes the result of `func`. If `resolver` is
  14311. * provided, it determines the cache key for storing the result based on the
  14312. * arguments provided to the memoized function. By default, the first argument
  14313. * provided to the memoized function is used as the map cache key. The `func`
  14314. * is invoked with the `this` binding of the memoized function.
  14315. *
  14316. * **Note:** The cache is exposed as the `cache` property on the memoized
  14317. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  14318. * constructor with one whose instances implement the
  14319. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  14320. * method interface of `delete`, `get`, `has`, and `set`.
  14321. *
  14322. * @static
  14323. * @memberOf _
  14324. * @since 0.1.0
  14325. * @category Function
  14326. * @param {Function} func The function to have its output memoized.
  14327. * @param {Function} [resolver] The function to resolve the cache key.
  14328. * @returns {Function} Returns the new memoized function.
  14329. * @example
  14330. *
  14331. * var object = { 'a': 1, 'b': 2 };
  14332. * var other = { 'c': 3, 'd': 4 };
  14333. *
  14334. * var values = _.memoize(_.values);
  14335. * values(object);
  14336. * // => [1, 2]
  14337. *
  14338. * values(other);
  14339. * // => [3, 4]
  14340. *
  14341. * object.a = 2;
  14342. * values(object);
  14343. * // => [1, 2]
  14344. *
  14345. * // Modify the result cache.
  14346. * values.cache.set(object, ['a', 'b']);
  14347. * values(object);
  14348. * // => ['a', 'b']
  14349. *
  14350. * // Replace `_.memoize.Cache`.
  14351. * _.memoize.Cache = WeakMap;
  14352. */
  14353. function memoize(func, resolver) {
  14354. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  14355. throw new TypeError(FUNC_ERROR_TEXT);
  14356. }
  14357. var memoized = function() {
  14358. var args = arguments,
  14359. key = resolver ? resolver.apply(this, args) : args[0],
  14360. cache = memoized.cache;
  14361. if (cache.has(key)) {
  14362. return cache.get(key);
  14363. }
  14364. var result = func.apply(this, args);
  14365. memoized.cache = cache.set(key, result);
  14366. return result;
  14367. };
  14368. memoized.cache = new (memoize.Cache || MapCache);
  14369. return memoized;
  14370. }
  14371. // Assign cache to `_.memoize`.
  14372. memoize.Cache = MapCache;
  14373. /**
  14374. * Performs a
  14375. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14376. * comparison between two values to determine if they are equivalent.
  14377. *
  14378. * @static
  14379. * @memberOf _
  14380. * @since 4.0.0
  14381. * @category Lang
  14382. * @param {*} value The value to compare.
  14383. * @param {*} other The other value to compare.
  14384. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  14385. * @example
  14386. *
  14387. * var object = { 'a': 1 };
  14388. * var other = { 'a': 1 };
  14389. *
  14390. * _.eq(object, object);
  14391. * // => true
  14392. *
  14393. * _.eq(object, other);
  14394. * // => false
  14395. *
  14396. * _.eq('a', 'a');
  14397. * // => true
  14398. *
  14399. * _.eq('a', Object('a'));
  14400. * // => false
  14401. *
  14402. * _.eq(NaN, NaN);
  14403. * // => true
  14404. */
  14405. function eq(value, other) {
  14406. return value === other || (value !== value && other !== other);
  14407. }
  14408. /**
  14409. * Checks if `value` is classified as an `Array` object.
  14410. *
  14411. * @static
  14412. * @memberOf _
  14413. * @since 0.1.0
  14414. * @category Lang
  14415. * @param {*} value The value to check.
  14416. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14417. * @example
  14418. *
  14419. * _.isArray([1, 2, 3]);
  14420. * // => true
  14421. *
  14422. * _.isArray(document.body.children);
  14423. * // => false
  14424. *
  14425. * _.isArray('abc');
  14426. * // => false
  14427. *
  14428. * _.isArray(_.noop);
  14429. * // => false
  14430. */
  14431. var isArray = Array.isArray;
  14432. /**
  14433. * Checks if `value` is classified as a `Function` object.
  14434. *
  14435. * @static
  14436. * @memberOf _
  14437. * @since 0.1.0
  14438. * @category Lang
  14439. * @param {*} value The value to check.
  14440. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14441. * @example
  14442. *
  14443. * _.isFunction(_);
  14444. * // => true
  14445. *
  14446. * _.isFunction(/abc/);
  14447. * // => false
  14448. */
  14449. function isFunction(value) {
  14450. // The use of `Object#toString` avoids issues with the `typeof` operator
  14451. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14452. var tag = isObject(value) ? objectToString.call(value) : '';
  14453. return tag == funcTag || tag == genTag;
  14454. }
  14455. /**
  14456. * Checks if `value` is the
  14457. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14458. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14459. *
  14460. * @static
  14461. * @memberOf _
  14462. * @since 0.1.0
  14463. * @category Lang
  14464. * @param {*} value The value to check.
  14465. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14466. * @example
  14467. *
  14468. * _.isObject({});
  14469. * // => true
  14470. *
  14471. * _.isObject([1, 2, 3]);
  14472. * // => true
  14473. *
  14474. * _.isObject(_.noop);
  14475. * // => true
  14476. *
  14477. * _.isObject(null);
  14478. * // => false
  14479. */
  14480. function isObject(value) {
  14481. var type = typeof value;
  14482. return !!value && (type == 'object' || type == 'function');
  14483. }
  14484. /**
  14485. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14486. * and has a `typeof` result of "object".
  14487. *
  14488. * @static
  14489. * @memberOf _
  14490. * @since 4.0.0
  14491. * @category Lang
  14492. * @param {*} value The value to check.
  14493. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14494. * @example
  14495. *
  14496. * _.isObjectLike({});
  14497. * // => true
  14498. *
  14499. * _.isObjectLike([1, 2, 3]);
  14500. * // => true
  14501. *
  14502. * _.isObjectLike(_.noop);
  14503. * // => false
  14504. *
  14505. * _.isObjectLike(null);
  14506. * // => false
  14507. */
  14508. function isObjectLike(value) {
  14509. return !!value && typeof value == 'object';
  14510. }
  14511. /**
  14512. * Checks if `value` is classified as a `Symbol` primitive or object.
  14513. *
  14514. * @static
  14515. * @memberOf _
  14516. * @since 4.0.0
  14517. * @category Lang
  14518. * @param {*} value The value to check.
  14519. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14520. * @example
  14521. *
  14522. * _.isSymbol(Symbol.iterator);
  14523. * // => true
  14524. *
  14525. * _.isSymbol('abc');
  14526. * // => false
  14527. */
  14528. function isSymbol(value) {
  14529. return typeof value == 'symbol' ||
  14530. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14531. }
  14532. /**
  14533. * Converts `value` to a string. An empty string is returned for `null`
  14534. * and `undefined` values. The sign of `-0` is preserved.
  14535. *
  14536. * @static
  14537. * @memberOf _
  14538. * @since 4.0.0
  14539. * @category Lang
  14540. * @param {*} value The value to process.
  14541. * @returns {string} Returns the string.
  14542. * @example
  14543. *
  14544. * _.toString(null);
  14545. * // => ''
  14546. *
  14547. * _.toString(-0);
  14548. * // => '-0'
  14549. *
  14550. * _.toString([1, 2, 3]);
  14551. * // => '1,2,3'
  14552. */
  14553. function toString(value) {
  14554. return value == null ? '' : baseToString(value);
  14555. }
  14556. /**
  14557. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14558. * it's created. Arrays are created for missing index properties while objects
  14559. * are created for all other missing properties. Use `_.setWith` to customize
  14560. * `path` creation.
  14561. *
  14562. * **Note:** This method mutates `object`.
  14563. *
  14564. * @static
  14565. * @memberOf _
  14566. * @since 3.7.0
  14567. * @category Object
  14568. * @param {Object} object The object to modify.
  14569. * @param {Array|string} path The path of the property to set.
  14570. * @param {*} value The value to set.
  14571. * @returns {Object} Returns `object`.
  14572. * @example
  14573. *
  14574. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14575. *
  14576. * _.set(object, 'a[0].b.c', 4);
  14577. * console.log(object.a[0].b.c);
  14578. * // => 4
  14579. *
  14580. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14581. * console.log(object.x[0].y.z);
  14582. * // => 5
  14583. */
  14584. function set(object, path, value) {
  14585. return object == null ? object : baseSet(object, path, value);
  14586. }
  14587. module.exports = set;
  14588. /***/ }),
  14589. /***/ 898:
  14590. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14591. "use strict";
  14592. Object.defineProperty(exports, '__esModule', { value: true });
  14593. var request = __webpack_require__(753);
  14594. var universalUserAgent = __webpack_require__(796);
  14595. const VERSION = "4.3.1";
  14596. class GraphqlError extends Error {
  14597. constructor(request, response) {
  14598. const message = response.data.errors[0].message;
  14599. super(message);
  14600. Object.assign(this, response.data);
  14601. this.name = "GraphqlError";
  14602. this.request = request; // Maintains proper stack trace (only available on V8)
  14603. /* istanbul ignore next */
  14604. if (Error.captureStackTrace) {
  14605. Error.captureStackTrace(this, this.constructor);
  14606. }
  14607. }
  14608. }
  14609. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14610. function graphql(request, query, options) {
  14611. options = typeof query === "string" ? options = Object.assign({
  14612. query
  14613. }, options) : options = query;
  14614. const requestOptions = Object.keys(options).reduce((result, key) => {
  14615. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14616. result[key] = options[key];
  14617. return result;
  14618. }
  14619. if (!result.variables) {
  14620. result.variables = {};
  14621. }
  14622. result.variables[key] = options[key];
  14623. return result;
  14624. }, {});
  14625. return request(requestOptions).then(response => {
  14626. if (response.data.errors) {
  14627. throw new GraphqlError(requestOptions, {
  14628. data: response.data
  14629. });
  14630. }
  14631. return response.data.data;
  14632. });
  14633. }
  14634. function withDefaults(request$1, newDefaults) {
  14635. const newRequest = request$1.defaults(newDefaults);
  14636. const newApi = (query, options) => {
  14637. return graphql(newRequest, query, options);
  14638. };
  14639. return Object.assign(newApi, {
  14640. defaults: withDefaults.bind(null, newRequest),
  14641. endpoint: request.request.endpoint
  14642. });
  14643. }
  14644. const graphql$1 = withDefaults(request.request, {
  14645. headers: {
  14646. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14647. },
  14648. method: "POST",
  14649. url: "/graphql"
  14650. });
  14651. function withCustomRequest(customRequest) {
  14652. return withDefaults(customRequest, {
  14653. method: "POST",
  14654. url: "/graphql"
  14655. });
  14656. }
  14657. exports.graphql = graphql$1;
  14658. exports.withCustomRequest = withCustomRequest;
  14659. //# sourceMappingURL=index.js.map
  14660. /***/ }),
  14661. /***/ 899:
  14662. /***/ (function(module, __unusedexports, __webpack_require__) {
  14663. module.exports = registerEndpoints;
  14664. const { Deprecation } = __webpack_require__(692);
  14665. function registerEndpoints(octokit, routes) {
  14666. Object.keys(routes).forEach(namespaceName => {
  14667. if (!octokit[namespaceName]) {
  14668. octokit[namespaceName] = {};
  14669. }
  14670. Object.keys(routes[namespaceName]).forEach(apiName => {
  14671. const apiOptions = routes[namespaceName][apiName];
  14672. const endpointDefaults = ["method", "url", "headers"].reduce(
  14673. (map, key) => {
  14674. if (typeof apiOptions[key] !== "undefined") {
  14675. map[key] = apiOptions[key];
  14676. }
  14677. return map;
  14678. },
  14679. {}
  14680. );
  14681. endpointDefaults.request = {
  14682. validate: apiOptions.params
  14683. };
  14684. let request = octokit.request.defaults(endpointDefaults);
  14685. // patch request & endpoint methods to support deprecated parameters.
  14686. // Not the most elegant solution, but we don’t want to move deprecation
  14687. // logic into octokit/endpoint.js as it’s out of scope
  14688. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14689. key => apiOptions.params[key].deprecated
  14690. );
  14691. if (hasDeprecatedParam) {
  14692. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14693. request = patch(
  14694. octokit.request.defaults(endpointDefaults),
  14695. `.${namespaceName}.${apiName}()`
  14696. );
  14697. request.endpoint = patch(
  14698. request.endpoint,
  14699. `.${namespaceName}.${apiName}.endpoint()`
  14700. );
  14701. request.endpoint.merge = patch(
  14702. request.endpoint.merge,
  14703. `.${namespaceName}.${apiName}.endpoint.merge()`
  14704. );
  14705. }
  14706. if (apiOptions.deprecated) {
  14707. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14708. octokit.log.warn(
  14709. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14710. );
  14711. octokit[namespaceName][apiName] = request;
  14712. return request.apply(null, arguments);
  14713. };
  14714. return;
  14715. }
  14716. octokit[namespaceName][apiName] = request;
  14717. });
  14718. });
  14719. }
  14720. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14721. const patchedMethod = options => {
  14722. options = Object.assign({}, options);
  14723. Object.keys(options).forEach(key => {
  14724. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14725. const aliasKey = apiOptions.params[key].alias;
  14726. octokit.log.warn(
  14727. new Deprecation(
  14728. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14729. )
  14730. );
  14731. if (!(aliasKey in options)) {
  14732. options[aliasKey] = options[key];
  14733. }
  14734. delete options[key];
  14735. }
  14736. });
  14737. return method(options);
  14738. };
  14739. Object.keys(method).forEach(key => {
  14740. patchedMethod[key] = method[key];
  14741. });
  14742. return patchedMethod;
  14743. }
  14744. /***/ }),
  14745. /***/ 929:
  14746. /***/ (function(module, __unusedexports, __webpack_require__) {
  14747. module.exports = hasNextPage
  14748. const deprecate = __webpack_require__(370)
  14749. const getPageLinks = __webpack_require__(577)
  14750. function hasNextPage (link) {
  14751. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  14752. return getPageLinks(link).next
  14753. }
  14754. /***/ }),
  14755. /***/ 948:
  14756. /***/ (function(module) {
  14757. "use strict";
  14758. /**
  14759. * Tries to execute a function and discards any error that occurs.
  14760. * @param {Function} fn - Function that might or might not throw an error.
  14761. * @returns {?*} Return-value of the function when no error occurred.
  14762. */
  14763. module.exports = function(fn) {
  14764. try { return fn() } catch (e) {}
  14765. }
  14766. /***/ }),
  14767. /***/ 950:
  14768. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14769. "use strict";
  14770. Object.defineProperty(exports, "__esModule", { value: true });
  14771. const url = __webpack_require__(835);
  14772. function getProxyUrl(reqUrl) {
  14773. let usingSsl = reqUrl.protocol === 'https:';
  14774. let proxyUrl;
  14775. if (checkBypass(reqUrl)) {
  14776. return proxyUrl;
  14777. }
  14778. let proxyVar;
  14779. if (usingSsl) {
  14780. proxyVar = process.env["https_proxy"] ||
  14781. process.env["HTTPS_PROXY"];
  14782. }
  14783. else {
  14784. proxyVar = process.env["http_proxy"] ||
  14785. process.env["HTTP_PROXY"];
  14786. }
  14787. if (proxyVar) {
  14788. proxyUrl = url.parse(proxyVar);
  14789. }
  14790. return proxyUrl;
  14791. }
  14792. exports.getProxyUrl = getProxyUrl;
  14793. function checkBypass(reqUrl) {
  14794. if (!reqUrl.hostname) {
  14795. return false;
  14796. }
  14797. let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
  14798. if (!noProxy) {
  14799. return false;
  14800. }
  14801. // Determine the request port
  14802. let reqPort;
  14803. if (reqUrl.port) {
  14804. reqPort = Number(reqUrl.port);
  14805. }
  14806. else if (reqUrl.protocol === 'http:') {
  14807. reqPort = 80;
  14808. }
  14809. else if (reqUrl.protocol === 'https:') {
  14810. reqPort = 443;
  14811. }
  14812. // Format the request hostname and hostname with port
  14813. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  14814. if (typeof reqPort === 'number') {
  14815. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  14816. }
  14817. // Compare request host against noproxy
  14818. for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
  14819. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  14820. return true;
  14821. }
  14822. }
  14823. return false;
  14824. }
  14825. exports.checkBypass = checkBypass;
  14826. /***/ }),
  14827. /***/ 954:
  14828. /***/ (function(module) {
  14829. module.exports = validateAuth;
  14830. function validateAuth(auth) {
  14831. if (typeof auth === "string") {
  14832. return;
  14833. }
  14834. if (typeof auth === "function") {
  14835. return;
  14836. }
  14837. if (auth.username && auth.password) {
  14838. return;
  14839. }
  14840. if (auth.clientId && auth.clientSecret) {
  14841. return;
  14842. }
  14843. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  14844. }
  14845. /***/ }),
  14846. /***/ 955:
  14847. /***/ (function(module, __unusedexports, __webpack_require__) {
  14848. "use strict";
  14849. const path = __webpack_require__(622);
  14850. const childProcess = __webpack_require__(129);
  14851. const crossSpawn = __webpack_require__(20);
  14852. const stripEof = __webpack_require__(768);
  14853. const npmRunPath = __webpack_require__(621);
  14854. const isStream = __webpack_require__(323);
  14855. const _getStream = __webpack_require__(145);
  14856. const pFinally = __webpack_require__(697);
  14857. const onExit = __webpack_require__(260);
  14858. const errname = __webpack_require__(427);
  14859. const stdio = __webpack_require__(168);
  14860. const TEN_MEGABYTES = 1000 * 1000 * 10;
  14861. function handleArgs(cmd, args, opts) {
  14862. let parsed;
  14863. opts = Object.assign({
  14864. extendEnv: true,
  14865. env: {}
  14866. }, opts);
  14867. if (opts.extendEnv) {
  14868. opts.env = Object.assign({}, process.env, opts.env);
  14869. }
  14870. if (opts.__winShell === true) {
  14871. delete opts.__winShell;
  14872. parsed = {
  14873. command: cmd,
  14874. args,
  14875. options: opts,
  14876. file: cmd,
  14877. original: {
  14878. cmd,
  14879. args
  14880. }
  14881. };
  14882. } else {
  14883. parsed = crossSpawn._parse(cmd, args, opts);
  14884. }
  14885. opts = Object.assign({
  14886. maxBuffer: TEN_MEGABYTES,
  14887. buffer: true,
  14888. stripEof: true,
  14889. preferLocal: true,
  14890. localDir: parsed.options.cwd || process.cwd(),
  14891. encoding: 'utf8',
  14892. reject: true,
  14893. cleanup: true
  14894. }, parsed.options);
  14895. opts.stdio = stdio(opts);
  14896. if (opts.preferLocal) {
  14897. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  14898. }
  14899. if (opts.detached) {
  14900. // #115
  14901. opts.cleanup = false;
  14902. }
  14903. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  14904. // #116
  14905. parsed.args.unshift('/q');
  14906. }
  14907. return {
  14908. cmd: parsed.command,
  14909. args: parsed.args,
  14910. opts,
  14911. parsed
  14912. };
  14913. }
  14914. function handleInput(spawned, input) {
  14915. if (input === null || input === undefined) {
  14916. return;
  14917. }
  14918. if (isStream(input)) {
  14919. input.pipe(spawned.stdin);
  14920. } else {
  14921. spawned.stdin.end(input);
  14922. }
  14923. }
  14924. function handleOutput(opts, val) {
  14925. if (val && opts.stripEof) {
  14926. val = stripEof(val);
  14927. }
  14928. return val;
  14929. }
  14930. function handleShell(fn, cmd, opts) {
  14931. let file = '/bin/sh';
  14932. let args = ['-c', cmd];
  14933. opts = Object.assign({}, opts);
  14934. if (process.platform === 'win32') {
  14935. opts.__winShell = true;
  14936. file = process.env.comspec || 'cmd.exe';
  14937. args = ['/s', '/c', `"${cmd}"`];
  14938. opts.windowsVerbatimArguments = true;
  14939. }
  14940. if (opts.shell) {
  14941. file = opts.shell;
  14942. delete opts.shell;
  14943. }
  14944. return fn(file, args, opts);
  14945. }
  14946. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  14947. if (!process[stream]) {
  14948. return null;
  14949. }
  14950. let ret;
  14951. if (!buffer) {
  14952. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  14953. ret = new Promise((resolve, reject) => {
  14954. process[stream]
  14955. .once('end', resolve)
  14956. .once('error', reject);
  14957. });
  14958. } else if (encoding) {
  14959. ret = _getStream(process[stream], {
  14960. encoding,
  14961. maxBuffer
  14962. });
  14963. } else {
  14964. ret = _getStream.buffer(process[stream], {maxBuffer});
  14965. }
  14966. return ret.catch(err => {
  14967. err.stream = stream;
  14968. err.message = `${stream} ${err.message}`;
  14969. throw err;
  14970. });
  14971. }
  14972. function makeError(result, options) {
  14973. const {stdout, stderr} = result;
  14974. let err = result.error;
  14975. const {code, signal} = result;
  14976. const {parsed, joinedCmd} = options;
  14977. const timedOut = options.timedOut || false;
  14978. if (!err) {
  14979. let output = '';
  14980. if (Array.isArray(parsed.opts.stdio)) {
  14981. if (parsed.opts.stdio[2] !== 'inherit') {
  14982. output += output.length > 0 ? stderr : `\n${stderr}`;
  14983. }
  14984. if (parsed.opts.stdio[1] !== 'inherit') {
  14985. output += `\n${stdout}`;
  14986. }
  14987. } else if (parsed.opts.stdio !== 'inherit') {
  14988. output = `\n${stderr}${stdout}`;
  14989. }
  14990. err = new Error(`Command failed: ${joinedCmd}${output}`);
  14991. err.code = code < 0 ? errname(code) : code;
  14992. }
  14993. err.stdout = stdout;
  14994. err.stderr = stderr;
  14995. err.failed = true;
  14996. err.signal = signal || null;
  14997. err.cmd = joinedCmd;
  14998. err.timedOut = timedOut;
  14999. return err;
  15000. }
  15001. function joinCmd(cmd, args) {
  15002. let joinedCmd = cmd;
  15003. if (Array.isArray(args) && args.length > 0) {
  15004. joinedCmd += ' ' + args.join(' ');
  15005. }
  15006. return joinedCmd;
  15007. }
  15008. module.exports = (cmd, args, opts) => {
  15009. const parsed = handleArgs(cmd, args, opts);
  15010. const {encoding, buffer, maxBuffer} = parsed.opts;
  15011. const joinedCmd = joinCmd(cmd, args);
  15012. let spawned;
  15013. try {
  15014. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  15015. } catch (err) {
  15016. return Promise.reject(err);
  15017. }
  15018. let removeExitHandler;
  15019. if (parsed.opts.cleanup) {
  15020. removeExitHandler = onExit(() => {
  15021. spawned.kill();
  15022. });
  15023. }
  15024. let timeoutId = null;
  15025. let timedOut = false;
  15026. const cleanup = () => {
  15027. if (timeoutId) {
  15028. clearTimeout(timeoutId);
  15029. timeoutId = null;
  15030. }
  15031. if (removeExitHandler) {
  15032. removeExitHandler();
  15033. }
  15034. };
  15035. if (parsed.opts.timeout > 0) {
  15036. timeoutId = setTimeout(() => {
  15037. timeoutId = null;
  15038. timedOut = true;
  15039. spawned.kill(parsed.opts.killSignal);
  15040. }, parsed.opts.timeout);
  15041. }
  15042. const processDone = new Promise(resolve => {
  15043. spawned.on('exit', (code, signal) => {
  15044. cleanup();
  15045. resolve({code, signal});
  15046. });
  15047. spawned.on('error', err => {
  15048. cleanup();
  15049. resolve({error: err});
  15050. });
  15051. if (spawned.stdin) {
  15052. spawned.stdin.on('error', err => {
  15053. cleanup();
  15054. resolve({error: err});
  15055. });
  15056. }
  15057. });
  15058. function destroy() {
  15059. if (spawned.stdout) {
  15060. spawned.stdout.destroy();
  15061. }
  15062. if (spawned.stderr) {
  15063. spawned.stderr.destroy();
  15064. }
  15065. }
  15066. const handlePromise = () => pFinally(Promise.all([
  15067. processDone,
  15068. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  15069. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  15070. ]).then(arr => {
  15071. const result = arr[0];
  15072. result.stdout = arr[1];
  15073. result.stderr = arr[2];
  15074. if (result.error || result.code !== 0 || result.signal !== null) {
  15075. const err = makeError(result, {
  15076. joinedCmd,
  15077. parsed,
  15078. timedOut
  15079. });
  15080. // TODO: missing some timeout logic for killed
  15081. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  15082. // err.killed = spawned.killed || killed;
  15083. err.killed = err.killed || spawned.killed;
  15084. if (!parsed.opts.reject) {
  15085. return err;
  15086. }
  15087. throw err;
  15088. }
  15089. return {
  15090. stdout: handleOutput(parsed.opts, result.stdout),
  15091. stderr: handleOutput(parsed.opts, result.stderr),
  15092. code: 0,
  15093. failed: false,
  15094. killed: false,
  15095. signal: null,
  15096. cmd: joinedCmd,
  15097. timedOut: false
  15098. };
  15099. }), destroy);
  15100. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  15101. handleInput(spawned, parsed.opts.input);
  15102. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  15103. spawned.catch = onrejected => handlePromise().catch(onrejected);
  15104. return spawned;
  15105. };
  15106. // TODO: set `stderr: 'ignore'` when that option is implemented
  15107. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  15108. // TODO: set `stdout: 'ignore'` when that option is implemented
  15109. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  15110. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  15111. module.exports.sync = (cmd, args, opts) => {
  15112. const parsed = handleArgs(cmd, args, opts);
  15113. const joinedCmd = joinCmd(cmd, args);
  15114. if (isStream(parsed.opts.input)) {
  15115. throw new TypeError('The `input` option cannot be a stream in sync mode');
  15116. }
  15117. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  15118. result.code = result.status;
  15119. if (result.error || result.status !== 0 || result.signal !== null) {
  15120. const err = makeError(result, {
  15121. joinedCmd,
  15122. parsed
  15123. });
  15124. if (!parsed.opts.reject) {
  15125. return err;
  15126. }
  15127. throw err;
  15128. }
  15129. return {
  15130. stdout: handleOutput(parsed.opts, result.stdout),
  15131. stderr: handleOutput(parsed.opts, result.stderr),
  15132. code: 0,
  15133. failed: false,
  15134. signal: null,
  15135. cmd: joinedCmd,
  15136. timedOut: false
  15137. };
  15138. };
  15139. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  15140. /***/ }),
  15141. /***/ 966:
  15142. /***/ (function(module, __unusedexports, __webpack_require__) {
  15143. "use strict";
  15144. const {PassThrough} = __webpack_require__(413);
  15145. module.exports = options => {
  15146. options = Object.assign({}, options);
  15147. const {array} = options;
  15148. let {encoding} = options;
  15149. const buffer = encoding === 'buffer';
  15150. let objectMode = false;
  15151. if (array) {
  15152. objectMode = !(encoding || buffer);
  15153. } else {
  15154. encoding = encoding || 'utf8';
  15155. }
  15156. if (buffer) {
  15157. encoding = null;
  15158. }
  15159. let len = 0;
  15160. const ret = [];
  15161. const stream = new PassThrough({objectMode});
  15162. if (encoding) {
  15163. stream.setEncoding(encoding);
  15164. }
  15165. stream.on('data', chunk => {
  15166. ret.push(chunk);
  15167. if (objectMode) {
  15168. len = ret.length;
  15169. } else {
  15170. len += chunk.length;
  15171. }
  15172. });
  15173. stream.getBufferedValue = () => {
  15174. if (array) {
  15175. return ret;
  15176. }
  15177. return buffer ? Buffer.concat(ret, len) : ret.join('');
  15178. };
  15179. stream.getBufferedLength = () => len;
  15180. return stream;
  15181. };
  15182. /***/ }),
  15183. /***/ 969:
  15184. /***/ (function(module, __unusedexports, __webpack_require__) {
  15185. var wrappy = __webpack_require__(11)
  15186. module.exports = wrappy(once)
  15187. module.exports.strict = wrappy(onceStrict)
  15188. once.proto = once(function () {
  15189. Object.defineProperty(Function.prototype, 'once', {
  15190. value: function () {
  15191. return once(this)
  15192. },
  15193. configurable: true
  15194. })
  15195. Object.defineProperty(Function.prototype, 'onceStrict', {
  15196. value: function () {
  15197. return onceStrict(this)
  15198. },
  15199. configurable: true
  15200. })
  15201. })
  15202. function once (fn) {
  15203. var f = function () {
  15204. if (f.called) return f.value
  15205. f.called = true
  15206. return f.value = fn.apply(this, arguments)
  15207. }
  15208. f.called = false
  15209. return f
  15210. }
  15211. function onceStrict (fn) {
  15212. var f = function () {
  15213. if (f.called)
  15214. throw new Error(f.onceError)
  15215. f.called = true
  15216. return f.value = fn.apply(this, arguments)
  15217. }
  15218. var name = fn.name || 'Function wrapped with `once`'
  15219. f.onceError = name + " shouldn't be called more than once"
  15220. f.called = false
  15221. return f
  15222. }
  15223. /***/ }),
  15224. /***/ 986:
  15225. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  15226. "use strict";
  15227. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  15228. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  15229. return new (P || (P = Promise))(function (resolve, reject) {
  15230. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  15231. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  15232. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  15233. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15234. });
  15235. };
  15236. Object.defineProperty(exports, "__esModule", { value: true });
  15237. const tr = __webpack_require__(9);
  15238. /**
  15239. * Exec a command.
  15240. * Output will be streamed to the live console.
  15241. * Returns promise with return code
  15242. *
  15243. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  15244. * @param args optional arguments for tool. Escaping is handled by the lib.
  15245. * @param options optional exec options. See ExecOptions
  15246. * @returns Promise<number> exit code
  15247. */
  15248. function exec(commandLine, args, options) {
  15249. return __awaiter(this, void 0, void 0, function* () {
  15250. const commandArgs = tr.argStringToArray(commandLine);
  15251. if (commandArgs.length === 0) {
  15252. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  15253. }
  15254. // Path to tool to execute should be first arg
  15255. const toolPath = commandArgs[0];
  15256. args = commandArgs.slice(1).concat(args || []);
  15257. const runner = new tr.ToolRunner(toolPath, args, options);
  15258. return runner.exec();
  15259. });
  15260. }
  15261. exports.exec = exec;
  15262. //# sourceMappingURL=exec.js.map
  15263. /***/ }),
  15264. /***/ 991:
  15265. /***/ (function(module, __unusedexports, __webpack_require__) {
  15266. module.exports = authenticationRequestError;
  15267. const { RequestError } = __webpack_require__(463);
  15268. function authenticationRequestError(state, error, options) {
  15269. if (!error.headers) throw error;
  15270. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  15271. // handle "2FA required" error only
  15272. if (error.status !== 401 || !otpRequired) {
  15273. throw error;
  15274. }
  15275. if (
  15276. error.status === 401 &&
  15277. otpRequired &&
  15278. error.request &&
  15279. error.request.headers["x-github-otp"]
  15280. ) {
  15281. if (state.otp) {
  15282. delete state.otp; // no longer valid, request again
  15283. } else {
  15284. throw new RequestError(
  15285. "Invalid one-time password for two-factor authentication",
  15286. 401,
  15287. {
  15288. headers: error.headers,
  15289. request: options
  15290. }
  15291. );
  15292. }
  15293. }
  15294. if (typeof state.auth.on2fa !== "function") {
  15295. throw new RequestError(
  15296. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  15297. 401,
  15298. {
  15299. headers: error.headers,
  15300. request: options
  15301. }
  15302. );
  15303. }
  15304. return Promise.resolve()
  15305. .then(() => {
  15306. return state.auth.on2fa();
  15307. })
  15308. .then(oneTimePassword => {
  15309. const newOptions = Object.assign(options, {
  15310. headers: Object.assign(options.headers, {
  15311. "x-github-otp": oneTimePassword
  15312. })
  15313. });
  15314. return state.octokit.request(newOptions).then(response => {
  15315. // If OTP still valid, then persist it for following requests
  15316. state.otp = oneTimePassword;
  15317. return response;
  15318. });
  15319. });
  15320. }
  15321. /***/ })
  15322. /******/ });