index.js 674 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495174961749717498174991750017501175021750317504175051750617507175081750917510175111751217513175141751517516175171751817519175201752117522175231752417525175261752717528175291753017531175321753317534175351753617537175381753917540175411754217543175441754517546175471754817549175501755117552175531755417555175561755717558175591756017561175621756317564175651756617567175681756917570175711757217573175741757517576175771757817579175801758117582175831758417585175861758717588175891759017591175921759317594175951759617597175981759917600176011760217603176041760517606176071760817609176101761117612176131761417615176161761717618176191762017621176221762317624176251762617627176281762917630
  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.sshKeyPath = '';
  4473. this.sshKnownHostsPath = '';
  4474. this.temporaryHomePath = '';
  4475. this.git = gitCommandManager;
  4476. this.settings = gitSourceSettings || {};
  4477. // Token auth header
  4478. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4479. core.setSecret(basicCredential);
  4480. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4481. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4482. }
  4483. configureAuth() {
  4484. return __awaiter(this, void 0, void 0, function* () {
  4485. // Remove possible previous values
  4486. yield this.removeAuth();
  4487. // Configure new values
  4488. yield this.configureSsh();
  4489. yield this.configureToken();
  4490. });
  4491. }
  4492. configureGlobalAuth() {
  4493. return __awaiter(this, void 0, void 0, function* () {
  4494. // Create a temp home directory
  4495. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4496. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4497. const uniqueId = v4_1.default();
  4498. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4499. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4500. // Copy the global git config
  4501. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4502. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4503. let configExists = false;
  4504. try {
  4505. yield fs.promises.stat(gitConfigPath);
  4506. configExists = true;
  4507. }
  4508. catch (err) {
  4509. if (err.code !== 'ENOENT') {
  4510. throw err;
  4511. }
  4512. }
  4513. if (configExists) {
  4514. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4515. yield io.cp(gitConfigPath, newGitConfigPath);
  4516. }
  4517. else {
  4518. yield fs.promises.writeFile(newGitConfigPath, '');
  4519. }
  4520. try {
  4521. // Override HOME
  4522. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4523. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4524. // Configure the token
  4525. yield this.configureToken(newGitConfigPath, true);
  4526. // Configure HTTPS instead of SSH
  4527. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4528. if (!this.settings.sshKey) {
  4529. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4530. }
  4531. }
  4532. catch (err) {
  4533. // Unset in case somehow written to the real global config
  4534. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4535. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4536. throw err;
  4537. }
  4538. });
  4539. }
  4540. configureSubmoduleAuth() {
  4541. return __awaiter(this, void 0, void 0, function* () {
  4542. // Remove possible previous HTTPS instead of SSH
  4543. yield this.removeGitConfig(this.insteadOfKey, true);
  4544. if (this.settings.persistCredentials) {
  4545. // Configure a placeholder value. This approach avoids the credential being captured
  4546. // by process creation audit events, which are commonly logged. For more information,
  4547. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4548. 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);
  4549. // Replace the placeholder
  4550. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4551. for (const configPath of configPaths) {
  4552. core.debug(`Replacing token placeholder in '${configPath}'`);
  4553. this.replaceTokenPlaceholder(configPath);
  4554. }
  4555. // Configure HTTPS instead of SSH
  4556. if (!this.settings.sshKey) {
  4557. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4558. }
  4559. }
  4560. });
  4561. }
  4562. removeAuth() {
  4563. return __awaiter(this, void 0, void 0, function* () {
  4564. yield this.removeSsh();
  4565. yield this.removeToken();
  4566. });
  4567. }
  4568. removeGlobalAuth() {
  4569. return __awaiter(this, void 0, void 0, function* () {
  4570. core.info(`Unsetting HOME override`);
  4571. this.git.removeEnvironmentVariable('HOME');
  4572. yield io.rmRF(this.temporaryHomePath);
  4573. });
  4574. }
  4575. configureSsh() {
  4576. return __awaiter(this, void 0, void 0, function* () {
  4577. if (!this.settings.sshKey) {
  4578. return;
  4579. }
  4580. // Write key
  4581. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4582. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4583. const uniqueId = v4_1.default();
  4584. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4585. stateHelper.setSshKeyPath(this.sshKeyPath);
  4586. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4587. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4588. // Remove inherited permissions on Windows
  4589. if (IS_WINDOWS) {
  4590. const icacls = yield io.which('icacls.exe');
  4591. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4592. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4593. }
  4594. // Write known hosts
  4595. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4596. let userKnownHosts = '';
  4597. try {
  4598. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4599. }
  4600. catch (err) {
  4601. if (err.code !== 'ENOENT') {
  4602. throw err;
  4603. }
  4604. }
  4605. let knownHosts = '';
  4606. if (userKnownHosts) {
  4607. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4608. }
  4609. if (this.settings.sshKnownHosts) {
  4610. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4611. }
  4612. 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`;
  4613. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4614. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4615. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4616. // Configure GIT_SSH_COMMAND
  4617. const sshPath = yield io.which('ssh', true);
  4618. let sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4619. if (this.settings.sshStrict) {
  4620. sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4621. }
  4622. sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4623. core.info(`Temporarily overriding GIT_SSH_COMMAND=${sshCommand}`);
  4624. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', sshCommand);
  4625. // Configure core.sshCommand
  4626. if (this.settings.persistCredentials) {
  4627. yield this.git.config(SSH_COMMAND_KEY, sshCommand);
  4628. }
  4629. });
  4630. }
  4631. configureToken(configPath, globalConfig) {
  4632. return __awaiter(this, void 0, void 0, function* () {
  4633. // Validate args
  4634. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4635. // Default config path
  4636. if (!configPath && !globalConfig) {
  4637. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4638. }
  4639. // Configure a placeholder value. This approach avoids the credential being captured
  4640. // by process creation audit events, which are commonly logged. For more information,
  4641. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4642. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4643. // Replace the placeholder
  4644. yield this.replaceTokenPlaceholder(configPath || '');
  4645. });
  4646. }
  4647. replaceTokenPlaceholder(configPath) {
  4648. return __awaiter(this, void 0, void 0, function* () {
  4649. assert.ok(configPath, 'configPath is not defined');
  4650. let content = (yield fs.promises.readFile(configPath)).toString();
  4651. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4652. if (placeholderIndex < 0 ||
  4653. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4654. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4655. }
  4656. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4657. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4658. yield fs.promises.writeFile(configPath, content);
  4659. });
  4660. }
  4661. removeSsh() {
  4662. return __awaiter(this, void 0, void 0, function* () {
  4663. // SSH key
  4664. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4665. if (keyPath) {
  4666. try {
  4667. yield io.rmRF(keyPath);
  4668. }
  4669. catch (err) {
  4670. core.debug(err.message);
  4671. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4672. }
  4673. }
  4674. // SSH known hosts
  4675. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4676. if (knownHostsPath) {
  4677. try {
  4678. yield io.rmRF(knownHostsPath);
  4679. }
  4680. catch (_a) {
  4681. // Intentionally empty
  4682. }
  4683. }
  4684. // SSH command
  4685. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4686. });
  4687. }
  4688. removeToken() {
  4689. return __awaiter(this, void 0, void 0, function* () {
  4690. // HTTP extra header
  4691. yield this.removeGitConfig(this.tokenConfigKey);
  4692. });
  4693. }
  4694. removeGitConfig(configKey, submoduleOnly = false) {
  4695. return __awaiter(this, void 0, void 0, function* () {
  4696. if (!submoduleOnly) {
  4697. if ((yield this.git.configExists(configKey)) &&
  4698. !(yield this.git.tryConfigUnset(configKey))) {
  4699. // Load the config contents
  4700. core.warning(`Failed to remove '${configKey}' from the git config`);
  4701. }
  4702. }
  4703. const pattern = regexpHelper.escape(configKey);
  4704. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4705. });
  4706. }
  4707. }
  4708. /***/ }),
  4709. /***/ 289:
  4710. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4711. "use strict";
  4712. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4713. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4714. return new (P || (P = Promise))(function (resolve, reject) {
  4715. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4716. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4717. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4718. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4719. });
  4720. };
  4721. var __importStar = (this && this.__importStar) || function (mod) {
  4722. if (mod && mod.__esModule) return mod;
  4723. var result = {};
  4724. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4725. result["default"] = mod;
  4726. return result;
  4727. };
  4728. Object.defineProperty(exports, "__esModule", { value: true });
  4729. const core = __importStar(__webpack_require__(470));
  4730. const exec = __importStar(__webpack_require__(986));
  4731. const fshelper = __importStar(__webpack_require__(618));
  4732. const io = __importStar(__webpack_require__(1));
  4733. const path = __importStar(__webpack_require__(622));
  4734. const regexpHelper = __importStar(__webpack_require__(528));
  4735. const retryHelper = __importStar(__webpack_require__(587));
  4736. const git_version_1 = __webpack_require__(559);
  4737. // Auth header not supported before 2.9
  4738. // Wire protocol v2 not supported before 2.18
  4739. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4740. function createCommandManager(workingDirectory, lfs) {
  4741. return __awaiter(this, void 0, void 0, function* () {
  4742. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4743. });
  4744. }
  4745. exports.createCommandManager = createCommandManager;
  4746. class GitCommandManager {
  4747. // Private constructor; use createCommandManager()
  4748. constructor() {
  4749. this.gitEnv = {
  4750. GIT_TERMINAL_PROMPT: '0',
  4751. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4752. };
  4753. this.gitPath = '';
  4754. this.lfs = false;
  4755. this.workingDirectory = '';
  4756. }
  4757. branchDelete(remote, branch) {
  4758. return __awaiter(this, void 0, void 0, function* () {
  4759. const args = ['branch', '--delete', '--force'];
  4760. if (remote) {
  4761. args.push('--remote');
  4762. }
  4763. args.push(branch);
  4764. yield this.execGit(args);
  4765. });
  4766. }
  4767. branchExists(remote, pattern) {
  4768. return __awaiter(this, void 0, void 0, function* () {
  4769. const args = ['branch', '--list'];
  4770. if (remote) {
  4771. args.push('--remote');
  4772. }
  4773. args.push(pattern);
  4774. const output = yield this.execGit(args);
  4775. return !!output.stdout.trim();
  4776. });
  4777. }
  4778. branchList(remote) {
  4779. return __awaiter(this, void 0, void 0, function* () {
  4780. const result = [];
  4781. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4782. // "branch --list" is more difficult when in a detached HEAD state.
  4783. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4784. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4785. const args = ['rev-parse', '--symbolic-full-name'];
  4786. if (remote) {
  4787. args.push('--remotes=origin');
  4788. }
  4789. else {
  4790. args.push('--branches');
  4791. }
  4792. const output = yield this.execGit(args);
  4793. for (let branch of output.stdout.trim().split('\n')) {
  4794. branch = branch.trim();
  4795. if (branch) {
  4796. if (branch.startsWith('refs/heads/')) {
  4797. branch = branch.substr('refs/heads/'.length);
  4798. }
  4799. else if (branch.startsWith('refs/remotes/')) {
  4800. branch = branch.substr('refs/remotes/'.length);
  4801. }
  4802. result.push(branch);
  4803. }
  4804. }
  4805. return result;
  4806. });
  4807. }
  4808. checkout(ref, startPoint) {
  4809. return __awaiter(this, void 0, void 0, function* () {
  4810. const args = ['checkout', '--progress', '--force'];
  4811. if (startPoint) {
  4812. args.push('-B', ref, startPoint);
  4813. }
  4814. else {
  4815. args.push(ref);
  4816. }
  4817. yield this.execGit(args);
  4818. });
  4819. }
  4820. checkoutDetach() {
  4821. return __awaiter(this, void 0, void 0, function* () {
  4822. const args = ['checkout', '--detach'];
  4823. yield this.execGit(args);
  4824. });
  4825. }
  4826. config(configKey, configValue, globalConfig) {
  4827. return __awaiter(this, void 0, void 0, function* () {
  4828. yield this.execGit([
  4829. 'config',
  4830. globalConfig ? '--global' : '--local',
  4831. configKey,
  4832. configValue
  4833. ]);
  4834. });
  4835. }
  4836. configExists(configKey, globalConfig) {
  4837. return __awaiter(this, void 0, void 0, function* () {
  4838. const pattern = regexpHelper.escape(configKey);
  4839. const output = yield this.execGit([
  4840. 'config',
  4841. globalConfig ? '--global' : '--local',
  4842. '--name-only',
  4843. '--get-regexp',
  4844. pattern
  4845. ], true);
  4846. return output.exitCode === 0;
  4847. });
  4848. }
  4849. fetch(fetchDepth, refSpec) {
  4850. return __awaiter(this, void 0, void 0, function* () {
  4851. const args = [
  4852. '-c',
  4853. 'protocol.version=2',
  4854. 'fetch',
  4855. '--no-tags',
  4856. '--prune',
  4857. '--progress',
  4858. '--no-recurse-submodules'
  4859. ];
  4860. if (fetchDepth > 0) {
  4861. args.push(`--depth=${fetchDepth}`);
  4862. }
  4863. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4864. args.push('--unshallow');
  4865. }
  4866. args.push('origin');
  4867. for (const arg of refSpec) {
  4868. args.push(arg);
  4869. }
  4870. const that = this;
  4871. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4872. yield that.execGit(args);
  4873. }));
  4874. });
  4875. }
  4876. getWorkingDirectory() {
  4877. return this.workingDirectory;
  4878. }
  4879. init() {
  4880. return __awaiter(this, void 0, void 0, function* () {
  4881. yield this.execGit(['init', this.workingDirectory]);
  4882. });
  4883. }
  4884. isDetached() {
  4885. return __awaiter(this, void 0, void 0, function* () {
  4886. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  4887. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  4888. return !output.stdout.trim().startsWith('refs/heads/');
  4889. });
  4890. }
  4891. lfsFetch(ref) {
  4892. return __awaiter(this, void 0, void 0, function* () {
  4893. const args = ['lfs', 'fetch', 'origin', ref];
  4894. const that = this;
  4895. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4896. yield that.execGit(args);
  4897. }));
  4898. });
  4899. }
  4900. lfsInstall() {
  4901. return __awaiter(this, void 0, void 0, function* () {
  4902. yield this.execGit(['lfs', 'install', '--local']);
  4903. });
  4904. }
  4905. log1() {
  4906. return __awaiter(this, void 0, void 0, function* () {
  4907. yield this.execGit(['log', '-1']);
  4908. });
  4909. }
  4910. remoteAdd(remoteName, remoteUrl) {
  4911. return __awaiter(this, void 0, void 0, function* () {
  4912. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4913. });
  4914. }
  4915. removeEnvironmentVariable(name) {
  4916. delete this.gitEnv[name];
  4917. }
  4918. setEnvironmentVariable(name, value) {
  4919. this.gitEnv[name] = value;
  4920. }
  4921. submoduleForeach(command, recursive) {
  4922. return __awaiter(this, void 0, void 0, function* () {
  4923. const args = ['submodule', 'foreach'];
  4924. if (recursive) {
  4925. args.push('--recursive');
  4926. }
  4927. args.push(command);
  4928. const output = yield this.execGit(args);
  4929. return output.stdout;
  4930. });
  4931. }
  4932. submoduleSync(recursive) {
  4933. return __awaiter(this, void 0, void 0, function* () {
  4934. const args = ['submodule', 'sync'];
  4935. if (recursive) {
  4936. args.push('--recursive');
  4937. }
  4938. yield this.execGit(args);
  4939. });
  4940. }
  4941. submoduleUpdate(fetchDepth, recursive) {
  4942. return __awaiter(this, void 0, void 0, function* () {
  4943. const args = ['-c', 'protocol.version=2'];
  4944. args.push('submodule', 'update', '--init', '--force');
  4945. if (fetchDepth > 0) {
  4946. args.push(`--depth=${fetchDepth}`);
  4947. }
  4948. if (recursive) {
  4949. args.push('--recursive');
  4950. }
  4951. yield this.execGit(args);
  4952. });
  4953. }
  4954. tagExists(pattern) {
  4955. return __awaiter(this, void 0, void 0, function* () {
  4956. const output = yield this.execGit(['tag', '--list', pattern]);
  4957. return !!output.stdout.trim();
  4958. });
  4959. }
  4960. tryClean() {
  4961. return __awaiter(this, void 0, void 0, function* () {
  4962. const output = yield this.execGit(['clean', '-ffdx'], true);
  4963. return output.exitCode === 0;
  4964. });
  4965. }
  4966. tryConfigUnset(configKey, globalConfig) {
  4967. return __awaiter(this, void 0, void 0, function* () {
  4968. const output = yield this.execGit([
  4969. 'config',
  4970. globalConfig ? '--global' : '--local',
  4971. '--unset-all',
  4972. configKey
  4973. ], true);
  4974. return output.exitCode === 0;
  4975. });
  4976. }
  4977. tryDisableAutomaticGarbageCollection() {
  4978. return __awaiter(this, void 0, void 0, function* () {
  4979. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  4980. return output.exitCode === 0;
  4981. });
  4982. }
  4983. tryGetFetchUrl() {
  4984. return __awaiter(this, void 0, void 0, function* () {
  4985. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  4986. if (output.exitCode !== 0) {
  4987. return '';
  4988. }
  4989. const stdout = output.stdout.trim();
  4990. if (stdout.includes('\n')) {
  4991. return '';
  4992. }
  4993. return stdout;
  4994. });
  4995. }
  4996. tryReset() {
  4997. return __awaiter(this, void 0, void 0, function* () {
  4998. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4999. return output.exitCode === 0;
  5000. });
  5001. }
  5002. static createCommandManager(workingDirectory, lfs) {
  5003. return __awaiter(this, void 0, void 0, function* () {
  5004. const result = new GitCommandManager();
  5005. yield result.initializeCommandManager(workingDirectory, lfs);
  5006. return result;
  5007. });
  5008. }
  5009. execGit(args, allowAllExitCodes = false) {
  5010. return __awaiter(this, void 0, void 0, function* () {
  5011. fshelper.directoryExistsSync(this.workingDirectory, true);
  5012. const result = new GitOutput();
  5013. const env = {};
  5014. for (const key of Object.keys(process.env)) {
  5015. env[key] = process.env[key];
  5016. }
  5017. for (const key of Object.keys(this.gitEnv)) {
  5018. env[key] = this.gitEnv[key];
  5019. }
  5020. const stdout = [];
  5021. const options = {
  5022. cwd: this.workingDirectory,
  5023. env,
  5024. ignoreReturnCode: allowAllExitCodes,
  5025. listeners: {
  5026. stdout: (data) => {
  5027. stdout.push(data.toString());
  5028. }
  5029. }
  5030. };
  5031. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5032. result.stdout = stdout.join('');
  5033. return result;
  5034. });
  5035. }
  5036. initializeCommandManager(workingDirectory, lfs) {
  5037. return __awaiter(this, void 0, void 0, function* () {
  5038. this.workingDirectory = workingDirectory;
  5039. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5040. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5041. this.lfs = lfs;
  5042. if (!this.lfs) {
  5043. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5044. }
  5045. this.gitPath = yield io.which('git', true);
  5046. // Git version
  5047. core.debug('Getting git version');
  5048. let gitVersion = new git_version_1.GitVersion();
  5049. let gitOutput = yield this.execGit(['version']);
  5050. let stdout = gitOutput.stdout.trim();
  5051. if (!stdout.includes('\n')) {
  5052. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5053. if (match) {
  5054. gitVersion = new git_version_1.GitVersion(match[0]);
  5055. }
  5056. }
  5057. if (!gitVersion.isValid()) {
  5058. throw new Error('Unable to determine git version');
  5059. }
  5060. // Minimum git version
  5061. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5062. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5063. }
  5064. if (this.lfs) {
  5065. // Git-lfs version
  5066. core.debug('Getting git-lfs version');
  5067. let gitLfsVersion = new git_version_1.GitVersion();
  5068. const gitLfsPath = yield io.which('git-lfs', true);
  5069. gitOutput = yield this.execGit(['lfs', 'version']);
  5070. stdout = gitOutput.stdout.trim();
  5071. if (!stdout.includes('\n')) {
  5072. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5073. if (match) {
  5074. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5075. }
  5076. }
  5077. if (!gitLfsVersion.isValid()) {
  5078. throw new Error('Unable to determine git-lfs version');
  5079. }
  5080. // Minimum git-lfs version
  5081. // Note:
  5082. // - Auth header not supported before 2.1
  5083. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5084. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5085. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5086. }
  5087. }
  5088. // Set the user agent
  5089. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5090. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5091. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5092. });
  5093. }
  5094. }
  5095. class GitOutput {
  5096. constructor() {
  5097. this.stdout = '';
  5098. this.exitCode = 0;
  5099. }
  5100. }
  5101. /***/ }),
  5102. /***/ 293:
  5103. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5104. "use strict";
  5105. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5106. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5107. return new (P || (P = Promise))(function (resolve, reject) {
  5108. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5109. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5110. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5111. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5112. });
  5113. };
  5114. var __importStar = (this && this.__importStar) || function (mod) {
  5115. if (mod && mod.__esModule) return mod;
  5116. var result = {};
  5117. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5118. result["default"] = mod;
  5119. return result;
  5120. };
  5121. Object.defineProperty(exports, "__esModule", { value: true });
  5122. const core = __importStar(__webpack_require__(470));
  5123. const fsHelper = __importStar(__webpack_require__(618));
  5124. const gitAuthHelper = __importStar(__webpack_require__(287));
  5125. const gitCommandManager = __importStar(__webpack_require__(289));
  5126. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5127. const githubApiHelper = __importStar(__webpack_require__(464));
  5128. const io = __importStar(__webpack_require__(1));
  5129. const path = __importStar(__webpack_require__(622));
  5130. const refHelper = __importStar(__webpack_require__(227));
  5131. const stateHelper = __importStar(__webpack_require__(153));
  5132. const hostname = 'github.com';
  5133. function getSource(settings) {
  5134. return __awaiter(this, void 0, void 0, function* () {
  5135. // Repository URL
  5136. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5137. const repositoryUrl = settings.sshKey
  5138. ? `git@${hostname}:${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}.git`
  5139. : `https://${hostname}/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  5140. // Remove conflicting file path
  5141. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5142. yield io.rmRF(settings.repositoryPath);
  5143. }
  5144. // Create directory
  5145. let isExisting = true;
  5146. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5147. isExisting = false;
  5148. yield io.mkdirP(settings.repositoryPath);
  5149. }
  5150. // Git command manager
  5151. const git = yield getGitCommandManager(settings);
  5152. // Prepare existing directory, otherwise recreate
  5153. if (isExisting) {
  5154. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  5155. }
  5156. if (!git) {
  5157. // Downloading using REST API
  5158. core.info(`The repository will be downloaded using the GitHub REST API`);
  5159. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5160. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5161. return;
  5162. }
  5163. // Save state for POST action
  5164. stateHelper.setRepositoryPath(settings.repositoryPath);
  5165. // Initialize the repository
  5166. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5167. yield git.init();
  5168. yield git.remoteAdd('origin', repositoryUrl);
  5169. }
  5170. // Disable automatic garbage collection
  5171. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5172. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5173. }
  5174. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5175. try {
  5176. // Configure auth
  5177. yield authHelper.configureAuth();
  5178. // LFS install
  5179. if (settings.lfs) {
  5180. yield git.lfsInstall();
  5181. }
  5182. // Fetch
  5183. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5184. yield git.fetch(settings.fetchDepth, refSpec);
  5185. // Checkout info
  5186. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5187. // LFS fetch
  5188. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5189. // Explicit lfs fetch will fetch lfs objects in parallel.
  5190. if (settings.lfs) {
  5191. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5192. }
  5193. // Checkout
  5194. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5195. // Submodules
  5196. if (settings.submodules) {
  5197. try {
  5198. // Temporarily override global config
  5199. yield authHelper.configureGlobalAuth();
  5200. // Checkout submodules
  5201. yield git.submoduleSync(settings.nestedSubmodules);
  5202. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5203. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5204. // Persist credentials
  5205. if (settings.persistCredentials) {
  5206. yield authHelper.configureSubmoduleAuth();
  5207. }
  5208. }
  5209. finally {
  5210. // Remove temporary global config override
  5211. yield authHelper.removeGlobalAuth();
  5212. }
  5213. }
  5214. // Dump some info about the checked out commit
  5215. yield git.log1();
  5216. }
  5217. finally {
  5218. // Remove auth
  5219. if (!settings.persistCredentials) {
  5220. yield authHelper.removeAuth();
  5221. }
  5222. }
  5223. });
  5224. }
  5225. exports.getSource = getSource;
  5226. function cleanup(repositoryPath) {
  5227. return __awaiter(this, void 0, void 0, function* () {
  5228. // Repo exists?
  5229. if (!repositoryPath ||
  5230. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5231. return;
  5232. }
  5233. let git;
  5234. try {
  5235. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5236. }
  5237. catch (_a) {
  5238. return;
  5239. }
  5240. // Remove auth
  5241. const authHelper = gitAuthHelper.createAuthHelper(git);
  5242. yield authHelper.removeAuth();
  5243. });
  5244. }
  5245. exports.cleanup = cleanup;
  5246. function getGitCommandManager(settings) {
  5247. return __awaiter(this, void 0, void 0, function* () {
  5248. core.info(`Working directory is '${settings.repositoryPath}'`);
  5249. try {
  5250. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5251. }
  5252. catch (err) {
  5253. // Git is required for LFS
  5254. if (settings.lfs) {
  5255. throw err;
  5256. }
  5257. // Otherwise fallback to REST API
  5258. return undefined;
  5259. }
  5260. });
  5261. }
  5262. /***/ }),
  5263. /***/ 294:
  5264. /***/ (function(module, __unusedexports, __webpack_require__) {
  5265. module.exports = parseOptions;
  5266. const { Deprecation } = __webpack_require__(692);
  5267. const { getUserAgent } = __webpack_require__(796);
  5268. const once = __webpack_require__(969);
  5269. const pkg = __webpack_require__(215);
  5270. const deprecateOptionsTimeout = once((log, deprecation) =>
  5271. log.warn(deprecation)
  5272. );
  5273. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5274. const deprecateOptionsHeaders = once((log, deprecation) =>
  5275. log.warn(deprecation)
  5276. );
  5277. function parseOptions(options, log, hook) {
  5278. if (options.headers) {
  5279. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5280. newObj[key.toLowerCase()] = options.headers[key];
  5281. return newObj;
  5282. }, {});
  5283. }
  5284. const clientDefaults = {
  5285. headers: options.headers || {},
  5286. request: options.request || {},
  5287. mediaType: {
  5288. previews: [],
  5289. format: ""
  5290. }
  5291. };
  5292. if (options.baseUrl) {
  5293. clientDefaults.baseUrl = options.baseUrl;
  5294. }
  5295. if (options.userAgent) {
  5296. clientDefaults.headers["user-agent"] = options.userAgent;
  5297. }
  5298. if (options.previews) {
  5299. clientDefaults.mediaType.previews = options.previews;
  5300. }
  5301. if (options.timeZone) {
  5302. clientDefaults.headers["time-zone"] = options.timeZone;
  5303. }
  5304. if (options.timeout) {
  5305. deprecateOptionsTimeout(
  5306. log,
  5307. new Deprecation(
  5308. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5309. )
  5310. );
  5311. clientDefaults.request.timeout = options.timeout;
  5312. }
  5313. if (options.agent) {
  5314. deprecateOptionsAgent(
  5315. log,
  5316. new Deprecation(
  5317. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5318. )
  5319. );
  5320. clientDefaults.request.agent = options.agent;
  5321. }
  5322. if (options.headers) {
  5323. deprecateOptionsHeaders(
  5324. log,
  5325. new Deprecation(
  5326. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5327. )
  5328. );
  5329. }
  5330. const userAgentOption = clientDefaults.headers["user-agent"];
  5331. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5332. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5333. .filter(Boolean)
  5334. .join(" ");
  5335. clientDefaults.request.hook = hook.bind(null, "request");
  5336. return clientDefaults;
  5337. }
  5338. /***/ }),
  5339. /***/ 297:
  5340. /***/ (function(module) {
  5341. module.exports = class HttpError extends Error {
  5342. constructor (message, code, headers) {
  5343. super(message)
  5344. // Maintains proper stack trace (only available on V8)
  5345. /* istanbul ignore next */
  5346. if (Error.captureStackTrace) {
  5347. Error.captureStackTrace(this, this.constructor)
  5348. }
  5349. this.name = 'HttpError'
  5350. this.code = code
  5351. this.headers = headers
  5352. }
  5353. }
  5354. /***/ }),
  5355. /***/ 301:
  5356. /***/ (function(module, __unusedexports, __webpack_require__) {
  5357. /**
  5358. * Some “list” response that can be paginated have a different response structure
  5359. *
  5360. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5361. * /installation/repositories also has `repository_selection`), as well as a key with
  5362. * the list of the items which name varies from endpoint to endpoint:
  5363. *
  5364. * - https://developer.github.com/v3/search/#example (key `items`)
  5365. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5366. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5367. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5368. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5369. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5370. *
  5371. * Octokit normalizes these responses so that paginated results are always returned following
  5372. * the same structure. One challenge is that if the list response has only one page, no Link
  5373. * header is provided, so this header alone is not sufficient to check wether a response is
  5374. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5375. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5376. * property because it also exists in the response of Get the combined status for a specific ref.
  5377. */
  5378. module.exports = normalizePaginatedListResponse;
  5379. const { Deprecation } = __webpack_require__(692);
  5380. const once = __webpack_require__(969);
  5381. const deprecateIncompleteResults = once((log, deprecation) =>
  5382. log.warn(deprecation)
  5383. );
  5384. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5385. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5386. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5387. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5388. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5389. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5390. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5391. function normalizePaginatedListResponse(octokit, url, response) {
  5392. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5393. if (
  5394. !REGEX_IS_SEARCH_PATH.test(path) &&
  5395. !REGEX_IS_CHECKS_PATH.test(path) &&
  5396. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5397. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5398. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5399. ) {
  5400. return;
  5401. }
  5402. // keep the additional properties intact to avoid a breaking change,
  5403. // but log a deprecation warning when accessed
  5404. const incompleteResults = response.data.incomplete_results;
  5405. const repositorySelection = response.data.repository_selection;
  5406. const totalCount = response.data.total_count;
  5407. delete response.data.incomplete_results;
  5408. delete response.data.repository_selection;
  5409. delete response.data.total_count;
  5410. const namespaceKey = Object.keys(response.data)[0];
  5411. response.data = response.data[namespaceKey];
  5412. Object.defineProperty(response.data, namespaceKey, {
  5413. get() {
  5414. deprecateNamespace(
  5415. octokit.log,
  5416. new Deprecation(
  5417. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5418. )
  5419. );
  5420. return response.data;
  5421. }
  5422. });
  5423. if (typeof incompleteResults !== "undefined") {
  5424. Object.defineProperty(response.data, "incomplete_results", {
  5425. get() {
  5426. deprecateIncompleteResults(
  5427. octokit.log,
  5428. new Deprecation(
  5429. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5430. )
  5431. );
  5432. return incompleteResults;
  5433. }
  5434. });
  5435. }
  5436. if (typeof repositorySelection !== "undefined") {
  5437. Object.defineProperty(response.data, "repository_selection", {
  5438. get() {
  5439. deprecateTotalCount(
  5440. octokit.log,
  5441. new Deprecation(
  5442. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5443. )
  5444. );
  5445. return repositorySelection;
  5446. }
  5447. });
  5448. }
  5449. Object.defineProperty(response.data, "total_count", {
  5450. get() {
  5451. deprecateTotalCount(
  5452. octokit.log,
  5453. new Deprecation(
  5454. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5455. )
  5456. );
  5457. return totalCount;
  5458. }
  5459. });
  5460. }
  5461. /***/ }),
  5462. /***/ 323:
  5463. /***/ (function(module) {
  5464. "use strict";
  5465. var isStream = module.exports = function (stream) {
  5466. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5467. };
  5468. isStream.writable = function (stream) {
  5469. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5470. };
  5471. isStream.readable = function (stream) {
  5472. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5473. };
  5474. isStream.duplex = function (stream) {
  5475. return isStream.writable(stream) && isStream.readable(stream);
  5476. };
  5477. isStream.transform = function (stream) {
  5478. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5479. };
  5480. /***/ }),
  5481. /***/ 335:
  5482. /***/ (function(module, __unusedexports, __webpack_require__) {
  5483. module.exports = __webpack_require__(179);
  5484. /***/ }),
  5485. /***/ 336:
  5486. /***/ (function(module, __unusedexports, __webpack_require__) {
  5487. module.exports = hasLastPage
  5488. const deprecate = __webpack_require__(370)
  5489. const getPageLinks = __webpack_require__(577)
  5490. function hasLastPage (link) {
  5491. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5492. return getPageLinks(link).last
  5493. }
  5494. /***/ }),
  5495. /***/ 348:
  5496. /***/ (function(module, __unusedexports, __webpack_require__) {
  5497. "use strict";
  5498. module.exports = validate;
  5499. const { RequestError } = __webpack_require__(463);
  5500. const get = __webpack_require__(854);
  5501. const set = __webpack_require__(883);
  5502. function validate(octokit, options) {
  5503. if (!options.request.validate) {
  5504. return;
  5505. }
  5506. const { validate: params } = options.request;
  5507. Object.keys(params).forEach(parameterName => {
  5508. const parameter = get(params, parameterName);
  5509. const expectedType = parameter.type;
  5510. let parentParameterName;
  5511. let parentValue;
  5512. let parentParamIsPresent = true;
  5513. let parentParameterIsArray = false;
  5514. if (/\./.test(parameterName)) {
  5515. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5516. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5517. if (parentParameterIsArray) {
  5518. parentParameterName = parentParameterName.slice(0, -2);
  5519. }
  5520. parentValue = get(options, parentParameterName);
  5521. parentParamIsPresent =
  5522. parentParameterName === "headers" ||
  5523. (typeof parentValue === "object" && parentValue !== null);
  5524. }
  5525. const values = parentParameterIsArray
  5526. ? (get(options, parentParameterName) || []).map(
  5527. value => value[parameterName.split(/\./).pop()]
  5528. )
  5529. : [get(options, parameterName)];
  5530. values.forEach((value, i) => {
  5531. const valueIsPresent = typeof value !== "undefined";
  5532. const valueIsNull = value === null;
  5533. const currentParameterName = parentParameterIsArray
  5534. ? parameterName.replace(/\[\]/, `[${i}]`)
  5535. : parameterName;
  5536. if (!parameter.required && !valueIsPresent) {
  5537. return;
  5538. }
  5539. // if the parent parameter is of type object but allows null
  5540. // then the child parameters can be ignored
  5541. if (!parentParamIsPresent) {
  5542. return;
  5543. }
  5544. if (parameter.allowNull && valueIsNull) {
  5545. return;
  5546. }
  5547. if (!parameter.allowNull && valueIsNull) {
  5548. throw new RequestError(
  5549. `'${currentParameterName}' cannot be null`,
  5550. 400,
  5551. {
  5552. request: options
  5553. }
  5554. );
  5555. }
  5556. if (parameter.required && !valueIsPresent) {
  5557. throw new RequestError(
  5558. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5559. value
  5560. )}`,
  5561. 400,
  5562. {
  5563. request: options
  5564. }
  5565. );
  5566. }
  5567. // parse to integer before checking for enum
  5568. // so that string "1" will match enum with number 1
  5569. if (expectedType === "integer") {
  5570. const unparsedValue = value;
  5571. value = parseInt(value, 10);
  5572. if (isNaN(value)) {
  5573. throw new RequestError(
  5574. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5575. unparsedValue
  5576. )} is NaN`,
  5577. 400,
  5578. {
  5579. request: options
  5580. }
  5581. );
  5582. }
  5583. }
  5584. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5585. throw new RequestError(
  5586. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5587. value
  5588. )}`,
  5589. 400,
  5590. {
  5591. request: options
  5592. }
  5593. );
  5594. }
  5595. if (parameter.validation) {
  5596. const regex = new RegExp(parameter.validation);
  5597. if (!regex.test(value)) {
  5598. throw new RequestError(
  5599. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5600. value
  5601. )}`,
  5602. 400,
  5603. {
  5604. request: options
  5605. }
  5606. );
  5607. }
  5608. }
  5609. if (expectedType === "object" && typeof value === "string") {
  5610. try {
  5611. value = JSON.parse(value);
  5612. } catch (exception) {
  5613. throw new RequestError(
  5614. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5615. value
  5616. )}`,
  5617. 400,
  5618. {
  5619. request: options
  5620. }
  5621. );
  5622. }
  5623. }
  5624. set(options, parameter.mapTo || currentParameterName, value);
  5625. });
  5626. });
  5627. return options;
  5628. }
  5629. /***/ }),
  5630. /***/ 349:
  5631. /***/ (function(module, __unusedexports, __webpack_require__) {
  5632. module.exports = authenticationRequestError;
  5633. const { RequestError } = __webpack_require__(463);
  5634. function authenticationRequestError(state, error, options) {
  5635. /* istanbul ignore next */
  5636. if (!error.headers) throw error;
  5637. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5638. // handle "2FA required" error only
  5639. if (error.status !== 401 || !otpRequired) {
  5640. throw error;
  5641. }
  5642. if (
  5643. error.status === 401 &&
  5644. otpRequired &&
  5645. error.request &&
  5646. error.request.headers["x-github-otp"]
  5647. ) {
  5648. throw new RequestError(
  5649. "Invalid one-time password for two-factor authentication",
  5650. 401,
  5651. {
  5652. headers: error.headers,
  5653. request: options
  5654. }
  5655. );
  5656. }
  5657. if (typeof state.auth.on2fa !== "function") {
  5658. throw new RequestError(
  5659. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5660. 401,
  5661. {
  5662. headers: error.headers,
  5663. request: options
  5664. }
  5665. );
  5666. }
  5667. return Promise.resolve()
  5668. .then(() => {
  5669. return state.auth.on2fa();
  5670. })
  5671. .then(oneTimePassword => {
  5672. const newOptions = Object.assign(options, {
  5673. headers: Object.assign(
  5674. { "x-github-otp": oneTimePassword },
  5675. options.headers
  5676. )
  5677. });
  5678. return state.octokit.request(newOptions);
  5679. });
  5680. }
  5681. /***/ }),
  5682. /***/ 357:
  5683. /***/ (function(module) {
  5684. module.exports = require("assert");
  5685. /***/ }),
  5686. /***/ 363:
  5687. /***/ (function(module) {
  5688. module.exports = register
  5689. function register (state, name, method, options) {
  5690. if (typeof method !== 'function') {
  5691. throw new Error('method for before hook must be a function')
  5692. }
  5693. if (!options) {
  5694. options = {}
  5695. }
  5696. if (Array.isArray(name)) {
  5697. return name.reverse().reduce(function (callback, name) {
  5698. return register.bind(null, state, name, callback, options)
  5699. }, method)()
  5700. }
  5701. return Promise.resolve()
  5702. .then(function () {
  5703. if (!state.registry[name]) {
  5704. return method(options)
  5705. }
  5706. return (state.registry[name]).reduce(function (method, registered) {
  5707. return registered.hook.bind(null, method, options)
  5708. }, method)()
  5709. })
  5710. }
  5711. /***/ }),
  5712. /***/ 368:
  5713. /***/ (function(module) {
  5714. module.exports = function atob(str) {
  5715. return Buffer.from(str, 'base64').toString('binary')
  5716. }
  5717. /***/ }),
  5718. /***/ 370:
  5719. /***/ (function(module) {
  5720. module.exports = deprecate
  5721. const loggedMessages = {}
  5722. function deprecate (message) {
  5723. if (loggedMessages[message]) {
  5724. return
  5725. }
  5726. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5727. loggedMessages[message] = 1
  5728. }
  5729. /***/ }),
  5730. /***/ 372:
  5731. /***/ (function(module) {
  5732. module.exports = octokitDebug;
  5733. function octokitDebug(octokit) {
  5734. octokit.hook.wrap("request", (request, options) => {
  5735. octokit.log.debug("request", options);
  5736. const start = Date.now();
  5737. const requestOptions = octokit.request.endpoint.parse(options);
  5738. const path = requestOptions.url.replace(options.baseUrl, "");
  5739. return request(options)
  5740. .then(response => {
  5741. octokit.log.info(
  5742. `${requestOptions.method} ${path} - ${
  5743. response.status
  5744. } in ${Date.now() - start}ms`
  5745. );
  5746. return response;
  5747. })
  5748. .catch(error => {
  5749. octokit.log.info(
  5750. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5751. start}ms`
  5752. );
  5753. throw error;
  5754. });
  5755. });
  5756. }
  5757. /***/ }),
  5758. /***/ 385:
  5759. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5760. "use strict";
  5761. Object.defineProperty(exports, '__esModule', { value: true });
  5762. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5763. var isPlainObject = _interopDefault(__webpack_require__(696));
  5764. var universalUserAgent = __webpack_require__(796);
  5765. function lowercaseKeys(object) {
  5766. if (!object) {
  5767. return {};
  5768. }
  5769. return Object.keys(object).reduce((newObj, key) => {
  5770. newObj[key.toLowerCase()] = object[key];
  5771. return newObj;
  5772. }, {});
  5773. }
  5774. function mergeDeep(defaults, options) {
  5775. const result = Object.assign({}, defaults);
  5776. Object.keys(options).forEach(key => {
  5777. if (isPlainObject(options[key])) {
  5778. if (!(key in defaults)) Object.assign(result, {
  5779. [key]: options[key]
  5780. });else result[key] = mergeDeep(defaults[key], options[key]);
  5781. } else {
  5782. Object.assign(result, {
  5783. [key]: options[key]
  5784. });
  5785. }
  5786. });
  5787. return result;
  5788. }
  5789. function merge(defaults, route, options) {
  5790. if (typeof route === "string") {
  5791. let [method, url] = route.split(" ");
  5792. options = Object.assign(url ? {
  5793. method,
  5794. url
  5795. } : {
  5796. url: method
  5797. }, options);
  5798. } else {
  5799. options = Object.assign({}, route);
  5800. } // lowercase header names before merging with defaults to avoid duplicates
  5801. options.headers = lowercaseKeys(options.headers);
  5802. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5803. if (defaults && defaults.mediaType.previews.length) {
  5804. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5805. }
  5806. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5807. return mergedOptions;
  5808. }
  5809. function addQueryParameters(url, parameters) {
  5810. const separator = /\?/.test(url) ? "&" : "?";
  5811. const names = Object.keys(parameters);
  5812. if (names.length === 0) {
  5813. return url;
  5814. }
  5815. return url + separator + names.map(name => {
  5816. if (name === "q") {
  5817. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5818. }
  5819. return `${name}=${encodeURIComponent(parameters[name])}`;
  5820. }).join("&");
  5821. }
  5822. const urlVariableRegex = /\{[^}]+\}/g;
  5823. function removeNonChars(variableName) {
  5824. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5825. }
  5826. function extractUrlVariableNames(url) {
  5827. const matches = url.match(urlVariableRegex);
  5828. if (!matches) {
  5829. return [];
  5830. }
  5831. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5832. }
  5833. function omit(object, keysToOmit) {
  5834. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5835. obj[key] = object[key];
  5836. return obj;
  5837. }, {});
  5838. }
  5839. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5840. // TODO: create separate package.
  5841. //
  5842. // Copyright (c) 2012-2014, Bram Stein
  5843. // All rights reserved.
  5844. // Redistribution and use in source and binary forms, with or without
  5845. // modification, are permitted provided that the following conditions
  5846. // are met:
  5847. // 1. Redistributions of source code must retain the above copyright
  5848. // notice, this list of conditions and the following disclaimer.
  5849. // 2. Redistributions in binary form must reproduce the above copyright
  5850. // notice, this list of conditions and the following disclaimer in the
  5851. // documentation and/or other materials provided with the distribution.
  5852. // 3. The name of the author may not be used to endorse or promote products
  5853. // derived from this software without specific prior written permission.
  5854. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5855. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5856. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5857. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5858. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5859. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5860. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5861. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5862. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5863. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5864. /* istanbul ignore file */
  5865. function encodeReserved(str) {
  5866. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5867. if (!/%[0-9A-Fa-f]/.test(part)) {
  5868. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5869. }
  5870. return part;
  5871. }).join("");
  5872. }
  5873. function encodeUnreserved(str) {
  5874. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5875. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5876. });
  5877. }
  5878. function encodeValue(operator, value, key) {
  5879. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5880. if (key) {
  5881. return encodeUnreserved(key) + "=" + value;
  5882. } else {
  5883. return value;
  5884. }
  5885. }
  5886. function isDefined(value) {
  5887. return value !== undefined && value !== null;
  5888. }
  5889. function isKeyOperator(operator) {
  5890. return operator === ";" || operator === "&" || operator === "?";
  5891. }
  5892. function getValues(context, operator, key, modifier) {
  5893. var value = context[key],
  5894. result = [];
  5895. if (isDefined(value) && value !== "") {
  5896. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5897. value = value.toString();
  5898. if (modifier && modifier !== "*") {
  5899. value = value.substring(0, parseInt(modifier, 10));
  5900. }
  5901. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5902. } else {
  5903. if (modifier === "*") {
  5904. if (Array.isArray(value)) {
  5905. value.filter(isDefined).forEach(function (value) {
  5906. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5907. });
  5908. } else {
  5909. Object.keys(value).forEach(function (k) {
  5910. if (isDefined(value[k])) {
  5911. result.push(encodeValue(operator, value[k], k));
  5912. }
  5913. });
  5914. }
  5915. } else {
  5916. const tmp = [];
  5917. if (Array.isArray(value)) {
  5918. value.filter(isDefined).forEach(function (value) {
  5919. tmp.push(encodeValue(operator, value));
  5920. });
  5921. } else {
  5922. Object.keys(value).forEach(function (k) {
  5923. if (isDefined(value[k])) {
  5924. tmp.push(encodeUnreserved(k));
  5925. tmp.push(encodeValue(operator, value[k].toString()));
  5926. }
  5927. });
  5928. }
  5929. if (isKeyOperator(operator)) {
  5930. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5931. } else if (tmp.length !== 0) {
  5932. result.push(tmp.join(","));
  5933. }
  5934. }
  5935. }
  5936. } else {
  5937. if (operator === ";") {
  5938. if (isDefined(value)) {
  5939. result.push(encodeUnreserved(key));
  5940. }
  5941. } else if (value === "" && (operator === "&" || operator === "?")) {
  5942. result.push(encodeUnreserved(key) + "=");
  5943. } else if (value === "") {
  5944. result.push("");
  5945. }
  5946. }
  5947. return result;
  5948. }
  5949. function parseUrl(template) {
  5950. return {
  5951. expand: expand.bind(null, template)
  5952. };
  5953. }
  5954. function expand(template, context) {
  5955. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5956. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5957. if (expression) {
  5958. let operator = "";
  5959. const values = [];
  5960. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5961. operator = expression.charAt(0);
  5962. expression = expression.substr(1);
  5963. }
  5964. expression.split(/,/g).forEach(function (variable) {
  5965. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5966. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5967. });
  5968. if (operator && operator !== "+") {
  5969. var separator = ",";
  5970. if (operator === "?") {
  5971. separator = "&";
  5972. } else if (operator !== "#") {
  5973. separator = operator;
  5974. }
  5975. return (values.length !== 0 ? operator : "") + values.join(separator);
  5976. } else {
  5977. return values.join(",");
  5978. }
  5979. } else {
  5980. return encodeReserved(literal);
  5981. }
  5982. });
  5983. }
  5984. function parse(options) {
  5985. // https://fetch.spec.whatwg.org/#methods
  5986. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5987. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5988. let headers = Object.assign({}, options.headers);
  5989. let body;
  5990. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5991. const urlVariableNames = extractUrlVariableNames(url);
  5992. url = parseUrl(url).expand(parameters);
  5993. if (!/^http/.test(url)) {
  5994. url = options.baseUrl + url;
  5995. }
  5996. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5997. const remainingParameters = omit(parameters, omittedParameters);
  5998. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5999. if (!isBinaryRequset) {
  6000. if (options.mediaType.format) {
  6001. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6002. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6003. }
  6004. if (options.mediaType.previews.length) {
  6005. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6006. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6007. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6008. return `application/vnd.github.${preview}-preview${format}`;
  6009. }).join(",");
  6010. }
  6011. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6012. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6013. if (["GET", "HEAD"].includes(method)) {
  6014. url = addQueryParameters(url, remainingParameters);
  6015. } else {
  6016. if ("data" in remainingParameters) {
  6017. body = remainingParameters.data;
  6018. } else {
  6019. if (Object.keys(remainingParameters).length) {
  6020. body = remainingParameters;
  6021. } else {
  6022. headers["content-length"] = 0;
  6023. }
  6024. }
  6025. } // default content-type for JSON if body is set
  6026. if (!headers["content-type"] && typeof body !== "undefined") {
  6027. headers["content-type"] = "application/json; charset=utf-8";
  6028. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6029. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6030. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6031. body = "";
  6032. } // Only return body/request keys if present
  6033. return Object.assign({
  6034. method,
  6035. url,
  6036. headers
  6037. }, typeof body !== "undefined" ? {
  6038. body
  6039. } : null, options.request ? {
  6040. request: options.request
  6041. } : null);
  6042. }
  6043. function endpointWithDefaults(defaults, route, options) {
  6044. return parse(merge(defaults, route, options));
  6045. }
  6046. function withDefaults(oldDefaults, newDefaults) {
  6047. const DEFAULTS = merge(oldDefaults, newDefaults);
  6048. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6049. return Object.assign(endpoint, {
  6050. DEFAULTS,
  6051. defaults: withDefaults.bind(null, DEFAULTS),
  6052. merge: merge.bind(null, DEFAULTS),
  6053. parse
  6054. });
  6055. }
  6056. const VERSION = "5.5.1";
  6057. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6058. // So we use RequestParameters and add method as additional required property.
  6059. const DEFAULTS = {
  6060. method: "GET",
  6061. baseUrl: "https://api.github.com",
  6062. headers: {
  6063. accept: "application/vnd.github.v3+json",
  6064. "user-agent": userAgent
  6065. },
  6066. mediaType: {
  6067. format: "",
  6068. previews: []
  6069. }
  6070. };
  6071. const endpoint = withDefaults(null, DEFAULTS);
  6072. exports.endpoint = endpoint;
  6073. //# sourceMappingURL=index.js.map
  6074. /***/ }),
  6075. /***/ 389:
  6076. /***/ (function(module, __unusedexports, __webpack_require__) {
  6077. "use strict";
  6078. const fs = __webpack_require__(747);
  6079. const shebangCommand = __webpack_require__(866);
  6080. function readShebang(command) {
  6081. // Read the first 150 bytes from the file
  6082. const size = 150;
  6083. let buffer;
  6084. if (Buffer.alloc) {
  6085. // Node.js v4.5+ / v5.10+
  6086. buffer = Buffer.alloc(size);
  6087. } else {
  6088. // Old Node.js API
  6089. buffer = new Buffer(size);
  6090. buffer.fill(0); // zero-fill
  6091. }
  6092. let fd;
  6093. try {
  6094. fd = fs.openSync(command, 'r');
  6095. fs.readSync(fd, buffer, 0, size, 0);
  6096. fs.closeSync(fd);
  6097. } catch (e) { /* Empty */ }
  6098. // Attempt to extract shebang (null is returned if not a shebang)
  6099. return shebangCommand(buffer.toString());
  6100. }
  6101. module.exports = readShebang;
  6102. /***/ }),
  6103. /***/ 402:
  6104. /***/ (function(module, __unusedexports, __webpack_require__) {
  6105. module.exports = Octokit;
  6106. const { request } = __webpack_require__(753);
  6107. const Hook = __webpack_require__(523);
  6108. const parseClientOptions = __webpack_require__(294);
  6109. function Octokit(plugins, options) {
  6110. options = options || {};
  6111. const hook = new Hook.Collection();
  6112. const log = Object.assign(
  6113. {
  6114. debug: () => {},
  6115. info: () => {},
  6116. warn: console.warn,
  6117. error: console.error
  6118. },
  6119. options && options.log
  6120. );
  6121. const api = {
  6122. hook,
  6123. log,
  6124. request: request.defaults(parseClientOptions(options, log, hook))
  6125. };
  6126. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6127. return api;
  6128. }
  6129. /***/ }),
  6130. /***/ 413:
  6131. /***/ (function(module) {
  6132. module.exports = require("stream");
  6133. /***/ }),
  6134. /***/ 417:
  6135. /***/ (function(module) {
  6136. module.exports = require("crypto");
  6137. /***/ }),
  6138. /***/ 427:
  6139. /***/ (function(module, __unusedexports, __webpack_require__) {
  6140. "use strict";
  6141. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6142. // In that case, fall back to a deprecated internal.
  6143. const util = __webpack_require__(669);
  6144. let uv;
  6145. if (typeof util.getSystemErrorName === 'function') {
  6146. module.exports = util.getSystemErrorName;
  6147. } else {
  6148. try {
  6149. uv = process.binding('uv');
  6150. if (typeof uv.errname !== 'function') {
  6151. throw new TypeError('uv.errname is not a function');
  6152. }
  6153. } catch (err) {
  6154. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6155. uv = null;
  6156. }
  6157. module.exports = code => errname(uv, code);
  6158. }
  6159. // Used for testing the fallback behavior
  6160. module.exports.__test__ = errname;
  6161. function errname(uv, code) {
  6162. if (uv) {
  6163. return uv.errname(code);
  6164. }
  6165. if (!(code < 0)) {
  6166. throw new Error('err >= 0');
  6167. }
  6168. return `Unknown system error ${code}`;
  6169. }
  6170. /***/ }),
  6171. /***/ 430:
  6172. /***/ (function(module, __unusedexports, __webpack_require__) {
  6173. module.exports = octokitValidate;
  6174. const validate = __webpack_require__(348);
  6175. function octokitValidate(octokit) {
  6176. octokit.hook.before("request", validate.bind(null, octokit));
  6177. }
  6178. /***/ }),
  6179. /***/ 431:
  6180. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6181. "use strict";
  6182. Object.defineProperty(exports, "__esModule", { value: true });
  6183. const os = __webpack_require__(87);
  6184. /**
  6185. * Commands
  6186. *
  6187. * Command Format:
  6188. * ##[name key=value;key=value]message
  6189. *
  6190. * Examples:
  6191. * ##[warning]This is the user warning message
  6192. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6193. */
  6194. function issueCommand(command, properties, message) {
  6195. const cmd = new Command(command, properties, message);
  6196. process.stdout.write(cmd.toString() + os.EOL);
  6197. }
  6198. exports.issueCommand = issueCommand;
  6199. function issue(name, message = '') {
  6200. issueCommand(name, {}, message);
  6201. }
  6202. exports.issue = issue;
  6203. const CMD_STRING = '::';
  6204. class Command {
  6205. constructor(command, properties, message) {
  6206. if (!command) {
  6207. command = 'missing.command';
  6208. }
  6209. this.command = command;
  6210. this.properties = properties;
  6211. this.message = message;
  6212. }
  6213. toString() {
  6214. let cmdStr = CMD_STRING + this.command;
  6215. if (this.properties && Object.keys(this.properties).length > 0) {
  6216. cmdStr += ' ';
  6217. for (const key in this.properties) {
  6218. if (this.properties.hasOwnProperty(key)) {
  6219. const val = this.properties[key];
  6220. if (val) {
  6221. // safely append the val - avoid blowing up when attempting to
  6222. // call .replace() if message is not a string for some reason
  6223. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6224. }
  6225. }
  6226. }
  6227. }
  6228. cmdStr += CMD_STRING;
  6229. // safely append the message - avoid blowing up when attempting to
  6230. // call .replace() if message is not a string for some reason
  6231. const message = `${this.message || ''}`;
  6232. cmdStr += escapeData(message);
  6233. return cmdStr;
  6234. }
  6235. }
  6236. function escapeData(s) {
  6237. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6238. }
  6239. function escape(s) {
  6240. return s
  6241. .replace(/\r/g, '%0D')
  6242. .replace(/\n/g, '%0A')
  6243. .replace(/]/g, '%5D')
  6244. .replace(/;/g, '%3B');
  6245. }
  6246. //# sourceMappingURL=command.js.map
  6247. /***/ }),
  6248. /***/ 438:
  6249. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6250. "use strict";
  6251. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6252. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6253. return new (P || (P = Promise))(function (resolve, reject) {
  6254. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6255. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6256. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6257. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6258. });
  6259. };
  6260. var __importStar = (this && this.__importStar) || function (mod) {
  6261. if (mod && mod.__esModule) return mod;
  6262. var result = {};
  6263. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6264. result["default"] = mod;
  6265. return result;
  6266. };
  6267. Object.defineProperty(exports, "__esModule", { value: true });
  6268. const core = __importStar(__webpack_require__(470));
  6269. const fs = __importStar(__webpack_require__(747));
  6270. const fsHelper = __importStar(__webpack_require__(618));
  6271. const io = __importStar(__webpack_require__(1));
  6272. const path = __importStar(__webpack_require__(622));
  6273. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  6274. return __awaiter(this, void 0, void 0, function* () {
  6275. let remove = false;
  6276. // Check whether using git or REST API
  6277. if (!git) {
  6278. remove = true;
  6279. }
  6280. // Fetch URL does not match
  6281. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6282. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6283. remove = true;
  6284. }
  6285. else {
  6286. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6287. const lockPaths = [
  6288. path.join(repositoryPath, '.git', 'index.lock'),
  6289. path.join(repositoryPath, '.git', 'shallow.lock')
  6290. ];
  6291. for (const lockPath of lockPaths) {
  6292. try {
  6293. yield io.rmRF(lockPath);
  6294. }
  6295. catch (error) {
  6296. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6297. }
  6298. }
  6299. try {
  6300. // Checkout detached HEAD
  6301. if (!(yield git.isDetached())) {
  6302. yield git.checkoutDetach();
  6303. }
  6304. // Remove all refs/heads/*
  6305. let branches = yield git.branchList(false);
  6306. for (const branch of branches) {
  6307. yield git.branchDelete(false, branch);
  6308. }
  6309. // Remove all refs/remotes/origin/* to avoid conflicts
  6310. branches = yield git.branchList(true);
  6311. for (const branch of branches) {
  6312. yield git.branchDelete(true, branch);
  6313. }
  6314. // Clean
  6315. if (clean) {
  6316. if (!(yield git.tryClean())) {
  6317. 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}'.`);
  6318. remove = true;
  6319. }
  6320. else if (!(yield git.tryReset())) {
  6321. remove = true;
  6322. }
  6323. if (remove) {
  6324. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6325. }
  6326. }
  6327. }
  6328. catch (error) {
  6329. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6330. remove = true;
  6331. }
  6332. }
  6333. if (remove) {
  6334. // Delete the contents of the directory. Don't delete the directory itself
  6335. // since it might be the current working directory.
  6336. core.info(`Deleting the contents of '${repositoryPath}'`);
  6337. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6338. yield io.rmRF(path.join(repositoryPath, file));
  6339. }
  6340. }
  6341. });
  6342. }
  6343. exports.prepareExistingDirectory = prepareExistingDirectory;
  6344. /***/ }),
  6345. /***/ 453:
  6346. /***/ (function(module, __unusedexports, __webpack_require__) {
  6347. var once = __webpack_require__(969)
  6348. var eos = __webpack_require__(562)
  6349. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6350. var noop = function () {}
  6351. var ancient = /^v?\.0/.test(process.version)
  6352. var isFn = function (fn) {
  6353. return typeof fn === 'function'
  6354. }
  6355. var isFS = function (stream) {
  6356. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6357. if (!fs) return false // browser
  6358. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6359. }
  6360. var isRequest = function (stream) {
  6361. return stream.setHeader && isFn(stream.abort)
  6362. }
  6363. var destroyer = function (stream, reading, writing, callback) {
  6364. callback = once(callback)
  6365. var closed = false
  6366. stream.on('close', function () {
  6367. closed = true
  6368. })
  6369. eos(stream, {readable: reading, writable: writing}, function (err) {
  6370. if (err) return callback(err)
  6371. closed = true
  6372. callback()
  6373. })
  6374. var destroyed = false
  6375. return function (err) {
  6376. if (closed) return
  6377. if (destroyed) return
  6378. destroyed = true
  6379. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6380. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6381. if (isFn(stream.destroy)) return stream.destroy()
  6382. callback(err || new Error('stream was destroyed'))
  6383. }
  6384. }
  6385. var call = function (fn) {
  6386. fn()
  6387. }
  6388. var pipe = function (from, to) {
  6389. return from.pipe(to)
  6390. }
  6391. var pump = function () {
  6392. var streams = Array.prototype.slice.call(arguments)
  6393. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6394. if (Array.isArray(streams[0])) streams = streams[0]
  6395. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6396. var error
  6397. var destroys = streams.map(function (stream, i) {
  6398. var reading = i < streams.length - 1
  6399. var writing = i > 0
  6400. return destroyer(stream, reading, writing, function (err) {
  6401. if (!error) error = err
  6402. if (err) destroys.forEach(call)
  6403. if (reading) return
  6404. destroys.forEach(call)
  6405. callback(error)
  6406. })
  6407. })
  6408. return streams.reduce(pipe)
  6409. }
  6410. module.exports = pump
  6411. /***/ }),
  6412. /***/ 454:
  6413. /***/ (function(module, exports, __webpack_require__) {
  6414. "use strict";
  6415. Object.defineProperty(exports, '__esModule', { value: true });
  6416. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6417. var Stream = _interopDefault(__webpack_require__(413));
  6418. var http = _interopDefault(__webpack_require__(605));
  6419. var Url = _interopDefault(__webpack_require__(835));
  6420. var https = _interopDefault(__webpack_require__(211));
  6421. var zlib = _interopDefault(__webpack_require__(761));
  6422. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6423. // fix for "Readable" isn't a named export issue
  6424. const Readable = Stream.Readable;
  6425. const BUFFER = Symbol('buffer');
  6426. const TYPE = Symbol('type');
  6427. class Blob {
  6428. constructor() {
  6429. this[TYPE] = '';
  6430. const blobParts = arguments[0];
  6431. const options = arguments[1];
  6432. const buffers = [];
  6433. let size = 0;
  6434. if (blobParts) {
  6435. const a = blobParts;
  6436. const length = Number(a.length);
  6437. for (let i = 0; i < length; i++) {
  6438. const element = a[i];
  6439. let buffer;
  6440. if (element instanceof Buffer) {
  6441. buffer = element;
  6442. } else if (ArrayBuffer.isView(element)) {
  6443. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6444. } else if (element instanceof ArrayBuffer) {
  6445. buffer = Buffer.from(element);
  6446. } else if (element instanceof Blob) {
  6447. buffer = element[BUFFER];
  6448. } else {
  6449. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6450. }
  6451. size += buffer.length;
  6452. buffers.push(buffer);
  6453. }
  6454. }
  6455. this[BUFFER] = Buffer.concat(buffers);
  6456. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6457. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6458. this[TYPE] = type;
  6459. }
  6460. }
  6461. get size() {
  6462. return this[BUFFER].length;
  6463. }
  6464. get type() {
  6465. return this[TYPE];
  6466. }
  6467. text() {
  6468. return Promise.resolve(this[BUFFER].toString());
  6469. }
  6470. arrayBuffer() {
  6471. const buf = this[BUFFER];
  6472. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6473. return Promise.resolve(ab);
  6474. }
  6475. stream() {
  6476. const readable = new Readable();
  6477. readable._read = function () {};
  6478. readable.push(this[BUFFER]);
  6479. readable.push(null);
  6480. return readable;
  6481. }
  6482. toString() {
  6483. return '[object Blob]';
  6484. }
  6485. slice() {
  6486. const size = this.size;
  6487. const start = arguments[0];
  6488. const end = arguments[1];
  6489. let relativeStart, relativeEnd;
  6490. if (start === undefined) {
  6491. relativeStart = 0;
  6492. } else if (start < 0) {
  6493. relativeStart = Math.max(size + start, 0);
  6494. } else {
  6495. relativeStart = Math.min(start, size);
  6496. }
  6497. if (end === undefined) {
  6498. relativeEnd = size;
  6499. } else if (end < 0) {
  6500. relativeEnd = Math.max(size + end, 0);
  6501. } else {
  6502. relativeEnd = Math.min(end, size);
  6503. }
  6504. const span = Math.max(relativeEnd - relativeStart, 0);
  6505. const buffer = this[BUFFER];
  6506. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6507. const blob = new Blob([], { type: arguments[2] });
  6508. blob[BUFFER] = slicedBuffer;
  6509. return blob;
  6510. }
  6511. }
  6512. Object.defineProperties(Blob.prototype, {
  6513. size: { enumerable: true },
  6514. type: { enumerable: true },
  6515. slice: { enumerable: true }
  6516. });
  6517. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6518. value: 'Blob',
  6519. writable: false,
  6520. enumerable: false,
  6521. configurable: true
  6522. });
  6523. /**
  6524. * fetch-error.js
  6525. *
  6526. * FetchError interface for operational errors
  6527. */
  6528. /**
  6529. * Create FetchError instance
  6530. *
  6531. * @param String message Error message for human
  6532. * @param String type Error type for machine
  6533. * @param String systemError For Node.js system error
  6534. * @return FetchError
  6535. */
  6536. function FetchError(message, type, systemError) {
  6537. Error.call(this, message);
  6538. this.message = message;
  6539. this.type = type;
  6540. // when err.type is `system`, err.code contains system error code
  6541. if (systemError) {
  6542. this.code = this.errno = systemError.code;
  6543. }
  6544. // hide custom error implementation details from end-users
  6545. Error.captureStackTrace(this, this.constructor);
  6546. }
  6547. FetchError.prototype = Object.create(Error.prototype);
  6548. FetchError.prototype.constructor = FetchError;
  6549. FetchError.prototype.name = 'FetchError';
  6550. let convert;
  6551. try {
  6552. convert = __webpack_require__(18).convert;
  6553. } catch (e) {}
  6554. const INTERNALS = Symbol('Body internals');
  6555. // fix an issue where "PassThrough" isn't a named export for node <10
  6556. const PassThrough = Stream.PassThrough;
  6557. /**
  6558. * Body mixin
  6559. *
  6560. * Ref: https://fetch.spec.whatwg.org/#body
  6561. *
  6562. * @param Stream body Readable stream
  6563. * @param Object opts Response options
  6564. * @return Void
  6565. */
  6566. function Body(body) {
  6567. var _this = this;
  6568. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6569. _ref$size = _ref.size;
  6570. let size = _ref$size === undefined ? 0 : _ref$size;
  6571. var _ref$timeout = _ref.timeout;
  6572. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6573. if (body == null) {
  6574. // body is undefined or null
  6575. body = null;
  6576. } else if (isURLSearchParams(body)) {
  6577. // body is a URLSearchParams
  6578. body = Buffer.from(body.toString());
  6579. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6580. // body is ArrayBuffer
  6581. body = Buffer.from(body);
  6582. } else if (ArrayBuffer.isView(body)) {
  6583. // body is ArrayBufferView
  6584. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6585. } else if (body instanceof Stream) ; else {
  6586. // none of the above
  6587. // coerce to string then buffer
  6588. body = Buffer.from(String(body));
  6589. }
  6590. this[INTERNALS] = {
  6591. body,
  6592. disturbed: false,
  6593. error: null
  6594. };
  6595. this.size = size;
  6596. this.timeout = timeout;
  6597. if (body instanceof Stream) {
  6598. body.on('error', function (err) {
  6599. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6600. _this[INTERNALS].error = error;
  6601. });
  6602. }
  6603. }
  6604. Body.prototype = {
  6605. get body() {
  6606. return this[INTERNALS].body;
  6607. },
  6608. get bodyUsed() {
  6609. return this[INTERNALS].disturbed;
  6610. },
  6611. /**
  6612. * Decode response as ArrayBuffer
  6613. *
  6614. * @return Promise
  6615. */
  6616. arrayBuffer() {
  6617. return consumeBody.call(this).then(function (buf) {
  6618. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6619. });
  6620. },
  6621. /**
  6622. * Return raw response as Blob
  6623. *
  6624. * @return Promise
  6625. */
  6626. blob() {
  6627. let ct = this.headers && this.headers.get('content-type') || '';
  6628. return consumeBody.call(this).then(function (buf) {
  6629. return Object.assign(
  6630. // Prevent copying
  6631. new Blob([], {
  6632. type: ct.toLowerCase()
  6633. }), {
  6634. [BUFFER]: buf
  6635. });
  6636. });
  6637. },
  6638. /**
  6639. * Decode response as json
  6640. *
  6641. * @return Promise
  6642. */
  6643. json() {
  6644. var _this2 = this;
  6645. return consumeBody.call(this).then(function (buffer) {
  6646. try {
  6647. return JSON.parse(buffer.toString());
  6648. } catch (err) {
  6649. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6650. }
  6651. });
  6652. },
  6653. /**
  6654. * Decode response as text
  6655. *
  6656. * @return Promise
  6657. */
  6658. text() {
  6659. return consumeBody.call(this).then(function (buffer) {
  6660. return buffer.toString();
  6661. });
  6662. },
  6663. /**
  6664. * Decode response as buffer (non-spec api)
  6665. *
  6666. * @return Promise
  6667. */
  6668. buffer() {
  6669. return consumeBody.call(this);
  6670. },
  6671. /**
  6672. * Decode response as text, while automatically detecting the encoding and
  6673. * trying to decode to UTF-8 (non-spec api)
  6674. *
  6675. * @return Promise
  6676. */
  6677. textConverted() {
  6678. var _this3 = this;
  6679. return consumeBody.call(this).then(function (buffer) {
  6680. return convertBody(buffer, _this3.headers);
  6681. });
  6682. }
  6683. };
  6684. // In browsers, all properties are enumerable.
  6685. Object.defineProperties(Body.prototype, {
  6686. body: { enumerable: true },
  6687. bodyUsed: { enumerable: true },
  6688. arrayBuffer: { enumerable: true },
  6689. blob: { enumerable: true },
  6690. json: { enumerable: true },
  6691. text: { enumerable: true }
  6692. });
  6693. Body.mixIn = function (proto) {
  6694. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6695. // istanbul ignore else: future proof
  6696. if (!(name in proto)) {
  6697. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6698. Object.defineProperty(proto, name, desc);
  6699. }
  6700. }
  6701. };
  6702. /**
  6703. * Consume and convert an entire Body to a Buffer.
  6704. *
  6705. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6706. *
  6707. * @return Promise
  6708. */
  6709. function consumeBody() {
  6710. var _this4 = this;
  6711. if (this[INTERNALS].disturbed) {
  6712. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6713. }
  6714. this[INTERNALS].disturbed = true;
  6715. if (this[INTERNALS].error) {
  6716. return Body.Promise.reject(this[INTERNALS].error);
  6717. }
  6718. let body = this.body;
  6719. // body is null
  6720. if (body === null) {
  6721. return Body.Promise.resolve(Buffer.alloc(0));
  6722. }
  6723. // body is blob
  6724. if (isBlob(body)) {
  6725. body = body.stream();
  6726. }
  6727. // body is buffer
  6728. if (Buffer.isBuffer(body)) {
  6729. return Body.Promise.resolve(body);
  6730. }
  6731. // istanbul ignore if: should never happen
  6732. if (!(body instanceof Stream)) {
  6733. return Body.Promise.resolve(Buffer.alloc(0));
  6734. }
  6735. // body is stream
  6736. // get ready to actually consume the body
  6737. let accum = [];
  6738. let accumBytes = 0;
  6739. let abort = false;
  6740. return new Body.Promise(function (resolve, reject) {
  6741. let resTimeout;
  6742. // allow timeout on slow response body
  6743. if (_this4.timeout) {
  6744. resTimeout = setTimeout(function () {
  6745. abort = true;
  6746. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6747. }, _this4.timeout);
  6748. }
  6749. // handle stream errors
  6750. body.on('error', function (err) {
  6751. if (err.name === 'AbortError') {
  6752. // if the request was aborted, reject with this Error
  6753. abort = true;
  6754. reject(err);
  6755. } else {
  6756. // other errors, such as incorrect content-encoding
  6757. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6758. }
  6759. });
  6760. body.on('data', function (chunk) {
  6761. if (abort || chunk === null) {
  6762. return;
  6763. }
  6764. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6765. abort = true;
  6766. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6767. return;
  6768. }
  6769. accumBytes += chunk.length;
  6770. accum.push(chunk);
  6771. });
  6772. body.on('end', function () {
  6773. if (abort) {
  6774. return;
  6775. }
  6776. clearTimeout(resTimeout);
  6777. try {
  6778. resolve(Buffer.concat(accum, accumBytes));
  6779. } catch (err) {
  6780. // handle streams that have accumulated too much data (issue #414)
  6781. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6782. }
  6783. });
  6784. });
  6785. }
  6786. /**
  6787. * Detect buffer encoding and convert to target encoding
  6788. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6789. *
  6790. * @param Buffer buffer Incoming buffer
  6791. * @param String encoding Target encoding
  6792. * @return String
  6793. */
  6794. function convertBody(buffer, headers) {
  6795. if (typeof convert !== 'function') {
  6796. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6797. }
  6798. const ct = headers.get('content-type');
  6799. let charset = 'utf-8';
  6800. let res, str;
  6801. // header
  6802. if (ct) {
  6803. res = /charset=([^;]*)/i.exec(ct);
  6804. }
  6805. // no charset in content type, peek at response body for at most 1024 bytes
  6806. str = buffer.slice(0, 1024).toString();
  6807. // html5
  6808. if (!res && str) {
  6809. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6810. }
  6811. // html4
  6812. if (!res && str) {
  6813. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6814. if (res) {
  6815. res = /charset=(.*)/i.exec(res.pop());
  6816. }
  6817. }
  6818. // xml
  6819. if (!res && str) {
  6820. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6821. }
  6822. // found charset
  6823. if (res) {
  6824. charset = res.pop();
  6825. // prevent decode issues when sites use incorrect encoding
  6826. // ref: https://hsivonen.fi/encoding-menu/
  6827. if (charset === 'gb2312' || charset === 'gbk') {
  6828. charset = 'gb18030';
  6829. }
  6830. }
  6831. // turn raw buffers into a single utf-8 buffer
  6832. return convert(buffer, 'UTF-8', charset).toString();
  6833. }
  6834. /**
  6835. * Detect a URLSearchParams object
  6836. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6837. *
  6838. * @param Object obj Object to detect by type or brand
  6839. * @return String
  6840. */
  6841. function isURLSearchParams(obj) {
  6842. // Duck-typing as a necessary condition.
  6843. 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') {
  6844. return false;
  6845. }
  6846. // Brand-checking and more duck-typing as optional condition.
  6847. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6848. }
  6849. /**
  6850. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6851. * @param {*} obj
  6852. * @return {boolean}
  6853. */
  6854. function isBlob(obj) {
  6855. 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]);
  6856. }
  6857. /**
  6858. * Clone body given Res/Req instance
  6859. *
  6860. * @param Mixed instance Response or Request instance
  6861. * @return Mixed
  6862. */
  6863. function clone(instance) {
  6864. let p1, p2;
  6865. let body = instance.body;
  6866. // don't allow cloning a used body
  6867. if (instance.bodyUsed) {
  6868. throw new Error('cannot clone body after it is used');
  6869. }
  6870. // check that body is a stream and not form-data object
  6871. // note: we can't clone the form-data object without having it as a dependency
  6872. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6873. // tee instance body
  6874. p1 = new PassThrough();
  6875. p2 = new PassThrough();
  6876. body.pipe(p1);
  6877. body.pipe(p2);
  6878. // set instance body to teed body and return the other teed body
  6879. instance[INTERNALS].body = p1;
  6880. body = p2;
  6881. }
  6882. return body;
  6883. }
  6884. /**
  6885. * Performs the operation "extract a `Content-Type` value from |object|" as
  6886. * specified in the specification:
  6887. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6888. *
  6889. * This function assumes that instance.body is present.
  6890. *
  6891. * @param Mixed instance Any options.body input
  6892. */
  6893. function extractContentType(body) {
  6894. if (body === null) {
  6895. // body is null
  6896. return null;
  6897. } else if (typeof body === 'string') {
  6898. // body is string
  6899. return 'text/plain;charset=UTF-8';
  6900. } else if (isURLSearchParams(body)) {
  6901. // body is a URLSearchParams
  6902. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6903. } else if (isBlob(body)) {
  6904. // body is blob
  6905. return body.type || null;
  6906. } else if (Buffer.isBuffer(body)) {
  6907. // body is buffer
  6908. return null;
  6909. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6910. // body is ArrayBuffer
  6911. return null;
  6912. } else if (ArrayBuffer.isView(body)) {
  6913. // body is ArrayBufferView
  6914. return null;
  6915. } else if (typeof body.getBoundary === 'function') {
  6916. // detect form data input from form-data module
  6917. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6918. } else if (body instanceof Stream) {
  6919. // body is stream
  6920. // can't really do much about this
  6921. return null;
  6922. } else {
  6923. // Body constructor defaults other things to string
  6924. return 'text/plain;charset=UTF-8';
  6925. }
  6926. }
  6927. /**
  6928. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6929. * For us, we have to explicitly get it with a function.
  6930. *
  6931. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6932. *
  6933. * @param Body instance Instance of Body
  6934. * @return Number? Number of bytes, or null if not possible
  6935. */
  6936. function getTotalBytes(instance) {
  6937. const body = instance.body;
  6938. if (body === null) {
  6939. // body is null
  6940. return 0;
  6941. } else if (isBlob(body)) {
  6942. return body.size;
  6943. } else if (Buffer.isBuffer(body)) {
  6944. // body is buffer
  6945. return body.length;
  6946. } else if (body && typeof body.getLengthSync === 'function') {
  6947. // detect form data input from form-data module
  6948. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6949. body.hasKnownLength && body.hasKnownLength()) {
  6950. // 2.x
  6951. return body.getLengthSync();
  6952. }
  6953. return null;
  6954. } else {
  6955. // body is stream
  6956. return null;
  6957. }
  6958. }
  6959. /**
  6960. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6961. *
  6962. * @param Body instance Instance of Body
  6963. * @return Void
  6964. */
  6965. function writeToStream(dest, instance) {
  6966. const body = instance.body;
  6967. if (body === null) {
  6968. // body is null
  6969. dest.end();
  6970. } else if (isBlob(body)) {
  6971. body.stream().pipe(dest);
  6972. } else if (Buffer.isBuffer(body)) {
  6973. // body is buffer
  6974. dest.write(body);
  6975. dest.end();
  6976. } else {
  6977. // body is stream
  6978. body.pipe(dest);
  6979. }
  6980. }
  6981. // expose Promise
  6982. Body.Promise = global.Promise;
  6983. /**
  6984. * headers.js
  6985. *
  6986. * Headers class offers convenient helpers
  6987. */
  6988. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6989. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6990. function validateName(name) {
  6991. name = `${name}`;
  6992. if (invalidTokenRegex.test(name) || name === '') {
  6993. throw new TypeError(`${name} is not a legal HTTP header name`);
  6994. }
  6995. }
  6996. function validateValue(value) {
  6997. value = `${value}`;
  6998. if (invalidHeaderCharRegex.test(value)) {
  6999. throw new TypeError(`${value} is not a legal HTTP header value`);
  7000. }
  7001. }
  7002. /**
  7003. * Find the key in the map object given a header name.
  7004. *
  7005. * Returns undefined if not found.
  7006. *
  7007. * @param String name Header name
  7008. * @return String|Undefined
  7009. */
  7010. function find(map, name) {
  7011. name = name.toLowerCase();
  7012. for (const key in map) {
  7013. if (key.toLowerCase() === name) {
  7014. return key;
  7015. }
  7016. }
  7017. return undefined;
  7018. }
  7019. const MAP = Symbol('map');
  7020. class Headers {
  7021. /**
  7022. * Headers class
  7023. *
  7024. * @param Object headers Response headers
  7025. * @return Void
  7026. */
  7027. constructor() {
  7028. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7029. this[MAP] = Object.create(null);
  7030. if (init instanceof Headers) {
  7031. const rawHeaders = init.raw();
  7032. const headerNames = Object.keys(rawHeaders);
  7033. for (const headerName of headerNames) {
  7034. for (const value of rawHeaders[headerName]) {
  7035. this.append(headerName, value);
  7036. }
  7037. }
  7038. return;
  7039. }
  7040. // We don't worry about converting prop to ByteString here as append()
  7041. // will handle it.
  7042. if (init == null) ; else if (typeof init === 'object') {
  7043. const method = init[Symbol.iterator];
  7044. if (method != null) {
  7045. if (typeof method !== 'function') {
  7046. throw new TypeError('Header pairs must be iterable');
  7047. }
  7048. // sequence<sequence<ByteString>>
  7049. // Note: per spec we have to first exhaust the lists then process them
  7050. const pairs = [];
  7051. for (const pair of init) {
  7052. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7053. throw new TypeError('Each header pair must be iterable');
  7054. }
  7055. pairs.push(Array.from(pair));
  7056. }
  7057. for (const pair of pairs) {
  7058. if (pair.length !== 2) {
  7059. throw new TypeError('Each header pair must be a name/value tuple');
  7060. }
  7061. this.append(pair[0], pair[1]);
  7062. }
  7063. } else {
  7064. // record<ByteString, ByteString>
  7065. for (const key of Object.keys(init)) {
  7066. const value = init[key];
  7067. this.append(key, value);
  7068. }
  7069. }
  7070. } else {
  7071. throw new TypeError('Provided initializer must be an object');
  7072. }
  7073. }
  7074. /**
  7075. * Return combined header value given name
  7076. *
  7077. * @param String name Header name
  7078. * @return Mixed
  7079. */
  7080. get(name) {
  7081. name = `${name}`;
  7082. validateName(name);
  7083. const key = find(this[MAP], name);
  7084. if (key === undefined) {
  7085. return null;
  7086. }
  7087. return this[MAP][key].join(', ');
  7088. }
  7089. /**
  7090. * Iterate over all headers
  7091. *
  7092. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7093. * @param Boolean thisArg `this` context for callback function
  7094. * @return Void
  7095. */
  7096. forEach(callback) {
  7097. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7098. let pairs = getHeaders(this);
  7099. let i = 0;
  7100. while (i < pairs.length) {
  7101. var _pairs$i = pairs[i];
  7102. const name = _pairs$i[0],
  7103. value = _pairs$i[1];
  7104. callback.call(thisArg, value, name, this);
  7105. pairs = getHeaders(this);
  7106. i++;
  7107. }
  7108. }
  7109. /**
  7110. * Overwrite header values given name
  7111. *
  7112. * @param String name Header name
  7113. * @param String value Header value
  7114. * @return Void
  7115. */
  7116. set(name, value) {
  7117. name = `${name}`;
  7118. value = `${value}`;
  7119. validateName(name);
  7120. validateValue(value);
  7121. const key = find(this[MAP], name);
  7122. this[MAP][key !== undefined ? key : name] = [value];
  7123. }
  7124. /**
  7125. * Append a value onto existing header
  7126. *
  7127. * @param String name Header name
  7128. * @param String value Header value
  7129. * @return Void
  7130. */
  7131. append(name, value) {
  7132. name = `${name}`;
  7133. value = `${value}`;
  7134. validateName(name);
  7135. validateValue(value);
  7136. const key = find(this[MAP], name);
  7137. if (key !== undefined) {
  7138. this[MAP][key].push(value);
  7139. } else {
  7140. this[MAP][name] = [value];
  7141. }
  7142. }
  7143. /**
  7144. * Check for header name existence
  7145. *
  7146. * @param String name Header name
  7147. * @return Boolean
  7148. */
  7149. has(name) {
  7150. name = `${name}`;
  7151. validateName(name);
  7152. return find(this[MAP], name) !== undefined;
  7153. }
  7154. /**
  7155. * Delete all header values given name
  7156. *
  7157. * @param String name Header name
  7158. * @return Void
  7159. */
  7160. delete(name) {
  7161. name = `${name}`;
  7162. validateName(name);
  7163. const key = find(this[MAP], name);
  7164. if (key !== undefined) {
  7165. delete this[MAP][key];
  7166. }
  7167. }
  7168. /**
  7169. * Return raw headers (non-spec api)
  7170. *
  7171. * @return Object
  7172. */
  7173. raw() {
  7174. return this[MAP];
  7175. }
  7176. /**
  7177. * Get an iterator on keys.
  7178. *
  7179. * @return Iterator
  7180. */
  7181. keys() {
  7182. return createHeadersIterator(this, 'key');
  7183. }
  7184. /**
  7185. * Get an iterator on values.
  7186. *
  7187. * @return Iterator
  7188. */
  7189. values() {
  7190. return createHeadersIterator(this, 'value');
  7191. }
  7192. /**
  7193. * Get an iterator on entries.
  7194. *
  7195. * This is the default iterator of the Headers object.
  7196. *
  7197. * @return Iterator
  7198. */
  7199. [Symbol.iterator]() {
  7200. return createHeadersIterator(this, 'key+value');
  7201. }
  7202. }
  7203. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7204. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7205. value: 'Headers',
  7206. writable: false,
  7207. enumerable: false,
  7208. configurable: true
  7209. });
  7210. Object.defineProperties(Headers.prototype, {
  7211. get: { enumerable: true },
  7212. forEach: { enumerable: true },
  7213. set: { enumerable: true },
  7214. append: { enumerable: true },
  7215. has: { enumerable: true },
  7216. delete: { enumerable: true },
  7217. keys: { enumerable: true },
  7218. values: { enumerable: true },
  7219. entries: { enumerable: true }
  7220. });
  7221. function getHeaders(headers) {
  7222. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7223. const keys = Object.keys(headers[MAP]).sort();
  7224. return keys.map(kind === 'key' ? function (k) {
  7225. return k.toLowerCase();
  7226. } : kind === 'value' ? function (k) {
  7227. return headers[MAP][k].join(', ');
  7228. } : function (k) {
  7229. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7230. });
  7231. }
  7232. const INTERNAL = Symbol('internal');
  7233. function createHeadersIterator(target, kind) {
  7234. const iterator = Object.create(HeadersIteratorPrototype);
  7235. iterator[INTERNAL] = {
  7236. target,
  7237. kind,
  7238. index: 0
  7239. };
  7240. return iterator;
  7241. }
  7242. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7243. next() {
  7244. // istanbul ignore if
  7245. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7246. throw new TypeError('Value of `this` is not a HeadersIterator');
  7247. }
  7248. var _INTERNAL = this[INTERNAL];
  7249. const target = _INTERNAL.target,
  7250. kind = _INTERNAL.kind,
  7251. index = _INTERNAL.index;
  7252. const values = getHeaders(target, kind);
  7253. const len = values.length;
  7254. if (index >= len) {
  7255. return {
  7256. value: undefined,
  7257. done: true
  7258. };
  7259. }
  7260. this[INTERNAL].index = index + 1;
  7261. return {
  7262. value: values[index],
  7263. done: false
  7264. };
  7265. }
  7266. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7267. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7268. value: 'HeadersIterator',
  7269. writable: false,
  7270. enumerable: false,
  7271. configurable: true
  7272. });
  7273. /**
  7274. * Export the Headers object in a form that Node.js can consume.
  7275. *
  7276. * @param Headers headers
  7277. * @return Object
  7278. */
  7279. function exportNodeCompatibleHeaders(headers) {
  7280. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7281. // http.request() only supports string as Host header. This hack makes
  7282. // specifying custom Host header possible.
  7283. const hostHeaderKey = find(headers[MAP], 'Host');
  7284. if (hostHeaderKey !== undefined) {
  7285. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7286. }
  7287. return obj;
  7288. }
  7289. /**
  7290. * Create a Headers object from an object of headers, ignoring those that do
  7291. * not conform to HTTP grammar productions.
  7292. *
  7293. * @param Object obj Object of headers
  7294. * @return Headers
  7295. */
  7296. function createHeadersLenient(obj) {
  7297. const headers = new Headers();
  7298. for (const name of Object.keys(obj)) {
  7299. if (invalidTokenRegex.test(name)) {
  7300. continue;
  7301. }
  7302. if (Array.isArray(obj[name])) {
  7303. for (const val of obj[name]) {
  7304. if (invalidHeaderCharRegex.test(val)) {
  7305. continue;
  7306. }
  7307. if (headers[MAP][name] === undefined) {
  7308. headers[MAP][name] = [val];
  7309. } else {
  7310. headers[MAP][name].push(val);
  7311. }
  7312. }
  7313. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7314. headers[MAP][name] = [obj[name]];
  7315. }
  7316. }
  7317. return headers;
  7318. }
  7319. const INTERNALS$1 = Symbol('Response internals');
  7320. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7321. const STATUS_CODES = http.STATUS_CODES;
  7322. /**
  7323. * Response class
  7324. *
  7325. * @param Stream body Readable stream
  7326. * @param Object opts Response options
  7327. * @return Void
  7328. */
  7329. class Response {
  7330. constructor() {
  7331. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7332. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7333. Body.call(this, body, opts);
  7334. const status = opts.status || 200;
  7335. const headers = new Headers(opts.headers);
  7336. if (body != null && !headers.has('Content-Type')) {
  7337. const contentType = extractContentType(body);
  7338. if (contentType) {
  7339. headers.append('Content-Type', contentType);
  7340. }
  7341. }
  7342. this[INTERNALS$1] = {
  7343. url: opts.url,
  7344. status,
  7345. statusText: opts.statusText || STATUS_CODES[status],
  7346. headers,
  7347. counter: opts.counter
  7348. };
  7349. }
  7350. get url() {
  7351. return this[INTERNALS$1].url || '';
  7352. }
  7353. get status() {
  7354. return this[INTERNALS$1].status;
  7355. }
  7356. /**
  7357. * Convenience property representing if the request ended normally
  7358. */
  7359. get ok() {
  7360. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7361. }
  7362. get redirected() {
  7363. return this[INTERNALS$1].counter > 0;
  7364. }
  7365. get statusText() {
  7366. return this[INTERNALS$1].statusText;
  7367. }
  7368. get headers() {
  7369. return this[INTERNALS$1].headers;
  7370. }
  7371. /**
  7372. * Clone this response
  7373. *
  7374. * @return Response
  7375. */
  7376. clone() {
  7377. return new Response(clone(this), {
  7378. url: this.url,
  7379. status: this.status,
  7380. statusText: this.statusText,
  7381. headers: this.headers,
  7382. ok: this.ok,
  7383. redirected: this.redirected
  7384. });
  7385. }
  7386. }
  7387. Body.mixIn(Response.prototype);
  7388. Object.defineProperties(Response.prototype, {
  7389. url: { enumerable: true },
  7390. status: { enumerable: true },
  7391. ok: { enumerable: true },
  7392. redirected: { enumerable: true },
  7393. statusText: { enumerable: true },
  7394. headers: { enumerable: true },
  7395. clone: { enumerable: true }
  7396. });
  7397. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7398. value: 'Response',
  7399. writable: false,
  7400. enumerable: false,
  7401. configurable: true
  7402. });
  7403. const INTERNALS$2 = Symbol('Request internals');
  7404. // fix an issue where "format", "parse" aren't a named export for node <10
  7405. const parse_url = Url.parse;
  7406. const format_url = Url.format;
  7407. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7408. /**
  7409. * Check if a value is an instance of Request.
  7410. *
  7411. * @param Mixed input
  7412. * @return Boolean
  7413. */
  7414. function isRequest(input) {
  7415. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7416. }
  7417. function isAbortSignal(signal) {
  7418. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7419. return !!(proto && proto.constructor.name === 'AbortSignal');
  7420. }
  7421. /**
  7422. * Request class
  7423. *
  7424. * @param Mixed input Url or Request instance
  7425. * @param Object init Custom options
  7426. * @return Void
  7427. */
  7428. class Request {
  7429. constructor(input) {
  7430. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7431. let parsedURL;
  7432. // normalize input
  7433. if (!isRequest(input)) {
  7434. if (input && input.href) {
  7435. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7436. // will fall into this branch also (since their `toString()` will return
  7437. // `href` property anyway)
  7438. parsedURL = parse_url(input.href);
  7439. } else {
  7440. // coerce input to a string before attempting to parse
  7441. parsedURL = parse_url(`${input}`);
  7442. }
  7443. input = {};
  7444. } else {
  7445. parsedURL = parse_url(input.url);
  7446. }
  7447. let method = init.method || input.method || 'GET';
  7448. method = method.toUpperCase();
  7449. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7450. throw new TypeError('Request with GET/HEAD method cannot have body');
  7451. }
  7452. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7453. Body.call(this, inputBody, {
  7454. timeout: init.timeout || input.timeout || 0,
  7455. size: init.size || input.size || 0
  7456. });
  7457. const headers = new Headers(init.headers || input.headers || {});
  7458. if (inputBody != null && !headers.has('Content-Type')) {
  7459. const contentType = extractContentType(inputBody);
  7460. if (contentType) {
  7461. headers.append('Content-Type', contentType);
  7462. }
  7463. }
  7464. let signal = isRequest(input) ? input.signal : null;
  7465. if ('signal' in init) signal = init.signal;
  7466. if (signal != null && !isAbortSignal(signal)) {
  7467. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7468. }
  7469. this[INTERNALS$2] = {
  7470. method,
  7471. redirect: init.redirect || input.redirect || 'follow',
  7472. headers,
  7473. parsedURL,
  7474. signal
  7475. };
  7476. // node-fetch-only options
  7477. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7478. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7479. this.counter = init.counter || input.counter || 0;
  7480. this.agent = init.agent || input.agent;
  7481. }
  7482. get method() {
  7483. return this[INTERNALS$2].method;
  7484. }
  7485. get url() {
  7486. return format_url(this[INTERNALS$2].parsedURL);
  7487. }
  7488. get headers() {
  7489. return this[INTERNALS$2].headers;
  7490. }
  7491. get redirect() {
  7492. return this[INTERNALS$2].redirect;
  7493. }
  7494. get signal() {
  7495. return this[INTERNALS$2].signal;
  7496. }
  7497. /**
  7498. * Clone this request
  7499. *
  7500. * @return Request
  7501. */
  7502. clone() {
  7503. return new Request(this);
  7504. }
  7505. }
  7506. Body.mixIn(Request.prototype);
  7507. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7508. value: 'Request',
  7509. writable: false,
  7510. enumerable: false,
  7511. configurable: true
  7512. });
  7513. Object.defineProperties(Request.prototype, {
  7514. method: { enumerable: true },
  7515. url: { enumerable: true },
  7516. headers: { enumerable: true },
  7517. redirect: { enumerable: true },
  7518. clone: { enumerable: true },
  7519. signal: { enumerable: true }
  7520. });
  7521. /**
  7522. * Convert a Request to Node.js http request options.
  7523. *
  7524. * @param Request A Request instance
  7525. * @return Object The options object to be passed to http.request
  7526. */
  7527. function getNodeRequestOptions(request) {
  7528. const parsedURL = request[INTERNALS$2].parsedURL;
  7529. const headers = new Headers(request[INTERNALS$2].headers);
  7530. // fetch step 1.3
  7531. if (!headers.has('Accept')) {
  7532. headers.set('Accept', '*/*');
  7533. }
  7534. // Basic fetch
  7535. if (!parsedURL.protocol || !parsedURL.hostname) {
  7536. throw new TypeError('Only absolute URLs are supported');
  7537. }
  7538. if (!/^https?:$/.test(parsedURL.protocol)) {
  7539. throw new TypeError('Only HTTP(S) protocols are supported');
  7540. }
  7541. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7542. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7543. }
  7544. // HTTP-network-or-cache fetch steps 2.4-2.7
  7545. let contentLengthValue = null;
  7546. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7547. contentLengthValue = '0';
  7548. }
  7549. if (request.body != null) {
  7550. const totalBytes = getTotalBytes(request);
  7551. if (typeof totalBytes === 'number') {
  7552. contentLengthValue = String(totalBytes);
  7553. }
  7554. }
  7555. if (contentLengthValue) {
  7556. headers.set('Content-Length', contentLengthValue);
  7557. }
  7558. // HTTP-network-or-cache fetch step 2.11
  7559. if (!headers.has('User-Agent')) {
  7560. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7561. }
  7562. // HTTP-network-or-cache fetch step 2.15
  7563. if (request.compress && !headers.has('Accept-Encoding')) {
  7564. headers.set('Accept-Encoding', 'gzip,deflate');
  7565. }
  7566. let agent = request.agent;
  7567. if (typeof agent === 'function') {
  7568. agent = agent(parsedURL);
  7569. }
  7570. if (!headers.has('Connection') && !agent) {
  7571. headers.set('Connection', 'close');
  7572. }
  7573. // HTTP-network fetch step 4.2
  7574. // chunked encoding is handled by Node.js
  7575. return Object.assign({}, parsedURL, {
  7576. method: request.method,
  7577. headers: exportNodeCompatibleHeaders(headers),
  7578. agent
  7579. });
  7580. }
  7581. /**
  7582. * abort-error.js
  7583. *
  7584. * AbortError interface for cancelled requests
  7585. */
  7586. /**
  7587. * Create AbortError instance
  7588. *
  7589. * @param String message Error message for human
  7590. * @return AbortError
  7591. */
  7592. function AbortError(message) {
  7593. Error.call(this, message);
  7594. this.type = 'aborted';
  7595. this.message = message;
  7596. // hide custom error implementation details from end-users
  7597. Error.captureStackTrace(this, this.constructor);
  7598. }
  7599. AbortError.prototype = Object.create(Error.prototype);
  7600. AbortError.prototype.constructor = AbortError;
  7601. AbortError.prototype.name = 'AbortError';
  7602. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7603. const PassThrough$1 = Stream.PassThrough;
  7604. const resolve_url = Url.resolve;
  7605. /**
  7606. * Fetch function
  7607. *
  7608. * @param Mixed url Absolute url or Request instance
  7609. * @param Object opts Fetch options
  7610. * @return Promise
  7611. */
  7612. function fetch(url, opts) {
  7613. // allow custom promise
  7614. if (!fetch.Promise) {
  7615. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7616. }
  7617. Body.Promise = fetch.Promise;
  7618. // wrap http.request into fetch
  7619. return new fetch.Promise(function (resolve, reject) {
  7620. // build request object
  7621. const request = new Request(url, opts);
  7622. const options = getNodeRequestOptions(request);
  7623. const send = (options.protocol === 'https:' ? https : http).request;
  7624. const signal = request.signal;
  7625. let response = null;
  7626. const abort = function abort() {
  7627. let error = new AbortError('The user aborted a request.');
  7628. reject(error);
  7629. if (request.body && request.body instanceof Stream.Readable) {
  7630. request.body.destroy(error);
  7631. }
  7632. if (!response || !response.body) return;
  7633. response.body.emit('error', error);
  7634. };
  7635. if (signal && signal.aborted) {
  7636. abort();
  7637. return;
  7638. }
  7639. const abortAndFinalize = function abortAndFinalize() {
  7640. abort();
  7641. finalize();
  7642. };
  7643. // send request
  7644. const req = send(options);
  7645. let reqTimeout;
  7646. if (signal) {
  7647. signal.addEventListener('abort', abortAndFinalize);
  7648. }
  7649. function finalize() {
  7650. req.abort();
  7651. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7652. clearTimeout(reqTimeout);
  7653. }
  7654. if (request.timeout) {
  7655. req.once('socket', function (socket) {
  7656. reqTimeout = setTimeout(function () {
  7657. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7658. finalize();
  7659. }, request.timeout);
  7660. });
  7661. }
  7662. req.on('error', function (err) {
  7663. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7664. finalize();
  7665. });
  7666. req.on('response', function (res) {
  7667. clearTimeout(reqTimeout);
  7668. const headers = createHeadersLenient(res.headers);
  7669. // HTTP fetch step 5
  7670. if (fetch.isRedirect(res.statusCode)) {
  7671. // HTTP fetch step 5.2
  7672. const location = headers.get('Location');
  7673. // HTTP fetch step 5.3
  7674. const locationURL = location === null ? null : resolve_url(request.url, location);
  7675. // HTTP fetch step 5.5
  7676. switch (request.redirect) {
  7677. case 'error':
  7678. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7679. finalize();
  7680. return;
  7681. case 'manual':
  7682. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7683. if (locationURL !== null) {
  7684. // handle corrupted header
  7685. try {
  7686. headers.set('Location', locationURL);
  7687. } catch (err) {
  7688. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7689. reject(err);
  7690. }
  7691. }
  7692. break;
  7693. case 'follow':
  7694. // HTTP-redirect fetch step 2
  7695. if (locationURL === null) {
  7696. break;
  7697. }
  7698. // HTTP-redirect fetch step 5
  7699. if (request.counter >= request.follow) {
  7700. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7701. finalize();
  7702. return;
  7703. }
  7704. // HTTP-redirect fetch step 6 (counter increment)
  7705. // Create a new Request object.
  7706. const requestOpts = {
  7707. headers: new Headers(request.headers),
  7708. follow: request.follow,
  7709. counter: request.counter + 1,
  7710. agent: request.agent,
  7711. compress: request.compress,
  7712. method: request.method,
  7713. body: request.body,
  7714. signal: request.signal,
  7715. timeout: request.timeout
  7716. };
  7717. // HTTP-redirect fetch step 9
  7718. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7719. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7720. finalize();
  7721. return;
  7722. }
  7723. // HTTP-redirect fetch step 11
  7724. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7725. requestOpts.method = 'GET';
  7726. requestOpts.body = undefined;
  7727. requestOpts.headers.delete('content-length');
  7728. }
  7729. // HTTP-redirect fetch step 15
  7730. resolve(fetch(new Request(locationURL, requestOpts)));
  7731. finalize();
  7732. return;
  7733. }
  7734. }
  7735. // prepare response
  7736. res.once('end', function () {
  7737. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7738. });
  7739. let body = res.pipe(new PassThrough$1());
  7740. const response_options = {
  7741. url: request.url,
  7742. status: res.statusCode,
  7743. statusText: res.statusMessage,
  7744. headers: headers,
  7745. size: request.size,
  7746. timeout: request.timeout,
  7747. counter: request.counter
  7748. };
  7749. // HTTP-network fetch step 12.1.1.3
  7750. const codings = headers.get('Content-Encoding');
  7751. // HTTP-network fetch step 12.1.1.4: handle content codings
  7752. // in following scenarios we ignore compression support
  7753. // 1. compression support is disabled
  7754. // 2. HEAD request
  7755. // 3. no Content-Encoding header
  7756. // 4. no content response (204)
  7757. // 5. content not modified response (304)
  7758. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7759. response = new Response(body, response_options);
  7760. resolve(response);
  7761. return;
  7762. }
  7763. // For Node v6+
  7764. // Be less strict when decoding compressed responses, since sometimes
  7765. // servers send slightly invalid responses that are still accepted
  7766. // by common browsers.
  7767. // Always using Z_SYNC_FLUSH is what cURL does.
  7768. const zlibOptions = {
  7769. flush: zlib.Z_SYNC_FLUSH,
  7770. finishFlush: zlib.Z_SYNC_FLUSH
  7771. };
  7772. // for gzip
  7773. if (codings == 'gzip' || codings == 'x-gzip') {
  7774. body = body.pipe(zlib.createGunzip(zlibOptions));
  7775. response = new Response(body, response_options);
  7776. resolve(response);
  7777. return;
  7778. }
  7779. // for deflate
  7780. if (codings == 'deflate' || codings == 'x-deflate') {
  7781. // handle the infamous raw deflate response from old servers
  7782. // a hack for old IIS and Apache servers
  7783. const raw = res.pipe(new PassThrough$1());
  7784. raw.once('data', function (chunk) {
  7785. // see http://stackoverflow.com/questions/37519828
  7786. if ((chunk[0] & 0x0F) === 0x08) {
  7787. body = body.pipe(zlib.createInflate());
  7788. } else {
  7789. body = body.pipe(zlib.createInflateRaw());
  7790. }
  7791. response = new Response(body, response_options);
  7792. resolve(response);
  7793. });
  7794. return;
  7795. }
  7796. // for br
  7797. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7798. body = body.pipe(zlib.createBrotliDecompress());
  7799. response = new Response(body, response_options);
  7800. resolve(response);
  7801. return;
  7802. }
  7803. // otherwise, use response as-is
  7804. response = new Response(body, response_options);
  7805. resolve(response);
  7806. });
  7807. writeToStream(req, request);
  7808. });
  7809. }
  7810. /**
  7811. * Redirect code matching
  7812. *
  7813. * @param Number code Status code
  7814. * @return Boolean
  7815. */
  7816. fetch.isRedirect = function (code) {
  7817. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7818. };
  7819. // expose Promise
  7820. fetch.Promise = global.Promise;
  7821. module.exports = exports = fetch;
  7822. Object.defineProperty(exports, "__esModule", { value: true });
  7823. exports.default = exports;
  7824. exports.Headers = Headers;
  7825. exports.Request = Request;
  7826. exports.Response = Response;
  7827. exports.FetchError = FetchError;
  7828. /***/ }),
  7829. /***/ 462:
  7830. /***/ (function(module) {
  7831. "use strict";
  7832. // See http://www.robvanderwoude.com/escapechars.php
  7833. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7834. function escapeCommand(arg) {
  7835. // Escape meta chars
  7836. arg = arg.replace(metaCharsRegExp, '^$1');
  7837. return arg;
  7838. }
  7839. function escapeArgument(arg, doubleEscapeMetaChars) {
  7840. // Convert to string
  7841. arg = `${arg}`;
  7842. // Algorithm below is based on https://qntm.org/cmd
  7843. // Sequence of backslashes followed by a double quote:
  7844. // double up all the backslashes and escape the double quote
  7845. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7846. // Sequence of backslashes followed by the end of the string
  7847. // (which will become a double quote later):
  7848. // double up all the backslashes
  7849. arg = arg.replace(/(\\*)$/, '$1$1');
  7850. // All other backslashes occur literally
  7851. // Quote the whole thing:
  7852. arg = `"${arg}"`;
  7853. // Escape meta chars
  7854. arg = arg.replace(metaCharsRegExp, '^$1');
  7855. // Double escape meta chars if necessary
  7856. if (doubleEscapeMetaChars) {
  7857. arg = arg.replace(metaCharsRegExp, '^$1');
  7858. }
  7859. return arg;
  7860. }
  7861. module.exports.command = escapeCommand;
  7862. module.exports.argument = escapeArgument;
  7863. /***/ }),
  7864. /***/ 463:
  7865. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7866. "use strict";
  7867. Object.defineProperty(exports, '__esModule', { value: true });
  7868. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7869. var deprecation = __webpack_require__(692);
  7870. var once = _interopDefault(__webpack_require__(969));
  7871. const logOnce = once(deprecation => console.warn(deprecation));
  7872. /**
  7873. * Error with extra properties to help with debugging
  7874. */
  7875. class RequestError extends Error {
  7876. constructor(message, statusCode, options) {
  7877. super(message); // Maintains proper stack trace (only available on V8)
  7878. /* istanbul ignore next */
  7879. if (Error.captureStackTrace) {
  7880. Error.captureStackTrace(this, this.constructor);
  7881. }
  7882. this.name = "HttpError";
  7883. this.status = statusCode;
  7884. Object.defineProperty(this, "code", {
  7885. get() {
  7886. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7887. return statusCode;
  7888. }
  7889. });
  7890. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7891. const requestCopy = Object.assign({}, options.request);
  7892. if (options.request.headers.authorization) {
  7893. requestCopy.headers = Object.assign({}, options.request.headers, {
  7894. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7895. });
  7896. }
  7897. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7898. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7899. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7900. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7901. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7902. this.request = requestCopy;
  7903. }
  7904. }
  7905. exports.RequestError = RequestError;
  7906. //# sourceMappingURL=index.js.map
  7907. /***/ }),
  7908. /***/ 464:
  7909. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7910. "use strict";
  7911. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7912. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7913. return new (P || (P = Promise))(function (resolve, reject) {
  7914. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7915. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7916. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7917. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7918. });
  7919. };
  7920. var __importStar = (this && this.__importStar) || function (mod) {
  7921. if (mod && mod.__esModule) return mod;
  7922. var result = {};
  7923. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7924. result["default"] = mod;
  7925. return result;
  7926. };
  7927. var __importDefault = (this && this.__importDefault) || function (mod) {
  7928. return (mod && mod.__esModule) ? mod : { "default": mod };
  7929. };
  7930. Object.defineProperty(exports, "__esModule", { value: true });
  7931. const assert = __importStar(__webpack_require__(357));
  7932. const core = __importStar(__webpack_require__(470));
  7933. const fs = __importStar(__webpack_require__(747));
  7934. const github = __importStar(__webpack_require__(469));
  7935. const io = __importStar(__webpack_require__(1));
  7936. const path = __importStar(__webpack_require__(622));
  7937. const retryHelper = __importStar(__webpack_require__(587));
  7938. const toolCache = __importStar(__webpack_require__(533));
  7939. const v4_1 = __importDefault(__webpack_require__(826));
  7940. const IS_WINDOWS = process.platform === 'win32';
  7941. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  7942. return __awaiter(this, void 0, void 0, function* () {
  7943. // Download the archive
  7944. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7945. core.info('Downloading the archive');
  7946. return yield downloadArchive(authToken, owner, repo, ref, commit);
  7947. }));
  7948. // Write archive to disk
  7949. core.info('Writing archive to disk');
  7950. const uniqueId = v4_1.default();
  7951. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  7952. yield fs.promises.writeFile(archivePath, archiveData);
  7953. archiveData = Buffer.from(''); // Free memory
  7954. // Extract archive
  7955. core.info('Extracting the archive');
  7956. const extractPath = path.join(repositoryPath, uniqueId);
  7957. yield io.mkdirP(extractPath);
  7958. if (IS_WINDOWS) {
  7959. yield toolCache.extractZip(archivePath, extractPath);
  7960. }
  7961. else {
  7962. yield toolCache.extractTar(archivePath, extractPath);
  7963. }
  7964. io.rmRF(archivePath);
  7965. // Determine the path of the repository content. The archive contains
  7966. // a top-level folder and the repository content is inside.
  7967. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7968. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7969. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  7970. core.info(`Resolved version ${archiveVersion}`);
  7971. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  7972. // Move the files
  7973. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  7974. const sourcePath = path.join(tempRepositoryPath, fileName);
  7975. const targetPath = path.join(repositoryPath, fileName);
  7976. if (IS_WINDOWS) {
  7977. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  7978. }
  7979. else {
  7980. yield io.mv(sourcePath, targetPath);
  7981. }
  7982. }
  7983. io.rmRF(extractPath);
  7984. });
  7985. }
  7986. exports.downloadRepository = downloadRepository;
  7987. function downloadArchive(authToken, owner, repo, ref, commit) {
  7988. return __awaiter(this, void 0, void 0, function* () {
  7989. const octokit = new github.GitHub(authToken);
  7990. const params = {
  7991. owner: owner,
  7992. repo: repo,
  7993. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7994. ref: commit || ref
  7995. };
  7996. const response = yield octokit.repos.getArchiveLink(params);
  7997. if (response.status != 200) {
  7998. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  7999. }
  8000. return Buffer.from(response.data); // response.data is ArrayBuffer
  8001. });
  8002. }
  8003. /***/ }),
  8004. /***/ 469:
  8005. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8006. "use strict";
  8007. var __importDefault = (this && this.__importDefault) || function (mod) {
  8008. return (mod && mod.__esModule) ? mod : { "default": mod };
  8009. };
  8010. var __importStar = (this && this.__importStar) || function (mod) {
  8011. if (mod && mod.__esModule) return mod;
  8012. var result = {};
  8013. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8014. result["default"] = mod;
  8015. return result;
  8016. };
  8017. Object.defineProperty(exports, "__esModule", { value: true });
  8018. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8019. const graphql_1 = __webpack_require__(898);
  8020. const rest_1 = __importDefault(__webpack_require__(0));
  8021. const Context = __importStar(__webpack_require__(262));
  8022. const httpClient = __importStar(__webpack_require__(539));
  8023. // We need this in order to extend Octokit
  8024. rest_1.default.prototype = new rest_1.default();
  8025. exports.context = new Context.Context();
  8026. class GitHub extends rest_1.default {
  8027. constructor(token, opts) {
  8028. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8029. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8030. }
  8031. /**
  8032. * Disambiguates the constructor overload parameters
  8033. */
  8034. static disambiguate(token, opts) {
  8035. return [
  8036. typeof token === 'string' ? token : '',
  8037. typeof token === 'object' ? token : opts || {}
  8038. ];
  8039. }
  8040. static getOctokitOptions(args) {
  8041. const token = args[0];
  8042. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8043. // Auth
  8044. const auth = GitHub.getAuthString(token, options);
  8045. if (auth) {
  8046. options.auth = auth;
  8047. }
  8048. // Proxy
  8049. const agent = GitHub.getProxyAgent(options);
  8050. if (agent) {
  8051. // Shallow clone - don't mutate the object provided by the caller
  8052. options.request = options.request ? Object.assign({}, options.request) : {};
  8053. // Set the agent
  8054. options.request.agent = agent;
  8055. }
  8056. return options;
  8057. }
  8058. static getGraphQL(args) {
  8059. const defaults = {};
  8060. const token = args[0];
  8061. const options = args[1];
  8062. // Authorization
  8063. const auth = this.getAuthString(token, options);
  8064. if (auth) {
  8065. defaults.headers = {
  8066. authorization: auth
  8067. };
  8068. }
  8069. // Proxy
  8070. const agent = GitHub.getProxyAgent(options);
  8071. if (agent) {
  8072. defaults.request = { agent };
  8073. }
  8074. return graphql_1.graphql.defaults(defaults);
  8075. }
  8076. static getAuthString(token, options) {
  8077. // Validate args
  8078. if (!token && !options.auth) {
  8079. throw new Error('Parameter token or opts.auth is required');
  8080. }
  8081. else if (token && options.auth) {
  8082. throw new Error('Parameters token and opts.auth may not both be specified');
  8083. }
  8084. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8085. }
  8086. static getProxyAgent(options) {
  8087. var _a;
  8088. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8089. const serverUrl = 'https://api.github.com';
  8090. if (httpClient.getProxyUrl(serverUrl)) {
  8091. const hc = new httpClient.HttpClient();
  8092. return hc.getAgent(serverUrl);
  8093. }
  8094. }
  8095. return undefined;
  8096. }
  8097. }
  8098. exports.GitHub = GitHub;
  8099. //# sourceMappingURL=github.js.map
  8100. /***/ }),
  8101. /***/ 470:
  8102. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8103. "use strict";
  8104. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8105. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8106. return new (P || (P = Promise))(function (resolve, reject) {
  8107. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8108. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8109. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8110. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8111. });
  8112. };
  8113. Object.defineProperty(exports, "__esModule", { value: true });
  8114. const command_1 = __webpack_require__(431);
  8115. const os = __webpack_require__(87);
  8116. const path = __webpack_require__(622);
  8117. /**
  8118. * The code to exit an action
  8119. */
  8120. var ExitCode;
  8121. (function (ExitCode) {
  8122. /**
  8123. * A code indicating that the action was successful
  8124. */
  8125. ExitCode[ExitCode["Success"] = 0] = "Success";
  8126. /**
  8127. * A code indicating that the action was a failure
  8128. */
  8129. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8130. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8131. //-----------------------------------------------------------------------
  8132. // Variables
  8133. //-----------------------------------------------------------------------
  8134. /**
  8135. * Sets env variable for this action and future actions in the job
  8136. * @param name the name of the variable to set
  8137. * @param val the value of the variable
  8138. */
  8139. function exportVariable(name, val) {
  8140. process.env[name] = val;
  8141. command_1.issueCommand('set-env', { name }, val);
  8142. }
  8143. exports.exportVariable = exportVariable;
  8144. /**
  8145. * Registers a secret which will get masked from logs
  8146. * @param secret value of the secret
  8147. */
  8148. function setSecret(secret) {
  8149. command_1.issueCommand('add-mask', {}, secret);
  8150. }
  8151. exports.setSecret = setSecret;
  8152. /**
  8153. * Prepends inputPath to the PATH (for this action and future actions)
  8154. * @param inputPath
  8155. */
  8156. function addPath(inputPath) {
  8157. command_1.issueCommand('add-path', {}, inputPath);
  8158. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8159. }
  8160. exports.addPath = addPath;
  8161. /**
  8162. * Gets the value of an input. The value is also trimmed.
  8163. *
  8164. * @param name name of the input to get
  8165. * @param options optional. See InputOptions.
  8166. * @returns string
  8167. */
  8168. function getInput(name, options) {
  8169. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8170. if (options && options.required && !val) {
  8171. throw new Error(`Input required and not supplied: ${name}`);
  8172. }
  8173. return val.trim();
  8174. }
  8175. exports.getInput = getInput;
  8176. /**
  8177. * Sets the value of an output.
  8178. *
  8179. * @param name name of the output to set
  8180. * @param value value to store
  8181. */
  8182. function setOutput(name, value) {
  8183. command_1.issueCommand('set-output', { name }, value);
  8184. }
  8185. exports.setOutput = setOutput;
  8186. //-----------------------------------------------------------------------
  8187. // Results
  8188. //-----------------------------------------------------------------------
  8189. /**
  8190. * Sets the action status to failed.
  8191. * When the action exits it will be with an exit code of 1
  8192. * @param message add error issue message
  8193. */
  8194. function setFailed(message) {
  8195. process.exitCode = ExitCode.Failure;
  8196. error(message);
  8197. }
  8198. exports.setFailed = setFailed;
  8199. //-----------------------------------------------------------------------
  8200. // Logging Commands
  8201. //-----------------------------------------------------------------------
  8202. /**
  8203. * Writes debug message to user log
  8204. * @param message debug message
  8205. */
  8206. function debug(message) {
  8207. command_1.issueCommand('debug', {}, message);
  8208. }
  8209. exports.debug = debug;
  8210. /**
  8211. * Adds an error issue
  8212. * @param message error issue message
  8213. */
  8214. function error(message) {
  8215. command_1.issue('error', message);
  8216. }
  8217. exports.error = error;
  8218. /**
  8219. * Adds an warning issue
  8220. * @param message warning issue message
  8221. */
  8222. function warning(message) {
  8223. command_1.issue('warning', message);
  8224. }
  8225. exports.warning = warning;
  8226. /**
  8227. * Writes info to log with console.log.
  8228. * @param message info message
  8229. */
  8230. function info(message) {
  8231. process.stdout.write(message + os.EOL);
  8232. }
  8233. exports.info = info;
  8234. /**
  8235. * Begin an output group.
  8236. *
  8237. * Output until the next `groupEnd` will be foldable in this group
  8238. *
  8239. * @param name The name of the output group
  8240. */
  8241. function startGroup(name) {
  8242. command_1.issue('group', name);
  8243. }
  8244. exports.startGroup = startGroup;
  8245. /**
  8246. * End an output group.
  8247. */
  8248. function endGroup() {
  8249. command_1.issue('endgroup');
  8250. }
  8251. exports.endGroup = endGroup;
  8252. /**
  8253. * Wrap an asynchronous function call in a group.
  8254. *
  8255. * Returns the same type as the function itself.
  8256. *
  8257. * @param name The name of the group
  8258. * @param fn The function to wrap in the group
  8259. */
  8260. function group(name, fn) {
  8261. return __awaiter(this, void 0, void 0, function* () {
  8262. startGroup(name);
  8263. let result;
  8264. try {
  8265. result = yield fn();
  8266. }
  8267. finally {
  8268. endGroup();
  8269. }
  8270. return result;
  8271. });
  8272. }
  8273. exports.group = group;
  8274. //# sourceMappingURL=core.js.map
  8275. /***/ }),
  8276. /***/ 471:
  8277. /***/ (function(module, __unusedexports, __webpack_require__) {
  8278. module.exports = authenticationBeforeRequest;
  8279. const btoa = __webpack_require__(675);
  8280. const uniq = __webpack_require__(126);
  8281. function authenticationBeforeRequest(state, options) {
  8282. if (!state.auth.type) {
  8283. return;
  8284. }
  8285. if (state.auth.type === "basic") {
  8286. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8287. options.headers.authorization = `Basic ${hash}`;
  8288. return;
  8289. }
  8290. if (state.auth.type === "token") {
  8291. options.headers.authorization = `token ${state.auth.token}`;
  8292. return;
  8293. }
  8294. if (state.auth.type === "app") {
  8295. options.headers.authorization = `Bearer ${state.auth.token}`;
  8296. const acceptHeaders = options.headers.accept
  8297. .split(",")
  8298. .concat("application/vnd.github.machine-man-preview+json");
  8299. options.headers.accept = uniq(acceptHeaders)
  8300. .filter(Boolean)
  8301. .join(",");
  8302. return;
  8303. }
  8304. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8305. if (state.auth.token) {
  8306. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8307. return;
  8308. }
  8309. const key = encodeURIComponent(state.auth.key);
  8310. const secret = encodeURIComponent(state.auth.secret);
  8311. options.url += `client_id=${key}&client_secret=${secret}`;
  8312. }
  8313. /***/ }),
  8314. /***/ 489:
  8315. /***/ (function(module, __unusedexports, __webpack_require__) {
  8316. "use strict";
  8317. const path = __webpack_require__(622);
  8318. const which = __webpack_require__(814);
  8319. const pathKey = __webpack_require__(39)();
  8320. function resolveCommandAttempt(parsed, withoutPathExt) {
  8321. const cwd = process.cwd();
  8322. const hasCustomCwd = parsed.options.cwd != null;
  8323. // If a custom `cwd` was specified, we need to change the process cwd
  8324. // because `which` will do stat calls but does not support a custom cwd
  8325. if (hasCustomCwd) {
  8326. try {
  8327. process.chdir(parsed.options.cwd);
  8328. } catch (err) {
  8329. /* Empty */
  8330. }
  8331. }
  8332. let resolved;
  8333. try {
  8334. resolved = which.sync(parsed.command, {
  8335. path: (parsed.options.env || process.env)[pathKey],
  8336. pathExt: withoutPathExt ? path.delimiter : undefined,
  8337. });
  8338. } catch (e) {
  8339. /* Empty */
  8340. } finally {
  8341. process.chdir(cwd);
  8342. }
  8343. // If we successfully resolved, ensure that an absolute path is returned
  8344. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8345. if (resolved) {
  8346. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8347. }
  8348. return resolved;
  8349. }
  8350. function resolveCommand(parsed) {
  8351. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8352. }
  8353. module.exports = resolveCommand;
  8354. /***/ }),
  8355. /***/ 510:
  8356. /***/ (function(module) {
  8357. module.exports = addHook
  8358. function addHook (state, kind, name, hook) {
  8359. var orig = hook
  8360. if (!state.registry[name]) {
  8361. state.registry[name] = []
  8362. }
  8363. if (kind === 'before') {
  8364. hook = function (method, options) {
  8365. return Promise.resolve()
  8366. .then(orig.bind(null, options))
  8367. .then(method.bind(null, options))
  8368. }
  8369. }
  8370. if (kind === 'after') {
  8371. hook = function (method, options) {
  8372. var result
  8373. return Promise.resolve()
  8374. .then(method.bind(null, options))
  8375. .then(function (result_) {
  8376. result = result_
  8377. return orig(result, options)
  8378. })
  8379. .then(function () {
  8380. return result
  8381. })
  8382. }
  8383. }
  8384. if (kind === 'error') {
  8385. hook = function (method, options) {
  8386. return Promise.resolve()
  8387. .then(method.bind(null, options))
  8388. .catch(function (error) {
  8389. return orig(error, options)
  8390. })
  8391. }
  8392. }
  8393. state.registry[name].push({
  8394. hook: hook,
  8395. orig: orig
  8396. })
  8397. }
  8398. /***/ }),
  8399. /***/ 523:
  8400. /***/ (function(module, __unusedexports, __webpack_require__) {
  8401. var register = __webpack_require__(363)
  8402. var addHook = __webpack_require__(510)
  8403. var removeHook = __webpack_require__(763)
  8404. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8405. var bind = Function.bind
  8406. var bindable = bind.bind(bind)
  8407. function bindApi (hook, state, name) {
  8408. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8409. hook.api = { remove: removeHookRef }
  8410. hook.remove = removeHookRef
  8411. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8412. var args = name ? [state, kind, name] : [state, kind]
  8413. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8414. })
  8415. }
  8416. function HookSingular () {
  8417. var singularHookName = 'h'
  8418. var singularHookState = {
  8419. registry: {}
  8420. }
  8421. var singularHook = register.bind(null, singularHookState, singularHookName)
  8422. bindApi(singularHook, singularHookState, singularHookName)
  8423. return singularHook
  8424. }
  8425. function HookCollection () {
  8426. var state = {
  8427. registry: {}
  8428. }
  8429. var hook = register.bind(null, state)
  8430. bindApi(hook, state)
  8431. return hook
  8432. }
  8433. var collectionHookDeprecationMessageDisplayed = false
  8434. function Hook () {
  8435. if (!collectionHookDeprecationMessageDisplayed) {
  8436. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8437. collectionHookDeprecationMessageDisplayed = true
  8438. }
  8439. return HookCollection()
  8440. }
  8441. Hook.Singular = HookSingular.bind()
  8442. Hook.Collection = HookCollection.bind()
  8443. module.exports = Hook
  8444. // expose constructors as a named property for TypeScript
  8445. module.exports.Hook = Hook
  8446. module.exports.Singular = Hook.Singular
  8447. module.exports.Collection = Hook.Collection
  8448. /***/ }),
  8449. /***/ 528:
  8450. /***/ (function(__unusedmodule, exports) {
  8451. "use strict";
  8452. Object.defineProperty(exports, "__esModule", { value: true });
  8453. function escape(value) {
  8454. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8455. return `\\${x}`;
  8456. });
  8457. }
  8458. exports.escape = escape;
  8459. /***/ }),
  8460. /***/ 529:
  8461. /***/ (function(module, __unusedexports, __webpack_require__) {
  8462. const factory = __webpack_require__(47);
  8463. module.exports = factory();
  8464. /***/ }),
  8465. /***/ 533:
  8466. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8467. "use strict";
  8468. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8469. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8470. return new (P || (P = Promise))(function (resolve, reject) {
  8471. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8472. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8473. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8474. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8475. });
  8476. };
  8477. Object.defineProperty(exports, "__esModule", { value: true });
  8478. const core = __webpack_require__(470);
  8479. const io = __webpack_require__(1);
  8480. const fs = __webpack_require__(747);
  8481. const os = __webpack_require__(87);
  8482. const path = __webpack_require__(622);
  8483. const httpm = __webpack_require__(874);
  8484. const semver = __webpack_require__(656);
  8485. const uuidV4 = __webpack_require__(826);
  8486. const exec_1 = __webpack_require__(986);
  8487. const assert_1 = __webpack_require__(357);
  8488. class HTTPError extends Error {
  8489. constructor(httpStatusCode) {
  8490. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8491. this.httpStatusCode = httpStatusCode;
  8492. Object.setPrototypeOf(this, new.target.prototype);
  8493. }
  8494. }
  8495. exports.HTTPError = HTTPError;
  8496. const IS_WINDOWS = process.platform === 'win32';
  8497. const userAgent = 'actions/tool-cache';
  8498. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8499. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8500. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8501. // If directories not found, place them in common temp locations
  8502. if (!tempDirectory || !cacheRoot) {
  8503. let baseLocation;
  8504. if (IS_WINDOWS) {
  8505. // On windows use the USERPROFILE env variable
  8506. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8507. }
  8508. else {
  8509. if (process.platform === 'darwin') {
  8510. baseLocation = '/Users';
  8511. }
  8512. else {
  8513. baseLocation = '/home';
  8514. }
  8515. }
  8516. if (!tempDirectory) {
  8517. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8518. }
  8519. if (!cacheRoot) {
  8520. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8521. }
  8522. }
  8523. /**
  8524. * Download a tool from an url and stream it into a file
  8525. *
  8526. * @param url url of tool to download
  8527. * @returns path to downloaded tool
  8528. */
  8529. function downloadTool(url) {
  8530. return __awaiter(this, void 0, void 0, function* () {
  8531. // Wrap in a promise so that we can resolve from within stream callbacks
  8532. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8533. try {
  8534. const http = new httpm.HttpClient(userAgent, [], {
  8535. allowRetries: true,
  8536. maxRetries: 3
  8537. });
  8538. const destPath = path.join(tempDirectory, uuidV4());
  8539. yield io.mkdirP(tempDirectory);
  8540. core.debug(`Downloading ${url}`);
  8541. core.debug(`Downloading ${destPath}`);
  8542. if (fs.existsSync(destPath)) {
  8543. throw new Error(`Destination file path ${destPath} already exists`);
  8544. }
  8545. const response = yield http.get(url);
  8546. if (response.message.statusCode !== 200) {
  8547. const err = new HTTPError(response.message.statusCode);
  8548. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8549. throw err;
  8550. }
  8551. const file = fs.createWriteStream(destPath);
  8552. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8553. try {
  8554. const stream = response.message.pipe(file);
  8555. stream.on('close', () => {
  8556. core.debug('download complete');
  8557. resolve(destPath);
  8558. });
  8559. }
  8560. catch (err) {
  8561. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8562. reject(err);
  8563. }
  8564. }));
  8565. file.on('error', err => {
  8566. file.end();
  8567. reject(err);
  8568. });
  8569. }
  8570. catch (err) {
  8571. reject(err);
  8572. }
  8573. }));
  8574. });
  8575. }
  8576. exports.downloadTool = downloadTool;
  8577. /**
  8578. * Extract a .7z file
  8579. *
  8580. * @param file path to the .7z file
  8581. * @param dest destination directory. Optional.
  8582. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8583. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8584. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8585. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8586. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8587. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8588. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8589. * to 7zr.exe can be pass to this function.
  8590. * @returns path to the destination directory
  8591. */
  8592. function extract7z(file, dest, _7zPath) {
  8593. return __awaiter(this, void 0, void 0, function* () {
  8594. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8595. assert_1.ok(file, 'parameter "file" is required');
  8596. dest = dest || (yield _createExtractFolder(dest));
  8597. const originalCwd = process.cwd();
  8598. process.chdir(dest);
  8599. if (_7zPath) {
  8600. try {
  8601. const args = [
  8602. 'x',
  8603. '-bb1',
  8604. '-bd',
  8605. '-sccUTF-8',
  8606. file
  8607. ];
  8608. const options = {
  8609. silent: true
  8610. };
  8611. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8612. }
  8613. finally {
  8614. process.chdir(originalCwd);
  8615. }
  8616. }
  8617. else {
  8618. const escapedScript = path
  8619. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8620. .replace(/'/g, "''")
  8621. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8622. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8623. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8624. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8625. const args = [
  8626. '-NoLogo',
  8627. '-Sta',
  8628. '-NoProfile',
  8629. '-NonInteractive',
  8630. '-ExecutionPolicy',
  8631. 'Unrestricted',
  8632. '-Command',
  8633. command
  8634. ];
  8635. const options = {
  8636. silent: true
  8637. };
  8638. try {
  8639. const powershellPath = yield io.which('powershell', true);
  8640. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8641. }
  8642. finally {
  8643. process.chdir(originalCwd);
  8644. }
  8645. }
  8646. return dest;
  8647. });
  8648. }
  8649. exports.extract7z = extract7z;
  8650. /**
  8651. * Extract a tar
  8652. *
  8653. * @param file path to the tar
  8654. * @param dest destination directory. Optional.
  8655. * @param flags flags for the tar. Optional.
  8656. * @returns path to the destination directory
  8657. */
  8658. function extractTar(file, dest, flags = 'xz') {
  8659. return __awaiter(this, void 0, void 0, function* () {
  8660. if (!file) {
  8661. throw new Error("parameter 'file' is required");
  8662. }
  8663. dest = dest || (yield _createExtractFolder(dest));
  8664. const tarPath = yield io.which('tar', true);
  8665. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8666. return dest;
  8667. });
  8668. }
  8669. exports.extractTar = extractTar;
  8670. /**
  8671. * Extract a zip
  8672. *
  8673. * @param file path to the zip
  8674. * @param dest destination directory. Optional.
  8675. * @returns path to the destination directory
  8676. */
  8677. function extractZip(file, dest) {
  8678. return __awaiter(this, void 0, void 0, function* () {
  8679. if (!file) {
  8680. throw new Error("parameter 'file' is required");
  8681. }
  8682. dest = dest || (yield _createExtractFolder(dest));
  8683. if (IS_WINDOWS) {
  8684. yield extractZipWin(file, dest);
  8685. }
  8686. else {
  8687. yield extractZipNix(file, dest);
  8688. }
  8689. return dest;
  8690. });
  8691. }
  8692. exports.extractZip = extractZip;
  8693. function extractZipWin(file, dest) {
  8694. return __awaiter(this, void 0, void 0, function* () {
  8695. // build the powershell command
  8696. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8697. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8698. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8699. // run powershell
  8700. const powershellPath = yield io.which('powershell');
  8701. const args = [
  8702. '-NoLogo',
  8703. '-Sta',
  8704. '-NoProfile',
  8705. '-NonInteractive',
  8706. '-ExecutionPolicy',
  8707. 'Unrestricted',
  8708. '-Command',
  8709. command
  8710. ];
  8711. yield exec_1.exec(`"${powershellPath}"`, args);
  8712. });
  8713. }
  8714. function extractZipNix(file, dest) {
  8715. return __awaiter(this, void 0, void 0, function* () {
  8716. const unzipPath = yield io.which('unzip');
  8717. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8718. });
  8719. }
  8720. /**
  8721. * Caches a directory and installs it into the tool cacheDir
  8722. *
  8723. * @param sourceDir the directory to cache into tools
  8724. * @param tool tool name
  8725. * @param version version of the tool. semver format
  8726. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8727. */
  8728. function cacheDir(sourceDir, tool, version, arch) {
  8729. return __awaiter(this, void 0, void 0, function* () {
  8730. version = semver.clean(version) || version;
  8731. arch = arch || os.arch();
  8732. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8733. core.debug(`source dir: ${sourceDir}`);
  8734. if (!fs.statSync(sourceDir).isDirectory()) {
  8735. throw new Error('sourceDir is not a directory');
  8736. }
  8737. // Create the tool dir
  8738. const destPath = yield _createToolPath(tool, version, arch);
  8739. // copy each child item. do not move. move can fail on Windows
  8740. // due to anti-virus software having an open handle on a file.
  8741. for (const itemName of fs.readdirSync(sourceDir)) {
  8742. const s = path.join(sourceDir, itemName);
  8743. yield io.cp(s, destPath, { recursive: true });
  8744. }
  8745. // write .complete
  8746. _completeToolPath(tool, version, arch);
  8747. return destPath;
  8748. });
  8749. }
  8750. exports.cacheDir = cacheDir;
  8751. /**
  8752. * Caches a downloaded file (GUID) and installs it
  8753. * into the tool cache with a given targetName
  8754. *
  8755. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8756. * @param targetFile the name of the file name in the tools directory
  8757. * @param tool tool name
  8758. * @param version version of the tool. semver format
  8759. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8760. */
  8761. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8762. return __awaiter(this, void 0, void 0, function* () {
  8763. version = semver.clean(version) || version;
  8764. arch = arch || os.arch();
  8765. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8766. core.debug(`source file: ${sourceFile}`);
  8767. if (!fs.statSync(sourceFile).isFile()) {
  8768. throw new Error('sourceFile is not a file');
  8769. }
  8770. // create the tool dir
  8771. const destFolder = yield _createToolPath(tool, version, arch);
  8772. // copy instead of move. move can fail on Windows due to
  8773. // anti-virus software having an open handle on a file.
  8774. const destPath = path.join(destFolder, targetFile);
  8775. core.debug(`destination file ${destPath}`);
  8776. yield io.cp(sourceFile, destPath);
  8777. // write .complete
  8778. _completeToolPath(tool, version, arch);
  8779. return destFolder;
  8780. });
  8781. }
  8782. exports.cacheFile = cacheFile;
  8783. /**
  8784. * Finds the path to a tool version in the local installed tool cache
  8785. *
  8786. * @param toolName name of the tool
  8787. * @param versionSpec version of the tool
  8788. * @param arch optional arch. defaults to arch of computer
  8789. */
  8790. function find(toolName, versionSpec, arch) {
  8791. if (!toolName) {
  8792. throw new Error('toolName parameter is required');
  8793. }
  8794. if (!versionSpec) {
  8795. throw new Error('versionSpec parameter is required');
  8796. }
  8797. arch = arch || os.arch();
  8798. // attempt to resolve an explicit version
  8799. if (!_isExplicitVersion(versionSpec)) {
  8800. const localVersions = findAllVersions(toolName, arch);
  8801. const match = _evaluateVersions(localVersions, versionSpec);
  8802. versionSpec = match;
  8803. }
  8804. // check for the explicit version in the cache
  8805. let toolPath = '';
  8806. if (versionSpec) {
  8807. versionSpec = semver.clean(versionSpec) || '';
  8808. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8809. core.debug(`checking cache: ${cachePath}`);
  8810. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8811. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8812. toolPath = cachePath;
  8813. }
  8814. else {
  8815. core.debug('not found');
  8816. }
  8817. }
  8818. return toolPath;
  8819. }
  8820. exports.find = find;
  8821. /**
  8822. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8823. *
  8824. * @param toolName name of the tool
  8825. * @param arch optional arch. defaults to arch of computer
  8826. */
  8827. function findAllVersions(toolName, arch) {
  8828. const versions = [];
  8829. arch = arch || os.arch();
  8830. const toolPath = path.join(cacheRoot, toolName);
  8831. if (fs.existsSync(toolPath)) {
  8832. const children = fs.readdirSync(toolPath);
  8833. for (const child of children) {
  8834. if (_isExplicitVersion(child)) {
  8835. const fullPath = path.join(toolPath, child, arch || '');
  8836. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8837. versions.push(child);
  8838. }
  8839. }
  8840. }
  8841. }
  8842. return versions;
  8843. }
  8844. exports.findAllVersions = findAllVersions;
  8845. function _createExtractFolder(dest) {
  8846. return __awaiter(this, void 0, void 0, function* () {
  8847. if (!dest) {
  8848. // create a temp dir
  8849. dest = path.join(tempDirectory, uuidV4());
  8850. }
  8851. yield io.mkdirP(dest);
  8852. return dest;
  8853. });
  8854. }
  8855. function _createToolPath(tool, version, arch) {
  8856. return __awaiter(this, void 0, void 0, function* () {
  8857. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8858. core.debug(`destination ${folderPath}`);
  8859. const markerPath = `${folderPath}.complete`;
  8860. yield io.rmRF(folderPath);
  8861. yield io.rmRF(markerPath);
  8862. yield io.mkdirP(folderPath);
  8863. return folderPath;
  8864. });
  8865. }
  8866. function _completeToolPath(tool, version, arch) {
  8867. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8868. const markerPath = `${folderPath}.complete`;
  8869. fs.writeFileSync(markerPath, '');
  8870. core.debug('finished caching tool');
  8871. }
  8872. function _isExplicitVersion(versionSpec) {
  8873. const c = semver.clean(versionSpec) || '';
  8874. core.debug(`isExplicit: ${c}`);
  8875. const valid = semver.valid(c) != null;
  8876. core.debug(`explicit? ${valid}`);
  8877. return valid;
  8878. }
  8879. function _evaluateVersions(versions, versionSpec) {
  8880. let version = '';
  8881. core.debug(`evaluating ${versions.length} versions`);
  8882. versions = versions.sort((a, b) => {
  8883. if (semver.gt(a, b)) {
  8884. return 1;
  8885. }
  8886. return -1;
  8887. });
  8888. for (let i = versions.length - 1; i >= 0; i--) {
  8889. const potential = versions[i];
  8890. const satisfied = semver.satisfies(potential, versionSpec);
  8891. if (satisfied) {
  8892. version = potential;
  8893. break;
  8894. }
  8895. }
  8896. if (version) {
  8897. core.debug(`matched: ${version}`);
  8898. }
  8899. else {
  8900. core.debug('match not found');
  8901. }
  8902. return version;
  8903. }
  8904. //# sourceMappingURL=tool-cache.js.map
  8905. /***/ }),
  8906. /***/ 536:
  8907. /***/ (function(module, __unusedexports, __webpack_require__) {
  8908. module.exports = hasFirstPage
  8909. const deprecate = __webpack_require__(370)
  8910. const getPageLinks = __webpack_require__(577)
  8911. function hasFirstPage (link) {
  8912. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8913. return getPageLinks(link).first
  8914. }
  8915. /***/ }),
  8916. /***/ 539:
  8917. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8918. "use strict";
  8919. Object.defineProperty(exports, "__esModule", { value: true });
  8920. const url = __webpack_require__(835);
  8921. const http = __webpack_require__(605);
  8922. const https = __webpack_require__(211);
  8923. const pm = __webpack_require__(950);
  8924. let tunnel;
  8925. var HttpCodes;
  8926. (function (HttpCodes) {
  8927. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  8928. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  8929. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  8930. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  8931. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  8932. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  8933. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  8934. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  8935. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  8936. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  8937. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  8938. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  8939. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  8940. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  8941. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  8942. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  8943. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  8944. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  8945. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  8946. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  8947. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  8948. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  8949. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  8950. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  8951. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  8952. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  8953. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  8954. /**
  8955. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  8956. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  8957. */
  8958. function getProxyUrl(serverUrl) {
  8959. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  8960. return proxyUrl ? proxyUrl.href : '';
  8961. }
  8962. exports.getProxyUrl = getProxyUrl;
  8963. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  8964. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  8965. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  8966. const ExponentialBackoffCeiling = 10;
  8967. const ExponentialBackoffTimeSlice = 5;
  8968. class HttpClientResponse {
  8969. constructor(message) {
  8970. this.message = message;
  8971. }
  8972. readBody() {
  8973. return new Promise(async (resolve, reject) => {
  8974. let output = Buffer.alloc(0);
  8975. this.message.on('data', (chunk) => {
  8976. output = Buffer.concat([output, chunk]);
  8977. });
  8978. this.message.on('end', () => {
  8979. resolve(output.toString());
  8980. });
  8981. });
  8982. }
  8983. }
  8984. exports.HttpClientResponse = HttpClientResponse;
  8985. function isHttps(requestUrl) {
  8986. let parsedUrl = url.parse(requestUrl);
  8987. return parsedUrl.protocol === 'https:';
  8988. }
  8989. exports.isHttps = isHttps;
  8990. class HttpClient {
  8991. constructor(userAgent, handlers, requestOptions) {
  8992. this._ignoreSslError = false;
  8993. this._allowRedirects = true;
  8994. this._allowRedirectDowngrade = false;
  8995. this._maxRedirects = 50;
  8996. this._allowRetries = false;
  8997. this._maxRetries = 1;
  8998. this._keepAlive = false;
  8999. this._disposed = false;
  9000. this.userAgent = userAgent;
  9001. this.handlers = handlers || [];
  9002. this.requestOptions = requestOptions;
  9003. if (requestOptions) {
  9004. if (requestOptions.ignoreSslError != null) {
  9005. this._ignoreSslError = requestOptions.ignoreSslError;
  9006. }
  9007. this._socketTimeout = requestOptions.socketTimeout;
  9008. if (requestOptions.allowRedirects != null) {
  9009. this._allowRedirects = requestOptions.allowRedirects;
  9010. }
  9011. if (requestOptions.allowRedirectDowngrade != null) {
  9012. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9013. }
  9014. if (requestOptions.maxRedirects != null) {
  9015. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9016. }
  9017. if (requestOptions.keepAlive != null) {
  9018. this._keepAlive = requestOptions.keepAlive;
  9019. }
  9020. if (requestOptions.allowRetries != null) {
  9021. this._allowRetries = requestOptions.allowRetries;
  9022. }
  9023. if (requestOptions.maxRetries != null) {
  9024. this._maxRetries = requestOptions.maxRetries;
  9025. }
  9026. }
  9027. }
  9028. options(requestUrl, additionalHeaders) {
  9029. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9030. }
  9031. get(requestUrl, additionalHeaders) {
  9032. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9033. }
  9034. del(requestUrl, additionalHeaders) {
  9035. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9036. }
  9037. post(requestUrl, data, additionalHeaders) {
  9038. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9039. }
  9040. patch(requestUrl, data, additionalHeaders) {
  9041. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9042. }
  9043. put(requestUrl, data, additionalHeaders) {
  9044. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9045. }
  9046. head(requestUrl, additionalHeaders) {
  9047. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9048. }
  9049. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9050. return this.request(verb, requestUrl, stream, additionalHeaders);
  9051. }
  9052. /**
  9053. * Makes a raw http request.
  9054. * All other methods such as get, post, patch, and request ultimately call this.
  9055. * Prefer get, del, post and patch
  9056. */
  9057. async request(verb, requestUrl, data, headers) {
  9058. if (this._disposed) {
  9059. throw new Error("Client has already been disposed.");
  9060. }
  9061. let parsedUrl = url.parse(requestUrl);
  9062. let info = this._prepareRequest(verb, parsedUrl, headers);
  9063. // Only perform retries on reads since writes may not be idempotent.
  9064. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  9065. let numTries = 0;
  9066. let response;
  9067. while (numTries < maxTries) {
  9068. response = await this.requestRaw(info, data);
  9069. // Check if it's an authentication challenge
  9070. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  9071. let authenticationHandler;
  9072. for (let i = 0; i < this.handlers.length; i++) {
  9073. if (this.handlers[i].canHandleAuthentication(response)) {
  9074. authenticationHandler = this.handlers[i];
  9075. break;
  9076. }
  9077. }
  9078. if (authenticationHandler) {
  9079. return authenticationHandler.handleAuthentication(this, info, data);
  9080. }
  9081. else {
  9082. // We have received an unauthorized response but have no handlers to handle it.
  9083. // Let the response return to the caller.
  9084. return response;
  9085. }
  9086. }
  9087. let redirectsRemaining = this._maxRedirects;
  9088. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  9089. && this._allowRedirects
  9090. && redirectsRemaining > 0) {
  9091. const redirectUrl = response.message.headers["location"];
  9092. if (!redirectUrl) {
  9093. // if there's no location to redirect to, we won't
  9094. break;
  9095. }
  9096. let parsedRedirectUrl = url.parse(redirectUrl);
  9097. if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
  9098. 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.");
  9099. }
  9100. // we need to finish reading the response before reassigning response
  9101. // which will leak the open socket.
  9102. await response.readBody();
  9103. // let's make the request with the new redirectUrl
  9104. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9105. response = await this.requestRaw(info, data);
  9106. redirectsRemaining--;
  9107. }
  9108. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9109. // If not a retry code, return immediately instead of retrying
  9110. return response;
  9111. }
  9112. numTries += 1;
  9113. if (numTries < maxTries) {
  9114. await response.readBody();
  9115. await this._performExponentialBackoff(numTries);
  9116. }
  9117. }
  9118. return response;
  9119. }
  9120. /**
  9121. * Needs to be called if keepAlive is set to true in request options.
  9122. */
  9123. dispose() {
  9124. if (this._agent) {
  9125. this._agent.destroy();
  9126. }
  9127. this._disposed = true;
  9128. }
  9129. /**
  9130. * Raw request.
  9131. * @param info
  9132. * @param data
  9133. */
  9134. requestRaw(info, data) {
  9135. return new Promise((resolve, reject) => {
  9136. let callbackForResult = function (err, res) {
  9137. if (err) {
  9138. reject(err);
  9139. }
  9140. resolve(res);
  9141. };
  9142. this.requestRawWithCallback(info, data, callbackForResult);
  9143. });
  9144. }
  9145. /**
  9146. * Raw request with callback.
  9147. * @param info
  9148. * @param data
  9149. * @param onResult
  9150. */
  9151. requestRawWithCallback(info, data, onResult) {
  9152. let socket;
  9153. if (typeof (data) === 'string') {
  9154. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  9155. }
  9156. let callbackCalled = false;
  9157. let handleResult = (err, res) => {
  9158. if (!callbackCalled) {
  9159. callbackCalled = true;
  9160. onResult(err, res);
  9161. }
  9162. };
  9163. let req = info.httpModule.request(info.options, (msg) => {
  9164. let res = new HttpClientResponse(msg);
  9165. handleResult(null, res);
  9166. });
  9167. req.on('socket', (sock) => {
  9168. socket = sock;
  9169. });
  9170. // If we ever get disconnected, we want the socket to timeout eventually
  9171. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9172. if (socket) {
  9173. socket.end();
  9174. }
  9175. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9176. });
  9177. req.on('error', function (err) {
  9178. // err has statusCode property
  9179. // res should have headers
  9180. handleResult(err, null);
  9181. });
  9182. if (data && typeof (data) === 'string') {
  9183. req.write(data, 'utf8');
  9184. }
  9185. if (data && typeof (data) !== 'string') {
  9186. data.on('close', function () {
  9187. req.end();
  9188. });
  9189. data.pipe(req);
  9190. }
  9191. else {
  9192. req.end();
  9193. }
  9194. }
  9195. /**
  9196. * Gets an http agent. This function is useful when you need an http agent that handles
  9197. * routing through a proxy server - depending upon the url and proxy environment variables.
  9198. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9199. */
  9200. getAgent(serverUrl) {
  9201. let parsedUrl = url.parse(serverUrl);
  9202. return this._getAgent(parsedUrl);
  9203. }
  9204. _prepareRequest(method, requestUrl, headers) {
  9205. const info = {};
  9206. info.parsedUrl = requestUrl;
  9207. const usingSsl = info.parsedUrl.protocol === 'https:';
  9208. info.httpModule = usingSsl ? https : http;
  9209. const defaultPort = usingSsl ? 443 : 80;
  9210. info.options = {};
  9211. info.options.host = info.parsedUrl.hostname;
  9212. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  9213. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9214. info.options.method = method;
  9215. info.options.headers = this._mergeHeaders(headers);
  9216. if (this.userAgent != null) {
  9217. info.options.headers["user-agent"] = this.userAgent;
  9218. }
  9219. info.options.agent = this._getAgent(info.parsedUrl);
  9220. // gives handlers an opportunity to participate
  9221. if (this.handlers) {
  9222. this.handlers.forEach((handler) => {
  9223. handler.prepareRequest(info.options);
  9224. });
  9225. }
  9226. return info;
  9227. }
  9228. _mergeHeaders(headers) {
  9229. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  9230. if (this.requestOptions && this.requestOptions.headers) {
  9231. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9232. }
  9233. return lowercaseKeys(headers || {});
  9234. }
  9235. _getAgent(parsedUrl) {
  9236. let agent;
  9237. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9238. let useProxy = proxyUrl && proxyUrl.hostname;
  9239. if (this._keepAlive && useProxy) {
  9240. agent = this._proxyAgent;
  9241. }
  9242. if (this._keepAlive && !useProxy) {
  9243. agent = this._agent;
  9244. }
  9245. // if agent is already assigned use that agent.
  9246. if (!!agent) {
  9247. return agent;
  9248. }
  9249. const usingSsl = parsedUrl.protocol === 'https:';
  9250. let maxSockets = 100;
  9251. if (!!this.requestOptions) {
  9252. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9253. }
  9254. if (useProxy) {
  9255. // If using proxy, need tunnel
  9256. if (!tunnel) {
  9257. tunnel = __webpack_require__(335);
  9258. }
  9259. const agentOptions = {
  9260. maxSockets: maxSockets,
  9261. keepAlive: this._keepAlive,
  9262. proxy: {
  9263. proxyAuth: proxyUrl.auth,
  9264. host: proxyUrl.hostname,
  9265. port: proxyUrl.port
  9266. },
  9267. };
  9268. let tunnelAgent;
  9269. const overHttps = proxyUrl.protocol === 'https:';
  9270. if (usingSsl) {
  9271. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9272. }
  9273. else {
  9274. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9275. }
  9276. agent = tunnelAgent(agentOptions);
  9277. this._proxyAgent = agent;
  9278. }
  9279. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9280. if (this._keepAlive && !agent) {
  9281. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9282. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9283. this._agent = agent;
  9284. }
  9285. // if not using private agent and tunnel agent isn't setup then use global agent
  9286. if (!agent) {
  9287. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9288. }
  9289. if (usingSsl && this._ignoreSslError) {
  9290. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9291. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9292. // we have to cast it to any and change it directly
  9293. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  9294. }
  9295. return agent;
  9296. }
  9297. _performExponentialBackoff(retryNumber) {
  9298. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9299. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9300. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9301. }
  9302. }
  9303. exports.HttpClient = HttpClient;
  9304. /***/ }),
  9305. /***/ 550:
  9306. /***/ (function(module, __unusedexports, __webpack_require__) {
  9307. module.exports = getNextPage
  9308. const getPage = __webpack_require__(265)
  9309. function getNextPage (octokit, link, headers) {
  9310. return getPage(octokit, link, 'next', headers)
  9311. }
  9312. /***/ }),
  9313. /***/ 558:
  9314. /***/ (function(module, __unusedexports, __webpack_require__) {
  9315. module.exports = hasPreviousPage
  9316. const deprecate = __webpack_require__(370)
  9317. const getPageLinks = __webpack_require__(577)
  9318. function hasPreviousPage (link) {
  9319. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9320. return getPageLinks(link).prev
  9321. }
  9322. /***/ }),
  9323. /***/ 559:
  9324. /***/ (function(__unusedmodule, exports) {
  9325. "use strict";
  9326. Object.defineProperty(exports, "__esModule", { value: true });
  9327. class GitVersion {
  9328. /**
  9329. * Used for comparing the version of git and git-lfs against the minimum required version
  9330. * @param version the version string, e.g. 1.2 or 1.2.3
  9331. */
  9332. constructor(version) {
  9333. this.major = NaN;
  9334. this.minor = NaN;
  9335. this.patch = NaN;
  9336. if (version) {
  9337. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9338. if (match) {
  9339. this.major = Number(match[1]);
  9340. this.minor = Number(match[2]);
  9341. if (match[4]) {
  9342. this.patch = Number(match[4]);
  9343. }
  9344. }
  9345. }
  9346. }
  9347. /**
  9348. * Compares the instance against a minimum required version
  9349. * @param minimum Minimum version
  9350. */
  9351. checkMinimum(minimum) {
  9352. if (!minimum.isValid()) {
  9353. throw new Error('Arg minimum is not a valid version');
  9354. }
  9355. // Major is insufficient
  9356. if (this.major < minimum.major) {
  9357. return false;
  9358. }
  9359. // Major is equal
  9360. if (this.major === minimum.major) {
  9361. // Minor is insufficient
  9362. if (this.minor < minimum.minor) {
  9363. return false;
  9364. }
  9365. // Minor is equal
  9366. if (this.minor === minimum.minor) {
  9367. // Patch is insufficient
  9368. if (this.patch && this.patch < (minimum.patch || 0)) {
  9369. return false;
  9370. }
  9371. }
  9372. }
  9373. return true;
  9374. }
  9375. /**
  9376. * Indicates whether the instance was constructed from a valid version string
  9377. */
  9378. isValid() {
  9379. return !isNaN(this.major);
  9380. }
  9381. /**
  9382. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9383. */
  9384. toString() {
  9385. let result = '';
  9386. if (this.isValid()) {
  9387. result = `${this.major}.${this.minor}`;
  9388. if (!isNaN(this.patch)) {
  9389. result += `.${this.patch}`;
  9390. }
  9391. }
  9392. return result;
  9393. }
  9394. }
  9395. exports.GitVersion = GitVersion;
  9396. /***/ }),
  9397. /***/ 562:
  9398. /***/ (function(module, __unusedexports, __webpack_require__) {
  9399. var once = __webpack_require__(969);
  9400. var noop = function() {};
  9401. var isRequest = function(stream) {
  9402. return stream.setHeader && typeof stream.abort === 'function';
  9403. };
  9404. var isChildProcess = function(stream) {
  9405. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9406. };
  9407. var eos = function(stream, opts, callback) {
  9408. if (typeof opts === 'function') return eos(stream, null, opts);
  9409. if (!opts) opts = {};
  9410. callback = once(callback || noop);
  9411. var ws = stream._writableState;
  9412. var rs = stream._readableState;
  9413. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9414. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9415. var cancelled = false;
  9416. var onlegacyfinish = function() {
  9417. if (!stream.writable) onfinish();
  9418. };
  9419. var onfinish = function() {
  9420. writable = false;
  9421. if (!readable) callback.call(stream);
  9422. };
  9423. var onend = function() {
  9424. readable = false;
  9425. if (!writable) callback.call(stream);
  9426. };
  9427. var onexit = function(exitCode) {
  9428. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9429. };
  9430. var onerror = function(err) {
  9431. callback.call(stream, err);
  9432. };
  9433. var onclose = function() {
  9434. process.nextTick(onclosenexttick);
  9435. };
  9436. var onclosenexttick = function() {
  9437. if (cancelled) return;
  9438. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9439. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9440. };
  9441. var onrequest = function() {
  9442. stream.req.on('finish', onfinish);
  9443. };
  9444. if (isRequest(stream)) {
  9445. stream.on('complete', onfinish);
  9446. stream.on('abort', onclose);
  9447. if (stream.req) onrequest();
  9448. else stream.on('request', onrequest);
  9449. } else if (writable && !ws) { // legacy streams
  9450. stream.on('end', onlegacyfinish);
  9451. stream.on('close', onlegacyfinish);
  9452. }
  9453. if (isChildProcess(stream)) stream.on('exit', onexit);
  9454. stream.on('end', onend);
  9455. stream.on('finish', onfinish);
  9456. if (opts.error !== false) stream.on('error', onerror);
  9457. stream.on('close', onclose);
  9458. return function() {
  9459. cancelled = true;
  9460. stream.removeListener('complete', onfinish);
  9461. stream.removeListener('abort', onclose);
  9462. stream.removeListener('request', onrequest);
  9463. if (stream.req) stream.req.removeListener('finish', onfinish);
  9464. stream.removeListener('end', onlegacyfinish);
  9465. stream.removeListener('close', onlegacyfinish);
  9466. stream.removeListener('finish', onfinish);
  9467. stream.removeListener('exit', onexit);
  9468. stream.removeListener('end', onend);
  9469. stream.removeListener('error', onerror);
  9470. stream.removeListener('close', onclose);
  9471. };
  9472. };
  9473. module.exports = eos;
  9474. /***/ }),
  9475. /***/ 563:
  9476. /***/ (function(module, __unusedexports, __webpack_require__) {
  9477. module.exports = getPreviousPage
  9478. const getPage = __webpack_require__(265)
  9479. function getPreviousPage (octokit, link, headers) {
  9480. return getPage(octokit, link, 'prev', headers)
  9481. }
  9482. /***/ }),
  9483. /***/ 568:
  9484. /***/ (function(module, __unusedexports, __webpack_require__) {
  9485. "use strict";
  9486. const path = __webpack_require__(622);
  9487. const niceTry = __webpack_require__(948);
  9488. const resolveCommand = __webpack_require__(489);
  9489. const escape = __webpack_require__(462);
  9490. const readShebang = __webpack_require__(389);
  9491. const semver = __webpack_require__(280);
  9492. const isWin = process.platform === 'win32';
  9493. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9494. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9495. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9496. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9497. function detectShebang(parsed) {
  9498. parsed.file = resolveCommand(parsed);
  9499. const shebang = parsed.file && readShebang(parsed.file);
  9500. if (shebang) {
  9501. parsed.args.unshift(parsed.file);
  9502. parsed.command = shebang;
  9503. return resolveCommand(parsed);
  9504. }
  9505. return parsed.file;
  9506. }
  9507. function parseNonShell(parsed) {
  9508. if (!isWin) {
  9509. return parsed;
  9510. }
  9511. // Detect & add support for shebangs
  9512. const commandFile = detectShebang(parsed);
  9513. // We don't need a shell if the command filename is an executable
  9514. const needsShell = !isExecutableRegExp.test(commandFile);
  9515. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9516. // Note that `forceShell` is an hidden option used only in tests
  9517. if (parsed.options.forceShell || needsShell) {
  9518. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9519. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9520. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9521. // we need to double escape them
  9522. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9523. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9524. // This is necessary otherwise it will always fail with ENOENT in those cases
  9525. parsed.command = path.normalize(parsed.command);
  9526. // Escape command & arguments
  9527. parsed.command = escape.command(parsed.command);
  9528. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9529. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9530. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9531. parsed.command = process.env.comspec || 'cmd.exe';
  9532. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9533. }
  9534. return parsed;
  9535. }
  9536. function parseShell(parsed) {
  9537. // If node supports the shell option, there's no need to mimic its behavior
  9538. if (supportsShellOption) {
  9539. return parsed;
  9540. }
  9541. // Mimic node shell option
  9542. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9543. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9544. if (isWin) {
  9545. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9546. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9547. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9548. } else {
  9549. if (typeof parsed.options.shell === 'string') {
  9550. parsed.command = parsed.options.shell;
  9551. } else if (process.platform === 'android') {
  9552. parsed.command = '/system/bin/sh';
  9553. } else {
  9554. parsed.command = '/bin/sh';
  9555. }
  9556. parsed.args = ['-c', shellCommand];
  9557. }
  9558. return parsed;
  9559. }
  9560. function parse(command, args, options) {
  9561. // Normalize arguments, similar to nodejs
  9562. if (args && !Array.isArray(args)) {
  9563. options = args;
  9564. args = null;
  9565. }
  9566. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9567. options = Object.assign({}, options); // Clone object to avoid changing the original
  9568. // Build our parsed object
  9569. const parsed = {
  9570. command,
  9571. args,
  9572. options,
  9573. file: undefined,
  9574. original: {
  9575. command,
  9576. args,
  9577. },
  9578. };
  9579. // Delegate further parsing to shell or non-shell
  9580. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9581. }
  9582. module.exports = parse;
  9583. /***/ }),
  9584. /***/ 577:
  9585. /***/ (function(module) {
  9586. module.exports = getPageLinks
  9587. function getPageLinks (link) {
  9588. link = link.link || link.headers.link || ''
  9589. const links = {}
  9590. // link format:
  9591. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9592. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9593. links[type] = uri
  9594. })
  9595. return links
  9596. }
  9597. /***/ }),
  9598. /***/ 586:
  9599. /***/ (function(module, __unusedexports, __webpack_require__) {
  9600. module.exports = octokitRestApiEndpoints;
  9601. const ROUTES = __webpack_require__(705);
  9602. function octokitRestApiEndpoints(octokit) {
  9603. // Aliasing scopes for backward compatibility
  9604. // See https://github.com/octokit/rest.js/pull/1134
  9605. ROUTES.gitdata = ROUTES.git;
  9606. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9607. ROUTES.pullRequests = ROUTES.pulls;
  9608. octokit.registerEndpoints(ROUTES);
  9609. }
  9610. /***/ }),
  9611. /***/ 587:
  9612. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9613. "use strict";
  9614. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9615. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9616. return new (P || (P = Promise))(function (resolve, reject) {
  9617. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9618. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9619. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9620. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9621. });
  9622. };
  9623. var __importStar = (this && this.__importStar) || function (mod) {
  9624. if (mod && mod.__esModule) return mod;
  9625. var result = {};
  9626. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9627. result["default"] = mod;
  9628. return result;
  9629. };
  9630. Object.defineProperty(exports, "__esModule", { value: true });
  9631. const core = __importStar(__webpack_require__(470));
  9632. const defaultMaxAttempts = 3;
  9633. const defaultMinSeconds = 10;
  9634. const defaultMaxSeconds = 20;
  9635. class RetryHelper {
  9636. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9637. this.maxAttempts = maxAttempts;
  9638. this.minSeconds = Math.floor(minSeconds);
  9639. this.maxSeconds = Math.floor(maxSeconds);
  9640. if (this.minSeconds > this.maxSeconds) {
  9641. throw new Error('min seconds should be less than or equal to max seconds');
  9642. }
  9643. }
  9644. execute(action) {
  9645. return __awaiter(this, void 0, void 0, function* () {
  9646. let attempt = 1;
  9647. while (attempt < this.maxAttempts) {
  9648. // Try
  9649. try {
  9650. return yield action();
  9651. }
  9652. catch (err) {
  9653. core.info(err.message);
  9654. }
  9655. // Sleep
  9656. const seconds = this.getSleepAmount();
  9657. core.info(`Waiting ${seconds} seconds before trying again`);
  9658. yield this.sleep(seconds);
  9659. attempt++;
  9660. }
  9661. // Last attempt
  9662. return yield action();
  9663. });
  9664. }
  9665. getSleepAmount() {
  9666. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9667. this.minSeconds);
  9668. }
  9669. sleep(seconds) {
  9670. return __awaiter(this, void 0, void 0, function* () {
  9671. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9672. });
  9673. }
  9674. }
  9675. exports.RetryHelper = RetryHelper;
  9676. function execute(action) {
  9677. return __awaiter(this, void 0, void 0, function* () {
  9678. const retryHelper = new RetryHelper();
  9679. return yield retryHelper.execute(action);
  9680. });
  9681. }
  9682. exports.execute = execute;
  9683. /***/ }),
  9684. /***/ 605:
  9685. /***/ (function(module) {
  9686. module.exports = require("http");
  9687. /***/ }),
  9688. /***/ 614:
  9689. /***/ (function(module) {
  9690. module.exports = require("events");
  9691. /***/ }),
  9692. /***/ 618:
  9693. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9694. "use strict";
  9695. var __importStar = (this && this.__importStar) || function (mod) {
  9696. if (mod && mod.__esModule) return mod;
  9697. var result = {};
  9698. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9699. result["default"] = mod;
  9700. return result;
  9701. };
  9702. Object.defineProperty(exports, "__esModule", { value: true });
  9703. const fs = __importStar(__webpack_require__(747));
  9704. function directoryExistsSync(path, required) {
  9705. if (!path) {
  9706. throw new Error("Arg 'path' must not be empty");
  9707. }
  9708. let stats;
  9709. try {
  9710. stats = fs.statSync(path);
  9711. }
  9712. catch (error) {
  9713. if (error.code === 'ENOENT') {
  9714. if (!required) {
  9715. return false;
  9716. }
  9717. throw new Error(`Directory '${path}' does not exist`);
  9718. }
  9719. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9720. }
  9721. if (stats.isDirectory()) {
  9722. return true;
  9723. }
  9724. else if (!required) {
  9725. return false;
  9726. }
  9727. throw new Error(`Directory '${path}' does not exist`);
  9728. }
  9729. exports.directoryExistsSync = directoryExistsSync;
  9730. function existsSync(path) {
  9731. if (!path) {
  9732. throw new Error("Arg 'path' must not be empty");
  9733. }
  9734. try {
  9735. fs.statSync(path);
  9736. }
  9737. catch (error) {
  9738. if (error.code === 'ENOENT') {
  9739. return false;
  9740. }
  9741. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9742. }
  9743. return true;
  9744. }
  9745. exports.existsSync = existsSync;
  9746. function fileExistsSync(path) {
  9747. if (!path) {
  9748. throw new Error("Arg 'path' must not be empty");
  9749. }
  9750. let stats;
  9751. try {
  9752. stats = fs.statSync(path);
  9753. }
  9754. catch (error) {
  9755. if (error.code === 'ENOENT') {
  9756. return false;
  9757. }
  9758. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9759. }
  9760. if (!stats.isDirectory()) {
  9761. return true;
  9762. }
  9763. return false;
  9764. }
  9765. exports.fileExistsSync = fileExistsSync;
  9766. /***/ }),
  9767. /***/ 621:
  9768. /***/ (function(module, __unusedexports, __webpack_require__) {
  9769. "use strict";
  9770. const path = __webpack_require__(622);
  9771. const pathKey = __webpack_require__(39);
  9772. module.exports = opts => {
  9773. opts = Object.assign({
  9774. cwd: process.cwd(),
  9775. path: process.env[pathKey()]
  9776. }, opts);
  9777. let prev;
  9778. let pth = path.resolve(opts.cwd);
  9779. const ret = [];
  9780. while (prev !== pth) {
  9781. ret.push(path.join(pth, 'node_modules/.bin'));
  9782. prev = pth;
  9783. pth = path.resolve(pth, '..');
  9784. }
  9785. // ensure the running `node` binary is used
  9786. ret.push(path.dirname(process.execPath));
  9787. return ret.concat(opts.path).join(path.delimiter);
  9788. };
  9789. module.exports.env = opts => {
  9790. opts = Object.assign({
  9791. env: process.env
  9792. }, opts);
  9793. const env = Object.assign({}, opts.env);
  9794. const path = pathKey({env});
  9795. opts.path = env[path];
  9796. env[path] = module.exports(opts);
  9797. return env;
  9798. };
  9799. /***/ }),
  9800. /***/ 622:
  9801. /***/ (function(module) {
  9802. module.exports = require("path");
  9803. /***/ }),
  9804. /***/ 631:
  9805. /***/ (function(module) {
  9806. module.exports = require("net");
  9807. /***/ }),
  9808. /***/ 649:
  9809. /***/ (function(module, __unusedexports, __webpack_require__) {
  9810. module.exports = getLastPage
  9811. const getPage = __webpack_require__(265)
  9812. function getLastPage (octokit, link, headers) {
  9813. return getPage(octokit, link, 'last', headers)
  9814. }
  9815. /***/ }),
  9816. /***/ 654:
  9817. /***/ (function(module) {
  9818. // This is not the set of all possible signals.
  9819. //
  9820. // It IS, however, the set of all signals that trigger
  9821. // an exit on either Linux or BSD systems. Linux is a
  9822. // superset of the signal names supported on BSD, and
  9823. // the unknown signals just fail to register, so we can
  9824. // catch that easily enough.
  9825. //
  9826. // Don't bother with SIGKILL. It's uncatchable, which
  9827. // means that we can't fire any callbacks anyway.
  9828. //
  9829. // If a user does happen to register a handler on a non-
  9830. // fatal signal like SIGWINCH or something, and then
  9831. // exit, it'll end up firing `process.emit('exit')`, so
  9832. // the handler will be fired anyway.
  9833. //
  9834. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9835. // artificially, inherently leave the process in a
  9836. // state from which it is not safe to try and enter JS
  9837. // listeners.
  9838. module.exports = [
  9839. 'SIGABRT',
  9840. 'SIGALRM',
  9841. 'SIGHUP',
  9842. 'SIGINT',
  9843. 'SIGTERM'
  9844. ]
  9845. if (process.platform !== 'win32') {
  9846. module.exports.push(
  9847. 'SIGVTALRM',
  9848. 'SIGXCPU',
  9849. 'SIGXFSZ',
  9850. 'SIGUSR2',
  9851. 'SIGTRAP',
  9852. 'SIGSYS',
  9853. 'SIGQUIT',
  9854. 'SIGIOT'
  9855. // should detect profiler and enable/disable accordingly.
  9856. // see #21
  9857. // 'SIGPROF'
  9858. )
  9859. }
  9860. if (process.platform === 'linux') {
  9861. module.exports.push(
  9862. 'SIGIO',
  9863. 'SIGPOLL',
  9864. 'SIGPWR',
  9865. 'SIGSTKFLT',
  9866. 'SIGUNUSED'
  9867. )
  9868. }
  9869. /***/ }),
  9870. /***/ 656:
  9871. /***/ (function(module, exports) {
  9872. exports = module.exports = SemVer
  9873. var debug
  9874. /* istanbul ignore next */
  9875. if (typeof process === 'object' &&
  9876. process.env &&
  9877. process.env.NODE_DEBUG &&
  9878. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9879. debug = function () {
  9880. var args = Array.prototype.slice.call(arguments, 0)
  9881. args.unshift('SEMVER')
  9882. console.log.apply(console, args)
  9883. }
  9884. } else {
  9885. debug = function () {}
  9886. }
  9887. // Note: this is the semver.org version of the spec that it implements
  9888. // Not necessarily the package version of this code.
  9889. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9890. var MAX_LENGTH = 256
  9891. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9892. /* istanbul ignore next */ 9007199254740991
  9893. // Max safe segment length for coercion.
  9894. var MAX_SAFE_COMPONENT_LENGTH = 16
  9895. // The actual regexps go on exports.re
  9896. var re = exports.re = []
  9897. var src = exports.src = []
  9898. var t = exports.tokens = {}
  9899. var R = 0
  9900. function tok (n) {
  9901. t[n] = R++
  9902. }
  9903. // The following Regular Expressions can be used for tokenizing,
  9904. // validating, and parsing SemVer version strings.
  9905. // ## Numeric Identifier
  9906. // A single `0`, or a non-zero digit followed by zero or more digits.
  9907. tok('NUMERICIDENTIFIER')
  9908. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9909. tok('NUMERICIDENTIFIERLOOSE')
  9910. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9911. // ## Non-numeric Identifier
  9912. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9913. // more letters, digits, or hyphens.
  9914. tok('NONNUMERICIDENTIFIER')
  9915. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9916. // ## Main Version
  9917. // Three dot-separated numeric identifiers.
  9918. tok('MAINVERSION')
  9919. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9920. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9921. '(' + src[t.NUMERICIDENTIFIER] + ')'
  9922. tok('MAINVERSIONLOOSE')
  9923. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9924. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9925. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  9926. // ## Pre-release Version Identifier
  9927. // A numeric identifier, or a non-numeric identifier.
  9928. tok('PRERELEASEIDENTIFIER')
  9929. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  9930. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9931. tok('PRERELEASEIDENTIFIERLOOSE')
  9932. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  9933. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9934. // ## Pre-release Version
  9935. // Hyphen, followed by one or more dot-separated pre-release version
  9936. // identifiers.
  9937. tok('PRERELEASE')
  9938. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  9939. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  9940. tok('PRERELEASELOOSE')
  9941. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  9942. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  9943. // ## Build Metadata Identifier
  9944. // Any combination of digits, letters, or hyphens.
  9945. tok('BUILDIDENTIFIER')
  9946. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  9947. // ## Build Metadata
  9948. // Plus sign, followed by one or more period-separated build metadata
  9949. // identifiers.
  9950. tok('BUILD')
  9951. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  9952. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  9953. // ## Full Version String
  9954. // A main version, followed optionally by a pre-release version and
  9955. // build metadata.
  9956. // Note that the only major, minor, patch, and pre-release sections of
  9957. // the version string are capturing groups. The build metadata is not a
  9958. // capturing group, because it should not ever be used in version
  9959. // comparison.
  9960. tok('FULL')
  9961. tok('FULLPLAIN')
  9962. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  9963. src[t.PRERELEASE] + '?' +
  9964. src[t.BUILD] + '?'
  9965. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  9966. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  9967. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  9968. // common in the npm registry.
  9969. tok('LOOSEPLAIN')
  9970. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  9971. src[t.PRERELEASELOOSE] + '?' +
  9972. src[t.BUILD] + '?'
  9973. tok('LOOSE')
  9974. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  9975. tok('GTLT')
  9976. src[t.GTLT] = '((?:<|>)?=?)'
  9977. // Something like "2.*" or "1.2.x".
  9978. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  9979. // Only the first item is strictly required.
  9980. tok('XRANGEIDENTIFIERLOOSE')
  9981. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  9982. tok('XRANGEIDENTIFIER')
  9983. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  9984. tok('XRANGEPLAIN')
  9985. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  9986. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9987. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9988. '(?:' + src[t.PRERELEASE] + ')?' +
  9989. src[t.BUILD] + '?' +
  9990. ')?)?'
  9991. tok('XRANGEPLAINLOOSE')
  9992. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9993. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9994. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9995. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  9996. src[t.BUILD] + '?' +
  9997. ')?)?'
  9998. tok('XRANGE')
  9999. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10000. tok('XRANGELOOSE')
  10001. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10002. // Coercion.
  10003. // Extract anything that could conceivably be a part of a valid semver
  10004. tok('COERCE')
  10005. src[t.COERCE] = '(^|[^\\d])' +
  10006. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10007. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10008. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10009. '(?:$|[^\\d])'
  10010. tok('COERCERTL')
  10011. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10012. // Tilde ranges.
  10013. // Meaning is "reasonably at or greater than"
  10014. tok('LONETILDE')
  10015. src[t.LONETILDE] = '(?:~>?)'
  10016. tok('TILDETRIM')
  10017. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10018. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10019. var tildeTrimReplace = '$1~'
  10020. tok('TILDE')
  10021. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10022. tok('TILDELOOSE')
  10023. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10024. // Caret ranges.
  10025. // Meaning is "at least and backwards compatible with"
  10026. tok('LONECARET')
  10027. src[t.LONECARET] = '(?:\\^)'
  10028. tok('CARETTRIM')
  10029. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10030. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10031. var caretTrimReplace = '$1^'
  10032. tok('CARET')
  10033. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10034. tok('CARETLOOSE')
  10035. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10036. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10037. tok('COMPARATORLOOSE')
  10038. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10039. tok('COMPARATOR')
  10040. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10041. // An expression to strip any whitespace between the gtlt and the thing
  10042. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10043. tok('COMPARATORTRIM')
  10044. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10045. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10046. // this one has to use the /g flag
  10047. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10048. var comparatorTrimReplace = '$1$2$3'
  10049. // Something like `1.2.3 - 1.2.4`
  10050. // Note that these all use the loose form, because they'll be
  10051. // checked against either the strict or loose comparator form
  10052. // later.
  10053. tok('HYPHENRANGE')
  10054. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10055. '\\s+-\\s+' +
  10056. '(' + src[t.XRANGEPLAIN] + ')' +
  10057. '\\s*$'
  10058. tok('HYPHENRANGELOOSE')
  10059. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10060. '\\s+-\\s+' +
  10061. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10062. '\\s*$'
  10063. // Star ranges basically just allow anything at all.
  10064. tok('STAR')
  10065. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10066. // Compile to actual regexp objects.
  10067. // All are flag-free, unless they were created above with a flag.
  10068. for (var i = 0; i < R; i++) {
  10069. debug(i, src[i])
  10070. if (!re[i]) {
  10071. re[i] = new RegExp(src[i])
  10072. }
  10073. }
  10074. exports.parse = parse
  10075. function parse (version, options) {
  10076. if (!options || typeof options !== 'object') {
  10077. options = {
  10078. loose: !!options,
  10079. includePrerelease: false
  10080. }
  10081. }
  10082. if (version instanceof SemVer) {
  10083. return version
  10084. }
  10085. if (typeof version !== 'string') {
  10086. return null
  10087. }
  10088. if (version.length > MAX_LENGTH) {
  10089. return null
  10090. }
  10091. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10092. if (!r.test(version)) {
  10093. return null
  10094. }
  10095. try {
  10096. return new SemVer(version, options)
  10097. } catch (er) {
  10098. return null
  10099. }
  10100. }
  10101. exports.valid = valid
  10102. function valid (version, options) {
  10103. var v = parse(version, options)
  10104. return v ? v.version : null
  10105. }
  10106. exports.clean = clean
  10107. function clean (version, options) {
  10108. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10109. return s ? s.version : null
  10110. }
  10111. exports.SemVer = SemVer
  10112. function SemVer (version, options) {
  10113. if (!options || typeof options !== 'object') {
  10114. options = {
  10115. loose: !!options,
  10116. includePrerelease: false
  10117. }
  10118. }
  10119. if (version instanceof SemVer) {
  10120. if (version.loose === options.loose) {
  10121. return version
  10122. } else {
  10123. version = version.version
  10124. }
  10125. } else if (typeof version !== 'string') {
  10126. throw new TypeError('Invalid Version: ' + version)
  10127. }
  10128. if (version.length > MAX_LENGTH) {
  10129. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10130. }
  10131. if (!(this instanceof SemVer)) {
  10132. return new SemVer(version, options)
  10133. }
  10134. debug('SemVer', version, options)
  10135. this.options = options
  10136. this.loose = !!options.loose
  10137. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10138. if (!m) {
  10139. throw new TypeError('Invalid Version: ' + version)
  10140. }
  10141. this.raw = version
  10142. // these are actually numbers
  10143. this.major = +m[1]
  10144. this.minor = +m[2]
  10145. this.patch = +m[3]
  10146. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10147. throw new TypeError('Invalid major version')
  10148. }
  10149. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10150. throw new TypeError('Invalid minor version')
  10151. }
  10152. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10153. throw new TypeError('Invalid patch version')
  10154. }
  10155. // numberify any prerelease numeric ids
  10156. if (!m[4]) {
  10157. this.prerelease = []
  10158. } else {
  10159. this.prerelease = m[4].split('.').map(function (id) {
  10160. if (/^[0-9]+$/.test(id)) {
  10161. var num = +id
  10162. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10163. return num
  10164. }
  10165. }
  10166. return id
  10167. })
  10168. }
  10169. this.build = m[5] ? m[5].split('.') : []
  10170. this.format()
  10171. }
  10172. SemVer.prototype.format = function () {
  10173. this.version = this.major + '.' + this.minor + '.' + this.patch
  10174. if (this.prerelease.length) {
  10175. this.version += '-' + this.prerelease.join('.')
  10176. }
  10177. return this.version
  10178. }
  10179. SemVer.prototype.toString = function () {
  10180. return this.version
  10181. }
  10182. SemVer.prototype.compare = function (other) {
  10183. debug('SemVer.compare', this.version, this.options, other)
  10184. if (!(other instanceof SemVer)) {
  10185. other = new SemVer(other, this.options)
  10186. }
  10187. return this.compareMain(other) || this.comparePre(other)
  10188. }
  10189. SemVer.prototype.compareMain = function (other) {
  10190. if (!(other instanceof SemVer)) {
  10191. other = new SemVer(other, this.options)
  10192. }
  10193. return compareIdentifiers(this.major, other.major) ||
  10194. compareIdentifiers(this.minor, other.minor) ||
  10195. compareIdentifiers(this.patch, other.patch)
  10196. }
  10197. SemVer.prototype.comparePre = function (other) {
  10198. if (!(other instanceof SemVer)) {
  10199. other = new SemVer(other, this.options)
  10200. }
  10201. // NOT having a prerelease is > having one
  10202. if (this.prerelease.length && !other.prerelease.length) {
  10203. return -1
  10204. } else if (!this.prerelease.length && other.prerelease.length) {
  10205. return 1
  10206. } else if (!this.prerelease.length && !other.prerelease.length) {
  10207. return 0
  10208. }
  10209. var i = 0
  10210. do {
  10211. var a = this.prerelease[i]
  10212. var b = other.prerelease[i]
  10213. debug('prerelease compare', i, a, b)
  10214. if (a === undefined && b === undefined) {
  10215. return 0
  10216. } else if (b === undefined) {
  10217. return 1
  10218. } else if (a === undefined) {
  10219. return -1
  10220. } else if (a === b) {
  10221. continue
  10222. } else {
  10223. return compareIdentifiers(a, b)
  10224. }
  10225. } while (++i)
  10226. }
  10227. SemVer.prototype.compareBuild = function (other) {
  10228. if (!(other instanceof SemVer)) {
  10229. other = new SemVer(other, this.options)
  10230. }
  10231. var i = 0
  10232. do {
  10233. var a = this.build[i]
  10234. var b = other.build[i]
  10235. debug('prerelease compare', i, a, b)
  10236. if (a === undefined && b === undefined) {
  10237. return 0
  10238. } else if (b === undefined) {
  10239. return 1
  10240. } else if (a === undefined) {
  10241. return -1
  10242. } else if (a === b) {
  10243. continue
  10244. } else {
  10245. return compareIdentifiers(a, b)
  10246. }
  10247. } while (++i)
  10248. }
  10249. // preminor will bump the version up to the next minor release, and immediately
  10250. // down to pre-release. premajor and prepatch work the same way.
  10251. SemVer.prototype.inc = function (release, identifier) {
  10252. switch (release) {
  10253. case 'premajor':
  10254. this.prerelease.length = 0
  10255. this.patch = 0
  10256. this.minor = 0
  10257. this.major++
  10258. this.inc('pre', identifier)
  10259. break
  10260. case 'preminor':
  10261. this.prerelease.length = 0
  10262. this.patch = 0
  10263. this.minor++
  10264. this.inc('pre', identifier)
  10265. break
  10266. case 'prepatch':
  10267. // If this is already a prerelease, it will bump to the next version
  10268. // drop any prereleases that might already exist, since they are not
  10269. // relevant at this point.
  10270. this.prerelease.length = 0
  10271. this.inc('patch', identifier)
  10272. this.inc('pre', identifier)
  10273. break
  10274. // If the input is a non-prerelease version, this acts the same as
  10275. // prepatch.
  10276. case 'prerelease':
  10277. if (this.prerelease.length === 0) {
  10278. this.inc('patch', identifier)
  10279. }
  10280. this.inc('pre', identifier)
  10281. break
  10282. case 'major':
  10283. // If this is a pre-major version, bump up to the same major version.
  10284. // Otherwise increment major.
  10285. // 1.0.0-5 bumps to 1.0.0
  10286. // 1.1.0 bumps to 2.0.0
  10287. if (this.minor !== 0 ||
  10288. this.patch !== 0 ||
  10289. this.prerelease.length === 0) {
  10290. this.major++
  10291. }
  10292. this.minor = 0
  10293. this.patch = 0
  10294. this.prerelease = []
  10295. break
  10296. case 'minor':
  10297. // If this is a pre-minor version, bump up to the same minor version.
  10298. // Otherwise increment minor.
  10299. // 1.2.0-5 bumps to 1.2.0
  10300. // 1.2.1 bumps to 1.3.0
  10301. if (this.patch !== 0 || this.prerelease.length === 0) {
  10302. this.minor++
  10303. }
  10304. this.patch = 0
  10305. this.prerelease = []
  10306. break
  10307. case 'patch':
  10308. // If this is not a pre-release version, it will increment the patch.
  10309. // If it is a pre-release it will bump up to the same patch version.
  10310. // 1.2.0-5 patches to 1.2.0
  10311. // 1.2.0 patches to 1.2.1
  10312. if (this.prerelease.length === 0) {
  10313. this.patch++
  10314. }
  10315. this.prerelease = []
  10316. break
  10317. // This probably shouldn't be used publicly.
  10318. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10319. case 'pre':
  10320. if (this.prerelease.length === 0) {
  10321. this.prerelease = [0]
  10322. } else {
  10323. var i = this.prerelease.length
  10324. while (--i >= 0) {
  10325. if (typeof this.prerelease[i] === 'number') {
  10326. this.prerelease[i]++
  10327. i = -2
  10328. }
  10329. }
  10330. if (i === -1) {
  10331. // didn't increment anything
  10332. this.prerelease.push(0)
  10333. }
  10334. }
  10335. if (identifier) {
  10336. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10337. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10338. if (this.prerelease[0] === identifier) {
  10339. if (isNaN(this.prerelease[1])) {
  10340. this.prerelease = [identifier, 0]
  10341. }
  10342. } else {
  10343. this.prerelease = [identifier, 0]
  10344. }
  10345. }
  10346. break
  10347. default:
  10348. throw new Error('invalid increment argument: ' + release)
  10349. }
  10350. this.format()
  10351. this.raw = this.version
  10352. return this
  10353. }
  10354. exports.inc = inc
  10355. function inc (version, release, loose, identifier) {
  10356. if (typeof (loose) === 'string') {
  10357. identifier = loose
  10358. loose = undefined
  10359. }
  10360. try {
  10361. return new SemVer(version, loose).inc(release, identifier).version
  10362. } catch (er) {
  10363. return null
  10364. }
  10365. }
  10366. exports.diff = diff
  10367. function diff (version1, version2) {
  10368. if (eq(version1, version2)) {
  10369. return null
  10370. } else {
  10371. var v1 = parse(version1)
  10372. var v2 = parse(version2)
  10373. var prefix = ''
  10374. if (v1.prerelease.length || v2.prerelease.length) {
  10375. prefix = 'pre'
  10376. var defaultResult = 'prerelease'
  10377. }
  10378. for (var key in v1) {
  10379. if (key === 'major' || key === 'minor' || key === 'patch') {
  10380. if (v1[key] !== v2[key]) {
  10381. return prefix + key
  10382. }
  10383. }
  10384. }
  10385. return defaultResult // may be undefined
  10386. }
  10387. }
  10388. exports.compareIdentifiers = compareIdentifiers
  10389. var numeric = /^[0-9]+$/
  10390. function compareIdentifiers (a, b) {
  10391. var anum = numeric.test(a)
  10392. var bnum = numeric.test(b)
  10393. if (anum && bnum) {
  10394. a = +a
  10395. b = +b
  10396. }
  10397. return a === b ? 0
  10398. : (anum && !bnum) ? -1
  10399. : (bnum && !anum) ? 1
  10400. : a < b ? -1
  10401. : 1
  10402. }
  10403. exports.rcompareIdentifiers = rcompareIdentifiers
  10404. function rcompareIdentifiers (a, b) {
  10405. return compareIdentifiers(b, a)
  10406. }
  10407. exports.major = major
  10408. function major (a, loose) {
  10409. return new SemVer(a, loose).major
  10410. }
  10411. exports.minor = minor
  10412. function minor (a, loose) {
  10413. return new SemVer(a, loose).minor
  10414. }
  10415. exports.patch = patch
  10416. function patch (a, loose) {
  10417. return new SemVer(a, loose).patch
  10418. }
  10419. exports.compare = compare
  10420. function compare (a, b, loose) {
  10421. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10422. }
  10423. exports.compareLoose = compareLoose
  10424. function compareLoose (a, b) {
  10425. return compare(a, b, true)
  10426. }
  10427. exports.compareBuild = compareBuild
  10428. function compareBuild (a, b, loose) {
  10429. var versionA = new SemVer(a, loose)
  10430. var versionB = new SemVer(b, loose)
  10431. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10432. }
  10433. exports.rcompare = rcompare
  10434. function rcompare (a, b, loose) {
  10435. return compare(b, a, loose)
  10436. }
  10437. exports.sort = sort
  10438. function sort (list, loose) {
  10439. return list.sort(function (a, b) {
  10440. return exports.compareBuild(a, b, loose)
  10441. })
  10442. }
  10443. exports.rsort = rsort
  10444. function rsort (list, loose) {
  10445. return list.sort(function (a, b) {
  10446. return exports.compareBuild(b, a, loose)
  10447. })
  10448. }
  10449. exports.gt = gt
  10450. function gt (a, b, loose) {
  10451. return compare(a, b, loose) > 0
  10452. }
  10453. exports.lt = lt
  10454. function lt (a, b, loose) {
  10455. return compare(a, b, loose) < 0
  10456. }
  10457. exports.eq = eq
  10458. function eq (a, b, loose) {
  10459. return compare(a, b, loose) === 0
  10460. }
  10461. exports.neq = neq
  10462. function neq (a, b, loose) {
  10463. return compare(a, b, loose) !== 0
  10464. }
  10465. exports.gte = gte
  10466. function gte (a, b, loose) {
  10467. return compare(a, b, loose) >= 0
  10468. }
  10469. exports.lte = lte
  10470. function lte (a, b, loose) {
  10471. return compare(a, b, loose) <= 0
  10472. }
  10473. exports.cmp = cmp
  10474. function cmp (a, op, b, loose) {
  10475. switch (op) {
  10476. case '===':
  10477. if (typeof a === 'object')
  10478. a = a.version
  10479. if (typeof b === 'object')
  10480. b = b.version
  10481. return a === b
  10482. case '!==':
  10483. if (typeof a === 'object')
  10484. a = a.version
  10485. if (typeof b === 'object')
  10486. b = b.version
  10487. return a !== b
  10488. case '':
  10489. case '=':
  10490. case '==':
  10491. return eq(a, b, loose)
  10492. case '!=':
  10493. return neq(a, b, loose)
  10494. case '>':
  10495. return gt(a, b, loose)
  10496. case '>=':
  10497. return gte(a, b, loose)
  10498. case '<':
  10499. return lt(a, b, loose)
  10500. case '<=':
  10501. return lte(a, b, loose)
  10502. default:
  10503. throw new TypeError('Invalid operator: ' + op)
  10504. }
  10505. }
  10506. exports.Comparator = Comparator
  10507. function Comparator (comp, options) {
  10508. if (!options || typeof options !== 'object') {
  10509. options = {
  10510. loose: !!options,
  10511. includePrerelease: false
  10512. }
  10513. }
  10514. if (comp instanceof Comparator) {
  10515. if (comp.loose === !!options.loose) {
  10516. return comp
  10517. } else {
  10518. comp = comp.value
  10519. }
  10520. }
  10521. if (!(this instanceof Comparator)) {
  10522. return new Comparator(comp, options)
  10523. }
  10524. debug('comparator', comp, options)
  10525. this.options = options
  10526. this.loose = !!options.loose
  10527. this.parse(comp)
  10528. if (this.semver === ANY) {
  10529. this.value = ''
  10530. } else {
  10531. this.value = this.operator + this.semver.version
  10532. }
  10533. debug('comp', this)
  10534. }
  10535. var ANY = {}
  10536. Comparator.prototype.parse = function (comp) {
  10537. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10538. var m = comp.match(r)
  10539. if (!m) {
  10540. throw new TypeError('Invalid comparator: ' + comp)
  10541. }
  10542. this.operator = m[1] !== undefined ? m[1] : ''
  10543. if (this.operator === '=') {
  10544. this.operator = ''
  10545. }
  10546. // if it literally is just '>' or '' then allow anything.
  10547. if (!m[2]) {
  10548. this.semver = ANY
  10549. } else {
  10550. this.semver = new SemVer(m[2], this.options.loose)
  10551. }
  10552. }
  10553. Comparator.prototype.toString = function () {
  10554. return this.value
  10555. }
  10556. Comparator.prototype.test = function (version) {
  10557. debug('Comparator.test', version, this.options.loose)
  10558. if (this.semver === ANY || version === ANY) {
  10559. return true
  10560. }
  10561. if (typeof version === 'string') {
  10562. try {
  10563. version = new SemVer(version, this.options)
  10564. } catch (er) {
  10565. return false
  10566. }
  10567. }
  10568. return cmp(version, this.operator, this.semver, this.options)
  10569. }
  10570. Comparator.prototype.intersects = function (comp, options) {
  10571. if (!(comp instanceof Comparator)) {
  10572. throw new TypeError('a Comparator is required')
  10573. }
  10574. if (!options || typeof options !== 'object') {
  10575. options = {
  10576. loose: !!options,
  10577. includePrerelease: false
  10578. }
  10579. }
  10580. var rangeTmp
  10581. if (this.operator === '') {
  10582. if (this.value === '') {
  10583. return true
  10584. }
  10585. rangeTmp = new Range(comp.value, options)
  10586. return satisfies(this.value, rangeTmp, options)
  10587. } else if (comp.operator === '') {
  10588. if (comp.value === '') {
  10589. return true
  10590. }
  10591. rangeTmp = new Range(this.value, options)
  10592. return satisfies(comp.semver, rangeTmp, options)
  10593. }
  10594. var sameDirectionIncreasing =
  10595. (this.operator === '>=' || this.operator === '>') &&
  10596. (comp.operator === '>=' || comp.operator === '>')
  10597. var sameDirectionDecreasing =
  10598. (this.operator === '<=' || this.operator === '<') &&
  10599. (comp.operator === '<=' || comp.operator === '<')
  10600. var sameSemVer = this.semver.version === comp.semver.version
  10601. var differentDirectionsInclusive =
  10602. (this.operator === '>=' || this.operator === '<=') &&
  10603. (comp.operator === '>=' || comp.operator === '<=')
  10604. var oppositeDirectionsLessThan =
  10605. cmp(this.semver, '<', comp.semver, options) &&
  10606. ((this.operator === '>=' || this.operator === '>') &&
  10607. (comp.operator === '<=' || comp.operator === '<'))
  10608. var oppositeDirectionsGreaterThan =
  10609. cmp(this.semver, '>', comp.semver, options) &&
  10610. ((this.operator === '<=' || this.operator === '<') &&
  10611. (comp.operator === '>=' || comp.operator === '>'))
  10612. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10613. (sameSemVer && differentDirectionsInclusive) ||
  10614. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10615. }
  10616. exports.Range = Range
  10617. function Range (range, options) {
  10618. if (!options || typeof options !== 'object') {
  10619. options = {
  10620. loose: !!options,
  10621. includePrerelease: false
  10622. }
  10623. }
  10624. if (range instanceof Range) {
  10625. if (range.loose === !!options.loose &&
  10626. range.includePrerelease === !!options.includePrerelease) {
  10627. return range
  10628. } else {
  10629. return new Range(range.raw, options)
  10630. }
  10631. }
  10632. if (range instanceof Comparator) {
  10633. return new Range(range.value, options)
  10634. }
  10635. if (!(this instanceof Range)) {
  10636. return new Range(range, options)
  10637. }
  10638. this.options = options
  10639. this.loose = !!options.loose
  10640. this.includePrerelease = !!options.includePrerelease
  10641. // First, split based on boolean or ||
  10642. this.raw = range
  10643. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10644. return this.parseRange(range.trim())
  10645. }, this).filter(function (c) {
  10646. // throw out any that are not relevant for whatever reason
  10647. return c.length
  10648. })
  10649. if (!this.set.length) {
  10650. throw new TypeError('Invalid SemVer Range: ' + range)
  10651. }
  10652. this.format()
  10653. }
  10654. Range.prototype.format = function () {
  10655. this.range = this.set.map(function (comps) {
  10656. return comps.join(' ').trim()
  10657. }).join('||').trim()
  10658. return this.range
  10659. }
  10660. Range.prototype.toString = function () {
  10661. return this.range
  10662. }
  10663. Range.prototype.parseRange = function (range) {
  10664. var loose = this.options.loose
  10665. range = range.trim()
  10666. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10667. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10668. range = range.replace(hr, hyphenReplace)
  10669. debug('hyphen replace', range)
  10670. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10671. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10672. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10673. // `~ 1.2.3` => `~1.2.3`
  10674. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10675. // `^ 1.2.3` => `^1.2.3`
  10676. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10677. // normalize spaces
  10678. range = range.split(/\s+/).join(' ')
  10679. // At this point, the range is completely trimmed and
  10680. // ready to be split into comparators.
  10681. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10682. var set = range.split(' ').map(function (comp) {
  10683. return parseComparator(comp, this.options)
  10684. }, this).join(' ').split(/\s+/)
  10685. if (this.options.loose) {
  10686. // in loose mode, throw out any that are not valid comparators
  10687. set = set.filter(function (comp) {
  10688. return !!comp.match(compRe)
  10689. })
  10690. }
  10691. set = set.map(function (comp) {
  10692. return new Comparator(comp, this.options)
  10693. }, this)
  10694. return set
  10695. }
  10696. Range.prototype.intersects = function (range, options) {
  10697. if (!(range instanceof Range)) {
  10698. throw new TypeError('a Range is required')
  10699. }
  10700. return this.set.some(function (thisComparators) {
  10701. return (
  10702. isSatisfiable(thisComparators, options) &&
  10703. range.set.some(function (rangeComparators) {
  10704. return (
  10705. isSatisfiable(rangeComparators, options) &&
  10706. thisComparators.every(function (thisComparator) {
  10707. return rangeComparators.every(function (rangeComparator) {
  10708. return thisComparator.intersects(rangeComparator, options)
  10709. })
  10710. })
  10711. )
  10712. })
  10713. )
  10714. })
  10715. }
  10716. // take a set of comparators and determine whether there
  10717. // exists a version which can satisfy it
  10718. function isSatisfiable (comparators, options) {
  10719. var result = true
  10720. var remainingComparators = comparators.slice()
  10721. var testComparator = remainingComparators.pop()
  10722. while (result && remainingComparators.length) {
  10723. result = remainingComparators.every(function (otherComparator) {
  10724. return testComparator.intersects(otherComparator, options)
  10725. })
  10726. testComparator = remainingComparators.pop()
  10727. }
  10728. return result
  10729. }
  10730. // Mostly just for testing and legacy API reasons
  10731. exports.toComparators = toComparators
  10732. function toComparators (range, options) {
  10733. return new Range(range, options).set.map(function (comp) {
  10734. return comp.map(function (c) {
  10735. return c.value
  10736. }).join(' ').trim().split(' ')
  10737. })
  10738. }
  10739. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10740. // already replaced the hyphen ranges
  10741. // turn into a set of JUST comparators.
  10742. function parseComparator (comp, options) {
  10743. debug('comp', comp, options)
  10744. comp = replaceCarets(comp, options)
  10745. debug('caret', comp)
  10746. comp = replaceTildes(comp, options)
  10747. debug('tildes', comp)
  10748. comp = replaceXRanges(comp, options)
  10749. debug('xrange', comp)
  10750. comp = replaceStars(comp, options)
  10751. debug('stars', comp)
  10752. return comp
  10753. }
  10754. function isX (id) {
  10755. return !id || id.toLowerCase() === 'x' || id === '*'
  10756. }
  10757. // ~, ~> --> * (any, kinda silly)
  10758. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10759. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10760. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10761. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10762. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10763. function replaceTildes (comp, options) {
  10764. return comp.trim().split(/\s+/).map(function (comp) {
  10765. return replaceTilde(comp, options)
  10766. }).join(' ')
  10767. }
  10768. function replaceTilde (comp, options) {
  10769. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10770. return comp.replace(r, function (_, M, m, p, pr) {
  10771. debug('tilde', comp, _, M, m, p, pr)
  10772. var ret
  10773. if (isX(M)) {
  10774. ret = ''
  10775. } else if (isX(m)) {
  10776. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10777. } else if (isX(p)) {
  10778. // ~1.2 == >=1.2.0 <1.3.0
  10779. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10780. } else if (pr) {
  10781. debug('replaceTilde pr', pr)
  10782. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10783. ' <' + M + '.' + (+m + 1) + '.0'
  10784. } else {
  10785. // ~1.2.3 == >=1.2.3 <1.3.0
  10786. ret = '>=' + M + '.' + m + '.' + p +
  10787. ' <' + M + '.' + (+m + 1) + '.0'
  10788. }
  10789. debug('tilde return', ret)
  10790. return ret
  10791. })
  10792. }
  10793. // ^ --> * (any, kinda silly)
  10794. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10795. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10796. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10797. // ^1.2.3 --> >=1.2.3 <2.0.0
  10798. // ^1.2.0 --> >=1.2.0 <2.0.0
  10799. function replaceCarets (comp, options) {
  10800. return comp.trim().split(/\s+/).map(function (comp) {
  10801. return replaceCaret(comp, options)
  10802. }).join(' ')
  10803. }
  10804. function replaceCaret (comp, options) {
  10805. debug('caret', comp, options)
  10806. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10807. return comp.replace(r, function (_, M, m, p, pr) {
  10808. debug('caret', comp, _, M, m, p, pr)
  10809. var ret
  10810. if (isX(M)) {
  10811. ret = ''
  10812. } else if (isX(m)) {
  10813. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10814. } else if (isX(p)) {
  10815. if (M === '0') {
  10816. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10817. } else {
  10818. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10819. }
  10820. } else if (pr) {
  10821. debug('replaceCaret pr', pr)
  10822. if (M === '0') {
  10823. if (m === '0') {
  10824. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10825. ' <' + M + '.' + m + '.' + (+p + 1)
  10826. } else {
  10827. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10828. ' <' + M + '.' + (+m + 1) + '.0'
  10829. }
  10830. } else {
  10831. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10832. ' <' + (+M + 1) + '.0.0'
  10833. }
  10834. } else {
  10835. debug('no pr')
  10836. if (M === '0') {
  10837. if (m === '0') {
  10838. ret = '>=' + M + '.' + m + '.' + p +
  10839. ' <' + M + '.' + m + '.' + (+p + 1)
  10840. } else {
  10841. ret = '>=' + M + '.' + m + '.' + p +
  10842. ' <' + M + '.' + (+m + 1) + '.0'
  10843. }
  10844. } else {
  10845. ret = '>=' + M + '.' + m + '.' + p +
  10846. ' <' + (+M + 1) + '.0.0'
  10847. }
  10848. }
  10849. debug('caret return', ret)
  10850. return ret
  10851. })
  10852. }
  10853. function replaceXRanges (comp, options) {
  10854. debug('replaceXRanges', comp, options)
  10855. return comp.split(/\s+/).map(function (comp) {
  10856. return replaceXRange(comp, options)
  10857. }).join(' ')
  10858. }
  10859. function replaceXRange (comp, options) {
  10860. comp = comp.trim()
  10861. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10862. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10863. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10864. var xM = isX(M)
  10865. var xm = xM || isX(m)
  10866. var xp = xm || isX(p)
  10867. var anyX = xp
  10868. if (gtlt === '=' && anyX) {
  10869. gtlt = ''
  10870. }
  10871. // if we're including prereleases in the match, then we need
  10872. // to fix this to -0, the lowest possible prerelease value
  10873. pr = options.includePrerelease ? '-0' : ''
  10874. if (xM) {
  10875. if (gtlt === '>' || gtlt === '<') {
  10876. // nothing is allowed
  10877. ret = '<0.0.0-0'
  10878. } else {
  10879. // nothing is forbidden
  10880. ret = '*'
  10881. }
  10882. } else if (gtlt && anyX) {
  10883. // we know patch is an x, because we have any x at all.
  10884. // replace X with 0
  10885. if (xm) {
  10886. m = 0
  10887. }
  10888. p = 0
  10889. if (gtlt === '>') {
  10890. // >1 => >=2.0.0
  10891. // >1.2 => >=1.3.0
  10892. // >1.2.3 => >= 1.2.4
  10893. gtlt = '>='
  10894. if (xm) {
  10895. M = +M + 1
  10896. m = 0
  10897. p = 0
  10898. } else {
  10899. m = +m + 1
  10900. p = 0
  10901. }
  10902. } else if (gtlt === '<=') {
  10903. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10904. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10905. gtlt = '<'
  10906. if (xm) {
  10907. M = +M + 1
  10908. } else {
  10909. m = +m + 1
  10910. }
  10911. }
  10912. ret = gtlt + M + '.' + m + '.' + p + pr
  10913. } else if (xm) {
  10914. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10915. } else if (xp) {
  10916. ret = '>=' + M + '.' + m + '.0' + pr +
  10917. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10918. }
  10919. debug('xRange return', ret)
  10920. return ret
  10921. })
  10922. }
  10923. // Because * is AND-ed with everything else in the comparator,
  10924. // and '' means "any version", just remove the *s entirely.
  10925. function replaceStars (comp, options) {
  10926. debug('replaceStars', comp, options)
  10927. // Looseness is ignored here. star is always as loose as it gets!
  10928. return comp.trim().replace(re[t.STAR], '')
  10929. }
  10930. // This function is passed to string.replace(re[t.HYPHENRANGE])
  10931. // M, m, patch, prerelease, build
  10932. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  10933. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  10934. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  10935. function hyphenReplace ($0,
  10936. from, fM, fm, fp, fpr, fb,
  10937. to, tM, tm, tp, tpr, tb) {
  10938. if (isX(fM)) {
  10939. from = ''
  10940. } else if (isX(fm)) {
  10941. from = '>=' + fM + '.0.0'
  10942. } else if (isX(fp)) {
  10943. from = '>=' + fM + '.' + fm + '.0'
  10944. } else {
  10945. from = '>=' + from
  10946. }
  10947. if (isX(tM)) {
  10948. to = ''
  10949. } else if (isX(tm)) {
  10950. to = '<' + (+tM + 1) + '.0.0'
  10951. } else if (isX(tp)) {
  10952. to = '<' + tM + '.' + (+tm + 1) + '.0'
  10953. } else if (tpr) {
  10954. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  10955. } else {
  10956. to = '<=' + to
  10957. }
  10958. return (from + ' ' + to).trim()
  10959. }
  10960. // if ANY of the sets match ALL of its comparators, then pass
  10961. Range.prototype.test = function (version) {
  10962. if (!version) {
  10963. return false
  10964. }
  10965. if (typeof version === 'string') {
  10966. try {
  10967. version = new SemVer(version, this.options)
  10968. } catch (er) {
  10969. return false
  10970. }
  10971. }
  10972. for (var i = 0; i < this.set.length; i++) {
  10973. if (testSet(this.set[i], version, this.options)) {
  10974. return true
  10975. }
  10976. }
  10977. return false
  10978. }
  10979. function testSet (set, version, options) {
  10980. for (var i = 0; i < set.length; i++) {
  10981. if (!set[i].test(version)) {
  10982. return false
  10983. }
  10984. }
  10985. if (version.prerelease.length && !options.includePrerelease) {
  10986. // Find the set of versions that are allowed to have prereleases
  10987. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  10988. // That should allow `1.2.3-pr.2` to pass.
  10989. // However, `1.2.4-alpha.notready` should NOT be allowed,
  10990. // even though it's within the range set by the comparators.
  10991. for (i = 0; i < set.length; i++) {
  10992. debug(set[i].semver)
  10993. if (set[i].semver === ANY) {
  10994. continue
  10995. }
  10996. if (set[i].semver.prerelease.length > 0) {
  10997. var allowed = set[i].semver
  10998. if (allowed.major === version.major &&
  10999. allowed.minor === version.minor &&
  11000. allowed.patch === version.patch) {
  11001. return true
  11002. }
  11003. }
  11004. }
  11005. // Version has a -pre, but it's not one of the ones we like.
  11006. return false
  11007. }
  11008. return true
  11009. }
  11010. exports.satisfies = satisfies
  11011. function satisfies (version, range, options) {
  11012. try {
  11013. range = new Range(range, options)
  11014. } catch (er) {
  11015. return false
  11016. }
  11017. return range.test(version)
  11018. }
  11019. exports.maxSatisfying = maxSatisfying
  11020. function maxSatisfying (versions, range, options) {
  11021. var max = null
  11022. var maxSV = null
  11023. try {
  11024. var rangeObj = new Range(range, options)
  11025. } catch (er) {
  11026. return null
  11027. }
  11028. versions.forEach(function (v) {
  11029. if (rangeObj.test(v)) {
  11030. // satisfies(v, range, options)
  11031. if (!max || maxSV.compare(v) === -1) {
  11032. // compare(max, v, true)
  11033. max = v
  11034. maxSV = new SemVer(max, options)
  11035. }
  11036. }
  11037. })
  11038. return max
  11039. }
  11040. exports.minSatisfying = minSatisfying
  11041. function minSatisfying (versions, range, options) {
  11042. var min = null
  11043. var minSV = null
  11044. try {
  11045. var rangeObj = new Range(range, options)
  11046. } catch (er) {
  11047. return null
  11048. }
  11049. versions.forEach(function (v) {
  11050. if (rangeObj.test(v)) {
  11051. // satisfies(v, range, options)
  11052. if (!min || minSV.compare(v) === 1) {
  11053. // compare(min, v, true)
  11054. min = v
  11055. minSV = new SemVer(min, options)
  11056. }
  11057. }
  11058. })
  11059. return min
  11060. }
  11061. exports.minVersion = minVersion
  11062. function minVersion (range, loose) {
  11063. range = new Range(range, loose)
  11064. var minver = new SemVer('0.0.0')
  11065. if (range.test(minver)) {
  11066. return minver
  11067. }
  11068. minver = new SemVer('0.0.0-0')
  11069. if (range.test(minver)) {
  11070. return minver
  11071. }
  11072. minver = null
  11073. for (var i = 0; i < range.set.length; ++i) {
  11074. var comparators = range.set[i]
  11075. comparators.forEach(function (comparator) {
  11076. // Clone to avoid manipulating the comparator's semver object.
  11077. var compver = new SemVer(comparator.semver.version)
  11078. switch (comparator.operator) {
  11079. case '>':
  11080. if (compver.prerelease.length === 0) {
  11081. compver.patch++
  11082. } else {
  11083. compver.prerelease.push(0)
  11084. }
  11085. compver.raw = compver.format()
  11086. /* fallthrough */
  11087. case '':
  11088. case '>=':
  11089. if (!minver || gt(minver, compver)) {
  11090. minver = compver
  11091. }
  11092. break
  11093. case '<':
  11094. case '<=':
  11095. /* Ignore maximum versions */
  11096. break
  11097. /* istanbul ignore next */
  11098. default:
  11099. throw new Error('Unexpected operation: ' + comparator.operator)
  11100. }
  11101. })
  11102. }
  11103. if (minver && range.test(minver)) {
  11104. return minver
  11105. }
  11106. return null
  11107. }
  11108. exports.validRange = validRange
  11109. function validRange (range, options) {
  11110. try {
  11111. // Return '*' instead of '' so that truthiness works.
  11112. // This will throw if it's invalid anyway
  11113. return new Range(range, options).range || '*'
  11114. } catch (er) {
  11115. return null
  11116. }
  11117. }
  11118. // Determine if version is less than all the versions possible in the range
  11119. exports.ltr = ltr
  11120. function ltr (version, range, options) {
  11121. return outside(version, range, '<', options)
  11122. }
  11123. // Determine if version is greater than all the versions possible in the range.
  11124. exports.gtr = gtr
  11125. function gtr (version, range, options) {
  11126. return outside(version, range, '>', options)
  11127. }
  11128. exports.outside = outside
  11129. function outside (version, range, hilo, options) {
  11130. version = new SemVer(version, options)
  11131. range = new Range(range, options)
  11132. var gtfn, ltefn, ltfn, comp, ecomp
  11133. switch (hilo) {
  11134. case '>':
  11135. gtfn = gt
  11136. ltefn = lte
  11137. ltfn = lt
  11138. comp = '>'
  11139. ecomp = '>='
  11140. break
  11141. case '<':
  11142. gtfn = lt
  11143. ltefn = gte
  11144. ltfn = gt
  11145. comp = '<'
  11146. ecomp = '<='
  11147. break
  11148. default:
  11149. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11150. }
  11151. // If it satisifes the range it is not outside
  11152. if (satisfies(version, range, options)) {
  11153. return false
  11154. }
  11155. // From now on, variable terms are as if we're in "gtr" mode.
  11156. // but note that everything is flipped for the "ltr" function.
  11157. for (var i = 0; i < range.set.length; ++i) {
  11158. var comparators = range.set[i]
  11159. var high = null
  11160. var low = null
  11161. comparators.forEach(function (comparator) {
  11162. if (comparator.semver === ANY) {
  11163. comparator = new Comparator('>=0.0.0')
  11164. }
  11165. high = high || comparator
  11166. low = low || comparator
  11167. if (gtfn(comparator.semver, high.semver, options)) {
  11168. high = comparator
  11169. } else if (ltfn(comparator.semver, low.semver, options)) {
  11170. low = comparator
  11171. }
  11172. })
  11173. // If the edge version comparator has a operator then our version
  11174. // isn't outside it
  11175. if (high.operator === comp || high.operator === ecomp) {
  11176. return false
  11177. }
  11178. // If the lowest version comparator has an operator and our version
  11179. // is less than it then it isn't higher than the range
  11180. if ((!low.operator || low.operator === comp) &&
  11181. ltefn(version, low.semver)) {
  11182. return false
  11183. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11184. return false
  11185. }
  11186. }
  11187. return true
  11188. }
  11189. exports.prerelease = prerelease
  11190. function prerelease (version, options) {
  11191. var parsed = parse(version, options)
  11192. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11193. }
  11194. exports.intersects = intersects
  11195. function intersects (r1, r2, options) {
  11196. r1 = new Range(r1, options)
  11197. r2 = new Range(r2, options)
  11198. return r1.intersects(r2)
  11199. }
  11200. exports.coerce = coerce
  11201. function coerce (version, options) {
  11202. if (version instanceof SemVer) {
  11203. return version
  11204. }
  11205. if (typeof version === 'number') {
  11206. version = String(version)
  11207. }
  11208. if (typeof version !== 'string') {
  11209. return null
  11210. }
  11211. options = options || {}
  11212. var match = null
  11213. if (!options.rtl) {
  11214. match = version.match(re[t.COERCE])
  11215. } else {
  11216. // Find the right-most coercible string that does not share
  11217. // a terminus with a more left-ward coercible string.
  11218. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11219. //
  11220. // Walk through the string checking with a /g regexp
  11221. // Manually set the index so as to pick up overlapping matches.
  11222. // Stop when we get a match that ends at the string end, since no
  11223. // coercible string can be more right-ward without the same terminus.
  11224. var next
  11225. while ((next = re[t.COERCERTL].exec(version)) &&
  11226. (!match || match.index + match[0].length !== version.length)
  11227. ) {
  11228. if (!match ||
  11229. next.index + next[0].length !== match.index + match[0].length) {
  11230. match = next
  11231. }
  11232. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11233. }
  11234. // leave it in a clean state
  11235. re[t.COERCERTL].lastIndex = -1
  11236. }
  11237. if (match === null) {
  11238. return null
  11239. }
  11240. return parse(match[2] +
  11241. '.' + (match[3] || '0') +
  11242. '.' + (match[4] || '0'), options)
  11243. }
  11244. /***/ }),
  11245. /***/ 669:
  11246. /***/ (function(module) {
  11247. module.exports = require("util");
  11248. /***/ }),
  11249. /***/ 672:
  11250. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11251. "use strict";
  11252. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11253. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11254. return new (P || (P = Promise))(function (resolve, reject) {
  11255. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11256. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11257. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11258. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11259. });
  11260. };
  11261. var _a;
  11262. Object.defineProperty(exports, "__esModule", { value: true });
  11263. const assert_1 = __webpack_require__(357);
  11264. const fs = __webpack_require__(747);
  11265. const path = __webpack_require__(622);
  11266. _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;
  11267. exports.IS_WINDOWS = process.platform === 'win32';
  11268. function exists(fsPath) {
  11269. return __awaiter(this, void 0, void 0, function* () {
  11270. try {
  11271. yield exports.stat(fsPath);
  11272. }
  11273. catch (err) {
  11274. if (err.code === 'ENOENT') {
  11275. return false;
  11276. }
  11277. throw err;
  11278. }
  11279. return true;
  11280. });
  11281. }
  11282. exports.exists = exists;
  11283. function isDirectory(fsPath, useStat = false) {
  11284. return __awaiter(this, void 0, void 0, function* () {
  11285. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11286. return stats.isDirectory();
  11287. });
  11288. }
  11289. exports.isDirectory = isDirectory;
  11290. /**
  11291. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11292. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11293. */
  11294. function isRooted(p) {
  11295. p = normalizeSeparators(p);
  11296. if (!p) {
  11297. throw new Error('isRooted() parameter "p" cannot be empty');
  11298. }
  11299. if (exports.IS_WINDOWS) {
  11300. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11301. ); // e.g. C: or C:\hello
  11302. }
  11303. return p.startsWith('/');
  11304. }
  11305. exports.isRooted = isRooted;
  11306. /**
  11307. * Recursively create a directory at `fsPath`.
  11308. *
  11309. * This implementation is optimistic, meaning it attempts to create the full
  11310. * path first, and backs up the path stack from there.
  11311. *
  11312. * @param fsPath The path to create
  11313. * @param maxDepth The maximum recursion depth
  11314. * @param depth The current recursion depth
  11315. */
  11316. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11317. return __awaiter(this, void 0, void 0, function* () {
  11318. assert_1.ok(fsPath, 'a path argument must be provided');
  11319. fsPath = path.resolve(fsPath);
  11320. if (depth >= maxDepth)
  11321. return exports.mkdir(fsPath);
  11322. try {
  11323. yield exports.mkdir(fsPath);
  11324. return;
  11325. }
  11326. catch (err) {
  11327. switch (err.code) {
  11328. case 'ENOENT': {
  11329. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11330. yield exports.mkdir(fsPath);
  11331. return;
  11332. }
  11333. default: {
  11334. let stats;
  11335. try {
  11336. stats = yield exports.stat(fsPath);
  11337. }
  11338. catch (err2) {
  11339. throw err;
  11340. }
  11341. if (!stats.isDirectory())
  11342. throw err;
  11343. }
  11344. }
  11345. }
  11346. });
  11347. }
  11348. exports.mkdirP = mkdirP;
  11349. /**
  11350. * Best effort attempt to determine whether a file exists and is executable.
  11351. * @param filePath file path to check
  11352. * @param extensions additional file extensions to try
  11353. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11354. */
  11355. function tryGetExecutablePath(filePath, extensions) {
  11356. return __awaiter(this, void 0, void 0, function* () {
  11357. let stats = undefined;
  11358. try {
  11359. // test file exists
  11360. stats = yield exports.stat(filePath);
  11361. }
  11362. catch (err) {
  11363. if (err.code !== 'ENOENT') {
  11364. // eslint-disable-next-line no-console
  11365. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11366. }
  11367. }
  11368. if (stats && stats.isFile()) {
  11369. if (exports.IS_WINDOWS) {
  11370. // on Windows, test for valid extension
  11371. const upperExt = path.extname(filePath).toUpperCase();
  11372. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11373. return filePath;
  11374. }
  11375. }
  11376. else {
  11377. if (isUnixExecutable(stats)) {
  11378. return filePath;
  11379. }
  11380. }
  11381. }
  11382. // try each extension
  11383. const originalFilePath = filePath;
  11384. for (const extension of extensions) {
  11385. filePath = originalFilePath + extension;
  11386. stats = undefined;
  11387. try {
  11388. stats = yield exports.stat(filePath);
  11389. }
  11390. catch (err) {
  11391. if (err.code !== 'ENOENT') {
  11392. // eslint-disable-next-line no-console
  11393. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11394. }
  11395. }
  11396. if (stats && stats.isFile()) {
  11397. if (exports.IS_WINDOWS) {
  11398. // preserve the case of the actual file (since an extension was appended)
  11399. try {
  11400. const directory = path.dirname(filePath);
  11401. const upperName = path.basename(filePath).toUpperCase();
  11402. for (const actualName of yield exports.readdir(directory)) {
  11403. if (upperName === actualName.toUpperCase()) {
  11404. filePath = path.join(directory, actualName);
  11405. break;
  11406. }
  11407. }
  11408. }
  11409. catch (err) {
  11410. // eslint-disable-next-line no-console
  11411. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11412. }
  11413. return filePath;
  11414. }
  11415. else {
  11416. if (isUnixExecutable(stats)) {
  11417. return filePath;
  11418. }
  11419. }
  11420. }
  11421. }
  11422. return '';
  11423. });
  11424. }
  11425. exports.tryGetExecutablePath = tryGetExecutablePath;
  11426. function normalizeSeparators(p) {
  11427. p = p || '';
  11428. if (exports.IS_WINDOWS) {
  11429. // convert slashes on Windows
  11430. p = p.replace(/\//g, '\\');
  11431. // remove redundant slashes
  11432. return p.replace(/\\\\+/g, '\\');
  11433. }
  11434. // remove redundant slashes
  11435. return p.replace(/\/\/+/g, '/');
  11436. }
  11437. // on Mac/Linux, test the execute bit
  11438. // R W X R W X R W X
  11439. // 256 128 64 32 16 8 4 2 1
  11440. function isUnixExecutable(stats) {
  11441. return ((stats.mode & 1) > 0 ||
  11442. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11443. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11444. }
  11445. //# sourceMappingURL=io-util.js.map
  11446. /***/ }),
  11447. /***/ 674:
  11448. /***/ (function(module, __unusedexports, __webpack_require__) {
  11449. module.exports = authenticate;
  11450. const { Deprecation } = __webpack_require__(692);
  11451. const once = __webpack_require__(969);
  11452. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11453. function authenticate(state, options) {
  11454. deprecateAuthenticate(
  11455. state.octokit.log,
  11456. new Deprecation(
  11457. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11458. )
  11459. );
  11460. if (!options) {
  11461. state.auth = false;
  11462. return;
  11463. }
  11464. switch (options.type) {
  11465. case "basic":
  11466. if (!options.username || !options.password) {
  11467. throw new Error(
  11468. "Basic authentication requires both a username and password to be set"
  11469. );
  11470. }
  11471. break;
  11472. case "oauth":
  11473. if (!options.token && !(options.key && options.secret)) {
  11474. throw new Error(
  11475. "OAuth2 authentication requires a token or key & secret to be set"
  11476. );
  11477. }
  11478. break;
  11479. case "token":
  11480. case "app":
  11481. if (!options.token) {
  11482. throw new Error("Token authentication requires a token to be set");
  11483. }
  11484. break;
  11485. default:
  11486. throw new Error(
  11487. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11488. );
  11489. }
  11490. state.auth = options;
  11491. }
  11492. /***/ }),
  11493. /***/ 675:
  11494. /***/ (function(module) {
  11495. module.exports = function btoa(str) {
  11496. return new Buffer(str).toString('base64')
  11497. }
  11498. /***/ }),
  11499. /***/ 692:
  11500. /***/ (function(__unusedmodule, exports) {
  11501. "use strict";
  11502. Object.defineProperty(exports, '__esModule', { value: true });
  11503. class Deprecation extends Error {
  11504. constructor(message) {
  11505. super(message); // Maintains proper stack trace (only available on V8)
  11506. /* istanbul ignore next */
  11507. if (Error.captureStackTrace) {
  11508. Error.captureStackTrace(this, this.constructor);
  11509. }
  11510. this.name = 'Deprecation';
  11511. }
  11512. }
  11513. exports.Deprecation = Deprecation;
  11514. /***/ }),
  11515. /***/ 696:
  11516. /***/ (function(module) {
  11517. "use strict";
  11518. /*!
  11519. * isobject <https://github.com/jonschlinkert/isobject>
  11520. *
  11521. * Copyright (c) 2014-2017, Jon Schlinkert.
  11522. * Released under the MIT License.
  11523. */
  11524. function isObject(val) {
  11525. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11526. }
  11527. /*!
  11528. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11529. *
  11530. * Copyright (c) 2014-2017, Jon Schlinkert.
  11531. * Released under the MIT License.
  11532. */
  11533. function isObjectObject(o) {
  11534. return isObject(o) === true
  11535. && Object.prototype.toString.call(o) === '[object Object]';
  11536. }
  11537. function isPlainObject(o) {
  11538. var ctor,prot;
  11539. if (isObjectObject(o) === false) return false;
  11540. // If has modified constructor
  11541. ctor = o.constructor;
  11542. if (typeof ctor !== 'function') return false;
  11543. // If has modified prototype
  11544. prot = ctor.prototype;
  11545. if (isObjectObject(prot) === false) return false;
  11546. // If constructor does not have an Object-specific method
  11547. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11548. return false;
  11549. }
  11550. // Most likely a plain Object
  11551. return true;
  11552. }
  11553. module.exports = isPlainObject;
  11554. /***/ }),
  11555. /***/ 697:
  11556. /***/ (function(module) {
  11557. "use strict";
  11558. module.exports = (promise, onFinally) => {
  11559. onFinally = onFinally || (() => {});
  11560. return promise.then(
  11561. val => new Promise(resolve => {
  11562. resolve(onFinally());
  11563. }).then(() => val),
  11564. err => new Promise(resolve => {
  11565. resolve(onFinally());
  11566. }).then(() => {
  11567. throw err;
  11568. })
  11569. );
  11570. };
  11571. /***/ }),
  11572. /***/ 705:
  11573. /***/ (function(module) {
  11574. 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"}}};
  11575. /***/ }),
  11576. /***/ 722:
  11577. /***/ (function(module) {
  11578. /**
  11579. * Convert array of 16 byte values to UUID string format of the form:
  11580. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11581. */
  11582. var byteToHex = [];
  11583. for (var i = 0; i < 256; ++i) {
  11584. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11585. }
  11586. function bytesToUuid(buf, offset) {
  11587. var i = offset || 0;
  11588. var bth = byteToHex;
  11589. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11590. return ([bth[buf[i++]], bth[buf[i++]],
  11591. bth[buf[i++]], bth[buf[i++]], '-',
  11592. bth[buf[i++]], bth[buf[i++]], '-',
  11593. bth[buf[i++]], bth[buf[i++]], '-',
  11594. bth[buf[i++]], bth[buf[i++]], '-',
  11595. bth[buf[i++]], bth[buf[i++]],
  11596. bth[buf[i++]], bth[buf[i++]],
  11597. bth[buf[i++]], bth[buf[i++]]]).join('');
  11598. }
  11599. module.exports = bytesToUuid;
  11600. /***/ }),
  11601. /***/ 742:
  11602. /***/ (function(module, __unusedexports, __webpack_require__) {
  11603. var fs = __webpack_require__(747)
  11604. var core
  11605. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11606. core = __webpack_require__(818)
  11607. } else {
  11608. core = __webpack_require__(197)
  11609. }
  11610. module.exports = isexe
  11611. isexe.sync = sync
  11612. function isexe (path, options, cb) {
  11613. if (typeof options === 'function') {
  11614. cb = options
  11615. options = {}
  11616. }
  11617. if (!cb) {
  11618. if (typeof Promise !== 'function') {
  11619. throw new TypeError('callback not provided')
  11620. }
  11621. return new Promise(function (resolve, reject) {
  11622. isexe(path, options || {}, function (er, is) {
  11623. if (er) {
  11624. reject(er)
  11625. } else {
  11626. resolve(is)
  11627. }
  11628. })
  11629. })
  11630. }
  11631. core(path, options || {}, function (er, is) {
  11632. // ignore EACCES because that just means we aren't allowed to run it
  11633. if (er) {
  11634. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11635. er = null
  11636. is = false
  11637. }
  11638. }
  11639. cb(er, is)
  11640. })
  11641. }
  11642. function sync (path, options) {
  11643. // my kingdom for a filtered catch
  11644. try {
  11645. return core.sync(path, options || {})
  11646. } catch (er) {
  11647. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11648. return false
  11649. } else {
  11650. throw er
  11651. }
  11652. }
  11653. }
  11654. /***/ }),
  11655. /***/ 747:
  11656. /***/ (function(module) {
  11657. module.exports = require("fs");
  11658. /***/ }),
  11659. /***/ 753:
  11660. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11661. "use strict";
  11662. Object.defineProperty(exports, '__esModule', { value: true });
  11663. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11664. var endpoint = __webpack_require__(385);
  11665. var universalUserAgent = __webpack_require__(796);
  11666. var isPlainObject = _interopDefault(__webpack_require__(696));
  11667. var nodeFetch = _interopDefault(__webpack_require__(454));
  11668. var requestError = __webpack_require__(463);
  11669. const VERSION = "5.3.1";
  11670. function getBufferResponse(response) {
  11671. return response.arrayBuffer();
  11672. }
  11673. function fetchWrapper(requestOptions) {
  11674. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11675. requestOptions.body = JSON.stringify(requestOptions.body);
  11676. }
  11677. let headers = {};
  11678. let status;
  11679. let url;
  11680. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11681. return fetch(requestOptions.url, Object.assign({
  11682. method: requestOptions.method,
  11683. body: requestOptions.body,
  11684. headers: requestOptions.headers,
  11685. redirect: requestOptions.redirect
  11686. }, requestOptions.request)).then(response => {
  11687. url = response.url;
  11688. status = response.status;
  11689. for (const keyAndValue of response.headers) {
  11690. headers[keyAndValue[0]] = keyAndValue[1];
  11691. }
  11692. if (status === 204 || status === 205) {
  11693. return;
  11694. } // GitHub API returns 200 for HEAD requsets
  11695. if (requestOptions.method === "HEAD") {
  11696. if (status < 400) {
  11697. return;
  11698. }
  11699. throw new requestError.RequestError(response.statusText, status, {
  11700. headers,
  11701. request: requestOptions
  11702. });
  11703. }
  11704. if (status === 304) {
  11705. throw new requestError.RequestError("Not modified", status, {
  11706. headers,
  11707. request: requestOptions
  11708. });
  11709. }
  11710. if (status >= 400) {
  11711. return response.text().then(message => {
  11712. const error = new requestError.RequestError(message, status, {
  11713. headers,
  11714. request: requestOptions
  11715. });
  11716. try {
  11717. let responseBody = JSON.parse(error.message);
  11718. Object.assign(error, responseBody);
  11719. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11720. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11721. } catch (e) {// ignore, see octokit/rest.js#684
  11722. }
  11723. throw error;
  11724. });
  11725. }
  11726. const contentType = response.headers.get("content-type");
  11727. if (/application\/json/.test(contentType)) {
  11728. return response.json();
  11729. }
  11730. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11731. return response.text();
  11732. }
  11733. return getBufferResponse(response);
  11734. }).then(data => {
  11735. return {
  11736. status,
  11737. url,
  11738. headers,
  11739. data
  11740. };
  11741. }).catch(error => {
  11742. if (error instanceof requestError.RequestError) {
  11743. throw error;
  11744. }
  11745. throw new requestError.RequestError(error.message, 500, {
  11746. headers,
  11747. request: requestOptions
  11748. });
  11749. });
  11750. }
  11751. function withDefaults(oldEndpoint, newDefaults) {
  11752. const endpoint = oldEndpoint.defaults(newDefaults);
  11753. const newApi = function (route, parameters) {
  11754. const endpointOptions = endpoint.merge(route, parameters);
  11755. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11756. return fetchWrapper(endpoint.parse(endpointOptions));
  11757. }
  11758. const request = (route, parameters) => {
  11759. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11760. };
  11761. Object.assign(request, {
  11762. endpoint,
  11763. defaults: withDefaults.bind(null, endpoint)
  11764. });
  11765. return endpointOptions.request.hook(request, endpointOptions);
  11766. };
  11767. return Object.assign(newApi, {
  11768. endpoint,
  11769. defaults: withDefaults.bind(null, endpoint)
  11770. });
  11771. }
  11772. const request = withDefaults(endpoint.endpoint, {
  11773. headers: {
  11774. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11775. }
  11776. });
  11777. exports.request = request;
  11778. //# sourceMappingURL=index.js.map
  11779. /***/ }),
  11780. /***/ 761:
  11781. /***/ (function(module) {
  11782. module.exports = require("zlib");
  11783. /***/ }),
  11784. /***/ 763:
  11785. /***/ (function(module) {
  11786. module.exports = removeHook
  11787. function removeHook (state, name, method) {
  11788. if (!state.registry[name]) {
  11789. return
  11790. }
  11791. var index = state.registry[name]
  11792. .map(function (registered) { return registered.orig })
  11793. .indexOf(method)
  11794. if (index === -1) {
  11795. return
  11796. }
  11797. state.registry[name].splice(index, 1)
  11798. }
  11799. /***/ }),
  11800. /***/ 768:
  11801. /***/ (function(module) {
  11802. "use strict";
  11803. module.exports = function (x) {
  11804. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11805. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11806. if (x[x.length - 1] === lf) {
  11807. x = x.slice(0, x.length - 1);
  11808. }
  11809. if (x[x.length - 1] === cr) {
  11810. x = x.slice(0, x.length - 1);
  11811. }
  11812. return x;
  11813. };
  11814. /***/ }),
  11815. /***/ 777:
  11816. /***/ (function(module, __unusedexports, __webpack_require__) {
  11817. module.exports = getFirstPage
  11818. const getPage = __webpack_require__(265)
  11819. function getFirstPage (octokit, link, headers) {
  11820. return getPage(octokit, link, 'first', headers)
  11821. }
  11822. /***/ }),
  11823. /***/ 796:
  11824. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11825. "use strict";
  11826. Object.defineProperty(exports, '__esModule', { value: true });
  11827. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11828. var osName = _interopDefault(__webpack_require__(2));
  11829. function getUserAgent() {
  11830. try {
  11831. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  11832. } catch (error) {
  11833. if (/wmic os get Caption/.test(error.message)) {
  11834. return "Windows <version undetectable>";
  11835. }
  11836. throw error;
  11837. }
  11838. }
  11839. exports.getUserAgent = getUserAgent;
  11840. //# sourceMappingURL=index.js.map
  11841. /***/ }),
  11842. /***/ 807:
  11843. /***/ (function(module, __unusedexports, __webpack_require__) {
  11844. module.exports = paginate;
  11845. const iterator = __webpack_require__(8);
  11846. function paginate(octokit, route, options, mapFn) {
  11847. if (typeof options === "function") {
  11848. mapFn = options;
  11849. options = undefined;
  11850. }
  11851. options = octokit.request.endpoint.merge(route, options);
  11852. return gather(
  11853. octokit,
  11854. [],
  11855. iterator(octokit, options)[Symbol.asyncIterator](),
  11856. mapFn
  11857. );
  11858. }
  11859. function gather(octokit, results, iterator, mapFn) {
  11860. return iterator.next().then(result => {
  11861. if (result.done) {
  11862. return results;
  11863. }
  11864. let earlyExit = false;
  11865. function done() {
  11866. earlyExit = true;
  11867. }
  11868. results = results.concat(
  11869. mapFn ? mapFn(result.value, done) : result.value.data
  11870. );
  11871. if (earlyExit) {
  11872. return results;
  11873. }
  11874. return gather(octokit, results, iterator, mapFn);
  11875. });
  11876. }
  11877. /***/ }),
  11878. /***/ 813:
  11879. /***/ (function(__unusedmodule, exports) {
  11880. "use strict";
  11881. Object.defineProperty(exports, '__esModule', { value: true });
  11882. async function auth(token) {
  11883. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  11884. return {
  11885. type: "token",
  11886. token: token,
  11887. tokenType
  11888. };
  11889. }
  11890. /**
  11891. * Prefix token for usage in the Authorization header
  11892. *
  11893. * @param token OAuth token or JSON Web Token
  11894. */
  11895. function withAuthorizationPrefix(token) {
  11896. if (token.split(/\./).length === 3) {
  11897. return `bearer ${token}`;
  11898. }
  11899. return `token ${token}`;
  11900. }
  11901. async function hook(token, request, route, parameters) {
  11902. const endpoint = request.endpoint.merge(route, parameters);
  11903. endpoint.headers.authorization = withAuthorizationPrefix(token);
  11904. return request(endpoint);
  11905. }
  11906. const createTokenAuth = function createTokenAuth(token) {
  11907. if (!token) {
  11908. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  11909. }
  11910. if (typeof token !== "string") {
  11911. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  11912. }
  11913. token = token.replace(/^(token|bearer) +/i, "");
  11914. return Object.assign(auth.bind(null, token), {
  11915. hook: hook.bind(null, token)
  11916. });
  11917. };
  11918. exports.createTokenAuth = createTokenAuth;
  11919. //# sourceMappingURL=index.js.map
  11920. /***/ }),
  11921. /***/ 814:
  11922. /***/ (function(module, __unusedexports, __webpack_require__) {
  11923. module.exports = which
  11924. which.sync = whichSync
  11925. var isWindows = process.platform === 'win32' ||
  11926. process.env.OSTYPE === 'cygwin' ||
  11927. process.env.OSTYPE === 'msys'
  11928. var path = __webpack_require__(622)
  11929. var COLON = isWindows ? ';' : ':'
  11930. var isexe = __webpack_require__(742)
  11931. function getNotFoundError (cmd) {
  11932. var er = new Error('not found: ' + cmd)
  11933. er.code = 'ENOENT'
  11934. return er
  11935. }
  11936. function getPathInfo (cmd, opt) {
  11937. var colon = opt.colon || COLON
  11938. var pathEnv = opt.path || process.env.PATH || ''
  11939. var pathExt = ['']
  11940. pathEnv = pathEnv.split(colon)
  11941. var pathExtExe = ''
  11942. if (isWindows) {
  11943. pathEnv.unshift(process.cwd())
  11944. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  11945. pathExt = pathExtExe.split(colon)
  11946. // Always test the cmd itself first. isexe will check to make sure
  11947. // it's found in the pathExt set.
  11948. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  11949. pathExt.unshift('')
  11950. }
  11951. // If it has a slash, then we don't bother searching the pathenv.
  11952. // just check the file itself, and that's it.
  11953. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  11954. pathEnv = ['']
  11955. return {
  11956. env: pathEnv,
  11957. ext: pathExt,
  11958. extExe: pathExtExe
  11959. }
  11960. }
  11961. function which (cmd, opt, cb) {
  11962. if (typeof opt === 'function') {
  11963. cb = opt
  11964. opt = {}
  11965. }
  11966. var info = getPathInfo(cmd, opt)
  11967. var pathEnv = info.env
  11968. var pathExt = info.ext
  11969. var pathExtExe = info.extExe
  11970. var found = []
  11971. ;(function F (i, l) {
  11972. if (i === l) {
  11973. if (opt.all && found.length)
  11974. return cb(null, found)
  11975. else
  11976. return cb(getNotFoundError(cmd))
  11977. }
  11978. var pathPart = pathEnv[i]
  11979. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  11980. pathPart = pathPart.slice(1, -1)
  11981. var p = path.join(pathPart, cmd)
  11982. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  11983. p = cmd.slice(0, 2) + p
  11984. }
  11985. ;(function E (ii, ll) {
  11986. if (ii === ll) return F(i + 1, l)
  11987. var ext = pathExt[ii]
  11988. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  11989. if (!er && is) {
  11990. if (opt.all)
  11991. found.push(p + ext)
  11992. else
  11993. return cb(null, p + ext)
  11994. }
  11995. return E(ii + 1, ll)
  11996. })
  11997. })(0, pathExt.length)
  11998. })(0, pathEnv.length)
  11999. }
  12000. function whichSync (cmd, opt) {
  12001. opt = opt || {}
  12002. var info = getPathInfo(cmd, opt)
  12003. var pathEnv = info.env
  12004. var pathExt = info.ext
  12005. var pathExtExe = info.extExe
  12006. var found = []
  12007. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12008. var pathPart = pathEnv[i]
  12009. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12010. pathPart = pathPart.slice(1, -1)
  12011. var p = path.join(pathPart, cmd)
  12012. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12013. p = cmd.slice(0, 2) + p
  12014. }
  12015. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12016. var cur = p + pathExt[j]
  12017. var is
  12018. try {
  12019. is = isexe.sync(cur, { pathExt: pathExtExe })
  12020. if (is) {
  12021. if (opt.all)
  12022. found.push(cur)
  12023. else
  12024. return cur
  12025. }
  12026. } catch (ex) {}
  12027. }
  12028. }
  12029. if (opt.all && found.length)
  12030. return found
  12031. if (opt.nothrow)
  12032. return null
  12033. throw getNotFoundError(cmd)
  12034. }
  12035. /***/ }),
  12036. /***/ 816:
  12037. /***/ (function(module) {
  12038. "use strict";
  12039. module.exports = /^#!.*/;
  12040. /***/ }),
  12041. /***/ 818:
  12042. /***/ (function(module, __unusedexports, __webpack_require__) {
  12043. module.exports = isexe
  12044. isexe.sync = sync
  12045. var fs = __webpack_require__(747)
  12046. function checkPathExt (path, options) {
  12047. var pathext = options.pathExt !== undefined ?
  12048. options.pathExt : process.env.PATHEXT
  12049. if (!pathext) {
  12050. return true
  12051. }
  12052. pathext = pathext.split(';')
  12053. if (pathext.indexOf('') !== -1) {
  12054. return true
  12055. }
  12056. for (var i = 0; i < pathext.length; i++) {
  12057. var p = pathext[i].toLowerCase()
  12058. if (p && path.substr(-p.length).toLowerCase() === p) {
  12059. return true
  12060. }
  12061. }
  12062. return false
  12063. }
  12064. function checkStat (stat, path, options) {
  12065. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12066. return false
  12067. }
  12068. return checkPathExt(path, options)
  12069. }
  12070. function isexe (path, options, cb) {
  12071. fs.stat(path, function (er, stat) {
  12072. cb(er, er ? false : checkStat(stat, path, options))
  12073. })
  12074. }
  12075. function sync (path, options) {
  12076. return checkStat(fs.statSync(path), path, options)
  12077. }
  12078. /***/ }),
  12079. /***/ 821:
  12080. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12081. "use strict";
  12082. var __importStar = (this && this.__importStar) || function (mod) {
  12083. if (mod && mod.__esModule) return mod;
  12084. var result = {};
  12085. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12086. result["default"] = mod;
  12087. return result;
  12088. };
  12089. Object.defineProperty(exports, "__esModule", { value: true });
  12090. const core = __importStar(__webpack_require__(470));
  12091. const fsHelper = __importStar(__webpack_require__(618));
  12092. const github = __importStar(__webpack_require__(469));
  12093. const path = __importStar(__webpack_require__(622));
  12094. function getInputs() {
  12095. const result = {};
  12096. // GitHub workspace
  12097. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12098. if (!githubWorkspacePath) {
  12099. throw new Error('GITHUB_WORKSPACE not defined');
  12100. }
  12101. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12102. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12103. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12104. // Qualified repository
  12105. const qualifiedRepository = core.getInput('repository') ||
  12106. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12107. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12108. const splitRepository = qualifiedRepository.split('/');
  12109. if (splitRepository.length !== 2 ||
  12110. !splitRepository[0] ||
  12111. !splitRepository[1]) {
  12112. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12113. }
  12114. result.repositoryOwner = splitRepository[0];
  12115. result.repositoryName = splitRepository[1];
  12116. // Repository path
  12117. result.repositoryPath = core.getInput('path') || '.';
  12118. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12119. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12120. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12121. }
  12122. // Workflow repository?
  12123. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12124. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12125. // Source branch, source version
  12126. result.ref = core.getInput('ref');
  12127. if (!result.ref) {
  12128. if (isWorkflowRepository) {
  12129. result.ref = github.context.ref;
  12130. result.commit = github.context.sha;
  12131. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12132. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12133. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12134. result.ref = `refs/heads/${result.ref}`;
  12135. }
  12136. }
  12137. if (!result.ref && !result.commit) {
  12138. result.ref = 'refs/heads/master';
  12139. }
  12140. }
  12141. // SHA?
  12142. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12143. result.commit = result.ref;
  12144. result.ref = '';
  12145. }
  12146. core.debug(`ref = '${result.ref}'`);
  12147. core.debug(`commit = '${result.commit}'`);
  12148. // Clean
  12149. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12150. core.debug(`clean = ${result.clean}`);
  12151. // Fetch depth
  12152. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12153. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12154. result.fetchDepth = 0;
  12155. }
  12156. core.debug(`fetch depth = ${result.fetchDepth}`);
  12157. // LFS
  12158. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12159. core.debug(`lfs = ${result.lfs}`);
  12160. // Submodules
  12161. result.submodules = false;
  12162. result.nestedSubmodules = false;
  12163. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12164. if (submodulesString == 'RECURSIVE') {
  12165. result.submodules = true;
  12166. result.nestedSubmodules = true;
  12167. }
  12168. else if (submodulesString == 'TRUE') {
  12169. result.submodules = true;
  12170. }
  12171. core.debug(`submodules = ${result.submodules}`);
  12172. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12173. // Auth token
  12174. result.authToken = core.getInput('token');
  12175. // SSH
  12176. result.sshKey = core.getInput('ssh-key');
  12177. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12178. result.sshStrict =
  12179. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12180. // Persist credentials
  12181. result.persistCredentials =
  12182. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12183. return result;
  12184. }
  12185. exports.getInputs = getInputs;
  12186. /***/ }),
  12187. /***/ 826:
  12188. /***/ (function(module, __unusedexports, __webpack_require__) {
  12189. var rng = __webpack_require__(139);
  12190. var bytesToUuid = __webpack_require__(722);
  12191. function v4(options, buf, offset) {
  12192. var i = buf && offset || 0;
  12193. if (typeof(options) == 'string') {
  12194. buf = options === 'binary' ? new Array(16) : null;
  12195. options = null;
  12196. }
  12197. options = options || {};
  12198. var rnds = options.random || (options.rng || rng)();
  12199. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12200. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12201. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12202. // Copy bytes to buffer, if provided
  12203. if (buf) {
  12204. for (var ii = 0; ii < 16; ++ii) {
  12205. buf[i + ii] = rnds[ii];
  12206. }
  12207. }
  12208. return buf || bytesToUuid(rnds);
  12209. }
  12210. module.exports = v4;
  12211. /***/ }),
  12212. /***/ 835:
  12213. /***/ (function(module) {
  12214. module.exports = require("url");
  12215. /***/ }),
  12216. /***/ 850:
  12217. /***/ (function(module, __unusedexports, __webpack_require__) {
  12218. module.exports = paginationMethodsPlugin
  12219. function paginationMethodsPlugin (octokit) {
  12220. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  12221. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  12222. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  12223. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  12224. octokit.hasFirstPage = __webpack_require__(536)
  12225. octokit.hasLastPage = __webpack_require__(336)
  12226. octokit.hasNextPage = __webpack_require__(929)
  12227. octokit.hasPreviousPage = __webpack_require__(558)
  12228. }
  12229. /***/ }),
  12230. /***/ 854:
  12231. /***/ (function(module) {
  12232. /**
  12233. * lodash (Custom Build) <https://lodash.com/>
  12234. * Build: `lodash modularize exports="npm" -o ./`
  12235. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12236. * Released under MIT license <https://lodash.com/license>
  12237. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12238. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12239. */
  12240. /** Used as the `TypeError` message for "Functions" methods. */
  12241. var FUNC_ERROR_TEXT = 'Expected a function';
  12242. /** Used to stand-in for `undefined` hash values. */
  12243. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12244. /** Used as references for various `Number` constants. */
  12245. var INFINITY = 1 / 0;
  12246. /** `Object#toString` result references. */
  12247. var funcTag = '[object Function]',
  12248. genTag = '[object GeneratorFunction]',
  12249. symbolTag = '[object Symbol]';
  12250. /** Used to match property names within property paths. */
  12251. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12252. reIsPlainProp = /^\w*$/,
  12253. reLeadingDot = /^\./,
  12254. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12255. /**
  12256. * Used to match `RegExp`
  12257. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12258. */
  12259. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12260. /** Used to match backslashes in property paths. */
  12261. var reEscapeChar = /\\(\\)?/g;
  12262. /** Used to detect host constructors (Safari). */
  12263. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12264. /** Detect free variable `global` from Node.js. */
  12265. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12266. /** Detect free variable `self`. */
  12267. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12268. /** Used as a reference to the global object. */
  12269. var root = freeGlobal || freeSelf || Function('return this')();
  12270. /**
  12271. * Gets the value at `key` of `object`.
  12272. *
  12273. * @private
  12274. * @param {Object} [object] The object to query.
  12275. * @param {string} key The key of the property to get.
  12276. * @returns {*} Returns the property value.
  12277. */
  12278. function getValue(object, key) {
  12279. return object == null ? undefined : object[key];
  12280. }
  12281. /**
  12282. * Checks if `value` is a host object in IE < 9.
  12283. *
  12284. * @private
  12285. * @param {*} value The value to check.
  12286. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12287. */
  12288. function isHostObject(value) {
  12289. // Many host objects are `Object` objects that can coerce to strings
  12290. // despite having improperly defined `toString` methods.
  12291. var result = false;
  12292. if (value != null && typeof value.toString != 'function') {
  12293. try {
  12294. result = !!(value + '');
  12295. } catch (e) {}
  12296. }
  12297. return result;
  12298. }
  12299. /** Used for built-in method references. */
  12300. var arrayProto = Array.prototype,
  12301. funcProto = Function.prototype,
  12302. objectProto = Object.prototype;
  12303. /** Used to detect overreaching core-js shims. */
  12304. var coreJsData = root['__core-js_shared__'];
  12305. /** Used to detect methods masquerading as native. */
  12306. var maskSrcKey = (function() {
  12307. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12308. return uid ? ('Symbol(src)_1.' + uid) : '';
  12309. }());
  12310. /** Used to resolve the decompiled source of functions. */
  12311. var funcToString = funcProto.toString;
  12312. /** Used to check objects for own properties. */
  12313. var hasOwnProperty = objectProto.hasOwnProperty;
  12314. /**
  12315. * Used to resolve the
  12316. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12317. * of values.
  12318. */
  12319. var objectToString = objectProto.toString;
  12320. /** Used to detect if a method is native. */
  12321. var reIsNative = RegExp('^' +
  12322. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12323. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12324. );
  12325. /** Built-in value references. */
  12326. var Symbol = root.Symbol,
  12327. splice = arrayProto.splice;
  12328. /* Built-in method references that are verified to be native. */
  12329. var Map = getNative(root, 'Map'),
  12330. nativeCreate = getNative(Object, 'create');
  12331. /** Used to convert symbols to primitives and strings. */
  12332. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12333. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12334. /**
  12335. * Creates a hash object.
  12336. *
  12337. * @private
  12338. * @constructor
  12339. * @param {Array} [entries] The key-value pairs to cache.
  12340. */
  12341. function Hash(entries) {
  12342. var index = -1,
  12343. length = entries ? entries.length : 0;
  12344. this.clear();
  12345. while (++index < length) {
  12346. var entry = entries[index];
  12347. this.set(entry[0], entry[1]);
  12348. }
  12349. }
  12350. /**
  12351. * Removes all key-value entries from the hash.
  12352. *
  12353. * @private
  12354. * @name clear
  12355. * @memberOf Hash
  12356. */
  12357. function hashClear() {
  12358. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12359. }
  12360. /**
  12361. * Removes `key` and its value from the hash.
  12362. *
  12363. * @private
  12364. * @name delete
  12365. * @memberOf Hash
  12366. * @param {Object} hash The hash to modify.
  12367. * @param {string} key The key of the value to remove.
  12368. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12369. */
  12370. function hashDelete(key) {
  12371. return this.has(key) && delete this.__data__[key];
  12372. }
  12373. /**
  12374. * Gets the hash value for `key`.
  12375. *
  12376. * @private
  12377. * @name get
  12378. * @memberOf Hash
  12379. * @param {string} key The key of the value to get.
  12380. * @returns {*} Returns the entry value.
  12381. */
  12382. function hashGet(key) {
  12383. var data = this.__data__;
  12384. if (nativeCreate) {
  12385. var result = data[key];
  12386. return result === HASH_UNDEFINED ? undefined : result;
  12387. }
  12388. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12389. }
  12390. /**
  12391. * Checks if a hash value for `key` exists.
  12392. *
  12393. * @private
  12394. * @name has
  12395. * @memberOf Hash
  12396. * @param {string} key The key of the entry to check.
  12397. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12398. */
  12399. function hashHas(key) {
  12400. var data = this.__data__;
  12401. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12402. }
  12403. /**
  12404. * Sets the hash `key` to `value`.
  12405. *
  12406. * @private
  12407. * @name set
  12408. * @memberOf Hash
  12409. * @param {string} key The key of the value to set.
  12410. * @param {*} value The value to set.
  12411. * @returns {Object} Returns the hash instance.
  12412. */
  12413. function hashSet(key, value) {
  12414. var data = this.__data__;
  12415. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12416. return this;
  12417. }
  12418. // Add methods to `Hash`.
  12419. Hash.prototype.clear = hashClear;
  12420. Hash.prototype['delete'] = hashDelete;
  12421. Hash.prototype.get = hashGet;
  12422. Hash.prototype.has = hashHas;
  12423. Hash.prototype.set = hashSet;
  12424. /**
  12425. * Creates an list cache object.
  12426. *
  12427. * @private
  12428. * @constructor
  12429. * @param {Array} [entries] The key-value pairs to cache.
  12430. */
  12431. function ListCache(entries) {
  12432. var index = -1,
  12433. length = entries ? entries.length : 0;
  12434. this.clear();
  12435. while (++index < length) {
  12436. var entry = entries[index];
  12437. this.set(entry[0], entry[1]);
  12438. }
  12439. }
  12440. /**
  12441. * Removes all key-value entries from the list cache.
  12442. *
  12443. * @private
  12444. * @name clear
  12445. * @memberOf ListCache
  12446. */
  12447. function listCacheClear() {
  12448. this.__data__ = [];
  12449. }
  12450. /**
  12451. * Removes `key` and its value from the list cache.
  12452. *
  12453. * @private
  12454. * @name delete
  12455. * @memberOf ListCache
  12456. * @param {string} key The key of the value to remove.
  12457. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12458. */
  12459. function listCacheDelete(key) {
  12460. var data = this.__data__,
  12461. index = assocIndexOf(data, key);
  12462. if (index < 0) {
  12463. return false;
  12464. }
  12465. var lastIndex = data.length - 1;
  12466. if (index == lastIndex) {
  12467. data.pop();
  12468. } else {
  12469. splice.call(data, index, 1);
  12470. }
  12471. return true;
  12472. }
  12473. /**
  12474. * Gets the list cache value for `key`.
  12475. *
  12476. * @private
  12477. * @name get
  12478. * @memberOf ListCache
  12479. * @param {string} key The key of the value to get.
  12480. * @returns {*} Returns the entry value.
  12481. */
  12482. function listCacheGet(key) {
  12483. var data = this.__data__,
  12484. index = assocIndexOf(data, key);
  12485. return index < 0 ? undefined : data[index][1];
  12486. }
  12487. /**
  12488. * Checks if a list cache value for `key` exists.
  12489. *
  12490. * @private
  12491. * @name has
  12492. * @memberOf ListCache
  12493. * @param {string} key The key of the entry to check.
  12494. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12495. */
  12496. function listCacheHas(key) {
  12497. return assocIndexOf(this.__data__, key) > -1;
  12498. }
  12499. /**
  12500. * Sets the list cache `key` to `value`.
  12501. *
  12502. * @private
  12503. * @name set
  12504. * @memberOf ListCache
  12505. * @param {string} key The key of the value to set.
  12506. * @param {*} value The value to set.
  12507. * @returns {Object} Returns the list cache instance.
  12508. */
  12509. function listCacheSet(key, value) {
  12510. var data = this.__data__,
  12511. index = assocIndexOf(data, key);
  12512. if (index < 0) {
  12513. data.push([key, value]);
  12514. } else {
  12515. data[index][1] = value;
  12516. }
  12517. return this;
  12518. }
  12519. // Add methods to `ListCache`.
  12520. ListCache.prototype.clear = listCacheClear;
  12521. ListCache.prototype['delete'] = listCacheDelete;
  12522. ListCache.prototype.get = listCacheGet;
  12523. ListCache.prototype.has = listCacheHas;
  12524. ListCache.prototype.set = listCacheSet;
  12525. /**
  12526. * Creates a map cache object to store key-value pairs.
  12527. *
  12528. * @private
  12529. * @constructor
  12530. * @param {Array} [entries] The key-value pairs to cache.
  12531. */
  12532. function MapCache(entries) {
  12533. var index = -1,
  12534. length = entries ? entries.length : 0;
  12535. this.clear();
  12536. while (++index < length) {
  12537. var entry = entries[index];
  12538. this.set(entry[0], entry[1]);
  12539. }
  12540. }
  12541. /**
  12542. * Removes all key-value entries from the map.
  12543. *
  12544. * @private
  12545. * @name clear
  12546. * @memberOf MapCache
  12547. */
  12548. function mapCacheClear() {
  12549. this.__data__ = {
  12550. 'hash': new Hash,
  12551. 'map': new (Map || ListCache),
  12552. 'string': new Hash
  12553. };
  12554. }
  12555. /**
  12556. * Removes `key` and its value from the map.
  12557. *
  12558. * @private
  12559. * @name delete
  12560. * @memberOf MapCache
  12561. * @param {string} key The key of the value to remove.
  12562. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12563. */
  12564. function mapCacheDelete(key) {
  12565. return getMapData(this, key)['delete'](key);
  12566. }
  12567. /**
  12568. * Gets the map value for `key`.
  12569. *
  12570. * @private
  12571. * @name get
  12572. * @memberOf MapCache
  12573. * @param {string} key The key of the value to get.
  12574. * @returns {*} Returns the entry value.
  12575. */
  12576. function mapCacheGet(key) {
  12577. return getMapData(this, key).get(key);
  12578. }
  12579. /**
  12580. * Checks if a map value for `key` exists.
  12581. *
  12582. * @private
  12583. * @name has
  12584. * @memberOf MapCache
  12585. * @param {string} key The key of the entry to check.
  12586. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12587. */
  12588. function mapCacheHas(key) {
  12589. return getMapData(this, key).has(key);
  12590. }
  12591. /**
  12592. * Sets the map `key` to `value`.
  12593. *
  12594. * @private
  12595. * @name set
  12596. * @memberOf MapCache
  12597. * @param {string} key The key of the value to set.
  12598. * @param {*} value The value to set.
  12599. * @returns {Object} Returns the map cache instance.
  12600. */
  12601. function mapCacheSet(key, value) {
  12602. getMapData(this, key).set(key, value);
  12603. return this;
  12604. }
  12605. // Add methods to `MapCache`.
  12606. MapCache.prototype.clear = mapCacheClear;
  12607. MapCache.prototype['delete'] = mapCacheDelete;
  12608. MapCache.prototype.get = mapCacheGet;
  12609. MapCache.prototype.has = mapCacheHas;
  12610. MapCache.prototype.set = mapCacheSet;
  12611. /**
  12612. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12613. *
  12614. * @private
  12615. * @param {Array} array The array to inspect.
  12616. * @param {*} key The key to search for.
  12617. * @returns {number} Returns the index of the matched value, else `-1`.
  12618. */
  12619. function assocIndexOf(array, key) {
  12620. var length = array.length;
  12621. while (length--) {
  12622. if (eq(array[length][0], key)) {
  12623. return length;
  12624. }
  12625. }
  12626. return -1;
  12627. }
  12628. /**
  12629. * The base implementation of `_.get` without support for default values.
  12630. *
  12631. * @private
  12632. * @param {Object} object The object to query.
  12633. * @param {Array|string} path The path of the property to get.
  12634. * @returns {*} Returns the resolved value.
  12635. */
  12636. function baseGet(object, path) {
  12637. path = isKey(path, object) ? [path] : castPath(path);
  12638. var index = 0,
  12639. length = path.length;
  12640. while (object != null && index < length) {
  12641. object = object[toKey(path[index++])];
  12642. }
  12643. return (index && index == length) ? object : undefined;
  12644. }
  12645. /**
  12646. * The base implementation of `_.isNative` without bad shim checks.
  12647. *
  12648. * @private
  12649. * @param {*} value The value to check.
  12650. * @returns {boolean} Returns `true` if `value` is a native function,
  12651. * else `false`.
  12652. */
  12653. function baseIsNative(value) {
  12654. if (!isObject(value) || isMasked(value)) {
  12655. return false;
  12656. }
  12657. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12658. return pattern.test(toSource(value));
  12659. }
  12660. /**
  12661. * The base implementation of `_.toString` which doesn't convert nullish
  12662. * values to empty strings.
  12663. *
  12664. * @private
  12665. * @param {*} value The value to process.
  12666. * @returns {string} Returns the string.
  12667. */
  12668. function baseToString(value) {
  12669. // Exit early for strings to avoid a performance hit in some environments.
  12670. if (typeof value == 'string') {
  12671. return value;
  12672. }
  12673. if (isSymbol(value)) {
  12674. return symbolToString ? symbolToString.call(value) : '';
  12675. }
  12676. var result = (value + '');
  12677. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12678. }
  12679. /**
  12680. * Casts `value` to a path array if it's not one.
  12681. *
  12682. * @private
  12683. * @param {*} value The value to inspect.
  12684. * @returns {Array} Returns the cast property path array.
  12685. */
  12686. function castPath(value) {
  12687. return isArray(value) ? value : stringToPath(value);
  12688. }
  12689. /**
  12690. * Gets the data for `map`.
  12691. *
  12692. * @private
  12693. * @param {Object} map The map to query.
  12694. * @param {string} key The reference key.
  12695. * @returns {*} Returns the map data.
  12696. */
  12697. function getMapData(map, key) {
  12698. var data = map.__data__;
  12699. return isKeyable(key)
  12700. ? data[typeof key == 'string' ? 'string' : 'hash']
  12701. : data.map;
  12702. }
  12703. /**
  12704. * Gets the native function at `key` of `object`.
  12705. *
  12706. * @private
  12707. * @param {Object} object The object to query.
  12708. * @param {string} key The key of the method to get.
  12709. * @returns {*} Returns the function if it's native, else `undefined`.
  12710. */
  12711. function getNative(object, key) {
  12712. var value = getValue(object, key);
  12713. return baseIsNative(value) ? value : undefined;
  12714. }
  12715. /**
  12716. * Checks if `value` is a property name and not a property path.
  12717. *
  12718. * @private
  12719. * @param {*} value The value to check.
  12720. * @param {Object} [object] The object to query keys on.
  12721. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12722. */
  12723. function isKey(value, object) {
  12724. if (isArray(value)) {
  12725. return false;
  12726. }
  12727. var type = typeof value;
  12728. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12729. value == null || isSymbol(value)) {
  12730. return true;
  12731. }
  12732. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12733. (object != null && value in Object(object));
  12734. }
  12735. /**
  12736. * Checks if `value` is suitable for use as unique object key.
  12737. *
  12738. * @private
  12739. * @param {*} value The value to check.
  12740. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12741. */
  12742. function isKeyable(value) {
  12743. var type = typeof value;
  12744. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12745. ? (value !== '__proto__')
  12746. : (value === null);
  12747. }
  12748. /**
  12749. * Checks if `func` has its source masked.
  12750. *
  12751. * @private
  12752. * @param {Function} func The function to check.
  12753. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12754. */
  12755. function isMasked(func) {
  12756. return !!maskSrcKey && (maskSrcKey in func);
  12757. }
  12758. /**
  12759. * Converts `string` to a property path array.
  12760. *
  12761. * @private
  12762. * @param {string} string The string to convert.
  12763. * @returns {Array} Returns the property path array.
  12764. */
  12765. var stringToPath = memoize(function(string) {
  12766. string = toString(string);
  12767. var result = [];
  12768. if (reLeadingDot.test(string)) {
  12769. result.push('');
  12770. }
  12771. string.replace(rePropName, function(match, number, quote, string) {
  12772. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  12773. });
  12774. return result;
  12775. });
  12776. /**
  12777. * Converts `value` to a string key if it's not a string or symbol.
  12778. *
  12779. * @private
  12780. * @param {*} value The value to inspect.
  12781. * @returns {string|symbol} Returns the key.
  12782. */
  12783. function toKey(value) {
  12784. if (typeof value == 'string' || isSymbol(value)) {
  12785. return value;
  12786. }
  12787. var result = (value + '');
  12788. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12789. }
  12790. /**
  12791. * Converts `func` to its source code.
  12792. *
  12793. * @private
  12794. * @param {Function} func The function to process.
  12795. * @returns {string} Returns the source code.
  12796. */
  12797. function toSource(func) {
  12798. if (func != null) {
  12799. try {
  12800. return funcToString.call(func);
  12801. } catch (e) {}
  12802. try {
  12803. return (func + '');
  12804. } catch (e) {}
  12805. }
  12806. return '';
  12807. }
  12808. /**
  12809. * Creates a function that memoizes the result of `func`. If `resolver` is
  12810. * provided, it determines the cache key for storing the result based on the
  12811. * arguments provided to the memoized function. By default, the first argument
  12812. * provided to the memoized function is used as the map cache key. The `func`
  12813. * is invoked with the `this` binding of the memoized function.
  12814. *
  12815. * **Note:** The cache is exposed as the `cache` property on the memoized
  12816. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  12817. * constructor with one whose instances implement the
  12818. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  12819. * method interface of `delete`, `get`, `has`, and `set`.
  12820. *
  12821. * @static
  12822. * @memberOf _
  12823. * @since 0.1.0
  12824. * @category Function
  12825. * @param {Function} func The function to have its output memoized.
  12826. * @param {Function} [resolver] The function to resolve the cache key.
  12827. * @returns {Function} Returns the new memoized function.
  12828. * @example
  12829. *
  12830. * var object = { 'a': 1, 'b': 2 };
  12831. * var other = { 'c': 3, 'd': 4 };
  12832. *
  12833. * var values = _.memoize(_.values);
  12834. * values(object);
  12835. * // => [1, 2]
  12836. *
  12837. * values(other);
  12838. * // => [3, 4]
  12839. *
  12840. * object.a = 2;
  12841. * values(object);
  12842. * // => [1, 2]
  12843. *
  12844. * // Modify the result cache.
  12845. * values.cache.set(object, ['a', 'b']);
  12846. * values(object);
  12847. * // => ['a', 'b']
  12848. *
  12849. * // Replace `_.memoize.Cache`.
  12850. * _.memoize.Cache = WeakMap;
  12851. */
  12852. function memoize(func, resolver) {
  12853. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  12854. throw new TypeError(FUNC_ERROR_TEXT);
  12855. }
  12856. var memoized = function() {
  12857. var args = arguments,
  12858. key = resolver ? resolver.apply(this, args) : args[0],
  12859. cache = memoized.cache;
  12860. if (cache.has(key)) {
  12861. return cache.get(key);
  12862. }
  12863. var result = func.apply(this, args);
  12864. memoized.cache = cache.set(key, result);
  12865. return result;
  12866. };
  12867. memoized.cache = new (memoize.Cache || MapCache);
  12868. return memoized;
  12869. }
  12870. // Assign cache to `_.memoize`.
  12871. memoize.Cache = MapCache;
  12872. /**
  12873. * Performs a
  12874. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12875. * comparison between two values to determine if they are equivalent.
  12876. *
  12877. * @static
  12878. * @memberOf _
  12879. * @since 4.0.0
  12880. * @category Lang
  12881. * @param {*} value The value to compare.
  12882. * @param {*} other The other value to compare.
  12883. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12884. * @example
  12885. *
  12886. * var object = { 'a': 1 };
  12887. * var other = { 'a': 1 };
  12888. *
  12889. * _.eq(object, object);
  12890. * // => true
  12891. *
  12892. * _.eq(object, other);
  12893. * // => false
  12894. *
  12895. * _.eq('a', 'a');
  12896. * // => true
  12897. *
  12898. * _.eq('a', Object('a'));
  12899. * // => false
  12900. *
  12901. * _.eq(NaN, NaN);
  12902. * // => true
  12903. */
  12904. function eq(value, other) {
  12905. return value === other || (value !== value && other !== other);
  12906. }
  12907. /**
  12908. * Checks if `value` is classified as an `Array` object.
  12909. *
  12910. * @static
  12911. * @memberOf _
  12912. * @since 0.1.0
  12913. * @category Lang
  12914. * @param {*} value The value to check.
  12915. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12916. * @example
  12917. *
  12918. * _.isArray([1, 2, 3]);
  12919. * // => true
  12920. *
  12921. * _.isArray(document.body.children);
  12922. * // => false
  12923. *
  12924. * _.isArray('abc');
  12925. * // => false
  12926. *
  12927. * _.isArray(_.noop);
  12928. * // => false
  12929. */
  12930. var isArray = Array.isArray;
  12931. /**
  12932. * Checks if `value` is classified as a `Function` object.
  12933. *
  12934. * @static
  12935. * @memberOf _
  12936. * @since 0.1.0
  12937. * @category Lang
  12938. * @param {*} value The value to check.
  12939. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12940. * @example
  12941. *
  12942. * _.isFunction(_);
  12943. * // => true
  12944. *
  12945. * _.isFunction(/abc/);
  12946. * // => false
  12947. */
  12948. function isFunction(value) {
  12949. // The use of `Object#toString` avoids issues with the `typeof` operator
  12950. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  12951. var tag = isObject(value) ? objectToString.call(value) : '';
  12952. return tag == funcTag || tag == genTag;
  12953. }
  12954. /**
  12955. * Checks if `value` is the
  12956. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12957. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12958. *
  12959. * @static
  12960. * @memberOf _
  12961. * @since 0.1.0
  12962. * @category Lang
  12963. * @param {*} value The value to check.
  12964. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12965. * @example
  12966. *
  12967. * _.isObject({});
  12968. * // => true
  12969. *
  12970. * _.isObject([1, 2, 3]);
  12971. * // => true
  12972. *
  12973. * _.isObject(_.noop);
  12974. * // => true
  12975. *
  12976. * _.isObject(null);
  12977. * // => false
  12978. */
  12979. function isObject(value) {
  12980. var type = typeof value;
  12981. return !!value && (type == 'object' || type == 'function');
  12982. }
  12983. /**
  12984. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12985. * and has a `typeof` result of "object".
  12986. *
  12987. * @static
  12988. * @memberOf _
  12989. * @since 4.0.0
  12990. * @category Lang
  12991. * @param {*} value The value to check.
  12992. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12993. * @example
  12994. *
  12995. * _.isObjectLike({});
  12996. * // => true
  12997. *
  12998. * _.isObjectLike([1, 2, 3]);
  12999. * // => true
  13000. *
  13001. * _.isObjectLike(_.noop);
  13002. * // => false
  13003. *
  13004. * _.isObjectLike(null);
  13005. * // => false
  13006. */
  13007. function isObjectLike(value) {
  13008. return !!value && typeof value == 'object';
  13009. }
  13010. /**
  13011. * Checks if `value` is classified as a `Symbol` primitive or object.
  13012. *
  13013. * @static
  13014. * @memberOf _
  13015. * @since 4.0.0
  13016. * @category Lang
  13017. * @param {*} value The value to check.
  13018. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13019. * @example
  13020. *
  13021. * _.isSymbol(Symbol.iterator);
  13022. * // => true
  13023. *
  13024. * _.isSymbol('abc');
  13025. * // => false
  13026. */
  13027. function isSymbol(value) {
  13028. return typeof value == 'symbol' ||
  13029. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13030. }
  13031. /**
  13032. * Converts `value` to a string. An empty string is returned for `null`
  13033. * and `undefined` values. The sign of `-0` is preserved.
  13034. *
  13035. * @static
  13036. * @memberOf _
  13037. * @since 4.0.0
  13038. * @category Lang
  13039. * @param {*} value The value to process.
  13040. * @returns {string} Returns the string.
  13041. * @example
  13042. *
  13043. * _.toString(null);
  13044. * // => ''
  13045. *
  13046. * _.toString(-0);
  13047. * // => '-0'
  13048. *
  13049. * _.toString([1, 2, 3]);
  13050. * // => '1,2,3'
  13051. */
  13052. function toString(value) {
  13053. return value == null ? '' : baseToString(value);
  13054. }
  13055. /**
  13056. * Gets the value at `path` of `object`. If the resolved value is
  13057. * `undefined`, the `defaultValue` is returned in its place.
  13058. *
  13059. * @static
  13060. * @memberOf _
  13061. * @since 3.7.0
  13062. * @category Object
  13063. * @param {Object} object The object to query.
  13064. * @param {Array|string} path The path of the property to get.
  13065. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13066. * @returns {*} Returns the resolved value.
  13067. * @example
  13068. *
  13069. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13070. *
  13071. * _.get(object, 'a[0].b.c');
  13072. * // => 3
  13073. *
  13074. * _.get(object, ['a', '0', 'b', 'c']);
  13075. * // => 3
  13076. *
  13077. * _.get(object, 'a.b.c', 'default');
  13078. * // => 'default'
  13079. */
  13080. function get(object, path, defaultValue) {
  13081. var result = object == null ? undefined : baseGet(object, path);
  13082. return result === undefined ? defaultValue : result;
  13083. }
  13084. module.exports = get;
  13085. /***/ }),
  13086. /***/ 855:
  13087. /***/ (function(module, __unusedexports, __webpack_require__) {
  13088. module.exports = registerPlugin;
  13089. const factory = __webpack_require__(47);
  13090. function registerPlugin(plugins, pluginFunction) {
  13091. return factory(
  13092. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  13093. );
  13094. }
  13095. /***/ }),
  13096. /***/ 856:
  13097. /***/ (function(module, __unusedexports, __webpack_require__) {
  13098. module.exports = __webpack_require__(141);
  13099. /***/ }),
  13100. /***/ 863:
  13101. /***/ (function(module, __unusedexports, __webpack_require__) {
  13102. module.exports = authenticationBeforeRequest;
  13103. const btoa = __webpack_require__(675);
  13104. const withAuthorizationPrefix = __webpack_require__(143);
  13105. function authenticationBeforeRequest(state, options) {
  13106. if (typeof state.auth === "string") {
  13107. options.headers.authorization = withAuthorizationPrefix(state.auth);
  13108. return;
  13109. }
  13110. if (state.auth.username) {
  13111. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  13112. options.headers.authorization = `Basic ${hash}`;
  13113. if (state.otp) {
  13114. options.headers["x-github-otp"] = state.otp;
  13115. }
  13116. return;
  13117. }
  13118. if (state.auth.clientId) {
  13119. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  13120. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  13121. // URL though: `/applications/:client_id/tokens/:access_token`.
  13122. //
  13123. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  13124. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  13125. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  13126. //
  13127. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  13128. // as well as "/applications/123/tokens/token456"
  13129. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  13130. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  13131. options.headers.authorization = `Basic ${hash}`;
  13132. return;
  13133. }
  13134. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  13135. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  13136. return;
  13137. }
  13138. return Promise.resolve()
  13139. .then(() => {
  13140. return state.auth();
  13141. })
  13142. .then(authorization => {
  13143. options.headers.authorization = withAuthorizationPrefix(authorization);
  13144. });
  13145. }
  13146. /***/ }),
  13147. /***/ 866:
  13148. /***/ (function(module, __unusedexports, __webpack_require__) {
  13149. "use strict";
  13150. var shebangRegex = __webpack_require__(816);
  13151. module.exports = function (str) {
  13152. var match = str.match(shebangRegex);
  13153. if (!match) {
  13154. return null;
  13155. }
  13156. var arr = match[0].replace(/#! ?/, '').split(' ');
  13157. var bin = arr[0].split('/').pop();
  13158. var arg = arr[1];
  13159. return (bin === 'env' ?
  13160. arg :
  13161. bin + (arg ? ' ' + arg : '')
  13162. );
  13163. };
  13164. /***/ }),
  13165. /***/ 874:
  13166. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13167. "use strict";
  13168. // Copyright (c) Microsoft. All rights reserved.
  13169. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  13170. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13171. return new (P || (P = Promise))(function (resolve, reject) {
  13172. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13173. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13174. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  13175. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13176. });
  13177. };
  13178. Object.defineProperty(exports, "__esModule", { value: true });
  13179. const url = __webpack_require__(835);
  13180. const http = __webpack_require__(605);
  13181. const https = __webpack_require__(211);
  13182. let fs;
  13183. let tunnel;
  13184. var HttpCodes;
  13185. (function (HttpCodes) {
  13186. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  13187. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  13188. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  13189. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  13190. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  13191. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  13192. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  13193. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  13194. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  13195. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  13196. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  13197. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  13198. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  13199. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  13200. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  13201. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  13202. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  13203. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  13204. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  13205. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  13206. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  13207. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  13208. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  13209. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  13210. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  13211. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  13212. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  13213. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  13214. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  13215. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  13216. const ExponentialBackoffCeiling = 10;
  13217. const ExponentialBackoffTimeSlice = 5;
  13218. class HttpClientResponse {
  13219. constructor(message) {
  13220. this.message = message;
  13221. }
  13222. readBody() {
  13223. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  13224. let output = '';
  13225. this.message.on('data', (chunk) => {
  13226. output += chunk;
  13227. });
  13228. this.message.on('end', () => {
  13229. resolve(output);
  13230. });
  13231. }));
  13232. }
  13233. }
  13234. exports.HttpClientResponse = HttpClientResponse;
  13235. function isHttps(requestUrl) {
  13236. let parsedUrl = url.parse(requestUrl);
  13237. return parsedUrl.protocol === 'https:';
  13238. }
  13239. exports.isHttps = isHttps;
  13240. var EnvironmentVariables;
  13241. (function (EnvironmentVariables) {
  13242. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  13243. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  13244. })(EnvironmentVariables || (EnvironmentVariables = {}));
  13245. class HttpClient {
  13246. constructor(userAgent, handlers, requestOptions) {
  13247. this._ignoreSslError = false;
  13248. this._allowRedirects = true;
  13249. this._maxRedirects = 50;
  13250. this._allowRetries = false;
  13251. this._maxRetries = 1;
  13252. this._keepAlive = false;
  13253. this._disposed = false;
  13254. this.userAgent = userAgent;
  13255. this.handlers = handlers || [];
  13256. this.requestOptions = requestOptions;
  13257. if (requestOptions) {
  13258. if (requestOptions.ignoreSslError != null) {
  13259. this._ignoreSslError = requestOptions.ignoreSslError;
  13260. }
  13261. this._socketTimeout = requestOptions.socketTimeout;
  13262. this._httpProxy = requestOptions.proxy;
  13263. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  13264. this._httpProxyBypassHosts = [];
  13265. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  13266. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  13267. });
  13268. }
  13269. this._certConfig = requestOptions.cert;
  13270. if (this._certConfig) {
  13271. // If using cert, need fs
  13272. fs = __webpack_require__(747);
  13273. // cache the cert content into memory, so we don't have to read it from disk every time
  13274. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  13275. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  13276. }
  13277. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  13278. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  13279. }
  13280. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  13281. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  13282. }
  13283. }
  13284. if (requestOptions.allowRedirects != null) {
  13285. this._allowRedirects = requestOptions.allowRedirects;
  13286. }
  13287. if (requestOptions.maxRedirects != null) {
  13288. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  13289. }
  13290. if (requestOptions.keepAlive != null) {
  13291. this._keepAlive = requestOptions.keepAlive;
  13292. }
  13293. if (requestOptions.allowRetries != null) {
  13294. this._allowRetries = requestOptions.allowRetries;
  13295. }
  13296. if (requestOptions.maxRetries != null) {
  13297. this._maxRetries = requestOptions.maxRetries;
  13298. }
  13299. }
  13300. }
  13301. options(requestUrl, additionalHeaders) {
  13302. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  13303. }
  13304. get(requestUrl, additionalHeaders) {
  13305. return this.request('GET', requestUrl, null, additionalHeaders || {});
  13306. }
  13307. del(requestUrl, additionalHeaders) {
  13308. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  13309. }
  13310. post(requestUrl, data, additionalHeaders) {
  13311. return this.request('POST', requestUrl, data, additionalHeaders || {});
  13312. }
  13313. patch(requestUrl, data, additionalHeaders) {
  13314. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  13315. }
  13316. put(requestUrl, data, additionalHeaders) {
  13317. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  13318. }
  13319. head(requestUrl, additionalHeaders) {
  13320. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  13321. }
  13322. sendStream(verb, requestUrl, stream, additionalHeaders) {
  13323. return this.request(verb, requestUrl, stream, additionalHeaders);
  13324. }
  13325. /**
  13326. * Makes a raw http request.
  13327. * All other methods such as get, post, patch, and request ultimately call this.
  13328. * Prefer get, del, post and patch
  13329. */
  13330. request(verb, requestUrl, data, headers) {
  13331. return __awaiter(this, void 0, void 0, function* () {
  13332. if (this._disposed) {
  13333. throw new Error("Client has already been disposed.");
  13334. }
  13335. let info = this._prepareRequest(verb, requestUrl, headers);
  13336. // Only perform retries on reads since writes may not be idempotent.
  13337. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  13338. let numTries = 0;
  13339. let response;
  13340. while (numTries < maxTries) {
  13341. response = yield this.requestRaw(info, data);
  13342. // Check if it's an authentication challenge
  13343. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  13344. let authenticationHandler;
  13345. for (let i = 0; i < this.handlers.length; i++) {
  13346. if (this.handlers[i].canHandleAuthentication(response)) {
  13347. authenticationHandler = this.handlers[i];
  13348. break;
  13349. }
  13350. }
  13351. if (authenticationHandler) {
  13352. return authenticationHandler.handleAuthentication(this, info, data);
  13353. }
  13354. else {
  13355. // We have received an unauthorized response but have no handlers to handle it.
  13356. // Let the response return to the caller.
  13357. return response;
  13358. }
  13359. }
  13360. let redirectsRemaining = this._maxRedirects;
  13361. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  13362. && this._allowRedirects
  13363. && redirectsRemaining > 0) {
  13364. const redirectUrl = response.message.headers["location"];
  13365. if (!redirectUrl) {
  13366. // if there's no location to redirect to, we won't
  13367. break;
  13368. }
  13369. // we need to finish reading the response before reassigning response
  13370. // which will leak the open socket.
  13371. yield response.readBody();
  13372. // let's make the request with the new redirectUrl
  13373. info = this._prepareRequest(verb, redirectUrl, headers);
  13374. response = yield this.requestRaw(info, data);
  13375. redirectsRemaining--;
  13376. }
  13377. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  13378. // If not a retry code, return immediately instead of retrying
  13379. return response;
  13380. }
  13381. numTries += 1;
  13382. if (numTries < maxTries) {
  13383. yield response.readBody();
  13384. yield this._performExponentialBackoff(numTries);
  13385. }
  13386. }
  13387. return response;
  13388. });
  13389. }
  13390. /**
  13391. * Needs to be called if keepAlive is set to true in request options.
  13392. */
  13393. dispose() {
  13394. if (this._agent) {
  13395. this._agent.destroy();
  13396. }
  13397. this._disposed = true;
  13398. }
  13399. /**
  13400. * Raw request.
  13401. * @param info
  13402. * @param data
  13403. */
  13404. requestRaw(info, data) {
  13405. return new Promise((resolve, reject) => {
  13406. let callbackForResult = function (err, res) {
  13407. if (err) {
  13408. reject(err);
  13409. }
  13410. resolve(res);
  13411. };
  13412. this.requestRawWithCallback(info, data, callbackForResult);
  13413. });
  13414. }
  13415. /**
  13416. * Raw request with callback.
  13417. * @param info
  13418. * @param data
  13419. * @param onResult
  13420. */
  13421. requestRawWithCallback(info, data, onResult) {
  13422. let socket;
  13423. let isDataString = typeof (data) === 'string';
  13424. if (typeof (data) === 'string') {
  13425. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13426. }
  13427. let callbackCalled = false;
  13428. let handleResult = (err, res) => {
  13429. if (!callbackCalled) {
  13430. callbackCalled = true;
  13431. onResult(err, res);
  13432. }
  13433. };
  13434. let req = info.httpModule.request(info.options, (msg) => {
  13435. let res = new HttpClientResponse(msg);
  13436. handleResult(null, res);
  13437. });
  13438. req.on('socket', (sock) => {
  13439. socket = sock;
  13440. });
  13441. // If we ever get disconnected, we want the socket to timeout eventually
  13442. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13443. if (socket) {
  13444. socket.end();
  13445. }
  13446. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13447. });
  13448. req.on('error', function (err) {
  13449. // err has statusCode property
  13450. // res should have headers
  13451. handleResult(err, null);
  13452. });
  13453. if (data && typeof (data) === 'string') {
  13454. req.write(data, 'utf8');
  13455. }
  13456. if (data && typeof (data) !== 'string') {
  13457. data.on('close', function () {
  13458. req.end();
  13459. });
  13460. data.pipe(req);
  13461. }
  13462. else {
  13463. req.end();
  13464. }
  13465. }
  13466. _prepareRequest(method, requestUrl, headers) {
  13467. const info = {};
  13468. info.parsedUrl = url.parse(requestUrl);
  13469. const usingSsl = info.parsedUrl.protocol === 'https:';
  13470. info.httpModule = usingSsl ? https : http;
  13471. const defaultPort = usingSsl ? 443 : 80;
  13472. info.options = {};
  13473. info.options.host = info.parsedUrl.hostname;
  13474. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13475. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13476. info.options.method = method;
  13477. info.options.headers = this._mergeHeaders(headers);
  13478. info.options.headers["user-agent"] = this.userAgent;
  13479. info.options.agent = this._getAgent(requestUrl);
  13480. // gives handlers an opportunity to participate
  13481. if (this.handlers && !this._isPresigned(requestUrl)) {
  13482. this.handlers.forEach((handler) => {
  13483. handler.prepareRequest(info.options);
  13484. });
  13485. }
  13486. return info;
  13487. }
  13488. _isPresigned(requestUrl) {
  13489. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13490. const patterns = this.requestOptions.presignedUrlPatterns;
  13491. for (let i = 0; i < patterns.length; i++) {
  13492. if (requestUrl.match(patterns[i])) {
  13493. return true;
  13494. }
  13495. }
  13496. }
  13497. return false;
  13498. }
  13499. _mergeHeaders(headers) {
  13500. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13501. if (this.requestOptions && this.requestOptions.headers) {
  13502. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13503. }
  13504. return lowercaseKeys(headers || {});
  13505. }
  13506. _getAgent(requestUrl) {
  13507. let agent;
  13508. let proxy = this._getProxy(requestUrl);
  13509. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13510. if (this._keepAlive && useProxy) {
  13511. agent = this._proxyAgent;
  13512. }
  13513. if (this._keepAlive && !useProxy) {
  13514. agent = this._agent;
  13515. }
  13516. // if agent is already assigned use that agent.
  13517. if (!!agent) {
  13518. return agent;
  13519. }
  13520. let parsedUrl = url.parse(requestUrl);
  13521. const usingSsl = parsedUrl.protocol === 'https:';
  13522. let maxSockets = 100;
  13523. if (!!this.requestOptions) {
  13524. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13525. }
  13526. if (useProxy) {
  13527. // If using proxy, need tunnel
  13528. if (!tunnel) {
  13529. tunnel = __webpack_require__(856);
  13530. }
  13531. const agentOptions = {
  13532. maxSockets: maxSockets,
  13533. keepAlive: this._keepAlive,
  13534. proxy: {
  13535. proxyAuth: proxy.proxyAuth,
  13536. host: proxy.proxyUrl.hostname,
  13537. port: proxy.proxyUrl.port
  13538. },
  13539. };
  13540. let tunnelAgent;
  13541. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13542. if (usingSsl) {
  13543. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13544. }
  13545. else {
  13546. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13547. }
  13548. agent = tunnelAgent(agentOptions);
  13549. this._proxyAgent = agent;
  13550. }
  13551. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13552. if (this._keepAlive && !agent) {
  13553. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13554. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13555. this._agent = agent;
  13556. }
  13557. // if not using private agent and tunnel agent isn't setup then use global agent
  13558. if (!agent) {
  13559. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13560. }
  13561. if (usingSsl && this._ignoreSslError) {
  13562. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13563. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13564. // we have to cast it to any and change it directly
  13565. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13566. }
  13567. if (usingSsl && this._certConfig) {
  13568. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13569. }
  13570. return agent;
  13571. }
  13572. _getProxy(requestUrl) {
  13573. const parsedUrl = url.parse(requestUrl);
  13574. let usingSsl = parsedUrl.protocol === 'https:';
  13575. let proxyConfig = this._httpProxy;
  13576. // fallback to http_proxy and https_proxy env
  13577. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13578. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13579. if (!proxyConfig) {
  13580. if (https_proxy && usingSsl) {
  13581. proxyConfig = {
  13582. proxyUrl: https_proxy
  13583. };
  13584. }
  13585. else if (http_proxy) {
  13586. proxyConfig = {
  13587. proxyUrl: http_proxy
  13588. };
  13589. }
  13590. }
  13591. let proxyUrl;
  13592. let proxyAuth;
  13593. if (proxyConfig) {
  13594. if (proxyConfig.proxyUrl.length > 0) {
  13595. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13596. }
  13597. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13598. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13599. }
  13600. }
  13601. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13602. }
  13603. _isBypassProxy(requestUrl) {
  13604. if (!this._httpProxyBypassHosts) {
  13605. return false;
  13606. }
  13607. let bypass = false;
  13608. this._httpProxyBypassHosts.forEach(bypassHost => {
  13609. if (bypassHost.test(requestUrl)) {
  13610. bypass = true;
  13611. }
  13612. });
  13613. return bypass;
  13614. }
  13615. _performExponentialBackoff(retryNumber) {
  13616. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13617. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13618. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13619. }
  13620. }
  13621. exports.HttpClient = HttpClient;
  13622. /***/ }),
  13623. /***/ 881:
  13624. /***/ (function(module) {
  13625. "use strict";
  13626. const isWin = process.platform === 'win32';
  13627. function notFoundError(original, syscall) {
  13628. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13629. code: 'ENOENT',
  13630. errno: 'ENOENT',
  13631. syscall: `${syscall} ${original.command}`,
  13632. path: original.command,
  13633. spawnargs: original.args,
  13634. });
  13635. }
  13636. function hookChildProcess(cp, parsed) {
  13637. if (!isWin) {
  13638. return;
  13639. }
  13640. const originalEmit = cp.emit;
  13641. cp.emit = function (name, arg1) {
  13642. // If emitting "exit" event and exit code is 1, we need to check if
  13643. // the command exists and emit an "error" instead
  13644. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13645. if (name === 'exit') {
  13646. const err = verifyENOENT(arg1, parsed, 'spawn');
  13647. if (err) {
  13648. return originalEmit.call(cp, 'error', err);
  13649. }
  13650. }
  13651. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13652. };
  13653. }
  13654. function verifyENOENT(status, parsed) {
  13655. if (isWin && status === 1 && !parsed.file) {
  13656. return notFoundError(parsed.original, 'spawn');
  13657. }
  13658. return null;
  13659. }
  13660. function verifyENOENTSync(status, parsed) {
  13661. if (isWin && status === 1 && !parsed.file) {
  13662. return notFoundError(parsed.original, 'spawnSync');
  13663. }
  13664. return null;
  13665. }
  13666. module.exports = {
  13667. hookChildProcess,
  13668. verifyENOENT,
  13669. verifyENOENTSync,
  13670. notFoundError,
  13671. };
  13672. /***/ }),
  13673. /***/ 883:
  13674. /***/ (function(module) {
  13675. /**
  13676. * lodash (Custom Build) <https://lodash.com/>
  13677. * Build: `lodash modularize exports="npm" -o ./`
  13678. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13679. * Released under MIT license <https://lodash.com/license>
  13680. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13681. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13682. */
  13683. /** Used as the `TypeError` message for "Functions" methods. */
  13684. var FUNC_ERROR_TEXT = 'Expected a function';
  13685. /** Used to stand-in for `undefined` hash values. */
  13686. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13687. /** Used as references for various `Number` constants. */
  13688. var INFINITY = 1 / 0,
  13689. MAX_SAFE_INTEGER = 9007199254740991;
  13690. /** `Object#toString` result references. */
  13691. var funcTag = '[object Function]',
  13692. genTag = '[object GeneratorFunction]',
  13693. symbolTag = '[object Symbol]';
  13694. /** Used to match property names within property paths. */
  13695. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13696. reIsPlainProp = /^\w*$/,
  13697. reLeadingDot = /^\./,
  13698. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13699. /**
  13700. * Used to match `RegExp`
  13701. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13702. */
  13703. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13704. /** Used to match backslashes in property paths. */
  13705. var reEscapeChar = /\\(\\)?/g;
  13706. /** Used to detect host constructors (Safari). */
  13707. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13708. /** Used to detect unsigned integer values. */
  13709. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13710. /** Detect free variable `global` from Node.js. */
  13711. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13712. /** Detect free variable `self`. */
  13713. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13714. /** Used as a reference to the global object. */
  13715. var root = freeGlobal || freeSelf || Function('return this')();
  13716. /**
  13717. * Gets the value at `key` of `object`.
  13718. *
  13719. * @private
  13720. * @param {Object} [object] The object to query.
  13721. * @param {string} key The key of the property to get.
  13722. * @returns {*} Returns the property value.
  13723. */
  13724. function getValue(object, key) {
  13725. return object == null ? undefined : object[key];
  13726. }
  13727. /**
  13728. * Checks if `value` is a host object in IE < 9.
  13729. *
  13730. * @private
  13731. * @param {*} value The value to check.
  13732. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13733. */
  13734. function isHostObject(value) {
  13735. // Many host objects are `Object` objects that can coerce to strings
  13736. // despite having improperly defined `toString` methods.
  13737. var result = false;
  13738. if (value != null && typeof value.toString != 'function') {
  13739. try {
  13740. result = !!(value + '');
  13741. } catch (e) {}
  13742. }
  13743. return result;
  13744. }
  13745. /** Used for built-in method references. */
  13746. var arrayProto = Array.prototype,
  13747. funcProto = Function.prototype,
  13748. objectProto = Object.prototype;
  13749. /** Used to detect overreaching core-js shims. */
  13750. var coreJsData = root['__core-js_shared__'];
  13751. /** Used to detect methods masquerading as native. */
  13752. var maskSrcKey = (function() {
  13753. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  13754. return uid ? ('Symbol(src)_1.' + uid) : '';
  13755. }());
  13756. /** Used to resolve the decompiled source of functions. */
  13757. var funcToString = funcProto.toString;
  13758. /** Used to check objects for own properties. */
  13759. var hasOwnProperty = objectProto.hasOwnProperty;
  13760. /**
  13761. * Used to resolve the
  13762. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  13763. * of values.
  13764. */
  13765. var objectToString = objectProto.toString;
  13766. /** Used to detect if a method is native. */
  13767. var reIsNative = RegExp('^' +
  13768. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  13769. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  13770. );
  13771. /** Built-in value references. */
  13772. var Symbol = root.Symbol,
  13773. splice = arrayProto.splice;
  13774. /* Built-in method references that are verified to be native. */
  13775. var Map = getNative(root, 'Map'),
  13776. nativeCreate = getNative(Object, 'create');
  13777. /** Used to convert symbols to primitives and strings. */
  13778. var symbolProto = Symbol ? Symbol.prototype : undefined,
  13779. symbolToString = symbolProto ? symbolProto.toString : undefined;
  13780. /**
  13781. * Creates a hash object.
  13782. *
  13783. * @private
  13784. * @constructor
  13785. * @param {Array} [entries] The key-value pairs to cache.
  13786. */
  13787. function Hash(entries) {
  13788. var index = -1,
  13789. length = entries ? entries.length : 0;
  13790. this.clear();
  13791. while (++index < length) {
  13792. var entry = entries[index];
  13793. this.set(entry[0], entry[1]);
  13794. }
  13795. }
  13796. /**
  13797. * Removes all key-value entries from the hash.
  13798. *
  13799. * @private
  13800. * @name clear
  13801. * @memberOf Hash
  13802. */
  13803. function hashClear() {
  13804. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  13805. }
  13806. /**
  13807. * Removes `key` and its value from the hash.
  13808. *
  13809. * @private
  13810. * @name delete
  13811. * @memberOf Hash
  13812. * @param {Object} hash The hash to modify.
  13813. * @param {string} key The key of the value to remove.
  13814. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13815. */
  13816. function hashDelete(key) {
  13817. return this.has(key) && delete this.__data__[key];
  13818. }
  13819. /**
  13820. * Gets the hash value for `key`.
  13821. *
  13822. * @private
  13823. * @name get
  13824. * @memberOf Hash
  13825. * @param {string} key The key of the value to get.
  13826. * @returns {*} Returns the entry value.
  13827. */
  13828. function hashGet(key) {
  13829. var data = this.__data__;
  13830. if (nativeCreate) {
  13831. var result = data[key];
  13832. return result === HASH_UNDEFINED ? undefined : result;
  13833. }
  13834. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  13835. }
  13836. /**
  13837. * Checks if a hash value for `key` exists.
  13838. *
  13839. * @private
  13840. * @name has
  13841. * @memberOf Hash
  13842. * @param {string} key The key of the entry to check.
  13843. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13844. */
  13845. function hashHas(key) {
  13846. var data = this.__data__;
  13847. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  13848. }
  13849. /**
  13850. * Sets the hash `key` to `value`.
  13851. *
  13852. * @private
  13853. * @name set
  13854. * @memberOf Hash
  13855. * @param {string} key The key of the value to set.
  13856. * @param {*} value The value to set.
  13857. * @returns {Object} Returns the hash instance.
  13858. */
  13859. function hashSet(key, value) {
  13860. var data = this.__data__;
  13861. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  13862. return this;
  13863. }
  13864. // Add methods to `Hash`.
  13865. Hash.prototype.clear = hashClear;
  13866. Hash.prototype['delete'] = hashDelete;
  13867. Hash.prototype.get = hashGet;
  13868. Hash.prototype.has = hashHas;
  13869. Hash.prototype.set = hashSet;
  13870. /**
  13871. * Creates an list cache object.
  13872. *
  13873. * @private
  13874. * @constructor
  13875. * @param {Array} [entries] The key-value pairs to cache.
  13876. */
  13877. function ListCache(entries) {
  13878. var index = -1,
  13879. length = entries ? entries.length : 0;
  13880. this.clear();
  13881. while (++index < length) {
  13882. var entry = entries[index];
  13883. this.set(entry[0], entry[1]);
  13884. }
  13885. }
  13886. /**
  13887. * Removes all key-value entries from the list cache.
  13888. *
  13889. * @private
  13890. * @name clear
  13891. * @memberOf ListCache
  13892. */
  13893. function listCacheClear() {
  13894. this.__data__ = [];
  13895. }
  13896. /**
  13897. * Removes `key` and its value from the list cache.
  13898. *
  13899. * @private
  13900. * @name delete
  13901. * @memberOf ListCache
  13902. * @param {string} key The key of the value to remove.
  13903. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13904. */
  13905. function listCacheDelete(key) {
  13906. var data = this.__data__,
  13907. index = assocIndexOf(data, key);
  13908. if (index < 0) {
  13909. return false;
  13910. }
  13911. var lastIndex = data.length - 1;
  13912. if (index == lastIndex) {
  13913. data.pop();
  13914. } else {
  13915. splice.call(data, index, 1);
  13916. }
  13917. return true;
  13918. }
  13919. /**
  13920. * Gets the list cache value for `key`.
  13921. *
  13922. * @private
  13923. * @name get
  13924. * @memberOf ListCache
  13925. * @param {string} key The key of the value to get.
  13926. * @returns {*} Returns the entry value.
  13927. */
  13928. function listCacheGet(key) {
  13929. var data = this.__data__,
  13930. index = assocIndexOf(data, key);
  13931. return index < 0 ? undefined : data[index][1];
  13932. }
  13933. /**
  13934. * Checks if a list cache value for `key` exists.
  13935. *
  13936. * @private
  13937. * @name has
  13938. * @memberOf ListCache
  13939. * @param {string} key The key of the entry to check.
  13940. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13941. */
  13942. function listCacheHas(key) {
  13943. return assocIndexOf(this.__data__, key) > -1;
  13944. }
  13945. /**
  13946. * Sets the list cache `key` to `value`.
  13947. *
  13948. * @private
  13949. * @name set
  13950. * @memberOf ListCache
  13951. * @param {string} key The key of the value to set.
  13952. * @param {*} value The value to set.
  13953. * @returns {Object} Returns the list cache instance.
  13954. */
  13955. function listCacheSet(key, value) {
  13956. var data = this.__data__,
  13957. index = assocIndexOf(data, key);
  13958. if (index < 0) {
  13959. data.push([key, value]);
  13960. } else {
  13961. data[index][1] = value;
  13962. }
  13963. return this;
  13964. }
  13965. // Add methods to `ListCache`.
  13966. ListCache.prototype.clear = listCacheClear;
  13967. ListCache.prototype['delete'] = listCacheDelete;
  13968. ListCache.prototype.get = listCacheGet;
  13969. ListCache.prototype.has = listCacheHas;
  13970. ListCache.prototype.set = listCacheSet;
  13971. /**
  13972. * Creates a map cache object to store key-value pairs.
  13973. *
  13974. * @private
  13975. * @constructor
  13976. * @param {Array} [entries] The key-value pairs to cache.
  13977. */
  13978. function MapCache(entries) {
  13979. var index = -1,
  13980. length = entries ? entries.length : 0;
  13981. this.clear();
  13982. while (++index < length) {
  13983. var entry = entries[index];
  13984. this.set(entry[0], entry[1]);
  13985. }
  13986. }
  13987. /**
  13988. * Removes all key-value entries from the map.
  13989. *
  13990. * @private
  13991. * @name clear
  13992. * @memberOf MapCache
  13993. */
  13994. function mapCacheClear() {
  13995. this.__data__ = {
  13996. 'hash': new Hash,
  13997. 'map': new (Map || ListCache),
  13998. 'string': new Hash
  13999. };
  14000. }
  14001. /**
  14002. * Removes `key` and its value from the map.
  14003. *
  14004. * @private
  14005. * @name delete
  14006. * @memberOf MapCache
  14007. * @param {string} key The key of the value to remove.
  14008. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  14009. */
  14010. function mapCacheDelete(key) {
  14011. return getMapData(this, key)['delete'](key);
  14012. }
  14013. /**
  14014. * Gets the map value for `key`.
  14015. *
  14016. * @private
  14017. * @name get
  14018. * @memberOf MapCache
  14019. * @param {string} key The key of the value to get.
  14020. * @returns {*} Returns the entry value.
  14021. */
  14022. function mapCacheGet(key) {
  14023. return getMapData(this, key).get(key);
  14024. }
  14025. /**
  14026. * Checks if a map value for `key` exists.
  14027. *
  14028. * @private
  14029. * @name has
  14030. * @memberOf MapCache
  14031. * @param {string} key The key of the entry to check.
  14032. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14033. */
  14034. function mapCacheHas(key) {
  14035. return getMapData(this, key).has(key);
  14036. }
  14037. /**
  14038. * Sets the map `key` to `value`.
  14039. *
  14040. * @private
  14041. * @name set
  14042. * @memberOf MapCache
  14043. * @param {string} key The key of the value to set.
  14044. * @param {*} value The value to set.
  14045. * @returns {Object} Returns the map cache instance.
  14046. */
  14047. function mapCacheSet(key, value) {
  14048. getMapData(this, key).set(key, value);
  14049. return this;
  14050. }
  14051. // Add methods to `MapCache`.
  14052. MapCache.prototype.clear = mapCacheClear;
  14053. MapCache.prototype['delete'] = mapCacheDelete;
  14054. MapCache.prototype.get = mapCacheGet;
  14055. MapCache.prototype.has = mapCacheHas;
  14056. MapCache.prototype.set = mapCacheSet;
  14057. /**
  14058. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  14059. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14060. * for equality comparisons.
  14061. *
  14062. * @private
  14063. * @param {Object} object The object to modify.
  14064. * @param {string} key The key of the property to assign.
  14065. * @param {*} value The value to assign.
  14066. */
  14067. function assignValue(object, key, value) {
  14068. var objValue = object[key];
  14069. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  14070. (value === undefined && !(key in object))) {
  14071. object[key] = value;
  14072. }
  14073. }
  14074. /**
  14075. * Gets the index at which the `key` is found in `array` of key-value pairs.
  14076. *
  14077. * @private
  14078. * @param {Array} array The array to inspect.
  14079. * @param {*} key The key to search for.
  14080. * @returns {number} Returns the index of the matched value, else `-1`.
  14081. */
  14082. function assocIndexOf(array, key) {
  14083. var length = array.length;
  14084. while (length--) {
  14085. if (eq(array[length][0], key)) {
  14086. return length;
  14087. }
  14088. }
  14089. return -1;
  14090. }
  14091. /**
  14092. * The base implementation of `_.isNative` without bad shim checks.
  14093. *
  14094. * @private
  14095. * @param {*} value The value to check.
  14096. * @returns {boolean} Returns `true` if `value` is a native function,
  14097. * else `false`.
  14098. */
  14099. function baseIsNative(value) {
  14100. if (!isObject(value) || isMasked(value)) {
  14101. return false;
  14102. }
  14103. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  14104. return pattern.test(toSource(value));
  14105. }
  14106. /**
  14107. * The base implementation of `_.set`.
  14108. *
  14109. * @private
  14110. * @param {Object} object The object to modify.
  14111. * @param {Array|string} path The path of the property to set.
  14112. * @param {*} value The value to set.
  14113. * @param {Function} [customizer] The function to customize path creation.
  14114. * @returns {Object} Returns `object`.
  14115. */
  14116. function baseSet(object, path, value, customizer) {
  14117. if (!isObject(object)) {
  14118. return object;
  14119. }
  14120. path = isKey(path, object) ? [path] : castPath(path);
  14121. var index = -1,
  14122. length = path.length,
  14123. lastIndex = length - 1,
  14124. nested = object;
  14125. while (nested != null && ++index < length) {
  14126. var key = toKey(path[index]),
  14127. newValue = value;
  14128. if (index != lastIndex) {
  14129. var objValue = nested[key];
  14130. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  14131. if (newValue === undefined) {
  14132. newValue = isObject(objValue)
  14133. ? objValue
  14134. : (isIndex(path[index + 1]) ? [] : {});
  14135. }
  14136. }
  14137. assignValue(nested, key, newValue);
  14138. nested = nested[key];
  14139. }
  14140. return object;
  14141. }
  14142. /**
  14143. * The base implementation of `_.toString` which doesn't convert nullish
  14144. * values to empty strings.
  14145. *
  14146. * @private
  14147. * @param {*} value The value to process.
  14148. * @returns {string} Returns the string.
  14149. */
  14150. function baseToString(value) {
  14151. // Exit early for strings to avoid a performance hit in some environments.
  14152. if (typeof value == 'string') {
  14153. return value;
  14154. }
  14155. if (isSymbol(value)) {
  14156. return symbolToString ? symbolToString.call(value) : '';
  14157. }
  14158. var result = (value + '');
  14159. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14160. }
  14161. /**
  14162. * Casts `value` to a path array if it's not one.
  14163. *
  14164. * @private
  14165. * @param {*} value The value to inspect.
  14166. * @returns {Array} Returns the cast property path array.
  14167. */
  14168. function castPath(value) {
  14169. return isArray(value) ? value : stringToPath(value);
  14170. }
  14171. /**
  14172. * Gets the data for `map`.
  14173. *
  14174. * @private
  14175. * @param {Object} map The map to query.
  14176. * @param {string} key The reference key.
  14177. * @returns {*} Returns the map data.
  14178. */
  14179. function getMapData(map, key) {
  14180. var data = map.__data__;
  14181. return isKeyable(key)
  14182. ? data[typeof key == 'string' ? 'string' : 'hash']
  14183. : data.map;
  14184. }
  14185. /**
  14186. * Gets the native function at `key` of `object`.
  14187. *
  14188. * @private
  14189. * @param {Object} object The object to query.
  14190. * @param {string} key The key of the method to get.
  14191. * @returns {*} Returns the function if it's native, else `undefined`.
  14192. */
  14193. function getNative(object, key) {
  14194. var value = getValue(object, key);
  14195. return baseIsNative(value) ? value : undefined;
  14196. }
  14197. /**
  14198. * Checks if `value` is a valid array-like index.
  14199. *
  14200. * @private
  14201. * @param {*} value The value to check.
  14202. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  14203. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  14204. */
  14205. function isIndex(value, length) {
  14206. length = length == null ? MAX_SAFE_INTEGER : length;
  14207. return !!length &&
  14208. (typeof value == 'number' || reIsUint.test(value)) &&
  14209. (value > -1 && value % 1 == 0 && value < length);
  14210. }
  14211. /**
  14212. * Checks if `value` is a property name and not a property path.
  14213. *
  14214. * @private
  14215. * @param {*} value The value to check.
  14216. * @param {Object} [object] The object to query keys on.
  14217. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  14218. */
  14219. function isKey(value, object) {
  14220. if (isArray(value)) {
  14221. return false;
  14222. }
  14223. var type = typeof value;
  14224. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  14225. value == null || isSymbol(value)) {
  14226. return true;
  14227. }
  14228. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  14229. (object != null && value in Object(object));
  14230. }
  14231. /**
  14232. * Checks if `value` is suitable for use as unique object key.
  14233. *
  14234. * @private
  14235. * @param {*} value The value to check.
  14236. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  14237. */
  14238. function isKeyable(value) {
  14239. var type = typeof value;
  14240. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  14241. ? (value !== '__proto__')
  14242. : (value === null);
  14243. }
  14244. /**
  14245. * Checks if `func` has its source masked.
  14246. *
  14247. * @private
  14248. * @param {Function} func The function to check.
  14249. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  14250. */
  14251. function isMasked(func) {
  14252. return !!maskSrcKey && (maskSrcKey in func);
  14253. }
  14254. /**
  14255. * Converts `string` to a property path array.
  14256. *
  14257. * @private
  14258. * @param {string} string The string to convert.
  14259. * @returns {Array} Returns the property path array.
  14260. */
  14261. var stringToPath = memoize(function(string) {
  14262. string = toString(string);
  14263. var result = [];
  14264. if (reLeadingDot.test(string)) {
  14265. result.push('');
  14266. }
  14267. string.replace(rePropName, function(match, number, quote, string) {
  14268. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  14269. });
  14270. return result;
  14271. });
  14272. /**
  14273. * Converts `value` to a string key if it's not a string or symbol.
  14274. *
  14275. * @private
  14276. * @param {*} value The value to inspect.
  14277. * @returns {string|symbol} Returns the key.
  14278. */
  14279. function toKey(value) {
  14280. if (typeof value == 'string' || isSymbol(value)) {
  14281. return value;
  14282. }
  14283. var result = (value + '');
  14284. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14285. }
  14286. /**
  14287. * Converts `func` to its source code.
  14288. *
  14289. * @private
  14290. * @param {Function} func The function to process.
  14291. * @returns {string} Returns the source code.
  14292. */
  14293. function toSource(func) {
  14294. if (func != null) {
  14295. try {
  14296. return funcToString.call(func);
  14297. } catch (e) {}
  14298. try {
  14299. return (func + '');
  14300. } catch (e) {}
  14301. }
  14302. return '';
  14303. }
  14304. /**
  14305. * Creates a function that memoizes the result of `func`. If `resolver` is
  14306. * provided, it determines the cache key for storing the result based on the
  14307. * arguments provided to the memoized function. By default, the first argument
  14308. * provided to the memoized function is used as the map cache key. The `func`
  14309. * is invoked with the `this` binding of the memoized function.
  14310. *
  14311. * **Note:** The cache is exposed as the `cache` property on the memoized
  14312. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  14313. * constructor with one whose instances implement the
  14314. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  14315. * method interface of `delete`, `get`, `has`, and `set`.
  14316. *
  14317. * @static
  14318. * @memberOf _
  14319. * @since 0.1.0
  14320. * @category Function
  14321. * @param {Function} func The function to have its output memoized.
  14322. * @param {Function} [resolver] The function to resolve the cache key.
  14323. * @returns {Function} Returns the new memoized function.
  14324. * @example
  14325. *
  14326. * var object = { 'a': 1, 'b': 2 };
  14327. * var other = { 'c': 3, 'd': 4 };
  14328. *
  14329. * var values = _.memoize(_.values);
  14330. * values(object);
  14331. * // => [1, 2]
  14332. *
  14333. * values(other);
  14334. * // => [3, 4]
  14335. *
  14336. * object.a = 2;
  14337. * values(object);
  14338. * // => [1, 2]
  14339. *
  14340. * // Modify the result cache.
  14341. * values.cache.set(object, ['a', 'b']);
  14342. * values(object);
  14343. * // => ['a', 'b']
  14344. *
  14345. * // Replace `_.memoize.Cache`.
  14346. * _.memoize.Cache = WeakMap;
  14347. */
  14348. function memoize(func, resolver) {
  14349. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  14350. throw new TypeError(FUNC_ERROR_TEXT);
  14351. }
  14352. var memoized = function() {
  14353. var args = arguments,
  14354. key = resolver ? resolver.apply(this, args) : args[0],
  14355. cache = memoized.cache;
  14356. if (cache.has(key)) {
  14357. return cache.get(key);
  14358. }
  14359. var result = func.apply(this, args);
  14360. memoized.cache = cache.set(key, result);
  14361. return result;
  14362. };
  14363. memoized.cache = new (memoize.Cache || MapCache);
  14364. return memoized;
  14365. }
  14366. // Assign cache to `_.memoize`.
  14367. memoize.Cache = MapCache;
  14368. /**
  14369. * Performs a
  14370. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14371. * comparison between two values to determine if they are equivalent.
  14372. *
  14373. * @static
  14374. * @memberOf _
  14375. * @since 4.0.0
  14376. * @category Lang
  14377. * @param {*} value The value to compare.
  14378. * @param {*} other The other value to compare.
  14379. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  14380. * @example
  14381. *
  14382. * var object = { 'a': 1 };
  14383. * var other = { 'a': 1 };
  14384. *
  14385. * _.eq(object, object);
  14386. * // => true
  14387. *
  14388. * _.eq(object, other);
  14389. * // => false
  14390. *
  14391. * _.eq('a', 'a');
  14392. * // => true
  14393. *
  14394. * _.eq('a', Object('a'));
  14395. * // => false
  14396. *
  14397. * _.eq(NaN, NaN);
  14398. * // => true
  14399. */
  14400. function eq(value, other) {
  14401. return value === other || (value !== value && other !== other);
  14402. }
  14403. /**
  14404. * Checks if `value` is classified as an `Array` object.
  14405. *
  14406. * @static
  14407. * @memberOf _
  14408. * @since 0.1.0
  14409. * @category Lang
  14410. * @param {*} value The value to check.
  14411. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14412. * @example
  14413. *
  14414. * _.isArray([1, 2, 3]);
  14415. * // => true
  14416. *
  14417. * _.isArray(document.body.children);
  14418. * // => false
  14419. *
  14420. * _.isArray('abc');
  14421. * // => false
  14422. *
  14423. * _.isArray(_.noop);
  14424. * // => false
  14425. */
  14426. var isArray = Array.isArray;
  14427. /**
  14428. * Checks if `value` is classified as a `Function` object.
  14429. *
  14430. * @static
  14431. * @memberOf _
  14432. * @since 0.1.0
  14433. * @category Lang
  14434. * @param {*} value The value to check.
  14435. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14436. * @example
  14437. *
  14438. * _.isFunction(_);
  14439. * // => true
  14440. *
  14441. * _.isFunction(/abc/);
  14442. * // => false
  14443. */
  14444. function isFunction(value) {
  14445. // The use of `Object#toString` avoids issues with the `typeof` operator
  14446. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14447. var tag = isObject(value) ? objectToString.call(value) : '';
  14448. return tag == funcTag || tag == genTag;
  14449. }
  14450. /**
  14451. * Checks if `value` is the
  14452. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14453. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14454. *
  14455. * @static
  14456. * @memberOf _
  14457. * @since 0.1.0
  14458. * @category Lang
  14459. * @param {*} value The value to check.
  14460. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14461. * @example
  14462. *
  14463. * _.isObject({});
  14464. * // => true
  14465. *
  14466. * _.isObject([1, 2, 3]);
  14467. * // => true
  14468. *
  14469. * _.isObject(_.noop);
  14470. * // => true
  14471. *
  14472. * _.isObject(null);
  14473. * // => false
  14474. */
  14475. function isObject(value) {
  14476. var type = typeof value;
  14477. return !!value && (type == 'object' || type == 'function');
  14478. }
  14479. /**
  14480. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14481. * and has a `typeof` result of "object".
  14482. *
  14483. * @static
  14484. * @memberOf _
  14485. * @since 4.0.0
  14486. * @category Lang
  14487. * @param {*} value The value to check.
  14488. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14489. * @example
  14490. *
  14491. * _.isObjectLike({});
  14492. * // => true
  14493. *
  14494. * _.isObjectLike([1, 2, 3]);
  14495. * // => true
  14496. *
  14497. * _.isObjectLike(_.noop);
  14498. * // => false
  14499. *
  14500. * _.isObjectLike(null);
  14501. * // => false
  14502. */
  14503. function isObjectLike(value) {
  14504. return !!value && typeof value == 'object';
  14505. }
  14506. /**
  14507. * Checks if `value` is classified as a `Symbol` primitive or object.
  14508. *
  14509. * @static
  14510. * @memberOf _
  14511. * @since 4.0.0
  14512. * @category Lang
  14513. * @param {*} value The value to check.
  14514. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14515. * @example
  14516. *
  14517. * _.isSymbol(Symbol.iterator);
  14518. * // => true
  14519. *
  14520. * _.isSymbol('abc');
  14521. * // => false
  14522. */
  14523. function isSymbol(value) {
  14524. return typeof value == 'symbol' ||
  14525. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14526. }
  14527. /**
  14528. * Converts `value` to a string. An empty string is returned for `null`
  14529. * and `undefined` values. The sign of `-0` is preserved.
  14530. *
  14531. * @static
  14532. * @memberOf _
  14533. * @since 4.0.0
  14534. * @category Lang
  14535. * @param {*} value The value to process.
  14536. * @returns {string} Returns the string.
  14537. * @example
  14538. *
  14539. * _.toString(null);
  14540. * // => ''
  14541. *
  14542. * _.toString(-0);
  14543. * // => '-0'
  14544. *
  14545. * _.toString([1, 2, 3]);
  14546. * // => '1,2,3'
  14547. */
  14548. function toString(value) {
  14549. return value == null ? '' : baseToString(value);
  14550. }
  14551. /**
  14552. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14553. * it's created. Arrays are created for missing index properties while objects
  14554. * are created for all other missing properties. Use `_.setWith` to customize
  14555. * `path` creation.
  14556. *
  14557. * **Note:** This method mutates `object`.
  14558. *
  14559. * @static
  14560. * @memberOf _
  14561. * @since 3.7.0
  14562. * @category Object
  14563. * @param {Object} object The object to modify.
  14564. * @param {Array|string} path The path of the property to set.
  14565. * @param {*} value The value to set.
  14566. * @returns {Object} Returns `object`.
  14567. * @example
  14568. *
  14569. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14570. *
  14571. * _.set(object, 'a[0].b.c', 4);
  14572. * console.log(object.a[0].b.c);
  14573. * // => 4
  14574. *
  14575. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14576. * console.log(object.x[0].y.z);
  14577. * // => 5
  14578. */
  14579. function set(object, path, value) {
  14580. return object == null ? object : baseSet(object, path, value);
  14581. }
  14582. module.exports = set;
  14583. /***/ }),
  14584. /***/ 898:
  14585. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14586. "use strict";
  14587. Object.defineProperty(exports, '__esModule', { value: true });
  14588. var request = __webpack_require__(753);
  14589. var universalUserAgent = __webpack_require__(796);
  14590. const VERSION = "4.3.1";
  14591. class GraphqlError extends Error {
  14592. constructor(request, response) {
  14593. const message = response.data.errors[0].message;
  14594. super(message);
  14595. Object.assign(this, response.data);
  14596. this.name = "GraphqlError";
  14597. this.request = request; // Maintains proper stack trace (only available on V8)
  14598. /* istanbul ignore next */
  14599. if (Error.captureStackTrace) {
  14600. Error.captureStackTrace(this, this.constructor);
  14601. }
  14602. }
  14603. }
  14604. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14605. function graphql(request, query, options) {
  14606. options = typeof query === "string" ? options = Object.assign({
  14607. query
  14608. }, options) : options = query;
  14609. const requestOptions = Object.keys(options).reduce((result, key) => {
  14610. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14611. result[key] = options[key];
  14612. return result;
  14613. }
  14614. if (!result.variables) {
  14615. result.variables = {};
  14616. }
  14617. result.variables[key] = options[key];
  14618. return result;
  14619. }, {});
  14620. return request(requestOptions).then(response => {
  14621. if (response.data.errors) {
  14622. throw new GraphqlError(requestOptions, {
  14623. data: response.data
  14624. });
  14625. }
  14626. return response.data.data;
  14627. });
  14628. }
  14629. function withDefaults(request$1, newDefaults) {
  14630. const newRequest = request$1.defaults(newDefaults);
  14631. const newApi = (query, options) => {
  14632. return graphql(newRequest, query, options);
  14633. };
  14634. return Object.assign(newApi, {
  14635. defaults: withDefaults.bind(null, newRequest),
  14636. endpoint: request.request.endpoint
  14637. });
  14638. }
  14639. const graphql$1 = withDefaults(request.request, {
  14640. headers: {
  14641. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14642. },
  14643. method: "POST",
  14644. url: "/graphql"
  14645. });
  14646. function withCustomRequest(customRequest) {
  14647. return withDefaults(customRequest, {
  14648. method: "POST",
  14649. url: "/graphql"
  14650. });
  14651. }
  14652. exports.graphql = graphql$1;
  14653. exports.withCustomRequest = withCustomRequest;
  14654. //# sourceMappingURL=index.js.map
  14655. /***/ }),
  14656. /***/ 899:
  14657. /***/ (function(module, __unusedexports, __webpack_require__) {
  14658. module.exports = registerEndpoints;
  14659. const { Deprecation } = __webpack_require__(692);
  14660. function registerEndpoints(octokit, routes) {
  14661. Object.keys(routes).forEach(namespaceName => {
  14662. if (!octokit[namespaceName]) {
  14663. octokit[namespaceName] = {};
  14664. }
  14665. Object.keys(routes[namespaceName]).forEach(apiName => {
  14666. const apiOptions = routes[namespaceName][apiName];
  14667. const endpointDefaults = ["method", "url", "headers"].reduce(
  14668. (map, key) => {
  14669. if (typeof apiOptions[key] !== "undefined") {
  14670. map[key] = apiOptions[key];
  14671. }
  14672. return map;
  14673. },
  14674. {}
  14675. );
  14676. endpointDefaults.request = {
  14677. validate: apiOptions.params
  14678. };
  14679. let request = octokit.request.defaults(endpointDefaults);
  14680. // patch request & endpoint methods to support deprecated parameters.
  14681. // Not the most elegant solution, but we don’t want to move deprecation
  14682. // logic into octokit/endpoint.js as it’s out of scope
  14683. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14684. key => apiOptions.params[key].deprecated
  14685. );
  14686. if (hasDeprecatedParam) {
  14687. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14688. request = patch(
  14689. octokit.request.defaults(endpointDefaults),
  14690. `.${namespaceName}.${apiName}()`
  14691. );
  14692. request.endpoint = patch(
  14693. request.endpoint,
  14694. `.${namespaceName}.${apiName}.endpoint()`
  14695. );
  14696. request.endpoint.merge = patch(
  14697. request.endpoint.merge,
  14698. `.${namespaceName}.${apiName}.endpoint.merge()`
  14699. );
  14700. }
  14701. if (apiOptions.deprecated) {
  14702. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14703. octokit.log.warn(
  14704. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14705. );
  14706. octokit[namespaceName][apiName] = request;
  14707. return request.apply(null, arguments);
  14708. };
  14709. return;
  14710. }
  14711. octokit[namespaceName][apiName] = request;
  14712. });
  14713. });
  14714. }
  14715. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14716. const patchedMethod = options => {
  14717. options = Object.assign({}, options);
  14718. Object.keys(options).forEach(key => {
  14719. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14720. const aliasKey = apiOptions.params[key].alias;
  14721. octokit.log.warn(
  14722. new Deprecation(
  14723. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14724. )
  14725. );
  14726. if (!(aliasKey in options)) {
  14727. options[aliasKey] = options[key];
  14728. }
  14729. delete options[key];
  14730. }
  14731. });
  14732. return method(options);
  14733. };
  14734. Object.keys(method).forEach(key => {
  14735. patchedMethod[key] = method[key];
  14736. });
  14737. return patchedMethod;
  14738. }
  14739. /***/ }),
  14740. /***/ 929:
  14741. /***/ (function(module, __unusedexports, __webpack_require__) {
  14742. module.exports = hasNextPage
  14743. const deprecate = __webpack_require__(370)
  14744. const getPageLinks = __webpack_require__(577)
  14745. function hasNextPage (link) {
  14746. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  14747. return getPageLinks(link).next
  14748. }
  14749. /***/ }),
  14750. /***/ 948:
  14751. /***/ (function(module) {
  14752. "use strict";
  14753. /**
  14754. * Tries to execute a function and discards any error that occurs.
  14755. * @param {Function} fn - Function that might or might not throw an error.
  14756. * @returns {?*} Return-value of the function when no error occurred.
  14757. */
  14758. module.exports = function(fn) {
  14759. try { return fn() } catch (e) {}
  14760. }
  14761. /***/ }),
  14762. /***/ 950:
  14763. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14764. "use strict";
  14765. Object.defineProperty(exports, "__esModule", { value: true });
  14766. const url = __webpack_require__(835);
  14767. function getProxyUrl(reqUrl) {
  14768. let usingSsl = reqUrl.protocol === 'https:';
  14769. let proxyUrl;
  14770. if (checkBypass(reqUrl)) {
  14771. return proxyUrl;
  14772. }
  14773. let proxyVar;
  14774. if (usingSsl) {
  14775. proxyVar = process.env["https_proxy"] ||
  14776. process.env["HTTPS_PROXY"];
  14777. }
  14778. else {
  14779. proxyVar = process.env["http_proxy"] ||
  14780. process.env["HTTP_PROXY"];
  14781. }
  14782. if (proxyVar) {
  14783. proxyUrl = url.parse(proxyVar);
  14784. }
  14785. return proxyUrl;
  14786. }
  14787. exports.getProxyUrl = getProxyUrl;
  14788. function checkBypass(reqUrl) {
  14789. if (!reqUrl.hostname) {
  14790. return false;
  14791. }
  14792. let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
  14793. if (!noProxy) {
  14794. return false;
  14795. }
  14796. // Determine the request port
  14797. let reqPort;
  14798. if (reqUrl.port) {
  14799. reqPort = Number(reqUrl.port);
  14800. }
  14801. else if (reqUrl.protocol === 'http:') {
  14802. reqPort = 80;
  14803. }
  14804. else if (reqUrl.protocol === 'https:') {
  14805. reqPort = 443;
  14806. }
  14807. // Format the request hostname and hostname with port
  14808. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  14809. if (typeof reqPort === 'number') {
  14810. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  14811. }
  14812. // Compare request host against noproxy
  14813. for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
  14814. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  14815. return true;
  14816. }
  14817. }
  14818. return false;
  14819. }
  14820. exports.checkBypass = checkBypass;
  14821. /***/ }),
  14822. /***/ 954:
  14823. /***/ (function(module) {
  14824. module.exports = validateAuth;
  14825. function validateAuth(auth) {
  14826. if (typeof auth === "string") {
  14827. return;
  14828. }
  14829. if (typeof auth === "function") {
  14830. return;
  14831. }
  14832. if (auth.username && auth.password) {
  14833. return;
  14834. }
  14835. if (auth.clientId && auth.clientSecret) {
  14836. return;
  14837. }
  14838. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  14839. }
  14840. /***/ }),
  14841. /***/ 955:
  14842. /***/ (function(module, __unusedexports, __webpack_require__) {
  14843. "use strict";
  14844. const path = __webpack_require__(622);
  14845. const childProcess = __webpack_require__(129);
  14846. const crossSpawn = __webpack_require__(20);
  14847. const stripEof = __webpack_require__(768);
  14848. const npmRunPath = __webpack_require__(621);
  14849. const isStream = __webpack_require__(323);
  14850. const _getStream = __webpack_require__(145);
  14851. const pFinally = __webpack_require__(697);
  14852. const onExit = __webpack_require__(260);
  14853. const errname = __webpack_require__(427);
  14854. const stdio = __webpack_require__(168);
  14855. const TEN_MEGABYTES = 1000 * 1000 * 10;
  14856. function handleArgs(cmd, args, opts) {
  14857. let parsed;
  14858. opts = Object.assign({
  14859. extendEnv: true,
  14860. env: {}
  14861. }, opts);
  14862. if (opts.extendEnv) {
  14863. opts.env = Object.assign({}, process.env, opts.env);
  14864. }
  14865. if (opts.__winShell === true) {
  14866. delete opts.__winShell;
  14867. parsed = {
  14868. command: cmd,
  14869. args,
  14870. options: opts,
  14871. file: cmd,
  14872. original: {
  14873. cmd,
  14874. args
  14875. }
  14876. };
  14877. } else {
  14878. parsed = crossSpawn._parse(cmd, args, opts);
  14879. }
  14880. opts = Object.assign({
  14881. maxBuffer: TEN_MEGABYTES,
  14882. buffer: true,
  14883. stripEof: true,
  14884. preferLocal: true,
  14885. localDir: parsed.options.cwd || process.cwd(),
  14886. encoding: 'utf8',
  14887. reject: true,
  14888. cleanup: true
  14889. }, parsed.options);
  14890. opts.stdio = stdio(opts);
  14891. if (opts.preferLocal) {
  14892. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  14893. }
  14894. if (opts.detached) {
  14895. // #115
  14896. opts.cleanup = false;
  14897. }
  14898. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  14899. // #116
  14900. parsed.args.unshift('/q');
  14901. }
  14902. return {
  14903. cmd: parsed.command,
  14904. args: parsed.args,
  14905. opts,
  14906. parsed
  14907. };
  14908. }
  14909. function handleInput(spawned, input) {
  14910. if (input === null || input === undefined) {
  14911. return;
  14912. }
  14913. if (isStream(input)) {
  14914. input.pipe(spawned.stdin);
  14915. } else {
  14916. spawned.stdin.end(input);
  14917. }
  14918. }
  14919. function handleOutput(opts, val) {
  14920. if (val && opts.stripEof) {
  14921. val = stripEof(val);
  14922. }
  14923. return val;
  14924. }
  14925. function handleShell(fn, cmd, opts) {
  14926. let file = '/bin/sh';
  14927. let args = ['-c', cmd];
  14928. opts = Object.assign({}, opts);
  14929. if (process.platform === 'win32') {
  14930. opts.__winShell = true;
  14931. file = process.env.comspec || 'cmd.exe';
  14932. args = ['/s', '/c', `"${cmd}"`];
  14933. opts.windowsVerbatimArguments = true;
  14934. }
  14935. if (opts.shell) {
  14936. file = opts.shell;
  14937. delete opts.shell;
  14938. }
  14939. return fn(file, args, opts);
  14940. }
  14941. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  14942. if (!process[stream]) {
  14943. return null;
  14944. }
  14945. let ret;
  14946. if (!buffer) {
  14947. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  14948. ret = new Promise((resolve, reject) => {
  14949. process[stream]
  14950. .once('end', resolve)
  14951. .once('error', reject);
  14952. });
  14953. } else if (encoding) {
  14954. ret = _getStream(process[stream], {
  14955. encoding,
  14956. maxBuffer
  14957. });
  14958. } else {
  14959. ret = _getStream.buffer(process[stream], {maxBuffer});
  14960. }
  14961. return ret.catch(err => {
  14962. err.stream = stream;
  14963. err.message = `${stream} ${err.message}`;
  14964. throw err;
  14965. });
  14966. }
  14967. function makeError(result, options) {
  14968. const {stdout, stderr} = result;
  14969. let err = result.error;
  14970. const {code, signal} = result;
  14971. const {parsed, joinedCmd} = options;
  14972. const timedOut = options.timedOut || false;
  14973. if (!err) {
  14974. let output = '';
  14975. if (Array.isArray(parsed.opts.stdio)) {
  14976. if (parsed.opts.stdio[2] !== 'inherit') {
  14977. output += output.length > 0 ? stderr : `\n${stderr}`;
  14978. }
  14979. if (parsed.opts.stdio[1] !== 'inherit') {
  14980. output += `\n${stdout}`;
  14981. }
  14982. } else if (parsed.opts.stdio !== 'inherit') {
  14983. output = `\n${stderr}${stdout}`;
  14984. }
  14985. err = new Error(`Command failed: ${joinedCmd}${output}`);
  14986. err.code = code < 0 ? errname(code) : code;
  14987. }
  14988. err.stdout = stdout;
  14989. err.stderr = stderr;
  14990. err.failed = true;
  14991. err.signal = signal || null;
  14992. err.cmd = joinedCmd;
  14993. err.timedOut = timedOut;
  14994. return err;
  14995. }
  14996. function joinCmd(cmd, args) {
  14997. let joinedCmd = cmd;
  14998. if (Array.isArray(args) && args.length > 0) {
  14999. joinedCmd += ' ' + args.join(' ');
  15000. }
  15001. return joinedCmd;
  15002. }
  15003. module.exports = (cmd, args, opts) => {
  15004. const parsed = handleArgs(cmd, args, opts);
  15005. const {encoding, buffer, maxBuffer} = parsed.opts;
  15006. const joinedCmd = joinCmd(cmd, args);
  15007. let spawned;
  15008. try {
  15009. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  15010. } catch (err) {
  15011. return Promise.reject(err);
  15012. }
  15013. let removeExitHandler;
  15014. if (parsed.opts.cleanup) {
  15015. removeExitHandler = onExit(() => {
  15016. spawned.kill();
  15017. });
  15018. }
  15019. let timeoutId = null;
  15020. let timedOut = false;
  15021. const cleanup = () => {
  15022. if (timeoutId) {
  15023. clearTimeout(timeoutId);
  15024. timeoutId = null;
  15025. }
  15026. if (removeExitHandler) {
  15027. removeExitHandler();
  15028. }
  15029. };
  15030. if (parsed.opts.timeout > 0) {
  15031. timeoutId = setTimeout(() => {
  15032. timeoutId = null;
  15033. timedOut = true;
  15034. spawned.kill(parsed.opts.killSignal);
  15035. }, parsed.opts.timeout);
  15036. }
  15037. const processDone = new Promise(resolve => {
  15038. spawned.on('exit', (code, signal) => {
  15039. cleanup();
  15040. resolve({code, signal});
  15041. });
  15042. spawned.on('error', err => {
  15043. cleanup();
  15044. resolve({error: err});
  15045. });
  15046. if (spawned.stdin) {
  15047. spawned.stdin.on('error', err => {
  15048. cleanup();
  15049. resolve({error: err});
  15050. });
  15051. }
  15052. });
  15053. function destroy() {
  15054. if (spawned.stdout) {
  15055. spawned.stdout.destroy();
  15056. }
  15057. if (spawned.stderr) {
  15058. spawned.stderr.destroy();
  15059. }
  15060. }
  15061. const handlePromise = () => pFinally(Promise.all([
  15062. processDone,
  15063. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  15064. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  15065. ]).then(arr => {
  15066. const result = arr[0];
  15067. result.stdout = arr[1];
  15068. result.stderr = arr[2];
  15069. if (result.error || result.code !== 0 || result.signal !== null) {
  15070. const err = makeError(result, {
  15071. joinedCmd,
  15072. parsed,
  15073. timedOut
  15074. });
  15075. // TODO: missing some timeout logic for killed
  15076. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  15077. // err.killed = spawned.killed || killed;
  15078. err.killed = err.killed || spawned.killed;
  15079. if (!parsed.opts.reject) {
  15080. return err;
  15081. }
  15082. throw err;
  15083. }
  15084. return {
  15085. stdout: handleOutput(parsed.opts, result.stdout),
  15086. stderr: handleOutput(parsed.opts, result.stderr),
  15087. code: 0,
  15088. failed: false,
  15089. killed: false,
  15090. signal: null,
  15091. cmd: joinedCmd,
  15092. timedOut: false
  15093. };
  15094. }), destroy);
  15095. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  15096. handleInput(spawned, parsed.opts.input);
  15097. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  15098. spawned.catch = onrejected => handlePromise().catch(onrejected);
  15099. return spawned;
  15100. };
  15101. // TODO: set `stderr: 'ignore'` when that option is implemented
  15102. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  15103. // TODO: set `stdout: 'ignore'` when that option is implemented
  15104. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  15105. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  15106. module.exports.sync = (cmd, args, opts) => {
  15107. const parsed = handleArgs(cmd, args, opts);
  15108. const joinedCmd = joinCmd(cmd, args);
  15109. if (isStream(parsed.opts.input)) {
  15110. throw new TypeError('The `input` option cannot be a stream in sync mode');
  15111. }
  15112. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  15113. result.code = result.status;
  15114. if (result.error || result.status !== 0 || result.signal !== null) {
  15115. const err = makeError(result, {
  15116. joinedCmd,
  15117. parsed
  15118. });
  15119. if (!parsed.opts.reject) {
  15120. return err;
  15121. }
  15122. throw err;
  15123. }
  15124. return {
  15125. stdout: handleOutput(parsed.opts, result.stdout),
  15126. stderr: handleOutput(parsed.opts, result.stderr),
  15127. code: 0,
  15128. failed: false,
  15129. signal: null,
  15130. cmd: joinedCmd,
  15131. timedOut: false
  15132. };
  15133. };
  15134. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  15135. /***/ }),
  15136. /***/ 966:
  15137. /***/ (function(module, __unusedexports, __webpack_require__) {
  15138. "use strict";
  15139. const {PassThrough} = __webpack_require__(413);
  15140. module.exports = options => {
  15141. options = Object.assign({}, options);
  15142. const {array} = options;
  15143. let {encoding} = options;
  15144. const buffer = encoding === 'buffer';
  15145. let objectMode = false;
  15146. if (array) {
  15147. objectMode = !(encoding || buffer);
  15148. } else {
  15149. encoding = encoding || 'utf8';
  15150. }
  15151. if (buffer) {
  15152. encoding = null;
  15153. }
  15154. let len = 0;
  15155. const ret = [];
  15156. const stream = new PassThrough({objectMode});
  15157. if (encoding) {
  15158. stream.setEncoding(encoding);
  15159. }
  15160. stream.on('data', chunk => {
  15161. ret.push(chunk);
  15162. if (objectMode) {
  15163. len = ret.length;
  15164. } else {
  15165. len += chunk.length;
  15166. }
  15167. });
  15168. stream.getBufferedValue = () => {
  15169. if (array) {
  15170. return ret;
  15171. }
  15172. return buffer ? Buffer.concat(ret, len) : ret.join('');
  15173. };
  15174. stream.getBufferedLength = () => len;
  15175. return stream;
  15176. };
  15177. /***/ }),
  15178. /***/ 969:
  15179. /***/ (function(module, __unusedexports, __webpack_require__) {
  15180. var wrappy = __webpack_require__(11)
  15181. module.exports = wrappy(once)
  15182. module.exports.strict = wrappy(onceStrict)
  15183. once.proto = once(function () {
  15184. Object.defineProperty(Function.prototype, 'once', {
  15185. value: function () {
  15186. return once(this)
  15187. },
  15188. configurable: true
  15189. })
  15190. Object.defineProperty(Function.prototype, 'onceStrict', {
  15191. value: function () {
  15192. return onceStrict(this)
  15193. },
  15194. configurable: true
  15195. })
  15196. })
  15197. function once (fn) {
  15198. var f = function () {
  15199. if (f.called) return f.value
  15200. f.called = true
  15201. return f.value = fn.apply(this, arguments)
  15202. }
  15203. f.called = false
  15204. return f
  15205. }
  15206. function onceStrict (fn) {
  15207. var f = function () {
  15208. if (f.called)
  15209. throw new Error(f.onceError)
  15210. f.called = true
  15211. return f.value = fn.apply(this, arguments)
  15212. }
  15213. var name = fn.name || 'Function wrapped with `once`'
  15214. f.onceError = name + " shouldn't be called more than once"
  15215. f.called = false
  15216. return f
  15217. }
  15218. /***/ }),
  15219. /***/ 986:
  15220. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  15221. "use strict";
  15222. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  15223. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  15224. return new (P || (P = Promise))(function (resolve, reject) {
  15225. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  15226. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  15227. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  15228. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15229. });
  15230. };
  15231. Object.defineProperty(exports, "__esModule", { value: true });
  15232. const tr = __webpack_require__(9);
  15233. /**
  15234. * Exec a command.
  15235. * Output will be streamed to the live console.
  15236. * Returns promise with return code
  15237. *
  15238. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  15239. * @param args optional arguments for tool. Escaping is handled by the lib.
  15240. * @param options optional exec options. See ExecOptions
  15241. * @returns Promise<number> exit code
  15242. */
  15243. function exec(commandLine, args, options) {
  15244. return __awaiter(this, void 0, void 0, function* () {
  15245. const commandArgs = tr.argStringToArray(commandLine);
  15246. if (commandArgs.length === 0) {
  15247. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  15248. }
  15249. // Path to tool to execute should be first arg
  15250. const toolPath = commandArgs[0];
  15251. args = commandArgs.slice(1).concat(args || []);
  15252. const runner = new tr.ToolRunner(toolPath, args, options);
  15253. return runner.exec();
  15254. });
  15255. }
  15256. exports.exec = exec;
  15257. //# sourceMappingURL=exec.js.map
  15258. /***/ }),
  15259. /***/ 991:
  15260. /***/ (function(module, __unusedexports, __webpack_require__) {
  15261. module.exports = authenticationRequestError;
  15262. const { RequestError } = __webpack_require__(463);
  15263. function authenticationRequestError(state, error, options) {
  15264. if (!error.headers) throw error;
  15265. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  15266. // handle "2FA required" error only
  15267. if (error.status !== 401 || !otpRequired) {
  15268. throw error;
  15269. }
  15270. if (
  15271. error.status === 401 &&
  15272. otpRequired &&
  15273. error.request &&
  15274. error.request.headers["x-github-otp"]
  15275. ) {
  15276. if (state.otp) {
  15277. delete state.otp; // no longer valid, request again
  15278. } else {
  15279. throw new RequestError(
  15280. "Invalid one-time password for two-factor authentication",
  15281. 401,
  15282. {
  15283. headers: error.headers,
  15284. request: options
  15285. }
  15286. );
  15287. }
  15288. }
  15289. if (typeof state.auth.on2fa !== "function") {
  15290. throw new RequestError(
  15291. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  15292. 401,
  15293. {
  15294. headers: error.headers,
  15295. request: options
  15296. }
  15297. );
  15298. }
  15299. return Promise.resolve()
  15300. .then(() => {
  15301. return state.auth.on2fa();
  15302. })
  15303. .then(oneTimePassword => {
  15304. const newOptions = Object.assign(options, {
  15305. headers: Object.assign(options.headers, {
  15306. "x-github-otp": oneTimePassword
  15307. })
  15308. });
  15309. return state.octokit.request(newOptions).then(response => {
  15310. // If OTP still valid, then persist it for following requests
  15311. state.otp = oneTimePassword;
  15312. return response;
  15313. });
  15314. });
  15315. }
  15316. /***/ })
  15317. /******/ });