index.js 655 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216
  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. * Save the repository path so the POST action can retrieve the value.
  2343. */
  2344. function setRepositoryPath(repositoryPath) {
  2345. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2346. }
  2347. exports.setRepositoryPath = setRepositoryPath;
  2348. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2349. // This is necessary since we don't have a separate entry point.
  2350. if (!exports.IsPost) {
  2351. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2352. }
  2353. /***/ }),
  2354. /***/ 168:
  2355. /***/ (function(module) {
  2356. "use strict";
  2357. const alias = ['stdin', 'stdout', 'stderr'];
  2358. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2359. module.exports = opts => {
  2360. if (!opts) {
  2361. return null;
  2362. }
  2363. if (opts.stdio && hasAlias(opts)) {
  2364. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2365. }
  2366. if (typeof opts.stdio === 'string') {
  2367. return opts.stdio;
  2368. }
  2369. const stdio = opts.stdio || [];
  2370. if (!Array.isArray(stdio)) {
  2371. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2372. }
  2373. const result = [];
  2374. const len = Math.max(stdio.length, alias.length);
  2375. for (let i = 0; i < len; i++) {
  2376. let value = null;
  2377. if (stdio[i] !== undefined) {
  2378. value = stdio[i];
  2379. } else if (opts[alias[i]] !== undefined) {
  2380. value = opts[alias[i]];
  2381. }
  2382. result[i] = value;
  2383. }
  2384. return result;
  2385. };
  2386. /***/ }),
  2387. /***/ 179:
  2388. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2389. "use strict";
  2390. var net = __webpack_require__(631);
  2391. var tls = __webpack_require__(16);
  2392. var http = __webpack_require__(605);
  2393. var https = __webpack_require__(211);
  2394. var events = __webpack_require__(614);
  2395. var assert = __webpack_require__(357);
  2396. var util = __webpack_require__(669);
  2397. exports.httpOverHttp = httpOverHttp;
  2398. exports.httpsOverHttp = httpsOverHttp;
  2399. exports.httpOverHttps = httpOverHttps;
  2400. exports.httpsOverHttps = httpsOverHttps;
  2401. function httpOverHttp(options) {
  2402. var agent = new TunnelingAgent(options);
  2403. agent.request = http.request;
  2404. return agent;
  2405. }
  2406. function httpsOverHttp(options) {
  2407. var agent = new TunnelingAgent(options);
  2408. agent.request = http.request;
  2409. agent.createSocket = createSecureSocket;
  2410. agent.defaultPort = 443;
  2411. return agent;
  2412. }
  2413. function httpOverHttps(options) {
  2414. var agent = new TunnelingAgent(options);
  2415. agent.request = https.request;
  2416. return agent;
  2417. }
  2418. function httpsOverHttps(options) {
  2419. var agent = new TunnelingAgent(options);
  2420. agent.request = https.request;
  2421. agent.createSocket = createSecureSocket;
  2422. agent.defaultPort = 443;
  2423. return agent;
  2424. }
  2425. function TunnelingAgent(options) {
  2426. var self = this;
  2427. self.options = options || {};
  2428. self.proxyOptions = self.options.proxy || {};
  2429. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2430. self.requests = [];
  2431. self.sockets = [];
  2432. self.on('free', function onFree(socket, host, port, localAddress) {
  2433. var options = toOptions(host, port, localAddress);
  2434. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2435. var pending = self.requests[i];
  2436. if (pending.host === options.host && pending.port === options.port) {
  2437. // Detect the request to connect same origin server,
  2438. // reuse the connection.
  2439. self.requests.splice(i, 1);
  2440. pending.request.onSocket(socket);
  2441. return;
  2442. }
  2443. }
  2444. socket.destroy();
  2445. self.removeSocket(socket);
  2446. });
  2447. }
  2448. util.inherits(TunnelingAgent, events.EventEmitter);
  2449. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2450. var self = this;
  2451. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2452. if (self.sockets.length >= this.maxSockets) {
  2453. // We are over limit so we'll add it to the queue.
  2454. self.requests.push(options);
  2455. return;
  2456. }
  2457. // If we are under maxSockets create a new one.
  2458. self.createSocket(options, function(socket) {
  2459. socket.on('free', onFree);
  2460. socket.on('close', onCloseOrRemove);
  2461. socket.on('agentRemove', onCloseOrRemove);
  2462. req.onSocket(socket);
  2463. function onFree() {
  2464. self.emit('free', socket, options);
  2465. }
  2466. function onCloseOrRemove(err) {
  2467. self.removeSocket(socket);
  2468. socket.removeListener('free', onFree);
  2469. socket.removeListener('close', onCloseOrRemove);
  2470. socket.removeListener('agentRemove', onCloseOrRemove);
  2471. }
  2472. });
  2473. };
  2474. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2475. var self = this;
  2476. var placeholder = {};
  2477. self.sockets.push(placeholder);
  2478. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2479. method: 'CONNECT',
  2480. path: options.host + ':' + options.port,
  2481. agent: false,
  2482. headers: {
  2483. host: options.host + ':' + options.port
  2484. }
  2485. });
  2486. if (options.localAddress) {
  2487. connectOptions.localAddress = options.localAddress;
  2488. }
  2489. if (connectOptions.proxyAuth) {
  2490. connectOptions.headers = connectOptions.headers || {};
  2491. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2492. new Buffer(connectOptions.proxyAuth).toString('base64');
  2493. }
  2494. debug('making CONNECT request');
  2495. var connectReq = self.request(connectOptions);
  2496. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2497. connectReq.once('response', onResponse); // for v0.6
  2498. connectReq.once('upgrade', onUpgrade); // for v0.6
  2499. connectReq.once('connect', onConnect); // for v0.7 or later
  2500. connectReq.once('error', onError);
  2501. connectReq.end();
  2502. function onResponse(res) {
  2503. // Very hacky. This is necessary to avoid http-parser leaks.
  2504. res.upgrade = true;
  2505. }
  2506. function onUpgrade(res, socket, head) {
  2507. // Hacky.
  2508. process.nextTick(function() {
  2509. onConnect(res, socket, head);
  2510. });
  2511. }
  2512. function onConnect(res, socket, head) {
  2513. connectReq.removeAllListeners();
  2514. socket.removeAllListeners();
  2515. if (res.statusCode !== 200) {
  2516. debug('tunneling socket could not be established, statusCode=%d',
  2517. res.statusCode);
  2518. socket.destroy();
  2519. var error = new Error('tunneling socket could not be established, ' +
  2520. 'statusCode=' + res.statusCode);
  2521. error.code = 'ECONNRESET';
  2522. options.request.emit('error', error);
  2523. self.removeSocket(placeholder);
  2524. return;
  2525. }
  2526. if (head.length > 0) {
  2527. debug('got illegal response body from proxy');
  2528. socket.destroy();
  2529. var error = new Error('got illegal response body from proxy');
  2530. error.code = 'ECONNRESET';
  2531. options.request.emit('error', error);
  2532. self.removeSocket(placeholder);
  2533. return;
  2534. }
  2535. debug('tunneling connection has established');
  2536. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2537. return cb(socket);
  2538. }
  2539. function onError(cause) {
  2540. connectReq.removeAllListeners();
  2541. debug('tunneling socket could not be established, cause=%s\n',
  2542. cause.message, cause.stack);
  2543. var error = new Error('tunneling socket could not be established, ' +
  2544. 'cause=' + cause.message);
  2545. error.code = 'ECONNRESET';
  2546. options.request.emit('error', error);
  2547. self.removeSocket(placeholder);
  2548. }
  2549. };
  2550. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2551. var pos = this.sockets.indexOf(socket)
  2552. if (pos === -1) {
  2553. return;
  2554. }
  2555. this.sockets.splice(pos, 1);
  2556. var pending = this.requests.shift();
  2557. if (pending) {
  2558. // If we have pending requests and a socket gets closed a new one
  2559. // needs to be created to take over in the pool for the one that closed.
  2560. this.createSocket(pending, function(socket) {
  2561. pending.request.onSocket(socket);
  2562. });
  2563. }
  2564. };
  2565. function createSecureSocket(options, cb) {
  2566. var self = this;
  2567. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2568. var hostHeader = options.request.getHeader('host');
  2569. var tlsOptions = mergeOptions({}, self.options, {
  2570. socket: socket,
  2571. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2572. });
  2573. // 0 is dummy port for v0.6
  2574. var secureSocket = tls.connect(0, tlsOptions);
  2575. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2576. cb(secureSocket);
  2577. });
  2578. }
  2579. function toOptions(host, port, localAddress) {
  2580. if (typeof host === 'string') { // since v0.10
  2581. return {
  2582. host: host,
  2583. port: port,
  2584. localAddress: localAddress
  2585. };
  2586. }
  2587. return host; // for v0.11 or later
  2588. }
  2589. function mergeOptions(target) {
  2590. for (var i = 1, len = arguments.length; i < len; ++i) {
  2591. var overrides = arguments[i];
  2592. if (typeof overrides === 'object') {
  2593. var keys = Object.keys(overrides);
  2594. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2595. var k = keys[j];
  2596. if (overrides[k] !== undefined) {
  2597. target[k] = overrides[k];
  2598. }
  2599. }
  2600. }
  2601. }
  2602. return target;
  2603. }
  2604. var debug;
  2605. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2606. debug = function() {
  2607. var args = Array.prototype.slice.call(arguments);
  2608. if (typeof args[0] === 'string') {
  2609. args[0] = 'TUNNEL: ' + args[0];
  2610. } else {
  2611. args.unshift('TUNNEL:');
  2612. }
  2613. console.error.apply(console, args);
  2614. }
  2615. } else {
  2616. debug = function() {};
  2617. }
  2618. exports.debug = debug; // for test
  2619. /***/ }),
  2620. /***/ 190:
  2621. /***/ (function(module, __unusedexports, __webpack_require__) {
  2622. module.exports = authenticationPlugin;
  2623. const { createTokenAuth } = __webpack_require__(813);
  2624. const { Deprecation } = __webpack_require__(692);
  2625. const once = __webpack_require__(969);
  2626. const beforeRequest = __webpack_require__(863);
  2627. const requestError = __webpack_require__(991);
  2628. const validate = __webpack_require__(954);
  2629. const withAuthorizationPrefix = __webpack_require__(143);
  2630. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2631. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2632. function authenticationPlugin(octokit, options) {
  2633. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2634. if (options.authStrategy) {
  2635. const auth = options.authStrategy(options.auth);
  2636. octokit.hook.wrap("request", auth.hook);
  2637. octokit.auth = auth;
  2638. return;
  2639. }
  2640. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2641. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2642. if (!options.auth) {
  2643. octokit.auth = () =>
  2644. Promise.resolve({
  2645. type: "unauthenticated"
  2646. });
  2647. return;
  2648. }
  2649. const isBasicAuthString =
  2650. typeof options.auth === "string" &&
  2651. /^basic/.test(withAuthorizationPrefix(options.auth));
  2652. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2653. if (typeof options.auth === "string" && !isBasicAuthString) {
  2654. const auth = createTokenAuth(options.auth);
  2655. octokit.hook.wrap("request", auth.hook);
  2656. octokit.auth = auth;
  2657. return;
  2658. }
  2659. // Otherwise log a deprecation message
  2660. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2661. ? [
  2662. deprecateAuthBasic,
  2663. '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)'
  2664. ]
  2665. : [
  2666. deprecateAuthObject,
  2667. '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)'
  2668. ];
  2669. deprecationMethod(
  2670. octokit.log,
  2671. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2672. );
  2673. octokit.auth = () =>
  2674. Promise.resolve({
  2675. type: "deprecated",
  2676. message: deprecationMessapge
  2677. });
  2678. validate(options.auth);
  2679. const state = {
  2680. octokit,
  2681. auth: options.auth
  2682. };
  2683. octokit.hook.before("request", beforeRequest.bind(null, state));
  2684. octokit.hook.error("request", requestError.bind(null, state));
  2685. }
  2686. /***/ }),
  2687. /***/ 197:
  2688. /***/ (function(module, __unusedexports, __webpack_require__) {
  2689. module.exports = isexe
  2690. isexe.sync = sync
  2691. var fs = __webpack_require__(747)
  2692. function isexe (path, options, cb) {
  2693. fs.stat(path, function (er, stat) {
  2694. cb(er, er ? false : checkStat(stat, options))
  2695. })
  2696. }
  2697. function sync (path, options) {
  2698. return checkStat(fs.statSync(path), options)
  2699. }
  2700. function checkStat (stat, options) {
  2701. return stat.isFile() && checkMode(stat, options)
  2702. }
  2703. function checkMode (stat, options) {
  2704. var mod = stat.mode
  2705. var uid = stat.uid
  2706. var gid = stat.gid
  2707. var myUid = options.uid !== undefined ?
  2708. options.uid : process.getuid && process.getuid()
  2709. var myGid = options.gid !== undefined ?
  2710. options.gid : process.getgid && process.getgid()
  2711. var u = parseInt('100', 8)
  2712. var g = parseInt('010', 8)
  2713. var o = parseInt('001', 8)
  2714. var ug = u | g
  2715. var ret = (mod & o) ||
  2716. (mod & g) && gid === myGid ||
  2717. (mod & u) && uid === myUid ||
  2718. (mod & ug) && myUid === 0
  2719. return ret
  2720. }
  2721. /***/ }),
  2722. /***/ 198:
  2723. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2724. "use strict";
  2725. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2726. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2727. return new (P || (P = Promise))(function (resolve, reject) {
  2728. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2729. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2730. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2731. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2732. });
  2733. };
  2734. var __importStar = (this && this.__importStar) || function (mod) {
  2735. if (mod && mod.__esModule) return mod;
  2736. var result = {};
  2737. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2738. result["default"] = mod;
  2739. return result;
  2740. };
  2741. Object.defineProperty(exports, "__esModule", { value: true });
  2742. const core = __importStar(__webpack_require__(470));
  2743. const coreCommand = __importStar(__webpack_require__(431));
  2744. const gitSourceProvider = __importStar(__webpack_require__(293));
  2745. const inputHelper = __importStar(__webpack_require__(821));
  2746. const path = __importStar(__webpack_require__(622));
  2747. const stateHelper = __importStar(__webpack_require__(153));
  2748. function run() {
  2749. return __awaiter(this, void 0, void 0, function* () {
  2750. try {
  2751. const sourceSettings = inputHelper.getInputs();
  2752. try {
  2753. // Register problem matcher
  2754. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2755. // Get sources
  2756. yield gitSourceProvider.getSource(sourceSettings);
  2757. }
  2758. finally {
  2759. // Unregister problem matcher
  2760. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2761. }
  2762. }
  2763. catch (error) {
  2764. core.setFailed(error.message);
  2765. }
  2766. });
  2767. }
  2768. function cleanup() {
  2769. return __awaiter(this, void 0, void 0, function* () {
  2770. try {
  2771. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2772. }
  2773. catch (error) {
  2774. core.warning(error.message);
  2775. }
  2776. });
  2777. }
  2778. // Main
  2779. if (!stateHelper.IsPost) {
  2780. run();
  2781. }
  2782. // Post
  2783. else {
  2784. cleanup();
  2785. }
  2786. /***/ }),
  2787. /***/ 211:
  2788. /***/ (function(module) {
  2789. module.exports = require("https");
  2790. /***/ }),
  2791. /***/ 215:
  2792. /***/ (function(module) {
  2793. 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"};
  2794. /***/ }),
  2795. /***/ 227:
  2796. /***/ (function(__unusedmodule, exports) {
  2797. "use strict";
  2798. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2799. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2800. return new (P || (P = Promise))(function (resolve, reject) {
  2801. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2802. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2803. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2804. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2805. });
  2806. };
  2807. Object.defineProperty(exports, "__esModule", { value: true });
  2808. function getCheckoutInfo(git, ref, commit) {
  2809. return __awaiter(this, void 0, void 0, function* () {
  2810. if (!git) {
  2811. throw new Error('Arg git cannot be empty');
  2812. }
  2813. if (!ref && !commit) {
  2814. throw new Error('Args ref and commit cannot both be empty');
  2815. }
  2816. const result = {};
  2817. const upperRef = (ref || '').toUpperCase();
  2818. // SHA only
  2819. if (!ref) {
  2820. result.ref = commit;
  2821. }
  2822. // refs/heads/
  2823. else if (upperRef.startsWith('REFS/HEADS/')) {
  2824. const branch = ref.substring('refs/heads/'.length);
  2825. result.ref = branch;
  2826. result.startPoint = `refs/remotes/origin/${branch}`;
  2827. }
  2828. // refs/pull/
  2829. else if (upperRef.startsWith('REFS/PULL/')) {
  2830. const branch = ref.substring('refs/pull/'.length);
  2831. result.ref = `refs/remotes/pull/${branch}`;
  2832. }
  2833. // refs/tags/
  2834. else if (upperRef.startsWith('REFS/')) {
  2835. result.ref = ref;
  2836. }
  2837. // Unqualified ref, check for a matching branch or tag
  2838. else {
  2839. if (yield git.branchExists(true, `origin/${ref}`)) {
  2840. result.ref = ref;
  2841. result.startPoint = `refs/remotes/origin/${ref}`;
  2842. }
  2843. else if (yield git.tagExists(`${ref}`)) {
  2844. result.ref = `refs/tags/${ref}`;
  2845. }
  2846. else {
  2847. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2848. }
  2849. }
  2850. return result;
  2851. });
  2852. }
  2853. exports.getCheckoutInfo = getCheckoutInfo;
  2854. function getRefSpec(ref, commit) {
  2855. if (!ref && !commit) {
  2856. throw new Error('Args ref and commit cannot both be empty');
  2857. }
  2858. const upperRef = (ref || '').toUpperCase();
  2859. // SHA
  2860. if (commit) {
  2861. // refs/heads
  2862. if (upperRef.startsWith('REFS/HEADS/')) {
  2863. const branch = ref.substring('refs/heads/'.length);
  2864. return [`+${commit}:refs/remotes/origin/${branch}`];
  2865. }
  2866. // refs/pull/
  2867. else if (upperRef.startsWith('REFS/PULL/')) {
  2868. const branch = ref.substring('refs/pull/'.length);
  2869. return [`+${commit}:refs/remotes/pull/${branch}`];
  2870. }
  2871. // refs/tags/
  2872. else if (upperRef.startsWith('REFS/TAGS/')) {
  2873. return [`+${commit}:${ref}`];
  2874. }
  2875. // Otherwise no destination ref
  2876. else {
  2877. return [commit];
  2878. }
  2879. }
  2880. // Unqualified ref, check for a matching branch or tag
  2881. else if (!upperRef.startsWith('REFS/')) {
  2882. return [
  2883. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2884. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2885. ];
  2886. }
  2887. // refs/heads/
  2888. else if (upperRef.startsWith('REFS/HEADS/')) {
  2889. const branch = ref.substring('refs/heads/'.length);
  2890. return [`+${ref}:refs/remotes/origin/${branch}`];
  2891. }
  2892. // refs/pull/
  2893. else if (upperRef.startsWith('REFS/PULL/')) {
  2894. const branch = ref.substring('refs/pull/'.length);
  2895. return [`+${ref}:refs/remotes/pull/${branch}`];
  2896. }
  2897. // refs/tags/
  2898. else {
  2899. return [`+${ref}:${ref}`];
  2900. }
  2901. }
  2902. exports.getRefSpec = getRefSpec;
  2903. /***/ }),
  2904. /***/ 248:
  2905. /***/ (function(module, __unusedexports, __webpack_require__) {
  2906. module.exports = octokitRegisterEndpoints;
  2907. const registerEndpoints = __webpack_require__(899);
  2908. function octokitRegisterEndpoints(octokit) {
  2909. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2910. }
  2911. /***/ }),
  2912. /***/ 260:
  2913. /***/ (function(module, __unusedexports, __webpack_require__) {
  2914. // Note: since nyc uses this module to output coverage, any lines
  2915. // that are in the direct sync flow of nyc's outputCoverage are
  2916. // ignored, since we can never get coverage for them.
  2917. var assert = __webpack_require__(357)
  2918. var signals = __webpack_require__(654)
  2919. var EE = __webpack_require__(614)
  2920. /* istanbul ignore if */
  2921. if (typeof EE !== 'function') {
  2922. EE = EE.EventEmitter
  2923. }
  2924. var emitter
  2925. if (process.__signal_exit_emitter__) {
  2926. emitter = process.__signal_exit_emitter__
  2927. } else {
  2928. emitter = process.__signal_exit_emitter__ = new EE()
  2929. emitter.count = 0
  2930. emitter.emitted = {}
  2931. }
  2932. // Because this emitter is a global, we have to check to see if a
  2933. // previous version of this library failed to enable infinite listeners.
  2934. // I know what you're about to say. But literally everything about
  2935. // signal-exit is a compromise with evil. Get used to it.
  2936. if (!emitter.infinite) {
  2937. emitter.setMaxListeners(Infinity)
  2938. emitter.infinite = true
  2939. }
  2940. module.exports = function (cb, opts) {
  2941. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2942. if (loaded === false) {
  2943. load()
  2944. }
  2945. var ev = 'exit'
  2946. if (opts && opts.alwaysLast) {
  2947. ev = 'afterexit'
  2948. }
  2949. var remove = function () {
  2950. emitter.removeListener(ev, cb)
  2951. if (emitter.listeners('exit').length === 0 &&
  2952. emitter.listeners('afterexit').length === 0) {
  2953. unload()
  2954. }
  2955. }
  2956. emitter.on(ev, cb)
  2957. return remove
  2958. }
  2959. module.exports.unload = unload
  2960. function unload () {
  2961. if (!loaded) {
  2962. return
  2963. }
  2964. loaded = false
  2965. signals.forEach(function (sig) {
  2966. try {
  2967. process.removeListener(sig, sigListeners[sig])
  2968. } catch (er) {}
  2969. })
  2970. process.emit = originalProcessEmit
  2971. process.reallyExit = originalProcessReallyExit
  2972. emitter.count -= 1
  2973. }
  2974. function emit (event, code, signal) {
  2975. if (emitter.emitted[event]) {
  2976. return
  2977. }
  2978. emitter.emitted[event] = true
  2979. emitter.emit(event, code, signal)
  2980. }
  2981. // { <signal>: <listener fn>, ... }
  2982. var sigListeners = {}
  2983. signals.forEach(function (sig) {
  2984. sigListeners[sig] = function listener () {
  2985. // If there are no other listeners, an exit is coming!
  2986. // Simplest way: remove us and then re-send the signal.
  2987. // We know that this will kill the process, so we can
  2988. // safely emit now.
  2989. var listeners = process.listeners(sig)
  2990. if (listeners.length === emitter.count) {
  2991. unload()
  2992. emit('exit', null, sig)
  2993. /* istanbul ignore next */
  2994. emit('afterexit', null, sig)
  2995. /* istanbul ignore next */
  2996. process.kill(process.pid, sig)
  2997. }
  2998. }
  2999. })
  3000. module.exports.signals = function () {
  3001. return signals
  3002. }
  3003. module.exports.load = load
  3004. var loaded = false
  3005. function load () {
  3006. if (loaded) {
  3007. return
  3008. }
  3009. loaded = true
  3010. // This is the number of onSignalExit's that are in play.
  3011. // It's important so that we can count the correct number of
  3012. // listeners on signals, and don't wait for the other one to
  3013. // handle it instead of us.
  3014. emitter.count += 1
  3015. signals = signals.filter(function (sig) {
  3016. try {
  3017. process.on(sig, sigListeners[sig])
  3018. return true
  3019. } catch (er) {
  3020. return false
  3021. }
  3022. })
  3023. process.emit = processEmit
  3024. process.reallyExit = processReallyExit
  3025. }
  3026. var originalProcessReallyExit = process.reallyExit
  3027. function processReallyExit (code) {
  3028. process.exitCode = code || 0
  3029. emit('exit', process.exitCode, null)
  3030. /* istanbul ignore next */
  3031. emit('afterexit', process.exitCode, null)
  3032. /* istanbul ignore next */
  3033. originalProcessReallyExit.call(process, process.exitCode)
  3034. }
  3035. var originalProcessEmit = process.emit
  3036. function processEmit (ev, arg) {
  3037. if (ev === 'exit') {
  3038. if (arg !== undefined) {
  3039. process.exitCode = arg
  3040. }
  3041. var ret = originalProcessEmit.apply(this, arguments)
  3042. emit('exit', process.exitCode, null)
  3043. /* istanbul ignore next */
  3044. emit('afterexit', process.exitCode, null)
  3045. return ret
  3046. } else {
  3047. return originalProcessEmit.apply(this, arguments)
  3048. }
  3049. }
  3050. /***/ }),
  3051. /***/ 262:
  3052. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3053. "use strict";
  3054. Object.defineProperty(exports, "__esModule", { value: true });
  3055. const fs_1 = __webpack_require__(747);
  3056. const os_1 = __webpack_require__(87);
  3057. class Context {
  3058. /**
  3059. * Hydrate the context from the environment
  3060. */
  3061. constructor() {
  3062. this.payload = {};
  3063. if (process.env.GITHUB_EVENT_PATH) {
  3064. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3065. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3066. }
  3067. else {
  3068. const path = process.env.GITHUB_EVENT_PATH;
  3069. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3070. }
  3071. }
  3072. this.eventName = process.env.GITHUB_EVENT_NAME;
  3073. this.sha = process.env.GITHUB_SHA;
  3074. this.ref = process.env.GITHUB_REF;
  3075. this.workflow = process.env.GITHUB_WORKFLOW;
  3076. this.action = process.env.GITHUB_ACTION;
  3077. this.actor = process.env.GITHUB_ACTOR;
  3078. }
  3079. get issue() {
  3080. const payload = this.payload;
  3081. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3082. }
  3083. get repo() {
  3084. if (process.env.GITHUB_REPOSITORY) {
  3085. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3086. return { owner, repo };
  3087. }
  3088. if (this.payload.repository) {
  3089. return {
  3090. owner: this.payload.repository.owner.login,
  3091. repo: this.payload.repository.name
  3092. };
  3093. }
  3094. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3095. }
  3096. }
  3097. exports.Context = Context;
  3098. //# sourceMappingURL=context.js.map
  3099. /***/ }),
  3100. /***/ 265:
  3101. /***/ (function(module, __unusedexports, __webpack_require__) {
  3102. module.exports = getPage
  3103. const deprecate = __webpack_require__(370)
  3104. const getPageLinks = __webpack_require__(577)
  3105. const HttpError = __webpack_require__(297)
  3106. function getPage (octokit, link, which, headers) {
  3107. 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.`)
  3108. const url = getPageLinks(link)[which]
  3109. if (!url) {
  3110. const urlError = new HttpError(`No ${which} page found`, 404)
  3111. return Promise.reject(urlError)
  3112. }
  3113. const requestOptions = {
  3114. url,
  3115. headers: applyAcceptHeader(link, headers)
  3116. }
  3117. const promise = octokit.request(requestOptions)
  3118. return promise
  3119. }
  3120. function applyAcceptHeader (res, headers) {
  3121. const previous = res.headers && res.headers['x-github-media-type']
  3122. if (!previous || (headers && headers.accept)) {
  3123. return headers
  3124. }
  3125. headers = headers || {}
  3126. headers.accept = 'application/vnd.' + previous
  3127. .replace('; param=', '.')
  3128. .replace('; format=', '+')
  3129. return headers
  3130. }
  3131. /***/ }),
  3132. /***/ 280:
  3133. /***/ (function(module, exports) {
  3134. exports = module.exports = SemVer
  3135. var debug
  3136. /* istanbul ignore next */
  3137. if (typeof process === 'object' &&
  3138. process.env &&
  3139. process.env.NODE_DEBUG &&
  3140. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3141. debug = function () {
  3142. var args = Array.prototype.slice.call(arguments, 0)
  3143. args.unshift('SEMVER')
  3144. console.log.apply(console, args)
  3145. }
  3146. } else {
  3147. debug = function () {}
  3148. }
  3149. // Note: this is the semver.org version of the spec that it implements
  3150. // Not necessarily the package version of this code.
  3151. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3152. var MAX_LENGTH = 256
  3153. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3154. /* istanbul ignore next */ 9007199254740991
  3155. // Max safe segment length for coercion.
  3156. var MAX_SAFE_COMPONENT_LENGTH = 16
  3157. // The actual regexps go on exports.re
  3158. var re = exports.re = []
  3159. var src = exports.src = []
  3160. var R = 0
  3161. // The following Regular Expressions can be used for tokenizing,
  3162. // validating, and parsing SemVer version strings.
  3163. // ## Numeric Identifier
  3164. // A single `0`, or a non-zero digit followed by zero or more digits.
  3165. var NUMERICIDENTIFIER = R++
  3166. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3167. var NUMERICIDENTIFIERLOOSE = R++
  3168. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3169. // ## Non-numeric Identifier
  3170. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3171. // more letters, digits, or hyphens.
  3172. var NONNUMERICIDENTIFIER = R++
  3173. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3174. // ## Main Version
  3175. // Three dot-separated numeric identifiers.
  3176. var MAINVERSION = R++
  3177. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3178. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3179. '(' + src[NUMERICIDENTIFIER] + ')'
  3180. var MAINVERSIONLOOSE = R++
  3181. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3182. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3183. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3184. // ## Pre-release Version Identifier
  3185. // A numeric identifier, or a non-numeric identifier.
  3186. var PRERELEASEIDENTIFIER = R++
  3187. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3188. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3189. var PRERELEASEIDENTIFIERLOOSE = R++
  3190. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3191. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3192. // ## Pre-release Version
  3193. // Hyphen, followed by one or more dot-separated pre-release version
  3194. // identifiers.
  3195. var PRERELEASE = R++
  3196. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3197. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3198. var PRERELEASELOOSE = R++
  3199. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3200. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3201. // ## Build Metadata Identifier
  3202. // Any combination of digits, letters, or hyphens.
  3203. var BUILDIDENTIFIER = R++
  3204. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3205. // ## Build Metadata
  3206. // Plus sign, followed by one or more period-separated build metadata
  3207. // identifiers.
  3208. var BUILD = R++
  3209. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3210. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3211. // ## Full Version String
  3212. // A main version, followed optionally by a pre-release version and
  3213. // build metadata.
  3214. // Note that the only major, minor, patch, and pre-release sections of
  3215. // the version string are capturing groups. The build metadata is not a
  3216. // capturing group, because it should not ever be used in version
  3217. // comparison.
  3218. var FULL = R++
  3219. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3220. src[PRERELEASE] + '?' +
  3221. src[BUILD] + '?'
  3222. src[FULL] = '^' + FULLPLAIN + '$'
  3223. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3224. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3225. // common in the npm registry.
  3226. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3227. src[PRERELEASELOOSE] + '?' +
  3228. src[BUILD] + '?'
  3229. var LOOSE = R++
  3230. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3231. var GTLT = R++
  3232. src[GTLT] = '((?:<|>)?=?)'
  3233. // Something like "2.*" or "1.2.x".
  3234. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3235. // Only the first item is strictly required.
  3236. var XRANGEIDENTIFIERLOOSE = R++
  3237. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3238. var XRANGEIDENTIFIER = R++
  3239. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3240. var XRANGEPLAIN = R++
  3241. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3242. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3243. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3244. '(?:' + src[PRERELEASE] + ')?' +
  3245. src[BUILD] + '?' +
  3246. ')?)?'
  3247. var XRANGEPLAINLOOSE = R++
  3248. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3249. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3250. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3251. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3252. src[BUILD] + '?' +
  3253. ')?)?'
  3254. var XRANGE = R++
  3255. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3256. var XRANGELOOSE = R++
  3257. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3258. // Coercion.
  3259. // Extract anything that could conceivably be a part of a valid semver
  3260. var COERCE = R++
  3261. src[COERCE] = '(?:^|[^\\d])' +
  3262. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3263. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3264. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3265. '(?:$|[^\\d])'
  3266. // Tilde ranges.
  3267. // Meaning is "reasonably at or greater than"
  3268. var LONETILDE = R++
  3269. src[LONETILDE] = '(?:~>?)'
  3270. var TILDETRIM = R++
  3271. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3272. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3273. var tildeTrimReplace = '$1~'
  3274. var TILDE = R++
  3275. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3276. var TILDELOOSE = R++
  3277. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3278. // Caret ranges.
  3279. // Meaning is "at least and backwards compatible with"
  3280. var LONECARET = R++
  3281. src[LONECARET] = '(?:\\^)'
  3282. var CARETTRIM = R++
  3283. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3284. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3285. var caretTrimReplace = '$1^'
  3286. var CARET = R++
  3287. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3288. var CARETLOOSE = R++
  3289. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3290. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3291. var COMPARATORLOOSE = R++
  3292. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3293. var COMPARATOR = R++
  3294. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3295. // An expression to strip any whitespace between the gtlt and the thing
  3296. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3297. var COMPARATORTRIM = R++
  3298. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3299. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3300. // this one has to use the /g flag
  3301. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3302. var comparatorTrimReplace = '$1$2$3'
  3303. // Something like `1.2.3 - 1.2.4`
  3304. // Note that these all use the loose form, because they'll be
  3305. // checked against either the strict or loose comparator form
  3306. // later.
  3307. var HYPHENRANGE = R++
  3308. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3309. '\\s+-\\s+' +
  3310. '(' + src[XRANGEPLAIN] + ')' +
  3311. '\\s*$'
  3312. var HYPHENRANGELOOSE = R++
  3313. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3314. '\\s+-\\s+' +
  3315. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3316. '\\s*$'
  3317. // Star ranges basically just allow anything at all.
  3318. var STAR = R++
  3319. src[STAR] = '(<|>)?=?\\s*\\*'
  3320. // Compile to actual regexp objects.
  3321. // All are flag-free, unless they were created above with a flag.
  3322. for (var i = 0; i < R; i++) {
  3323. debug(i, src[i])
  3324. if (!re[i]) {
  3325. re[i] = new RegExp(src[i])
  3326. }
  3327. }
  3328. exports.parse = parse
  3329. function parse (version, options) {
  3330. if (!options || typeof options !== 'object') {
  3331. options = {
  3332. loose: !!options,
  3333. includePrerelease: false
  3334. }
  3335. }
  3336. if (version instanceof SemVer) {
  3337. return version
  3338. }
  3339. if (typeof version !== 'string') {
  3340. return null
  3341. }
  3342. if (version.length > MAX_LENGTH) {
  3343. return null
  3344. }
  3345. var r = options.loose ? re[LOOSE] : re[FULL]
  3346. if (!r.test(version)) {
  3347. return null
  3348. }
  3349. try {
  3350. return new SemVer(version, options)
  3351. } catch (er) {
  3352. return null
  3353. }
  3354. }
  3355. exports.valid = valid
  3356. function valid (version, options) {
  3357. var v = parse(version, options)
  3358. return v ? v.version : null
  3359. }
  3360. exports.clean = clean
  3361. function clean (version, options) {
  3362. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3363. return s ? s.version : null
  3364. }
  3365. exports.SemVer = SemVer
  3366. function SemVer (version, options) {
  3367. if (!options || typeof options !== 'object') {
  3368. options = {
  3369. loose: !!options,
  3370. includePrerelease: false
  3371. }
  3372. }
  3373. if (version instanceof SemVer) {
  3374. if (version.loose === options.loose) {
  3375. return version
  3376. } else {
  3377. version = version.version
  3378. }
  3379. } else if (typeof version !== 'string') {
  3380. throw new TypeError('Invalid Version: ' + version)
  3381. }
  3382. if (version.length > MAX_LENGTH) {
  3383. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3384. }
  3385. if (!(this instanceof SemVer)) {
  3386. return new SemVer(version, options)
  3387. }
  3388. debug('SemVer', version, options)
  3389. this.options = options
  3390. this.loose = !!options.loose
  3391. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3392. if (!m) {
  3393. throw new TypeError('Invalid Version: ' + version)
  3394. }
  3395. this.raw = version
  3396. // these are actually numbers
  3397. this.major = +m[1]
  3398. this.minor = +m[2]
  3399. this.patch = +m[3]
  3400. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3401. throw new TypeError('Invalid major version')
  3402. }
  3403. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3404. throw new TypeError('Invalid minor version')
  3405. }
  3406. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3407. throw new TypeError('Invalid patch version')
  3408. }
  3409. // numberify any prerelease numeric ids
  3410. if (!m[4]) {
  3411. this.prerelease = []
  3412. } else {
  3413. this.prerelease = m[4].split('.').map(function (id) {
  3414. if (/^[0-9]+$/.test(id)) {
  3415. var num = +id
  3416. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3417. return num
  3418. }
  3419. }
  3420. return id
  3421. })
  3422. }
  3423. this.build = m[5] ? m[5].split('.') : []
  3424. this.format()
  3425. }
  3426. SemVer.prototype.format = function () {
  3427. this.version = this.major + '.' + this.minor + '.' + this.patch
  3428. if (this.prerelease.length) {
  3429. this.version += '-' + this.prerelease.join('.')
  3430. }
  3431. return this.version
  3432. }
  3433. SemVer.prototype.toString = function () {
  3434. return this.version
  3435. }
  3436. SemVer.prototype.compare = function (other) {
  3437. debug('SemVer.compare', this.version, this.options, other)
  3438. if (!(other instanceof SemVer)) {
  3439. other = new SemVer(other, this.options)
  3440. }
  3441. return this.compareMain(other) || this.comparePre(other)
  3442. }
  3443. SemVer.prototype.compareMain = function (other) {
  3444. if (!(other instanceof SemVer)) {
  3445. other = new SemVer(other, this.options)
  3446. }
  3447. return compareIdentifiers(this.major, other.major) ||
  3448. compareIdentifiers(this.minor, other.minor) ||
  3449. compareIdentifiers(this.patch, other.patch)
  3450. }
  3451. SemVer.prototype.comparePre = function (other) {
  3452. if (!(other instanceof SemVer)) {
  3453. other = new SemVer(other, this.options)
  3454. }
  3455. // NOT having a prerelease is > having one
  3456. if (this.prerelease.length && !other.prerelease.length) {
  3457. return -1
  3458. } else if (!this.prerelease.length && other.prerelease.length) {
  3459. return 1
  3460. } else if (!this.prerelease.length && !other.prerelease.length) {
  3461. return 0
  3462. }
  3463. var i = 0
  3464. do {
  3465. var a = this.prerelease[i]
  3466. var b = other.prerelease[i]
  3467. debug('prerelease compare', i, a, b)
  3468. if (a === undefined && b === undefined) {
  3469. return 0
  3470. } else if (b === undefined) {
  3471. return 1
  3472. } else if (a === undefined) {
  3473. return -1
  3474. } else if (a === b) {
  3475. continue
  3476. } else {
  3477. return compareIdentifiers(a, b)
  3478. }
  3479. } while (++i)
  3480. }
  3481. // preminor will bump the version up to the next minor release, and immediately
  3482. // down to pre-release. premajor and prepatch work the same way.
  3483. SemVer.prototype.inc = function (release, identifier) {
  3484. switch (release) {
  3485. case 'premajor':
  3486. this.prerelease.length = 0
  3487. this.patch = 0
  3488. this.minor = 0
  3489. this.major++
  3490. this.inc('pre', identifier)
  3491. break
  3492. case 'preminor':
  3493. this.prerelease.length = 0
  3494. this.patch = 0
  3495. this.minor++
  3496. this.inc('pre', identifier)
  3497. break
  3498. case 'prepatch':
  3499. // If this is already a prerelease, it will bump to the next version
  3500. // drop any prereleases that might already exist, since they are not
  3501. // relevant at this point.
  3502. this.prerelease.length = 0
  3503. this.inc('patch', identifier)
  3504. this.inc('pre', identifier)
  3505. break
  3506. // If the input is a non-prerelease version, this acts the same as
  3507. // prepatch.
  3508. case 'prerelease':
  3509. if (this.prerelease.length === 0) {
  3510. this.inc('patch', identifier)
  3511. }
  3512. this.inc('pre', identifier)
  3513. break
  3514. case 'major':
  3515. // If this is a pre-major version, bump up to the same major version.
  3516. // Otherwise increment major.
  3517. // 1.0.0-5 bumps to 1.0.0
  3518. // 1.1.0 bumps to 2.0.0
  3519. if (this.minor !== 0 ||
  3520. this.patch !== 0 ||
  3521. this.prerelease.length === 0) {
  3522. this.major++
  3523. }
  3524. this.minor = 0
  3525. this.patch = 0
  3526. this.prerelease = []
  3527. break
  3528. case 'minor':
  3529. // If this is a pre-minor version, bump up to the same minor version.
  3530. // Otherwise increment minor.
  3531. // 1.2.0-5 bumps to 1.2.0
  3532. // 1.2.1 bumps to 1.3.0
  3533. if (this.patch !== 0 || this.prerelease.length === 0) {
  3534. this.minor++
  3535. }
  3536. this.patch = 0
  3537. this.prerelease = []
  3538. break
  3539. case 'patch':
  3540. // If this is not a pre-release version, it will increment the patch.
  3541. // If it is a pre-release it will bump up to the same patch version.
  3542. // 1.2.0-5 patches to 1.2.0
  3543. // 1.2.0 patches to 1.2.1
  3544. if (this.prerelease.length === 0) {
  3545. this.patch++
  3546. }
  3547. this.prerelease = []
  3548. break
  3549. // This probably shouldn't be used publicly.
  3550. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3551. case 'pre':
  3552. if (this.prerelease.length === 0) {
  3553. this.prerelease = [0]
  3554. } else {
  3555. var i = this.prerelease.length
  3556. while (--i >= 0) {
  3557. if (typeof this.prerelease[i] === 'number') {
  3558. this.prerelease[i]++
  3559. i = -2
  3560. }
  3561. }
  3562. if (i === -1) {
  3563. // didn't increment anything
  3564. this.prerelease.push(0)
  3565. }
  3566. }
  3567. if (identifier) {
  3568. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3569. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3570. if (this.prerelease[0] === identifier) {
  3571. if (isNaN(this.prerelease[1])) {
  3572. this.prerelease = [identifier, 0]
  3573. }
  3574. } else {
  3575. this.prerelease = [identifier, 0]
  3576. }
  3577. }
  3578. break
  3579. default:
  3580. throw new Error('invalid increment argument: ' + release)
  3581. }
  3582. this.format()
  3583. this.raw = this.version
  3584. return this
  3585. }
  3586. exports.inc = inc
  3587. function inc (version, release, loose, identifier) {
  3588. if (typeof (loose) === 'string') {
  3589. identifier = loose
  3590. loose = undefined
  3591. }
  3592. try {
  3593. return new SemVer(version, loose).inc(release, identifier).version
  3594. } catch (er) {
  3595. return null
  3596. }
  3597. }
  3598. exports.diff = diff
  3599. function diff (version1, version2) {
  3600. if (eq(version1, version2)) {
  3601. return null
  3602. } else {
  3603. var v1 = parse(version1)
  3604. var v2 = parse(version2)
  3605. var prefix = ''
  3606. if (v1.prerelease.length || v2.prerelease.length) {
  3607. prefix = 'pre'
  3608. var defaultResult = 'prerelease'
  3609. }
  3610. for (var key in v1) {
  3611. if (key === 'major' || key === 'minor' || key === 'patch') {
  3612. if (v1[key] !== v2[key]) {
  3613. return prefix + key
  3614. }
  3615. }
  3616. }
  3617. return defaultResult // may be undefined
  3618. }
  3619. }
  3620. exports.compareIdentifiers = compareIdentifiers
  3621. var numeric = /^[0-9]+$/
  3622. function compareIdentifiers (a, b) {
  3623. var anum = numeric.test(a)
  3624. var bnum = numeric.test(b)
  3625. if (anum && bnum) {
  3626. a = +a
  3627. b = +b
  3628. }
  3629. return a === b ? 0
  3630. : (anum && !bnum) ? -1
  3631. : (bnum && !anum) ? 1
  3632. : a < b ? -1
  3633. : 1
  3634. }
  3635. exports.rcompareIdentifiers = rcompareIdentifiers
  3636. function rcompareIdentifiers (a, b) {
  3637. return compareIdentifiers(b, a)
  3638. }
  3639. exports.major = major
  3640. function major (a, loose) {
  3641. return new SemVer(a, loose).major
  3642. }
  3643. exports.minor = minor
  3644. function minor (a, loose) {
  3645. return new SemVer(a, loose).minor
  3646. }
  3647. exports.patch = patch
  3648. function patch (a, loose) {
  3649. return new SemVer(a, loose).patch
  3650. }
  3651. exports.compare = compare
  3652. function compare (a, b, loose) {
  3653. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3654. }
  3655. exports.compareLoose = compareLoose
  3656. function compareLoose (a, b) {
  3657. return compare(a, b, true)
  3658. }
  3659. exports.rcompare = rcompare
  3660. function rcompare (a, b, loose) {
  3661. return compare(b, a, loose)
  3662. }
  3663. exports.sort = sort
  3664. function sort (list, loose) {
  3665. return list.sort(function (a, b) {
  3666. return exports.compare(a, b, loose)
  3667. })
  3668. }
  3669. exports.rsort = rsort
  3670. function rsort (list, loose) {
  3671. return list.sort(function (a, b) {
  3672. return exports.rcompare(a, b, loose)
  3673. })
  3674. }
  3675. exports.gt = gt
  3676. function gt (a, b, loose) {
  3677. return compare(a, b, loose) > 0
  3678. }
  3679. exports.lt = lt
  3680. function lt (a, b, loose) {
  3681. return compare(a, b, loose) < 0
  3682. }
  3683. exports.eq = eq
  3684. function eq (a, b, loose) {
  3685. return compare(a, b, loose) === 0
  3686. }
  3687. exports.neq = neq
  3688. function neq (a, b, loose) {
  3689. return compare(a, b, loose) !== 0
  3690. }
  3691. exports.gte = gte
  3692. function gte (a, b, loose) {
  3693. return compare(a, b, loose) >= 0
  3694. }
  3695. exports.lte = lte
  3696. function lte (a, b, loose) {
  3697. return compare(a, b, loose) <= 0
  3698. }
  3699. exports.cmp = cmp
  3700. function cmp (a, op, b, loose) {
  3701. switch (op) {
  3702. case '===':
  3703. if (typeof a === 'object')
  3704. a = a.version
  3705. if (typeof b === 'object')
  3706. b = b.version
  3707. return a === b
  3708. case '!==':
  3709. if (typeof a === 'object')
  3710. a = a.version
  3711. if (typeof b === 'object')
  3712. b = b.version
  3713. return a !== b
  3714. case '':
  3715. case '=':
  3716. case '==':
  3717. return eq(a, b, loose)
  3718. case '!=':
  3719. return neq(a, b, loose)
  3720. case '>':
  3721. return gt(a, b, loose)
  3722. case '>=':
  3723. return gte(a, b, loose)
  3724. case '<':
  3725. return lt(a, b, loose)
  3726. case '<=':
  3727. return lte(a, b, loose)
  3728. default:
  3729. throw new TypeError('Invalid operator: ' + op)
  3730. }
  3731. }
  3732. exports.Comparator = Comparator
  3733. function Comparator (comp, options) {
  3734. if (!options || typeof options !== 'object') {
  3735. options = {
  3736. loose: !!options,
  3737. includePrerelease: false
  3738. }
  3739. }
  3740. if (comp instanceof Comparator) {
  3741. if (comp.loose === !!options.loose) {
  3742. return comp
  3743. } else {
  3744. comp = comp.value
  3745. }
  3746. }
  3747. if (!(this instanceof Comparator)) {
  3748. return new Comparator(comp, options)
  3749. }
  3750. debug('comparator', comp, options)
  3751. this.options = options
  3752. this.loose = !!options.loose
  3753. this.parse(comp)
  3754. if (this.semver === ANY) {
  3755. this.value = ''
  3756. } else {
  3757. this.value = this.operator + this.semver.version
  3758. }
  3759. debug('comp', this)
  3760. }
  3761. var ANY = {}
  3762. Comparator.prototype.parse = function (comp) {
  3763. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3764. var m = comp.match(r)
  3765. if (!m) {
  3766. throw new TypeError('Invalid comparator: ' + comp)
  3767. }
  3768. this.operator = m[1]
  3769. if (this.operator === '=') {
  3770. this.operator = ''
  3771. }
  3772. // if it literally is just '>' or '' then allow anything.
  3773. if (!m[2]) {
  3774. this.semver = ANY
  3775. } else {
  3776. this.semver = new SemVer(m[2], this.options.loose)
  3777. }
  3778. }
  3779. Comparator.prototype.toString = function () {
  3780. return this.value
  3781. }
  3782. Comparator.prototype.test = function (version) {
  3783. debug('Comparator.test', version, this.options.loose)
  3784. if (this.semver === ANY) {
  3785. return true
  3786. }
  3787. if (typeof version === 'string') {
  3788. version = new SemVer(version, this.options)
  3789. }
  3790. return cmp(version, this.operator, this.semver, this.options)
  3791. }
  3792. Comparator.prototype.intersects = function (comp, options) {
  3793. if (!(comp instanceof Comparator)) {
  3794. throw new TypeError('a Comparator is required')
  3795. }
  3796. if (!options || typeof options !== 'object') {
  3797. options = {
  3798. loose: !!options,
  3799. includePrerelease: false
  3800. }
  3801. }
  3802. var rangeTmp
  3803. if (this.operator === '') {
  3804. rangeTmp = new Range(comp.value, options)
  3805. return satisfies(this.value, rangeTmp, options)
  3806. } else if (comp.operator === '') {
  3807. rangeTmp = new Range(this.value, options)
  3808. return satisfies(comp.semver, rangeTmp, options)
  3809. }
  3810. var sameDirectionIncreasing =
  3811. (this.operator === '>=' || this.operator === '>') &&
  3812. (comp.operator === '>=' || comp.operator === '>')
  3813. var sameDirectionDecreasing =
  3814. (this.operator === '<=' || this.operator === '<') &&
  3815. (comp.operator === '<=' || comp.operator === '<')
  3816. var sameSemVer = this.semver.version === comp.semver.version
  3817. var differentDirectionsInclusive =
  3818. (this.operator === '>=' || this.operator === '<=') &&
  3819. (comp.operator === '>=' || comp.operator === '<=')
  3820. var oppositeDirectionsLessThan =
  3821. cmp(this.semver, '<', comp.semver, options) &&
  3822. ((this.operator === '>=' || this.operator === '>') &&
  3823. (comp.operator === '<=' || comp.operator === '<'))
  3824. var oppositeDirectionsGreaterThan =
  3825. cmp(this.semver, '>', comp.semver, options) &&
  3826. ((this.operator === '<=' || this.operator === '<') &&
  3827. (comp.operator === '>=' || comp.operator === '>'))
  3828. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3829. (sameSemVer && differentDirectionsInclusive) ||
  3830. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3831. }
  3832. exports.Range = Range
  3833. function Range (range, options) {
  3834. if (!options || typeof options !== 'object') {
  3835. options = {
  3836. loose: !!options,
  3837. includePrerelease: false
  3838. }
  3839. }
  3840. if (range instanceof Range) {
  3841. if (range.loose === !!options.loose &&
  3842. range.includePrerelease === !!options.includePrerelease) {
  3843. return range
  3844. } else {
  3845. return new Range(range.raw, options)
  3846. }
  3847. }
  3848. if (range instanceof Comparator) {
  3849. return new Range(range.value, options)
  3850. }
  3851. if (!(this instanceof Range)) {
  3852. return new Range(range, options)
  3853. }
  3854. this.options = options
  3855. this.loose = !!options.loose
  3856. this.includePrerelease = !!options.includePrerelease
  3857. // First, split based on boolean or ||
  3858. this.raw = range
  3859. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3860. return this.parseRange(range.trim())
  3861. }, this).filter(function (c) {
  3862. // throw out any that are not relevant for whatever reason
  3863. return c.length
  3864. })
  3865. if (!this.set.length) {
  3866. throw new TypeError('Invalid SemVer Range: ' + range)
  3867. }
  3868. this.format()
  3869. }
  3870. Range.prototype.format = function () {
  3871. this.range = this.set.map(function (comps) {
  3872. return comps.join(' ').trim()
  3873. }).join('||').trim()
  3874. return this.range
  3875. }
  3876. Range.prototype.toString = function () {
  3877. return this.range
  3878. }
  3879. Range.prototype.parseRange = function (range) {
  3880. var loose = this.options.loose
  3881. range = range.trim()
  3882. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3883. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3884. range = range.replace(hr, hyphenReplace)
  3885. debug('hyphen replace', range)
  3886. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3887. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3888. debug('comparator trim', range, re[COMPARATORTRIM])
  3889. // `~ 1.2.3` => `~1.2.3`
  3890. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3891. // `^ 1.2.3` => `^1.2.3`
  3892. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3893. // normalize spaces
  3894. range = range.split(/\s+/).join(' ')
  3895. // At this point, the range is completely trimmed and
  3896. // ready to be split into comparators.
  3897. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3898. var set = range.split(' ').map(function (comp) {
  3899. return parseComparator(comp, this.options)
  3900. }, this).join(' ').split(/\s+/)
  3901. if (this.options.loose) {
  3902. // in loose mode, throw out any that are not valid comparators
  3903. set = set.filter(function (comp) {
  3904. return !!comp.match(compRe)
  3905. })
  3906. }
  3907. set = set.map(function (comp) {
  3908. return new Comparator(comp, this.options)
  3909. }, this)
  3910. return set
  3911. }
  3912. Range.prototype.intersects = function (range, options) {
  3913. if (!(range instanceof Range)) {
  3914. throw new TypeError('a Range is required')
  3915. }
  3916. return this.set.some(function (thisComparators) {
  3917. return thisComparators.every(function (thisComparator) {
  3918. return range.set.some(function (rangeComparators) {
  3919. return rangeComparators.every(function (rangeComparator) {
  3920. return thisComparator.intersects(rangeComparator, options)
  3921. })
  3922. })
  3923. })
  3924. })
  3925. }
  3926. // Mostly just for testing and legacy API reasons
  3927. exports.toComparators = toComparators
  3928. function toComparators (range, options) {
  3929. return new Range(range, options).set.map(function (comp) {
  3930. return comp.map(function (c) {
  3931. return c.value
  3932. }).join(' ').trim().split(' ')
  3933. })
  3934. }
  3935. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3936. // already replaced the hyphen ranges
  3937. // turn into a set of JUST comparators.
  3938. function parseComparator (comp, options) {
  3939. debug('comp', comp, options)
  3940. comp = replaceCarets(comp, options)
  3941. debug('caret', comp)
  3942. comp = replaceTildes(comp, options)
  3943. debug('tildes', comp)
  3944. comp = replaceXRanges(comp, options)
  3945. debug('xrange', comp)
  3946. comp = replaceStars(comp, options)
  3947. debug('stars', comp)
  3948. return comp
  3949. }
  3950. function isX (id) {
  3951. return !id || id.toLowerCase() === 'x' || id === '*'
  3952. }
  3953. // ~, ~> --> * (any, kinda silly)
  3954. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3955. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3956. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3957. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3958. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3959. function replaceTildes (comp, options) {
  3960. return comp.trim().split(/\s+/).map(function (comp) {
  3961. return replaceTilde(comp, options)
  3962. }).join(' ')
  3963. }
  3964. function replaceTilde (comp, options) {
  3965. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3966. return comp.replace(r, function (_, M, m, p, pr) {
  3967. debug('tilde', comp, _, M, m, p, pr)
  3968. var ret
  3969. if (isX(M)) {
  3970. ret = ''
  3971. } else if (isX(m)) {
  3972. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3973. } else if (isX(p)) {
  3974. // ~1.2 == >=1.2.0 <1.3.0
  3975. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3976. } else if (pr) {
  3977. debug('replaceTilde pr', pr)
  3978. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3979. ' <' + M + '.' + (+m + 1) + '.0'
  3980. } else {
  3981. // ~1.2.3 == >=1.2.3 <1.3.0
  3982. ret = '>=' + M + '.' + m + '.' + p +
  3983. ' <' + M + '.' + (+m + 1) + '.0'
  3984. }
  3985. debug('tilde return', ret)
  3986. return ret
  3987. })
  3988. }
  3989. // ^ --> * (any, kinda silly)
  3990. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  3991. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  3992. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  3993. // ^1.2.3 --> >=1.2.3 <2.0.0
  3994. // ^1.2.0 --> >=1.2.0 <2.0.0
  3995. function replaceCarets (comp, options) {
  3996. return comp.trim().split(/\s+/).map(function (comp) {
  3997. return replaceCaret(comp, options)
  3998. }).join(' ')
  3999. }
  4000. function replaceCaret (comp, options) {
  4001. debug('caret', comp, options)
  4002. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4003. return comp.replace(r, function (_, M, m, p, pr) {
  4004. debug('caret', comp, _, M, m, p, pr)
  4005. var ret
  4006. if (isX(M)) {
  4007. ret = ''
  4008. } else if (isX(m)) {
  4009. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4010. } else if (isX(p)) {
  4011. if (M === '0') {
  4012. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4013. } else {
  4014. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4015. }
  4016. } else if (pr) {
  4017. debug('replaceCaret pr', pr)
  4018. if (M === '0') {
  4019. if (m === '0') {
  4020. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4021. ' <' + M + '.' + m + '.' + (+p + 1)
  4022. } else {
  4023. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4024. ' <' + M + '.' + (+m + 1) + '.0'
  4025. }
  4026. } else {
  4027. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4028. ' <' + (+M + 1) + '.0.0'
  4029. }
  4030. } else {
  4031. debug('no pr')
  4032. if (M === '0') {
  4033. if (m === '0') {
  4034. ret = '>=' + M + '.' + m + '.' + p +
  4035. ' <' + M + '.' + m + '.' + (+p + 1)
  4036. } else {
  4037. ret = '>=' + M + '.' + m + '.' + p +
  4038. ' <' + M + '.' + (+m + 1) + '.0'
  4039. }
  4040. } else {
  4041. ret = '>=' + M + '.' + m + '.' + p +
  4042. ' <' + (+M + 1) + '.0.0'
  4043. }
  4044. }
  4045. debug('caret return', ret)
  4046. return ret
  4047. })
  4048. }
  4049. function replaceXRanges (comp, options) {
  4050. debug('replaceXRanges', comp, options)
  4051. return comp.split(/\s+/).map(function (comp) {
  4052. return replaceXRange(comp, options)
  4053. }).join(' ')
  4054. }
  4055. function replaceXRange (comp, options) {
  4056. comp = comp.trim()
  4057. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4058. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4059. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4060. var xM = isX(M)
  4061. var xm = xM || isX(m)
  4062. var xp = xm || isX(p)
  4063. var anyX = xp
  4064. if (gtlt === '=' && anyX) {
  4065. gtlt = ''
  4066. }
  4067. if (xM) {
  4068. if (gtlt === '>' || gtlt === '<') {
  4069. // nothing is allowed
  4070. ret = '<0.0.0'
  4071. } else {
  4072. // nothing is forbidden
  4073. ret = '*'
  4074. }
  4075. } else if (gtlt && anyX) {
  4076. // we know patch is an x, because we have any x at all.
  4077. // replace X with 0
  4078. if (xm) {
  4079. m = 0
  4080. }
  4081. p = 0
  4082. if (gtlt === '>') {
  4083. // >1 => >=2.0.0
  4084. // >1.2 => >=1.3.0
  4085. // >1.2.3 => >= 1.2.4
  4086. gtlt = '>='
  4087. if (xm) {
  4088. M = +M + 1
  4089. m = 0
  4090. p = 0
  4091. } else {
  4092. m = +m + 1
  4093. p = 0
  4094. }
  4095. } else if (gtlt === '<=') {
  4096. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4097. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4098. gtlt = '<'
  4099. if (xm) {
  4100. M = +M + 1
  4101. } else {
  4102. m = +m + 1
  4103. }
  4104. }
  4105. ret = gtlt + M + '.' + m + '.' + p
  4106. } else if (xm) {
  4107. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4108. } else if (xp) {
  4109. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4110. }
  4111. debug('xRange return', ret)
  4112. return ret
  4113. })
  4114. }
  4115. // Because * is AND-ed with everything else in the comparator,
  4116. // and '' means "any version", just remove the *s entirely.
  4117. function replaceStars (comp, options) {
  4118. debug('replaceStars', comp, options)
  4119. // Looseness is ignored here. star is always as loose as it gets!
  4120. return comp.trim().replace(re[STAR], '')
  4121. }
  4122. // This function is passed to string.replace(re[HYPHENRANGE])
  4123. // M, m, patch, prerelease, build
  4124. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4125. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4126. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4127. function hyphenReplace ($0,
  4128. from, fM, fm, fp, fpr, fb,
  4129. to, tM, tm, tp, tpr, tb) {
  4130. if (isX(fM)) {
  4131. from = ''
  4132. } else if (isX(fm)) {
  4133. from = '>=' + fM + '.0.0'
  4134. } else if (isX(fp)) {
  4135. from = '>=' + fM + '.' + fm + '.0'
  4136. } else {
  4137. from = '>=' + from
  4138. }
  4139. if (isX(tM)) {
  4140. to = ''
  4141. } else if (isX(tm)) {
  4142. to = '<' + (+tM + 1) + '.0.0'
  4143. } else if (isX(tp)) {
  4144. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4145. } else if (tpr) {
  4146. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4147. } else {
  4148. to = '<=' + to
  4149. }
  4150. return (from + ' ' + to).trim()
  4151. }
  4152. // if ANY of the sets match ALL of its comparators, then pass
  4153. Range.prototype.test = function (version) {
  4154. if (!version) {
  4155. return false
  4156. }
  4157. if (typeof version === 'string') {
  4158. version = new SemVer(version, this.options)
  4159. }
  4160. for (var i = 0; i < this.set.length; i++) {
  4161. if (testSet(this.set[i], version, this.options)) {
  4162. return true
  4163. }
  4164. }
  4165. return false
  4166. }
  4167. function testSet (set, version, options) {
  4168. for (var i = 0; i < set.length; i++) {
  4169. if (!set[i].test(version)) {
  4170. return false
  4171. }
  4172. }
  4173. if (version.prerelease.length && !options.includePrerelease) {
  4174. // Find the set of versions that are allowed to have prereleases
  4175. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4176. // That should allow `1.2.3-pr.2` to pass.
  4177. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4178. // even though it's within the range set by the comparators.
  4179. for (i = 0; i < set.length; i++) {
  4180. debug(set[i].semver)
  4181. if (set[i].semver === ANY) {
  4182. continue
  4183. }
  4184. if (set[i].semver.prerelease.length > 0) {
  4185. var allowed = set[i].semver
  4186. if (allowed.major === version.major &&
  4187. allowed.minor === version.minor &&
  4188. allowed.patch === version.patch) {
  4189. return true
  4190. }
  4191. }
  4192. }
  4193. // Version has a -pre, but it's not one of the ones we like.
  4194. return false
  4195. }
  4196. return true
  4197. }
  4198. exports.satisfies = satisfies
  4199. function satisfies (version, range, options) {
  4200. try {
  4201. range = new Range(range, options)
  4202. } catch (er) {
  4203. return false
  4204. }
  4205. return range.test(version)
  4206. }
  4207. exports.maxSatisfying = maxSatisfying
  4208. function maxSatisfying (versions, range, options) {
  4209. var max = null
  4210. var maxSV = null
  4211. try {
  4212. var rangeObj = new Range(range, options)
  4213. } catch (er) {
  4214. return null
  4215. }
  4216. versions.forEach(function (v) {
  4217. if (rangeObj.test(v)) {
  4218. // satisfies(v, range, options)
  4219. if (!max || maxSV.compare(v) === -1) {
  4220. // compare(max, v, true)
  4221. max = v
  4222. maxSV = new SemVer(max, options)
  4223. }
  4224. }
  4225. })
  4226. return max
  4227. }
  4228. exports.minSatisfying = minSatisfying
  4229. function minSatisfying (versions, range, options) {
  4230. var min = null
  4231. var minSV = null
  4232. try {
  4233. var rangeObj = new Range(range, options)
  4234. } catch (er) {
  4235. return null
  4236. }
  4237. versions.forEach(function (v) {
  4238. if (rangeObj.test(v)) {
  4239. // satisfies(v, range, options)
  4240. if (!min || minSV.compare(v) === 1) {
  4241. // compare(min, v, true)
  4242. min = v
  4243. minSV = new SemVer(min, options)
  4244. }
  4245. }
  4246. })
  4247. return min
  4248. }
  4249. exports.minVersion = minVersion
  4250. function minVersion (range, loose) {
  4251. range = new Range(range, loose)
  4252. var minver = new SemVer('0.0.0')
  4253. if (range.test(minver)) {
  4254. return minver
  4255. }
  4256. minver = new SemVer('0.0.0-0')
  4257. if (range.test(minver)) {
  4258. return minver
  4259. }
  4260. minver = null
  4261. for (var i = 0; i < range.set.length; ++i) {
  4262. var comparators = range.set[i]
  4263. comparators.forEach(function (comparator) {
  4264. // Clone to avoid manipulating the comparator's semver object.
  4265. var compver = new SemVer(comparator.semver.version)
  4266. switch (comparator.operator) {
  4267. case '>':
  4268. if (compver.prerelease.length === 0) {
  4269. compver.patch++
  4270. } else {
  4271. compver.prerelease.push(0)
  4272. }
  4273. compver.raw = compver.format()
  4274. /* fallthrough */
  4275. case '':
  4276. case '>=':
  4277. if (!minver || gt(minver, compver)) {
  4278. minver = compver
  4279. }
  4280. break
  4281. case '<':
  4282. case '<=':
  4283. /* Ignore maximum versions */
  4284. break
  4285. /* istanbul ignore next */
  4286. default:
  4287. throw new Error('Unexpected operation: ' + comparator.operator)
  4288. }
  4289. })
  4290. }
  4291. if (minver && range.test(minver)) {
  4292. return minver
  4293. }
  4294. return null
  4295. }
  4296. exports.validRange = validRange
  4297. function validRange (range, options) {
  4298. try {
  4299. // Return '*' instead of '' so that truthiness works.
  4300. // This will throw if it's invalid anyway
  4301. return new Range(range, options).range || '*'
  4302. } catch (er) {
  4303. return null
  4304. }
  4305. }
  4306. // Determine if version is less than all the versions possible in the range
  4307. exports.ltr = ltr
  4308. function ltr (version, range, options) {
  4309. return outside(version, range, '<', options)
  4310. }
  4311. // Determine if version is greater than all the versions possible in the range.
  4312. exports.gtr = gtr
  4313. function gtr (version, range, options) {
  4314. return outside(version, range, '>', options)
  4315. }
  4316. exports.outside = outside
  4317. function outside (version, range, hilo, options) {
  4318. version = new SemVer(version, options)
  4319. range = new Range(range, options)
  4320. var gtfn, ltefn, ltfn, comp, ecomp
  4321. switch (hilo) {
  4322. case '>':
  4323. gtfn = gt
  4324. ltefn = lte
  4325. ltfn = lt
  4326. comp = '>'
  4327. ecomp = '>='
  4328. break
  4329. case '<':
  4330. gtfn = lt
  4331. ltefn = gte
  4332. ltfn = gt
  4333. comp = '<'
  4334. ecomp = '<='
  4335. break
  4336. default:
  4337. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4338. }
  4339. // If it satisifes the range it is not outside
  4340. if (satisfies(version, range, options)) {
  4341. return false
  4342. }
  4343. // From now on, variable terms are as if we're in "gtr" mode.
  4344. // but note that everything is flipped for the "ltr" function.
  4345. for (var i = 0; i < range.set.length; ++i) {
  4346. var comparators = range.set[i]
  4347. var high = null
  4348. var low = null
  4349. comparators.forEach(function (comparator) {
  4350. if (comparator.semver === ANY) {
  4351. comparator = new Comparator('>=0.0.0')
  4352. }
  4353. high = high || comparator
  4354. low = low || comparator
  4355. if (gtfn(comparator.semver, high.semver, options)) {
  4356. high = comparator
  4357. } else if (ltfn(comparator.semver, low.semver, options)) {
  4358. low = comparator
  4359. }
  4360. })
  4361. // If the edge version comparator has a operator then our version
  4362. // isn't outside it
  4363. if (high.operator === comp || high.operator === ecomp) {
  4364. return false
  4365. }
  4366. // If the lowest version comparator has an operator and our version
  4367. // is less than it then it isn't higher than the range
  4368. if ((!low.operator || low.operator === comp) &&
  4369. ltefn(version, low.semver)) {
  4370. return false
  4371. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4372. return false
  4373. }
  4374. }
  4375. return true
  4376. }
  4377. exports.prerelease = prerelease
  4378. function prerelease (version, options) {
  4379. var parsed = parse(version, options)
  4380. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4381. }
  4382. exports.intersects = intersects
  4383. function intersects (r1, r2, options) {
  4384. r1 = new Range(r1, options)
  4385. r2 = new Range(r2, options)
  4386. return r1.intersects(r2)
  4387. }
  4388. exports.coerce = coerce
  4389. function coerce (version) {
  4390. if (version instanceof SemVer) {
  4391. return version
  4392. }
  4393. if (typeof version !== 'string') {
  4394. return null
  4395. }
  4396. var match = version.match(re[COERCE])
  4397. if (match == null) {
  4398. return null
  4399. }
  4400. return parse(match[1] +
  4401. '.' + (match[2] || '0') +
  4402. '.' + (match[3] || '0'))
  4403. }
  4404. /***/ }),
  4405. /***/ 289:
  4406. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4407. "use strict";
  4408. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4409. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4410. return new (P || (P = Promise))(function (resolve, reject) {
  4411. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4412. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4413. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4414. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4415. });
  4416. };
  4417. var __importStar = (this && this.__importStar) || function (mod) {
  4418. if (mod && mod.__esModule) return mod;
  4419. var result = {};
  4420. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4421. result["default"] = mod;
  4422. return result;
  4423. };
  4424. Object.defineProperty(exports, "__esModule", { value: true });
  4425. const core = __importStar(__webpack_require__(470));
  4426. const exec = __importStar(__webpack_require__(986));
  4427. const fshelper = __importStar(__webpack_require__(618));
  4428. const io = __importStar(__webpack_require__(1));
  4429. const path = __importStar(__webpack_require__(622));
  4430. const retryHelper = __importStar(__webpack_require__(587));
  4431. const git_version_1 = __webpack_require__(559);
  4432. // Auth header not supported before 2.9
  4433. // Wire protocol v2 not supported before 2.18
  4434. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4435. function CreateCommandManager(workingDirectory, lfs) {
  4436. return __awaiter(this, void 0, void 0, function* () {
  4437. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4438. });
  4439. }
  4440. exports.CreateCommandManager = CreateCommandManager;
  4441. class GitCommandManager {
  4442. // Private constructor; use createCommandManager()
  4443. constructor() {
  4444. this.gitEnv = {
  4445. GIT_TERMINAL_PROMPT: '0',
  4446. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4447. };
  4448. this.gitPath = '';
  4449. this.lfs = false;
  4450. this.workingDirectory = '';
  4451. }
  4452. branchDelete(remote, branch) {
  4453. return __awaiter(this, void 0, void 0, function* () {
  4454. const args = ['branch', '--delete', '--force'];
  4455. if (remote) {
  4456. args.push('--remote');
  4457. }
  4458. args.push(branch);
  4459. yield this.execGit(args);
  4460. });
  4461. }
  4462. branchExists(remote, pattern) {
  4463. return __awaiter(this, void 0, void 0, function* () {
  4464. const args = ['branch', '--list'];
  4465. if (remote) {
  4466. args.push('--remote');
  4467. }
  4468. args.push(pattern);
  4469. const output = yield this.execGit(args);
  4470. return !!output.stdout.trim();
  4471. });
  4472. }
  4473. branchList(remote) {
  4474. return __awaiter(this, void 0, void 0, function* () {
  4475. const result = [];
  4476. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4477. // "branch --list" is more difficult when in a detached HEAD state.
  4478. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4479. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4480. const args = ['rev-parse', '--symbolic-full-name'];
  4481. if (remote) {
  4482. args.push('--remotes=origin');
  4483. }
  4484. else {
  4485. args.push('--branches');
  4486. }
  4487. const output = yield this.execGit(args);
  4488. for (let branch of output.stdout.trim().split('\n')) {
  4489. branch = branch.trim();
  4490. if (branch) {
  4491. if (branch.startsWith('refs/heads/')) {
  4492. branch = branch.substr('refs/heads/'.length);
  4493. }
  4494. else if (branch.startsWith('refs/remotes/')) {
  4495. branch = branch.substr('refs/remotes/'.length);
  4496. }
  4497. result.push(branch);
  4498. }
  4499. }
  4500. return result;
  4501. });
  4502. }
  4503. checkout(ref, startPoint) {
  4504. return __awaiter(this, void 0, void 0, function* () {
  4505. const args = ['checkout', '--progress', '--force'];
  4506. if (startPoint) {
  4507. args.push('-B', ref, startPoint);
  4508. }
  4509. else {
  4510. args.push(ref);
  4511. }
  4512. yield this.execGit(args);
  4513. });
  4514. }
  4515. checkoutDetach() {
  4516. return __awaiter(this, void 0, void 0, function* () {
  4517. const args = ['checkout', '--detach'];
  4518. yield this.execGit(args);
  4519. });
  4520. }
  4521. config(configKey, configValue) {
  4522. return __awaiter(this, void 0, void 0, function* () {
  4523. yield this.execGit(['config', '--local', configKey, configValue]);
  4524. });
  4525. }
  4526. configExists(configKey) {
  4527. return __awaiter(this, void 0, void 0, function* () {
  4528. const pattern = configKey.replace(/[^a-zA-Z0-9_]/g, x => {
  4529. return `\\${x}`;
  4530. });
  4531. const output = yield this.execGit(['config', '--local', '--name-only', '--get-regexp', pattern], true);
  4532. return output.exitCode === 0;
  4533. });
  4534. }
  4535. fetch(fetchDepth, refSpec) {
  4536. return __awaiter(this, void 0, void 0, function* () {
  4537. const args = [
  4538. '-c',
  4539. 'protocol.version=2',
  4540. 'fetch',
  4541. '--no-tags',
  4542. '--prune',
  4543. '--progress',
  4544. '--no-recurse-submodules'
  4545. ];
  4546. if (fetchDepth > 0) {
  4547. args.push(`--depth=${fetchDepth}`);
  4548. }
  4549. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4550. args.push('--unshallow');
  4551. }
  4552. args.push('origin');
  4553. for (const arg of refSpec) {
  4554. args.push(arg);
  4555. }
  4556. const that = this;
  4557. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4558. yield that.execGit(args);
  4559. }));
  4560. });
  4561. }
  4562. getWorkingDirectory() {
  4563. return this.workingDirectory;
  4564. }
  4565. init() {
  4566. return __awaiter(this, void 0, void 0, function* () {
  4567. yield this.execGit(['init', this.workingDirectory]);
  4568. });
  4569. }
  4570. isDetached() {
  4571. return __awaiter(this, void 0, void 0, function* () {
  4572. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  4573. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  4574. return !output.stdout.trim().startsWith('refs/heads/');
  4575. });
  4576. }
  4577. lfsFetch(ref) {
  4578. return __awaiter(this, void 0, void 0, function* () {
  4579. const args = ['lfs', 'fetch', 'origin', ref];
  4580. const that = this;
  4581. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4582. yield that.execGit(args);
  4583. }));
  4584. });
  4585. }
  4586. lfsInstall() {
  4587. return __awaiter(this, void 0, void 0, function* () {
  4588. yield this.execGit(['lfs', 'install', '--local']);
  4589. });
  4590. }
  4591. log1() {
  4592. return __awaiter(this, void 0, void 0, function* () {
  4593. yield this.execGit(['log', '-1']);
  4594. });
  4595. }
  4596. remoteAdd(remoteName, remoteUrl) {
  4597. return __awaiter(this, void 0, void 0, function* () {
  4598. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4599. });
  4600. }
  4601. tagExists(pattern) {
  4602. return __awaiter(this, void 0, void 0, function* () {
  4603. const output = yield this.execGit(['tag', '--list', pattern]);
  4604. return !!output.stdout.trim();
  4605. });
  4606. }
  4607. tryClean() {
  4608. return __awaiter(this, void 0, void 0, function* () {
  4609. const output = yield this.execGit(['clean', '-ffdx'], true);
  4610. return output.exitCode === 0;
  4611. });
  4612. }
  4613. tryConfigUnset(configKey) {
  4614. return __awaiter(this, void 0, void 0, function* () {
  4615. const output = yield this.execGit(['config', '--local', '--unset-all', configKey], true);
  4616. return output.exitCode === 0;
  4617. });
  4618. }
  4619. tryDisableAutomaticGarbageCollection() {
  4620. return __awaiter(this, void 0, void 0, function* () {
  4621. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  4622. return output.exitCode === 0;
  4623. });
  4624. }
  4625. tryGetFetchUrl() {
  4626. return __awaiter(this, void 0, void 0, function* () {
  4627. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  4628. if (output.exitCode !== 0) {
  4629. return '';
  4630. }
  4631. const stdout = output.stdout.trim();
  4632. if (stdout.includes('\n')) {
  4633. return '';
  4634. }
  4635. return stdout;
  4636. });
  4637. }
  4638. tryReset() {
  4639. return __awaiter(this, void 0, void 0, function* () {
  4640. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4641. return output.exitCode === 0;
  4642. });
  4643. }
  4644. static createCommandManager(workingDirectory, lfs) {
  4645. return __awaiter(this, void 0, void 0, function* () {
  4646. const result = new GitCommandManager();
  4647. yield result.initializeCommandManager(workingDirectory, lfs);
  4648. return result;
  4649. });
  4650. }
  4651. execGit(args, allowAllExitCodes = false) {
  4652. return __awaiter(this, void 0, void 0, function* () {
  4653. fshelper.directoryExistsSync(this.workingDirectory, true);
  4654. const result = new GitOutput();
  4655. const env = {};
  4656. for (const key of Object.keys(process.env)) {
  4657. env[key] = process.env[key];
  4658. }
  4659. for (const key of Object.keys(this.gitEnv)) {
  4660. env[key] = this.gitEnv[key];
  4661. }
  4662. const stdout = [];
  4663. const options = {
  4664. cwd: this.workingDirectory,
  4665. env,
  4666. ignoreReturnCode: allowAllExitCodes,
  4667. listeners: {
  4668. stdout: (data) => {
  4669. stdout.push(data.toString());
  4670. }
  4671. }
  4672. };
  4673. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4674. result.stdout = stdout.join('');
  4675. return result;
  4676. });
  4677. }
  4678. initializeCommandManager(workingDirectory, lfs) {
  4679. return __awaiter(this, void 0, void 0, function* () {
  4680. this.workingDirectory = workingDirectory;
  4681. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4682. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4683. this.lfs = lfs;
  4684. if (!this.lfs) {
  4685. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4686. }
  4687. this.gitPath = yield io.which('git', true);
  4688. // Git version
  4689. core.debug('Getting git version');
  4690. let gitVersion = new git_version_1.GitVersion();
  4691. let gitOutput = yield this.execGit(['version']);
  4692. let stdout = gitOutput.stdout.trim();
  4693. if (!stdout.includes('\n')) {
  4694. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4695. if (match) {
  4696. gitVersion = new git_version_1.GitVersion(match[0]);
  4697. }
  4698. }
  4699. if (!gitVersion.isValid()) {
  4700. throw new Error('Unable to determine git version');
  4701. }
  4702. // Minimum git version
  4703. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  4704. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4705. }
  4706. if (this.lfs) {
  4707. // Git-lfs version
  4708. core.debug('Getting git-lfs version');
  4709. let gitLfsVersion = new git_version_1.GitVersion();
  4710. const gitLfsPath = yield io.which('git-lfs', true);
  4711. gitOutput = yield this.execGit(['lfs', 'version']);
  4712. stdout = gitOutput.stdout.trim();
  4713. if (!stdout.includes('\n')) {
  4714. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4715. if (match) {
  4716. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4717. }
  4718. }
  4719. if (!gitLfsVersion.isValid()) {
  4720. throw new Error('Unable to determine git-lfs version');
  4721. }
  4722. // Minimum git-lfs version
  4723. // Note:
  4724. // - Auth header not supported before 2.1
  4725. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4726. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4727. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4728. }
  4729. }
  4730. // Set the user agent
  4731. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4732. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4733. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4734. });
  4735. }
  4736. }
  4737. class GitOutput {
  4738. constructor() {
  4739. this.stdout = '';
  4740. this.exitCode = 0;
  4741. }
  4742. }
  4743. /***/ }),
  4744. /***/ 293:
  4745. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4746. "use strict";
  4747. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4748. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4749. return new (P || (P = Promise))(function (resolve, reject) {
  4750. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4751. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4752. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4753. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4754. });
  4755. };
  4756. var __importStar = (this && this.__importStar) || function (mod) {
  4757. if (mod && mod.__esModule) return mod;
  4758. var result = {};
  4759. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4760. result["default"] = mod;
  4761. return result;
  4762. };
  4763. Object.defineProperty(exports, "__esModule", { value: true });
  4764. const core = __importStar(__webpack_require__(470));
  4765. const fs = __importStar(__webpack_require__(747));
  4766. const fsHelper = __importStar(__webpack_require__(618));
  4767. const gitCommandManager = __importStar(__webpack_require__(289));
  4768. const githubApiHelper = __importStar(__webpack_require__(464));
  4769. const io = __importStar(__webpack_require__(1));
  4770. const path = __importStar(__webpack_require__(622));
  4771. const refHelper = __importStar(__webpack_require__(227));
  4772. const stateHelper = __importStar(__webpack_require__(153));
  4773. const serverUrl = 'https://github.com/';
  4774. const authConfigKey = `http.${serverUrl}.extraheader`;
  4775. function getSource(settings) {
  4776. return __awaiter(this, void 0, void 0, function* () {
  4777. // Repository URL
  4778. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  4779. const repositoryUrl = `https://github.com/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  4780. // Remove conflicting file path
  4781. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  4782. yield io.rmRF(settings.repositoryPath);
  4783. }
  4784. // Create directory
  4785. let isExisting = true;
  4786. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  4787. isExisting = false;
  4788. yield io.mkdirP(settings.repositoryPath);
  4789. }
  4790. // Git command manager
  4791. const git = yield getGitCommandManager(settings);
  4792. // Prepare existing directory, otherwise recreate
  4793. if (isExisting) {
  4794. yield prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  4795. }
  4796. if (!git) {
  4797. // Downloading using REST API
  4798. core.info(`The repository will be downloaded using the GitHub REST API`);
  4799. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  4800. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  4801. }
  4802. else {
  4803. // Save state for POST action
  4804. stateHelper.setRepositoryPath(settings.repositoryPath);
  4805. // Initialize the repository
  4806. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  4807. yield git.init();
  4808. yield git.remoteAdd('origin', repositoryUrl);
  4809. }
  4810. // Disable automatic garbage collection
  4811. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  4812. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  4813. }
  4814. // Remove possible previous extraheader
  4815. yield removeGitConfig(git, authConfigKey);
  4816. try {
  4817. // Config extraheader
  4818. yield configureAuthToken(git, settings.authToken);
  4819. // LFS install
  4820. if (settings.lfs) {
  4821. yield git.lfsInstall();
  4822. }
  4823. // Fetch
  4824. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  4825. yield git.fetch(settings.fetchDepth, refSpec);
  4826. // Checkout info
  4827. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  4828. // LFS fetch
  4829. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  4830. // Explicit lfs fetch will fetch lfs objects in parallel.
  4831. if (settings.lfs) {
  4832. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  4833. }
  4834. // Checkout
  4835. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  4836. // Dump some info about the checked out commit
  4837. yield git.log1();
  4838. }
  4839. finally {
  4840. if (!settings.persistCredentials) {
  4841. yield removeGitConfig(git, authConfigKey);
  4842. }
  4843. }
  4844. }
  4845. });
  4846. }
  4847. exports.getSource = getSource;
  4848. function cleanup(repositoryPath) {
  4849. return __awaiter(this, void 0, void 0, function* () {
  4850. // Repo exists?
  4851. if (!repositoryPath ||
  4852. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  4853. return;
  4854. }
  4855. let git;
  4856. try {
  4857. git = yield gitCommandManager.CreateCommandManager(repositoryPath, false);
  4858. }
  4859. catch (_a) {
  4860. return;
  4861. }
  4862. // Remove extraheader
  4863. yield removeGitConfig(git, authConfigKey);
  4864. });
  4865. }
  4866. exports.cleanup = cleanup;
  4867. function getGitCommandManager(settings) {
  4868. return __awaiter(this, void 0, void 0, function* () {
  4869. core.info(`Working directory is '${settings.repositoryPath}'`);
  4870. let git = null;
  4871. try {
  4872. return yield gitCommandManager.CreateCommandManager(settings.repositoryPath, settings.lfs);
  4873. }
  4874. catch (err) {
  4875. // Git is required for LFS
  4876. if (settings.lfs) {
  4877. throw err;
  4878. }
  4879. // Otherwise fallback to REST API
  4880. return null;
  4881. }
  4882. });
  4883. }
  4884. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  4885. return __awaiter(this, void 0, void 0, function* () {
  4886. let remove = false;
  4887. // Check whether using git or REST API
  4888. if (!git) {
  4889. remove = true;
  4890. }
  4891. // Fetch URL does not match
  4892. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  4893. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  4894. remove = true;
  4895. }
  4896. else {
  4897. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  4898. const lockPaths = [
  4899. path.join(repositoryPath, '.git', 'index.lock'),
  4900. path.join(repositoryPath, '.git', 'shallow.lock')
  4901. ];
  4902. for (const lockPath of lockPaths) {
  4903. try {
  4904. yield io.rmRF(lockPath);
  4905. }
  4906. catch (error) {
  4907. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  4908. }
  4909. }
  4910. try {
  4911. // Checkout detached HEAD
  4912. if (!(yield git.isDetached())) {
  4913. yield git.checkoutDetach();
  4914. }
  4915. // Remove all refs/heads/*
  4916. let branches = yield git.branchList(false);
  4917. for (const branch of branches) {
  4918. yield git.branchDelete(false, branch);
  4919. }
  4920. // Remove all refs/remotes/origin/* to avoid conflicts
  4921. branches = yield git.branchList(true);
  4922. for (const branch of branches) {
  4923. yield git.branchDelete(true, branch);
  4924. }
  4925. // Clean
  4926. if (clean) {
  4927. if (!(yield git.tryClean())) {
  4928. 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}'.`);
  4929. remove = true;
  4930. }
  4931. else if (!(yield git.tryReset())) {
  4932. remove = true;
  4933. }
  4934. if (remove) {
  4935. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  4936. }
  4937. }
  4938. }
  4939. catch (error) {
  4940. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  4941. remove = true;
  4942. }
  4943. }
  4944. if (remove) {
  4945. // Delete the contents of the directory. Don't delete the directory itself
  4946. // since it might be the current working directory.
  4947. core.info(`Deleting the contents of '${repositoryPath}'`);
  4948. for (const file of yield fs.promises.readdir(repositoryPath)) {
  4949. yield io.rmRF(path.join(repositoryPath, file));
  4950. }
  4951. }
  4952. });
  4953. }
  4954. function configureAuthToken(git, authToken) {
  4955. return __awaiter(this, void 0, void 0, function* () {
  4956. // Configure a placeholder value. This approach avoids the credential being captured
  4957. // by process creation audit events, which are commonly logged. For more information,
  4958. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4959. const placeholder = `AUTHORIZATION: basic ***`;
  4960. yield git.config(authConfigKey, placeholder);
  4961. // Determine the basic credential value
  4962. const basicCredential = Buffer.from(`x-access-token:${authToken}`, 'utf8').toString('base64');
  4963. core.setSecret(basicCredential);
  4964. // Replace the value in the config file
  4965. const configPath = path.join(git.getWorkingDirectory(), '.git', 'config');
  4966. let content = (yield fs.promises.readFile(configPath)).toString();
  4967. const placeholderIndex = content.indexOf(placeholder);
  4968. if (placeholderIndex < 0 ||
  4969. placeholderIndex != content.lastIndexOf(placeholder)) {
  4970. throw new Error('Unable to replace auth placeholder in .git/config');
  4971. }
  4972. content = content.replace(placeholder, `AUTHORIZATION: basic ${basicCredential}`);
  4973. yield fs.promises.writeFile(configPath, content);
  4974. });
  4975. }
  4976. function removeGitConfig(git, configKey) {
  4977. return __awaiter(this, void 0, void 0, function* () {
  4978. if ((yield git.configExists(configKey)) &&
  4979. !(yield git.tryConfigUnset(configKey))) {
  4980. // Load the config contents
  4981. core.warning(`Failed to remove '${configKey}' from the git config`);
  4982. }
  4983. });
  4984. }
  4985. /***/ }),
  4986. /***/ 294:
  4987. /***/ (function(module, __unusedexports, __webpack_require__) {
  4988. module.exports = parseOptions;
  4989. const { Deprecation } = __webpack_require__(692);
  4990. const { getUserAgent } = __webpack_require__(796);
  4991. const once = __webpack_require__(969);
  4992. const pkg = __webpack_require__(215);
  4993. const deprecateOptionsTimeout = once((log, deprecation) =>
  4994. log.warn(deprecation)
  4995. );
  4996. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  4997. const deprecateOptionsHeaders = once((log, deprecation) =>
  4998. log.warn(deprecation)
  4999. );
  5000. function parseOptions(options, log, hook) {
  5001. if (options.headers) {
  5002. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5003. newObj[key.toLowerCase()] = options.headers[key];
  5004. return newObj;
  5005. }, {});
  5006. }
  5007. const clientDefaults = {
  5008. headers: options.headers || {},
  5009. request: options.request || {},
  5010. mediaType: {
  5011. previews: [],
  5012. format: ""
  5013. }
  5014. };
  5015. if (options.baseUrl) {
  5016. clientDefaults.baseUrl = options.baseUrl;
  5017. }
  5018. if (options.userAgent) {
  5019. clientDefaults.headers["user-agent"] = options.userAgent;
  5020. }
  5021. if (options.previews) {
  5022. clientDefaults.mediaType.previews = options.previews;
  5023. }
  5024. if (options.timeZone) {
  5025. clientDefaults.headers["time-zone"] = options.timeZone;
  5026. }
  5027. if (options.timeout) {
  5028. deprecateOptionsTimeout(
  5029. log,
  5030. new Deprecation(
  5031. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5032. )
  5033. );
  5034. clientDefaults.request.timeout = options.timeout;
  5035. }
  5036. if (options.agent) {
  5037. deprecateOptionsAgent(
  5038. log,
  5039. new Deprecation(
  5040. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5041. )
  5042. );
  5043. clientDefaults.request.agent = options.agent;
  5044. }
  5045. if (options.headers) {
  5046. deprecateOptionsHeaders(
  5047. log,
  5048. new Deprecation(
  5049. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5050. )
  5051. );
  5052. }
  5053. const userAgentOption = clientDefaults.headers["user-agent"];
  5054. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5055. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5056. .filter(Boolean)
  5057. .join(" ");
  5058. clientDefaults.request.hook = hook.bind(null, "request");
  5059. return clientDefaults;
  5060. }
  5061. /***/ }),
  5062. /***/ 297:
  5063. /***/ (function(module) {
  5064. module.exports = class HttpError extends Error {
  5065. constructor (message, code, headers) {
  5066. super(message)
  5067. // Maintains proper stack trace (only available on V8)
  5068. /* istanbul ignore next */
  5069. if (Error.captureStackTrace) {
  5070. Error.captureStackTrace(this, this.constructor)
  5071. }
  5072. this.name = 'HttpError'
  5073. this.code = code
  5074. this.headers = headers
  5075. }
  5076. }
  5077. /***/ }),
  5078. /***/ 301:
  5079. /***/ (function(module, __unusedexports, __webpack_require__) {
  5080. /**
  5081. * Some “list” response that can be paginated have a different response structure
  5082. *
  5083. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5084. * /installation/repositories also has `repository_selection`), as well as a key with
  5085. * the list of the items which name varies from endpoint to endpoint:
  5086. *
  5087. * - https://developer.github.com/v3/search/#example (key `items`)
  5088. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5089. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5090. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5091. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5092. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5093. *
  5094. * Octokit normalizes these responses so that paginated results are always returned following
  5095. * the same structure. One challenge is that if the list response has only one page, no Link
  5096. * header is provided, so this header alone is not sufficient to check wether a response is
  5097. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5098. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5099. * property because it also exists in the response of Get the combined status for a specific ref.
  5100. */
  5101. module.exports = normalizePaginatedListResponse;
  5102. const { Deprecation } = __webpack_require__(692);
  5103. const once = __webpack_require__(969);
  5104. const deprecateIncompleteResults = once((log, deprecation) =>
  5105. log.warn(deprecation)
  5106. );
  5107. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5108. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5109. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5110. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5111. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5112. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5113. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5114. function normalizePaginatedListResponse(octokit, url, response) {
  5115. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5116. if (
  5117. !REGEX_IS_SEARCH_PATH.test(path) &&
  5118. !REGEX_IS_CHECKS_PATH.test(path) &&
  5119. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5120. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5121. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5122. ) {
  5123. return;
  5124. }
  5125. // keep the additional properties intact to avoid a breaking change,
  5126. // but log a deprecation warning when accessed
  5127. const incompleteResults = response.data.incomplete_results;
  5128. const repositorySelection = response.data.repository_selection;
  5129. const totalCount = response.data.total_count;
  5130. delete response.data.incomplete_results;
  5131. delete response.data.repository_selection;
  5132. delete response.data.total_count;
  5133. const namespaceKey = Object.keys(response.data)[0];
  5134. response.data = response.data[namespaceKey];
  5135. Object.defineProperty(response.data, namespaceKey, {
  5136. get() {
  5137. deprecateNamespace(
  5138. octokit.log,
  5139. new Deprecation(
  5140. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5141. )
  5142. );
  5143. return response.data;
  5144. }
  5145. });
  5146. if (typeof incompleteResults !== "undefined") {
  5147. Object.defineProperty(response.data, "incomplete_results", {
  5148. get() {
  5149. deprecateIncompleteResults(
  5150. octokit.log,
  5151. new Deprecation(
  5152. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5153. )
  5154. );
  5155. return incompleteResults;
  5156. }
  5157. });
  5158. }
  5159. if (typeof repositorySelection !== "undefined") {
  5160. Object.defineProperty(response.data, "repository_selection", {
  5161. get() {
  5162. deprecateTotalCount(
  5163. octokit.log,
  5164. new Deprecation(
  5165. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5166. )
  5167. );
  5168. return repositorySelection;
  5169. }
  5170. });
  5171. }
  5172. Object.defineProperty(response.data, "total_count", {
  5173. get() {
  5174. deprecateTotalCount(
  5175. octokit.log,
  5176. new Deprecation(
  5177. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5178. )
  5179. );
  5180. return totalCount;
  5181. }
  5182. });
  5183. }
  5184. /***/ }),
  5185. /***/ 323:
  5186. /***/ (function(module) {
  5187. "use strict";
  5188. var isStream = module.exports = function (stream) {
  5189. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5190. };
  5191. isStream.writable = function (stream) {
  5192. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5193. };
  5194. isStream.readable = function (stream) {
  5195. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5196. };
  5197. isStream.duplex = function (stream) {
  5198. return isStream.writable(stream) && isStream.readable(stream);
  5199. };
  5200. isStream.transform = function (stream) {
  5201. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5202. };
  5203. /***/ }),
  5204. /***/ 335:
  5205. /***/ (function(module, __unusedexports, __webpack_require__) {
  5206. module.exports = __webpack_require__(179);
  5207. /***/ }),
  5208. /***/ 336:
  5209. /***/ (function(module, __unusedexports, __webpack_require__) {
  5210. module.exports = hasLastPage
  5211. const deprecate = __webpack_require__(370)
  5212. const getPageLinks = __webpack_require__(577)
  5213. function hasLastPage (link) {
  5214. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5215. return getPageLinks(link).last
  5216. }
  5217. /***/ }),
  5218. /***/ 348:
  5219. /***/ (function(module, __unusedexports, __webpack_require__) {
  5220. "use strict";
  5221. module.exports = validate;
  5222. const { RequestError } = __webpack_require__(463);
  5223. const get = __webpack_require__(854);
  5224. const set = __webpack_require__(883);
  5225. function validate(octokit, options) {
  5226. if (!options.request.validate) {
  5227. return;
  5228. }
  5229. const { validate: params } = options.request;
  5230. Object.keys(params).forEach(parameterName => {
  5231. const parameter = get(params, parameterName);
  5232. const expectedType = parameter.type;
  5233. let parentParameterName;
  5234. let parentValue;
  5235. let parentParamIsPresent = true;
  5236. let parentParameterIsArray = false;
  5237. if (/\./.test(parameterName)) {
  5238. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5239. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5240. if (parentParameterIsArray) {
  5241. parentParameterName = parentParameterName.slice(0, -2);
  5242. }
  5243. parentValue = get(options, parentParameterName);
  5244. parentParamIsPresent =
  5245. parentParameterName === "headers" ||
  5246. (typeof parentValue === "object" && parentValue !== null);
  5247. }
  5248. const values = parentParameterIsArray
  5249. ? (get(options, parentParameterName) || []).map(
  5250. value => value[parameterName.split(/\./).pop()]
  5251. )
  5252. : [get(options, parameterName)];
  5253. values.forEach((value, i) => {
  5254. const valueIsPresent = typeof value !== "undefined";
  5255. const valueIsNull = value === null;
  5256. const currentParameterName = parentParameterIsArray
  5257. ? parameterName.replace(/\[\]/, `[${i}]`)
  5258. : parameterName;
  5259. if (!parameter.required && !valueIsPresent) {
  5260. return;
  5261. }
  5262. // if the parent parameter is of type object but allows null
  5263. // then the child parameters can be ignored
  5264. if (!parentParamIsPresent) {
  5265. return;
  5266. }
  5267. if (parameter.allowNull && valueIsNull) {
  5268. return;
  5269. }
  5270. if (!parameter.allowNull && valueIsNull) {
  5271. throw new RequestError(
  5272. `'${currentParameterName}' cannot be null`,
  5273. 400,
  5274. {
  5275. request: options
  5276. }
  5277. );
  5278. }
  5279. if (parameter.required && !valueIsPresent) {
  5280. throw new RequestError(
  5281. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5282. value
  5283. )}`,
  5284. 400,
  5285. {
  5286. request: options
  5287. }
  5288. );
  5289. }
  5290. // parse to integer before checking for enum
  5291. // so that string "1" will match enum with number 1
  5292. if (expectedType === "integer") {
  5293. const unparsedValue = value;
  5294. value = parseInt(value, 10);
  5295. if (isNaN(value)) {
  5296. throw new RequestError(
  5297. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5298. unparsedValue
  5299. )} is NaN`,
  5300. 400,
  5301. {
  5302. request: options
  5303. }
  5304. );
  5305. }
  5306. }
  5307. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5308. throw new RequestError(
  5309. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5310. value
  5311. )}`,
  5312. 400,
  5313. {
  5314. request: options
  5315. }
  5316. );
  5317. }
  5318. if (parameter.validation) {
  5319. const regex = new RegExp(parameter.validation);
  5320. if (!regex.test(value)) {
  5321. throw new RequestError(
  5322. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5323. value
  5324. )}`,
  5325. 400,
  5326. {
  5327. request: options
  5328. }
  5329. );
  5330. }
  5331. }
  5332. if (expectedType === "object" && typeof value === "string") {
  5333. try {
  5334. value = JSON.parse(value);
  5335. } catch (exception) {
  5336. throw new RequestError(
  5337. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5338. value
  5339. )}`,
  5340. 400,
  5341. {
  5342. request: options
  5343. }
  5344. );
  5345. }
  5346. }
  5347. set(options, parameter.mapTo || currentParameterName, value);
  5348. });
  5349. });
  5350. return options;
  5351. }
  5352. /***/ }),
  5353. /***/ 349:
  5354. /***/ (function(module, __unusedexports, __webpack_require__) {
  5355. module.exports = authenticationRequestError;
  5356. const { RequestError } = __webpack_require__(463);
  5357. function authenticationRequestError(state, error, options) {
  5358. /* istanbul ignore next */
  5359. if (!error.headers) throw error;
  5360. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5361. // handle "2FA required" error only
  5362. if (error.status !== 401 || !otpRequired) {
  5363. throw error;
  5364. }
  5365. if (
  5366. error.status === 401 &&
  5367. otpRequired &&
  5368. error.request &&
  5369. error.request.headers["x-github-otp"]
  5370. ) {
  5371. throw new RequestError(
  5372. "Invalid one-time password for two-factor authentication",
  5373. 401,
  5374. {
  5375. headers: error.headers,
  5376. request: options
  5377. }
  5378. );
  5379. }
  5380. if (typeof state.auth.on2fa !== "function") {
  5381. throw new RequestError(
  5382. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5383. 401,
  5384. {
  5385. headers: error.headers,
  5386. request: options
  5387. }
  5388. );
  5389. }
  5390. return Promise.resolve()
  5391. .then(() => {
  5392. return state.auth.on2fa();
  5393. })
  5394. .then(oneTimePassword => {
  5395. const newOptions = Object.assign(options, {
  5396. headers: Object.assign(
  5397. { "x-github-otp": oneTimePassword },
  5398. options.headers
  5399. )
  5400. });
  5401. return state.octokit.request(newOptions);
  5402. });
  5403. }
  5404. /***/ }),
  5405. /***/ 357:
  5406. /***/ (function(module) {
  5407. module.exports = require("assert");
  5408. /***/ }),
  5409. /***/ 363:
  5410. /***/ (function(module) {
  5411. module.exports = register
  5412. function register (state, name, method, options) {
  5413. if (typeof method !== 'function') {
  5414. throw new Error('method for before hook must be a function')
  5415. }
  5416. if (!options) {
  5417. options = {}
  5418. }
  5419. if (Array.isArray(name)) {
  5420. return name.reverse().reduce(function (callback, name) {
  5421. return register.bind(null, state, name, callback, options)
  5422. }, method)()
  5423. }
  5424. return Promise.resolve()
  5425. .then(function () {
  5426. if (!state.registry[name]) {
  5427. return method(options)
  5428. }
  5429. return (state.registry[name]).reduce(function (method, registered) {
  5430. return registered.hook.bind(null, method, options)
  5431. }, method)()
  5432. })
  5433. }
  5434. /***/ }),
  5435. /***/ 368:
  5436. /***/ (function(module) {
  5437. module.exports = function atob(str) {
  5438. return Buffer.from(str, 'base64').toString('binary')
  5439. }
  5440. /***/ }),
  5441. /***/ 370:
  5442. /***/ (function(module) {
  5443. module.exports = deprecate
  5444. const loggedMessages = {}
  5445. function deprecate (message) {
  5446. if (loggedMessages[message]) {
  5447. return
  5448. }
  5449. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5450. loggedMessages[message] = 1
  5451. }
  5452. /***/ }),
  5453. /***/ 372:
  5454. /***/ (function(module) {
  5455. module.exports = octokitDebug;
  5456. function octokitDebug(octokit) {
  5457. octokit.hook.wrap("request", (request, options) => {
  5458. octokit.log.debug("request", options);
  5459. const start = Date.now();
  5460. const requestOptions = octokit.request.endpoint.parse(options);
  5461. const path = requestOptions.url.replace(options.baseUrl, "");
  5462. return request(options)
  5463. .then(response => {
  5464. octokit.log.info(
  5465. `${requestOptions.method} ${path} - ${
  5466. response.status
  5467. } in ${Date.now() - start}ms`
  5468. );
  5469. return response;
  5470. })
  5471. .catch(error => {
  5472. octokit.log.info(
  5473. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5474. start}ms`
  5475. );
  5476. throw error;
  5477. });
  5478. });
  5479. }
  5480. /***/ }),
  5481. /***/ 385:
  5482. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5483. "use strict";
  5484. Object.defineProperty(exports, '__esModule', { value: true });
  5485. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5486. var isPlainObject = _interopDefault(__webpack_require__(696));
  5487. var universalUserAgent = __webpack_require__(796);
  5488. function lowercaseKeys(object) {
  5489. if (!object) {
  5490. return {};
  5491. }
  5492. return Object.keys(object).reduce((newObj, key) => {
  5493. newObj[key.toLowerCase()] = object[key];
  5494. return newObj;
  5495. }, {});
  5496. }
  5497. function mergeDeep(defaults, options) {
  5498. const result = Object.assign({}, defaults);
  5499. Object.keys(options).forEach(key => {
  5500. if (isPlainObject(options[key])) {
  5501. if (!(key in defaults)) Object.assign(result, {
  5502. [key]: options[key]
  5503. });else result[key] = mergeDeep(defaults[key], options[key]);
  5504. } else {
  5505. Object.assign(result, {
  5506. [key]: options[key]
  5507. });
  5508. }
  5509. });
  5510. return result;
  5511. }
  5512. function merge(defaults, route, options) {
  5513. if (typeof route === "string") {
  5514. let [method, url] = route.split(" ");
  5515. options = Object.assign(url ? {
  5516. method,
  5517. url
  5518. } : {
  5519. url: method
  5520. }, options);
  5521. } else {
  5522. options = Object.assign({}, route);
  5523. } // lowercase header names before merging with defaults to avoid duplicates
  5524. options.headers = lowercaseKeys(options.headers);
  5525. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5526. if (defaults && defaults.mediaType.previews.length) {
  5527. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5528. }
  5529. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5530. return mergedOptions;
  5531. }
  5532. function addQueryParameters(url, parameters) {
  5533. const separator = /\?/.test(url) ? "&" : "?";
  5534. const names = Object.keys(parameters);
  5535. if (names.length === 0) {
  5536. return url;
  5537. }
  5538. return url + separator + names.map(name => {
  5539. if (name === "q") {
  5540. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5541. }
  5542. return `${name}=${encodeURIComponent(parameters[name])}`;
  5543. }).join("&");
  5544. }
  5545. const urlVariableRegex = /\{[^}]+\}/g;
  5546. function removeNonChars(variableName) {
  5547. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5548. }
  5549. function extractUrlVariableNames(url) {
  5550. const matches = url.match(urlVariableRegex);
  5551. if (!matches) {
  5552. return [];
  5553. }
  5554. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5555. }
  5556. function omit(object, keysToOmit) {
  5557. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5558. obj[key] = object[key];
  5559. return obj;
  5560. }, {});
  5561. }
  5562. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5563. // TODO: create separate package.
  5564. //
  5565. // Copyright (c) 2012-2014, Bram Stein
  5566. // All rights reserved.
  5567. // Redistribution and use in source and binary forms, with or without
  5568. // modification, are permitted provided that the following conditions
  5569. // are met:
  5570. // 1. Redistributions of source code must retain the above copyright
  5571. // notice, this list of conditions and the following disclaimer.
  5572. // 2. Redistributions in binary form must reproduce the above copyright
  5573. // notice, this list of conditions and the following disclaimer in the
  5574. // documentation and/or other materials provided with the distribution.
  5575. // 3. The name of the author may not be used to endorse or promote products
  5576. // derived from this software without specific prior written permission.
  5577. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5578. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5579. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5580. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5581. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5582. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5583. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5584. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5585. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5586. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5587. /* istanbul ignore file */
  5588. function encodeReserved(str) {
  5589. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5590. if (!/%[0-9A-Fa-f]/.test(part)) {
  5591. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5592. }
  5593. return part;
  5594. }).join("");
  5595. }
  5596. function encodeUnreserved(str) {
  5597. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5598. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5599. });
  5600. }
  5601. function encodeValue(operator, value, key) {
  5602. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5603. if (key) {
  5604. return encodeUnreserved(key) + "=" + value;
  5605. } else {
  5606. return value;
  5607. }
  5608. }
  5609. function isDefined(value) {
  5610. return value !== undefined && value !== null;
  5611. }
  5612. function isKeyOperator(operator) {
  5613. return operator === ";" || operator === "&" || operator === "?";
  5614. }
  5615. function getValues(context, operator, key, modifier) {
  5616. var value = context[key],
  5617. result = [];
  5618. if (isDefined(value) && value !== "") {
  5619. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5620. value = value.toString();
  5621. if (modifier && modifier !== "*") {
  5622. value = value.substring(0, parseInt(modifier, 10));
  5623. }
  5624. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5625. } else {
  5626. if (modifier === "*") {
  5627. if (Array.isArray(value)) {
  5628. value.filter(isDefined).forEach(function (value) {
  5629. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5630. });
  5631. } else {
  5632. Object.keys(value).forEach(function (k) {
  5633. if (isDefined(value[k])) {
  5634. result.push(encodeValue(operator, value[k], k));
  5635. }
  5636. });
  5637. }
  5638. } else {
  5639. const tmp = [];
  5640. if (Array.isArray(value)) {
  5641. value.filter(isDefined).forEach(function (value) {
  5642. tmp.push(encodeValue(operator, value));
  5643. });
  5644. } else {
  5645. Object.keys(value).forEach(function (k) {
  5646. if (isDefined(value[k])) {
  5647. tmp.push(encodeUnreserved(k));
  5648. tmp.push(encodeValue(operator, value[k].toString()));
  5649. }
  5650. });
  5651. }
  5652. if (isKeyOperator(operator)) {
  5653. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5654. } else if (tmp.length !== 0) {
  5655. result.push(tmp.join(","));
  5656. }
  5657. }
  5658. }
  5659. } else {
  5660. if (operator === ";") {
  5661. if (isDefined(value)) {
  5662. result.push(encodeUnreserved(key));
  5663. }
  5664. } else if (value === "" && (operator === "&" || operator === "?")) {
  5665. result.push(encodeUnreserved(key) + "=");
  5666. } else if (value === "") {
  5667. result.push("");
  5668. }
  5669. }
  5670. return result;
  5671. }
  5672. function parseUrl(template) {
  5673. return {
  5674. expand: expand.bind(null, template)
  5675. };
  5676. }
  5677. function expand(template, context) {
  5678. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5679. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5680. if (expression) {
  5681. let operator = "";
  5682. const values = [];
  5683. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5684. operator = expression.charAt(0);
  5685. expression = expression.substr(1);
  5686. }
  5687. expression.split(/,/g).forEach(function (variable) {
  5688. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5689. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5690. });
  5691. if (operator && operator !== "+") {
  5692. var separator = ",";
  5693. if (operator === "?") {
  5694. separator = "&";
  5695. } else if (operator !== "#") {
  5696. separator = operator;
  5697. }
  5698. return (values.length !== 0 ? operator : "") + values.join(separator);
  5699. } else {
  5700. return values.join(",");
  5701. }
  5702. } else {
  5703. return encodeReserved(literal);
  5704. }
  5705. });
  5706. }
  5707. function parse(options) {
  5708. // https://fetch.spec.whatwg.org/#methods
  5709. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5710. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5711. let headers = Object.assign({}, options.headers);
  5712. let body;
  5713. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5714. const urlVariableNames = extractUrlVariableNames(url);
  5715. url = parseUrl(url).expand(parameters);
  5716. if (!/^http/.test(url)) {
  5717. url = options.baseUrl + url;
  5718. }
  5719. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5720. const remainingParameters = omit(parameters, omittedParameters);
  5721. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5722. if (!isBinaryRequset) {
  5723. if (options.mediaType.format) {
  5724. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5725. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5726. }
  5727. if (options.mediaType.previews.length) {
  5728. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5729. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5730. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5731. return `application/vnd.github.${preview}-preview${format}`;
  5732. }).join(",");
  5733. }
  5734. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5735. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5736. if (["GET", "HEAD"].includes(method)) {
  5737. url = addQueryParameters(url, remainingParameters);
  5738. } else {
  5739. if ("data" in remainingParameters) {
  5740. body = remainingParameters.data;
  5741. } else {
  5742. if (Object.keys(remainingParameters).length) {
  5743. body = remainingParameters;
  5744. } else {
  5745. headers["content-length"] = 0;
  5746. }
  5747. }
  5748. } // default content-type for JSON if body is set
  5749. if (!headers["content-type"] && typeof body !== "undefined") {
  5750. headers["content-type"] = "application/json; charset=utf-8";
  5751. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5752. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5753. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5754. body = "";
  5755. } // Only return body/request keys if present
  5756. return Object.assign({
  5757. method,
  5758. url,
  5759. headers
  5760. }, typeof body !== "undefined" ? {
  5761. body
  5762. } : null, options.request ? {
  5763. request: options.request
  5764. } : null);
  5765. }
  5766. function endpointWithDefaults(defaults, route, options) {
  5767. return parse(merge(defaults, route, options));
  5768. }
  5769. function withDefaults(oldDefaults, newDefaults) {
  5770. const DEFAULTS = merge(oldDefaults, newDefaults);
  5771. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5772. return Object.assign(endpoint, {
  5773. DEFAULTS,
  5774. defaults: withDefaults.bind(null, DEFAULTS),
  5775. merge: merge.bind(null, DEFAULTS),
  5776. parse
  5777. });
  5778. }
  5779. const VERSION = "5.5.1";
  5780. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  5781. // So we use RequestParameters and add method as additional required property.
  5782. const DEFAULTS = {
  5783. method: "GET",
  5784. baseUrl: "https://api.github.com",
  5785. headers: {
  5786. accept: "application/vnd.github.v3+json",
  5787. "user-agent": userAgent
  5788. },
  5789. mediaType: {
  5790. format: "",
  5791. previews: []
  5792. }
  5793. };
  5794. const endpoint = withDefaults(null, DEFAULTS);
  5795. exports.endpoint = endpoint;
  5796. //# sourceMappingURL=index.js.map
  5797. /***/ }),
  5798. /***/ 389:
  5799. /***/ (function(module, __unusedexports, __webpack_require__) {
  5800. "use strict";
  5801. const fs = __webpack_require__(747);
  5802. const shebangCommand = __webpack_require__(866);
  5803. function readShebang(command) {
  5804. // Read the first 150 bytes from the file
  5805. const size = 150;
  5806. let buffer;
  5807. if (Buffer.alloc) {
  5808. // Node.js v4.5+ / v5.10+
  5809. buffer = Buffer.alloc(size);
  5810. } else {
  5811. // Old Node.js API
  5812. buffer = new Buffer(size);
  5813. buffer.fill(0); // zero-fill
  5814. }
  5815. let fd;
  5816. try {
  5817. fd = fs.openSync(command, 'r');
  5818. fs.readSync(fd, buffer, 0, size, 0);
  5819. fs.closeSync(fd);
  5820. } catch (e) { /* Empty */ }
  5821. // Attempt to extract shebang (null is returned if not a shebang)
  5822. return shebangCommand(buffer.toString());
  5823. }
  5824. module.exports = readShebang;
  5825. /***/ }),
  5826. /***/ 402:
  5827. /***/ (function(module, __unusedexports, __webpack_require__) {
  5828. module.exports = Octokit;
  5829. const { request } = __webpack_require__(753);
  5830. const Hook = __webpack_require__(523);
  5831. const parseClientOptions = __webpack_require__(294);
  5832. function Octokit(plugins, options) {
  5833. options = options || {};
  5834. const hook = new Hook.Collection();
  5835. const log = Object.assign(
  5836. {
  5837. debug: () => {},
  5838. info: () => {},
  5839. warn: console.warn,
  5840. error: console.error
  5841. },
  5842. options && options.log
  5843. );
  5844. const api = {
  5845. hook,
  5846. log,
  5847. request: request.defaults(parseClientOptions(options, log, hook))
  5848. };
  5849. plugins.forEach(pluginFunction => pluginFunction(api, options));
  5850. return api;
  5851. }
  5852. /***/ }),
  5853. /***/ 413:
  5854. /***/ (function(module) {
  5855. module.exports = require("stream");
  5856. /***/ }),
  5857. /***/ 417:
  5858. /***/ (function(module) {
  5859. module.exports = require("crypto");
  5860. /***/ }),
  5861. /***/ 427:
  5862. /***/ (function(module, __unusedexports, __webpack_require__) {
  5863. "use strict";
  5864. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  5865. // In that case, fall back to a deprecated internal.
  5866. const util = __webpack_require__(669);
  5867. let uv;
  5868. if (typeof util.getSystemErrorName === 'function') {
  5869. module.exports = util.getSystemErrorName;
  5870. } else {
  5871. try {
  5872. uv = process.binding('uv');
  5873. if (typeof uv.errname !== 'function') {
  5874. throw new TypeError('uv.errname is not a function');
  5875. }
  5876. } catch (err) {
  5877. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  5878. uv = null;
  5879. }
  5880. module.exports = code => errname(uv, code);
  5881. }
  5882. // Used for testing the fallback behavior
  5883. module.exports.__test__ = errname;
  5884. function errname(uv, code) {
  5885. if (uv) {
  5886. return uv.errname(code);
  5887. }
  5888. if (!(code < 0)) {
  5889. throw new Error('err >= 0');
  5890. }
  5891. return `Unknown system error ${code}`;
  5892. }
  5893. /***/ }),
  5894. /***/ 430:
  5895. /***/ (function(module, __unusedexports, __webpack_require__) {
  5896. module.exports = octokitValidate;
  5897. const validate = __webpack_require__(348);
  5898. function octokitValidate(octokit) {
  5899. octokit.hook.before("request", validate.bind(null, octokit));
  5900. }
  5901. /***/ }),
  5902. /***/ 431:
  5903. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5904. "use strict";
  5905. Object.defineProperty(exports, "__esModule", { value: true });
  5906. const os = __webpack_require__(87);
  5907. /**
  5908. * Commands
  5909. *
  5910. * Command Format:
  5911. * ##[name key=value;key=value]message
  5912. *
  5913. * Examples:
  5914. * ##[warning]This is the user warning message
  5915. * ##[set-secret name=mypassword]definitelyNotAPassword!
  5916. */
  5917. function issueCommand(command, properties, message) {
  5918. const cmd = new Command(command, properties, message);
  5919. process.stdout.write(cmd.toString() + os.EOL);
  5920. }
  5921. exports.issueCommand = issueCommand;
  5922. function issue(name, message = '') {
  5923. issueCommand(name, {}, message);
  5924. }
  5925. exports.issue = issue;
  5926. const CMD_STRING = '::';
  5927. class Command {
  5928. constructor(command, properties, message) {
  5929. if (!command) {
  5930. command = 'missing.command';
  5931. }
  5932. this.command = command;
  5933. this.properties = properties;
  5934. this.message = message;
  5935. }
  5936. toString() {
  5937. let cmdStr = CMD_STRING + this.command;
  5938. if (this.properties && Object.keys(this.properties).length > 0) {
  5939. cmdStr += ' ';
  5940. for (const key in this.properties) {
  5941. if (this.properties.hasOwnProperty(key)) {
  5942. const val = this.properties[key];
  5943. if (val) {
  5944. // safely append the val - avoid blowing up when attempting to
  5945. // call .replace() if message is not a string for some reason
  5946. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  5947. }
  5948. }
  5949. }
  5950. }
  5951. cmdStr += CMD_STRING;
  5952. // safely append the message - avoid blowing up when attempting to
  5953. // call .replace() if message is not a string for some reason
  5954. const message = `${this.message || ''}`;
  5955. cmdStr += escapeData(message);
  5956. return cmdStr;
  5957. }
  5958. }
  5959. function escapeData(s) {
  5960. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  5961. }
  5962. function escape(s) {
  5963. return s
  5964. .replace(/\r/g, '%0D')
  5965. .replace(/\n/g, '%0A')
  5966. .replace(/]/g, '%5D')
  5967. .replace(/;/g, '%3B');
  5968. }
  5969. //# sourceMappingURL=command.js.map
  5970. /***/ }),
  5971. /***/ 453:
  5972. /***/ (function(module, __unusedexports, __webpack_require__) {
  5973. var once = __webpack_require__(969)
  5974. var eos = __webpack_require__(562)
  5975. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  5976. var noop = function () {}
  5977. var ancient = /^v?\.0/.test(process.version)
  5978. var isFn = function (fn) {
  5979. return typeof fn === 'function'
  5980. }
  5981. var isFS = function (stream) {
  5982. if (!ancient) return false // newer node version do not need to care about fs is a special way
  5983. if (!fs) return false // browser
  5984. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  5985. }
  5986. var isRequest = function (stream) {
  5987. return stream.setHeader && isFn(stream.abort)
  5988. }
  5989. var destroyer = function (stream, reading, writing, callback) {
  5990. callback = once(callback)
  5991. var closed = false
  5992. stream.on('close', function () {
  5993. closed = true
  5994. })
  5995. eos(stream, {readable: reading, writable: writing}, function (err) {
  5996. if (err) return callback(err)
  5997. closed = true
  5998. callback()
  5999. })
  6000. var destroyed = false
  6001. return function (err) {
  6002. if (closed) return
  6003. if (destroyed) return
  6004. destroyed = true
  6005. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6006. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6007. if (isFn(stream.destroy)) return stream.destroy()
  6008. callback(err || new Error('stream was destroyed'))
  6009. }
  6010. }
  6011. var call = function (fn) {
  6012. fn()
  6013. }
  6014. var pipe = function (from, to) {
  6015. return from.pipe(to)
  6016. }
  6017. var pump = function () {
  6018. var streams = Array.prototype.slice.call(arguments)
  6019. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6020. if (Array.isArray(streams[0])) streams = streams[0]
  6021. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6022. var error
  6023. var destroys = streams.map(function (stream, i) {
  6024. var reading = i < streams.length - 1
  6025. var writing = i > 0
  6026. return destroyer(stream, reading, writing, function (err) {
  6027. if (!error) error = err
  6028. if (err) destroys.forEach(call)
  6029. if (reading) return
  6030. destroys.forEach(call)
  6031. callback(error)
  6032. })
  6033. })
  6034. return streams.reduce(pipe)
  6035. }
  6036. module.exports = pump
  6037. /***/ }),
  6038. /***/ 454:
  6039. /***/ (function(module, exports, __webpack_require__) {
  6040. "use strict";
  6041. Object.defineProperty(exports, '__esModule', { value: true });
  6042. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6043. var Stream = _interopDefault(__webpack_require__(413));
  6044. var http = _interopDefault(__webpack_require__(605));
  6045. var Url = _interopDefault(__webpack_require__(835));
  6046. var https = _interopDefault(__webpack_require__(211));
  6047. var zlib = _interopDefault(__webpack_require__(761));
  6048. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6049. // fix for "Readable" isn't a named export issue
  6050. const Readable = Stream.Readable;
  6051. const BUFFER = Symbol('buffer');
  6052. const TYPE = Symbol('type');
  6053. class Blob {
  6054. constructor() {
  6055. this[TYPE] = '';
  6056. const blobParts = arguments[0];
  6057. const options = arguments[1];
  6058. const buffers = [];
  6059. let size = 0;
  6060. if (blobParts) {
  6061. const a = blobParts;
  6062. const length = Number(a.length);
  6063. for (let i = 0; i < length; i++) {
  6064. const element = a[i];
  6065. let buffer;
  6066. if (element instanceof Buffer) {
  6067. buffer = element;
  6068. } else if (ArrayBuffer.isView(element)) {
  6069. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6070. } else if (element instanceof ArrayBuffer) {
  6071. buffer = Buffer.from(element);
  6072. } else if (element instanceof Blob) {
  6073. buffer = element[BUFFER];
  6074. } else {
  6075. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6076. }
  6077. size += buffer.length;
  6078. buffers.push(buffer);
  6079. }
  6080. }
  6081. this[BUFFER] = Buffer.concat(buffers);
  6082. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6083. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6084. this[TYPE] = type;
  6085. }
  6086. }
  6087. get size() {
  6088. return this[BUFFER].length;
  6089. }
  6090. get type() {
  6091. return this[TYPE];
  6092. }
  6093. text() {
  6094. return Promise.resolve(this[BUFFER].toString());
  6095. }
  6096. arrayBuffer() {
  6097. const buf = this[BUFFER];
  6098. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6099. return Promise.resolve(ab);
  6100. }
  6101. stream() {
  6102. const readable = new Readable();
  6103. readable._read = function () {};
  6104. readable.push(this[BUFFER]);
  6105. readable.push(null);
  6106. return readable;
  6107. }
  6108. toString() {
  6109. return '[object Blob]';
  6110. }
  6111. slice() {
  6112. const size = this.size;
  6113. const start = arguments[0];
  6114. const end = arguments[1];
  6115. let relativeStart, relativeEnd;
  6116. if (start === undefined) {
  6117. relativeStart = 0;
  6118. } else if (start < 0) {
  6119. relativeStart = Math.max(size + start, 0);
  6120. } else {
  6121. relativeStart = Math.min(start, size);
  6122. }
  6123. if (end === undefined) {
  6124. relativeEnd = size;
  6125. } else if (end < 0) {
  6126. relativeEnd = Math.max(size + end, 0);
  6127. } else {
  6128. relativeEnd = Math.min(end, size);
  6129. }
  6130. const span = Math.max(relativeEnd - relativeStart, 0);
  6131. const buffer = this[BUFFER];
  6132. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6133. const blob = new Blob([], { type: arguments[2] });
  6134. blob[BUFFER] = slicedBuffer;
  6135. return blob;
  6136. }
  6137. }
  6138. Object.defineProperties(Blob.prototype, {
  6139. size: { enumerable: true },
  6140. type: { enumerable: true },
  6141. slice: { enumerable: true }
  6142. });
  6143. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6144. value: 'Blob',
  6145. writable: false,
  6146. enumerable: false,
  6147. configurable: true
  6148. });
  6149. /**
  6150. * fetch-error.js
  6151. *
  6152. * FetchError interface for operational errors
  6153. */
  6154. /**
  6155. * Create FetchError instance
  6156. *
  6157. * @param String message Error message for human
  6158. * @param String type Error type for machine
  6159. * @param String systemError For Node.js system error
  6160. * @return FetchError
  6161. */
  6162. function FetchError(message, type, systemError) {
  6163. Error.call(this, message);
  6164. this.message = message;
  6165. this.type = type;
  6166. // when err.type is `system`, err.code contains system error code
  6167. if (systemError) {
  6168. this.code = this.errno = systemError.code;
  6169. }
  6170. // hide custom error implementation details from end-users
  6171. Error.captureStackTrace(this, this.constructor);
  6172. }
  6173. FetchError.prototype = Object.create(Error.prototype);
  6174. FetchError.prototype.constructor = FetchError;
  6175. FetchError.prototype.name = 'FetchError';
  6176. let convert;
  6177. try {
  6178. convert = __webpack_require__(18).convert;
  6179. } catch (e) {}
  6180. const INTERNALS = Symbol('Body internals');
  6181. // fix an issue where "PassThrough" isn't a named export for node <10
  6182. const PassThrough = Stream.PassThrough;
  6183. /**
  6184. * Body mixin
  6185. *
  6186. * Ref: https://fetch.spec.whatwg.org/#body
  6187. *
  6188. * @param Stream body Readable stream
  6189. * @param Object opts Response options
  6190. * @return Void
  6191. */
  6192. function Body(body) {
  6193. var _this = this;
  6194. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6195. _ref$size = _ref.size;
  6196. let size = _ref$size === undefined ? 0 : _ref$size;
  6197. var _ref$timeout = _ref.timeout;
  6198. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6199. if (body == null) {
  6200. // body is undefined or null
  6201. body = null;
  6202. } else if (isURLSearchParams(body)) {
  6203. // body is a URLSearchParams
  6204. body = Buffer.from(body.toString());
  6205. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6206. // body is ArrayBuffer
  6207. body = Buffer.from(body);
  6208. } else if (ArrayBuffer.isView(body)) {
  6209. // body is ArrayBufferView
  6210. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6211. } else if (body instanceof Stream) ; else {
  6212. // none of the above
  6213. // coerce to string then buffer
  6214. body = Buffer.from(String(body));
  6215. }
  6216. this[INTERNALS] = {
  6217. body,
  6218. disturbed: false,
  6219. error: null
  6220. };
  6221. this.size = size;
  6222. this.timeout = timeout;
  6223. if (body instanceof Stream) {
  6224. body.on('error', function (err) {
  6225. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6226. _this[INTERNALS].error = error;
  6227. });
  6228. }
  6229. }
  6230. Body.prototype = {
  6231. get body() {
  6232. return this[INTERNALS].body;
  6233. },
  6234. get bodyUsed() {
  6235. return this[INTERNALS].disturbed;
  6236. },
  6237. /**
  6238. * Decode response as ArrayBuffer
  6239. *
  6240. * @return Promise
  6241. */
  6242. arrayBuffer() {
  6243. return consumeBody.call(this).then(function (buf) {
  6244. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6245. });
  6246. },
  6247. /**
  6248. * Return raw response as Blob
  6249. *
  6250. * @return Promise
  6251. */
  6252. blob() {
  6253. let ct = this.headers && this.headers.get('content-type') || '';
  6254. return consumeBody.call(this).then(function (buf) {
  6255. return Object.assign(
  6256. // Prevent copying
  6257. new Blob([], {
  6258. type: ct.toLowerCase()
  6259. }), {
  6260. [BUFFER]: buf
  6261. });
  6262. });
  6263. },
  6264. /**
  6265. * Decode response as json
  6266. *
  6267. * @return Promise
  6268. */
  6269. json() {
  6270. var _this2 = this;
  6271. return consumeBody.call(this).then(function (buffer) {
  6272. try {
  6273. return JSON.parse(buffer.toString());
  6274. } catch (err) {
  6275. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6276. }
  6277. });
  6278. },
  6279. /**
  6280. * Decode response as text
  6281. *
  6282. * @return Promise
  6283. */
  6284. text() {
  6285. return consumeBody.call(this).then(function (buffer) {
  6286. return buffer.toString();
  6287. });
  6288. },
  6289. /**
  6290. * Decode response as buffer (non-spec api)
  6291. *
  6292. * @return Promise
  6293. */
  6294. buffer() {
  6295. return consumeBody.call(this);
  6296. },
  6297. /**
  6298. * Decode response as text, while automatically detecting the encoding and
  6299. * trying to decode to UTF-8 (non-spec api)
  6300. *
  6301. * @return Promise
  6302. */
  6303. textConverted() {
  6304. var _this3 = this;
  6305. return consumeBody.call(this).then(function (buffer) {
  6306. return convertBody(buffer, _this3.headers);
  6307. });
  6308. }
  6309. };
  6310. // In browsers, all properties are enumerable.
  6311. Object.defineProperties(Body.prototype, {
  6312. body: { enumerable: true },
  6313. bodyUsed: { enumerable: true },
  6314. arrayBuffer: { enumerable: true },
  6315. blob: { enumerable: true },
  6316. json: { enumerable: true },
  6317. text: { enumerable: true }
  6318. });
  6319. Body.mixIn = function (proto) {
  6320. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6321. // istanbul ignore else: future proof
  6322. if (!(name in proto)) {
  6323. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6324. Object.defineProperty(proto, name, desc);
  6325. }
  6326. }
  6327. };
  6328. /**
  6329. * Consume and convert an entire Body to a Buffer.
  6330. *
  6331. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6332. *
  6333. * @return Promise
  6334. */
  6335. function consumeBody() {
  6336. var _this4 = this;
  6337. if (this[INTERNALS].disturbed) {
  6338. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6339. }
  6340. this[INTERNALS].disturbed = true;
  6341. if (this[INTERNALS].error) {
  6342. return Body.Promise.reject(this[INTERNALS].error);
  6343. }
  6344. let body = this.body;
  6345. // body is null
  6346. if (body === null) {
  6347. return Body.Promise.resolve(Buffer.alloc(0));
  6348. }
  6349. // body is blob
  6350. if (isBlob(body)) {
  6351. body = body.stream();
  6352. }
  6353. // body is buffer
  6354. if (Buffer.isBuffer(body)) {
  6355. return Body.Promise.resolve(body);
  6356. }
  6357. // istanbul ignore if: should never happen
  6358. if (!(body instanceof Stream)) {
  6359. return Body.Promise.resolve(Buffer.alloc(0));
  6360. }
  6361. // body is stream
  6362. // get ready to actually consume the body
  6363. let accum = [];
  6364. let accumBytes = 0;
  6365. let abort = false;
  6366. return new Body.Promise(function (resolve, reject) {
  6367. let resTimeout;
  6368. // allow timeout on slow response body
  6369. if (_this4.timeout) {
  6370. resTimeout = setTimeout(function () {
  6371. abort = true;
  6372. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6373. }, _this4.timeout);
  6374. }
  6375. // handle stream errors
  6376. body.on('error', function (err) {
  6377. if (err.name === 'AbortError') {
  6378. // if the request was aborted, reject with this Error
  6379. abort = true;
  6380. reject(err);
  6381. } else {
  6382. // other errors, such as incorrect content-encoding
  6383. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6384. }
  6385. });
  6386. body.on('data', function (chunk) {
  6387. if (abort || chunk === null) {
  6388. return;
  6389. }
  6390. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6391. abort = true;
  6392. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6393. return;
  6394. }
  6395. accumBytes += chunk.length;
  6396. accum.push(chunk);
  6397. });
  6398. body.on('end', function () {
  6399. if (abort) {
  6400. return;
  6401. }
  6402. clearTimeout(resTimeout);
  6403. try {
  6404. resolve(Buffer.concat(accum, accumBytes));
  6405. } catch (err) {
  6406. // handle streams that have accumulated too much data (issue #414)
  6407. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6408. }
  6409. });
  6410. });
  6411. }
  6412. /**
  6413. * Detect buffer encoding and convert to target encoding
  6414. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6415. *
  6416. * @param Buffer buffer Incoming buffer
  6417. * @param String encoding Target encoding
  6418. * @return String
  6419. */
  6420. function convertBody(buffer, headers) {
  6421. if (typeof convert !== 'function') {
  6422. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6423. }
  6424. const ct = headers.get('content-type');
  6425. let charset = 'utf-8';
  6426. let res, str;
  6427. // header
  6428. if (ct) {
  6429. res = /charset=([^;]*)/i.exec(ct);
  6430. }
  6431. // no charset in content type, peek at response body for at most 1024 bytes
  6432. str = buffer.slice(0, 1024).toString();
  6433. // html5
  6434. if (!res && str) {
  6435. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6436. }
  6437. // html4
  6438. if (!res && str) {
  6439. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6440. if (res) {
  6441. res = /charset=(.*)/i.exec(res.pop());
  6442. }
  6443. }
  6444. // xml
  6445. if (!res && str) {
  6446. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6447. }
  6448. // found charset
  6449. if (res) {
  6450. charset = res.pop();
  6451. // prevent decode issues when sites use incorrect encoding
  6452. // ref: https://hsivonen.fi/encoding-menu/
  6453. if (charset === 'gb2312' || charset === 'gbk') {
  6454. charset = 'gb18030';
  6455. }
  6456. }
  6457. // turn raw buffers into a single utf-8 buffer
  6458. return convert(buffer, 'UTF-8', charset).toString();
  6459. }
  6460. /**
  6461. * Detect a URLSearchParams object
  6462. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6463. *
  6464. * @param Object obj Object to detect by type or brand
  6465. * @return String
  6466. */
  6467. function isURLSearchParams(obj) {
  6468. // Duck-typing as a necessary condition.
  6469. 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') {
  6470. return false;
  6471. }
  6472. // Brand-checking and more duck-typing as optional condition.
  6473. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6474. }
  6475. /**
  6476. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6477. * @param {*} obj
  6478. * @return {boolean}
  6479. */
  6480. function isBlob(obj) {
  6481. 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]);
  6482. }
  6483. /**
  6484. * Clone body given Res/Req instance
  6485. *
  6486. * @param Mixed instance Response or Request instance
  6487. * @return Mixed
  6488. */
  6489. function clone(instance) {
  6490. let p1, p2;
  6491. let body = instance.body;
  6492. // don't allow cloning a used body
  6493. if (instance.bodyUsed) {
  6494. throw new Error('cannot clone body after it is used');
  6495. }
  6496. // check that body is a stream and not form-data object
  6497. // note: we can't clone the form-data object without having it as a dependency
  6498. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6499. // tee instance body
  6500. p1 = new PassThrough();
  6501. p2 = new PassThrough();
  6502. body.pipe(p1);
  6503. body.pipe(p2);
  6504. // set instance body to teed body and return the other teed body
  6505. instance[INTERNALS].body = p1;
  6506. body = p2;
  6507. }
  6508. return body;
  6509. }
  6510. /**
  6511. * Performs the operation "extract a `Content-Type` value from |object|" as
  6512. * specified in the specification:
  6513. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6514. *
  6515. * This function assumes that instance.body is present.
  6516. *
  6517. * @param Mixed instance Any options.body input
  6518. */
  6519. function extractContentType(body) {
  6520. if (body === null) {
  6521. // body is null
  6522. return null;
  6523. } else if (typeof body === 'string') {
  6524. // body is string
  6525. return 'text/plain;charset=UTF-8';
  6526. } else if (isURLSearchParams(body)) {
  6527. // body is a URLSearchParams
  6528. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6529. } else if (isBlob(body)) {
  6530. // body is blob
  6531. return body.type || null;
  6532. } else if (Buffer.isBuffer(body)) {
  6533. // body is buffer
  6534. return null;
  6535. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6536. // body is ArrayBuffer
  6537. return null;
  6538. } else if (ArrayBuffer.isView(body)) {
  6539. // body is ArrayBufferView
  6540. return null;
  6541. } else if (typeof body.getBoundary === 'function') {
  6542. // detect form data input from form-data module
  6543. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6544. } else if (body instanceof Stream) {
  6545. // body is stream
  6546. // can't really do much about this
  6547. return null;
  6548. } else {
  6549. // Body constructor defaults other things to string
  6550. return 'text/plain;charset=UTF-8';
  6551. }
  6552. }
  6553. /**
  6554. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6555. * For us, we have to explicitly get it with a function.
  6556. *
  6557. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6558. *
  6559. * @param Body instance Instance of Body
  6560. * @return Number? Number of bytes, or null if not possible
  6561. */
  6562. function getTotalBytes(instance) {
  6563. const body = instance.body;
  6564. if (body === null) {
  6565. // body is null
  6566. return 0;
  6567. } else if (isBlob(body)) {
  6568. return body.size;
  6569. } else if (Buffer.isBuffer(body)) {
  6570. // body is buffer
  6571. return body.length;
  6572. } else if (body && typeof body.getLengthSync === 'function') {
  6573. // detect form data input from form-data module
  6574. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6575. body.hasKnownLength && body.hasKnownLength()) {
  6576. // 2.x
  6577. return body.getLengthSync();
  6578. }
  6579. return null;
  6580. } else {
  6581. // body is stream
  6582. return null;
  6583. }
  6584. }
  6585. /**
  6586. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6587. *
  6588. * @param Body instance Instance of Body
  6589. * @return Void
  6590. */
  6591. function writeToStream(dest, instance) {
  6592. const body = instance.body;
  6593. if (body === null) {
  6594. // body is null
  6595. dest.end();
  6596. } else if (isBlob(body)) {
  6597. body.stream().pipe(dest);
  6598. } else if (Buffer.isBuffer(body)) {
  6599. // body is buffer
  6600. dest.write(body);
  6601. dest.end();
  6602. } else {
  6603. // body is stream
  6604. body.pipe(dest);
  6605. }
  6606. }
  6607. // expose Promise
  6608. Body.Promise = global.Promise;
  6609. /**
  6610. * headers.js
  6611. *
  6612. * Headers class offers convenient helpers
  6613. */
  6614. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6615. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6616. function validateName(name) {
  6617. name = `${name}`;
  6618. if (invalidTokenRegex.test(name) || name === '') {
  6619. throw new TypeError(`${name} is not a legal HTTP header name`);
  6620. }
  6621. }
  6622. function validateValue(value) {
  6623. value = `${value}`;
  6624. if (invalidHeaderCharRegex.test(value)) {
  6625. throw new TypeError(`${value} is not a legal HTTP header value`);
  6626. }
  6627. }
  6628. /**
  6629. * Find the key in the map object given a header name.
  6630. *
  6631. * Returns undefined if not found.
  6632. *
  6633. * @param String name Header name
  6634. * @return String|Undefined
  6635. */
  6636. function find(map, name) {
  6637. name = name.toLowerCase();
  6638. for (const key in map) {
  6639. if (key.toLowerCase() === name) {
  6640. return key;
  6641. }
  6642. }
  6643. return undefined;
  6644. }
  6645. const MAP = Symbol('map');
  6646. class Headers {
  6647. /**
  6648. * Headers class
  6649. *
  6650. * @param Object headers Response headers
  6651. * @return Void
  6652. */
  6653. constructor() {
  6654. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6655. this[MAP] = Object.create(null);
  6656. if (init instanceof Headers) {
  6657. const rawHeaders = init.raw();
  6658. const headerNames = Object.keys(rawHeaders);
  6659. for (const headerName of headerNames) {
  6660. for (const value of rawHeaders[headerName]) {
  6661. this.append(headerName, value);
  6662. }
  6663. }
  6664. return;
  6665. }
  6666. // We don't worry about converting prop to ByteString here as append()
  6667. // will handle it.
  6668. if (init == null) ; else if (typeof init === 'object') {
  6669. const method = init[Symbol.iterator];
  6670. if (method != null) {
  6671. if (typeof method !== 'function') {
  6672. throw new TypeError('Header pairs must be iterable');
  6673. }
  6674. // sequence<sequence<ByteString>>
  6675. // Note: per spec we have to first exhaust the lists then process them
  6676. const pairs = [];
  6677. for (const pair of init) {
  6678. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  6679. throw new TypeError('Each header pair must be iterable');
  6680. }
  6681. pairs.push(Array.from(pair));
  6682. }
  6683. for (const pair of pairs) {
  6684. if (pair.length !== 2) {
  6685. throw new TypeError('Each header pair must be a name/value tuple');
  6686. }
  6687. this.append(pair[0], pair[1]);
  6688. }
  6689. } else {
  6690. // record<ByteString, ByteString>
  6691. for (const key of Object.keys(init)) {
  6692. const value = init[key];
  6693. this.append(key, value);
  6694. }
  6695. }
  6696. } else {
  6697. throw new TypeError('Provided initializer must be an object');
  6698. }
  6699. }
  6700. /**
  6701. * Return combined header value given name
  6702. *
  6703. * @param String name Header name
  6704. * @return Mixed
  6705. */
  6706. get(name) {
  6707. name = `${name}`;
  6708. validateName(name);
  6709. const key = find(this[MAP], name);
  6710. if (key === undefined) {
  6711. return null;
  6712. }
  6713. return this[MAP][key].join(', ');
  6714. }
  6715. /**
  6716. * Iterate over all headers
  6717. *
  6718. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  6719. * @param Boolean thisArg `this` context for callback function
  6720. * @return Void
  6721. */
  6722. forEach(callback) {
  6723. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  6724. let pairs = getHeaders(this);
  6725. let i = 0;
  6726. while (i < pairs.length) {
  6727. var _pairs$i = pairs[i];
  6728. const name = _pairs$i[0],
  6729. value = _pairs$i[1];
  6730. callback.call(thisArg, value, name, this);
  6731. pairs = getHeaders(this);
  6732. i++;
  6733. }
  6734. }
  6735. /**
  6736. * Overwrite header values given name
  6737. *
  6738. * @param String name Header name
  6739. * @param String value Header value
  6740. * @return Void
  6741. */
  6742. set(name, value) {
  6743. name = `${name}`;
  6744. value = `${value}`;
  6745. validateName(name);
  6746. validateValue(value);
  6747. const key = find(this[MAP], name);
  6748. this[MAP][key !== undefined ? key : name] = [value];
  6749. }
  6750. /**
  6751. * Append a value onto existing header
  6752. *
  6753. * @param String name Header name
  6754. * @param String value Header value
  6755. * @return Void
  6756. */
  6757. append(name, value) {
  6758. name = `${name}`;
  6759. value = `${value}`;
  6760. validateName(name);
  6761. validateValue(value);
  6762. const key = find(this[MAP], name);
  6763. if (key !== undefined) {
  6764. this[MAP][key].push(value);
  6765. } else {
  6766. this[MAP][name] = [value];
  6767. }
  6768. }
  6769. /**
  6770. * Check for header name existence
  6771. *
  6772. * @param String name Header name
  6773. * @return Boolean
  6774. */
  6775. has(name) {
  6776. name = `${name}`;
  6777. validateName(name);
  6778. return find(this[MAP], name) !== undefined;
  6779. }
  6780. /**
  6781. * Delete all header values given name
  6782. *
  6783. * @param String name Header name
  6784. * @return Void
  6785. */
  6786. delete(name) {
  6787. name = `${name}`;
  6788. validateName(name);
  6789. const key = find(this[MAP], name);
  6790. if (key !== undefined) {
  6791. delete this[MAP][key];
  6792. }
  6793. }
  6794. /**
  6795. * Return raw headers (non-spec api)
  6796. *
  6797. * @return Object
  6798. */
  6799. raw() {
  6800. return this[MAP];
  6801. }
  6802. /**
  6803. * Get an iterator on keys.
  6804. *
  6805. * @return Iterator
  6806. */
  6807. keys() {
  6808. return createHeadersIterator(this, 'key');
  6809. }
  6810. /**
  6811. * Get an iterator on values.
  6812. *
  6813. * @return Iterator
  6814. */
  6815. values() {
  6816. return createHeadersIterator(this, 'value');
  6817. }
  6818. /**
  6819. * Get an iterator on entries.
  6820. *
  6821. * This is the default iterator of the Headers object.
  6822. *
  6823. * @return Iterator
  6824. */
  6825. [Symbol.iterator]() {
  6826. return createHeadersIterator(this, 'key+value');
  6827. }
  6828. }
  6829. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  6830. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  6831. value: 'Headers',
  6832. writable: false,
  6833. enumerable: false,
  6834. configurable: true
  6835. });
  6836. Object.defineProperties(Headers.prototype, {
  6837. get: { enumerable: true },
  6838. forEach: { enumerable: true },
  6839. set: { enumerable: true },
  6840. append: { enumerable: true },
  6841. has: { enumerable: true },
  6842. delete: { enumerable: true },
  6843. keys: { enumerable: true },
  6844. values: { enumerable: true },
  6845. entries: { enumerable: true }
  6846. });
  6847. function getHeaders(headers) {
  6848. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  6849. const keys = Object.keys(headers[MAP]).sort();
  6850. return keys.map(kind === 'key' ? function (k) {
  6851. return k.toLowerCase();
  6852. } : kind === 'value' ? function (k) {
  6853. return headers[MAP][k].join(', ');
  6854. } : function (k) {
  6855. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  6856. });
  6857. }
  6858. const INTERNAL = Symbol('internal');
  6859. function createHeadersIterator(target, kind) {
  6860. const iterator = Object.create(HeadersIteratorPrototype);
  6861. iterator[INTERNAL] = {
  6862. target,
  6863. kind,
  6864. index: 0
  6865. };
  6866. return iterator;
  6867. }
  6868. const HeadersIteratorPrototype = Object.setPrototypeOf({
  6869. next() {
  6870. // istanbul ignore if
  6871. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  6872. throw new TypeError('Value of `this` is not a HeadersIterator');
  6873. }
  6874. var _INTERNAL = this[INTERNAL];
  6875. const target = _INTERNAL.target,
  6876. kind = _INTERNAL.kind,
  6877. index = _INTERNAL.index;
  6878. const values = getHeaders(target, kind);
  6879. const len = values.length;
  6880. if (index >= len) {
  6881. return {
  6882. value: undefined,
  6883. done: true
  6884. };
  6885. }
  6886. this[INTERNAL].index = index + 1;
  6887. return {
  6888. value: values[index],
  6889. done: false
  6890. };
  6891. }
  6892. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  6893. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  6894. value: 'HeadersIterator',
  6895. writable: false,
  6896. enumerable: false,
  6897. configurable: true
  6898. });
  6899. /**
  6900. * Export the Headers object in a form that Node.js can consume.
  6901. *
  6902. * @param Headers headers
  6903. * @return Object
  6904. */
  6905. function exportNodeCompatibleHeaders(headers) {
  6906. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  6907. // http.request() only supports string as Host header. This hack makes
  6908. // specifying custom Host header possible.
  6909. const hostHeaderKey = find(headers[MAP], 'Host');
  6910. if (hostHeaderKey !== undefined) {
  6911. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  6912. }
  6913. return obj;
  6914. }
  6915. /**
  6916. * Create a Headers object from an object of headers, ignoring those that do
  6917. * not conform to HTTP grammar productions.
  6918. *
  6919. * @param Object obj Object of headers
  6920. * @return Headers
  6921. */
  6922. function createHeadersLenient(obj) {
  6923. const headers = new Headers();
  6924. for (const name of Object.keys(obj)) {
  6925. if (invalidTokenRegex.test(name)) {
  6926. continue;
  6927. }
  6928. if (Array.isArray(obj[name])) {
  6929. for (const val of obj[name]) {
  6930. if (invalidHeaderCharRegex.test(val)) {
  6931. continue;
  6932. }
  6933. if (headers[MAP][name] === undefined) {
  6934. headers[MAP][name] = [val];
  6935. } else {
  6936. headers[MAP][name].push(val);
  6937. }
  6938. }
  6939. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  6940. headers[MAP][name] = [obj[name]];
  6941. }
  6942. }
  6943. return headers;
  6944. }
  6945. const INTERNALS$1 = Symbol('Response internals');
  6946. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  6947. const STATUS_CODES = http.STATUS_CODES;
  6948. /**
  6949. * Response class
  6950. *
  6951. * @param Stream body Readable stream
  6952. * @param Object opts Response options
  6953. * @return Void
  6954. */
  6955. class Response {
  6956. constructor() {
  6957. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  6958. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6959. Body.call(this, body, opts);
  6960. const status = opts.status || 200;
  6961. const headers = new Headers(opts.headers);
  6962. if (body != null && !headers.has('Content-Type')) {
  6963. const contentType = extractContentType(body);
  6964. if (contentType) {
  6965. headers.append('Content-Type', contentType);
  6966. }
  6967. }
  6968. this[INTERNALS$1] = {
  6969. url: opts.url,
  6970. status,
  6971. statusText: opts.statusText || STATUS_CODES[status],
  6972. headers,
  6973. counter: opts.counter
  6974. };
  6975. }
  6976. get url() {
  6977. return this[INTERNALS$1].url || '';
  6978. }
  6979. get status() {
  6980. return this[INTERNALS$1].status;
  6981. }
  6982. /**
  6983. * Convenience property representing if the request ended normally
  6984. */
  6985. get ok() {
  6986. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  6987. }
  6988. get redirected() {
  6989. return this[INTERNALS$1].counter > 0;
  6990. }
  6991. get statusText() {
  6992. return this[INTERNALS$1].statusText;
  6993. }
  6994. get headers() {
  6995. return this[INTERNALS$1].headers;
  6996. }
  6997. /**
  6998. * Clone this response
  6999. *
  7000. * @return Response
  7001. */
  7002. clone() {
  7003. return new Response(clone(this), {
  7004. url: this.url,
  7005. status: this.status,
  7006. statusText: this.statusText,
  7007. headers: this.headers,
  7008. ok: this.ok,
  7009. redirected: this.redirected
  7010. });
  7011. }
  7012. }
  7013. Body.mixIn(Response.prototype);
  7014. Object.defineProperties(Response.prototype, {
  7015. url: { enumerable: true },
  7016. status: { enumerable: true },
  7017. ok: { enumerable: true },
  7018. redirected: { enumerable: true },
  7019. statusText: { enumerable: true },
  7020. headers: { enumerable: true },
  7021. clone: { enumerable: true }
  7022. });
  7023. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7024. value: 'Response',
  7025. writable: false,
  7026. enumerable: false,
  7027. configurable: true
  7028. });
  7029. const INTERNALS$2 = Symbol('Request internals');
  7030. // fix an issue where "format", "parse" aren't a named export for node <10
  7031. const parse_url = Url.parse;
  7032. const format_url = Url.format;
  7033. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7034. /**
  7035. * Check if a value is an instance of Request.
  7036. *
  7037. * @param Mixed input
  7038. * @return Boolean
  7039. */
  7040. function isRequest(input) {
  7041. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7042. }
  7043. function isAbortSignal(signal) {
  7044. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7045. return !!(proto && proto.constructor.name === 'AbortSignal');
  7046. }
  7047. /**
  7048. * Request class
  7049. *
  7050. * @param Mixed input Url or Request instance
  7051. * @param Object init Custom options
  7052. * @return Void
  7053. */
  7054. class Request {
  7055. constructor(input) {
  7056. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7057. let parsedURL;
  7058. // normalize input
  7059. if (!isRequest(input)) {
  7060. if (input && input.href) {
  7061. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7062. // will fall into this branch also (since their `toString()` will return
  7063. // `href` property anyway)
  7064. parsedURL = parse_url(input.href);
  7065. } else {
  7066. // coerce input to a string before attempting to parse
  7067. parsedURL = parse_url(`${input}`);
  7068. }
  7069. input = {};
  7070. } else {
  7071. parsedURL = parse_url(input.url);
  7072. }
  7073. let method = init.method || input.method || 'GET';
  7074. method = method.toUpperCase();
  7075. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7076. throw new TypeError('Request with GET/HEAD method cannot have body');
  7077. }
  7078. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7079. Body.call(this, inputBody, {
  7080. timeout: init.timeout || input.timeout || 0,
  7081. size: init.size || input.size || 0
  7082. });
  7083. const headers = new Headers(init.headers || input.headers || {});
  7084. if (inputBody != null && !headers.has('Content-Type')) {
  7085. const contentType = extractContentType(inputBody);
  7086. if (contentType) {
  7087. headers.append('Content-Type', contentType);
  7088. }
  7089. }
  7090. let signal = isRequest(input) ? input.signal : null;
  7091. if ('signal' in init) signal = init.signal;
  7092. if (signal != null && !isAbortSignal(signal)) {
  7093. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7094. }
  7095. this[INTERNALS$2] = {
  7096. method,
  7097. redirect: init.redirect || input.redirect || 'follow',
  7098. headers,
  7099. parsedURL,
  7100. signal
  7101. };
  7102. // node-fetch-only options
  7103. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7104. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7105. this.counter = init.counter || input.counter || 0;
  7106. this.agent = init.agent || input.agent;
  7107. }
  7108. get method() {
  7109. return this[INTERNALS$2].method;
  7110. }
  7111. get url() {
  7112. return format_url(this[INTERNALS$2].parsedURL);
  7113. }
  7114. get headers() {
  7115. return this[INTERNALS$2].headers;
  7116. }
  7117. get redirect() {
  7118. return this[INTERNALS$2].redirect;
  7119. }
  7120. get signal() {
  7121. return this[INTERNALS$2].signal;
  7122. }
  7123. /**
  7124. * Clone this request
  7125. *
  7126. * @return Request
  7127. */
  7128. clone() {
  7129. return new Request(this);
  7130. }
  7131. }
  7132. Body.mixIn(Request.prototype);
  7133. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7134. value: 'Request',
  7135. writable: false,
  7136. enumerable: false,
  7137. configurable: true
  7138. });
  7139. Object.defineProperties(Request.prototype, {
  7140. method: { enumerable: true },
  7141. url: { enumerable: true },
  7142. headers: { enumerable: true },
  7143. redirect: { enumerable: true },
  7144. clone: { enumerable: true },
  7145. signal: { enumerable: true }
  7146. });
  7147. /**
  7148. * Convert a Request to Node.js http request options.
  7149. *
  7150. * @param Request A Request instance
  7151. * @return Object The options object to be passed to http.request
  7152. */
  7153. function getNodeRequestOptions(request) {
  7154. const parsedURL = request[INTERNALS$2].parsedURL;
  7155. const headers = new Headers(request[INTERNALS$2].headers);
  7156. // fetch step 1.3
  7157. if (!headers.has('Accept')) {
  7158. headers.set('Accept', '*/*');
  7159. }
  7160. // Basic fetch
  7161. if (!parsedURL.protocol || !parsedURL.hostname) {
  7162. throw new TypeError('Only absolute URLs are supported');
  7163. }
  7164. if (!/^https?:$/.test(parsedURL.protocol)) {
  7165. throw new TypeError('Only HTTP(S) protocols are supported');
  7166. }
  7167. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7168. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7169. }
  7170. // HTTP-network-or-cache fetch steps 2.4-2.7
  7171. let contentLengthValue = null;
  7172. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7173. contentLengthValue = '0';
  7174. }
  7175. if (request.body != null) {
  7176. const totalBytes = getTotalBytes(request);
  7177. if (typeof totalBytes === 'number') {
  7178. contentLengthValue = String(totalBytes);
  7179. }
  7180. }
  7181. if (contentLengthValue) {
  7182. headers.set('Content-Length', contentLengthValue);
  7183. }
  7184. // HTTP-network-or-cache fetch step 2.11
  7185. if (!headers.has('User-Agent')) {
  7186. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7187. }
  7188. // HTTP-network-or-cache fetch step 2.15
  7189. if (request.compress && !headers.has('Accept-Encoding')) {
  7190. headers.set('Accept-Encoding', 'gzip,deflate');
  7191. }
  7192. let agent = request.agent;
  7193. if (typeof agent === 'function') {
  7194. agent = agent(parsedURL);
  7195. }
  7196. if (!headers.has('Connection') && !agent) {
  7197. headers.set('Connection', 'close');
  7198. }
  7199. // HTTP-network fetch step 4.2
  7200. // chunked encoding is handled by Node.js
  7201. return Object.assign({}, parsedURL, {
  7202. method: request.method,
  7203. headers: exportNodeCompatibleHeaders(headers),
  7204. agent
  7205. });
  7206. }
  7207. /**
  7208. * abort-error.js
  7209. *
  7210. * AbortError interface for cancelled requests
  7211. */
  7212. /**
  7213. * Create AbortError instance
  7214. *
  7215. * @param String message Error message for human
  7216. * @return AbortError
  7217. */
  7218. function AbortError(message) {
  7219. Error.call(this, message);
  7220. this.type = 'aborted';
  7221. this.message = message;
  7222. // hide custom error implementation details from end-users
  7223. Error.captureStackTrace(this, this.constructor);
  7224. }
  7225. AbortError.prototype = Object.create(Error.prototype);
  7226. AbortError.prototype.constructor = AbortError;
  7227. AbortError.prototype.name = 'AbortError';
  7228. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7229. const PassThrough$1 = Stream.PassThrough;
  7230. const resolve_url = Url.resolve;
  7231. /**
  7232. * Fetch function
  7233. *
  7234. * @param Mixed url Absolute url or Request instance
  7235. * @param Object opts Fetch options
  7236. * @return Promise
  7237. */
  7238. function fetch(url, opts) {
  7239. // allow custom promise
  7240. if (!fetch.Promise) {
  7241. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7242. }
  7243. Body.Promise = fetch.Promise;
  7244. // wrap http.request into fetch
  7245. return new fetch.Promise(function (resolve, reject) {
  7246. // build request object
  7247. const request = new Request(url, opts);
  7248. const options = getNodeRequestOptions(request);
  7249. const send = (options.protocol === 'https:' ? https : http).request;
  7250. const signal = request.signal;
  7251. let response = null;
  7252. const abort = function abort() {
  7253. let error = new AbortError('The user aborted a request.');
  7254. reject(error);
  7255. if (request.body && request.body instanceof Stream.Readable) {
  7256. request.body.destroy(error);
  7257. }
  7258. if (!response || !response.body) return;
  7259. response.body.emit('error', error);
  7260. };
  7261. if (signal && signal.aborted) {
  7262. abort();
  7263. return;
  7264. }
  7265. const abortAndFinalize = function abortAndFinalize() {
  7266. abort();
  7267. finalize();
  7268. };
  7269. // send request
  7270. const req = send(options);
  7271. let reqTimeout;
  7272. if (signal) {
  7273. signal.addEventListener('abort', abortAndFinalize);
  7274. }
  7275. function finalize() {
  7276. req.abort();
  7277. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7278. clearTimeout(reqTimeout);
  7279. }
  7280. if (request.timeout) {
  7281. req.once('socket', function (socket) {
  7282. reqTimeout = setTimeout(function () {
  7283. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7284. finalize();
  7285. }, request.timeout);
  7286. });
  7287. }
  7288. req.on('error', function (err) {
  7289. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7290. finalize();
  7291. });
  7292. req.on('response', function (res) {
  7293. clearTimeout(reqTimeout);
  7294. const headers = createHeadersLenient(res.headers);
  7295. // HTTP fetch step 5
  7296. if (fetch.isRedirect(res.statusCode)) {
  7297. // HTTP fetch step 5.2
  7298. const location = headers.get('Location');
  7299. // HTTP fetch step 5.3
  7300. const locationURL = location === null ? null : resolve_url(request.url, location);
  7301. // HTTP fetch step 5.5
  7302. switch (request.redirect) {
  7303. case 'error':
  7304. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7305. finalize();
  7306. return;
  7307. case 'manual':
  7308. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7309. if (locationURL !== null) {
  7310. // handle corrupted header
  7311. try {
  7312. headers.set('Location', locationURL);
  7313. } catch (err) {
  7314. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7315. reject(err);
  7316. }
  7317. }
  7318. break;
  7319. case 'follow':
  7320. // HTTP-redirect fetch step 2
  7321. if (locationURL === null) {
  7322. break;
  7323. }
  7324. // HTTP-redirect fetch step 5
  7325. if (request.counter >= request.follow) {
  7326. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7327. finalize();
  7328. return;
  7329. }
  7330. // HTTP-redirect fetch step 6 (counter increment)
  7331. // Create a new Request object.
  7332. const requestOpts = {
  7333. headers: new Headers(request.headers),
  7334. follow: request.follow,
  7335. counter: request.counter + 1,
  7336. agent: request.agent,
  7337. compress: request.compress,
  7338. method: request.method,
  7339. body: request.body,
  7340. signal: request.signal,
  7341. timeout: request.timeout
  7342. };
  7343. // HTTP-redirect fetch step 9
  7344. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7345. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7346. finalize();
  7347. return;
  7348. }
  7349. // HTTP-redirect fetch step 11
  7350. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7351. requestOpts.method = 'GET';
  7352. requestOpts.body = undefined;
  7353. requestOpts.headers.delete('content-length');
  7354. }
  7355. // HTTP-redirect fetch step 15
  7356. resolve(fetch(new Request(locationURL, requestOpts)));
  7357. finalize();
  7358. return;
  7359. }
  7360. }
  7361. // prepare response
  7362. res.once('end', function () {
  7363. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7364. });
  7365. let body = res.pipe(new PassThrough$1());
  7366. const response_options = {
  7367. url: request.url,
  7368. status: res.statusCode,
  7369. statusText: res.statusMessage,
  7370. headers: headers,
  7371. size: request.size,
  7372. timeout: request.timeout,
  7373. counter: request.counter
  7374. };
  7375. // HTTP-network fetch step 12.1.1.3
  7376. const codings = headers.get('Content-Encoding');
  7377. // HTTP-network fetch step 12.1.1.4: handle content codings
  7378. // in following scenarios we ignore compression support
  7379. // 1. compression support is disabled
  7380. // 2. HEAD request
  7381. // 3. no Content-Encoding header
  7382. // 4. no content response (204)
  7383. // 5. content not modified response (304)
  7384. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7385. response = new Response(body, response_options);
  7386. resolve(response);
  7387. return;
  7388. }
  7389. // For Node v6+
  7390. // Be less strict when decoding compressed responses, since sometimes
  7391. // servers send slightly invalid responses that are still accepted
  7392. // by common browsers.
  7393. // Always using Z_SYNC_FLUSH is what cURL does.
  7394. const zlibOptions = {
  7395. flush: zlib.Z_SYNC_FLUSH,
  7396. finishFlush: zlib.Z_SYNC_FLUSH
  7397. };
  7398. // for gzip
  7399. if (codings == 'gzip' || codings == 'x-gzip') {
  7400. body = body.pipe(zlib.createGunzip(zlibOptions));
  7401. response = new Response(body, response_options);
  7402. resolve(response);
  7403. return;
  7404. }
  7405. // for deflate
  7406. if (codings == 'deflate' || codings == 'x-deflate') {
  7407. // handle the infamous raw deflate response from old servers
  7408. // a hack for old IIS and Apache servers
  7409. const raw = res.pipe(new PassThrough$1());
  7410. raw.once('data', function (chunk) {
  7411. // see http://stackoverflow.com/questions/37519828
  7412. if ((chunk[0] & 0x0F) === 0x08) {
  7413. body = body.pipe(zlib.createInflate());
  7414. } else {
  7415. body = body.pipe(zlib.createInflateRaw());
  7416. }
  7417. response = new Response(body, response_options);
  7418. resolve(response);
  7419. });
  7420. return;
  7421. }
  7422. // for br
  7423. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7424. body = body.pipe(zlib.createBrotliDecompress());
  7425. response = new Response(body, response_options);
  7426. resolve(response);
  7427. return;
  7428. }
  7429. // otherwise, use response as-is
  7430. response = new Response(body, response_options);
  7431. resolve(response);
  7432. });
  7433. writeToStream(req, request);
  7434. });
  7435. }
  7436. /**
  7437. * Redirect code matching
  7438. *
  7439. * @param Number code Status code
  7440. * @return Boolean
  7441. */
  7442. fetch.isRedirect = function (code) {
  7443. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7444. };
  7445. // expose Promise
  7446. fetch.Promise = global.Promise;
  7447. module.exports = exports = fetch;
  7448. Object.defineProperty(exports, "__esModule", { value: true });
  7449. exports.default = exports;
  7450. exports.Headers = Headers;
  7451. exports.Request = Request;
  7452. exports.Response = Response;
  7453. exports.FetchError = FetchError;
  7454. /***/ }),
  7455. /***/ 462:
  7456. /***/ (function(module) {
  7457. "use strict";
  7458. // See http://www.robvanderwoude.com/escapechars.php
  7459. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7460. function escapeCommand(arg) {
  7461. // Escape meta chars
  7462. arg = arg.replace(metaCharsRegExp, '^$1');
  7463. return arg;
  7464. }
  7465. function escapeArgument(arg, doubleEscapeMetaChars) {
  7466. // Convert to string
  7467. arg = `${arg}`;
  7468. // Algorithm below is based on https://qntm.org/cmd
  7469. // Sequence of backslashes followed by a double quote:
  7470. // double up all the backslashes and escape the double quote
  7471. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7472. // Sequence of backslashes followed by the end of the string
  7473. // (which will become a double quote later):
  7474. // double up all the backslashes
  7475. arg = arg.replace(/(\\*)$/, '$1$1');
  7476. // All other backslashes occur literally
  7477. // Quote the whole thing:
  7478. arg = `"${arg}"`;
  7479. // Escape meta chars
  7480. arg = arg.replace(metaCharsRegExp, '^$1');
  7481. // Double escape meta chars if necessary
  7482. if (doubleEscapeMetaChars) {
  7483. arg = arg.replace(metaCharsRegExp, '^$1');
  7484. }
  7485. return arg;
  7486. }
  7487. module.exports.command = escapeCommand;
  7488. module.exports.argument = escapeArgument;
  7489. /***/ }),
  7490. /***/ 463:
  7491. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7492. "use strict";
  7493. Object.defineProperty(exports, '__esModule', { value: true });
  7494. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7495. var deprecation = __webpack_require__(692);
  7496. var once = _interopDefault(__webpack_require__(969));
  7497. const logOnce = once(deprecation => console.warn(deprecation));
  7498. /**
  7499. * Error with extra properties to help with debugging
  7500. */
  7501. class RequestError extends Error {
  7502. constructor(message, statusCode, options) {
  7503. super(message); // Maintains proper stack trace (only available on V8)
  7504. /* istanbul ignore next */
  7505. if (Error.captureStackTrace) {
  7506. Error.captureStackTrace(this, this.constructor);
  7507. }
  7508. this.name = "HttpError";
  7509. this.status = statusCode;
  7510. Object.defineProperty(this, "code", {
  7511. get() {
  7512. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7513. return statusCode;
  7514. }
  7515. });
  7516. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7517. const requestCopy = Object.assign({}, options.request);
  7518. if (options.request.headers.authorization) {
  7519. requestCopy.headers = Object.assign({}, options.request.headers, {
  7520. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7521. });
  7522. }
  7523. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7524. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7525. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7526. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7527. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7528. this.request = requestCopy;
  7529. }
  7530. }
  7531. exports.RequestError = RequestError;
  7532. //# sourceMappingURL=index.js.map
  7533. /***/ }),
  7534. /***/ 464:
  7535. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7536. "use strict";
  7537. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7538. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7539. return new (P || (P = Promise))(function (resolve, reject) {
  7540. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7541. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7542. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7543. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7544. });
  7545. };
  7546. var __importStar = (this && this.__importStar) || function (mod) {
  7547. if (mod && mod.__esModule) return mod;
  7548. var result = {};
  7549. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7550. result["default"] = mod;
  7551. return result;
  7552. };
  7553. var __importDefault = (this && this.__importDefault) || function (mod) {
  7554. return (mod && mod.__esModule) ? mod : { "default": mod };
  7555. };
  7556. Object.defineProperty(exports, "__esModule", { value: true });
  7557. const assert = __importStar(__webpack_require__(357));
  7558. const core = __importStar(__webpack_require__(470));
  7559. const fs = __importStar(__webpack_require__(747));
  7560. const github = __importStar(__webpack_require__(469));
  7561. const io = __importStar(__webpack_require__(1));
  7562. const path = __importStar(__webpack_require__(622));
  7563. const retryHelper = __importStar(__webpack_require__(587));
  7564. const toolCache = __importStar(__webpack_require__(533));
  7565. const v4_1 = __importDefault(__webpack_require__(826));
  7566. const IS_WINDOWS = process.platform === 'win32';
  7567. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  7568. return __awaiter(this, void 0, void 0, function* () {
  7569. // Download the archive
  7570. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7571. core.info('Downloading the archive');
  7572. return yield downloadArchive(authToken, owner, repo, ref, commit);
  7573. }));
  7574. // Write archive to disk
  7575. core.info('Writing archive to disk');
  7576. const uniqueId = v4_1.default();
  7577. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  7578. yield fs.promises.writeFile(archivePath, archiveData);
  7579. archiveData = Buffer.from(''); // Free memory
  7580. // Extract archive
  7581. core.info('Extracting the archive');
  7582. const extractPath = path.join(repositoryPath, uniqueId);
  7583. yield io.mkdirP(extractPath);
  7584. if (IS_WINDOWS) {
  7585. yield toolCache.extractZip(archivePath, extractPath);
  7586. }
  7587. else {
  7588. yield toolCache.extractTar(archivePath, extractPath);
  7589. }
  7590. io.rmRF(archivePath);
  7591. // Determine the path of the repository content. The archive contains
  7592. // a top-level folder and the repository content is inside.
  7593. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7594. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7595. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  7596. core.info(`Resolved version ${archiveVersion}`);
  7597. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  7598. // Move the files
  7599. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  7600. const sourcePath = path.join(tempRepositoryPath, fileName);
  7601. const targetPath = path.join(repositoryPath, fileName);
  7602. if (IS_WINDOWS) {
  7603. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  7604. }
  7605. else {
  7606. yield io.mv(sourcePath, targetPath);
  7607. }
  7608. }
  7609. io.rmRF(extractPath);
  7610. });
  7611. }
  7612. exports.downloadRepository = downloadRepository;
  7613. function downloadArchive(authToken, owner, repo, ref, commit) {
  7614. return __awaiter(this, void 0, void 0, function* () {
  7615. const octokit = new github.GitHub(authToken);
  7616. const params = {
  7617. owner: owner,
  7618. repo: repo,
  7619. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7620. ref: commit || ref
  7621. };
  7622. const response = yield octokit.repos.getArchiveLink(params);
  7623. if (response.status != 200) {
  7624. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  7625. }
  7626. return Buffer.from(response.data); // response.data is ArrayBuffer
  7627. });
  7628. }
  7629. /***/ }),
  7630. /***/ 469:
  7631. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7632. "use strict";
  7633. var __importDefault = (this && this.__importDefault) || function (mod) {
  7634. return (mod && mod.__esModule) ? mod : { "default": mod };
  7635. };
  7636. var __importStar = (this && this.__importStar) || function (mod) {
  7637. if (mod && mod.__esModule) return mod;
  7638. var result = {};
  7639. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7640. result["default"] = mod;
  7641. return result;
  7642. };
  7643. Object.defineProperty(exports, "__esModule", { value: true });
  7644. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7645. const graphql_1 = __webpack_require__(898);
  7646. const rest_1 = __importDefault(__webpack_require__(0));
  7647. const Context = __importStar(__webpack_require__(262));
  7648. const httpClient = __importStar(__webpack_require__(539));
  7649. // We need this in order to extend Octokit
  7650. rest_1.default.prototype = new rest_1.default();
  7651. exports.context = new Context.Context();
  7652. class GitHub extends rest_1.default {
  7653. constructor(token, opts) {
  7654. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  7655. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  7656. }
  7657. /**
  7658. * Disambiguates the constructor overload parameters
  7659. */
  7660. static disambiguate(token, opts) {
  7661. return [
  7662. typeof token === 'string' ? token : '',
  7663. typeof token === 'object' ? token : opts || {}
  7664. ];
  7665. }
  7666. static getOctokitOptions(args) {
  7667. const token = args[0];
  7668. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  7669. // Auth
  7670. const auth = GitHub.getAuthString(token, options);
  7671. if (auth) {
  7672. options.auth = auth;
  7673. }
  7674. // Proxy
  7675. const agent = GitHub.getProxyAgent(options);
  7676. if (agent) {
  7677. // Shallow clone - don't mutate the object provided by the caller
  7678. options.request = options.request ? Object.assign({}, options.request) : {};
  7679. // Set the agent
  7680. options.request.agent = agent;
  7681. }
  7682. return options;
  7683. }
  7684. static getGraphQL(args) {
  7685. const defaults = {};
  7686. const token = args[0];
  7687. const options = args[1];
  7688. // Authorization
  7689. const auth = this.getAuthString(token, options);
  7690. if (auth) {
  7691. defaults.headers = {
  7692. authorization: auth
  7693. };
  7694. }
  7695. // Proxy
  7696. const agent = GitHub.getProxyAgent(options);
  7697. if (agent) {
  7698. defaults.request = { agent };
  7699. }
  7700. return graphql_1.graphql.defaults(defaults);
  7701. }
  7702. static getAuthString(token, options) {
  7703. // Validate args
  7704. if (!token && !options.auth) {
  7705. throw new Error('Parameter token or opts.auth is required');
  7706. }
  7707. else if (token && options.auth) {
  7708. throw new Error('Parameters token and opts.auth may not both be specified');
  7709. }
  7710. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  7711. }
  7712. static getProxyAgent(options) {
  7713. var _a;
  7714. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  7715. const serverUrl = 'https://api.github.com';
  7716. if (httpClient.getProxyUrl(serverUrl)) {
  7717. const hc = new httpClient.HttpClient();
  7718. return hc.getAgent(serverUrl);
  7719. }
  7720. }
  7721. return undefined;
  7722. }
  7723. }
  7724. exports.GitHub = GitHub;
  7725. //# sourceMappingURL=github.js.map
  7726. /***/ }),
  7727. /***/ 470:
  7728. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7729. "use strict";
  7730. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7731. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7732. return new (P || (P = Promise))(function (resolve, reject) {
  7733. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7734. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7735. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7736. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7737. });
  7738. };
  7739. Object.defineProperty(exports, "__esModule", { value: true });
  7740. const command_1 = __webpack_require__(431);
  7741. const os = __webpack_require__(87);
  7742. const path = __webpack_require__(622);
  7743. /**
  7744. * The code to exit an action
  7745. */
  7746. var ExitCode;
  7747. (function (ExitCode) {
  7748. /**
  7749. * A code indicating that the action was successful
  7750. */
  7751. ExitCode[ExitCode["Success"] = 0] = "Success";
  7752. /**
  7753. * A code indicating that the action was a failure
  7754. */
  7755. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  7756. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  7757. //-----------------------------------------------------------------------
  7758. // Variables
  7759. //-----------------------------------------------------------------------
  7760. /**
  7761. * Sets env variable for this action and future actions in the job
  7762. * @param name the name of the variable to set
  7763. * @param val the value of the variable
  7764. */
  7765. function exportVariable(name, val) {
  7766. process.env[name] = val;
  7767. command_1.issueCommand('set-env', { name }, val);
  7768. }
  7769. exports.exportVariable = exportVariable;
  7770. /**
  7771. * Registers a secret which will get masked from logs
  7772. * @param secret value of the secret
  7773. */
  7774. function setSecret(secret) {
  7775. command_1.issueCommand('add-mask', {}, secret);
  7776. }
  7777. exports.setSecret = setSecret;
  7778. /**
  7779. * Prepends inputPath to the PATH (for this action and future actions)
  7780. * @param inputPath
  7781. */
  7782. function addPath(inputPath) {
  7783. command_1.issueCommand('add-path', {}, inputPath);
  7784. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  7785. }
  7786. exports.addPath = addPath;
  7787. /**
  7788. * Gets the value of an input. The value is also trimmed.
  7789. *
  7790. * @param name name of the input to get
  7791. * @param options optional. See InputOptions.
  7792. * @returns string
  7793. */
  7794. function getInput(name, options) {
  7795. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  7796. if (options && options.required && !val) {
  7797. throw new Error(`Input required and not supplied: ${name}`);
  7798. }
  7799. return val.trim();
  7800. }
  7801. exports.getInput = getInput;
  7802. /**
  7803. * Sets the value of an output.
  7804. *
  7805. * @param name name of the output to set
  7806. * @param value value to store
  7807. */
  7808. function setOutput(name, value) {
  7809. command_1.issueCommand('set-output', { name }, value);
  7810. }
  7811. exports.setOutput = setOutput;
  7812. //-----------------------------------------------------------------------
  7813. // Results
  7814. //-----------------------------------------------------------------------
  7815. /**
  7816. * Sets the action status to failed.
  7817. * When the action exits it will be with an exit code of 1
  7818. * @param message add error issue message
  7819. */
  7820. function setFailed(message) {
  7821. process.exitCode = ExitCode.Failure;
  7822. error(message);
  7823. }
  7824. exports.setFailed = setFailed;
  7825. //-----------------------------------------------------------------------
  7826. // Logging Commands
  7827. //-----------------------------------------------------------------------
  7828. /**
  7829. * Writes debug message to user log
  7830. * @param message debug message
  7831. */
  7832. function debug(message) {
  7833. command_1.issueCommand('debug', {}, message);
  7834. }
  7835. exports.debug = debug;
  7836. /**
  7837. * Adds an error issue
  7838. * @param message error issue message
  7839. */
  7840. function error(message) {
  7841. command_1.issue('error', message);
  7842. }
  7843. exports.error = error;
  7844. /**
  7845. * Adds an warning issue
  7846. * @param message warning issue message
  7847. */
  7848. function warning(message) {
  7849. command_1.issue('warning', message);
  7850. }
  7851. exports.warning = warning;
  7852. /**
  7853. * Writes info to log with console.log.
  7854. * @param message info message
  7855. */
  7856. function info(message) {
  7857. process.stdout.write(message + os.EOL);
  7858. }
  7859. exports.info = info;
  7860. /**
  7861. * Begin an output group.
  7862. *
  7863. * Output until the next `groupEnd` will be foldable in this group
  7864. *
  7865. * @param name The name of the output group
  7866. */
  7867. function startGroup(name) {
  7868. command_1.issue('group', name);
  7869. }
  7870. exports.startGroup = startGroup;
  7871. /**
  7872. * End an output group.
  7873. */
  7874. function endGroup() {
  7875. command_1.issue('endgroup');
  7876. }
  7877. exports.endGroup = endGroup;
  7878. /**
  7879. * Wrap an asynchronous function call in a group.
  7880. *
  7881. * Returns the same type as the function itself.
  7882. *
  7883. * @param name The name of the group
  7884. * @param fn The function to wrap in the group
  7885. */
  7886. function group(name, fn) {
  7887. return __awaiter(this, void 0, void 0, function* () {
  7888. startGroup(name);
  7889. let result;
  7890. try {
  7891. result = yield fn();
  7892. }
  7893. finally {
  7894. endGroup();
  7895. }
  7896. return result;
  7897. });
  7898. }
  7899. exports.group = group;
  7900. //# sourceMappingURL=core.js.map
  7901. /***/ }),
  7902. /***/ 471:
  7903. /***/ (function(module, __unusedexports, __webpack_require__) {
  7904. module.exports = authenticationBeforeRequest;
  7905. const btoa = __webpack_require__(675);
  7906. const uniq = __webpack_require__(126);
  7907. function authenticationBeforeRequest(state, options) {
  7908. if (!state.auth.type) {
  7909. return;
  7910. }
  7911. if (state.auth.type === "basic") {
  7912. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  7913. options.headers.authorization = `Basic ${hash}`;
  7914. return;
  7915. }
  7916. if (state.auth.type === "token") {
  7917. options.headers.authorization = `token ${state.auth.token}`;
  7918. return;
  7919. }
  7920. if (state.auth.type === "app") {
  7921. options.headers.authorization = `Bearer ${state.auth.token}`;
  7922. const acceptHeaders = options.headers.accept
  7923. .split(",")
  7924. .concat("application/vnd.github.machine-man-preview+json");
  7925. options.headers.accept = uniq(acceptHeaders)
  7926. .filter(Boolean)
  7927. .join(",");
  7928. return;
  7929. }
  7930. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  7931. if (state.auth.token) {
  7932. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  7933. return;
  7934. }
  7935. const key = encodeURIComponent(state.auth.key);
  7936. const secret = encodeURIComponent(state.auth.secret);
  7937. options.url += `client_id=${key}&client_secret=${secret}`;
  7938. }
  7939. /***/ }),
  7940. /***/ 489:
  7941. /***/ (function(module, __unusedexports, __webpack_require__) {
  7942. "use strict";
  7943. const path = __webpack_require__(622);
  7944. const which = __webpack_require__(814);
  7945. const pathKey = __webpack_require__(39)();
  7946. function resolveCommandAttempt(parsed, withoutPathExt) {
  7947. const cwd = process.cwd();
  7948. const hasCustomCwd = parsed.options.cwd != null;
  7949. // If a custom `cwd` was specified, we need to change the process cwd
  7950. // because `which` will do stat calls but does not support a custom cwd
  7951. if (hasCustomCwd) {
  7952. try {
  7953. process.chdir(parsed.options.cwd);
  7954. } catch (err) {
  7955. /* Empty */
  7956. }
  7957. }
  7958. let resolved;
  7959. try {
  7960. resolved = which.sync(parsed.command, {
  7961. path: (parsed.options.env || process.env)[pathKey],
  7962. pathExt: withoutPathExt ? path.delimiter : undefined,
  7963. });
  7964. } catch (e) {
  7965. /* Empty */
  7966. } finally {
  7967. process.chdir(cwd);
  7968. }
  7969. // If we successfully resolved, ensure that an absolute path is returned
  7970. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  7971. if (resolved) {
  7972. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  7973. }
  7974. return resolved;
  7975. }
  7976. function resolveCommand(parsed) {
  7977. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  7978. }
  7979. module.exports = resolveCommand;
  7980. /***/ }),
  7981. /***/ 510:
  7982. /***/ (function(module) {
  7983. module.exports = addHook
  7984. function addHook (state, kind, name, hook) {
  7985. var orig = hook
  7986. if (!state.registry[name]) {
  7987. state.registry[name] = []
  7988. }
  7989. if (kind === 'before') {
  7990. hook = function (method, options) {
  7991. return Promise.resolve()
  7992. .then(orig.bind(null, options))
  7993. .then(method.bind(null, options))
  7994. }
  7995. }
  7996. if (kind === 'after') {
  7997. hook = function (method, options) {
  7998. var result
  7999. return Promise.resolve()
  8000. .then(method.bind(null, options))
  8001. .then(function (result_) {
  8002. result = result_
  8003. return orig(result, options)
  8004. })
  8005. .then(function () {
  8006. return result
  8007. })
  8008. }
  8009. }
  8010. if (kind === 'error') {
  8011. hook = function (method, options) {
  8012. return Promise.resolve()
  8013. .then(method.bind(null, options))
  8014. .catch(function (error) {
  8015. return orig(error, options)
  8016. })
  8017. }
  8018. }
  8019. state.registry[name].push({
  8020. hook: hook,
  8021. orig: orig
  8022. })
  8023. }
  8024. /***/ }),
  8025. /***/ 523:
  8026. /***/ (function(module, __unusedexports, __webpack_require__) {
  8027. var register = __webpack_require__(363)
  8028. var addHook = __webpack_require__(510)
  8029. var removeHook = __webpack_require__(763)
  8030. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8031. var bind = Function.bind
  8032. var bindable = bind.bind(bind)
  8033. function bindApi (hook, state, name) {
  8034. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8035. hook.api = { remove: removeHookRef }
  8036. hook.remove = removeHookRef
  8037. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8038. var args = name ? [state, kind, name] : [state, kind]
  8039. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8040. })
  8041. }
  8042. function HookSingular () {
  8043. var singularHookName = 'h'
  8044. var singularHookState = {
  8045. registry: {}
  8046. }
  8047. var singularHook = register.bind(null, singularHookState, singularHookName)
  8048. bindApi(singularHook, singularHookState, singularHookName)
  8049. return singularHook
  8050. }
  8051. function HookCollection () {
  8052. var state = {
  8053. registry: {}
  8054. }
  8055. var hook = register.bind(null, state)
  8056. bindApi(hook, state)
  8057. return hook
  8058. }
  8059. var collectionHookDeprecationMessageDisplayed = false
  8060. function Hook () {
  8061. if (!collectionHookDeprecationMessageDisplayed) {
  8062. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8063. collectionHookDeprecationMessageDisplayed = true
  8064. }
  8065. return HookCollection()
  8066. }
  8067. Hook.Singular = HookSingular.bind()
  8068. Hook.Collection = HookCollection.bind()
  8069. module.exports = Hook
  8070. // expose constructors as a named property for TypeScript
  8071. module.exports.Hook = Hook
  8072. module.exports.Singular = Hook.Singular
  8073. module.exports.Collection = Hook.Collection
  8074. /***/ }),
  8075. /***/ 529:
  8076. /***/ (function(module, __unusedexports, __webpack_require__) {
  8077. const factory = __webpack_require__(47);
  8078. module.exports = factory();
  8079. /***/ }),
  8080. /***/ 533:
  8081. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8082. "use strict";
  8083. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8084. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8085. return new (P || (P = Promise))(function (resolve, reject) {
  8086. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8087. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8088. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8089. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8090. });
  8091. };
  8092. Object.defineProperty(exports, "__esModule", { value: true });
  8093. const core = __webpack_require__(470);
  8094. const io = __webpack_require__(1);
  8095. const fs = __webpack_require__(747);
  8096. const os = __webpack_require__(87);
  8097. const path = __webpack_require__(622);
  8098. const httpm = __webpack_require__(874);
  8099. const semver = __webpack_require__(656);
  8100. const uuidV4 = __webpack_require__(826);
  8101. const exec_1 = __webpack_require__(986);
  8102. const assert_1 = __webpack_require__(357);
  8103. class HTTPError extends Error {
  8104. constructor(httpStatusCode) {
  8105. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8106. this.httpStatusCode = httpStatusCode;
  8107. Object.setPrototypeOf(this, new.target.prototype);
  8108. }
  8109. }
  8110. exports.HTTPError = HTTPError;
  8111. const IS_WINDOWS = process.platform === 'win32';
  8112. const userAgent = 'actions/tool-cache';
  8113. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8114. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8115. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8116. // If directories not found, place them in common temp locations
  8117. if (!tempDirectory || !cacheRoot) {
  8118. let baseLocation;
  8119. if (IS_WINDOWS) {
  8120. // On windows use the USERPROFILE env variable
  8121. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8122. }
  8123. else {
  8124. if (process.platform === 'darwin') {
  8125. baseLocation = '/Users';
  8126. }
  8127. else {
  8128. baseLocation = '/home';
  8129. }
  8130. }
  8131. if (!tempDirectory) {
  8132. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8133. }
  8134. if (!cacheRoot) {
  8135. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8136. }
  8137. }
  8138. /**
  8139. * Download a tool from an url and stream it into a file
  8140. *
  8141. * @param url url of tool to download
  8142. * @returns path to downloaded tool
  8143. */
  8144. function downloadTool(url) {
  8145. return __awaiter(this, void 0, void 0, function* () {
  8146. // Wrap in a promise so that we can resolve from within stream callbacks
  8147. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8148. try {
  8149. const http = new httpm.HttpClient(userAgent, [], {
  8150. allowRetries: true,
  8151. maxRetries: 3
  8152. });
  8153. const destPath = path.join(tempDirectory, uuidV4());
  8154. yield io.mkdirP(tempDirectory);
  8155. core.debug(`Downloading ${url}`);
  8156. core.debug(`Downloading ${destPath}`);
  8157. if (fs.existsSync(destPath)) {
  8158. throw new Error(`Destination file path ${destPath} already exists`);
  8159. }
  8160. const response = yield http.get(url);
  8161. if (response.message.statusCode !== 200) {
  8162. const err = new HTTPError(response.message.statusCode);
  8163. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8164. throw err;
  8165. }
  8166. const file = fs.createWriteStream(destPath);
  8167. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8168. try {
  8169. const stream = response.message.pipe(file);
  8170. stream.on('close', () => {
  8171. core.debug('download complete');
  8172. resolve(destPath);
  8173. });
  8174. }
  8175. catch (err) {
  8176. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8177. reject(err);
  8178. }
  8179. }));
  8180. file.on('error', err => {
  8181. file.end();
  8182. reject(err);
  8183. });
  8184. }
  8185. catch (err) {
  8186. reject(err);
  8187. }
  8188. }));
  8189. });
  8190. }
  8191. exports.downloadTool = downloadTool;
  8192. /**
  8193. * Extract a .7z file
  8194. *
  8195. * @param file path to the .7z file
  8196. * @param dest destination directory. Optional.
  8197. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8198. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8199. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8200. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8201. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8202. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8203. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8204. * to 7zr.exe can be pass to this function.
  8205. * @returns path to the destination directory
  8206. */
  8207. function extract7z(file, dest, _7zPath) {
  8208. return __awaiter(this, void 0, void 0, function* () {
  8209. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8210. assert_1.ok(file, 'parameter "file" is required');
  8211. dest = dest || (yield _createExtractFolder(dest));
  8212. const originalCwd = process.cwd();
  8213. process.chdir(dest);
  8214. if (_7zPath) {
  8215. try {
  8216. const args = [
  8217. 'x',
  8218. '-bb1',
  8219. '-bd',
  8220. '-sccUTF-8',
  8221. file
  8222. ];
  8223. const options = {
  8224. silent: true
  8225. };
  8226. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8227. }
  8228. finally {
  8229. process.chdir(originalCwd);
  8230. }
  8231. }
  8232. else {
  8233. const escapedScript = path
  8234. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8235. .replace(/'/g, "''")
  8236. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8237. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8238. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8239. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8240. const args = [
  8241. '-NoLogo',
  8242. '-Sta',
  8243. '-NoProfile',
  8244. '-NonInteractive',
  8245. '-ExecutionPolicy',
  8246. 'Unrestricted',
  8247. '-Command',
  8248. command
  8249. ];
  8250. const options = {
  8251. silent: true
  8252. };
  8253. try {
  8254. const powershellPath = yield io.which('powershell', true);
  8255. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8256. }
  8257. finally {
  8258. process.chdir(originalCwd);
  8259. }
  8260. }
  8261. return dest;
  8262. });
  8263. }
  8264. exports.extract7z = extract7z;
  8265. /**
  8266. * Extract a tar
  8267. *
  8268. * @param file path to the tar
  8269. * @param dest destination directory. Optional.
  8270. * @param flags flags for the tar. Optional.
  8271. * @returns path to the destination directory
  8272. */
  8273. function extractTar(file, dest, flags = 'xz') {
  8274. return __awaiter(this, void 0, void 0, function* () {
  8275. if (!file) {
  8276. throw new Error("parameter 'file' is required");
  8277. }
  8278. dest = dest || (yield _createExtractFolder(dest));
  8279. const tarPath = yield io.which('tar', true);
  8280. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8281. return dest;
  8282. });
  8283. }
  8284. exports.extractTar = extractTar;
  8285. /**
  8286. * Extract a zip
  8287. *
  8288. * @param file path to the zip
  8289. * @param dest destination directory. Optional.
  8290. * @returns path to the destination directory
  8291. */
  8292. function extractZip(file, dest) {
  8293. return __awaiter(this, void 0, void 0, function* () {
  8294. if (!file) {
  8295. throw new Error("parameter 'file' is required");
  8296. }
  8297. dest = dest || (yield _createExtractFolder(dest));
  8298. if (IS_WINDOWS) {
  8299. yield extractZipWin(file, dest);
  8300. }
  8301. else {
  8302. yield extractZipNix(file, dest);
  8303. }
  8304. return dest;
  8305. });
  8306. }
  8307. exports.extractZip = extractZip;
  8308. function extractZipWin(file, dest) {
  8309. return __awaiter(this, void 0, void 0, function* () {
  8310. // build the powershell command
  8311. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8312. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8313. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8314. // run powershell
  8315. const powershellPath = yield io.which('powershell');
  8316. const args = [
  8317. '-NoLogo',
  8318. '-Sta',
  8319. '-NoProfile',
  8320. '-NonInteractive',
  8321. '-ExecutionPolicy',
  8322. 'Unrestricted',
  8323. '-Command',
  8324. command
  8325. ];
  8326. yield exec_1.exec(`"${powershellPath}"`, args);
  8327. });
  8328. }
  8329. function extractZipNix(file, dest) {
  8330. return __awaiter(this, void 0, void 0, function* () {
  8331. const unzipPath = yield io.which('unzip');
  8332. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8333. });
  8334. }
  8335. /**
  8336. * Caches a directory and installs it into the tool cacheDir
  8337. *
  8338. * @param sourceDir the directory to cache into tools
  8339. * @param tool tool name
  8340. * @param version version of the tool. semver format
  8341. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8342. */
  8343. function cacheDir(sourceDir, tool, version, arch) {
  8344. return __awaiter(this, void 0, void 0, function* () {
  8345. version = semver.clean(version) || version;
  8346. arch = arch || os.arch();
  8347. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8348. core.debug(`source dir: ${sourceDir}`);
  8349. if (!fs.statSync(sourceDir).isDirectory()) {
  8350. throw new Error('sourceDir is not a directory');
  8351. }
  8352. // Create the tool dir
  8353. const destPath = yield _createToolPath(tool, version, arch);
  8354. // copy each child item. do not move. move can fail on Windows
  8355. // due to anti-virus software having an open handle on a file.
  8356. for (const itemName of fs.readdirSync(sourceDir)) {
  8357. const s = path.join(sourceDir, itemName);
  8358. yield io.cp(s, destPath, { recursive: true });
  8359. }
  8360. // write .complete
  8361. _completeToolPath(tool, version, arch);
  8362. return destPath;
  8363. });
  8364. }
  8365. exports.cacheDir = cacheDir;
  8366. /**
  8367. * Caches a downloaded file (GUID) and installs it
  8368. * into the tool cache with a given targetName
  8369. *
  8370. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8371. * @param targetFile the name of the file name in the tools directory
  8372. * @param tool tool name
  8373. * @param version version of the tool. semver format
  8374. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8375. */
  8376. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8377. return __awaiter(this, void 0, void 0, function* () {
  8378. version = semver.clean(version) || version;
  8379. arch = arch || os.arch();
  8380. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8381. core.debug(`source file: ${sourceFile}`);
  8382. if (!fs.statSync(sourceFile).isFile()) {
  8383. throw new Error('sourceFile is not a file');
  8384. }
  8385. // create the tool dir
  8386. const destFolder = yield _createToolPath(tool, version, arch);
  8387. // copy instead of move. move can fail on Windows due to
  8388. // anti-virus software having an open handle on a file.
  8389. const destPath = path.join(destFolder, targetFile);
  8390. core.debug(`destination file ${destPath}`);
  8391. yield io.cp(sourceFile, destPath);
  8392. // write .complete
  8393. _completeToolPath(tool, version, arch);
  8394. return destFolder;
  8395. });
  8396. }
  8397. exports.cacheFile = cacheFile;
  8398. /**
  8399. * Finds the path to a tool version in the local installed tool cache
  8400. *
  8401. * @param toolName name of the tool
  8402. * @param versionSpec version of the tool
  8403. * @param arch optional arch. defaults to arch of computer
  8404. */
  8405. function find(toolName, versionSpec, arch) {
  8406. if (!toolName) {
  8407. throw new Error('toolName parameter is required');
  8408. }
  8409. if (!versionSpec) {
  8410. throw new Error('versionSpec parameter is required');
  8411. }
  8412. arch = arch || os.arch();
  8413. // attempt to resolve an explicit version
  8414. if (!_isExplicitVersion(versionSpec)) {
  8415. const localVersions = findAllVersions(toolName, arch);
  8416. const match = _evaluateVersions(localVersions, versionSpec);
  8417. versionSpec = match;
  8418. }
  8419. // check for the explicit version in the cache
  8420. let toolPath = '';
  8421. if (versionSpec) {
  8422. versionSpec = semver.clean(versionSpec) || '';
  8423. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8424. core.debug(`checking cache: ${cachePath}`);
  8425. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8426. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8427. toolPath = cachePath;
  8428. }
  8429. else {
  8430. core.debug('not found');
  8431. }
  8432. }
  8433. return toolPath;
  8434. }
  8435. exports.find = find;
  8436. /**
  8437. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8438. *
  8439. * @param toolName name of the tool
  8440. * @param arch optional arch. defaults to arch of computer
  8441. */
  8442. function findAllVersions(toolName, arch) {
  8443. const versions = [];
  8444. arch = arch || os.arch();
  8445. const toolPath = path.join(cacheRoot, toolName);
  8446. if (fs.existsSync(toolPath)) {
  8447. const children = fs.readdirSync(toolPath);
  8448. for (const child of children) {
  8449. if (_isExplicitVersion(child)) {
  8450. const fullPath = path.join(toolPath, child, arch || '');
  8451. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8452. versions.push(child);
  8453. }
  8454. }
  8455. }
  8456. }
  8457. return versions;
  8458. }
  8459. exports.findAllVersions = findAllVersions;
  8460. function _createExtractFolder(dest) {
  8461. return __awaiter(this, void 0, void 0, function* () {
  8462. if (!dest) {
  8463. // create a temp dir
  8464. dest = path.join(tempDirectory, uuidV4());
  8465. }
  8466. yield io.mkdirP(dest);
  8467. return dest;
  8468. });
  8469. }
  8470. function _createToolPath(tool, version, arch) {
  8471. return __awaiter(this, void 0, void 0, function* () {
  8472. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8473. core.debug(`destination ${folderPath}`);
  8474. const markerPath = `${folderPath}.complete`;
  8475. yield io.rmRF(folderPath);
  8476. yield io.rmRF(markerPath);
  8477. yield io.mkdirP(folderPath);
  8478. return folderPath;
  8479. });
  8480. }
  8481. function _completeToolPath(tool, version, arch) {
  8482. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8483. const markerPath = `${folderPath}.complete`;
  8484. fs.writeFileSync(markerPath, '');
  8485. core.debug('finished caching tool');
  8486. }
  8487. function _isExplicitVersion(versionSpec) {
  8488. const c = semver.clean(versionSpec) || '';
  8489. core.debug(`isExplicit: ${c}`);
  8490. const valid = semver.valid(c) != null;
  8491. core.debug(`explicit? ${valid}`);
  8492. return valid;
  8493. }
  8494. function _evaluateVersions(versions, versionSpec) {
  8495. let version = '';
  8496. core.debug(`evaluating ${versions.length} versions`);
  8497. versions = versions.sort((a, b) => {
  8498. if (semver.gt(a, b)) {
  8499. return 1;
  8500. }
  8501. return -1;
  8502. });
  8503. for (let i = versions.length - 1; i >= 0; i--) {
  8504. const potential = versions[i];
  8505. const satisfied = semver.satisfies(potential, versionSpec);
  8506. if (satisfied) {
  8507. version = potential;
  8508. break;
  8509. }
  8510. }
  8511. if (version) {
  8512. core.debug(`matched: ${version}`);
  8513. }
  8514. else {
  8515. core.debug('match not found');
  8516. }
  8517. return version;
  8518. }
  8519. //# sourceMappingURL=tool-cache.js.map
  8520. /***/ }),
  8521. /***/ 536:
  8522. /***/ (function(module, __unusedexports, __webpack_require__) {
  8523. module.exports = hasFirstPage
  8524. const deprecate = __webpack_require__(370)
  8525. const getPageLinks = __webpack_require__(577)
  8526. function hasFirstPage (link) {
  8527. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8528. return getPageLinks(link).first
  8529. }
  8530. /***/ }),
  8531. /***/ 539:
  8532. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8533. "use strict";
  8534. Object.defineProperty(exports, "__esModule", { value: true });
  8535. const url = __webpack_require__(835);
  8536. const http = __webpack_require__(605);
  8537. const https = __webpack_require__(211);
  8538. const pm = __webpack_require__(950);
  8539. let tunnel;
  8540. var HttpCodes;
  8541. (function (HttpCodes) {
  8542. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  8543. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  8544. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  8545. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  8546. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  8547. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  8548. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  8549. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  8550. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  8551. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  8552. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  8553. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  8554. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  8555. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  8556. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  8557. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  8558. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  8559. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  8560. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  8561. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  8562. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  8563. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  8564. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  8565. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  8566. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  8567. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  8568. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  8569. /**
  8570. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  8571. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  8572. */
  8573. function getProxyUrl(serverUrl) {
  8574. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  8575. return proxyUrl ? proxyUrl.href : '';
  8576. }
  8577. exports.getProxyUrl = getProxyUrl;
  8578. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  8579. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  8580. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  8581. const ExponentialBackoffCeiling = 10;
  8582. const ExponentialBackoffTimeSlice = 5;
  8583. class HttpClientResponse {
  8584. constructor(message) {
  8585. this.message = message;
  8586. }
  8587. readBody() {
  8588. return new Promise(async (resolve, reject) => {
  8589. let output = Buffer.alloc(0);
  8590. this.message.on('data', (chunk) => {
  8591. output = Buffer.concat([output, chunk]);
  8592. });
  8593. this.message.on('end', () => {
  8594. resolve(output.toString());
  8595. });
  8596. });
  8597. }
  8598. }
  8599. exports.HttpClientResponse = HttpClientResponse;
  8600. function isHttps(requestUrl) {
  8601. let parsedUrl = url.parse(requestUrl);
  8602. return parsedUrl.protocol === 'https:';
  8603. }
  8604. exports.isHttps = isHttps;
  8605. class HttpClient {
  8606. constructor(userAgent, handlers, requestOptions) {
  8607. this._ignoreSslError = false;
  8608. this._allowRedirects = true;
  8609. this._allowRedirectDowngrade = false;
  8610. this._maxRedirects = 50;
  8611. this._allowRetries = false;
  8612. this._maxRetries = 1;
  8613. this._keepAlive = false;
  8614. this._disposed = false;
  8615. this.userAgent = userAgent;
  8616. this.handlers = handlers || [];
  8617. this.requestOptions = requestOptions;
  8618. if (requestOptions) {
  8619. if (requestOptions.ignoreSslError != null) {
  8620. this._ignoreSslError = requestOptions.ignoreSslError;
  8621. }
  8622. this._socketTimeout = requestOptions.socketTimeout;
  8623. if (requestOptions.allowRedirects != null) {
  8624. this._allowRedirects = requestOptions.allowRedirects;
  8625. }
  8626. if (requestOptions.allowRedirectDowngrade != null) {
  8627. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  8628. }
  8629. if (requestOptions.maxRedirects != null) {
  8630. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  8631. }
  8632. if (requestOptions.keepAlive != null) {
  8633. this._keepAlive = requestOptions.keepAlive;
  8634. }
  8635. if (requestOptions.allowRetries != null) {
  8636. this._allowRetries = requestOptions.allowRetries;
  8637. }
  8638. if (requestOptions.maxRetries != null) {
  8639. this._maxRetries = requestOptions.maxRetries;
  8640. }
  8641. }
  8642. }
  8643. options(requestUrl, additionalHeaders) {
  8644. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  8645. }
  8646. get(requestUrl, additionalHeaders) {
  8647. return this.request('GET', requestUrl, null, additionalHeaders || {});
  8648. }
  8649. del(requestUrl, additionalHeaders) {
  8650. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  8651. }
  8652. post(requestUrl, data, additionalHeaders) {
  8653. return this.request('POST', requestUrl, data, additionalHeaders || {});
  8654. }
  8655. patch(requestUrl, data, additionalHeaders) {
  8656. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  8657. }
  8658. put(requestUrl, data, additionalHeaders) {
  8659. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  8660. }
  8661. head(requestUrl, additionalHeaders) {
  8662. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  8663. }
  8664. sendStream(verb, requestUrl, stream, additionalHeaders) {
  8665. return this.request(verb, requestUrl, stream, additionalHeaders);
  8666. }
  8667. /**
  8668. * Makes a raw http request.
  8669. * All other methods such as get, post, patch, and request ultimately call this.
  8670. * Prefer get, del, post and patch
  8671. */
  8672. async request(verb, requestUrl, data, headers) {
  8673. if (this._disposed) {
  8674. throw new Error("Client has already been disposed.");
  8675. }
  8676. let parsedUrl = url.parse(requestUrl);
  8677. let info = this._prepareRequest(verb, parsedUrl, headers);
  8678. // Only perform retries on reads since writes may not be idempotent.
  8679. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  8680. let numTries = 0;
  8681. let response;
  8682. while (numTries < maxTries) {
  8683. response = await this.requestRaw(info, data);
  8684. // Check if it's an authentication challenge
  8685. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  8686. let authenticationHandler;
  8687. for (let i = 0; i < this.handlers.length; i++) {
  8688. if (this.handlers[i].canHandleAuthentication(response)) {
  8689. authenticationHandler = this.handlers[i];
  8690. break;
  8691. }
  8692. }
  8693. if (authenticationHandler) {
  8694. return authenticationHandler.handleAuthentication(this, info, data);
  8695. }
  8696. else {
  8697. // We have received an unauthorized response but have no handlers to handle it.
  8698. // Let the response return to the caller.
  8699. return response;
  8700. }
  8701. }
  8702. let redirectsRemaining = this._maxRedirects;
  8703. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  8704. && this._allowRedirects
  8705. && redirectsRemaining > 0) {
  8706. const redirectUrl = response.message.headers["location"];
  8707. if (!redirectUrl) {
  8708. // if there's no location to redirect to, we won't
  8709. break;
  8710. }
  8711. let parsedRedirectUrl = url.parse(redirectUrl);
  8712. if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
  8713. 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.");
  8714. }
  8715. // we need to finish reading the response before reassigning response
  8716. // which will leak the open socket.
  8717. await response.readBody();
  8718. // let's make the request with the new redirectUrl
  8719. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  8720. response = await this.requestRaw(info, data);
  8721. redirectsRemaining--;
  8722. }
  8723. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  8724. // If not a retry code, return immediately instead of retrying
  8725. return response;
  8726. }
  8727. numTries += 1;
  8728. if (numTries < maxTries) {
  8729. await response.readBody();
  8730. await this._performExponentialBackoff(numTries);
  8731. }
  8732. }
  8733. return response;
  8734. }
  8735. /**
  8736. * Needs to be called if keepAlive is set to true in request options.
  8737. */
  8738. dispose() {
  8739. if (this._agent) {
  8740. this._agent.destroy();
  8741. }
  8742. this._disposed = true;
  8743. }
  8744. /**
  8745. * Raw request.
  8746. * @param info
  8747. * @param data
  8748. */
  8749. requestRaw(info, data) {
  8750. return new Promise((resolve, reject) => {
  8751. let callbackForResult = function (err, res) {
  8752. if (err) {
  8753. reject(err);
  8754. }
  8755. resolve(res);
  8756. };
  8757. this.requestRawWithCallback(info, data, callbackForResult);
  8758. });
  8759. }
  8760. /**
  8761. * Raw request with callback.
  8762. * @param info
  8763. * @param data
  8764. * @param onResult
  8765. */
  8766. requestRawWithCallback(info, data, onResult) {
  8767. let socket;
  8768. if (typeof (data) === 'string') {
  8769. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  8770. }
  8771. let callbackCalled = false;
  8772. let handleResult = (err, res) => {
  8773. if (!callbackCalled) {
  8774. callbackCalled = true;
  8775. onResult(err, res);
  8776. }
  8777. };
  8778. let req = info.httpModule.request(info.options, (msg) => {
  8779. let res = new HttpClientResponse(msg);
  8780. handleResult(null, res);
  8781. });
  8782. req.on('socket', (sock) => {
  8783. socket = sock;
  8784. });
  8785. // If we ever get disconnected, we want the socket to timeout eventually
  8786. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  8787. if (socket) {
  8788. socket.end();
  8789. }
  8790. handleResult(new Error('Request timeout: ' + info.options.path), null);
  8791. });
  8792. req.on('error', function (err) {
  8793. // err has statusCode property
  8794. // res should have headers
  8795. handleResult(err, null);
  8796. });
  8797. if (data && typeof (data) === 'string') {
  8798. req.write(data, 'utf8');
  8799. }
  8800. if (data && typeof (data) !== 'string') {
  8801. data.on('close', function () {
  8802. req.end();
  8803. });
  8804. data.pipe(req);
  8805. }
  8806. else {
  8807. req.end();
  8808. }
  8809. }
  8810. /**
  8811. * Gets an http agent. This function is useful when you need an http agent that handles
  8812. * routing through a proxy server - depending upon the url and proxy environment variables.
  8813. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  8814. */
  8815. getAgent(serverUrl) {
  8816. let parsedUrl = url.parse(serverUrl);
  8817. return this._getAgent(parsedUrl);
  8818. }
  8819. _prepareRequest(method, requestUrl, headers) {
  8820. const info = {};
  8821. info.parsedUrl = requestUrl;
  8822. const usingSsl = info.parsedUrl.protocol === 'https:';
  8823. info.httpModule = usingSsl ? https : http;
  8824. const defaultPort = usingSsl ? 443 : 80;
  8825. info.options = {};
  8826. info.options.host = info.parsedUrl.hostname;
  8827. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  8828. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  8829. info.options.method = method;
  8830. info.options.headers = this._mergeHeaders(headers);
  8831. if (this.userAgent != null) {
  8832. info.options.headers["user-agent"] = this.userAgent;
  8833. }
  8834. info.options.agent = this._getAgent(info.parsedUrl);
  8835. // gives handlers an opportunity to participate
  8836. if (this.handlers) {
  8837. this.handlers.forEach((handler) => {
  8838. handler.prepareRequest(info.options);
  8839. });
  8840. }
  8841. return info;
  8842. }
  8843. _mergeHeaders(headers) {
  8844. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  8845. if (this.requestOptions && this.requestOptions.headers) {
  8846. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  8847. }
  8848. return lowercaseKeys(headers || {});
  8849. }
  8850. _getAgent(parsedUrl) {
  8851. let agent;
  8852. let proxyUrl = pm.getProxyUrl(parsedUrl);
  8853. let useProxy = proxyUrl && proxyUrl.hostname;
  8854. if (this._keepAlive && useProxy) {
  8855. agent = this._proxyAgent;
  8856. }
  8857. if (this._keepAlive && !useProxy) {
  8858. agent = this._agent;
  8859. }
  8860. // if agent is already assigned use that agent.
  8861. if (!!agent) {
  8862. return agent;
  8863. }
  8864. const usingSsl = parsedUrl.protocol === 'https:';
  8865. let maxSockets = 100;
  8866. if (!!this.requestOptions) {
  8867. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  8868. }
  8869. if (useProxy) {
  8870. // If using proxy, need tunnel
  8871. if (!tunnel) {
  8872. tunnel = __webpack_require__(335);
  8873. }
  8874. const agentOptions = {
  8875. maxSockets: maxSockets,
  8876. keepAlive: this._keepAlive,
  8877. proxy: {
  8878. proxyAuth: proxyUrl.auth,
  8879. host: proxyUrl.hostname,
  8880. port: proxyUrl.port
  8881. },
  8882. };
  8883. let tunnelAgent;
  8884. const overHttps = proxyUrl.protocol === 'https:';
  8885. if (usingSsl) {
  8886. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  8887. }
  8888. else {
  8889. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  8890. }
  8891. agent = tunnelAgent(agentOptions);
  8892. this._proxyAgent = agent;
  8893. }
  8894. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  8895. if (this._keepAlive && !agent) {
  8896. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  8897. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  8898. this._agent = agent;
  8899. }
  8900. // if not using private agent and tunnel agent isn't setup then use global agent
  8901. if (!agent) {
  8902. agent = usingSsl ? https.globalAgent : http.globalAgent;
  8903. }
  8904. if (usingSsl && this._ignoreSslError) {
  8905. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  8906. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  8907. // we have to cast it to any and change it directly
  8908. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  8909. }
  8910. return agent;
  8911. }
  8912. _performExponentialBackoff(retryNumber) {
  8913. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  8914. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  8915. return new Promise(resolve => setTimeout(() => resolve(), ms));
  8916. }
  8917. }
  8918. exports.HttpClient = HttpClient;
  8919. /***/ }),
  8920. /***/ 550:
  8921. /***/ (function(module, __unusedexports, __webpack_require__) {
  8922. module.exports = getNextPage
  8923. const getPage = __webpack_require__(265)
  8924. function getNextPage (octokit, link, headers) {
  8925. return getPage(octokit, link, 'next', headers)
  8926. }
  8927. /***/ }),
  8928. /***/ 558:
  8929. /***/ (function(module, __unusedexports, __webpack_require__) {
  8930. module.exports = hasPreviousPage
  8931. const deprecate = __webpack_require__(370)
  8932. const getPageLinks = __webpack_require__(577)
  8933. function hasPreviousPage (link) {
  8934. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8935. return getPageLinks(link).prev
  8936. }
  8937. /***/ }),
  8938. /***/ 559:
  8939. /***/ (function(__unusedmodule, exports) {
  8940. "use strict";
  8941. Object.defineProperty(exports, "__esModule", { value: true });
  8942. class GitVersion {
  8943. /**
  8944. * Used for comparing the version of git and git-lfs against the minimum required version
  8945. * @param version the version string, e.g. 1.2 or 1.2.3
  8946. */
  8947. constructor(version) {
  8948. this.major = NaN;
  8949. this.minor = NaN;
  8950. this.patch = NaN;
  8951. if (version) {
  8952. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  8953. if (match) {
  8954. this.major = Number(match[1]);
  8955. this.minor = Number(match[2]);
  8956. if (match[4]) {
  8957. this.patch = Number(match[4]);
  8958. }
  8959. }
  8960. }
  8961. }
  8962. /**
  8963. * Compares the instance against a minimum required version
  8964. * @param minimum Minimum version
  8965. */
  8966. checkMinimum(minimum) {
  8967. if (!minimum.isValid()) {
  8968. throw new Error('Arg minimum is not a valid version');
  8969. }
  8970. // Major is insufficient
  8971. if (this.major < minimum.major) {
  8972. return false;
  8973. }
  8974. // Major is equal
  8975. if (this.major === minimum.major) {
  8976. // Minor is insufficient
  8977. if (this.minor < minimum.minor) {
  8978. return false;
  8979. }
  8980. // Minor is equal
  8981. if (this.minor === minimum.minor) {
  8982. // Patch is insufficient
  8983. if (this.patch && this.patch < (minimum.patch || 0)) {
  8984. return false;
  8985. }
  8986. }
  8987. }
  8988. return true;
  8989. }
  8990. /**
  8991. * Indicates whether the instance was constructed from a valid version string
  8992. */
  8993. isValid() {
  8994. return !isNaN(this.major);
  8995. }
  8996. /**
  8997. * Returns the version as a string, e.g. 1.2 or 1.2.3
  8998. */
  8999. toString() {
  9000. let result = '';
  9001. if (this.isValid()) {
  9002. result = `${this.major}.${this.minor}`;
  9003. if (!isNaN(this.patch)) {
  9004. result += `.${this.patch}`;
  9005. }
  9006. }
  9007. return result;
  9008. }
  9009. }
  9010. exports.GitVersion = GitVersion;
  9011. /***/ }),
  9012. /***/ 562:
  9013. /***/ (function(module, __unusedexports, __webpack_require__) {
  9014. var once = __webpack_require__(969);
  9015. var noop = function() {};
  9016. var isRequest = function(stream) {
  9017. return stream.setHeader && typeof stream.abort === 'function';
  9018. };
  9019. var isChildProcess = function(stream) {
  9020. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9021. };
  9022. var eos = function(stream, opts, callback) {
  9023. if (typeof opts === 'function') return eos(stream, null, opts);
  9024. if (!opts) opts = {};
  9025. callback = once(callback || noop);
  9026. var ws = stream._writableState;
  9027. var rs = stream._readableState;
  9028. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9029. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9030. var cancelled = false;
  9031. var onlegacyfinish = function() {
  9032. if (!stream.writable) onfinish();
  9033. };
  9034. var onfinish = function() {
  9035. writable = false;
  9036. if (!readable) callback.call(stream);
  9037. };
  9038. var onend = function() {
  9039. readable = false;
  9040. if (!writable) callback.call(stream);
  9041. };
  9042. var onexit = function(exitCode) {
  9043. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9044. };
  9045. var onerror = function(err) {
  9046. callback.call(stream, err);
  9047. };
  9048. var onclose = function() {
  9049. process.nextTick(onclosenexttick);
  9050. };
  9051. var onclosenexttick = function() {
  9052. if (cancelled) return;
  9053. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9054. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9055. };
  9056. var onrequest = function() {
  9057. stream.req.on('finish', onfinish);
  9058. };
  9059. if (isRequest(stream)) {
  9060. stream.on('complete', onfinish);
  9061. stream.on('abort', onclose);
  9062. if (stream.req) onrequest();
  9063. else stream.on('request', onrequest);
  9064. } else if (writable && !ws) { // legacy streams
  9065. stream.on('end', onlegacyfinish);
  9066. stream.on('close', onlegacyfinish);
  9067. }
  9068. if (isChildProcess(stream)) stream.on('exit', onexit);
  9069. stream.on('end', onend);
  9070. stream.on('finish', onfinish);
  9071. if (opts.error !== false) stream.on('error', onerror);
  9072. stream.on('close', onclose);
  9073. return function() {
  9074. cancelled = true;
  9075. stream.removeListener('complete', onfinish);
  9076. stream.removeListener('abort', onclose);
  9077. stream.removeListener('request', onrequest);
  9078. if (stream.req) stream.req.removeListener('finish', onfinish);
  9079. stream.removeListener('end', onlegacyfinish);
  9080. stream.removeListener('close', onlegacyfinish);
  9081. stream.removeListener('finish', onfinish);
  9082. stream.removeListener('exit', onexit);
  9083. stream.removeListener('end', onend);
  9084. stream.removeListener('error', onerror);
  9085. stream.removeListener('close', onclose);
  9086. };
  9087. };
  9088. module.exports = eos;
  9089. /***/ }),
  9090. /***/ 563:
  9091. /***/ (function(module, __unusedexports, __webpack_require__) {
  9092. module.exports = getPreviousPage
  9093. const getPage = __webpack_require__(265)
  9094. function getPreviousPage (octokit, link, headers) {
  9095. return getPage(octokit, link, 'prev', headers)
  9096. }
  9097. /***/ }),
  9098. /***/ 568:
  9099. /***/ (function(module, __unusedexports, __webpack_require__) {
  9100. "use strict";
  9101. const path = __webpack_require__(622);
  9102. const niceTry = __webpack_require__(948);
  9103. const resolveCommand = __webpack_require__(489);
  9104. const escape = __webpack_require__(462);
  9105. const readShebang = __webpack_require__(389);
  9106. const semver = __webpack_require__(280);
  9107. const isWin = process.platform === 'win32';
  9108. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9109. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9110. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9111. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9112. function detectShebang(parsed) {
  9113. parsed.file = resolveCommand(parsed);
  9114. const shebang = parsed.file && readShebang(parsed.file);
  9115. if (shebang) {
  9116. parsed.args.unshift(parsed.file);
  9117. parsed.command = shebang;
  9118. return resolveCommand(parsed);
  9119. }
  9120. return parsed.file;
  9121. }
  9122. function parseNonShell(parsed) {
  9123. if (!isWin) {
  9124. return parsed;
  9125. }
  9126. // Detect & add support for shebangs
  9127. const commandFile = detectShebang(parsed);
  9128. // We don't need a shell if the command filename is an executable
  9129. const needsShell = !isExecutableRegExp.test(commandFile);
  9130. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9131. // Note that `forceShell` is an hidden option used only in tests
  9132. if (parsed.options.forceShell || needsShell) {
  9133. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9134. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9135. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9136. // we need to double escape them
  9137. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9138. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9139. // This is necessary otherwise it will always fail with ENOENT in those cases
  9140. parsed.command = path.normalize(parsed.command);
  9141. // Escape command & arguments
  9142. parsed.command = escape.command(parsed.command);
  9143. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9144. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9145. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9146. parsed.command = process.env.comspec || 'cmd.exe';
  9147. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9148. }
  9149. return parsed;
  9150. }
  9151. function parseShell(parsed) {
  9152. // If node supports the shell option, there's no need to mimic its behavior
  9153. if (supportsShellOption) {
  9154. return parsed;
  9155. }
  9156. // Mimic node shell option
  9157. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9158. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9159. if (isWin) {
  9160. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9161. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9162. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9163. } else {
  9164. if (typeof parsed.options.shell === 'string') {
  9165. parsed.command = parsed.options.shell;
  9166. } else if (process.platform === 'android') {
  9167. parsed.command = '/system/bin/sh';
  9168. } else {
  9169. parsed.command = '/bin/sh';
  9170. }
  9171. parsed.args = ['-c', shellCommand];
  9172. }
  9173. return parsed;
  9174. }
  9175. function parse(command, args, options) {
  9176. // Normalize arguments, similar to nodejs
  9177. if (args && !Array.isArray(args)) {
  9178. options = args;
  9179. args = null;
  9180. }
  9181. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9182. options = Object.assign({}, options); // Clone object to avoid changing the original
  9183. // Build our parsed object
  9184. const parsed = {
  9185. command,
  9186. args,
  9187. options,
  9188. file: undefined,
  9189. original: {
  9190. command,
  9191. args,
  9192. },
  9193. };
  9194. // Delegate further parsing to shell or non-shell
  9195. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9196. }
  9197. module.exports = parse;
  9198. /***/ }),
  9199. /***/ 577:
  9200. /***/ (function(module) {
  9201. module.exports = getPageLinks
  9202. function getPageLinks (link) {
  9203. link = link.link || link.headers.link || ''
  9204. const links = {}
  9205. // link format:
  9206. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9207. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9208. links[type] = uri
  9209. })
  9210. return links
  9211. }
  9212. /***/ }),
  9213. /***/ 586:
  9214. /***/ (function(module, __unusedexports, __webpack_require__) {
  9215. module.exports = octokitRestApiEndpoints;
  9216. const ROUTES = __webpack_require__(705);
  9217. function octokitRestApiEndpoints(octokit) {
  9218. // Aliasing scopes for backward compatibility
  9219. // See https://github.com/octokit/rest.js/pull/1134
  9220. ROUTES.gitdata = ROUTES.git;
  9221. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9222. ROUTES.pullRequests = ROUTES.pulls;
  9223. octokit.registerEndpoints(ROUTES);
  9224. }
  9225. /***/ }),
  9226. /***/ 587:
  9227. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9228. "use strict";
  9229. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9230. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9231. return new (P || (P = Promise))(function (resolve, reject) {
  9232. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9233. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9234. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9235. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9236. });
  9237. };
  9238. var __importStar = (this && this.__importStar) || function (mod) {
  9239. if (mod && mod.__esModule) return mod;
  9240. var result = {};
  9241. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9242. result["default"] = mod;
  9243. return result;
  9244. };
  9245. Object.defineProperty(exports, "__esModule", { value: true });
  9246. const core = __importStar(__webpack_require__(470));
  9247. const defaultMaxAttempts = 3;
  9248. const defaultMinSeconds = 10;
  9249. const defaultMaxSeconds = 20;
  9250. class RetryHelper {
  9251. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9252. this.maxAttempts = maxAttempts;
  9253. this.minSeconds = Math.floor(minSeconds);
  9254. this.maxSeconds = Math.floor(maxSeconds);
  9255. if (this.minSeconds > this.maxSeconds) {
  9256. throw new Error('min seconds should be less than or equal to max seconds');
  9257. }
  9258. }
  9259. execute(action) {
  9260. return __awaiter(this, void 0, void 0, function* () {
  9261. let attempt = 1;
  9262. while (attempt < this.maxAttempts) {
  9263. // Try
  9264. try {
  9265. return yield action();
  9266. }
  9267. catch (err) {
  9268. core.info(err.message);
  9269. }
  9270. // Sleep
  9271. const seconds = this.getSleepAmount();
  9272. core.info(`Waiting ${seconds} seconds before trying again`);
  9273. yield this.sleep(seconds);
  9274. attempt++;
  9275. }
  9276. // Last attempt
  9277. return yield action();
  9278. });
  9279. }
  9280. getSleepAmount() {
  9281. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9282. this.minSeconds);
  9283. }
  9284. sleep(seconds) {
  9285. return __awaiter(this, void 0, void 0, function* () {
  9286. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9287. });
  9288. }
  9289. }
  9290. exports.RetryHelper = RetryHelper;
  9291. function execute(action) {
  9292. return __awaiter(this, void 0, void 0, function* () {
  9293. const retryHelper = new RetryHelper();
  9294. return yield retryHelper.execute(action);
  9295. });
  9296. }
  9297. exports.execute = execute;
  9298. /***/ }),
  9299. /***/ 605:
  9300. /***/ (function(module) {
  9301. module.exports = require("http");
  9302. /***/ }),
  9303. /***/ 614:
  9304. /***/ (function(module) {
  9305. module.exports = require("events");
  9306. /***/ }),
  9307. /***/ 618:
  9308. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9309. "use strict";
  9310. var __importStar = (this && this.__importStar) || function (mod) {
  9311. if (mod && mod.__esModule) return mod;
  9312. var result = {};
  9313. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9314. result["default"] = mod;
  9315. return result;
  9316. };
  9317. Object.defineProperty(exports, "__esModule", { value: true });
  9318. const fs = __importStar(__webpack_require__(747));
  9319. function directoryExistsSync(path, required) {
  9320. if (!path) {
  9321. throw new Error("Arg 'path' must not be empty");
  9322. }
  9323. let stats;
  9324. try {
  9325. stats = fs.statSync(path);
  9326. }
  9327. catch (error) {
  9328. if (error.code === 'ENOENT') {
  9329. if (!required) {
  9330. return false;
  9331. }
  9332. throw new Error(`Directory '${path}' does not exist`);
  9333. }
  9334. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9335. }
  9336. if (stats.isDirectory()) {
  9337. return true;
  9338. }
  9339. else if (!required) {
  9340. return false;
  9341. }
  9342. throw new Error(`Directory '${path}' does not exist`);
  9343. }
  9344. exports.directoryExistsSync = directoryExistsSync;
  9345. function existsSync(path) {
  9346. if (!path) {
  9347. throw new Error("Arg 'path' must not be empty");
  9348. }
  9349. try {
  9350. fs.statSync(path);
  9351. }
  9352. catch (error) {
  9353. if (error.code === 'ENOENT') {
  9354. return false;
  9355. }
  9356. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9357. }
  9358. return true;
  9359. }
  9360. exports.existsSync = existsSync;
  9361. function fileExistsSync(path) {
  9362. if (!path) {
  9363. throw new Error("Arg 'path' must not be empty");
  9364. }
  9365. let stats;
  9366. try {
  9367. stats = fs.statSync(path);
  9368. }
  9369. catch (error) {
  9370. if (error.code === 'ENOENT') {
  9371. return false;
  9372. }
  9373. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9374. }
  9375. if (!stats.isDirectory()) {
  9376. return true;
  9377. }
  9378. return false;
  9379. }
  9380. exports.fileExistsSync = fileExistsSync;
  9381. /***/ }),
  9382. /***/ 621:
  9383. /***/ (function(module, __unusedexports, __webpack_require__) {
  9384. "use strict";
  9385. const path = __webpack_require__(622);
  9386. const pathKey = __webpack_require__(39);
  9387. module.exports = opts => {
  9388. opts = Object.assign({
  9389. cwd: process.cwd(),
  9390. path: process.env[pathKey()]
  9391. }, opts);
  9392. let prev;
  9393. let pth = path.resolve(opts.cwd);
  9394. const ret = [];
  9395. while (prev !== pth) {
  9396. ret.push(path.join(pth, 'node_modules/.bin'));
  9397. prev = pth;
  9398. pth = path.resolve(pth, '..');
  9399. }
  9400. // ensure the running `node` binary is used
  9401. ret.push(path.dirname(process.execPath));
  9402. return ret.concat(opts.path).join(path.delimiter);
  9403. };
  9404. module.exports.env = opts => {
  9405. opts = Object.assign({
  9406. env: process.env
  9407. }, opts);
  9408. const env = Object.assign({}, opts.env);
  9409. const path = pathKey({env});
  9410. opts.path = env[path];
  9411. env[path] = module.exports(opts);
  9412. return env;
  9413. };
  9414. /***/ }),
  9415. /***/ 622:
  9416. /***/ (function(module) {
  9417. module.exports = require("path");
  9418. /***/ }),
  9419. /***/ 631:
  9420. /***/ (function(module) {
  9421. module.exports = require("net");
  9422. /***/ }),
  9423. /***/ 649:
  9424. /***/ (function(module, __unusedexports, __webpack_require__) {
  9425. module.exports = getLastPage
  9426. const getPage = __webpack_require__(265)
  9427. function getLastPage (octokit, link, headers) {
  9428. return getPage(octokit, link, 'last', headers)
  9429. }
  9430. /***/ }),
  9431. /***/ 654:
  9432. /***/ (function(module) {
  9433. // This is not the set of all possible signals.
  9434. //
  9435. // It IS, however, the set of all signals that trigger
  9436. // an exit on either Linux or BSD systems. Linux is a
  9437. // superset of the signal names supported on BSD, and
  9438. // the unknown signals just fail to register, so we can
  9439. // catch that easily enough.
  9440. //
  9441. // Don't bother with SIGKILL. It's uncatchable, which
  9442. // means that we can't fire any callbacks anyway.
  9443. //
  9444. // If a user does happen to register a handler on a non-
  9445. // fatal signal like SIGWINCH or something, and then
  9446. // exit, it'll end up firing `process.emit('exit')`, so
  9447. // the handler will be fired anyway.
  9448. //
  9449. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9450. // artificially, inherently leave the process in a
  9451. // state from which it is not safe to try and enter JS
  9452. // listeners.
  9453. module.exports = [
  9454. 'SIGABRT',
  9455. 'SIGALRM',
  9456. 'SIGHUP',
  9457. 'SIGINT',
  9458. 'SIGTERM'
  9459. ]
  9460. if (process.platform !== 'win32') {
  9461. module.exports.push(
  9462. 'SIGVTALRM',
  9463. 'SIGXCPU',
  9464. 'SIGXFSZ',
  9465. 'SIGUSR2',
  9466. 'SIGTRAP',
  9467. 'SIGSYS',
  9468. 'SIGQUIT',
  9469. 'SIGIOT'
  9470. // should detect profiler and enable/disable accordingly.
  9471. // see #21
  9472. // 'SIGPROF'
  9473. )
  9474. }
  9475. if (process.platform === 'linux') {
  9476. module.exports.push(
  9477. 'SIGIO',
  9478. 'SIGPOLL',
  9479. 'SIGPWR',
  9480. 'SIGSTKFLT',
  9481. 'SIGUNUSED'
  9482. )
  9483. }
  9484. /***/ }),
  9485. /***/ 656:
  9486. /***/ (function(module, exports) {
  9487. exports = module.exports = SemVer
  9488. var debug
  9489. /* istanbul ignore next */
  9490. if (typeof process === 'object' &&
  9491. process.env &&
  9492. process.env.NODE_DEBUG &&
  9493. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9494. debug = function () {
  9495. var args = Array.prototype.slice.call(arguments, 0)
  9496. args.unshift('SEMVER')
  9497. console.log.apply(console, args)
  9498. }
  9499. } else {
  9500. debug = function () {}
  9501. }
  9502. // Note: this is the semver.org version of the spec that it implements
  9503. // Not necessarily the package version of this code.
  9504. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9505. var MAX_LENGTH = 256
  9506. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9507. /* istanbul ignore next */ 9007199254740991
  9508. // Max safe segment length for coercion.
  9509. var MAX_SAFE_COMPONENT_LENGTH = 16
  9510. // The actual regexps go on exports.re
  9511. var re = exports.re = []
  9512. var src = exports.src = []
  9513. var t = exports.tokens = {}
  9514. var R = 0
  9515. function tok (n) {
  9516. t[n] = R++
  9517. }
  9518. // The following Regular Expressions can be used for tokenizing,
  9519. // validating, and parsing SemVer version strings.
  9520. // ## Numeric Identifier
  9521. // A single `0`, or a non-zero digit followed by zero or more digits.
  9522. tok('NUMERICIDENTIFIER')
  9523. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9524. tok('NUMERICIDENTIFIERLOOSE')
  9525. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9526. // ## Non-numeric Identifier
  9527. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9528. // more letters, digits, or hyphens.
  9529. tok('NONNUMERICIDENTIFIER')
  9530. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9531. // ## Main Version
  9532. // Three dot-separated numeric identifiers.
  9533. tok('MAINVERSION')
  9534. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9535. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9536. '(' + src[t.NUMERICIDENTIFIER] + ')'
  9537. tok('MAINVERSIONLOOSE')
  9538. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9539. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9540. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  9541. // ## Pre-release Version Identifier
  9542. // A numeric identifier, or a non-numeric identifier.
  9543. tok('PRERELEASEIDENTIFIER')
  9544. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  9545. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9546. tok('PRERELEASEIDENTIFIERLOOSE')
  9547. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  9548. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9549. // ## Pre-release Version
  9550. // Hyphen, followed by one or more dot-separated pre-release version
  9551. // identifiers.
  9552. tok('PRERELEASE')
  9553. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  9554. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  9555. tok('PRERELEASELOOSE')
  9556. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  9557. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  9558. // ## Build Metadata Identifier
  9559. // Any combination of digits, letters, or hyphens.
  9560. tok('BUILDIDENTIFIER')
  9561. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  9562. // ## Build Metadata
  9563. // Plus sign, followed by one or more period-separated build metadata
  9564. // identifiers.
  9565. tok('BUILD')
  9566. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  9567. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  9568. // ## Full Version String
  9569. // A main version, followed optionally by a pre-release version and
  9570. // build metadata.
  9571. // Note that the only major, minor, patch, and pre-release sections of
  9572. // the version string are capturing groups. The build metadata is not a
  9573. // capturing group, because it should not ever be used in version
  9574. // comparison.
  9575. tok('FULL')
  9576. tok('FULLPLAIN')
  9577. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  9578. src[t.PRERELEASE] + '?' +
  9579. src[t.BUILD] + '?'
  9580. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  9581. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  9582. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  9583. // common in the npm registry.
  9584. tok('LOOSEPLAIN')
  9585. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  9586. src[t.PRERELEASELOOSE] + '?' +
  9587. src[t.BUILD] + '?'
  9588. tok('LOOSE')
  9589. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  9590. tok('GTLT')
  9591. src[t.GTLT] = '((?:<|>)?=?)'
  9592. // Something like "2.*" or "1.2.x".
  9593. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  9594. // Only the first item is strictly required.
  9595. tok('XRANGEIDENTIFIERLOOSE')
  9596. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  9597. tok('XRANGEIDENTIFIER')
  9598. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  9599. tok('XRANGEPLAIN')
  9600. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  9601. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9602. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9603. '(?:' + src[t.PRERELEASE] + ')?' +
  9604. src[t.BUILD] + '?' +
  9605. ')?)?'
  9606. tok('XRANGEPLAINLOOSE')
  9607. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9608. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9609. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9610. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  9611. src[t.BUILD] + '?' +
  9612. ')?)?'
  9613. tok('XRANGE')
  9614. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  9615. tok('XRANGELOOSE')
  9616. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  9617. // Coercion.
  9618. // Extract anything that could conceivably be a part of a valid semver
  9619. tok('COERCE')
  9620. src[t.COERCE] = '(^|[^\\d])' +
  9621. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  9622. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  9623. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  9624. '(?:$|[^\\d])'
  9625. tok('COERCERTL')
  9626. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  9627. // Tilde ranges.
  9628. // Meaning is "reasonably at or greater than"
  9629. tok('LONETILDE')
  9630. src[t.LONETILDE] = '(?:~>?)'
  9631. tok('TILDETRIM')
  9632. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  9633. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  9634. var tildeTrimReplace = '$1~'
  9635. tok('TILDE')
  9636. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  9637. tok('TILDELOOSE')
  9638. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  9639. // Caret ranges.
  9640. // Meaning is "at least and backwards compatible with"
  9641. tok('LONECARET')
  9642. src[t.LONECARET] = '(?:\\^)'
  9643. tok('CARETTRIM')
  9644. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  9645. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  9646. var caretTrimReplace = '$1^'
  9647. tok('CARET')
  9648. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  9649. tok('CARETLOOSE')
  9650. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  9651. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  9652. tok('COMPARATORLOOSE')
  9653. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  9654. tok('COMPARATOR')
  9655. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  9656. // An expression to strip any whitespace between the gtlt and the thing
  9657. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  9658. tok('COMPARATORTRIM')
  9659. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  9660. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  9661. // this one has to use the /g flag
  9662. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  9663. var comparatorTrimReplace = '$1$2$3'
  9664. // Something like `1.2.3 - 1.2.4`
  9665. // Note that these all use the loose form, because they'll be
  9666. // checked against either the strict or loose comparator form
  9667. // later.
  9668. tok('HYPHENRANGE')
  9669. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  9670. '\\s+-\\s+' +
  9671. '(' + src[t.XRANGEPLAIN] + ')' +
  9672. '\\s*$'
  9673. tok('HYPHENRANGELOOSE')
  9674. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  9675. '\\s+-\\s+' +
  9676. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  9677. '\\s*$'
  9678. // Star ranges basically just allow anything at all.
  9679. tok('STAR')
  9680. src[t.STAR] = '(<|>)?=?\\s*\\*'
  9681. // Compile to actual regexp objects.
  9682. // All are flag-free, unless they were created above with a flag.
  9683. for (var i = 0; i < R; i++) {
  9684. debug(i, src[i])
  9685. if (!re[i]) {
  9686. re[i] = new RegExp(src[i])
  9687. }
  9688. }
  9689. exports.parse = parse
  9690. function parse (version, options) {
  9691. if (!options || typeof options !== 'object') {
  9692. options = {
  9693. loose: !!options,
  9694. includePrerelease: false
  9695. }
  9696. }
  9697. if (version instanceof SemVer) {
  9698. return version
  9699. }
  9700. if (typeof version !== 'string') {
  9701. return null
  9702. }
  9703. if (version.length > MAX_LENGTH) {
  9704. return null
  9705. }
  9706. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  9707. if (!r.test(version)) {
  9708. return null
  9709. }
  9710. try {
  9711. return new SemVer(version, options)
  9712. } catch (er) {
  9713. return null
  9714. }
  9715. }
  9716. exports.valid = valid
  9717. function valid (version, options) {
  9718. var v = parse(version, options)
  9719. return v ? v.version : null
  9720. }
  9721. exports.clean = clean
  9722. function clean (version, options) {
  9723. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  9724. return s ? s.version : null
  9725. }
  9726. exports.SemVer = SemVer
  9727. function SemVer (version, options) {
  9728. if (!options || typeof options !== 'object') {
  9729. options = {
  9730. loose: !!options,
  9731. includePrerelease: false
  9732. }
  9733. }
  9734. if (version instanceof SemVer) {
  9735. if (version.loose === options.loose) {
  9736. return version
  9737. } else {
  9738. version = version.version
  9739. }
  9740. } else if (typeof version !== 'string') {
  9741. throw new TypeError('Invalid Version: ' + version)
  9742. }
  9743. if (version.length > MAX_LENGTH) {
  9744. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  9745. }
  9746. if (!(this instanceof SemVer)) {
  9747. return new SemVer(version, options)
  9748. }
  9749. debug('SemVer', version, options)
  9750. this.options = options
  9751. this.loose = !!options.loose
  9752. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  9753. if (!m) {
  9754. throw new TypeError('Invalid Version: ' + version)
  9755. }
  9756. this.raw = version
  9757. // these are actually numbers
  9758. this.major = +m[1]
  9759. this.minor = +m[2]
  9760. this.patch = +m[3]
  9761. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  9762. throw new TypeError('Invalid major version')
  9763. }
  9764. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  9765. throw new TypeError('Invalid minor version')
  9766. }
  9767. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  9768. throw new TypeError('Invalid patch version')
  9769. }
  9770. // numberify any prerelease numeric ids
  9771. if (!m[4]) {
  9772. this.prerelease = []
  9773. } else {
  9774. this.prerelease = m[4].split('.').map(function (id) {
  9775. if (/^[0-9]+$/.test(id)) {
  9776. var num = +id
  9777. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  9778. return num
  9779. }
  9780. }
  9781. return id
  9782. })
  9783. }
  9784. this.build = m[5] ? m[5].split('.') : []
  9785. this.format()
  9786. }
  9787. SemVer.prototype.format = function () {
  9788. this.version = this.major + '.' + this.minor + '.' + this.patch
  9789. if (this.prerelease.length) {
  9790. this.version += '-' + this.prerelease.join('.')
  9791. }
  9792. return this.version
  9793. }
  9794. SemVer.prototype.toString = function () {
  9795. return this.version
  9796. }
  9797. SemVer.prototype.compare = function (other) {
  9798. debug('SemVer.compare', this.version, this.options, other)
  9799. if (!(other instanceof SemVer)) {
  9800. other = new SemVer(other, this.options)
  9801. }
  9802. return this.compareMain(other) || this.comparePre(other)
  9803. }
  9804. SemVer.prototype.compareMain = function (other) {
  9805. if (!(other instanceof SemVer)) {
  9806. other = new SemVer(other, this.options)
  9807. }
  9808. return compareIdentifiers(this.major, other.major) ||
  9809. compareIdentifiers(this.minor, other.minor) ||
  9810. compareIdentifiers(this.patch, other.patch)
  9811. }
  9812. SemVer.prototype.comparePre = function (other) {
  9813. if (!(other instanceof SemVer)) {
  9814. other = new SemVer(other, this.options)
  9815. }
  9816. // NOT having a prerelease is > having one
  9817. if (this.prerelease.length && !other.prerelease.length) {
  9818. return -1
  9819. } else if (!this.prerelease.length && other.prerelease.length) {
  9820. return 1
  9821. } else if (!this.prerelease.length && !other.prerelease.length) {
  9822. return 0
  9823. }
  9824. var i = 0
  9825. do {
  9826. var a = this.prerelease[i]
  9827. var b = other.prerelease[i]
  9828. debug('prerelease compare', i, a, b)
  9829. if (a === undefined && b === undefined) {
  9830. return 0
  9831. } else if (b === undefined) {
  9832. return 1
  9833. } else if (a === undefined) {
  9834. return -1
  9835. } else if (a === b) {
  9836. continue
  9837. } else {
  9838. return compareIdentifiers(a, b)
  9839. }
  9840. } while (++i)
  9841. }
  9842. SemVer.prototype.compareBuild = function (other) {
  9843. if (!(other instanceof SemVer)) {
  9844. other = new SemVer(other, this.options)
  9845. }
  9846. var i = 0
  9847. do {
  9848. var a = this.build[i]
  9849. var b = other.build[i]
  9850. debug('prerelease compare', i, a, b)
  9851. if (a === undefined && b === undefined) {
  9852. return 0
  9853. } else if (b === undefined) {
  9854. return 1
  9855. } else if (a === undefined) {
  9856. return -1
  9857. } else if (a === b) {
  9858. continue
  9859. } else {
  9860. return compareIdentifiers(a, b)
  9861. }
  9862. } while (++i)
  9863. }
  9864. // preminor will bump the version up to the next minor release, and immediately
  9865. // down to pre-release. premajor and prepatch work the same way.
  9866. SemVer.prototype.inc = function (release, identifier) {
  9867. switch (release) {
  9868. case 'premajor':
  9869. this.prerelease.length = 0
  9870. this.patch = 0
  9871. this.minor = 0
  9872. this.major++
  9873. this.inc('pre', identifier)
  9874. break
  9875. case 'preminor':
  9876. this.prerelease.length = 0
  9877. this.patch = 0
  9878. this.minor++
  9879. this.inc('pre', identifier)
  9880. break
  9881. case 'prepatch':
  9882. // If this is already a prerelease, it will bump to the next version
  9883. // drop any prereleases that might already exist, since they are not
  9884. // relevant at this point.
  9885. this.prerelease.length = 0
  9886. this.inc('patch', identifier)
  9887. this.inc('pre', identifier)
  9888. break
  9889. // If the input is a non-prerelease version, this acts the same as
  9890. // prepatch.
  9891. case 'prerelease':
  9892. if (this.prerelease.length === 0) {
  9893. this.inc('patch', identifier)
  9894. }
  9895. this.inc('pre', identifier)
  9896. break
  9897. case 'major':
  9898. // If this is a pre-major version, bump up to the same major version.
  9899. // Otherwise increment major.
  9900. // 1.0.0-5 bumps to 1.0.0
  9901. // 1.1.0 bumps to 2.0.0
  9902. if (this.minor !== 0 ||
  9903. this.patch !== 0 ||
  9904. this.prerelease.length === 0) {
  9905. this.major++
  9906. }
  9907. this.minor = 0
  9908. this.patch = 0
  9909. this.prerelease = []
  9910. break
  9911. case 'minor':
  9912. // If this is a pre-minor version, bump up to the same minor version.
  9913. // Otherwise increment minor.
  9914. // 1.2.0-5 bumps to 1.2.0
  9915. // 1.2.1 bumps to 1.3.0
  9916. if (this.patch !== 0 || this.prerelease.length === 0) {
  9917. this.minor++
  9918. }
  9919. this.patch = 0
  9920. this.prerelease = []
  9921. break
  9922. case 'patch':
  9923. // If this is not a pre-release version, it will increment the patch.
  9924. // If it is a pre-release it will bump up to the same patch version.
  9925. // 1.2.0-5 patches to 1.2.0
  9926. // 1.2.0 patches to 1.2.1
  9927. if (this.prerelease.length === 0) {
  9928. this.patch++
  9929. }
  9930. this.prerelease = []
  9931. break
  9932. // This probably shouldn't be used publicly.
  9933. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  9934. case 'pre':
  9935. if (this.prerelease.length === 0) {
  9936. this.prerelease = [0]
  9937. } else {
  9938. var i = this.prerelease.length
  9939. while (--i >= 0) {
  9940. if (typeof this.prerelease[i] === 'number') {
  9941. this.prerelease[i]++
  9942. i = -2
  9943. }
  9944. }
  9945. if (i === -1) {
  9946. // didn't increment anything
  9947. this.prerelease.push(0)
  9948. }
  9949. }
  9950. if (identifier) {
  9951. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  9952. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  9953. if (this.prerelease[0] === identifier) {
  9954. if (isNaN(this.prerelease[1])) {
  9955. this.prerelease = [identifier, 0]
  9956. }
  9957. } else {
  9958. this.prerelease = [identifier, 0]
  9959. }
  9960. }
  9961. break
  9962. default:
  9963. throw new Error('invalid increment argument: ' + release)
  9964. }
  9965. this.format()
  9966. this.raw = this.version
  9967. return this
  9968. }
  9969. exports.inc = inc
  9970. function inc (version, release, loose, identifier) {
  9971. if (typeof (loose) === 'string') {
  9972. identifier = loose
  9973. loose = undefined
  9974. }
  9975. try {
  9976. return new SemVer(version, loose).inc(release, identifier).version
  9977. } catch (er) {
  9978. return null
  9979. }
  9980. }
  9981. exports.diff = diff
  9982. function diff (version1, version2) {
  9983. if (eq(version1, version2)) {
  9984. return null
  9985. } else {
  9986. var v1 = parse(version1)
  9987. var v2 = parse(version2)
  9988. var prefix = ''
  9989. if (v1.prerelease.length || v2.prerelease.length) {
  9990. prefix = 'pre'
  9991. var defaultResult = 'prerelease'
  9992. }
  9993. for (var key in v1) {
  9994. if (key === 'major' || key === 'minor' || key === 'patch') {
  9995. if (v1[key] !== v2[key]) {
  9996. return prefix + key
  9997. }
  9998. }
  9999. }
  10000. return defaultResult // may be undefined
  10001. }
  10002. }
  10003. exports.compareIdentifiers = compareIdentifiers
  10004. var numeric = /^[0-9]+$/
  10005. function compareIdentifiers (a, b) {
  10006. var anum = numeric.test(a)
  10007. var bnum = numeric.test(b)
  10008. if (anum && bnum) {
  10009. a = +a
  10010. b = +b
  10011. }
  10012. return a === b ? 0
  10013. : (anum && !bnum) ? -1
  10014. : (bnum && !anum) ? 1
  10015. : a < b ? -1
  10016. : 1
  10017. }
  10018. exports.rcompareIdentifiers = rcompareIdentifiers
  10019. function rcompareIdentifiers (a, b) {
  10020. return compareIdentifiers(b, a)
  10021. }
  10022. exports.major = major
  10023. function major (a, loose) {
  10024. return new SemVer(a, loose).major
  10025. }
  10026. exports.minor = minor
  10027. function minor (a, loose) {
  10028. return new SemVer(a, loose).minor
  10029. }
  10030. exports.patch = patch
  10031. function patch (a, loose) {
  10032. return new SemVer(a, loose).patch
  10033. }
  10034. exports.compare = compare
  10035. function compare (a, b, loose) {
  10036. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10037. }
  10038. exports.compareLoose = compareLoose
  10039. function compareLoose (a, b) {
  10040. return compare(a, b, true)
  10041. }
  10042. exports.compareBuild = compareBuild
  10043. function compareBuild (a, b, loose) {
  10044. var versionA = new SemVer(a, loose)
  10045. var versionB = new SemVer(b, loose)
  10046. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10047. }
  10048. exports.rcompare = rcompare
  10049. function rcompare (a, b, loose) {
  10050. return compare(b, a, loose)
  10051. }
  10052. exports.sort = sort
  10053. function sort (list, loose) {
  10054. return list.sort(function (a, b) {
  10055. return exports.compareBuild(a, b, loose)
  10056. })
  10057. }
  10058. exports.rsort = rsort
  10059. function rsort (list, loose) {
  10060. return list.sort(function (a, b) {
  10061. return exports.compareBuild(b, a, loose)
  10062. })
  10063. }
  10064. exports.gt = gt
  10065. function gt (a, b, loose) {
  10066. return compare(a, b, loose) > 0
  10067. }
  10068. exports.lt = lt
  10069. function lt (a, b, loose) {
  10070. return compare(a, b, loose) < 0
  10071. }
  10072. exports.eq = eq
  10073. function eq (a, b, loose) {
  10074. return compare(a, b, loose) === 0
  10075. }
  10076. exports.neq = neq
  10077. function neq (a, b, loose) {
  10078. return compare(a, b, loose) !== 0
  10079. }
  10080. exports.gte = gte
  10081. function gte (a, b, loose) {
  10082. return compare(a, b, loose) >= 0
  10083. }
  10084. exports.lte = lte
  10085. function lte (a, b, loose) {
  10086. return compare(a, b, loose) <= 0
  10087. }
  10088. exports.cmp = cmp
  10089. function cmp (a, op, b, loose) {
  10090. switch (op) {
  10091. case '===':
  10092. if (typeof a === 'object')
  10093. a = a.version
  10094. if (typeof b === 'object')
  10095. b = b.version
  10096. return a === b
  10097. case '!==':
  10098. if (typeof a === 'object')
  10099. a = a.version
  10100. if (typeof b === 'object')
  10101. b = b.version
  10102. return a !== b
  10103. case '':
  10104. case '=':
  10105. case '==':
  10106. return eq(a, b, loose)
  10107. case '!=':
  10108. return neq(a, b, loose)
  10109. case '>':
  10110. return gt(a, b, loose)
  10111. case '>=':
  10112. return gte(a, b, loose)
  10113. case '<':
  10114. return lt(a, b, loose)
  10115. case '<=':
  10116. return lte(a, b, loose)
  10117. default:
  10118. throw new TypeError('Invalid operator: ' + op)
  10119. }
  10120. }
  10121. exports.Comparator = Comparator
  10122. function Comparator (comp, options) {
  10123. if (!options || typeof options !== 'object') {
  10124. options = {
  10125. loose: !!options,
  10126. includePrerelease: false
  10127. }
  10128. }
  10129. if (comp instanceof Comparator) {
  10130. if (comp.loose === !!options.loose) {
  10131. return comp
  10132. } else {
  10133. comp = comp.value
  10134. }
  10135. }
  10136. if (!(this instanceof Comparator)) {
  10137. return new Comparator(comp, options)
  10138. }
  10139. debug('comparator', comp, options)
  10140. this.options = options
  10141. this.loose = !!options.loose
  10142. this.parse(comp)
  10143. if (this.semver === ANY) {
  10144. this.value = ''
  10145. } else {
  10146. this.value = this.operator + this.semver.version
  10147. }
  10148. debug('comp', this)
  10149. }
  10150. var ANY = {}
  10151. Comparator.prototype.parse = function (comp) {
  10152. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10153. var m = comp.match(r)
  10154. if (!m) {
  10155. throw new TypeError('Invalid comparator: ' + comp)
  10156. }
  10157. this.operator = m[1] !== undefined ? m[1] : ''
  10158. if (this.operator === '=') {
  10159. this.operator = ''
  10160. }
  10161. // if it literally is just '>' or '' then allow anything.
  10162. if (!m[2]) {
  10163. this.semver = ANY
  10164. } else {
  10165. this.semver = new SemVer(m[2], this.options.loose)
  10166. }
  10167. }
  10168. Comparator.prototype.toString = function () {
  10169. return this.value
  10170. }
  10171. Comparator.prototype.test = function (version) {
  10172. debug('Comparator.test', version, this.options.loose)
  10173. if (this.semver === ANY || version === ANY) {
  10174. return true
  10175. }
  10176. if (typeof version === 'string') {
  10177. try {
  10178. version = new SemVer(version, this.options)
  10179. } catch (er) {
  10180. return false
  10181. }
  10182. }
  10183. return cmp(version, this.operator, this.semver, this.options)
  10184. }
  10185. Comparator.prototype.intersects = function (comp, options) {
  10186. if (!(comp instanceof Comparator)) {
  10187. throw new TypeError('a Comparator is required')
  10188. }
  10189. if (!options || typeof options !== 'object') {
  10190. options = {
  10191. loose: !!options,
  10192. includePrerelease: false
  10193. }
  10194. }
  10195. var rangeTmp
  10196. if (this.operator === '') {
  10197. if (this.value === '') {
  10198. return true
  10199. }
  10200. rangeTmp = new Range(comp.value, options)
  10201. return satisfies(this.value, rangeTmp, options)
  10202. } else if (comp.operator === '') {
  10203. if (comp.value === '') {
  10204. return true
  10205. }
  10206. rangeTmp = new Range(this.value, options)
  10207. return satisfies(comp.semver, rangeTmp, options)
  10208. }
  10209. var sameDirectionIncreasing =
  10210. (this.operator === '>=' || this.operator === '>') &&
  10211. (comp.operator === '>=' || comp.operator === '>')
  10212. var sameDirectionDecreasing =
  10213. (this.operator === '<=' || this.operator === '<') &&
  10214. (comp.operator === '<=' || comp.operator === '<')
  10215. var sameSemVer = this.semver.version === comp.semver.version
  10216. var differentDirectionsInclusive =
  10217. (this.operator === '>=' || this.operator === '<=') &&
  10218. (comp.operator === '>=' || comp.operator === '<=')
  10219. var oppositeDirectionsLessThan =
  10220. cmp(this.semver, '<', comp.semver, options) &&
  10221. ((this.operator === '>=' || this.operator === '>') &&
  10222. (comp.operator === '<=' || comp.operator === '<'))
  10223. var oppositeDirectionsGreaterThan =
  10224. cmp(this.semver, '>', comp.semver, options) &&
  10225. ((this.operator === '<=' || this.operator === '<') &&
  10226. (comp.operator === '>=' || comp.operator === '>'))
  10227. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10228. (sameSemVer && differentDirectionsInclusive) ||
  10229. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10230. }
  10231. exports.Range = Range
  10232. function Range (range, options) {
  10233. if (!options || typeof options !== 'object') {
  10234. options = {
  10235. loose: !!options,
  10236. includePrerelease: false
  10237. }
  10238. }
  10239. if (range instanceof Range) {
  10240. if (range.loose === !!options.loose &&
  10241. range.includePrerelease === !!options.includePrerelease) {
  10242. return range
  10243. } else {
  10244. return new Range(range.raw, options)
  10245. }
  10246. }
  10247. if (range instanceof Comparator) {
  10248. return new Range(range.value, options)
  10249. }
  10250. if (!(this instanceof Range)) {
  10251. return new Range(range, options)
  10252. }
  10253. this.options = options
  10254. this.loose = !!options.loose
  10255. this.includePrerelease = !!options.includePrerelease
  10256. // First, split based on boolean or ||
  10257. this.raw = range
  10258. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10259. return this.parseRange(range.trim())
  10260. }, this).filter(function (c) {
  10261. // throw out any that are not relevant for whatever reason
  10262. return c.length
  10263. })
  10264. if (!this.set.length) {
  10265. throw new TypeError('Invalid SemVer Range: ' + range)
  10266. }
  10267. this.format()
  10268. }
  10269. Range.prototype.format = function () {
  10270. this.range = this.set.map(function (comps) {
  10271. return comps.join(' ').trim()
  10272. }).join('||').trim()
  10273. return this.range
  10274. }
  10275. Range.prototype.toString = function () {
  10276. return this.range
  10277. }
  10278. Range.prototype.parseRange = function (range) {
  10279. var loose = this.options.loose
  10280. range = range.trim()
  10281. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10282. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10283. range = range.replace(hr, hyphenReplace)
  10284. debug('hyphen replace', range)
  10285. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10286. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10287. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10288. // `~ 1.2.3` => `~1.2.3`
  10289. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10290. // `^ 1.2.3` => `^1.2.3`
  10291. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10292. // normalize spaces
  10293. range = range.split(/\s+/).join(' ')
  10294. // At this point, the range is completely trimmed and
  10295. // ready to be split into comparators.
  10296. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10297. var set = range.split(' ').map(function (comp) {
  10298. return parseComparator(comp, this.options)
  10299. }, this).join(' ').split(/\s+/)
  10300. if (this.options.loose) {
  10301. // in loose mode, throw out any that are not valid comparators
  10302. set = set.filter(function (comp) {
  10303. return !!comp.match(compRe)
  10304. })
  10305. }
  10306. set = set.map(function (comp) {
  10307. return new Comparator(comp, this.options)
  10308. }, this)
  10309. return set
  10310. }
  10311. Range.prototype.intersects = function (range, options) {
  10312. if (!(range instanceof Range)) {
  10313. throw new TypeError('a Range is required')
  10314. }
  10315. return this.set.some(function (thisComparators) {
  10316. return (
  10317. isSatisfiable(thisComparators, options) &&
  10318. range.set.some(function (rangeComparators) {
  10319. return (
  10320. isSatisfiable(rangeComparators, options) &&
  10321. thisComparators.every(function (thisComparator) {
  10322. return rangeComparators.every(function (rangeComparator) {
  10323. return thisComparator.intersects(rangeComparator, options)
  10324. })
  10325. })
  10326. )
  10327. })
  10328. )
  10329. })
  10330. }
  10331. // take a set of comparators and determine whether there
  10332. // exists a version which can satisfy it
  10333. function isSatisfiable (comparators, options) {
  10334. var result = true
  10335. var remainingComparators = comparators.slice()
  10336. var testComparator = remainingComparators.pop()
  10337. while (result && remainingComparators.length) {
  10338. result = remainingComparators.every(function (otherComparator) {
  10339. return testComparator.intersects(otherComparator, options)
  10340. })
  10341. testComparator = remainingComparators.pop()
  10342. }
  10343. return result
  10344. }
  10345. // Mostly just for testing and legacy API reasons
  10346. exports.toComparators = toComparators
  10347. function toComparators (range, options) {
  10348. return new Range(range, options).set.map(function (comp) {
  10349. return comp.map(function (c) {
  10350. return c.value
  10351. }).join(' ').trim().split(' ')
  10352. })
  10353. }
  10354. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10355. // already replaced the hyphen ranges
  10356. // turn into a set of JUST comparators.
  10357. function parseComparator (comp, options) {
  10358. debug('comp', comp, options)
  10359. comp = replaceCarets(comp, options)
  10360. debug('caret', comp)
  10361. comp = replaceTildes(comp, options)
  10362. debug('tildes', comp)
  10363. comp = replaceXRanges(comp, options)
  10364. debug('xrange', comp)
  10365. comp = replaceStars(comp, options)
  10366. debug('stars', comp)
  10367. return comp
  10368. }
  10369. function isX (id) {
  10370. return !id || id.toLowerCase() === 'x' || id === '*'
  10371. }
  10372. // ~, ~> --> * (any, kinda silly)
  10373. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10374. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10375. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10376. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10377. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10378. function replaceTildes (comp, options) {
  10379. return comp.trim().split(/\s+/).map(function (comp) {
  10380. return replaceTilde(comp, options)
  10381. }).join(' ')
  10382. }
  10383. function replaceTilde (comp, options) {
  10384. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10385. return comp.replace(r, function (_, M, m, p, pr) {
  10386. debug('tilde', comp, _, M, m, p, pr)
  10387. var ret
  10388. if (isX(M)) {
  10389. ret = ''
  10390. } else if (isX(m)) {
  10391. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10392. } else if (isX(p)) {
  10393. // ~1.2 == >=1.2.0 <1.3.0
  10394. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10395. } else if (pr) {
  10396. debug('replaceTilde pr', pr)
  10397. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10398. ' <' + M + '.' + (+m + 1) + '.0'
  10399. } else {
  10400. // ~1.2.3 == >=1.2.3 <1.3.0
  10401. ret = '>=' + M + '.' + m + '.' + p +
  10402. ' <' + M + '.' + (+m + 1) + '.0'
  10403. }
  10404. debug('tilde return', ret)
  10405. return ret
  10406. })
  10407. }
  10408. // ^ --> * (any, kinda silly)
  10409. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10410. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10411. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10412. // ^1.2.3 --> >=1.2.3 <2.0.0
  10413. // ^1.2.0 --> >=1.2.0 <2.0.0
  10414. function replaceCarets (comp, options) {
  10415. return comp.trim().split(/\s+/).map(function (comp) {
  10416. return replaceCaret(comp, options)
  10417. }).join(' ')
  10418. }
  10419. function replaceCaret (comp, options) {
  10420. debug('caret', comp, options)
  10421. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10422. return comp.replace(r, function (_, M, m, p, pr) {
  10423. debug('caret', comp, _, M, m, p, pr)
  10424. var ret
  10425. if (isX(M)) {
  10426. ret = ''
  10427. } else if (isX(m)) {
  10428. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10429. } else if (isX(p)) {
  10430. if (M === '0') {
  10431. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10432. } else {
  10433. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10434. }
  10435. } else if (pr) {
  10436. debug('replaceCaret pr', pr)
  10437. if (M === '0') {
  10438. if (m === '0') {
  10439. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10440. ' <' + M + '.' + m + '.' + (+p + 1)
  10441. } else {
  10442. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10443. ' <' + M + '.' + (+m + 1) + '.0'
  10444. }
  10445. } else {
  10446. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10447. ' <' + (+M + 1) + '.0.0'
  10448. }
  10449. } else {
  10450. debug('no pr')
  10451. if (M === '0') {
  10452. if (m === '0') {
  10453. ret = '>=' + M + '.' + m + '.' + p +
  10454. ' <' + M + '.' + m + '.' + (+p + 1)
  10455. } else {
  10456. ret = '>=' + M + '.' + m + '.' + p +
  10457. ' <' + M + '.' + (+m + 1) + '.0'
  10458. }
  10459. } else {
  10460. ret = '>=' + M + '.' + m + '.' + p +
  10461. ' <' + (+M + 1) + '.0.0'
  10462. }
  10463. }
  10464. debug('caret return', ret)
  10465. return ret
  10466. })
  10467. }
  10468. function replaceXRanges (comp, options) {
  10469. debug('replaceXRanges', comp, options)
  10470. return comp.split(/\s+/).map(function (comp) {
  10471. return replaceXRange(comp, options)
  10472. }).join(' ')
  10473. }
  10474. function replaceXRange (comp, options) {
  10475. comp = comp.trim()
  10476. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10477. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10478. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10479. var xM = isX(M)
  10480. var xm = xM || isX(m)
  10481. var xp = xm || isX(p)
  10482. var anyX = xp
  10483. if (gtlt === '=' && anyX) {
  10484. gtlt = ''
  10485. }
  10486. // if we're including prereleases in the match, then we need
  10487. // to fix this to -0, the lowest possible prerelease value
  10488. pr = options.includePrerelease ? '-0' : ''
  10489. if (xM) {
  10490. if (gtlt === '>' || gtlt === '<') {
  10491. // nothing is allowed
  10492. ret = '<0.0.0-0'
  10493. } else {
  10494. // nothing is forbidden
  10495. ret = '*'
  10496. }
  10497. } else if (gtlt && anyX) {
  10498. // we know patch is an x, because we have any x at all.
  10499. // replace X with 0
  10500. if (xm) {
  10501. m = 0
  10502. }
  10503. p = 0
  10504. if (gtlt === '>') {
  10505. // >1 => >=2.0.0
  10506. // >1.2 => >=1.3.0
  10507. // >1.2.3 => >= 1.2.4
  10508. gtlt = '>='
  10509. if (xm) {
  10510. M = +M + 1
  10511. m = 0
  10512. p = 0
  10513. } else {
  10514. m = +m + 1
  10515. p = 0
  10516. }
  10517. } else if (gtlt === '<=') {
  10518. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10519. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10520. gtlt = '<'
  10521. if (xm) {
  10522. M = +M + 1
  10523. } else {
  10524. m = +m + 1
  10525. }
  10526. }
  10527. ret = gtlt + M + '.' + m + '.' + p + pr
  10528. } else if (xm) {
  10529. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10530. } else if (xp) {
  10531. ret = '>=' + M + '.' + m + '.0' + pr +
  10532. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10533. }
  10534. debug('xRange return', ret)
  10535. return ret
  10536. })
  10537. }
  10538. // Because * is AND-ed with everything else in the comparator,
  10539. // and '' means "any version", just remove the *s entirely.
  10540. function replaceStars (comp, options) {
  10541. debug('replaceStars', comp, options)
  10542. // Looseness is ignored here. star is always as loose as it gets!
  10543. return comp.trim().replace(re[t.STAR], '')
  10544. }
  10545. // This function is passed to string.replace(re[t.HYPHENRANGE])
  10546. // M, m, patch, prerelease, build
  10547. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  10548. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  10549. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  10550. function hyphenReplace ($0,
  10551. from, fM, fm, fp, fpr, fb,
  10552. to, tM, tm, tp, tpr, tb) {
  10553. if (isX(fM)) {
  10554. from = ''
  10555. } else if (isX(fm)) {
  10556. from = '>=' + fM + '.0.0'
  10557. } else if (isX(fp)) {
  10558. from = '>=' + fM + '.' + fm + '.0'
  10559. } else {
  10560. from = '>=' + from
  10561. }
  10562. if (isX(tM)) {
  10563. to = ''
  10564. } else if (isX(tm)) {
  10565. to = '<' + (+tM + 1) + '.0.0'
  10566. } else if (isX(tp)) {
  10567. to = '<' + tM + '.' + (+tm + 1) + '.0'
  10568. } else if (tpr) {
  10569. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  10570. } else {
  10571. to = '<=' + to
  10572. }
  10573. return (from + ' ' + to).trim()
  10574. }
  10575. // if ANY of the sets match ALL of its comparators, then pass
  10576. Range.prototype.test = function (version) {
  10577. if (!version) {
  10578. return false
  10579. }
  10580. if (typeof version === 'string') {
  10581. try {
  10582. version = new SemVer(version, this.options)
  10583. } catch (er) {
  10584. return false
  10585. }
  10586. }
  10587. for (var i = 0; i < this.set.length; i++) {
  10588. if (testSet(this.set[i], version, this.options)) {
  10589. return true
  10590. }
  10591. }
  10592. return false
  10593. }
  10594. function testSet (set, version, options) {
  10595. for (var i = 0; i < set.length; i++) {
  10596. if (!set[i].test(version)) {
  10597. return false
  10598. }
  10599. }
  10600. if (version.prerelease.length && !options.includePrerelease) {
  10601. // Find the set of versions that are allowed to have prereleases
  10602. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  10603. // That should allow `1.2.3-pr.2` to pass.
  10604. // However, `1.2.4-alpha.notready` should NOT be allowed,
  10605. // even though it's within the range set by the comparators.
  10606. for (i = 0; i < set.length; i++) {
  10607. debug(set[i].semver)
  10608. if (set[i].semver === ANY) {
  10609. continue
  10610. }
  10611. if (set[i].semver.prerelease.length > 0) {
  10612. var allowed = set[i].semver
  10613. if (allowed.major === version.major &&
  10614. allowed.minor === version.minor &&
  10615. allowed.patch === version.patch) {
  10616. return true
  10617. }
  10618. }
  10619. }
  10620. // Version has a -pre, but it's not one of the ones we like.
  10621. return false
  10622. }
  10623. return true
  10624. }
  10625. exports.satisfies = satisfies
  10626. function satisfies (version, range, options) {
  10627. try {
  10628. range = new Range(range, options)
  10629. } catch (er) {
  10630. return false
  10631. }
  10632. return range.test(version)
  10633. }
  10634. exports.maxSatisfying = maxSatisfying
  10635. function maxSatisfying (versions, range, options) {
  10636. var max = null
  10637. var maxSV = null
  10638. try {
  10639. var rangeObj = new Range(range, options)
  10640. } catch (er) {
  10641. return null
  10642. }
  10643. versions.forEach(function (v) {
  10644. if (rangeObj.test(v)) {
  10645. // satisfies(v, range, options)
  10646. if (!max || maxSV.compare(v) === -1) {
  10647. // compare(max, v, true)
  10648. max = v
  10649. maxSV = new SemVer(max, options)
  10650. }
  10651. }
  10652. })
  10653. return max
  10654. }
  10655. exports.minSatisfying = minSatisfying
  10656. function minSatisfying (versions, range, options) {
  10657. var min = null
  10658. var minSV = null
  10659. try {
  10660. var rangeObj = new Range(range, options)
  10661. } catch (er) {
  10662. return null
  10663. }
  10664. versions.forEach(function (v) {
  10665. if (rangeObj.test(v)) {
  10666. // satisfies(v, range, options)
  10667. if (!min || minSV.compare(v) === 1) {
  10668. // compare(min, v, true)
  10669. min = v
  10670. minSV = new SemVer(min, options)
  10671. }
  10672. }
  10673. })
  10674. return min
  10675. }
  10676. exports.minVersion = minVersion
  10677. function minVersion (range, loose) {
  10678. range = new Range(range, loose)
  10679. var minver = new SemVer('0.0.0')
  10680. if (range.test(minver)) {
  10681. return minver
  10682. }
  10683. minver = new SemVer('0.0.0-0')
  10684. if (range.test(minver)) {
  10685. return minver
  10686. }
  10687. minver = null
  10688. for (var i = 0; i < range.set.length; ++i) {
  10689. var comparators = range.set[i]
  10690. comparators.forEach(function (comparator) {
  10691. // Clone to avoid manipulating the comparator's semver object.
  10692. var compver = new SemVer(comparator.semver.version)
  10693. switch (comparator.operator) {
  10694. case '>':
  10695. if (compver.prerelease.length === 0) {
  10696. compver.patch++
  10697. } else {
  10698. compver.prerelease.push(0)
  10699. }
  10700. compver.raw = compver.format()
  10701. /* fallthrough */
  10702. case '':
  10703. case '>=':
  10704. if (!minver || gt(minver, compver)) {
  10705. minver = compver
  10706. }
  10707. break
  10708. case '<':
  10709. case '<=':
  10710. /* Ignore maximum versions */
  10711. break
  10712. /* istanbul ignore next */
  10713. default:
  10714. throw new Error('Unexpected operation: ' + comparator.operator)
  10715. }
  10716. })
  10717. }
  10718. if (minver && range.test(minver)) {
  10719. return minver
  10720. }
  10721. return null
  10722. }
  10723. exports.validRange = validRange
  10724. function validRange (range, options) {
  10725. try {
  10726. // Return '*' instead of '' so that truthiness works.
  10727. // This will throw if it's invalid anyway
  10728. return new Range(range, options).range || '*'
  10729. } catch (er) {
  10730. return null
  10731. }
  10732. }
  10733. // Determine if version is less than all the versions possible in the range
  10734. exports.ltr = ltr
  10735. function ltr (version, range, options) {
  10736. return outside(version, range, '<', options)
  10737. }
  10738. // Determine if version is greater than all the versions possible in the range.
  10739. exports.gtr = gtr
  10740. function gtr (version, range, options) {
  10741. return outside(version, range, '>', options)
  10742. }
  10743. exports.outside = outside
  10744. function outside (version, range, hilo, options) {
  10745. version = new SemVer(version, options)
  10746. range = new Range(range, options)
  10747. var gtfn, ltefn, ltfn, comp, ecomp
  10748. switch (hilo) {
  10749. case '>':
  10750. gtfn = gt
  10751. ltefn = lte
  10752. ltfn = lt
  10753. comp = '>'
  10754. ecomp = '>='
  10755. break
  10756. case '<':
  10757. gtfn = lt
  10758. ltefn = gte
  10759. ltfn = gt
  10760. comp = '<'
  10761. ecomp = '<='
  10762. break
  10763. default:
  10764. throw new TypeError('Must provide a hilo val of "<" or ">"')
  10765. }
  10766. // If it satisifes the range it is not outside
  10767. if (satisfies(version, range, options)) {
  10768. return false
  10769. }
  10770. // From now on, variable terms are as if we're in "gtr" mode.
  10771. // but note that everything is flipped for the "ltr" function.
  10772. for (var i = 0; i < range.set.length; ++i) {
  10773. var comparators = range.set[i]
  10774. var high = null
  10775. var low = null
  10776. comparators.forEach(function (comparator) {
  10777. if (comparator.semver === ANY) {
  10778. comparator = new Comparator('>=0.0.0')
  10779. }
  10780. high = high || comparator
  10781. low = low || comparator
  10782. if (gtfn(comparator.semver, high.semver, options)) {
  10783. high = comparator
  10784. } else if (ltfn(comparator.semver, low.semver, options)) {
  10785. low = comparator
  10786. }
  10787. })
  10788. // If the edge version comparator has a operator then our version
  10789. // isn't outside it
  10790. if (high.operator === comp || high.operator === ecomp) {
  10791. return false
  10792. }
  10793. // If the lowest version comparator has an operator and our version
  10794. // is less than it then it isn't higher than the range
  10795. if ((!low.operator || low.operator === comp) &&
  10796. ltefn(version, low.semver)) {
  10797. return false
  10798. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  10799. return false
  10800. }
  10801. }
  10802. return true
  10803. }
  10804. exports.prerelease = prerelease
  10805. function prerelease (version, options) {
  10806. var parsed = parse(version, options)
  10807. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  10808. }
  10809. exports.intersects = intersects
  10810. function intersects (r1, r2, options) {
  10811. r1 = new Range(r1, options)
  10812. r2 = new Range(r2, options)
  10813. return r1.intersects(r2)
  10814. }
  10815. exports.coerce = coerce
  10816. function coerce (version, options) {
  10817. if (version instanceof SemVer) {
  10818. return version
  10819. }
  10820. if (typeof version === 'number') {
  10821. version = String(version)
  10822. }
  10823. if (typeof version !== 'string') {
  10824. return null
  10825. }
  10826. options = options || {}
  10827. var match = null
  10828. if (!options.rtl) {
  10829. match = version.match(re[t.COERCE])
  10830. } else {
  10831. // Find the right-most coercible string that does not share
  10832. // a terminus with a more left-ward coercible string.
  10833. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  10834. //
  10835. // Walk through the string checking with a /g regexp
  10836. // Manually set the index so as to pick up overlapping matches.
  10837. // Stop when we get a match that ends at the string end, since no
  10838. // coercible string can be more right-ward without the same terminus.
  10839. var next
  10840. while ((next = re[t.COERCERTL].exec(version)) &&
  10841. (!match || match.index + match[0].length !== version.length)
  10842. ) {
  10843. if (!match ||
  10844. next.index + next[0].length !== match.index + match[0].length) {
  10845. match = next
  10846. }
  10847. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  10848. }
  10849. // leave it in a clean state
  10850. re[t.COERCERTL].lastIndex = -1
  10851. }
  10852. if (match === null) {
  10853. return null
  10854. }
  10855. return parse(match[2] +
  10856. '.' + (match[3] || '0') +
  10857. '.' + (match[4] || '0'), options)
  10858. }
  10859. /***/ }),
  10860. /***/ 669:
  10861. /***/ (function(module) {
  10862. module.exports = require("util");
  10863. /***/ }),
  10864. /***/ 672:
  10865. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10866. "use strict";
  10867. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10868. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10869. return new (P || (P = Promise))(function (resolve, reject) {
  10870. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10871. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10872. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10873. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10874. });
  10875. };
  10876. var _a;
  10877. Object.defineProperty(exports, "__esModule", { value: true });
  10878. const assert_1 = __webpack_require__(357);
  10879. const fs = __webpack_require__(747);
  10880. const path = __webpack_require__(622);
  10881. _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;
  10882. exports.IS_WINDOWS = process.platform === 'win32';
  10883. function exists(fsPath) {
  10884. return __awaiter(this, void 0, void 0, function* () {
  10885. try {
  10886. yield exports.stat(fsPath);
  10887. }
  10888. catch (err) {
  10889. if (err.code === 'ENOENT') {
  10890. return false;
  10891. }
  10892. throw err;
  10893. }
  10894. return true;
  10895. });
  10896. }
  10897. exports.exists = exists;
  10898. function isDirectory(fsPath, useStat = false) {
  10899. return __awaiter(this, void 0, void 0, function* () {
  10900. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  10901. return stats.isDirectory();
  10902. });
  10903. }
  10904. exports.isDirectory = isDirectory;
  10905. /**
  10906. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  10907. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  10908. */
  10909. function isRooted(p) {
  10910. p = normalizeSeparators(p);
  10911. if (!p) {
  10912. throw new Error('isRooted() parameter "p" cannot be empty');
  10913. }
  10914. if (exports.IS_WINDOWS) {
  10915. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  10916. ); // e.g. C: or C:\hello
  10917. }
  10918. return p.startsWith('/');
  10919. }
  10920. exports.isRooted = isRooted;
  10921. /**
  10922. * Recursively create a directory at `fsPath`.
  10923. *
  10924. * This implementation is optimistic, meaning it attempts to create the full
  10925. * path first, and backs up the path stack from there.
  10926. *
  10927. * @param fsPath The path to create
  10928. * @param maxDepth The maximum recursion depth
  10929. * @param depth The current recursion depth
  10930. */
  10931. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  10932. return __awaiter(this, void 0, void 0, function* () {
  10933. assert_1.ok(fsPath, 'a path argument must be provided');
  10934. fsPath = path.resolve(fsPath);
  10935. if (depth >= maxDepth)
  10936. return exports.mkdir(fsPath);
  10937. try {
  10938. yield exports.mkdir(fsPath);
  10939. return;
  10940. }
  10941. catch (err) {
  10942. switch (err.code) {
  10943. case 'ENOENT': {
  10944. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  10945. yield exports.mkdir(fsPath);
  10946. return;
  10947. }
  10948. default: {
  10949. let stats;
  10950. try {
  10951. stats = yield exports.stat(fsPath);
  10952. }
  10953. catch (err2) {
  10954. throw err;
  10955. }
  10956. if (!stats.isDirectory())
  10957. throw err;
  10958. }
  10959. }
  10960. }
  10961. });
  10962. }
  10963. exports.mkdirP = mkdirP;
  10964. /**
  10965. * Best effort attempt to determine whether a file exists and is executable.
  10966. * @param filePath file path to check
  10967. * @param extensions additional file extensions to try
  10968. * @return if file exists and is executable, returns the file path. otherwise empty string.
  10969. */
  10970. function tryGetExecutablePath(filePath, extensions) {
  10971. return __awaiter(this, void 0, void 0, function* () {
  10972. let stats = undefined;
  10973. try {
  10974. // test file exists
  10975. stats = yield exports.stat(filePath);
  10976. }
  10977. catch (err) {
  10978. if (err.code !== 'ENOENT') {
  10979. // eslint-disable-next-line no-console
  10980. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  10981. }
  10982. }
  10983. if (stats && stats.isFile()) {
  10984. if (exports.IS_WINDOWS) {
  10985. // on Windows, test for valid extension
  10986. const upperExt = path.extname(filePath).toUpperCase();
  10987. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  10988. return filePath;
  10989. }
  10990. }
  10991. else {
  10992. if (isUnixExecutable(stats)) {
  10993. return filePath;
  10994. }
  10995. }
  10996. }
  10997. // try each extension
  10998. const originalFilePath = filePath;
  10999. for (const extension of extensions) {
  11000. filePath = originalFilePath + extension;
  11001. stats = undefined;
  11002. try {
  11003. stats = yield exports.stat(filePath);
  11004. }
  11005. catch (err) {
  11006. if (err.code !== 'ENOENT') {
  11007. // eslint-disable-next-line no-console
  11008. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11009. }
  11010. }
  11011. if (stats && stats.isFile()) {
  11012. if (exports.IS_WINDOWS) {
  11013. // preserve the case of the actual file (since an extension was appended)
  11014. try {
  11015. const directory = path.dirname(filePath);
  11016. const upperName = path.basename(filePath).toUpperCase();
  11017. for (const actualName of yield exports.readdir(directory)) {
  11018. if (upperName === actualName.toUpperCase()) {
  11019. filePath = path.join(directory, actualName);
  11020. break;
  11021. }
  11022. }
  11023. }
  11024. catch (err) {
  11025. // eslint-disable-next-line no-console
  11026. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11027. }
  11028. return filePath;
  11029. }
  11030. else {
  11031. if (isUnixExecutable(stats)) {
  11032. return filePath;
  11033. }
  11034. }
  11035. }
  11036. }
  11037. return '';
  11038. });
  11039. }
  11040. exports.tryGetExecutablePath = tryGetExecutablePath;
  11041. function normalizeSeparators(p) {
  11042. p = p || '';
  11043. if (exports.IS_WINDOWS) {
  11044. // convert slashes on Windows
  11045. p = p.replace(/\//g, '\\');
  11046. // remove redundant slashes
  11047. return p.replace(/\\\\+/g, '\\');
  11048. }
  11049. // remove redundant slashes
  11050. return p.replace(/\/\/+/g, '/');
  11051. }
  11052. // on Mac/Linux, test the execute bit
  11053. // R W X R W X R W X
  11054. // 256 128 64 32 16 8 4 2 1
  11055. function isUnixExecutable(stats) {
  11056. return ((stats.mode & 1) > 0 ||
  11057. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11058. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11059. }
  11060. //# sourceMappingURL=io-util.js.map
  11061. /***/ }),
  11062. /***/ 674:
  11063. /***/ (function(module, __unusedexports, __webpack_require__) {
  11064. module.exports = authenticate;
  11065. const { Deprecation } = __webpack_require__(692);
  11066. const once = __webpack_require__(969);
  11067. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11068. function authenticate(state, options) {
  11069. deprecateAuthenticate(
  11070. state.octokit.log,
  11071. new Deprecation(
  11072. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11073. )
  11074. );
  11075. if (!options) {
  11076. state.auth = false;
  11077. return;
  11078. }
  11079. switch (options.type) {
  11080. case "basic":
  11081. if (!options.username || !options.password) {
  11082. throw new Error(
  11083. "Basic authentication requires both a username and password to be set"
  11084. );
  11085. }
  11086. break;
  11087. case "oauth":
  11088. if (!options.token && !(options.key && options.secret)) {
  11089. throw new Error(
  11090. "OAuth2 authentication requires a token or key & secret to be set"
  11091. );
  11092. }
  11093. break;
  11094. case "token":
  11095. case "app":
  11096. if (!options.token) {
  11097. throw new Error("Token authentication requires a token to be set");
  11098. }
  11099. break;
  11100. default:
  11101. throw new Error(
  11102. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11103. );
  11104. }
  11105. state.auth = options;
  11106. }
  11107. /***/ }),
  11108. /***/ 675:
  11109. /***/ (function(module) {
  11110. module.exports = function btoa(str) {
  11111. return new Buffer(str).toString('base64')
  11112. }
  11113. /***/ }),
  11114. /***/ 692:
  11115. /***/ (function(__unusedmodule, exports) {
  11116. "use strict";
  11117. Object.defineProperty(exports, '__esModule', { value: true });
  11118. class Deprecation extends Error {
  11119. constructor(message) {
  11120. super(message); // Maintains proper stack trace (only available on V8)
  11121. /* istanbul ignore next */
  11122. if (Error.captureStackTrace) {
  11123. Error.captureStackTrace(this, this.constructor);
  11124. }
  11125. this.name = 'Deprecation';
  11126. }
  11127. }
  11128. exports.Deprecation = Deprecation;
  11129. /***/ }),
  11130. /***/ 696:
  11131. /***/ (function(module) {
  11132. "use strict";
  11133. /*!
  11134. * isobject <https://github.com/jonschlinkert/isobject>
  11135. *
  11136. * Copyright (c) 2014-2017, Jon Schlinkert.
  11137. * Released under the MIT License.
  11138. */
  11139. function isObject(val) {
  11140. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11141. }
  11142. /*!
  11143. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11144. *
  11145. * Copyright (c) 2014-2017, Jon Schlinkert.
  11146. * Released under the MIT License.
  11147. */
  11148. function isObjectObject(o) {
  11149. return isObject(o) === true
  11150. && Object.prototype.toString.call(o) === '[object Object]';
  11151. }
  11152. function isPlainObject(o) {
  11153. var ctor,prot;
  11154. if (isObjectObject(o) === false) return false;
  11155. // If has modified constructor
  11156. ctor = o.constructor;
  11157. if (typeof ctor !== 'function') return false;
  11158. // If has modified prototype
  11159. prot = ctor.prototype;
  11160. if (isObjectObject(prot) === false) return false;
  11161. // If constructor does not have an Object-specific method
  11162. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11163. return false;
  11164. }
  11165. // Most likely a plain Object
  11166. return true;
  11167. }
  11168. module.exports = isPlainObject;
  11169. /***/ }),
  11170. /***/ 697:
  11171. /***/ (function(module) {
  11172. "use strict";
  11173. module.exports = (promise, onFinally) => {
  11174. onFinally = onFinally || (() => {});
  11175. return promise.then(
  11176. val => new Promise(resolve => {
  11177. resolve(onFinally());
  11178. }).then(() => val),
  11179. err => new Promise(resolve => {
  11180. resolve(onFinally());
  11181. }).then(() => {
  11182. throw err;
  11183. })
  11184. );
  11185. };
  11186. /***/ }),
  11187. /***/ 705:
  11188. /***/ (function(module) {
  11189. 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"}}};
  11190. /***/ }),
  11191. /***/ 722:
  11192. /***/ (function(module) {
  11193. /**
  11194. * Convert array of 16 byte values to UUID string format of the form:
  11195. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11196. */
  11197. var byteToHex = [];
  11198. for (var i = 0; i < 256; ++i) {
  11199. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11200. }
  11201. function bytesToUuid(buf, offset) {
  11202. var i = offset || 0;
  11203. var bth = byteToHex;
  11204. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11205. return ([bth[buf[i++]], bth[buf[i++]],
  11206. bth[buf[i++]], bth[buf[i++]], '-',
  11207. bth[buf[i++]], bth[buf[i++]], '-',
  11208. bth[buf[i++]], bth[buf[i++]], '-',
  11209. bth[buf[i++]], bth[buf[i++]], '-',
  11210. bth[buf[i++]], bth[buf[i++]],
  11211. bth[buf[i++]], bth[buf[i++]],
  11212. bth[buf[i++]], bth[buf[i++]]]).join('');
  11213. }
  11214. module.exports = bytesToUuid;
  11215. /***/ }),
  11216. /***/ 742:
  11217. /***/ (function(module, __unusedexports, __webpack_require__) {
  11218. var fs = __webpack_require__(747)
  11219. var core
  11220. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11221. core = __webpack_require__(818)
  11222. } else {
  11223. core = __webpack_require__(197)
  11224. }
  11225. module.exports = isexe
  11226. isexe.sync = sync
  11227. function isexe (path, options, cb) {
  11228. if (typeof options === 'function') {
  11229. cb = options
  11230. options = {}
  11231. }
  11232. if (!cb) {
  11233. if (typeof Promise !== 'function') {
  11234. throw new TypeError('callback not provided')
  11235. }
  11236. return new Promise(function (resolve, reject) {
  11237. isexe(path, options || {}, function (er, is) {
  11238. if (er) {
  11239. reject(er)
  11240. } else {
  11241. resolve(is)
  11242. }
  11243. })
  11244. })
  11245. }
  11246. core(path, options || {}, function (er, is) {
  11247. // ignore EACCES because that just means we aren't allowed to run it
  11248. if (er) {
  11249. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11250. er = null
  11251. is = false
  11252. }
  11253. }
  11254. cb(er, is)
  11255. })
  11256. }
  11257. function sync (path, options) {
  11258. // my kingdom for a filtered catch
  11259. try {
  11260. return core.sync(path, options || {})
  11261. } catch (er) {
  11262. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11263. return false
  11264. } else {
  11265. throw er
  11266. }
  11267. }
  11268. }
  11269. /***/ }),
  11270. /***/ 747:
  11271. /***/ (function(module) {
  11272. module.exports = require("fs");
  11273. /***/ }),
  11274. /***/ 753:
  11275. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11276. "use strict";
  11277. Object.defineProperty(exports, '__esModule', { value: true });
  11278. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11279. var endpoint = __webpack_require__(385);
  11280. var universalUserAgent = __webpack_require__(796);
  11281. var isPlainObject = _interopDefault(__webpack_require__(696));
  11282. var nodeFetch = _interopDefault(__webpack_require__(454));
  11283. var requestError = __webpack_require__(463);
  11284. const VERSION = "5.3.1";
  11285. function getBufferResponse(response) {
  11286. return response.arrayBuffer();
  11287. }
  11288. function fetchWrapper(requestOptions) {
  11289. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11290. requestOptions.body = JSON.stringify(requestOptions.body);
  11291. }
  11292. let headers = {};
  11293. let status;
  11294. let url;
  11295. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11296. return fetch(requestOptions.url, Object.assign({
  11297. method: requestOptions.method,
  11298. body: requestOptions.body,
  11299. headers: requestOptions.headers,
  11300. redirect: requestOptions.redirect
  11301. }, requestOptions.request)).then(response => {
  11302. url = response.url;
  11303. status = response.status;
  11304. for (const keyAndValue of response.headers) {
  11305. headers[keyAndValue[0]] = keyAndValue[1];
  11306. }
  11307. if (status === 204 || status === 205) {
  11308. return;
  11309. } // GitHub API returns 200 for HEAD requsets
  11310. if (requestOptions.method === "HEAD") {
  11311. if (status < 400) {
  11312. return;
  11313. }
  11314. throw new requestError.RequestError(response.statusText, status, {
  11315. headers,
  11316. request: requestOptions
  11317. });
  11318. }
  11319. if (status === 304) {
  11320. throw new requestError.RequestError("Not modified", status, {
  11321. headers,
  11322. request: requestOptions
  11323. });
  11324. }
  11325. if (status >= 400) {
  11326. return response.text().then(message => {
  11327. const error = new requestError.RequestError(message, status, {
  11328. headers,
  11329. request: requestOptions
  11330. });
  11331. try {
  11332. let responseBody = JSON.parse(error.message);
  11333. Object.assign(error, responseBody);
  11334. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11335. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11336. } catch (e) {// ignore, see octokit/rest.js#684
  11337. }
  11338. throw error;
  11339. });
  11340. }
  11341. const contentType = response.headers.get("content-type");
  11342. if (/application\/json/.test(contentType)) {
  11343. return response.json();
  11344. }
  11345. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11346. return response.text();
  11347. }
  11348. return getBufferResponse(response);
  11349. }).then(data => {
  11350. return {
  11351. status,
  11352. url,
  11353. headers,
  11354. data
  11355. };
  11356. }).catch(error => {
  11357. if (error instanceof requestError.RequestError) {
  11358. throw error;
  11359. }
  11360. throw new requestError.RequestError(error.message, 500, {
  11361. headers,
  11362. request: requestOptions
  11363. });
  11364. });
  11365. }
  11366. function withDefaults(oldEndpoint, newDefaults) {
  11367. const endpoint = oldEndpoint.defaults(newDefaults);
  11368. const newApi = function (route, parameters) {
  11369. const endpointOptions = endpoint.merge(route, parameters);
  11370. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11371. return fetchWrapper(endpoint.parse(endpointOptions));
  11372. }
  11373. const request = (route, parameters) => {
  11374. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11375. };
  11376. Object.assign(request, {
  11377. endpoint,
  11378. defaults: withDefaults.bind(null, endpoint)
  11379. });
  11380. return endpointOptions.request.hook(request, endpointOptions);
  11381. };
  11382. return Object.assign(newApi, {
  11383. endpoint,
  11384. defaults: withDefaults.bind(null, endpoint)
  11385. });
  11386. }
  11387. const request = withDefaults(endpoint.endpoint, {
  11388. headers: {
  11389. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11390. }
  11391. });
  11392. exports.request = request;
  11393. //# sourceMappingURL=index.js.map
  11394. /***/ }),
  11395. /***/ 761:
  11396. /***/ (function(module) {
  11397. module.exports = require("zlib");
  11398. /***/ }),
  11399. /***/ 763:
  11400. /***/ (function(module) {
  11401. module.exports = removeHook
  11402. function removeHook (state, name, method) {
  11403. if (!state.registry[name]) {
  11404. return
  11405. }
  11406. var index = state.registry[name]
  11407. .map(function (registered) { return registered.orig })
  11408. .indexOf(method)
  11409. if (index === -1) {
  11410. return
  11411. }
  11412. state.registry[name].splice(index, 1)
  11413. }
  11414. /***/ }),
  11415. /***/ 768:
  11416. /***/ (function(module) {
  11417. "use strict";
  11418. module.exports = function (x) {
  11419. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11420. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11421. if (x[x.length - 1] === lf) {
  11422. x = x.slice(0, x.length - 1);
  11423. }
  11424. if (x[x.length - 1] === cr) {
  11425. x = x.slice(0, x.length - 1);
  11426. }
  11427. return x;
  11428. };
  11429. /***/ }),
  11430. /***/ 777:
  11431. /***/ (function(module, __unusedexports, __webpack_require__) {
  11432. module.exports = getFirstPage
  11433. const getPage = __webpack_require__(265)
  11434. function getFirstPage (octokit, link, headers) {
  11435. return getPage(octokit, link, 'first', headers)
  11436. }
  11437. /***/ }),
  11438. /***/ 796:
  11439. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11440. "use strict";
  11441. Object.defineProperty(exports, '__esModule', { value: true });
  11442. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11443. var osName = _interopDefault(__webpack_require__(2));
  11444. function getUserAgent() {
  11445. try {
  11446. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  11447. } catch (error) {
  11448. if (/wmic os get Caption/.test(error.message)) {
  11449. return "Windows <version undetectable>";
  11450. }
  11451. throw error;
  11452. }
  11453. }
  11454. exports.getUserAgent = getUserAgent;
  11455. //# sourceMappingURL=index.js.map
  11456. /***/ }),
  11457. /***/ 807:
  11458. /***/ (function(module, __unusedexports, __webpack_require__) {
  11459. module.exports = paginate;
  11460. const iterator = __webpack_require__(8);
  11461. function paginate(octokit, route, options, mapFn) {
  11462. if (typeof options === "function") {
  11463. mapFn = options;
  11464. options = undefined;
  11465. }
  11466. options = octokit.request.endpoint.merge(route, options);
  11467. return gather(
  11468. octokit,
  11469. [],
  11470. iterator(octokit, options)[Symbol.asyncIterator](),
  11471. mapFn
  11472. );
  11473. }
  11474. function gather(octokit, results, iterator, mapFn) {
  11475. return iterator.next().then(result => {
  11476. if (result.done) {
  11477. return results;
  11478. }
  11479. let earlyExit = false;
  11480. function done() {
  11481. earlyExit = true;
  11482. }
  11483. results = results.concat(
  11484. mapFn ? mapFn(result.value, done) : result.value.data
  11485. );
  11486. if (earlyExit) {
  11487. return results;
  11488. }
  11489. return gather(octokit, results, iterator, mapFn);
  11490. });
  11491. }
  11492. /***/ }),
  11493. /***/ 813:
  11494. /***/ (function(__unusedmodule, exports) {
  11495. "use strict";
  11496. Object.defineProperty(exports, '__esModule', { value: true });
  11497. async function auth(token) {
  11498. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  11499. return {
  11500. type: "token",
  11501. token: token,
  11502. tokenType
  11503. };
  11504. }
  11505. /**
  11506. * Prefix token for usage in the Authorization header
  11507. *
  11508. * @param token OAuth token or JSON Web Token
  11509. */
  11510. function withAuthorizationPrefix(token) {
  11511. if (token.split(/\./).length === 3) {
  11512. return `bearer ${token}`;
  11513. }
  11514. return `token ${token}`;
  11515. }
  11516. async function hook(token, request, route, parameters) {
  11517. const endpoint = request.endpoint.merge(route, parameters);
  11518. endpoint.headers.authorization = withAuthorizationPrefix(token);
  11519. return request(endpoint);
  11520. }
  11521. const createTokenAuth = function createTokenAuth(token) {
  11522. if (!token) {
  11523. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  11524. }
  11525. if (typeof token !== "string") {
  11526. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  11527. }
  11528. token = token.replace(/^(token|bearer) +/i, "");
  11529. return Object.assign(auth.bind(null, token), {
  11530. hook: hook.bind(null, token)
  11531. });
  11532. };
  11533. exports.createTokenAuth = createTokenAuth;
  11534. //# sourceMappingURL=index.js.map
  11535. /***/ }),
  11536. /***/ 814:
  11537. /***/ (function(module, __unusedexports, __webpack_require__) {
  11538. module.exports = which
  11539. which.sync = whichSync
  11540. var isWindows = process.platform === 'win32' ||
  11541. process.env.OSTYPE === 'cygwin' ||
  11542. process.env.OSTYPE === 'msys'
  11543. var path = __webpack_require__(622)
  11544. var COLON = isWindows ? ';' : ':'
  11545. var isexe = __webpack_require__(742)
  11546. function getNotFoundError (cmd) {
  11547. var er = new Error('not found: ' + cmd)
  11548. er.code = 'ENOENT'
  11549. return er
  11550. }
  11551. function getPathInfo (cmd, opt) {
  11552. var colon = opt.colon || COLON
  11553. var pathEnv = opt.path || process.env.PATH || ''
  11554. var pathExt = ['']
  11555. pathEnv = pathEnv.split(colon)
  11556. var pathExtExe = ''
  11557. if (isWindows) {
  11558. pathEnv.unshift(process.cwd())
  11559. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  11560. pathExt = pathExtExe.split(colon)
  11561. // Always test the cmd itself first. isexe will check to make sure
  11562. // it's found in the pathExt set.
  11563. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  11564. pathExt.unshift('')
  11565. }
  11566. // If it has a slash, then we don't bother searching the pathenv.
  11567. // just check the file itself, and that's it.
  11568. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  11569. pathEnv = ['']
  11570. return {
  11571. env: pathEnv,
  11572. ext: pathExt,
  11573. extExe: pathExtExe
  11574. }
  11575. }
  11576. function which (cmd, opt, cb) {
  11577. if (typeof opt === 'function') {
  11578. cb = opt
  11579. opt = {}
  11580. }
  11581. var info = getPathInfo(cmd, opt)
  11582. var pathEnv = info.env
  11583. var pathExt = info.ext
  11584. var pathExtExe = info.extExe
  11585. var found = []
  11586. ;(function F (i, l) {
  11587. if (i === l) {
  11588. if (opt.all && found.length)
  11589. return cb(null, found)
  11590. else
  11591. return cb(getNotFoundError(cmd))
  11592. }
  11593. var pathPart = pathEnv[i]
  11594. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  11595. pathPart = pathPart.slice(1, -1)
  11596. var p = path.join(pathPart, cmd)
  11597. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  11598. p = cmd.slice(0, 2) + p
  11599. }
  11600. ;(function E (ii, ll) {
  11601. if (ii === ll) return F(i + 1, l)
  11602. var ext = pathExt[ii]
  11603. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  11604. if (!er && is) {
  11605. if (opt.all)
  11606. found.push(p + ext)
  11607. else
  11608. return cb(null, p + ext)
  11609. }
  11610. return E(ii + 1, ll)
  11611. })
  11612. })(0, pathExt.length)
  11613. })(0, pathEnv.length)
  11614. }
  11615. function whichSync (cmd, opt) {
  11616. opt = opt || {}
  11617. var info = getPathInfo(cmd, opt)
  11618. var pathEnv = info.env
  11619. var pathExt = info.ext
  11620. var pathExtExe = info.extExe
  11621. var found = []
  11622. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  11623. var pathPart = pathEnv[i]
  11624. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  11625. pathPart = pathPart.slice(1, -1)
  11626. var p = path.join(pathPart, cmd)
  11627. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  11628. p = cmd.slice(0, 2) + p
  11629. }
  11630. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  11631. var cur = p + pathExt[j]
  11632. var is
  11633. try {
  11634. is = isexe.sync(cur, { pathExt: pathExtExe })
  11635. if (is) {
  11636. if (opt.all)
  11637. found.push(cur)
  11638. else
  11639. return cur
  11640. }
  11641. } catch (ex) {}
  11642. }
  11643. }
  11644. if (opt.all && found.length)
  11645. return found
  11646. if (opt.nothrow)
  11647. return null
  11648. throw getNotFoundError(cmd)
  11649. }
  11650. /***/ }),
  11651. /***/ 816:
  11652. /***/ (function(module) {
  11653. "use strict";
  11654. module.exports = /^#!.*/;
  11655. /***/ }),
  11656. /***/ 818:
  11657. /***/ (function(module, __unusedexports, __webpack_require__) {
  11658. module.exports = isexe
  11659. isexe.sync = sync
  11660. var fs = __webpack_require__(747)
  11661. function checkPathExt (path, options) {
  11662. var pathext = options.pathExt !== undefined ?
  11663. options.pathExt : process.env.PATHEXT
  11664. if (!pathext) {
  11665. return true
  11666. }
  11667. pathext = pathext.split(';')
  11668. if (pathext.indexOf('') !== -1) {
  11669. return true
  11670. }
  11671. for (var i = 0; i < pathext.length; i++) {
  11672. var p = pathext[i].toLowerCase()
  11673. if (p && path.substr(-p.length).toLowerCase() === p) {
  11674. return true
  11675. }
  11676. }
  11677. return false
  11678. }
  11679. function checkStat (stat, path, options) {
  11680. if (!stat.isSymbolicLink() && !stat.isFile()) {
  11681. return false
  11682. }
  11683. return checkPathExt(path, options)
  11684. }
  11685. function isexe (path, options, cb) {
  11686. fs.stat(path, function (er, stat) {
  11687. cb(er, er ? false : checkStat(stat, path, options))
  11688. })
  11689. }
  11690. function sync (path, options) {
  11691. return checkStat(fs.statSync(path), path, options)
  11692. }
  11693. /***/ }),
  11694. /***/ 821:
  11695. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11696. "use strict";
  11697. var __importStar = (this && this.__importStar) || function (mod) {
  11698. if (mod && mod.__esModule) return mod;
  11699. var result = {};
  11700. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  11701. result["default"] = mod;
  11702. return result;
  11703. };
  11704. Object.defineProperty(exports, "__esModule", { value: true });
  11705. const core = __importStar(__webpack_require__(470));
  11706. const fsHelper = __importStar(__webpack_require__(618));
  11707. const github = __importStar(__webpack_require__(469));
  11708. const path = __importStar(__webpack_require__(622));
  11709. function getInputs() {
  11710. const result = {};
  11711. // GitHub workspace
  11712. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  11713. if (!githubWorkspacePath) {
  11714. throw new Error('GITHUB_WORKSPACE not defined');
  11715. }
  11716. githubWorkspacePath = path.resolve(githubWorkspacePath);
  11717. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  11718. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  11719. // Qualified repository
  11720. const qualifiedRepository = core.getInput('repository') ||
  11721. `${github.context.repo.owner}/${github.context.repo.repo}`;
  11722. core.debug(`qualified repository = '${qualifiedRepository}'`);
  11723. const splitRepository = qualifiedRepository.split('/');
  11724. if (splitRepository.length !== 2 ||
  11725. !splitRepository[0] ||
  11726. !splitRepository[1]) {
  11727. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  11728. }
  11729. result.repositoryOwner = splitRepository[0];
  11730. result.repositoryName = splitRepository[1];
  11731. // Repository path
  11732. result.repositoryPath = core.getInput('path') || '.';
  11733. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  11734. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  11735. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  11736. }
  11737. // Workflow repository?
  11738. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  11739. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  11740. // Source branch, source version
  11741. result.ref = core.getInput('ref');
  11742. if (!result.ref) {
  11743. if (isWorkflowRepository) {
  11744. result.ref = github.context.ref;
  11745. result.commit = github.context.sha;
  11746. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  11747. // the ref is unqualifed like "master" instead of "refs/heads/master".
  11748. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  11749. result.ref = `refs/heads/${result.ref}`;
  11750. }
  11751. }
  11752. if (!result.ref && !result.commit) {
  11753. result.ref = 'refs/heads/master';
  11754. }
  11755. }
  11756. // SHA?
  11757. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  11758. result.commit = result.ref;
  11759. result.ref = '';
  11760. }
  11761. core.debug(`ref = '${result.ref}'`);
  11762. core.debug(`commit = '${result.commit}'`);
  11763. // Clean
  11764. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  11765. core.debug(`clean = ${result.clean}`);
  11766. // Submodules
  11767. if (core.getInput('submodules')) {
  11768. throw new Error("The input 'submodules' is not supported in actions/checkout@v2");
  11769. }
  11770. // Fetch depth
  11771. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  11772. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  11773. result.fetchDepth = 0;
  11774. }
  11775. core.debug(`fetch depth = ${result.fetchDepth}`);
  11776. // LFS
  11777. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  11778. core.debug(`lfs = ${result.lfs}`);
  11779. // Auth token
  11780. result.authToken = core.getInput('token');
  11781. // Persist credentials
  11782. result.persistCredentials =
  11783. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  11784. return result;
  11785. }
  11786. exports.getInputs = getInputs;
  11787. /***/ }),
  11788. /***/ 826:
  11789. /***/ (function(module, __unusedexports, __webpack_require__) {
  11790. var rng = __webpack_require__(139);
  11791. var bytesToUuid = __webpack_require__(722);
  11792. function v4(options, buf, offset) {
  11793. var i = buf && offset || 0;
  11794. if (typeof(options) == 'string') {
  11795. buf = options === 'binary' ? new Array(16) : null;
  11796. options = null;
  11797. }
  11798. options = options || {};
  11799. var rnds = options.random || (options.rng || rng)();
  11800. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  11801. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  11802. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  11803. // Copy bytes to buffer, if provided
  11804. if (buf) {
  11805. for (var ii = 0; ii < 16; ++ii) {
  11806. buf[i + ii] = rnds[ii];
  11807. }
  11808. }
  11809. return buf || bytesToUuid(rnds);
  11810. }
  11811. module.exports = v4;
  11812. /***/ }),
  11813. /***/ 835:
  11814. /***/ (function(module) {
  11815. module.exports = require("url");
  11816. /***/ }),
  11817. /***/ 850:
  11818. /***/ (function(module, __unusedexports, __webpack_require__) {
  11819. module.exports = paginationMethodsPlugin
  11820. function paginationMethodsPlugin (octokit) {
  11821. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  11822. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  11823. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  11824. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  11825. octokit.hasFirstPage = __webpack_require__(536)
  11826. octokit.hasLastPage = __webpack_require__(336)
  11827. octokit.hasNextPage = __webpack_require__(929)
  11828. octokit.hasPreviousPage = __webpack_require__(558)
  11829. }
  11830. /***/ }),
  11831. /***/ 854:
  11832. /***/ (function(module) {
  11833. /**
  11834. * lodash (Custom Build) <https://lodash.com/>
  11835. * Build: `lodash modularize exports="npm" -o ./`
  11836. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  11837. * Released under MIT license <https://lodash.com/license>
  11838. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  11839. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  11840. */
  11841. /** Used as the `TypeError` message for "Functions" methods. */
  11842. var FUNC_ERROR_TEXT = 'Expected a function';
  11843. /** Used to stand-in for `undefined` hash values. */
  11844. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  11845. /** Used as references for various `Number` constants. */
  11846. var INFINITY = 1 / 0;
  11847. /** `Object#toString` result references. */
  11848. var funcTag = '[object Function]',
  11849. genTag = '[object GeneratorFunction]',
  11850. symbolTag = '[object Symbol]';
  11851. /** Used to match property names within property paths. */
  11852. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  11853. reIsPlainProp = /^\w*$/,
  11854. reLeadingDot = /^\./,
  11855. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  11856. /**
  11857. * Used to match `RegExp`
  11858. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  11859. */
  11860. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  11861. /** Used to match backslashes in property paths. */
  11862. var reEscapeChar = /\\(\\)?/g;
  11863. /** Used to detect host constructors (Safari). */
  11864. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  11865. /** Detect free variable `global` from Node.js. */
  11866. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  11867. /** Detect free variable `self`. */
  11868. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  11869. /** Used as a reference to the global object. */
  11870. var root = freeGlobal || freeSelf || Function('return this')();
  11871. /**
  11872. * Gets the value at `key` of `object`.
  11873. *
  11874. * @private
  11875. * @param {Object} [object] The object to query.
  11876. * @param {string} key The key of the property to get.
  11877. * @returns {*} Returns the property value.
  11878. */
  11879. function getValue(object, key) {
  11880. return object == null ? undefined : object[key];
  11881. }
  11882. /**
  11883. * Checks if `value` is a host object in IE < 9.
  11884. *
  11885. * @private
  11886. * @param {*} value The value to check.
  11887. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  11888. */
  11889. function isHostObject(value) {
  11890. // Many host objects are `Object` objects that can coerce to strings
  11891. // despite having improperly defined `toString` methods.
  11892. var result = false;
  11893. if (value != null && typeof value.toString != 'function') {
  11894. try {
  11895. result = !!(value + '');
  11896. } catch (e) {}
  11897. }
  11898. return result;
  11899. }
  11900. /** Used for built-in method references. */
  11901. var arrayProto = Array.prototype,
  11902. funcProto = Function.prototype,
  11903. objectProto = Object.prototype;
  11904. /** Used to detect overreaching core-js shims. */
  11905. var coreJsData = root['__core-js_shared__'];
  11906. /** Used to detect methods masquerading as native. */
  11907. var maskSrcKey = (function() {
  11908. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  11909. return uid ? ('Symbol(src)_1.' + uid) : '';
  11910. }());
  11911. /** Used to resolve the decompiled source of functions. */
  11912. var funcToString = funcProto.toString;
  11913. /** Used to check objects for own properties. */
  11914. var hasOwnProperty = objectProto.hasOwnProperty;
  11915. /**
  11916. * Used to resolve the
  11917. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  11918. * of values.
  11919. */
  11920. var objectToString = objectProto.toString;
  11921. /** Used to detect if a method is native. */
  11922. var reIsNative = RegExp('^' +
  11923. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  11924. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  11925. );
  11926. /** Built-in value references. */
  11927. var Symbol = root.Symbol,
  11928. splice = arrayProto.splice;
  11929. /* Built-in method references that are verified to be native. */
  11930. var Map = getNative(root, 'Map'),
  11931. nativeCreate = getNative(Object, 'create');
  11932. /** Used to convert symbols to primitives and strings. */
  11933. var symbolProto = Symbol ? Symbol.prototype : undefined,
  11934. symbolToString = symbolProto ? symbolProto.toString : undefined;
  11935. /**
  11936. * Creates a hash object.
  11937. *
  11938. * @private
  11939. * @constructor
  11940. * @param {Array} [entries] The key-value pairs to cache.
  11941. */
  11942. function Hash(entries) {
  11943. var index = -1,
  11944. length = entries ? entries.length : 0;
  11945. this.clear();
  11946. while (++index < length) {
  11947. var entry = entries[index];
  11948. this.set(entry[0], entry[1]);
  11949. }
  11950. }
  11951. /**
  11952. * Removes all key-value entries from the hash.
  11953. *
  11954. * @private
  11955. * @name clear
  11956. * @memberOf Hash
  11957. */
  11958. function hashClear() {
  11959. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  11960. }
  11961. /**
  11962. * Removes `key` and its value from the hash.
  11963. *
  11964. * @private
  11965. * @name delete
  11966. * @memberOf Hash
  11967. * @param {Object} hash The hash to modify.
  11968. * @param {string} key The key of the value to remove.
  11969. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11970. */
  11971. function hashDelete(key) {
  11972. return this.has(key) && delete this.__data__[key];
  11973. }
  11974. /**
  11975. * Gets the hash value for `key`.
  11976. *
  11977. * @private
  11978. * @name get
  11979. * @memberOf Hash
  11980. * @param {string} key The key of the value to get.
  11981. * @returns {*} Returns the entry value.
  11982. */
  11983. function hashGet(key) {
  11984. var data = this.__data__;
  11985. if (nativeCreate) {
  11986. var result = data[key];
  11987. return result === HASH_UNDEFINED ? undefined : result;
  11988. }
  11989. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  11990. }
  11991. /**
  11992. * Checks if a hash value for `key` exists.
  11993. *
  11994. * @private
  11995. * @name has
  11996. * @memberOf Hash
  11997. * @param {string} key The key of the entry to check.
  11998. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11999. */
  12000. function hashHas(key) {
  12001. var data = this.__data__;
  12002. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12003. }
  12004. /**
  12005. * Sets the hash `key` to `value`.
  12006. *
  12007. * @private
  12008. * @name set
  12009. * @memberOf Hash
  12010. * @param {string} key The key of the value to set.
  12011. * @param {*} value The value to set.
  12012. * @returns {Object} Returns the hash instance.
  12013. */
  12014. function hashSet(key, value) {
  12015. var data = this.__data__;
  12016. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12017. return this;
  12018. }
  12019. // Add methods to `Hash`.
  12020. Hash.prototype.clear = hashClear;
  12021. Hash.prototype['delete'] = hashDelete;
  12022. Hash.prototype.get = hashGet;
  12023. Hash.prototype.has = hashHas;
  12024. Hash.prototype.set = hashSet;
  12025. /**
  12026. * Creates an list cache object.
  12027. *
  12028. * @private
  12029. * @constructor
  12030. * @param {Array} [entries] The key-value pairs to cache.
  12031. */
  12032. function ListCache(entries) {
  12033. var index = -1,
  12034. length = entries ? entries.length : 0;
  12035. this.clear();
  12036. while (++index < length) {
  12037. var entry = entries[index];
  12038. this.set(entry[0], entry[1]);
  12039. }
  12040. }
  12041. /**
  12042. * Removes all key-value entries from the list cache.
  12043. *
  12044. * @private
  12045. * @name clear
  12046. * @memberOf ListCache
  12047. */
  12048. function listCacheClear() {
  12049. this.__data__ = [];
  12050. }
  12051. /**
  12052. * Removes `key` and its value from the list cache.
  12053. *
  12054. * @private
  12055. * @name delete
  12056. * @memberOf ListCache
  12057. * @param {string} key The key of the value to remove.
  12058. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12059. */
  12060. function listCacheDelete(key) {
  12061. var data = this.__data__,
  12062. index = assocIndexOf(data, key);
  12063. if (index < 0) {
  12064. return false;
  12065. }
  12066. var lastIndex = data.length - 1;
  12067. if (index == lastIndex) {
  12068. data.pop();
  12069. } else {
  12070. splice.call(data, index, 1);
  12071. }
  12072. return true;
  12073. }
  12074. /**
  12075. * Gets the list cache value for `key`.
  12076. *
  12077. * @private
  12078. * @name get
  12079. * @memberOf ListCache
  12080. * @param {string} key The key of the value to get.
  12081. * @returns {*} Returns the entry value.
  12082. */
  12083. function listCacheGet(key) {
  12084. var data = this.__data__,
  12085. index = assocIndexOf(data, key);
  12086. return index < 0 ? undefined : data[index][1];
  12087. }
  12088. /**
  12089. * Checks if a list cache value for `key` exists.
  12090. *
  12091. * @private
  12092. * @name has
  12093. * @memberOf ListCache
  12094. * @param {string} key The key of the entry to check.
  12095. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12096. */
  12097. function listCacheHas(key) {
  12098. return assocIndexOf(this.__data__, key) > -1;
  12099. }
  12100. /**
  12101. * Sets the list cache `key` to `value`.
  12102. *
  12103. * @private
  12104. * @name set
  12105. * @memberOf ListCache
  12106. * @param {string} key The key of the value to set.
  12107. * @param {*} value The value to set.
  12108. * @returns {Object} Returns the list cache instance.
  12109. */
  12110. function listCacheSet(key, value) {
  12111. var data = this.__data__,
  12112. index = assocIndexOf(data, key);
  12113. if (index < 0) {
  12114. data.push([key, value]);
  12115. } else {
  12116. data[index][1] = value;
  12117. }
  12118. return this;
  12119. }
  12120. // Add methods to `ListCache`.
  12121. ListCache.prototype.clear = listCacheClear;
  12122. ListCache.prototype['delete'] = listCacheDelete;
  12123. ListCache.prototype.get = listCacheGet;
  12124. ListCache.prototype.has = listCacheHas;
  12125. ListCache.prototype.set = listCacheSet;
  12126. /**
  12127. * Creates a map cache object to store key-value pairs.
  12128. *
  12129. * @private
  12130. * @constructor
  12131. * @param {Array} [entries] The key-value pairs to cache.
  12132. */
  12133. function MapCache(entries) {
  12134. var index = -1,
  12135. length = entries ? entries.length : 0;
  12136. this.clear();
  12137. while (++index < length) {
  12138. var entry = entries[index];
  12139. this.set(entry[0], entry[1]);
  12140. }
  12141. }
  12142. /**
  12143. * Removes all key-value entries from the map.
  12144. *
  12145. * @private
  12146. * @name clear
  12147. * @memberOf MapCache
  12148. */
  12149. function mapCacheClear() {
  12150. this.__data__ = {
  12151. 'hash': new Hash,
  12152. 'map': new (Map || ListCache),
  12153. 'string': new Hash
  12154. };
  12155. }
  12156. /**
  12157. * Removes `key` and its value from the map.
  12158. *
  12159. * @private
  12160. * @name delete
  12161. * @memberOf MapCache
  12162. * @param {string} key The key of the value to remove.
  12163. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12164. */
  12165. function mapCacheDelete(key) {
  12166. return getMapData(this, key)['delete'](key);
  12167. }
  12168. /**
  12169. * Gets the map value for `key`.
  12170. *
  12171. * @private
  12172. * @name get
  12173. * @memberOf MapCache
  12174. * @param {string} key The key of the value to get.
  12175. * @returns {*} Returns the entry value.
  12176. */
  12177. function mapCacheGet(key) {
  12178. return getMapData(this, key).get(key);
  12179. }
  12180. /**
  12181. * Checks if a map value for `key` exists.
  12182. *
  12183. * @private
  12184. * @name has
  12185. * @memberOf MapCache
  12186. * @param {string} key The key of the entry to check.
  12187. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12188. */
  12189. function mapCacheHas(key) {
  12190. return getMapData(this, key).has(key);
  12191. }
  12192. /**
  12193. * Sets the map `key` to `value`.
  12194. *
  12195. * @private
  12196. * @name set
  12197. * @memberOf MapCache
  12198. * @param {string} key The key of the value to set.
  12199. * @param {*} value The value to set.
  12200. * @returns {Object} Returns the map cache instance.
  12201. */
  12202. function mapCacheSet(key, value) {
  12203. getMapData(this, key).set(key, value);
  12204. return this;
  12205. }
  12206. // Add methods to `MapCache`.
  12207. MapCache.prototype.clear = mapCacheClear;
  12208. MapCache.prototype['delete'] = mapCacheDelete;
  12209. MapCache.prototype.get = mapCacheGet;
  12210. MapCache.prototype.has = mapCacheHas;
  12211. MapCache.prototype.set = mapCacheSet;
  12212. /**
  12213. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12214. *
  12215. * @private
  12216. * @param {Array} array The array to inspect.
  12217. * @param {*} key The key to search for.
  12218. * @returns {number} Returns the index of the matched value, else `-1`.
  12219. */
  12220. function assocIndexOf(array, key) {
  12221. var length = array.length;
  12222. while (length--) {
  12223. if (eq(array[length][0], key)) {
  12224. return length;
  12225. }
  12226. }
  12227. return -1;
  12228. }
  12229. /**
  12230. * The base implementation of `_.get` without support for default values.
  12231. *
  12232. * @private
  12233. * @param {Object} object The object to query.
  12234. * @param {Array|string} path The path of the property to get.
  12235. * @returns {*} Returns the resolved value.
  12236. */
  12237. function baseGet(object, path) {
  12238. path = isKey(path, object) ? [path] : castPath(path);
  12239. var index = 0,
  12240. length = path.length;
  12241. while (object != null && index < length) {
  12242. object = object[toKey(path[index++])];
  12243. }
  12244. return (index && index == length) ? object : undefined;
  12245. }
  12246. /**
  12247. * The base implementation of `_.isNative` without bad shim checks.
  12248. *
  12249. * @private
  12250. * @param {*} value The value to check.
  12251. * @returns {boolean} Returns `true` if `value` is a native function,
  12252. * else `false`.
  12253. */
  12254. function baseIsNative(value) {
  12255. if (!isObject(value) || isMasked(value)) {
  12256. return false;
  12257. }
  12258. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12259. return pattern.test(toSource(value));
  12260. }
  12261. /**
  12262. * The base implementation of `_.toString` which doesn't convert nullish
  12263. * values to empty strings.
  12264. *
  12265. * @private
  12266. * @param {*} value The value to process.
  12267. * @returns {string} Returns the string.
  12268. */
  12269. function baseToString(value) {
  12270. // Exit early for strings to avoid a performance hit in some environments.
  12271. if (typeof value == 'string') {
  12272. return value;
  12273. }
  12274. if (isSymbol(value)) {
  12275. return symbolToString ? symbolToString.call(value) : '';
  12276. }
  12277. var result = (value + '');
  12278. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12279. }
  12280. /**
  12281. * Casts `value` to a path array if it's not one.
  12282. *
  12283. * @private
  12284. * @param {*} value The value to inspect.
  12285. * @returns {Array} Returns the cast property path array.
  12286. */
  12287. function castPath(value) {
  12288. return isArray(value) ? value : stringToPath(value);
  12289. }
  12290. /**
  12291. * Gets the data for `map`.
  12292. *
  12293. * @private
  12294. * @param {Object} map The map to query.
  12295. * @param {string} key The reference key.
  12296. * @returns {*} Returns the map data.
  12297. */
  12298. function getMapData(map, key) {
  12299. var data = map.__data__;
  12300. return isKeyable(key)
  12301. ? data[typeof key == 'string' ? 'string' : 'hash']
  12302. : data.map;
  12303. }
  12304. /**
  12305. * Gets the native function at `key` of `object`.
  12306. *
  12307. * @private
  12308. * @param {Object} object The object to query.
  12309. * @param {string} key The key of the method to get.
  12310. * @returns {*} Returns the function if it's native, else `undefined`.
  12311. */
  12312. function getNative(object, key) {
  12313. var value = getValue(object, key);
  12314. return baseIsNative(value) ? value : undefined;
  12315. }
  12316. /**
  12317. * Checks if `value` is a property name and not a property path.
  12318. *
  12319. * @private
  12320. * @param {*} value The value to check.
  12321. * @param {Object} [object] The object to query keys on.
  12322. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12323. */
  12324. function isKey(value, object) {
  12325. if (isArray(value)) {
  12326. return false;
  12327. }
  12328. var type = typeof value;
  12329. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12330. value == null || isSymbol(value)) {
  12331. return true;
  12332. }
  12333. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12334. (object != null && value in Object(object));
  12335. }
  12336. /**
  12337. * Checks if `value` is suitable for use as unique object key.
  12338. *
  12339. * @private
  12340. * @param {*} value The value to check.
  12341. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12342. */
  12343. function isKeyable(value) {
  12344. var type = typeof value;
  12345. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12346. ? (value !== '__proto__')
  12347. : (value === null);
  12348. }
  12349. /**
  12350. * Checks if `func` has its source masked.
  12351. *
  12352. * @private
  12353. * @param {Function} func The function to check.
  12354. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12355. */
  12356. function isMasked(func) {
  12357. return !!maskSrcKey && (maskSrcKey in func);
  12358. }
  12359. /**
  12360. * Converts `string` to a property path array.
  12361. *
  12362. * @private
  12363. * @param {string} string The string to convert.
  12364. * @returns {Array} Returns the property path array.
  12365. */
  12366. var stringToPath = memoize(function(string) {
  12367. string = toString(string);
  12368. var result = [];
  12369. if (reLeadingDot.test(string)) {
  12370. result.push('');
  12371. }
  12372. string.replace(rePropName, function(match, number, quote, string) {
  12373. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  12374. });
  12375. return result;
  12376. });
  12377. /**
  12378. * Converts `value` to a string key if it's not a string or symbol.
  12379. *
  12380. * @private
  12381. * @param {*} value The value to inspect.
  12382. * @returns {string|symbol} Returns the key.
  12383. */
  12384. function toKey(value) {
  12385. if (typeof value == 'string' || isSymbol(value)) {
  12386. return value;
  12387. }
  12388. var result = (value + '');
  12389. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12390. }
  12391. /**
  12392. * Converts `func` to its source code.
  12393. *
  12394. * @private
  12395. * @param {Function} func The function to process.
  12396. * @returns {string} Returns the source code.
  12397. */
  12398. function toSource(func) {
  12399. if (func != null) {
  12400. try {
  12401. return funcToString.call(func);
  12402. } catch (e) {}
  12403. try {
  12404. return (func + '');
  12405. } catch (e) {}
  12406. }
  12407. return '';
  12408. }
  12409. /**
  12410. * Creates a function that memoizes the result of `func`. If `resolver` is
  12411. * provided, it determines the cache key for storing the result based on the
  12412. * arguments provided to the memoized function. By default, the first argument
  12413. * provided to the memoized function is used as the map cache key. The `func`
  12414. * is invoked with the `this` binding of the memoized function.
  12415. *
  12416. * **Note:** The cache is exposed as the `cache` property on the memoized
  12417. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  12418. * constructor with one whose instances implement the
  12419. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  12420. * method interface of `delete`, `get`, `has`, and `set`.
  12421. *
  12422. * @static
  12423. * @memberOf _
  12424. * @since 0.1.0
  12425. * @category Function
  12426. * @param {Function} func The function to have its output memoized.
  12427. * @param {Function} [resolver] The function to resolve the cache key.
  12428. * @returns {Function} Returns the new memoized function.
  12429. * @example
  12430. *
  12431. * var object = { 'a': 1, 'b': 2 };
  12432. * var other = { 'c': 3, 'd': 4 };
  12433. *
  12434. * var values = _.memoize(_.values);
  12435. * values(object);
  12436. * // => [1, 2]
  12437. *
  12438. * values(other);
  12439. * // => [3, 4]
  12440. *
  12441. * object.a = 2;
  12442. * values(object);
  12443. * // => [1, 2]
  12444. *
  12445. * // Modify the result cache.
  12446. * values.cache.set(object, ['a', 'b']);
  12447. * values(object);
  12448. * // => ['a', 'b']
  12449. *
  12450. * // Replace `_.memoize.Cache`.
  12451. * _.memoize.Cache = WeakMap;
  12452. */
  12453. function memoize(func, resolver) {
  12454. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  12455. throw new TypeError(FUNC_ERROR_TEXT);
  12456. }
  12457. var memoized = function() {
  12458. var args = arguments,
  12459. key = resolver ? resolver.apply(this, args) : args[0],
  12460. cache = memoized.cache;
  12461. if (cache.has(key)) {
  12462. return cache.get(key);
  12463. }
  12464. var result = func.apply(this, args);
  12465. memoized.cache = cache.set(key, result);
  12466. return result;
  12467. };
  12468. memoized.cache = new (memoize.Cache || MapCache);
  12469. return memoized;
  12470. }
  12471. // Assign cache to `_.memoize`.
  12472. memoize.Cache = MapCache;
  12473. /**
  12474. * Performs a
  12475. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12476. * comparison between two values to determine if they are equivalent.
  12477. *
  12478. * @static
  12479. * @memberOf _
  12480. * @since 4.0.0
  12481. * @category Lang
  12482. * @param {*} value The value to compare.
  12483. * @param {*} other The other value to compare.
  12484. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12485. * @example
  12486. *
  12487. * var object = { 'a': 1 };
  12488. * var other = { 'a': 1 };
  12489. *
  12490. * _.eq(object, object);
  12491. * // => true
  12492. *
  12493. * _.eq(object, other);
  12494. * // => false
  12495. *
  12496. * _.eq('a', 'a');
  12497. * // => true
  12498. *
  12499. * _.eq('a', Object('a'));
  12500. * // => false
  12501. *
  12502. * _.eq(NaN, NaN);
  12503. * // => true
  12504. */
  12505. function eq(value, other) {
  12506. return value === other || (value !== value && other !== other);
  12507. }
  12508. /**
  12509. * Checks if `value` is classified as an `Array` object.
  12510. *
  12511. * @static
  12512. * @memberOf _
  12513. * @since 0.1.0
  12514. * @category Lang
  12515. * @param {*} value The value to check.
  12516. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12517. * @example
  12518. *
  12519. * _.isArray([1, 2, 3]);
  12520. * // => true
  12521. *
  12522. * _.isArray(document.body.children);
  12523. * // => false
  12524. *
  12525. * _.isArray('abc');
  12526. * // => false
  12527. *
  12528. * _.isArray(_.noop);
  12529. * // => false
  12530. */
  12531. var isArray = Array.isArray;
  12532. /**
  12533. * Checks if `value` is classified as a `Function` object.
  12534. *
  12535. * @static
  12536. * @memberOf _
  12537. * @since 0.1.0
  12538. * @category Lang
  12539. * @param {*} value The value to check.
  12540. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12541. * @example
  12542. *
  12543. * _.isFunction(_);
  12544. * // => true
  12545. *
  12546. * _.isFunction(/abc/);
  12547. * // => false
  12548. */
  12549. function isFunction(value) {
  12550. // The use of `Object#toString` avoids issues with the `typeof` operator
  12551. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  12552. var tag = isObject(value) ? objectToString.call(value) : '';
  12553. return tag == funcTag || tag == genTag;
  12554. }
  12555. /**
  12556. * Checks if `value` is the
  12557. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12558. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12559. *
  12560. * @static
  12561. * @memberOf _
  12562. * @since 0.1.0
  12563. * @category Lang
  12564. * @param {*} value The value to check.
  12565. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12566. * @example
  12567. *
  12568. * _.isObject({});
  12569. * // => true
  12570. *
  12571. * _.isObject([1, 2, 3]);
  12572. * // => true
  12573. *
  12574. * _.isObject(_.noop);
  12575. * // => true
  12576. *
  12577. * _.isObject(null);
  12578. * // => false
  12579. */
  12580. function isObject(value) {
  12581. var type = typeof value;
  12582. return !!value && (type == 'object' || type == 'function');
  12583. }
  12584. /**
  12585. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12586. * and has a `typeof` result of "object".
  12587. *
  12588. * @static
  12589. * @memberOf _
  12590. * @since 4.0.0
  12591. * @category Lang
  12592. * @param {*} value The value to check.
  12593. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12594. * @example
  12595. *
  12596. * _.isObjectLike({});
  12597. * // => true
  12598. *
  12599. * _.isObjectLike([1, 2, 3]);
  12600. * // => true
  12601. *
  12602. * _.isObjectLike(_.noop);
  12603. * // => false
  12604. *
  12605. * _.isObjectLike(null);
  12606. * // => false
  12607. */
  12608. function isObjectLike(value) {
  12609. return !!value && typeof value == 'object';
  12610. }
  12611. /**
  12612. * Checks if `value` is classified as a `Symbol` primitive or object.
  12613. *
  12614. * @static
  12615. * @memberOf _
  12616. * @since 4.0.0
  12617. * @category Lang
  12618. * @param {*} value The value to check.
  12619. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12620. * @example
  12621. *
  12622. * _.isSymbol(Symbol.iterator);
  12623. * // => true
  12624. *
  12625. * _.isSymbol('abc');
  12626. * // => false
  12627. */
  12628. function isSymbol(value) {
  12629. return typeof value == 'symbol' ||
  12630. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  12631. }
  12632. /**
  12633. * Converts `value` to a string. An empty string is returned for `null`
  12634. * and `undefined` values. The sign of `-0` is preserved.
  12635. *
  12636. * @static
  12637. * @memberOf _
  12638. * @since 4.0.0
  12639. * @category Lang
  12640. * @param {*} value The value to process.
  12641. * @returns {string} Returns the string.
  12642. * @example
  12643. *
  12644. * _.toString(null);
  12645. * // => ''
  12646. *
  12647. * _.toString(-0);
  12648. * // => '-0'
  12649. *
  12650. * _.toString([1, 2, 3]);
  12651. * // => '1,2,3'
  12652. */
  12653. function toString(value) {
  12654. return value == null ? '' : baseToString(value);
  12655. }
  12656. /**
  12657. * Gets the value at `path` of `object`. If the resolved value is
  12658. * `undefined`, the `defaultValue` is returned in its place.
  12659. *
  12660. * @static
  12661. * @memberOf _
  12662. * @since 3.7.0
  12663. * @category Object
  12664. * @param {Object} object The object to query.
  12665. * @param {Array|string} path The path of the property to get.
  12666. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  12667. * @returns {*} Returns the resolved value.
  12668. * @example
  12669. *
  12670. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  12671. *
  12672. * _.get(object, 'a[0].b.c');
  12673. * // => 3
  12674. *
  12675. * _.get(object, ['a', '0', 'b', 'c']);
  12676. * // => 3
  12677. *
  12678. * _.get(object, 'a.b.c', 'default');
  12679. * // => 'default'
  12680. */
  12681. function get(object, path, defaultValue) {
  12682. var result = object == null ? undefined : baseGet(object, path);
  12683. return result === undefined ? defaultValue : result;
  12684. }
  12685. module.exports = get;
  12686. /***/ }),
  12687. /***/ 855:
  12688. /***/ (function(module, __unusedexports, __webpack_require__) {
  12689. module.exports = registerPlugin;
  12690. const factory = __webpack_require__(47);
  12691. function registerPlugin(plugins, pluginFunction) {
  12692. return factory(
  12693. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  12694. );
  12695. }
  12696. /***/ }),
  12697. /***/ 856:
  12698. /***/ (function(module, __unusedexports, __webpack_require__) {
  12699. module.exports = __webpack_require__(141);
  12700. /***/ }),
  12701. /***/ 863:
  12702. /***/ (function(module, __unusedexports, __webpack_require__) {
  12703. module.exports = authenticationBeforeRequest;
  12704. const btoa = __webpack_require__(675);
  12705. const withAuthorizationPrefix = __webpack_require__(143);
  12706. function authenticationBeforeRequest(state, options) {
  12707. if (typeof state.auth === "string") {
  12708. options.headers.authorization = withAuthorizationPrefix(state.auth);
  12709. return;
  12710. }
  12711. if (state.auth.username) {
  12712. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  12713. options.headers.authorization = `Basic ${hash}`;
  12714. if (state.otp) {
  12715. options.headers["x-github-otp"] = state.otp;
  12716. }
  12717. return;
  12718. }
  12719. if (state.auth.clientId) {
  12720. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  12721. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  12722. // URL though: `/applications/:client_id/tokens/:access_token`.
  12723. //
  12724. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  12725. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  12726. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  12727. //
  12728. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  12729. // as well as "/applications/123/tokens/token456"
  12730. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  12731. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  12732. options.headers.authorization = `Basic ${hash}`;
  12733. return;
  12734. }
  12735. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  12736. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  12737. return;
  12738. }
  12739. return Promise.resolve()
  12740. .then(() => {
  12741. return state.auth();
  12742. })
  12743. .then(authorization => {
  12744. options.headers.authorization = withAuthorizationPrefix(authorization);
  12745. });
  12746. }
  12747. /***/ }),
  12748. /***/ 866:
  12749. /***/ (function(module, __unusedexports, __webpack_require__) {
  12750. "use strict";
  12751. var shebangRegex = __webpack_require__(816);
  12752. module.exports = function (str) {
  12753. var match = str.match(shebangRegex);
  12754. if (!match) {
  12755. return null;
  12756. }
  12757. var arr = match[0].replace(/#! ?/, '').split(' ');
  12758. var bin = arr[0].split('/').pop();
  12759. var arg = arr[1];
  12760. return (bin === 'env' ?
  12761. arg :
  12762. bin + (arg ? ' ' + arg : '')
  12763. );
  12764. };
  12765. /***/ }),
  12766. /***/ 874:
  12767. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12768. "use strict";
  12769. // Copyright (c) Microsoft. All rights reserved.
  12770. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  12771. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  12772. return new (P || (P = Promise))(function (resolve, reject) {
  12773. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  12774. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  12775. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  12776. step((generator = generator.apply(thisArg, _arguments || [])).next());
  12777. });
  12778. };
  12779. Object.defineProperty(exports, "__esModule", { value: true });
  12780. const url = __webpack_require__(835);
  12781. const http = __webpack_require__(605);
  12782. const https = __webpack_require__(211);
  12783. let fs;
  12784. let tunnel;
  12785. var HttpCodes;
  12786. (function (HttpCodes) {
  12787. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  12788. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  12789. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  12790. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  12791. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  12792. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  12793. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  12794. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  12795. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  12796. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  12797. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  12798. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  12799. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  12800. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  12801. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  12802. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  12803. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  12804. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  12805. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  12806. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  12807. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  12808. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  12809. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  12810. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  12811. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  12812. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  12813. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  12814. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  12815. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  12816. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  12817. const ExponentialBackoffCeiling = 10;
  12818. const ExponentialBackoffTimeSlice = 5;
  12819. class HttpClientResponse {
  12820. constructor(message) {
  12821. this.message = message;
  12822. }
  12823. readBody() {
  12824. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  12825. let output = '';
  12826. this.message.on('data', (chunk) => {
  12827. output += chunk;
  12828. });
  12829. this.message.on('end', () => {
  12830. resolve(output);
  12831. });
  12832. }));
  12833. }
  12834. }
  12835. exports.HttpClientResponse = HttpClientResponse;
  12836. function isHttps(requestUrl) {
  12837. let parsedUrl = url.parse(requestUrl);
  12838. return parsedUrl.protocol === 'https:';
  12839. }
  12840. exports.isHttps = isHttps;
  12841. var EnvironmentVariables;
  12842. (function (EnvironmentVariables) {
  12843. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  12844. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  12845. })(EnvironmentVariables || (EnvironmentVariables = {}));
  12846. class HttpClient {
  12847. constructor(userAgent, handlers, requestOptions) {
  12848. this._ignoreSslError = false;
  12849. this._allowRedirects = true;
  12850. this._maxRedirects = 50;
  12851. this._allowRetries = false;
  12852. this._maxRetries = 1;
  12853. this._keepAlive = false;
  12854. this._disposed = false;
  12855. this.userAgent = userAgent;
  12856. this.handlers = handlers || [];
  12857. this.requestOptions = requestOptions;
  12858. if (requestOptions) {
  12859. if (requestOptions.ignoreSslError != null) {
  12860. this._ignoreSslError = requestOptions.ignoreSslError;
  12861. }
  12862. this._socketTimeout = requestOptions.socketTimeout;
  12863. this._httpProxy = requestOptions.proxy;
  12864. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  12865. this._httpProxyBypassHosts = [];
  12866. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  12867. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  12868. });
  12869. }
  12870. this._certConfig = requestOptions.cert;
  12871. if (this._certConfig) {
  12872. // If using cert, need fs
  12873. fs = __webpack_require__(747);
  12874. // cache the cert content into memory, so we don't have to read it from disk every time
  12875. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  12876. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  12877. }
  12878. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  12879. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  12880. }
  12881. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  12882. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  12883. }
  12884. }
  12885. if (requestOptions.allowRedirects != null) {
  12886. this._allowRedirects = requestOptions.allowRedirects;
  12887. }
  12888. if (requestOptions.maxRedirects != null) {
  12889. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  12890. }
  12891. if (requestOptions.keepAlive != null) {
  12892. this._keepAlive = requestOptions.keepAlive;
  12893. }
  12894. if (requestOptions.allowRetries != null) {
  12895. this._allowRetries = requestOptions.allowRetries;
  12896. }
  12897. if (requestOptions.maxRetries != null) {
  12898. this._maxRetries = requestOptions.maxRetries;
  12899. }
  12900. }
  12901. }
  12902. options(requestUrl, additionalHeaders) {
  12903. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  12904. }
  12905. get(requestUrl, additionalHeaders) {
  12906. return this.request('GET', requestUrl, null, additionalHeaders || {});
  12907. }
  12908. del(requestUrl, additionalHeaders) {
  12909. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  12910. }
  12911. post(requestUrl, data, additionalHeaders) {
  12912. return this.request('POST', requestUrl, data, additionalHeaders || {});
  12913. }
  12914. patch(requestUrl, data, additionalHeaders) {
  12915. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  12916. }
  12917. put(requestUrl, data, additionalHeaders) {
  12918. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  12919. }
  12920. head(requestUrl, additionalHeaders) {
  12921. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  12922. }
  12923. sendStream(verb, requestUrl, stream, additionalHeaders) {
  12924. return this.request(verb, requestUrl, stream, additionalHeaders);
  12925. }
  12926. /**
  12927. * Makes a raw http request.
  12928. * All other methods such as get, post, patch, and request ultimately call this.
  12929. * Prefer get, del, post and patch
  12930. */
  12931. request(verb, requestUrl, data, headers) {
  12932. return __awaiter(this, void 0, void 0, function* () {
  12933. if (this._disposed) {
  12934. throw new Error("Client has already been disposed.");
  12935. }
  12936. let info = this._prepareRequest(verb, requestUrl, headers);
  12937. // Only perform retries on reads since writes may not be idempotent.
  12938. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  12939. let numTries = 0;
  12940. let response;
  12941. while (numTries < maxTries) {
  12942. response = yield this.requestRaw(info, data);
  12943. // Check if it's an authentication challenge
  12944. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  12945. let authenticationHandler;
  12946. for (let i = 0; i < this.handlers.length; i++) {
  12947. if (this.handlers[i].canHandleAuthentication(response)) {
  12948. authenticationHandler = this.handlers[i];
  12949. break;
  12950. }
  12951. }
  12952. if (authenticationHandler) {
  12953. return authenticationHandler.handleAuthentication(this, info, data);
  12954. }
  12955. else {
  12956. // We have received an unauthorized response but have no handlers to handle it.
  12957. // Let the response return to the caller.
  12958. return response;
  12959. }
  12960. }
  12961. let redirectsRemaining = this._maxRedirects;
  12962. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  12963. && this._allowRedirects
  12964. && redirectsRemaining > 0) {
  12965. const redirectUrl = response.message.headers["location"];
  12966. if (!redirectUrl) {
  12967. // if there's no location to redirect to, we won't
  12968. break;
  12969. }
  12970. // we need to finish reading the response before reassigning response
  12971. // which will leak the open socket.
  12972. yield response.readBody();
  12973. // let's make the request with the new redirectUrl
  12974. info = this._prepareRequest(verb, redirectUrl, headers);
  12975. response = yield this.requestRaw(info, data);
  12976. redirectsRemaining--;
  12977. }
  12978. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  12979. // If not a retry code, return immediately instead of retrying
  12980. return response;
  12981. }
  12982. numTries += 1;
  12983. if (numTries < maxTries) {
  12984. yield response.readBody();
  12985. yield this._performExponentialBackoff(numTries);
  12986. }
  12987. }
  12988. return response;
  12989. });
  12990. }
  12991. /**
  12992. * Needs to be called if keepAlive is set to true in request options.
  12993. */
  12994. dispose() {
  12995. if (this._agent) {
  12996. this._agent.destroy();
  12997. }
  12998. this._disposed = true;
  12999. }
  13000. /**
  13001. * Raw request.
  13002. * @param info
  13003. * @param data
  13004. */
  13005. requestRaw(info, data) {
  13006. return new Promise((resolve, reject) => {
  13007. let callbackForResult = function (err, res) {
  13008. if (err) {
  13009. reject(err);
  13010. }
  13011. resolve(res);
  13012. };
  13013. this.requestRawWithCallback(info, data, callbackForResult);
  13014. });
  13015. }
  13016. /**
  13017. * Raw request with callback.
  13018. * @param info
  13019. * @param data
  13020. * @param onResult
  13021. */
  13022. requestRawWithCallback(info, data, onResult) {
  13023. let socket;
  13024. let isDataString = typeof (data) === 'string';
  13025. if (typeof (data) === 'string') {
  13026. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13027. }
  13028. let callbackCalled = false;
  13029. let handleResult = (err, res) => {
  13030. if (!callbackCalled) {
  13031. callbackCalled = true;
  13032. onResult(err, res);
  13033. }
  13034. };
  13035. let req = info.httpModule.request(info.options, (msg) => {
  13036. let res = new HttpClientResponse(msg);
  13037. handleResult(null, res);
  13038. });
  13039. req.on('socket', (sock) => {
  13040. socket = sock;
  13041. });
  13042. // If we ever get disconnected, we want the socket to timeout eventually
  13043. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13044. if (socket) {
  13045. socket.end();
  13046. }
  13047. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13048. });
  13049. req.on('error', function (err) {
  13050. // err has statusCode property
  13051. // res should have headers
  13052. handleResult(err, null);
  13053. });
  13054. if (data && typeof (data) === 'string') {
  13055. req.write(data, 'utf8');
  13056. }
  13057. if (data && typeof (data) !== 'string') {
  13058. data.on('close', function () {
  13059. req.end();
  13060. });
  13061. data.pipe(req);
  13062. }
  13063. else {
  13064. req.end();
  13065. }
  13066. }
  13067. _prepareRequest(method, requestUrl, headers) {
  13068. const info = {};
  13069. info.parsedUrl = url.parse(requestUrl);
  13070. const usingSsl = info.parsedUrl.protocol === 'https:';
  13071. info.httpModule = usingSsl ? https : http;
  13072. const defaultPort = usingSsl ? 443 : 80;
  13073. info.options = {};
  13074. info.options.host = info.parsedUrl.hostname;
  13075. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13076. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13077. info.options.method = method;
  13078. info.options.headers = this._mergeHeaders(headers);
  13079. info.options.headers["user-agent"] = this.userAgent;
  13080. info.options.agent = this._getAgent(requestUrl);
  13081. // gives handlers an opportunity to participate
  13082. if (this.handlers && !this._isPresigned(requestUrl)) {
  13083. this.handlers.forEach((handler) => {
  13084. handler.prepareRequest(info.options);
  13085. });
  13086. }
  13087. return info;
  13088. }
  13089. _isPresigned(requestUrl) {
  13090. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13091. const patterns = this.requestOptions.presignedUrlPatterns;
  13092. for (let i = 0; i < patterns.length; i++) {
  13093. if (requestUrl.match(patterns[i])) {
  13094. return true;
  13095. }
  13096. }
  13097. }
  13098. return false;
  13099. }
  13100. _mergeHeaders(headers) {
  13101. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13102. if (this.requestOptions && this.requestOptions.headers) {
  13103. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13104. }
  13105. return lowercaseKeys(headers || {});
  13106. }
  13107. _getAgent(requestUrl) {
  13108. let agent;
  13109. let proxy = this._getProxy(requestUrl);
  13110. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13111. if (this._keepAlive && useProxy) {
  13112. agent = this._proxyAgent;
  13113. }
  13114. if (this._keepAlive && !useProxy) {
  13115. agent = this._agent;
  13116. }
  13117. // if agent is already assigned use that agent.
  13118. if (!!agent) {
  13119. return agent;
  13120. }
  13121. let parsedUrl = url.parse(requestUrl);
  13122. const usingSsl = parsedUrl.protocol === 'https:';
  13123. let maxSockets = 100;
  13124. if (!!this.requestOptions) {
  13125. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13126. }
  13127. if (useProxy) {
  13128. // If using proxy, need tunnel
  13129. if (!tunnel) {
  13130. tunnel = __webpack_require__(856);
  13131. }
  13132. const agentOptions = {
  13133. maxSockets: maxSockets,
  13134. keepAlive: this._keepAlive,
  13135. proxy: {
  13136. proxyAuth: proxy.proxyAuth,
  13137. host: proxy.proxyUrl.hostname,
  13138. port: proxy.proxyUrl.port
  13139. },
  13140. };
  13141. let tunnelAgent;
  13142. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13143. if (usingSsl) {
  13144. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13145. }
  13146. else {
  13147. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13148. }
  13149. agent = tunnelAgent(agentOptions);
  13150. this._proxyAgent = agent;
  13151. }
  13152. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13153. if (this._keepAlive && !agent) {
  13154. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13155. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13156. this._agent = agent;
  13157. }
  13158. // if not using private agent and tunnel agent isn't setup then use global agent
  13159. if (!agent) {
  13160. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13161. }
  13162. if (usingSsl && this._ignoreSslError) {
  13163. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13164. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13165. // we have to cast it to any and change it directly
  13166. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13167. }
  13168. if (usingSsl && this._certConfig) {
  13169. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13170. }
  13171. return agent;
  13172. }
  13173. _getProxy(requestUrl) {
  13174. const parsedUrl = url.parse(requestUrl);
  13175. let usingSsl = parsedUrl.protocol === 'https:';
  13176. let proxyConfig = this._httpProxy;
  13177. // fallback to http_proxy and https_proxy env
  13178. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13179. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13180. if (!proxyConfig) {
  13181. if (https_proxy && usingSsl) {
  13182. proxyConfig = {
  13183. proxyUrl: https_proxy
  13184. };
  13185. }
  13186. else if (http_proxy) {
  13187. proxyConfig = {
  13188. proxyUrl: http_proxy
  13189. };
  13190. }
  13191. }
  13192. let proxyUrl;
  13193. let proxyAuth;
  13194. if (proxyConfig) {
  13195. if (proxyConfig.proxyUrl.length > 0) {
  13196. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13197. }
  13198. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13199. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13200. }
  13201. }
  13202. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13203. }
  13204. _isBypassProxy(requestUrl) {
  13205. if (!this._httpProxyBypassHosts) {
  13206. return false;
  13207. }
  13208. let bypass = false;
  13209. this._httpProxyBypassHosts.forEach(bypassHost => {
  13210. if (bypassHost.test(requestUrl)) {
  13211. bypass = true;
  13212. }
  13213. });
  13214. return bypass;
  13215. }
  13216. _performExponentialBackoff(retryNumber) {
  13217. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13218. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13219. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13220. }
  13221. }
  13222. exports.HttpClient = HttpClient;
  13223. /***/ }),
  13224. /***/ 881:
  13225. /***/ (function(module) {
  13226. "use strict";
  13227. const isWin = process.platform === 'win32';
  13228. function notFoundError(original, syscall) {
  13229. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13230. code: 'ENOENT',
  13231. errno: 'ENOENT',
  13232. syscall: `${syscall} ${original.command}`,
  13233. path: original.command,
  13234. spawnargs: original.args,
  13235. });
  13236. }
  13237. function hookChildProcess(cp, parsed) {
  13238. if (!isWin) {
  13239. return;
  13240. }
  13241. const originalEmit = cp.emit;
  13242. cp.emit = function (name, arg1) {
  13243. // If emitting "exit" event and exit code is 1, we need to check if
  13244. // the command exists and emit an "error" instead
  13245. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13246. if (name === 'exit') {
  13247. const err = verifyENOENT(arg1, parsed, 'spawn');
  13248. if (err) {
  13249. return originalEmit.call(cp, 'error', err);
  13250. }
  13251. }
  13252. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13253. };
  13254. }
  13255. function verifyENOENT(status, parsed) {
  13256. if (isWin && status === 1 && !parsed.file) {
  13257. return notFoundError(parsed.original, 'spawn');
  13258. }
  13259. return null;
  13260. }
  13261. function verifyENOENTSync(status, parsed) {
  13262. if (isWin && status === 1 && !parsed.file) {
  13263. return notFoundError(parsed.original, 'spawnSync');
  13264. }
  13265. return null;
  13266. }
  13267. module.exports = {
  13268. hookChildProcess,
  13269. verifyENOENT,
  13270. verifyENOENTSync,
  13271. notFoundError,
  13272. };
  13273. /***/ }),
  13274. /***/ 883:
  13275. /***/ (function(module) {
  13276. /**
  13277. * lodash (Custom Build) <https://lodash.com/>
  13278. * Build: `lodash modularize exports="npm" -o ./`
  13279. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13280. * Released under MIT license <https://lodash.com/license>
  13281. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13282. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13283. */
  13284. /** Used as the `TypeError` message for "Functions" methods. */
  13285. var FUNC_ERROR_TEXT = 'Expected a function';
  13286. /** Used to stand-in for `undefined` hash values. */
  13287. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13288. /** Used as references for various `Number` constants. */
  13289. var INFINITY = 1 / 0,
  13290. MAX_SAFE_INTEGER = 9007199254740991;
  13291. /** `Object#toString` result references. */
  13292. var funcTag = '[object Function]',
  13293. genTag = '[object GeneratorFunction]',
  13294. symbolTag = '[object Symbol]';
  13295. /** Used to match property names within property paths. */
  13296. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13297. reIsPlainProp = /^\w*$/,
  13298. reLeadingDot = /^\./,
  13299. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13300. /**
  13301. * Used to match `RegExp`
  13302. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13303. */
  13304. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13305. /** Used to match backslashes in property paths. */
  13306. var reEscapeChar = /\\(\\)?/g;
  13307. /** Used to detect host constructors (Safari). */
  13308. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13309. /** Used to detect unsigned integer values. */
  13310. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13311. /** Detect free variable `global` from Node.js. */
  13312. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13313. /** Detect free variable `self`. */
  13314. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13315. /** Used as a reference to the global object. */
  13316. var root = freeGlobal || freeSelf || Function('return this')();
  13317. /**
  13318. * Gets the value at `key` of `object`.
  13319. *
  13320. * @private
  13321. * @param {Object} [object] The object to query.
  13322. * @param {string} key The key of the property to get.
  13323. * @returns {*} Returns the property value.
  13324. */
  13325. function getValue(object, key) {
  13326. return object == null ? undefined : object[key];
  13327. }
  13328. /**
  13329. * Checks if `value` is a host object in IE < 9.
  13330. *
  13331. * @private
  13332. * @param {*} value The value to check.
  13333. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13334. */
  13335. function isHostObject(value) {
  13336. // Many host objects are `Object` objects that can coerce to strings
  13337. // despite having improperly defined `toString` methods.
  13338. var result = false;
  13339. if (value != null && typeof value.toString != 'function') {
  13340. try {
  13341. result = !!(value + '');
  13342. } catch (e) {}
  13343. }
  13344. return result;
  13345. }
  13346. /** Used for built-in method references. */
  13347. var arrayProto = Array.prototype,
  13348. funcProto = Function.prototype,
  13349. objectProto = Object.prototype;
  13350. /** Used to detect overreaching core-js shims. */
  13351. var coreJsData = root['__core-js_shared__'];
  13352. /** Used to detect methods masquerading as native. */
  13353. var maskSrcKey = (function() {
  13354. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  13355. return uid ? ('Symbol(src)_1.' + uid) : '';
  13356. }());
  13357. /** Used to resolve the decompiled source of functions. */
  13358. var funcToString = funcProto.toString;
  13359. /** Used to check objects for own properties. */
  13360. var hasOwnProperty = objectProto.hasOwnProperty;
  13361. /**
  13362. * Used to resolve the
  13363. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  13364. * of values.
  13365. */
  13366. var objectToString = objectProto.toString;
  13367. /** Used to detect if a method is native. */
  13368. var reIsNative = RegExp('^' +
  13369. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  13370. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  13371. );
  13372. /** Built-in value references. */
  13373. var Symbol = root.Symbol,
  13374. splice = arrayProto.splice;
  13375. /* Built-in method references that are verified to be native. */
  13376. var Map = getNative(root, 'Map'),
  13377. nativeCreate = getNative(Object, 'create');
  13378. /** Used to convert symbols to primitives and strings. */
  13379. var symbolProto = Symbol ? Symbol.prototype : undefined,
  13380. symbolToString = symbolProto ? symbolProto.toString : undefined;
  13381. /**
  13382. * Creates a hash object.
  13383. *
  13384. * @private
  13385. * @constructor
  13386. * @param {Array} [entries] The key-value pairs to cache.
  13387. */
  13388. function Hash(entries) {
  13389. var index = -1,
  13390. length = entries ? entries.length : 0;
  13391. this.clear();
  13392. while (++index < length) {
  13393. var entry = entries[index];
  13394. this.set(entry[0], entry[1]);
  13395. }
  13396. }
  13397. /**
  13398. * Removes all key-value entries from the hash.
  13399. *
  13400. * @private
  13401. * @name clear
  13402. * @memberOf Hash
  13403. */
  13404. function hashClear() {
  13405. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  13406. }
  13407. /**
  13408. * Removes `key` and its value from the hash.
  13409. *
  13410. * @private
  13411. * @name delete
  13412. * @memberOf Hash
  13413. * @param {Object} hash The hash to modify.
  13414. * @param {string} key The key of the value to remove.
  13415. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13416. */
  13417. function hashDelete(key) {
  13418. return this.has(key) && delete this.__data__[key];
  13419. }
  13420. /**
  13421. * Gets the hash value for `key`.
  13422. *
  13423. * @private
  13424. * @name get
  13425. * @memberOf Hash
  13426. * @param {string} key The key of the value to get.
  13427. * @returns {*} Returns the entry value.
  13428. */
  13429. function hashGet(key) {
  13430. var data = this.__data__;
  13431. if (nativeCreate) {
  13432. var result = data[key];
  13433. return result === HASH_UNDEFINED ? undefined : result;
  13434. }
  13435. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  13436. }
  13437. /**
  13438. * Checks if a hash value for `key` exists.
  13439. *
  13440. * @private
  13441. * @name has
  13442. * @memberOf Hash
  13443. * @param {string} key The key of the entry to check.
  13444. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13445. */
  13446. function hashHas(key) {
  13447. var data = this.__data__;
  13448. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  13449. }
  13450. /**
  13451. * Sets the hash `key` to `value`.
  13452. *
  13453. * @private
  13454. * @name set
  13455. * @memberOf Hash
  13456. * @param {string} key The key of the value to set.
  13457. * @param {*} value The value to set.
  13458. * @returns {Object} Returns the hash instance.
  13459. */
  13460. function hashSet(key, value) {
  13461. var data = this.__data__;
  13462. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  13463. return this;
  13464. }
  13465. // Add methods to `Hash`.
  13466. Hash.prototype.clear = hashClear;
  13467. Hash.prototype['delete'] = hashDelete;
  13468. Hash.prototype.get = hashGet;
  13469. Hash.prototype.has = hashHas;
  13470. Hash.prototype.set = hashSet;
  13471. /**
  13472. * Creates an list cache object.
  13473. *
  13474. * @private
  13475. * @constructor
  13476. * @param {Array} [entries] The key-value pairs to cache.
  13477. */
  13478. function ListCache(entries) {
  13479. var index = -1,
  13480. length = entries ? entries.length : 0;
  13481. this.clear();
  13482. while (++index < length) {
  13483. var entry = entries[index];
  13484. this.set(entry[0], entry[1]);
  13485. }
  13486. }
  13487. /**
  13488. * Removes all key-value entries from the list cache.
  13489. *
  13490. * @private
  13491. * @name clear
  13492. * @memberOf ListCache
  13493. */
  13494. function listCacheClear() {
  13495. this.__data__ = [];
  13496. }
  13497. /**
  13498. * Removes `key` and its value from the list cache.
  13499. *
  13500. * @private
  13501. * @name delete
  13502. * @memberOf ListCache
  13503. * @param {string} key The key of the value to remove.
  13504. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13505. */
  13506. function listCacheDelete(key) {
  13507. var data = this.__data__,
  13508. index = assocIndexOf(data, key);
  13509. if (index < 0) {
  13510. return false;
  13511. }
  13512. var lastIndex = data.length - 1;
  13513. if (index == lastIndex) {
  13514. data.pop();
  13515. } else {
  13516. splice.call(data, index, 1);
  13517. }
  13518. return true;
  13519. }
  13520. /**
  13521. * Gets the list cache value for `key`.
  13522. *
  13523. * @private
  13524. * @name get
  13525. * @memberOf ListCache
  13526. * @param {string} key The key of the value to get.
  13527. * @returns {*} Returns the entry value.
  13528. */
  13529. function listCacheGet(key) {
  13530. var data = this.__data__,
  13531. index = assocIndexOf(data, key);
  13532. return index < 0 ? undefined : data[index][1];
  13533. }
  13534. /**
  13535. * Checks if a list cache value for `key` exists.
  13536. *
  13537. * @private
  13538. * @name has
  13539. * @memberOf ListCache
  13540. * @param {string} key The key of the entry to check.
  13541. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13542. */
  13543. function listCacheHas(key) {
  13544. return assocIndexOf(this.__data__, key) > -1;
  13545. }
  13546. /**
  13547. * Sets the list cache `key` to `value`.
  13548. *
  13549. * @private
  13550. * @name set
  13551. * @memberOf ListCache
  13552. * @param {string} key The key of the value to set.
  13553. * @param {*} value The value to set.
  13554. * @returns {Object} Returns the list cache instance.
  13555. */
  13556. function listCacheSet(key, value) {
  13557. var data = this.__data__,
  13558. index = assocIndexOf(data, key);
  13559. if (index < 0) {
  13560. data.push([key, value]);
  13561. } else {
  13562. data[index][1] = value;
  13563. }
  13564. return this;
  13565. }
  13566. // Add methods to `ListCache`.
  13567. ListCache.prototype.clear = listCacheClear;
  13568. ListCache.prototype['delete'] = listCacheDelete;
  13569. ListCache.prototype.get = listCacheGet;
  13570. ListCache.prototype.has = listCacheHas;
  13571. ListCache.prototype.set = listCacheSet;
  13572. /**
  13573. * Creates a map cache object to store key-value pairs.
  13574. *
  13575. * @private
  13576. * @constructor
  13577. * @param {Array} [entries] The key-value pairs to cache.
  13578. */
  13579. function MapCache(entries) {
  13580. var index = -1,
  13581. length = entries ? entries.length : 0;
  13582. this.clear();
  13583. while (++index < length) {
  13584. var entry = entries[index];
  13585. this.set(entry[0], entry[1]);
  13586. }
  13587. }
  13588. /**
  13589. * Removes all key-value entries from the map.
  13590. *
  13591. * @private
  13592. * @name clear
  13593. * @memberOf MapCache
  13594. */
  13595. function mapCacheClear() {
  13596. this.__data__ = {
  13597. 'hash': new Hash,
  13598. 'map': new (Map || ListCache),
  13599. 'string': new Hash
  13600. };
  13601. }
  13602. /**
  13603. * Removes `key` and its value from the map.
  13604. *
  13605. * @private
  13606. * @name delete
  13607. * @memberOf MapCache
  13608. * @param {string} key The key of the value to remove.
  13609. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13610. */
  13611. function mapCacheDelete(key) {
  13612. return getMapData(this, key)['delete'](key);
  13613. }
  13614. /**
  13615. * Gets the map value for `key`.
  13616. *
  13617. * @private
  13618. * @name get
  13619. * @memberOf MapCache
  13620. * @param {string} key The key of the value to get.
  13621. * @returns {*} Returns the entry value.
  13622. */
  13623. function mapCacheGet(key) {
  13624. return getMapData(this, key).get(key);
  13625. }
  13626. /**
  13627. * Checks if a map value for `key` exists.
  13628. *
  13629. * @private
  13630. * @name has
  13631. * @memberOf MapCache
  13632. * @param {string} key The key of the entry to check.
  13633. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13634. */
  13635. function mapCacheHas(key) {
  13636. return getMapData(this, key).has(key);
  13637. }
  13638. /**
  13639. * Sets the map `key` to `value`.
  13640. *
  13641. * @private
  13642. * @name set
  13643. * @memberOf MapCache
  13644. * @param {string} key The key of the value to set.
  13645. * @param {*} value The value to set.
  13646. * @returns {Object} Returns the map cache instance.
  13647. */
  13648. function mapCacheSet(key, value) {
  13649. getMapData(this, key).set(key, value);
  13650. return this;
  13651. }
  13652. // Add methods to `MapCache`.
  13653. MapCache.prototype.clear = mapCacheClear;
  13654. MapCache.prototype['delete'] = mapCacheDelete;
  13655. MapCache.prototype.get = mapCacheGet;
  13656. MapCache.prototype.has = mapCacheHas;
  13657. MapCache.prototype.set = mapCacheSet;
  13658. /**
  13659. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  13660. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13661. * for equality comparisons.
  13662. *
  13663. * @private
  13664. * @param {Object} object The object to modify.
  13665. * @param {string} key The key of the property to assign.
  13666. * @param {*} value The value to assign.
  13667. */
  13668. function assignValue(object, key, value) {
  13669. var objValue = object[key];
  13670. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  13671. (value === undefined && !(key in object))) {
  13672. object[key] = value;
  13673. }
  13674. }
  13675. /**
  13676. * Gets the index at which the `key` is found in `array` of key-value pairs.
  13677. *
  13678. * @private
  13679. * @param {Array} array The array to inspect.
  13680. * @param {*} key The key to search for.
  13681. * @returns {number} Returns the index of the matched value, else `-1`.
  13682. */
  13683. function assocIndexOf(array, key) {
  13684. var length = array.length;
  13685. while (length--) {
  13686. if (eq(array[length][0], key)) {
  13687. return length;
  13688. }
  13689. }
  13690. return -1;
  13691. }
  13692. /**
  13693. * The base implementation of `_.isNative` without bad shim checks.
  13694. *
  13695. * @private
  13696. * @param {*} value The value to check.
  13697. * @returns {boolean} Returns `true` if `value` is a native function,
  13698. * else `false`.
  13699. */
  13700. function baseIsNative(value) {
  13701. if (!isObject(value) || isMasked(value)) {
  13702. return false;
  13703. }
  13704. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  13705. return pattern.test(toSource(value));
  13706. }
  13707. /**
  13708. * The base implementation of `_.set`.
  13709. *
  13710. * @private
  13711. * @param {Object} object The object to modify.
  13712. * @param {Array|string} path The path of the property to set.
  13713. * @param {*} value The value to set.
  13714. * @param {Function} [customizer] The function to customize path creation.
  13715. * @returns {Object} Returns `object`.
  13716. */
  13717. function baseSet(object, path, value, customizer) {
  13718. if (!isObject(object)) {
  13719. return object;
  13720. }
  13721. path = isKey(path, object) ? [path] : castPath(path);
  13722. var index = -1,
  13723. length = path.length,
  13724. lastIndex = length - 1,
  13725. nested = object;
  13726. while (nested != null && ++index < length) {
  13727. var key = toKey(path[index]),
  13728. newValue = value;
  13729. if (index != lastIndex) {
  13730. var objValue = nested[key];
  13731. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  13732. if (newValue === undefined) {
  13733. newValue = isObject(objValue)
  13734. ? objValue
  13735. : (isIndex(path[index + 1]) ? [] : {});
  13736. }
  13737. }
  13738. assignValue(nested, key, newValue);
  13739. nested = nested[key];
  13740. }
  13741. return object;
  13742. }
  13743. /**
  13744. * The base implementation of `_.toString` which doesn't convert nullish
  13745. * values to empty strings.
  13746. *
  13747. * @private
  13748. * @param {*} value The value to process.
  13749. * @returns {string} Returns the string.
  13750. */
  13751. function baseToString(value) {
  13752. // Exit early for strings to avoid a performance hit in some environments.
  13753. if (typeof value == 'string') {
  13754. return value;
  13755. }
  13756. if (isSymbol(value)) {
  13757. return symbolToString ? symbolToString.call(value) : '';
  13758. }
  13759. var result = (value + '');
  13760. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  13761. }
  13762. /**
  13763. * Casts `value` to a path array if it's not one.
  13764. *
  13765. * @private
  13766. * @param {*} value The value to inspect.
  13767. * @returns {Array} Returns the cast property path array.
  13768. */
  13769. function castPath(value) {
  13770. return isArray(value) ? value : stringToPath(value);
  13771. }
  13772. /**
  13773. * Gets the data for `map`.
  13774. *
  13775. * @private
  13776. * @param {Object} map The map to query.
  13777. * @param {string} key The reference key.
  13778. * @returns {*} Returns the map data.
  13779. */
  13780. function getMapData(map, key) {
  13781. var data = map.__data__;
  13782. return isKeyable(key)
  13783. ? data[typeof key == 'string' ? 'string' : 'hash']
  13784. : data.map;
  13785. }
  13786. /**
  13787. * Gets the native function at `key` of `object`.
  13788. *
  13789. * @private
  13790. * @param {Object} object The object to query.
  13791. * @param {string} key The key of the method to get.
  13792. * @returns {*} Returns the function if it's native, else `undefined`.
  13793. */
  13794. function getNative(object, key) {
  13795. var value = getValue(object, key);
  13796. return baseIsNative(value) ? value : undefined;
  13797. }
  13798. /**
  13799. * Checks if `value` is a valid array-like index.
  13800. *
  13801. * @private
  13802. * @param {*} value The value to check.
  13803. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  13804. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  13805. */
  13806. function isIndex(value, length) {
  13807. length = length == null ? MAX_SAFE_INTEGER : length;
  13808. return !!length &&
  13809. (typeof value == 'number' || reIsUint.test(value)) &&
  13810. (value > -1 && value % 1 == 0 && value < length);
  13811. }
  13812. /**
  13813. * Checks if `value` is a property name and not a property path.
  13814. *
  13815. * @private
  13816. * @param {*} value The value to check.
  13817. * @param {Object} [object] The object to query keys on.
  13818. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  13819. */
  13820. function isKey(value, object) {
  13821. if (isArray(value)) {
  13822. return false;
  13823. }
  13824. var type = typeof value;
  13825. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  13826. value == null || isSymbol(value)) {
  13827. return true;
  13828. }
  13829. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  13830. (object != null && value in Object(object));
  13831. }
  13832. /**
  13833. * Checks if `value` is suitable for use as unique object key.
  13834. *
  13835. * @private
  13836. * @param {*} value The value to check.
  13837. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  13838. */
  13839. function isKeyable(value) {
  13840. var type = typeof value;
  13841. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  13842. ? (value !== '__proto__')
  13843. : (value === null);
  13844. }
  13845. /**
  13846. * Checks if `func` has its source masked.
  13847. *
  13848. * @private
  13849. * @param {Function} func The function to check.
  13850. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  13851. */
  13852. function isMasked(func) {
  13853. return !!maskSrcKey && (maskSrcKey in func);
  13854. }
  13855. /**
  13856. * Converts `string` to a property path array.
  13857. *
  13858. * @private
  13859. * @param {string} string The string to convert.
  13860. * @returns {Array} Returns the property path array.
  13861. */
  13862. var stringToPath = memoize(function(string) {
  13863. string = toString(string);
  13864. var result = [];
  13865. if (reLeadingDot.test(string)) {
  13866. result.push('');
  13867. }
  13868. string.replace(rePropName, function(match, number, quote, string) {
  13869. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  13870. });
  13871. return result;
  13872. });
  13873. /**
  13874. * Converts `value` to a string key if it's not a string or symbol.
  13875. *
  13876. * @private
  13877. * @param {*} value The value to inspect.
  13878. * @returns {string|symbol} Returns the key.
  13879. */
  13880. function toKey(value) {
  13881. if (typeof value == 'string' || isSymbol(value)) {
  13882. return value;
  13883. }
  13884. var result = (value + '');
  13885. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  13886. }
  13887. /**
  13888. * Converts `func` to its source code.
  13889. *
  13890. * @private
  13891. * @param {Function} func The function to process.
  13892. * @returns {string} Returns the source code.
  13893. */
  13894. function toSource(func) {
  13895. if (func != null) {
  13896. try {
  13897. return funcToString.call(func);
  13898. } catch (e) {}
  13899. try {
  13900. return (func + '');
  13901. } catch (e) {}
  13902. }
  13903. return '';
  13904. }
  13905. /**
  13906. * Creates a function that memoizes the result of `func`. If `resolver` is
  13907. * provided, it determines the cache key for storing the result based on the
  13908. * arguments provided to the memoized function. By default, the first argument
  13909. * provided to the memoized function is used as the map cache key. The `func`
  13910. * is invoked with the `this` binding of the memoized function.
  13911. *
  13912. * **Note:** The cache is exposed as the `cache` property on the memoized
  13913. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  13914. * constructor with one whose instances implement the
  13915. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  13916. * method interface of `delete`, `get`, `has`, and `set`.
  13917. *
  13918. * @static
  13919. * @memberOf _
  13920. * @since 0.1.0
  13921. * @category Function
  13922. * @param {Function} func The function to have its output memoized.
  13923. * @param {Function} [resolver] The function to resolve the cache key.
  13924. * @returns {Function} Returns the new memoized function.
  13925. * @example
  13926. *
  13927. * var object = { 'a': 1, 'b': 2 };
  13928. * var other = { 'c': 3, 'd': 4 };
  13929. *
  13930. * var values = _.memoize(_.values);
  13931. * values(object);
  13932. * // => [1, 2]
  13933. *
  13934. * values(other);
  13935. * // => [3, 4]
  13936. *
  13937. * object.a = 2;
  13938. * values(object);
  13939. * // => [1, 2]
  13940. *
  13941. * // Modify the result cache.
  13942. * values.cache.set(object, ['a', 'b']);
  13943. * values(object);
  13944. * // => ['a', 'b']
  13945. *
  13946. * // Replace `_.memoize.Cache`.
  13947. * _.memoize.Cache = WeakMap;
  13948. */
  13949. function memoize(func, resolver) {
  13950. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  13951. throw new TypeError(FUNC_ERROR_TEXT);
  13952. }
  13953. var memoized = function() {
  13954. var args = arguments,
  13955. key = resolver ? resolver.apply(this, args) : args[0],
  13956. cache = memoized.cache;
  13957. if (cache.has(key)) {
  13958. return cache.get(key);
  13959. }
  13960. var result = func.apply(this, args);
  13961. memoized.cache = cache.set(key, result);
  13962. return result;
  13963. };
  13964. memoized.cache = new (memoize.Cache || MapCache);
  13965. return memoized;
  13966. }
  13967. // Assign cache to `_.memoize`.
  13968. memoize.Cache = MapCache;
  13969. /**
  13970. * Performs a
  13971. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13972. * comparison between two values to determine if they are equivalent.
  13973. *
  13974. * @static
  13975. * @memberOf _
  13976. * @since 4.0.0
  13977. * @category Lang
  13978. * @param {*} value The value to compare.
  13979. * @param {*} other The other value to compare.
  13980. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  13981. * @example
  13982. *
  13983. * var object = { 'a': 1 };
  13984. * var other = { 'a': 1 };
  13985. *
  13986. * _.eq(object, object);
  13987. * // => true
  13988. *
  13989. * _.eq(object, other);
  13990. * // => false
  13991. *
  13992. * _.eq('a', 'a');
  13993. * // => true
  13994. *
  13995. * _.eq('a', Object('a'));
  13996. * // => false
  13997. *
  13998. * _.eq(NaN, NaN);
  13999. * // => true
  14000. */
  14001. function eq(value, other) {
  14002. return value === other || (value !== value && other !== other);
  14003. }
  14004. /**
  14005. * Checks if `value` is classified as an `Array` object.
  14006. *
  14007. * @static
  14008. * @memberOf _
  14009. * @since 0.1.0
  14010. * @category Lang
  14011. * @param {*} value The value to check.
  14012. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14013. * @example
  14014. *
  14015. * _.isArray([1, 2, 3]);
  14016. * // => true
  14017. *
  14018. * _.isArray(document.body.children);
  14019. * // => false
  14020. *
  14021. * _.isArray('abc');
  14022. * // => false
  14023. *
  14024. * _.isArray(_.noop);
  14025. * // => false
  14026. */
  14027. var isArray = Array.isArray;
  14028. /**
  14029. * Checks if `value` is classified as a `Function` object.
  14030. *
  14031. * @static
  14032. * @memberOf _
  14033. * @since 0.1.0
  14034. * @category Lang
  14035. * @param {*} value The value to check.
  14036. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14037. * @example
  14038. *
  14039. * _.isFunction(_);
  14040. * // => true
  14041. *
  14042. * _.isFunction(/abc/);
  14043. * // => false
  14044. */
  14045. function isFunction(value) {
  14046. // The use of `Object#toString` avoids issues with the `typeof` operator
  14047. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14048. var tag = isObject(value) ? objectToString.call(value) : '';
  14049. return tag == funcTag || tag == genTag;
  14050. }
  14051. /**
  14052. * Checks if `value` is the
  14053. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14054. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14055. *
  14056. * @static
  14057. * @memberOf _
  14058. * @since 0.1.0
  14059. * @category Lang
  14060. * @param {*} value The value to check.
  14061. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14062. * @example
  14063. *
  14064. * _.isObject({});
  14065. * // => true
  14066. *
  14067. * _.isObject([1, 2, 3]);
  14068. * // => true
  14069. *
  14070. * _.isObject(_.noop);
  14071. * // => true
  14072. *
  14073. * _.isObject(null);
  14074. * // => false
  14075. */
  14076. function isObject(value) {
  14077. var type = typeof value;
  14078. return !!value && (type == 'object' || type == 'function');
  14079. }
  14080. /**
  14081. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14082. * and has a `typeof` result of "object".
  14083. *
  14084. * @static
  14085. * @memberOf _
  14086. * @since 4.0.0
  14087. * @category Lang
  14088. * @param {*} value The value to check.
  14089. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14090. * @example
  14091. *
  14092. * _.isObjectLike({});
  14093. * // => true
  14094. *
  14095. * _.isObjectLike([1, 2, 3]);
  14096. * // => true
  14097. *
  14098. * _.isObjectLike(_.noop);
  14099. * // => false
  14100. *
  14101. * _.isObjectLike(null);
  14102. * // => false
  14103. */
  14104. function isObjectLike(value) {
  14105. return !!value && typeof value == 'object';
  14106. }
  14107. /**
  14108. * Checks if `value` is classified as a `Symbol` primitive or object.
  14109. *
  14110. * @static
  14111. * @memberOf _
  14112. * @since 4.0.0
  14113. * @category Lang
  14114. * @param {*} value The value to check.
  14115. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14116. * @example
  14117. *
  14118. * _.isSymbol(Symbol.iterator);
  14119. * // => true
  14120. *
  14121. * _.isSymbol('abc');
  14122. * // => false
  14123. */
  14124. function isSymbol(value) {
  14125. return typeof value == 'symbol' ||
  14126. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14127. }
  14128. /**
  14129. * Converts `value` to a string. An empty string is returned for `null`
  14130. * and `undefined` values. The sign of `-0` is preserved.
  14131. *
  14132. * @static
  14133. * @memberOf _
  14134. * @since 4.0.0
  14135. * @category Lang
  14136. * @param {*} value The value to process.
  14137. * @returns {string} Returns the string.
  14138. * @example
  14139. *
  14140. * _.toString(null);
  14141. * // => ''
  14142. *
  14143. * _.toString(-0);
  14144. * // => '-0'
  14145. *
  14146. * _.toString([1, 2, 3]);
  14147. * // => '1,2,3'
  14148. */
  14149. function toString(value) {
  14150. return value == null ? '' : baseToString(value);
  14151. }
  14152. /**
  14153. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14154. * it's created. Arrays are created for missing index properties while objects
  14155. * are created for all other missing properties. Use `_.setWith` to customize
  14156. * `path` creation.
  14157. *
  14158. * **Note:** This method mutates `object`.
  14159. *
  14160. * @static
  14161. * @memberOf _
  14162. * @since 3.7.0
  14163. * @category Object
  14164. * @param {Object} object The object to modify.
  14165. * @param {Array|string} path The path of the property to set.
  14166. * @param {*} value The value to set.
  14167. * @returns {Object} Returns `object`.
  14168. * @example
  14169. *
  14170. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14171. *
  14172. * _.set(object, 'a[0].b.c', 4);
  14173. * console.log(object.a[0].b.c);
  14174. * // => 4
  14175. *
  14176. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14177. * console.log(object.x[0].y.z);
  14178. * // => 5
  14179. */
  14180. function set(object, path, value) {
  14181. return object == null ? object : baseSet(object, path, value);
  14182. }
  14183. module.exports = set;
  14184. /***/ }),
  14185. /***/ 898:
  14186. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14187. "use strict";
  14188. Object.defineProperty(exports, '__esModule', { value: true });
  14189. var request = __webpack_require__(753);
  14190. var universalUserAgent = __webpack_require__(796);
  14191. const VERSION = "4.3.1";
  14192. class GraphqlError extends Error {
  14193. constructor(request, response) {
  14194. const message = response.data.errors[0].message;
  14195. super(message);
  14196. Object.assign(this, response.data);
  14197. this.name = "GraphqlError";
  14198. this.request = request; // Maintains proper stack trace (only available on V8)
  14199. /* istanbul ignore next */
  14200. if (Error.captureStackTrace) {
  14201. Error.captureStackTrace(this, this.constructor);
  14202. }
  14203. }
  14204. }
  14205. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14206. function graphql(request, query, options) {
  14207. options = typeof query === "string" ? options = Object.assign({
  14208. query
  14209. }, options) : options = query;
  14210. const requestOptions = Object.keys(options).reduce((result, key) => {
  14211. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14212. result[key] = options[key];
  14213. return result;
  14214. }
  14215. if (!result.variables) {
  14216. result.variables = {};
  14217. }
  14218. result.variables[key] = options[key];
  14219. return result;
  14220. }, {});
  14221. return request(requestOptions).then(response => {
  14222. if (response.data.errors) {
  14223. throw new GraphqlError(requestOptions, {
  14224. data: response.data
  14225. });
  14226. }
  14227. return response.data.data;
  14228. });
  14229. }
  14230. function withDefaults(request$1, newDefaults) {
  14231. const newRequest = request$1.defaults(newDefaults);
  14232. const newApi = (query, options) => {
  14233. return graphql(newRequest, query, options);
  14234. };
  14235. return Object.assign(newApi, {
  14236. defaults: withDefaults.bind(null, newRequest),
  14237. endpoint: request.request.endpoint
  14238. });
  14239. }
  14240. const graphql$1 = withDefaults(request.request, {
  14241. headers: {
  14242. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14243. },
  14244. method: "POST",
  14245. url: "/graphql"
  14246. });
  14247. function withCustomRequest(customRequest) {
  14248. return withDefaults(customRequest, {
  14249. method: "POST",
  14250. url: "/graphql"
  14251. });
  14252. }
  14253. exports.graphql = graphql$1;
  14254. exports.withCustomRequest = withCustomRequest;
  14255. //# sourceMappingURL=index.js.map
  14256. /***/ }),
  14257. /***/ 899:
  14258. /***/ (function(module, __unusedexports, __webpack_require__) {
  14259. module.exports = registerEndpoints;
  14260. const { Deprecation } = __webpack_require__(692);
  14261. function registerEndpoints(octokit, routes) {
  14262. Object.keys(routes).forEach(namespaceName => {
  14263. if (!octokit[namespaceName]) {
  14264. octokit[namespaceName] = {};
  14265. }
  14266. Object.keys(routes[namespaceName]).forEach(apiName => {
  14267. const apiOptions = routes[namespaceName][apiName];
  14268. const endpointDefaults = ["method", "url", "headers"].reduce(
  14269. (map, key) => {
  14270. if (typeof apiOptions[key] !== "undefined") {
  14271. map[key] = apiOptions[key];
  14272. }
  14273. return map;
  14274. },
  14275. {}
  14276. );
  14277. endpointDefaults.request = {
  14278. validate: apiOptions.params
  14279. };
  14280. let request = octokit.request.defaults(endpointDefaults);
  14281. // patch request & endpoint methods to support deprecated parameters.
  14282. // Not the most elegant solution, but we don’t want to move deprecation
  14283. // logic into octokit/endpoint.js as it’s out of scope
  14284. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14285. key => apiOptions.params[key].deprecated
  14286. );
  14287. if (hasDeprecatedParam) {
  14288. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14289. request = patch(
  14290. octokit.request.defaults(endpointDefaults),
  14291. `.${namespaceName}.${apiName}()`
  14292. );
  14293. request.endpoint = patch(
  14294. request.endpoint,
  14295. `.${namespaceName}.${apiName}.endpoint()`
  14296. );
  14297. request.endpoint.merge = patch(
  14298. request.endpoint.merge,
  14299. `.${namespaceName}.${apiName}.endpoint.merge()`
  14300. );
  14301. }
  14302. if (apiOptions.deprecated) {
  14303. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14304. octokit.log.warn(
  14305. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14306. );
  14307. octokit[namespaceName][apiName] = request;
  14308. return request.apply(null, arguments);
  14309. };
  14310. return;
  14311. }
  14312. octokit[namespaceName][apiName] = request;
  14313. });
  14314. });
  14315. }
  14316. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14317. const patchedMethod = options => {
  14318. options = Object.assign({}, options);
  14319. Object.keys(options).forEach(key => {
  14320. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14321. const aliasKey = apiOptions.params[key].alias;
  14322. octokit.log.warn(
  14323. new Deprecation(
  14324. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14325. )
  14326. );
  14327. if (!(aliasKey in options)) {
  14328. options[aliasKey] = options[key];
  14329. }
  14330. delete options[key];
  14331. }
  14332. });
  14333. return method(options);
  14334. };
  14335. Object.keys(method).forEach(key => {
  14336. patchedMethod[key] = method[key];
  14337. });
  14338. return patchedMethod;
  14339. }
  14340. /***/ }),
  14341. /***/ 929:
  14342. /***/ (function(module, __unusedexports, __webpack_require__) {
  14343. module.exports = hasNextPage
  14344. const deprecate = __webpack_require__(370)
  14345. const getPageLinks = __webpack_require__(577)
  14346. function hasNextPage (link) {
  14347. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  14348. return getPageLinks(link).next
  14349. }
  14350. /***/ }),
  14351. /***/ 948:
  14352. /***/ (function(module) {
  14353. "use strict";
  14354. /**
  14355. * Tries to execute a function and discards any error that occurs.
  14356. * @param {Function} fn - Function that might or might not throw an error.
  14357. * @returns {?*} Return-value of the function when no error occurred.
  14358. */
  14359. module.exports = function(fn) {
  14360. try { return fn() } catch (e) {}
  14361. }
  14362. /***/ }),
  14363. /***/ 950:
  14364. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14365. "use strict";
  14366. Object.defineProperty(exports, "__esModule", { value: true });
  14367. const url = __webpack_require__(835);
  14368. function getProxyUrl(reqUrl) {
  14369. let usingSsl = reqUrl.protocol === 'https:';
  14370. let proxyUrl;
  14371. if (checkBypass(reqUrl)) {
  14372. return proxyUrl;
  14373. }
  14374. let proxyVar;
  14375. if (usingSsl) {
  14376. proxyVar = process.env["https_proxy"] ||
  14377. process.env["HTTPS_PROXY"];
  14378. }
  14379. else {
  14380. proxyVar = process.env["http_proxy"] ||
  14381. process.env["HTTP_PROXY"];
  14382. }
  14383. if (proxyVar) {
  14384. proxyUrl = url.parse(proxyVar);
  14385. }
  14386. return proxyUrl;
  14387. }
  14388. exports.getProxyUrl = getProxyUrl;
  14389. function checkBypass(reqUrl) {
  14390. if (!reqUrl.hostname) {
  14391. return false;
  14392. }
  14393. let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
  14394. if (!noProxy) {
  14395. return false;
  14396. }
  14397. // Determine the request port
  14398. let reqPort;
  14399. if (reqUrl.port) {
  14400. reqPort = Number(reqUrl.port);
  14401. }
  14402. else if (reqUrl.protocol === 'http:') {
  14403. reqPort = 80;
  14404. }
  14405. else if (reqUrl.protocol === 'https:') {
  14406. reqPort = 443;
  14407. }
  14408. // Format the request hostname and hostname with port
  14409. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  14410. if (typeof reqPort === 'number') {
  14411. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  14412. }
  14413. // Compare request host against noproxy
  14414. for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
  14415. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  14416. return true;
  14417. }
  14418. }
  14419. return false;
  14420. }
  14421. exports.checkBypass = checkBypass;
  14422. /***/ }),
  14423. /***/ 954:
  14424. /***/ (function(module) {
  14425. module.exports = validateAuth;
  14426. function validateAuth(auth) {
  14427. if (typeof auth === "string") {
  14428. return;
  14429. }
  14430. if (typeof auth === "function") {
  14431. return;
  14432. }
  14433. if (auth.username && auth.password) {
  14434. return;
  14435. }
  14436. if (auth.clientId && auth.clientSecret) {
  14437. return;
  14438. }
  14439. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  14440. }
  14441. /***/ }),
  14442. /***/ 955:
  14443. /***/ (function(module, __unusedexports, __webpack_require__) {
  14444. "use strict";
  14445. const path = __webpack_require__(622);
  14446. const childProcess = __webpack_require__(129);
  14447. const crossSpawn = __webpack_require__(20);
  14448. const stripEof = __webpack_require__(768);
  14449. const npmRunPath = __webpack_require__(621);
  14450. const isStream = __webpack_require__(323);
  14451. const _getStream = __webpack_require__(145);
  14452. const pFinally = __webpack_require__(697);
  14453. const onExit = __webpack_require__(260);
  14454. const errname = __webpack_require__(427);
  14455. const stdio = __webpack_require__(168);
  14456. const TEN_MEGABYTES = 1000 * 1000 * 10;
  14457. function handleArgs(cmd, args, opts) {
  14458. let parsed;
  14459. opts = Object.assign({
  14460. extendEnv: true,
  14461. env: {}
  14462. }, opts);
  14463. if (opts.extendEnv) {
  14464. opts.env = Object.assign({}, process.env, opts.env);
  14465. }
  14466. if (opts.__winShell === true) {
  14467. delete opts.__winShell;
  14468. parsed = {
  14469. command: cmd,
  14470. args,
  14471. options: opts,
  14472. file: cmd,
  14473. original: {
  14474. cmd,
  14475. args
  14476. }
  14477. };
  14478. } else {
  14479. parsed = crossSpawn._parse(cmd, args, opts);
  14480. }
  14481. opts = Object.assign({
  14482. maxBuffer: TEN_MEGABYTES,
  14483. buffer: true,
  14484. stripEof: true,
  14485. preferLocal: true,
  14486. localDir: parsed.options.cwd || process.cwd(),
  14487. encoding: 'utf8',
  14488. reject: true,
  14489. cleanup: true
  14490. }, parsed.options);
  14491. opts.stdio = stdio(opts);
  14492. if (opts.preferLocal) {
  14493. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  14494. }
  14495. if (opts.detached) {
  14496. // #115
  14497. opts.cleanup = false;
  14498. }
  14499. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  14500. // #116
  14501. parsed.args.unshift('/q');
  14502. }
  14503. return {
  14504. cmd: parsed.command,
  14505. args: parsed.args,
  14506. opts,
  14507. parsed
  14508. };
  14509. }
  14510. function handleInput(spawned, input) {
  14511. if (input === null || input === undefined) {
  14512. return;
  14513. }
  14514. if (isStream(input)) {
  14515. input.pipe(spawned.stdin);
  14516. } else {
  14517. spawned.stdin.end(input);
  14518. }
  14519. }
  14520. function handleOutput(opts, val) {
  14521. if (val && opts.stripEof) {
  14522. val = stripEof(val);
  14523. }
  14524. return val;
  14525. }
  14526. function handleShell(fn, cmd, opts) {
  14527. let file = '/bin/sh';
  14528. let args = ['-c', cmd];
  14529. opts = Object.assign({}, opts);
  14530. if (process.platform === 'win32') {
  14531. opts.__winShell = true;
  14532. file = process.env.comspec || 'cmd.exe';
  14533. args = ['/s', '/c', `"${cmd}"`];
  14534. opts.windowsVerbatimArguments = true;
  14535. }
  14536. if (opts.shell) {
  14537. file = opts.shell;
  14538. delete opts.shell;
  14539. }
  14540. return fn(file, args, opts);
  14541. }
  14542. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  14543. if (!process[stream]) {
  14544. return null;
  14545. }
  14546. let ret;
  14547. if (!buffer) {
  14548. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  14549. ret = new Promise((resolve, reject) => {
  14550. process[stream]
  14551. .once('end', resolve)
  14552. .once('error', reject);
  14553. });
  14554. } else if (encoding) {
  14555. ret = _getStream(process[stream], {
  14556. encoding,
  14557. maxBuffer
  14558. });
  14559. } else {
  14560. ret = _getStream.buffer(process[stream], {maxBuffer});
  14561. }
  14562. return ret.catch(err => {
  14563. err.stream = stream;
  14564. err.message = `${stream} ${err.message}`;
  14565. throw err;
  14566. });
  14567. }
  14568. function makeError(result, options) {
  14569. const {stdout, stderr} = result;
  14570. let err = result.error;
  14571. const {code, signal} = result;
  14572. const {parsed, joinedCmd} = options;
  14573. const timedOut = options.timedOut || false;
  14574. if (!err) {
  14575. let output = '';
  14576. if (Array.isArray(parsed.opts.stdio)) {
  14577. if (parsed.opts.stdio[2] !== 'inherit') {
  14578. output += output.length > 0 ? stderr : `\n${stderr}`;
  14579. }
  14580. if (parsed.opts.stdio[1] !== 'inherit') {
  14581. output += `\n${stdout}`;
  14582. }
  14583. } else if (parsed.opts.stdio !== 'inherit') {
  14584. output = `\n${stderr}${stdout}`;
  14585. }
  14586. err = new Error(`Command failed: ${joinedCmd}${output}`);
  14587. err.code = code < 0 ? errname(code) : code;
  14588. }
  14589. err.stdout = stdout;
  14590. err.stderr = stderr;
  14591. err.failed = true;
  14592. err.signal = signal || null;
  14593. err.cmd = joinedCmd;
  14594. err.timedOut = timedOut;
  14595. return err;
  14596. }
  14597. function joinCmd(cmd, args) {
  14598. let joinedCmd = cmd;
  14599. if (Array.isArray(args) && args.length > 0) {
  14600. joinedCmd += ' ' + args.join(' ');
  14601. }
  14602. return joinedCmd;
  14603. }
  14604. module.exports = (cmd, args, opts) => {
  14605. const parsed = handleArgs(cmd, args, opts);
  14606. const {encoding, buffer, maxBuffer} = parsed.opts;
  14607. const joinedCmd = joinCmd(cmd, args);
  14608. let spawned;
  14609. try {
  14610. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  14611. } catch (err) {
  14612. return Promise.reject(err);
  14613. }
  14614. let removeExitHandler;
  14615. if (parsed.opts.cleanup) {
  14616. removeExitHandler = onExit(() => {
  14617. spawned.kill();
  14618. });
  14619. }
  14620. let timeoutId = null;
  14621. let timedOut = false;
  14622. const cleanup = () => {
  14623. if (timeoutId) {
  14624. clearTimeout(timeoutId);
  14625. timeoutId = null;
  14626. }
  14627. if (removeExitHandler) {
  14628. removeExitHandler();
  14629. }
  14630. };
  14631. if (parsed.opts.timeout > 0) {
  14632. timeoutId = setTimeout(() => {
  14633. timeoutId = null;
  14634. timedOut = true;
  14635. spawned.kill(parsed.opts.killSignal);
  14636. }, parsed.opts.timeout);
  14637. }
  14638. const processDone = new Promise(resolve => {
  14639. spawned.on('exit', (code, signal) => {
  14640. cleanup();
  14641. resolve({code, signal});
  14642. });
  14643. spawned.on('error', err => {
  14644. cleanup();
  14645. resolve({error: err});
  14646. });
  14647. if (spawned.stdin) {
  14648. spawned.stdin.on('error', err => {
  14649. cleanup();
  14650. resolve({error: err});
  14651. });
  14652. }
  14653. });
  14654. function destroy() {
  14655. if (spawned.stdout) {
  14656. spawned.stdout.destroy();
  14657. }
  14658. if (spawned.stderr) {
  14659. spawned.stderr.destroy();
  14660. }
  14661. }
  14662. const handlePromise = () => pFinally(Promise.all([
  14663. processDone,
  14664. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  14665. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  14666. ]).then(arr => {
  14667. const result = arr[0];
  14668. result.stdout = arr[1];
  14669. result.stderr = arr[2];
  14670. if (result.error || result.code !== 0 || result.signal !== null) {
  14671. const err = makeError(result, {
  14672. joinedCmd,
  14673. parsed,
  14674. timedOut
  14675. });
  14676. // TODO: missing some timeout logic for killed
  14677. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  14678. // err.killed = spawned.killed || killed;
  14679. err.killed = err.killed || spawned.killed;
  14680. if (!parsed.opts.reject) {
  14681. return err;
  14682. }
  14683. throw err;
  14684. }
  14685. return {
  14686. stdout: handleOutput(parsed.opts, result.stdout),
  14687. stderr: handleOutput(parsed.opts, result.stderr),
  14688. code: 0,
  14689. failed: false,
  14690. killed: false,
  14691. signal: null,
  14692. cmd: joinedCmd,
  14693. timedOut: false
  14694. };
  14695. }), destroy);
  14696. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  14697. handleInput(spawned, parsed.opts.input);
  14698. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  14699. spawned.catch = onrejected => handlePromise().catch(onrejected);
  14700. return spawned;
  14701. };
  14702. // TODO: set `stderr: 'ignore'` when that option is implemented
  14703. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  14704. // TODO: set `stdout: 'ignore'` when that option is implemented
  14705. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  14706. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  14707. module.exports.sync = (cmd, args, opts) => {
  14708. const parsed = handleArgs(cmd, args, opts);
  14709. const joinedCmd = joinCmd(cmd, args);
  14710. if (isStream(parsed.opts.input)) {
  14711. throw new TypeError('The `input` option cannot be a stream in sync mode');
  14712. }
  14713. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  14714. result.code = result.status;
  14715. if (result.error || result.status !== 0 || result.signal !== null) {
  14716. const err = makeError(result, {
  14717. joinedCmd,
  14718. parsed
  14719. });
  14720. if (!parsed.opts.reject) {
  14721. return err;
  14722. }
  14723. throw err;
  14724. }
  14725. return {
  14726. stdout: handleOutput(parsed.opts, result.stdout),
  14727. stderr: handleOutput(parsed.opts, result.stderr),
  14728. code: 0,
  14729. failed: false,
  14730. signal: null,
  14731. cmd: joinedCmd,
  14732. timedOut: false
  14733. };
  14734. };
  14735. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  14736. /***/ }),
  14737. /***/ 966:
  14738. /***/ (function(module, __unusedexports, __webpack_require__) {
  14739. "use strict";
  14740. const {PassThrough} = __webpack_require__(413);
  14741. module.exports = options => {
  14742. options = Object.assign({}, options);
  14743. const {array} = options;
  14744. let {encoding} = options;
  14745. const buffer = encoding === 'buffer';
  14746. let objectMode = false;
  14747. if (array) {
  14748. objectMode = !(encoding || buffer);
  14749. } else {
  14750. encoding = encoding || 'utf8';
  14751. }
  14752. if (buffer) {
  14753. encoding = null;
  14754. }
  14755. let len = 0;
  14756. const ret = [];
  14757. const stream = new PassThrough({objectMode});
  14758. if (encoding) {
  14759. stream.setEncoding(encoding);
  14760. }
  14761. stream.on('data', chunk => {
  14762. ret.push(chunk);
  14763. if (objectMode) {
  14764. len = ret.length;
  14765. } else {
  14766. len += chunk.length;
  14767. }
  14768. });
  14769. stream.getBufferedValue = () => {
  14770. if (array) {
  14771. return ret;
  14772. }
  14773. return buffer ? Buffer.concat(ret, len) : ret.join('');
  14774. };
  14775. stream.getBufferedLength = () => len;
  14776. return stream;
  14777. };
  14778. /***/ }),
  14779. /***/ 969:
  14780. /***/ (function(module, __unusedexports, __webpack_require__) {
  14781. var wrappy = __webpack_require__(11)
  14782. module.exports = wrappy(once)
  14783. module.exports.strict = wrappy(onceStrict)
  14784. once.proto = once(function () {
  14785. Object.defineProperty(Function.prototype, 'once', {
  14786. value: function () {
  14787. return once(this)
  14788. },
  14789. configurable: true
  14790. })
  14791. Object.defineProperty(Function.prototype, 'onceStrict', {
  14792. value: function () {
  14793. return onceStrict(this)
  14794. },
  14795. configurable: true
  14796. })
  14797. })
  14798. function once (fn) {
  14799. var f = function () {
  14800. if (f.called) return f.value
  14801. f.called = true
  14802. return f.value = fn.apply(this, arguments)
  14803. }
  14804. f.called = false
  14805. return f
  14806. }
  14807. function onceStrict (fn) {
  14808. var f = function () {
  14809. if (f.called)
  14810. throw new Error(f.onceError)
  14811. f.called = true
  14812. return f.value = fn.apply(this, arguments)
  14813. }
  14814. var name = fn.name || 'Function wrapped with `once`'
  14815. f.onceError = name + " shouldn't be called more than once"
  14816. f.called = false
  14817. return f
  14818. }
  14819. /***/ }),
  14820. /***/ 986:
  14821. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14822. "use strict";
  14823. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  14824. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  14825. return new (P || (P = Promise))(function (resolve, reject) {
  14826. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  14827. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  14828. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  14829. step((generator = generator.apply(thisArg, _arguments || [])).next());
  14830. });
  14831. };
  14832. Object.defineProperty(exports, "__esModule", { value: true });
  14833. const tr = __webpack_require__(9);
  14834. /**
  14835. * Exec a command.
  14836. * Output will be streamed to the live console.
  14837. * Returns promise with return code
  14838. *
  14839. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  14840. * @param args optional arguments for tool. Escaping is handled by the lib.
  14841. * @param options optional exec options. See ExecOptions
  14842. * @returns Promise<number> exit code
  14843. */
  14844. function exec(commandLine, args, options) {
  14845. return __awaiter(this, void 0, void 0, function* () {
  14846. const commandArgs = tr.argStringToArray(commandLine);
  14847. if (commandArgs.length === 0) {
  14848. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  14849. }
  14850. // Path to tool to execute should be first arg
  14851. const toolPath = commandArgs[0];
  14852. args = commandArgs.slice(1).concat(args || []);
  14853. const runner = new tr.ToolRunner(toolPath, args, options);
  14854. return runner.exec();
  14855. });
  14856. }
  14857. exports.exec = exec;
  14858. //# sourceMappingURL=exec.js.map
  14859. /***/ }),
  14860. /***/ 991:
  14861. /***/ (function(module, __unusedexports, __webpack_require__) {
  14862. module.exports = authenticationRequestError;
  14863. const { RequestError } = __webpack_require__(463);
  14864. function authenticationRequestError(state, error, options) {
  14865. if (!error.headers) throw error;
  14866. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  14867. // handle "2FA required" error only
  14868. if (error.status !== 401 || !otpRequired) {
  14869. throw error;
  14870. }
  14871. if (
  14872. error.status === 401 &&
  14873. otpRequired &&
  14874. error.request &&
  14875. error.request.headers["x-github-otp"]
  14876. ) {
  14877. if (state.otp) {
  14878. delete state.otp; // no longer valid, request again
  14879. } else {
  14880. throw new RequestError(
  14881. "Invalid one-time password for two-factor authentication",
  14882. 401,
  14883. {
  14884. headers: error.headers,
  14885. request: options
  14886. }
  14887. );
  14888. }
  14889. }
  14890. if (typeof state.auth.on2fa !== "function") {
  14891. throw new RequestError(
  14892. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  14893. 401,
  14894. {
  14895. headers: error.headers,
  14896. request: options
  14897. }
  14898. );
  14899. }
  14900. return Promise.resolve()
  14901. .then(() => {
  14902. return state.auth.on2fa();
  14903. })
  14904. .then(oneTimePassword => {
  14905. const newOptions = Object.assign(options, {
  14906. headers: Object.assign(options.headers, {
  14907. "x-github-otp": oneTimePassword
  14908. })
  14909. });
  14910. return state.octokit.request(newOptions).then(response => {
  14911. // If OTP still valid, then persist it for following requests
  14912. state.otp = oneTimePassword;
  14913. return response;
  14914. });
  14915. });
  14916. }
  14917. /***/ })
  14918. /******/ });