index.js 677 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685
  1. module.exports =
  2. /******/ (function(modules, runtime) { // webpackBootstrap
  3. /******/ "use strict";
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ __webpack_require__.ab = __dirname + "/";
  33. /******/
  34. /******/ // the startup function
  35. /******/ function startup() {
  36. /******/ // Load entry module and return exports
  37. /******/ return __webpack_require__(198);
  38. /******/ };
  39. /******/
  40. /******/ // run startup
  41. /******/ return startup();
  42. /******/ })
  43. /************************************************************************/
  44. /******/ ({
  45. /***/ 0:
  46. /***/ (function(module, __unusedexports, __webpack_require__) {
  47. const Octokit = __webpack_require__(529);
  48. const CORE_PLUGINS = [
  49. __webpack_require__(190),
  50. __webpack_require__(19), // deprecated: remove in v17
  51. __webpack_require__(372),
  52. __webpack_require__(148),
  53. __webpack_require__(248),
  54. __webpack_require__(586),
  55. __webpack_require__(430),
  56. __webpack_require__(850) // deprecated: remove in v17
  57. ];
  58. module.exports = Octokit.plugin(CORE_PLUGINS);
  59. /***/ }),
  60. /***/ 1:
  61. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  62. "use strict";
  63. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  64. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  65. return new (P || (P = Promise))(function (resolve, reject) {
  66. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  67. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  68. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  69. step((generator = generator.apply(thisArg, _arguments || [])).next());
  70. });
  71. };
  72. Object.defineProperty(exports, "__esModule", { value: true });
  73. const childProcess = __webpack_require__(129);
  74. const path = __webpack_require__(622);
  75. const util_1 = __webpack_require__(669);
  76. const ioUtil = __webpack_require__(672);
  77. const exec = util_1.promisify(childProcess.exec);
  78. /**
  79. * Copies a file or folder.
  80. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  81. *
  82. * @param source source path
  83. * @param dest destination path
  84. * @param options optional. See CopyOptions.
  85. */
  86. function cp(source, dest, options = {}) {
  87. return __awaiter(this, void 0, void 0, function* () {
  88. const { force, recursive } = readCopyOptions(options);
  89. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  90. // Dest is an existing file, but not forcing
  91. if (destStat && destStat.isFile() && !force) {
  92. return;
  93. }
  94. // If dest is an existing directory, should copy inside.
  95. const newDest = destStat && destStat.isDirectory()
  96. ? path.join(dest, path.basename(source))
  97. : dest;
  98. if (!(yield ioUtil.exists(source))) {
  99. throw new Error(`no such file or directory: ${source}`);
  100. }
  101. const sourceStat = yield ioUtil.stat(source);
  102. if (sourceStat.isDirectory()) {
  103. if (!recursive) {
  104. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  105. }
  106. else {
  107. yield cpDirRecursive(source, newDest, 0, force);
  108. }
  109. }
  110. else {
  111. if (path.relative(source, newDest) === '') {
  112. // a file cannot be copied to itself
  113. throw new Error(`'${newDest}' and '${source}' are the same file`);
  114. }
  115. yield copyFile(source, newDest, force);
  116. }
  117. });
  118. }
  119. exports.cp = cp;
  120. /**
  121. * Moves a path.
  122. *
  123. * @param source source path
  124. * @param dest destination path
  125. * @param options optional. See MoveOptions.
  126. */
  127. function mv(source, dest, options = {}) {
  128. return __awaiter(this, void 0, void 0, function* () {
  129. if (yield ioUtil.exists(dest)) {
  130. let destExists = true;
  131. if (yield ioUtil.isDirectory(dest)) {
  132. // If dest is directory copy src into dest
  133. dest = path.join(dest, path.basename(source));
  134. destExists = yield ioUtil.exists(dest);
  135. }
  136. if (destExists) {
  137. if (options.force == null || options.force) {
  138. yield rmRF(dest);
  139. }
  140. else {
  141. throw new Error('Destination already exists');
  142. }
  143. }
  144. }
  145. yield mkdirP(path.dirname(dest));
  146. yield ioUtil.rename(source, dest);
  147. });
  148. }
  149. exports.mv = mv;
  150. /**
  151. * Remove a path recursively with force
  152. *
  153. * @param inputPath path to remove
  154. */
  155. function rmRF(inputPath) {
  156. return __awaiter(this, void 0, void 0, function* () {
  157. if (ioUtil.IS_WINDOWS) {
  158. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  159. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  160. try {
  161. if (yield ioUtil.isDirectory(inputPath, true)) {
  162. yield exec(`rd /s /q "${inputPath}"`);
  163. }
  164. else {
  165. yield exec(`del /f /a "${inputPath}"`);
  166. }
  167. }
  168. catch (err) {
  169. // if you try to delete a file that doesn't exist, desired result is achieved
  170. // other errors are valid
  171. if (err.code !== 'ENOENT')
  172. throw err;
  173. }
  174. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  175. try {
  176. yield ioUtil.unlink(inputPath);
  177. }
  178. catch (err) {
  179. // if you try to delete a file that doesn't exist, desired result is achieved
  180. // other errors are valid
  181. if (err.code !== 'ENOENT')
  182. throw err;
  183. }
  184. }
  185. else {
  186. let isDir = false;
  187. try {
  188. isDir = yield ioUtil.isDirectory(inputPath);
  189. }
  190. catch (err) {
  191. // if you try to delete a file that doesn't exist, desired result is achieved
  192. // other errors are valid
  193. if (err.code !== 'ENOENT')
  194. throw err;
  195. return;
  196. }
  197. if (isDir) {
  198. yield exec(`rm -rf "${inputPath}"`);
  199. }
  200. else {
  201. yield ioUtil.unlink(inputPath);
  202. }
  203. }
  204. });
  205. }
  206. exports.rmRF = rmRF;
  207. /**
  208. * Make a directory. Creates the full path with folders in between
  209. * Will throw if it fails
  210. *
  211. * @param fsPath path to create
  212. * @returns Promise<void>
  213. */
  214. function mkdirP(fsPath) {
  215. return __awaiter(this, void 0, void 0, function* () {
  216. yield ioUtil.mkdirP(fsPath);
  217. });
  218. }
  219. exports.mkdirP = mkdirP;
  220. /**
  221. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  222. * If you check and the tool does not exist, it will throw.
  223. *
  224. * @param tool name of the tool
  225. * @param check whether to check if tool exists
  226. * @returns Promise<string> path to tool
  227. */
  228. function which(tool, check) {
  229. return __awaiter(this, void 0, void 0, function* () {
  230. if (!tool) {
  231. throw new Error("parameter 'tool' is required");
  232. }
  233. // recursive when check=true
  234. if (check) {
  235. const result = yield which(tool, false);
  236. if (!result) {
  237. if (ioUtil.IS_WINDOWS) {
  238. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
  239. }
  240. else {
  241. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
  242. }
  243. }
  244. }
  245. try {
  246. // build the list of extensions to try
  247. const extensions = [];
  248. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  249. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  250. if (extension) {
  251. extensions.push(extension);
  252. }
  253. }
  254. }
  255. // if it's rooted, return it if exists. otherwise return empty.
  256. if (ioUtil.isRooted(tool)) {
  257. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  258. if (filePath) {
  259. return filePath;
  260. }
  261. return '';
  262. }
  263. // if any path separators, return empty
  264. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  265. return '';
  266. }
  267. // build the list of directories
  268. //
  269. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  270. // it feels like we should not do this. Checking the current directory seems like more of a use
  271. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  272. // across platforms.
  273. const directories = [];
  274. if (process.env.PATH) {
  275. for (const p of process.env.PATH.split(path.delimiter)) {
  276. if (p) {
  277. directories.push(p);
  278. }
  279. }
  280. }
  281. // return the first match
  282. for (const directory of directories) {
  283. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  284. if (filePath) {
  285. return filePath;
  286. }
  287. }
  288. return '';
  289. }
  290. catch (err) {
  291. throw new Error(`which failed with message ${err.message}`);
  292. }
  293. });
  294. }
  295. exports.which = which;
  296. function readCopyOptions(options) {
  297. const force = options.force == null ? true : options.force;
  298. const recursive = Boolean(options.recursive);
  299. return { force, recursive };
  300. }
  301. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  302. return __awaiter(this, void 0, void 0, function* () {
  303. // Ensure there is not a run away recursive copy
  304. if (currentDepth >= 255)
  305. return;
  306. currentDepth++;
  307. yield mkdirP(destDir);
  308. const files = yield ioUtil.readdir(sourceDir);
  309. for (const fileName of files) {
  310. const srcFile = `${sourceDir}/${fileName}`;
  311. const destFile = `${destDir}/${fileName}`;
  312. const srcFileStat = yield ioUtil.lstat(srcFile);
  313. if (srcFileStat.isDirectory()) {
  314. // Recurse
  315. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  316. }
  317. else {
  318. yield copyFile(srcFile, destFile, force);
  319. }
  320. }
  321. // Change the mode for the newly created directory
  322. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  323. });
  324. }
  325. // Buffered file copy
  326. function copyFile(srcFile, destFile, force) {
  327. return __awaiter(this, void 0, void 0, function* () {
  328. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  329. // unlink/re-link it
  330. try {
  331. yield ioUtil.lstat(destFile);
  332. yield ioUtil.unlink(destFile);
  333. }
  334. catch (e) {
  335. // Try to override file permission
  336. if (e.code === 'EPERM') {
  337. yield ioUtil.chmod(destFile, '0666');
  338. yield ioUtil.unlink(destFile);
  339. }
  340. // other errors = it doesn't exist, no work to do
  341. }
  342. // Copy over symlink
  343. const symlinkFull = yield ioUtil.readlink(srcFile);
  344. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  345. }
  346. else if (!(yield ioUtil.exists(destFile)) || force) {
  347. yield ioUtil.copyFile(srcFile, destFile);
  348. }
  349. });
  350. }
  351. //# sourceMappingURL=io.js.map
  352. /***/ }),
  353. /***/ 2:
  354. /***/ (function(module, __unusedexports, __webpack_require__) {
  355. "use strict";
  356. const os = __webpack_require__(87);
  357. const macosRelease = __webpack_require__(118);
  358. const winRelease = __webpack_require__(49);
  359. const osName = (platform, release) => {
  360. if (!platform && release) {
  361. throw new Error('You can\'t specify a `release` without specifying `platform`');
  362. }
  363. platform = platform || os.platform();
  364. let id;
  365. if (platform === 'darwin') {
  366. if (!release && os.platform() === 'darwin') {
  367. release = os.release();
  368. }
  369. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  370. id = release ? macosRelease(release).name : '';
  371. return prefix + (id ? ' ' + id : '');
  372. }
  373. if (platform === 'linux') {
  374. if (!release && os.platform() === 'linux') {
  375. release = os.release();
  376. }
  377. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  378. return 'Linux' + (id ? ' ' + id : '');
  379. }
  380. if (platform === 'win32') {
  381. if (!release && os.platform() === 'win32') {
  382. release = os.release();
  383. }
  384. id = release ? winRelease(release) : '';
  385. return 'Windows' + (id ? ' ' + id : '');
  386. }
  387. return platform;
  388. };
  389. module.exports = osName;
  390. /***/ }),
  391. /***/ 8:
  392. /***/ (function(module, __unusedexports, __webpack_require__) {
  393. module.exports = iterator;
  394. const normalizePaginatedListResponse = __webpack_require__(301);
  395. function iterator(octokit, options) {
  396. const headers = options.headers;
  397. let url = octokit.request.endpoint(options).url;
  398. return {
  399. [Symbol.asyncIterator]: () => ({
  400. next() {
  401. if (!url) {
  402. return Promise.resolve({ done: true });
  403. }
  404. return octokit
  405. .request({ url, headers })
  406. .then(response => {
  407. normalizePaginatedListResponse(octokit, url, response);
  408. // `response.headers.link` format:
  409. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  410. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  411. url = ((response.headers.link || "").match(
  412. /<([^>]+)>;\s*rel="next"/
  413. ) || [])[1];
  414. return { value: response };
  415. });
  416. }
  417. })
  418. };
  419. }
  420. /***/ }),
  421. /***/ 9:
  422. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  423. "use strict";
  424. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  425. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  426. return new (P || (P = Promise))(function (resolve, reject) {
  427. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  428. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  429. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  430. step((generator = generator.apply(thisArg, _arguments || [])).next());
  431. });
  432. };
  433. Object.defineProperty(exports, "__esModule", { value: true });
  434. const os = __webpack_require__(87);
  435. const events = __webpack_require__(614);
  436. const child = __webpack_require__(129);
  437. /* eslint-disable @typescript-eslint/unbound-method */
  438. const IS_WINDOWS = process.platform === 'win32';
  439. /*
  440. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  441. */
  442. class ToolRunner extends events.EventEmitter {
  443. constructor(toolPath, args, options) {
  444. super();
  445. if (!toolPath) {
  446. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  447. }
  448. this.toolPath = toolPath;
  449. this.args = args || [];
  450. this.options = options || {};
  451. }
  452. _debug(message) {
  453. if (this.options.listeners && this.options.listeners.debug) {
  454. this.options.listeners.debug(message);
  455. }
  456. }
  457. _getCommandString(options, noPrefix) {
  458. const toolPath = this._getSpawnFileName();
  459. const args = this._getSpawnArgs(options);
  460. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  461. if (IS_WINDOWS) {
  462. // Windows + cmd file
  463. if (this._isCmdFile()) {
  464. cmd += toolPath;
  465. for (const a of args) {
  466. cmd += ` ${a}`;
  467. }
  468. }
  469. // Windows + verbatim
  470. else if (options.windowsVerbatimArguments) {
  471. cmd += `"${toolPath}"`;
  472. for (const a of args) {
  473. cmd += ` ${a}`;
  474. }
  475. }
  476. // Windows (regular)
  477. else {
  478. cmd += this._windowsQuoteCmdArg(toolPath);
  479. for (const a of args) {
  480. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  481. }
  482. }
  483. }
  484. else {
  485. // OSX/Linux - this can likely be improved with some form of quoting.
  486. // creating processes on Unix is fundamentally different than Windows.
  487. // on Unix, execvp() takes an arg array.
  488. cmd += toolPath;
  489. for (const a of args) {
  490. cmd += ` ${a}`;
  491. }
  492. }
  493. return cmd;
  494. }
  495. _processLineBuffer(data, strBuffer, onLine) {
  496. try {
  497. let s = strBuffer + data.toString();
  498. let n = s.indexOf(os.EOL);
  499. while (n > -1) {
  500. const line = s.substring(0, n);
  501. onLine(line);
  502. // the rest of the string ...
  503. s = s.substring(n + os.EOL.length);
  504. n = s.indexOf(os.EOL);
  505. }
  506. strBuffer = s;
  507. }
  508. catch (err) {
  509. // streaming lines to console is best effort. Don't fail a build.
  510. this._debug(`error processing line. Failed with error ${err}`);
  511. }
  512. }
  513. _getSpawnFileName() {
  514. if (IS_WINDOWS) {
  515. if (this._isCmdFile()) {
  516. return process.env['COMSPEC'] || 'cmd.exe';
  517. }
  518. }
  519. return this.toolPath;
  520. }
  521. _getSpawnArgs(options) {
  522. if (IS_WINDOWS) {
  523. if (this._isCmdFile()) {
  524. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  525. for (const a of this.args) {
  526. argline += ' ';
  527. argline += options.windowsVerbatimArguments
  528. ? a
  529. : this._windowsQuoteCmdArg(a);
  530. }
  531. argline += '"';
  532. return [argline];
  533. }
  534. }
  535. return this.args;
  536. }
  537. _endsWith(str, end) {
  538. return str.endsWith(end);
  539. }
  540. _isCmdFile() {
  541. const upperToolPath = this.toolPath.toUpperCase();
  542. return (this._endsWith(upperToolPath, '.CMD') ||
  543. this._endsWith(upperToolPath, '.BAT'));
  544. }
  545. _windowsQuoteCmdArg(arg) {
  546. // for .exe, apply the normal quoting rules that libuv applies
  547. if (!this._isCmdFile()) {
  548. return this._uvQuoteCmdArg(arg);
  549. }
  550. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  551. // the libuv rules are generic and are not designed specifically for cmd.exe
  552. // command line parser.
  553. //
  554. // for a detailed description of the cmd.exe command line parser, refer to
  555. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  556. // need quotes for empty arg
  557. if (!arg) {
  558. return '""';
  559. }
  560. // determine whether the arg needs to be quoted
  561. const cmdSpecialChars = [
  562. ' ',
  563. '\t',
  564. '&',
  565. '(',
  566. ')',
  567. '[',
  568. ']',
  569. '{',
  570. '}',
  571. '^',
  572. '=',
  573. ';',
  574. '!',
  575. "'",
  576. '+',
  577. ',',
  578. '`',
  579. '~',
  580. '|',
  581. '<',
  582. '>',
  583. '"'
  584. ];
  585. let needsQuotes = false;
  586. for (const char of arg) {
  587. if (cmdSpecialChars.some(x => x === char)) {
  588. needsQuotes = true;
  589. break;
  590. }
  591. }
  592. // short-circuit if quotes not needed
  593. if (!needsQuotes) {
  594. return arg;
  595. }
  596. // the following quoting rules are very similar to the rules that by libuv applies.
  597. //
  598. // 1) wrap the string in quotes
  599. //
  600. // 2) double-up quotes - i.e. " => ""
  601. //
  602. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  603. // doesn't work well with a cmd.exe command line.
  604. //
  605. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  606. // for example, the command line:
  607. // foo.exe "myarg:""my val"""
  608. // is parsed by a .NET console app into an arg array:
  609. // [ "myarg:\"my val\"" ]
  610. // which is the same end result when applying libuv quoting rules. although the actual
  611. // command line from libuv quoting rules would look like:
  612. // foo.exe "myarg:\"my val\""
  613. //
  614. // 3) double-up slashes that precede a quote,
  615. // e.g. hello \world => "hello \world"
  616. // hello\"world => "hello\\""world"
  617. // hello\\"world => "hello\\\\""world"
  618. // hello world\ => "hello world\\"
  619. //
  620. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  621. // the reasons for including this as a .cmd quoting rule are:
  622. //
  623. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  624. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  625. //
  626. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  627. // haven't heard any complaints about that aspect.
  628. //
  629. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  630. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  631. // by using %%.
  632. //
  633. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  634. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  635. //
  636. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  637. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  638. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  639. // to an external program.
  640. //
  641. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  642. // % can be escaped within a .cmd file.
  643. let reverse = '"';
  644. let quoteHit = true;
  645. for (let i = arg.length; i > 0; i--) {
  646. // walk the string in reverse
  647. reverse += arg[i - 1];
  648. if (quoteHit && arg[i - 1] === '\\') {
  649. reverse += '\\'; // double the slash
  650. }
  651. else if (arg[i - 1] === '"') {
  652. quoteHit = true;
  653. reverse += '"'; // double the quote
  654. }
  655. else {
  656. quoteHit = false;
  657. }
  658. }
  659. reverse += '"';
  660. return reverse
  661. .split('')
  662. .reverse()
  663. .join('');
  664. }
  665. _uvQuoteCmdArg(arg) {
  666. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  667. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  668. // is used.
  669. //
  670. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  671. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  672. // pasting copyright notice from Node within this function:
  673. //
  674. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  675. //
  676. // Permission is hereby granted, free of charge, to any person obtaining a copy
  677. // of this software and associated documentation files (the "Software"), to
  678. // deal in the Software without restriction, including without limitation the
  679. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  680. // sell copies of the Software, and to permit persons to whom the Software is
  681. // furnished to do so, subject to the following conditions:
  682. //
  683. // The above copyright notice and this permission notice shall be included in
  684. // all copies or substantial portions of the Software.
  685. //
  686. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  687. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  688. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  689. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  690. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  691. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  692. // IN THE SOFTWARE.
  693. if (!arg) {
  694. // Need double quotation for empty argument
  695. return '""';
  696. }
  697. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  698. // No quotation needed
  699. return arg;
  700. }
  701. if (!arg.includes('"') && !arg.includes('\\')) {
  702. // No embedded double quotes or backslashes, so I can just wrap
  703. // quote marks around the whole thing.
  704. return `"${arg}"`;
  705. }
  706. // Expected input/output:
  707. // input : hello"world
  708. // output: "hello\"world"
  709. // input : hello""world
  710. // output: "hello\"\"world"
  711. // input : hello\world
  712. // output: hello\world
  713. // input : hello\\world
  714. // output: hello\\world
  715. // input : hello\"world
  716. // output: "hello\\\"world"
  717. // input : hello\\"world
  718. // output: "hello\\\\\"world"
  719. // input : hello world\
  720. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  721. // but it appears the comment is wrong, it should be "hello world\\"
  722. let reverse = '"';
  723. let quoteHit = true;
  724. for (let i = arg.length; i > 0; i--) {
  725. // walk the string in reverse
  726. reverse += arg[i - 1];
  727. if (quoteHit && arg[i - 1] === '\\') {
  728. reverse += '\\';
  729. }
  730. else if (arg[i - 1] === '"') {
  731. quoteHit = true;
  732. reverse += '\\';
  733. }
  734. else {
  735. quoteHit = false;
  736. }
  737. }
  738. reverse += '"';
  739. return reverse
  740. .split('')
  741. .reverse()
  742. .join('');
  743. }
  744. _cloneExecOptions(options) {
  745. options = options || {};
  746. const result = {
  747. cwd: options.cwd || process.cwd(),
  748. env: options.env || process.env,
  749. silent: options.silent || false,
  750. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  751. failOnStdErr: options.failOnStdErr || false,
  752. ignoreReturnCode: options.ignoreReturnCode || false,
  753. delay: options.delay || 10000
  754. };
  755. result.outStream = options.outStream || process.stdout;
  756. result.errStream = options.errStream || process.stderr;
  757. return result;
  758. }
  759. _getSpawnOptions(options, toolPath) {
  760. options = options || {};
  761. const result = {};
  762. result.cwd = options.cwd;
  763. result.env = options.env;
  764. result['windowsVerbatimArguments'] =
  765. options.windowsVerbatimArguments || this._isCmdFile();
  766. if (options.windowsVerbatimArguments) {
  767. result.argv0 = `"${toolPath}"`;
  768. }
  769. return result;
  770. }
  771. /**
  772. * Exec a tool.
  773. * Output will be streamed to the live console.
  774. * Returns promise with return code
  775. *
  776. * @param tool path to tool to exec
  777. * @param options optional exec options. See ExecOptions
  778. * @returns number
  779. */
  780. exec() {
  781. return __awaiter(this, void 0, void 0, function* () {
  782. return new Promise((resolve, reject) => {
  783. this._debug(`exec tool: ${this.toolPath}`);
  784. this._debug('arguments:');
  785. for (const arg of this.args) {
  786. this._debug(` ${arg}`);
  787. }
  788. const optionsNonNull = this._cloneExecOptions(this.options);
  789. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  790. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  791. }
  792. const state = new ExecState(optionsNonNull, this.toolPath);
  793. state.on('debug', (message) => {
  794. this._debug(message);
  795. });
  796. const fileName = this._getSpawnFileName();
  797. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  798. const stdbuffer = '';
  799. if (cp.stdout) {
  800. cp.stdout.on('data', (data) => {
  801. if (this.options.listeners && this.options.listeners.stdout) {
  802. this.options.listeners.stdout(data);
  803. }
  804. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  805. optionsNonNull.outStream.write(data);
  806. }
  807. this._processLineBuffer(data, stdbuffer, (line) => {
  808. if (this.options.listeners && this.options.listeners.stdline) {
  809. this.options.listeners.stdline(line);
  810. }
  811. });
  812. });
  813. }
  814. const errbuffer = '';
  815. if (cp.stderr) {
  816. cp.stderr.on('data', (data) => {
  817. state.processStderr = true;
  818. if (this.options.listeners && this.options.listeners.stderr) {
  819. this.options.listeners.stderr(data);
  820. }
  821. if (!optionsNonNull.silent &&
  822. optionsNonNull.errStream &&
  823. optionsNonNull.outStream) {
  824. const s = optionsNonNull.failOnStdErr
  825. ? optionsNonNull.errStream
  826. : optionsNonNull.outStream;
  827. s.write(data);
  828. }
  829. this._processLineBuffer(data, errbuffer, (line) => {
  830. if (this.options.listeners && this.options.listeners.errline) {
  831. this.options.listeners.errline(line);
  832. }
  833. });
  834. });
  835. }
  836. cp.on('error', (err) => {
  837. state.processError = err.message;
  838. state.processExited = true;
  839. state.processClosed = true;
  840. state.CheckComplete();
  841. });
  842. cp.on('exit', (code) => {
  843. state.processExitCode = code;
  844. state.processExited = true;
  845. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  846. state.CheckComplete();
  847. });
  848. cp.on('close', (code) => {
  849. state.processExitCode = code;
  850. state.processExited = true;
  851. state.processClosed = true;
  852. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  853. state.CheckComplete();
  854. });
  855. state.on('done', (error, exitCode) => {
  856. if (stdbuffer.length > 0) {
  857. this.emit('stdline', stdbuffer);
  858. }
  859. if (errbuffer.length > 0) {
  860. this.emit('errline', errbuffer);
  861. }
  862. cp.removeAllListeners();
  863. if (error) {
  864. reject(error);
  865. }
  866. else {
  867. resolve(exitCode);
  868. }
  869. });
  870. });
  871. });
  872. }
  873. }
  874. exports.ToolRunner = ToolRunner;
  875. /**
  876. * Convert an arg string to an array of args. Handles escaping
  877. *
  878. * @param argString string of arguments
  879. * @returns string[] array of arguments
  880. */
  881. function argStringToArray(argString) {
  882. const args = [];
  883. let inQuotes = false;
  884. let escaped = false;
  885. let arg = '';
  886. function append(c) {
  887. // we only escape double quotes.
  888. if (escaped && c !== '"') {
  889. arg += '\\';
  890. }
  891. arg += c;
  892. escaped = false;
  893. }
  894. for (let i = 0; i < argString.length; i++) {
  895. const c = argString.charAt(i);
  896. if (c === '"') {
  897. if (!escaped) {
  898. inQuotes = !inQuotes;
  899. }
  900. else {
  901. append(c);
  902. }
  903. continue;
  904. }
  905. if (c === '\\' && escaped) {
  906. append(c);
  907. continue;
  908. }
  909. if (c === '\\' && inQuotes) {
  910. escaped = true;
  911. continue;
  912. }
  913. if (c === ' ' && !inQuotes) {
  914. if (arg.length > 0) {
  915. args.push(arg);
  916. arg = '';
  917. }
  918. continue;
  919. }
  920. append(c);
  921. }
  922. if (arg.length > 0) {
  923. args.push(arg.trim());
  924. }
  925. return args;
  926. }
  927. exports.argStringToArray = argStringToArray;
  928. class ExecState extends events.EventEmitter {
  929. constructor(options, toolPath) {
  930. super();
  931. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  932. this.processError = '';
  933. this.processExitCode = 0;
  934. this.processExited = false; // tracks whether the process has exited
  935. this.processStderr = false; // tracks whether stderr was written to
  936. this.delay = 10000; // 10 seconds
  937. this.done = false;
  938. this.timeout = null;
  939. if (!toolPath) {
  940. throw new Error('toolPath must not be empty');
  941. }
  942. this.options = options;
  943. this.toolPath = toolPath;
  944. if (options.delay) {
  945. this.delay = options.delay;
  946. }
  947. }
  948. CheckComplete() {
  949. if (this.done) {
  950. return;
  951. }
  952. if (this.processClosed) {
  953. this._setResult();
  954. }
  955. else if (this.processExited) {
  956. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  957. }
  958. }
  959. _debug(message) {
  960. this.emit('debug', message);
  961. }
  962. _setResult() {
  963. // determine whether there is an error
  964. let error;
  965. if (this.processExited) {
  966. if (this.processError) {
  967. error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
  968. }
  969. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  970. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  971. }
  972. else if (this.processStderr && this.options.failOnStdErr) {
  973. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  974. }
  975. }
  976. // clear the timeout
  977. if (this.timeout) {
  978. clearTimeout(this.timeout);
  979. this.timeout = null;
  980. }
  981. this.done = true;
  982. this.emit('done', error, this.processExitCode);
  983. }
  984. static HandleTimeout(state) {
  985. if (state.done) {
  986. return;
  987. }
  988. if (!state.processClosed && state.processExited) {
  989. const message = `The STDIO streams did not close within ${state.delay /
  990. 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
  991. state._debug(message);
  992. }
  993. state._setResult();
  994. }
  995. }
  996. //# sourceMappingURL=toolrunner.js.map
  997. /***/ }),
  998. /***/ 11:
  999. /***/ (function(module) {
  1000. // Returns a wrapper function that returns a wrapped callback
  1001. // The wrapper function should do some stuff, and return a
  1002. // presumably different callback function.
  1003. // This makes sure that own properties are retained, so that
  1004. // decorations and such are not lost along the way.
  1005. module.exports = wrappy
  1006. function wrappy (fn, cb) {
  1007. if (fn && cb) return wrappy(fn)(cb)
  1008. if (typeof fn !== 'function')
  1009. throw new TypeError('need wrapper function')
  1010. Object.keys(fn).forEach(function (k) {
  1011. wrapper[k] = fn[k]
  1012. })
  1013. return wrapper
  1014. function wrapper() {
  1015. var args = new Array(arguments.length)
  1016. for (var i = 0; i < args.length; i++) {
  1017. args[i] = arguments[i]
  1018. }
  1019. var ret = fn.apply(this, args)
  1020. var cb = args[args.length-1]
  1021. if (typeof ret === 'function' && ret !== cb) {
  1022. Object.keys(cb).forEach(function (k) {
  1023. ret[k] = cb[k]
  1024. })
  1025. }
  1026. return ret
  1027. }
  1028. }
  1029. /***/ }),
  1030. /***/ 16:
  1031. /***/ (function(module) {
  1032. module.exports = require("tls");
  1033. /***/ }),
  1034. /***/ 18:
  1035. /***/ (function() {
  1036. eval("require")("encoding");
  1037. /***/ }),
  1038. /***/ 19:
  1039. /***/ (function(module, __unusedexports, __webpack_require__) {
  1040. module.exports = authenticationPlugin;
  1041. const { Deprecation } = __webpack_require__(692);
  1042. const once = __webpack_require__(969);
  1043. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1044. const authenticate = __webpack_require__(674);
  1045. const beforeRequest = __webpack_require__(471);
  1046. const requestError = __webpack_require__(349);
  1047. function authenticationPlugin(octokit, options) {
  1048. if (options.auth) {
  1049. octokit.authenticate = () => {
  1050. deprecateAuthenticate(
  1051. octokit.log,
  1052. new Deprecation(
  1053. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1054. )
  1055. );
  1056. };
  1057. return;
  1058. }
  1059. const state = {
  1060. octokit,
  1061. auth: false
  1062. };
  1063. octokit.authenticate = authenticate.bind(null, state);
  1064. octokit.hook.before("request", beforeRequest.bind(null, state));
  1065. octokit.hook.error("request", requestError.bind(null, state));
  1066. }
  1067. /***/ }),
  1068. /***/ 20:
  1069. /***/ (function(module, __unusedexports, __webpack_require__) {
  1070. "use strict";
  1071. const cp = __webpack_require__(129);
  1072. const parse = __webpack_require__(568);
  1073. const enoent = __webpack_require__(881);
  1074. function spawn(command, args, options) {
  1075. // Parse the arguments
  1076. const parsed = parse(command, args, options);
  1077. // Spawn the child process
  1078. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1079. // Hook into child process "exit" event to emit an error if the command
  1080. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1081. enoent.hookChildProcess(spawned, parsed);
  1082. return spawned;
  1083. }
  1084. function spawnSync(command, args, options) {
  1085. // Parse the arguments
  1086. const parsed = parse(command, args, options);
  1087. // Spawn the child process
  1088. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1089. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1090. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1091. return result;
  1092. }
  1093. module.exports = spawn;
  1094. module.exports.spawn = spawn;
  1095. module.exports.sync = spawnSync;
  1096. module.exports._parse = parse;
  1097. module.exports._enoent = enoent;
  1098. /***/ }),
  1099. /***/ 39:
  1100. /***/ (function(module) {
  1101. "use strict";
  1102. module.exports = opts => {
  1103. opts = opts || {};
  1104. const env = opts.env || process.env;
  1105. const platform = opts.platform || process.platform;
  1106. if (platform !== 'win32') {
  1107. return 'PATH';
  1108. }
  1109. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1110. };
  1111. /***/ }),
  1112. /***/ 47:
  1113. /***/ (function(module, __unusedexports, __webpack_require__) {
  1114. module.exports = factory;
  1115. const Octokit = __webpack_require__(402);
  1116. const registerPlugin = __webpack_require__(855);
  1117. function factory(plugins) {
  1118. const Api = Octokit.bind(null, plugins || []);
  1119. Api.plugin = registerPlugin.bind(null, plugins || []);
  1120. return Api;
  1121. }
  1122. /***/ }),
  1123. /***/ 49:
  1124. /***/ (function(module, __unusedexports, __webpack_require__) {
  1125. "use strict";
  1126. const os = __webpack_require__(87);
  1127. const execa = __webpack_require__(955);
  1128. // Reference: https://www.gaijin.at/en/lstwinver.php
  1129. const names = new Map([
  1130. ['10.0', '10'],
  1131. ['6.3', '8.1'],
  1132. ['6.2', '8'],
  1133. ['6.1', '7'],
  1134. ['6.0', 'Vista'],
  1135. ['5.2', 'Server 2003'],
  1136. ['5.1', 'XP'],
  1137. ['5.0', '2000'],
  1138. ['4.9', 'ME'],
  1139. ['4.1', '98'],
  1140. ['4.0', '95']
  1141. ]);
  1142. const windowsRelease = release => {
  1143. const version = /\d+\.\d/.exec(release || os.release());
  1144. if (release && !version) {
  1145. throw new Error('`release` argument doesn\'t match `n.n`');
  1146. }
  1147. const ver = (version || [])[0];
  1148. // Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
  1149. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1150. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1151. // If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
  1152. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1153. const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1154. const year = (stdout.match(/2008|2012|2016/) || [])[0];
  1155. if (year) {
  1156. return `Server ${year}`;
  1157. }
  1158. }
  1159. return names.get(ver);
  1160. };
  1161. module.exports = windowsRelease;
  1162. /***/ }),
  1163. /***/ 87:
  1164. /***/ (function(module) {
  1165. module.exports = require("os");
  1166. /***/ }),
  1167. /***/ 118:
  1168. /***/ (function(module, __unusedexports, __webpack_require__) {
  1169. "use strict";
  1170. const os = __webpack_require__(87);
  1171. const nameMap = new Map([
  1172. [19, 'Catalina'],
  1173. [18, 'Mojave'],
  1174. [17, 'High Sierra'],
  1175. [16, 'Sierra'],
  1176. [15, 'El Capitan'],
  1177. [14, 'Yosemite'],
  1178. [13, 'Mavericks'],
  1179. [12, 'Mountain Lion'],
  1180. [11, 'Lion'],
  1181. [10, 'Snow Leopard'],
  1182. [9, 'Leopard'],
  1183. [8, 'Tiger'],
  1184. [7, 'Panther'],
  1185. [6, 'Jaguar'],
  1186. [5, 'Puma']
  1187. ]);
  1188. const macosRelease = release => {
  1189. release = Number((release || os.release()).split('.')[0]);
  1190. return {
  1191. name: nameMap.get(release),
  1192. version: '10.' + (release - 4)
  1193. };
  1194. };
  1195. module.exports = macosRelease;
  1196. // TODO: remove this in the next major version
  1197. module.exports.default = macosRelease;
  1198. /***/ }),
  1199. /***/ 126:
  1200. /***/ (function(module) {
  1201. /**
  1202. * lodash (Custom Build) <https://lodash.com/>
  1203. * Build: `lodash modularize exports="npm" -o ./`
  1204. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1205. * Released under MIT license <https://lodash.com/license>
  1206. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1207. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1208. */
  1209. /** Used as the size to enable large array optimizations. */
  1210. var LARGE_ARRAY_SIZE = 200;
  1211. /** Used to stand-in for `undefined` hash values. */
  1212. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1213. /** Used as references for various `Number` constants. */
  1214. var INFINITY = 1 / 0;
  1215. /** `Object#toString` result references. */
  1216. var funcTag = '[object Function]',
  1217. genTag = '[object GeneratorFunction]';
  1218. /**
  1219. * Used to match `RegExp`
  1220. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1221. */
  1222. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1223. /** Used to detect host constructors (Safari). */
  1224. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1225. /** Detect free variable `global` from Node.js. */
  1226. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1227. /** Detect free variable `self`. */
  1228. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1229. /** Used as a reference to the global object. */
  1230. var root = freeGlobal || freeSelf || Function('return this')();
  1231. /**
  1232. * A specialized version of `_.includes` for arrays without support for
  1233. * specifying an index to search from.
  1234. *
  1235. * @private
  1236. * @param {Array} [array] The array to inspect.
  1237. * @param {*} target The value to search for.
  1238. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1239. */
  1240. function arrayIncludes(array, value) {
  1241. var length = array ? array.length : 0;
  1242. return !!length && baseIndexOf(array, value, 0) > -1;
  1243. }
  1244. /**
  1245. * This function is like `arrayIncludes` except that it accepts a comparator.
  1246. *
  1247. * @private
  1248. * @param {Array} [array] The array to inspect.
  1249. * @param {*} target The value to search for.
  1250. * @param {Function} comparator The comparator invoked per element.
  1251. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1252. */
  1253. function arrayIncludesWith(array, value, comparator) {
  1254. var index = -1,
  1255. length = array ? array.length : 0;
  1256. while (++index < length) {
  1257. if (comparator(value, array[index])) {
  1258. return true;
  1259. }
  1260. }
  1261. return false;
  1262. }
  1263. /**
  1264. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1265. * support for iteratee shorthands.
  1266. *
  1267. * @private
  1268. * @param {Array} array The array to inspect.
  1269. * @param {Function} predicate The function invoked per iteration.
  1270. * @param {number} fromIndex The index to search from.
  1271. * @param {boolean} [fromRight] Specify iterating from right to left.
  1272. * @returns {number} Returns the index of the matched value, else `-1`.
  1273. */
  1274. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1275. var length = array.length,
  1276. index = fromIndex + (fromRight ? 1 : -1);
  1277. while ((fromRight ? index-- : ++index < length)) {
  1278. if (predicate(array[index], index, array)) {
  1279. return index;
  1280. }
  1281. }
  1282. return -1;
  1283. }
  1284. /**
  1285. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1286. *
  1287. * @private
  1288. * @param {Array} array The array to inspect.
  1289. * @param {*} value The value to search for.
  1290. * @param {number} fromIndex The index to search from.
  1291. * @returns {number} Returns the index of the matched value, else `-1`.
  1292. */
  1293. function baseIndexOf(array, value, fromIndex) {
  1294. if (value !== value) {
  1295. return baseFindIndex(array, baseIsNaN, fromIndex);
  1296. }
  1297. var index = fromIndex - 1,
  1298. length = array.length;
  1299. while (++index < length) {
  1300. if (array[index] === value) {
  1301. return index;
  1302. }
  1303. }
  1304. return -1;
  1305. }
  1306. /**
  1307. * The base implementation of `_.isNaN` without support for number objects.
  1308. *
  1309. * @private
  1310. * @param {*} value The value to check.
  1311. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1312. */
  1313. function baseIsNaN(value) {
  1314. return value !== value;
  1315. }
  1316. /**
  1317. * Checks if a cache value for `key` exists.
  1318. *
  1319. * @private
  1320. * @param {Object} cache The cache to query.
  1321. * @param {string} key The key of the entry to check.
  1322. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1323. */
  1324. function cacheHas(cache, key) {
  1325. return cache.has(key);
  1326. }
  1327. /**
  1328. * Gets the value at `key` of `object`.
  1329. *
  1330. * @private
  1331. * @param {Object} [object] The object to query.
  1332. * @param {string} key The key of the property to get.
  1333. * @returns {*} Returns the property value.
  1334. */
  1335. function getValue(object, key) {
  1336. return object == null ? undefined : object[key];
  1337. }
  1338. /**
  1339. * Checks if `value` is a host object in IE < 9.
  1340. *
  1341. * @private
  1342. * @param {*} value The value to check.
  1343. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1344. */
  1345. function isHostObject(value) {
  1346. // Many host objects are `Object` objects that can coerce to strings
  1347. // despite having improperly defined `toString` methods.
  1348. var result = false;
  1349. if (value != null && typeof value.toString != 'function') {
  1350. try {
  1351. result = !!(value + '');
  1352. } catch (e) {}
  1353. }
  1354. return result;
  1355. }
  1356. /**
  1357. * Converts `set` to an array of its values.
  1358. *
  1359. * @private
  1360. * @param {Object} set The set to convert.
  1361. * @returns {Array} Returns the values.
  1362. */
  1363. function setToArray(set) {
  1364. var index = -1,
  1365. result = Array(set.size);
  1366. set.forEach(function(value) {
  1367. result[++index] = value;
  1368. });
  1369. return result;
  1370. }
  1371. /** Used for built-in method references. */
  1372. var arrayProto = Array.prototype,
  1373. funcProto = Function.prototype,
  1374. objectProto = Object.prototype;
  1375. /** Used to detect overreaching core-js shims. */
  1376. var coreJsData = root['__core-js_shared__'];
  1377. /** Used to detect methods masquerading as native. */
  1378. var maskSrcKey = (function() {
  1379. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1380. return uid ? ('Symbol(src)_1.' + uid) : '';
  1381. }());
  1382. /** Used to resolve the decompiled source of functions. */
  1383. var funcToString = funcProto.toString;
  1384. /** Used to check objects for own properties. */
  1385. var hasOwnProperty = objectProto.hasOwnProperty;
  1386. /**
  1387. * Used to resolve the
  1388. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1389. * of values.
  1390. */
  1391. var objectToString = objectProto.toString;
  1392. /** Used to detect if a method is native. */
  1393. var reIsNative = RegExp('^' +
  1394. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1395. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1396. );
  1397. /** Built-in value references. */
  1398. var splice = arrayProto.splice;
  1399. /* Built-in method references that are verified to be native. */
  1400. var Map = getNative(root, 'Map'),
  1401. Set = getNative(root, 'Set'),
  1402. nativeCreate = getNative(Object, 'create');
  1403. /**
  1404. * Creates a hash object.
  1405. *
  1406. * @private
  1407. * @constructor
  1408. * @param {Array} [entries] The key-value pairs to cache.
  1409. */
  1410. function Hash(entries) {
  1411. var index = -1,
  1412. length = entries ? entries.length : 0;
  1413. this.clear();
  1414. while (++index < length) {
  1415. var entry = entries[index];
  1416. this.set(entry[0], entry[1]);
  1417. }
  1418. }
  1419. /**
  1420. * Removes all key-value entries from the hash.
  1421. *
  1422. * @private
  1423. * @name clear
  1424. * @memberOf Hash
  1425. */
  1426. function hashClear() {
  1427. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1428. }
  1429. /**
  1430. * Removes `key` and its value from the hash.
  1431. *
  1432. * @private
  1433. * @name delete
  1434. * @memberOf Hash
  1435. * @param {Object} hash The hash to modify.
  1436. * @param {string} key The key of the value to remove.
  1437. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1438. */
  1439. function hashDelete(key) {
  1440. return this.has(key) && delete this.__data__[key];
  1441. }
  1442. /**
  1443. * Gets the hash value for `key`.
  1444. *
  1445. * @private
  1446. * @name get
  1447. * @memberOf Hash
  1448. * @param {string} key The key of the value to get.
  1449. * @returns {*} Returns the entry value.
  1450. */
  1451. function hashGet(key) {
  1452. var data = this.__data__;
  1453. if (nativeCreate) {
  1454. var result = data[key];
  1455. return result === HASH_UNDEFINED ? undefined : result;
  1456. }
  1457. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1458. }
  1459. /**
  1460. * Checks if a hash value for `key` exists.
  1461. *
  1462. * @private
  1463. * @name has
  1464. * @memberOf Hash
  1465. * @param {string} key The key of the entry to check.
  1466. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1467. */
  1468. function hashHas(key) {
  1469. var data = this.__data__;
  1470. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1471. }
  1472. /**
  1473. * Sets the hash `key` to `value`.
  1474. *
  1475. * @private
  1476. * @name set
  1477. * @memberOf Hash
  1478. * @param {string} key The key of the value to set.
  1479. * @param {*} value The value to set.
  1480. * @returns {Object} Returns the hash instance.
  1481. */
  1482. function hashSet(key, value) {
  1483. var data = this.__data__;
  1484. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1485. return this;
  1486. }
  1487. // Add methods to `Hash`.
  1488. Hash.prototype.clear = hashClear;
  1489. Hash.prototype['delete'] = hashDelete;
  1490. Hash.prototype.get = hashGet;
  1491. Hash.prototype.has = hashHas;
  1492. Hash.prototype.set = hashSet;
  1493. /**
  1494. * Creates an list cache object.
  1495. *
  1496. * @private
  1497. * @constructor
  1498. * @param {Array} [entries] The key-value pairs to cache.
  1499. */
  1500. function ListCache(entries) {
  1501. var index = -1,
  1502. length = entries ? entries.length : 0;
  1503. this.clear();
  1504. while (++index < length) {
  1505. var entry = entries[index];
  1506. this.set(entry[0], entry[1]);
  1507. }
  1508. }
  1509. /**
  1510. * Removes all key-value entries from the list cache.
  1511. *
  1512. * @private
  1513. * @name clear
  1514. * @memberOf ListCache
  1515. */
  1516. function listCacheClear() {
  1517. this.__data__ = [];
  1518. }
  1519. /**
  1520. * Removes `key` and its value from the list cache.
  1521. *
  1522. * @private
  1523. * @name delete
  1524. * @memberOf ListCache
  1525. * @param {string} key The key of the value to remove.
  1526. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1527. */
  1528. function listCacheDelete(key) {
  1529. var data = this.__data__,
  1530. index = assocIndexOf(data, key);
  1531. if (index < 0) {
  1532. return false;
  1533. }
  1534. var lastIndex = data.length - 1;
  1535. if (index == lastIndex) {
  1536. data.pop();
  1537. } else {
  1538. splice.call(data, index, 1);
  1539. }
  1540. return true;
  1541. }
  1542. /**
  1543. * Gets the list cache value for `key`.
  1544. *
  1545. * @private
  1546. * @name get
  1547. * @memberOf ListCache
  1548. * @param {string} key The key of the value to get.
  1549. * @returns {*} Returns the entry value.
  1550. */
  1551. function listCacheGet(key) {
  1552. var data = this.__data__,
  1553. index = assocIndexOf(data, key);
  1554. return index < 0 ? undefined : data[index][1];
  1555. }
  1556. /**
  1557. * Checks if a list cache value for `key` exists.
  1558. *
  1559. * @private
  1560. * @name has
  1561. * @memberOf ListCache
  1562. * @param {string} key The key of the entry to check.
  1563. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1564. */
  1565. function listCacheHas(key) {
  1566. return assocIndexOf(this.__data__, key) > -1;
  1567. }
  1568. /**
  1569. * Sets the list cache `key` to `value`.
  1570. *
  1571. * @private
  1572. * @name set
  1573. * @memberOf ListCache
  1574. * @param {string} key The key of the value to set.
  1575. * @param {*} value The value to set.
  1576. * @returns {Object} Returns the list cache instance.
  1577. */
  1578. function listCacheSet(key, value) {
  1579. var data = this.__data__,
  1580. index = assocIndexOf(data, key);
  1581. if (index < 0) {
  1582. data.push([key, value]);
  1583. } else {
  1584. data[index][1] = value;
  1585. }
  1586. return this;
  1587. }
  1588. // Add methods to `ListCache`.
  1589. ListCache.prototype.clear = listCacheClear;
  1590. ListCache.prototype['delete'] = listCacheDelete;
  1591. ListCache.prototype.get = listCacheGet;
  1592. ListCache.prototype.has = listCacheHas;
  1593. ListCache.prototype.set = listCacheSet;
  1594. /**
  1595. * Creates a map cache object to store key-value pairs.
  1596. *
  1597. * @private
  1598. * @constructor
  1599. * @param {Array} [entries] The key-value pairs to cache.
  1600. */
  1601. function MapCache(entries) {
  1602. var index = -1,
  1603. length = entries ? entries.length : 0;
  1604. this.clear();
  1605. while (++index < length) {
  1606. var entry = entries[index];
  1607. this.set(entry[0], entry[1]);
  1608. }
  1609. }
  1610. /**
  1611. * Removes all key-value entries from the map.
  1612. *
  1613. * @private
  1614. * @name clear
  1615. * @memberOf MapCache
  1616. */
  1617. function mapCacheClear() {
  1618. this.__data__ = {
  1619. 'hash': new Hash,
  1620. 'map': new (Map || ListCache),
  1621. 'string': new Hash
  1622. };
  1623. }
  1624. /**
  1625. * Removes `key` and its value from the map.
  1626. *
  1627. * @private
  1628. * @name delete
  1629. * @memberOf MapCache
  1630. * @param {string} key The key of the value to remove.
  1631. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1632. */
  1633. function mapCacheDelete(key) {
  1634. return getMapData(this, key)['delete'](key);
  1635. }
  1636. /**
  1637. * Gets the map value for `key`.
  1638. *
  1639. * @private
  1640. * @name get
  1641. * @memberOf MapCache
  1642. * @param {string} key The key of the value to get.
  1643. * @returns {*} Returns the entry value.
  1644. */
  1645. function mapCacheGet(key) {
  1646. return getMapData(this, key).get(key);
  1647. }
  1648. /**
  1649. * Checks if a map value for `key` exists.
  1650. *
  1651. * @private
  1652. * @name has
  1653. * @memberOf MapCache
  1654. * @param {string} key The key of the entry to check.
  1655. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1656. */
  1657. function mapCacheHas(key) {
  1658. return getMapData(this, key).has(key);
  1659. }
  1660. /**
  1661. * Sets the map `key` to `value`.
  1662. *
  1663. * @private
  1664. * @name set
  1665. * @memberOf MapCache
  1666. * @param {string} key The key of the value to set.
  1667. * @param {*} value The value to set.
  1668. * @returns {Object} Returns the map cache instance.
  1669. */
  1670. function mapCacheSet(key, value) {
  1671. getMapData(this, key).set(key, value);
  1672. return this;
  1673. }
  1674. // Add methods to `MapCache`.
  1675. MapCache.prototype.clear = mapCacheClear;
  1676. MapCache.prototype['delete'] = mapCacheDelete;
  1677. MapCache.prototype.get = mapCacheGet;
  1678. MapCache.prototype.has = mapCacheHas;
  1679. MapCache.prototype.set = mapCacheSet;
  1680. /**
  1681. *
  1682. * Creates an array cache object to store unique values.
  1683. *
  1684. * @private
  1685. * @constructor
  1686. * @param {Array} [values] The values to cache.
  1687. */
  1688. function SetCache(values) {
  1689. var index = -1,
  1690. length = values ? values.length : 0;
  1691. this.__data__ = new MapCache;
  1692. while (++index < length) {
  1693. this.add(values[index]);
  1694. }
  1695. }
  1696. /**
  1697. * Adds `value` to the array cache.
  1698. *
  1699. * @private
  1700. * @name add
  1701. * @memberOf SetCache
  1702. * @alias push
  1703. * @param {*} value The value to cache.
  1704. * @returns {Object} Returns the cache instance.
  1705. */
  1706. function setCacheAdd(value) {
  1707. this.__data__.set(value, HASH_UNDEFINED);
  1708. return this;
  1709. }
  1710. /**
  1711. * Checks if `value` is in the array cache.
  1712. *
  1713. * @private
  1714. * @name has
  1715. * @memberOf SetCache
  1716. * @param {*} value The value to search for.
  1717. * @returns {number} Returns `true` if `value` is found, else `false`.
  1718. */
  1719. function setCacheHas(value) {
  1720. return this.__data__.has(value);
  1721. }
  1722. // Add methods to `SetCache`.
  1723. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1724. SetCache.prototype.has = setCacheHas;
  1725. /**
  1726. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1727. *
  1728. * @private
  1729. * @param {Array} array The array to inspect.
  1730. * @param {*} key The key to search for.
  1731. * @returns {number} Returns the index of the matched value, else `-1`.
  1732. */
  1733. function assocIndexOf(array, key) {
  1734. var length = array.length;
  1735. while (length--) {
  1736. if (eq(array[length][0], key)) {
  1737. return length;
  1738. }
  1739. }
  1740. return -1;
  1741. }
  1742. /**
  1743. * The base implementation of `_.isNative` without bad shim checks.
  1744. *
  1745. * @private
  1746. * @param {*} value The value to check.
  1747. * @returns {boolean} Returns `true` if `value` is a native function,
  1748. * else `false`.
  1749. */
  1750. function baseIsNative(value) {
  1751. if (!isObject(value) || isMasked(value)) {
  1752. return false;
  1753. }
  1754. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1755. return pattern.test(toSource(value));
  1756. }
  1757. /**
  1758. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1759. *
  1760. * @private
  1761. * @param {Array} array The array to inspect.
  1762. * @param {Function} [iteratee] The iteratee invoked per element.
  1763. * @param {Function} [comparator] The comparator invoked per element.
  1764. * @returns {Array} Returns the new duplicate free array.
  1765. */
  1766. function baseUniq(array, iteratee, comparator) {
  1767. var index = -1,
  1768. includes = arrayIncludes,
  1769. length = array.length,
  1770. isCommon = true,
  1771. result = [],
  1772. seen = result;
  1773. if (comparator) {
  1774. isCommon = false;
  1775. includes = arrayIncludesWith;
  1776. }
  1777. else if (length >= LARGE_ARRAY_SIZE) {
  1778. var set = iteratee ? null : createSet(array);
  1779. if (set) {
  1780. return setToArray(set);
  1781. }
  1782. isCommon = false;
  1783. includes = cacheHas;
  1784. seen = new SetCache;
  1785. }
  1786. else {
  1787. seen = iteratee ? [] : result;
  1788. }
  1789. outer:
  1790. while (++index < length) {
  1791. var value = array[index],
  1792. computed = iteratee ? iteratee(value) : value;
  1793. value = (comparator || value !== 0) ? value : 0;
  1794. if (isCommon && computed === computed) {
  1795. var seenIndex = seen.length;
  1796. while (seenIndex--) {
  1797. if (seen[seenIndex] === computed) {
  1798. continue outer;
  1799. }
  1800. }
  1801. if (iteratee) {
  1802. seen.push(computed);
  1803. }
  1804. result.push(value);
  1805. }
  1806. else if (!includes(seen, computed, comparator)) {
  1807. if (seen !== result) {
  1808. seen.push(computed);
  1809. }
  1810. result.push(value);
  1811. }
  1812. }
  1813. return result;
  1814. }
  1815. /**
  1816. * Creates a set object of `values`.
  1817. *
  1818. * @private
  1819. * @param {Array} values The values to add to the set.
  1820. * @returns {Object} Returns the new set.
  1821. */
  1822. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1823. return new Set(values);
  1824. };
  1825. /**
  1826. * Gets the data for `map`.
  1827. *
  1828. * @private
  1829. * @param {Object} map The map to query.
  1830. * @param {string} key The reference key.
  1831. * @returns {*} Returns the map data.
  1832. */
  1833. function getMapData(map, key) {
  1834. var data = map.__data__;
  1835. return isKeyable(key)
  1836. ? data[typeof key == 'string' ? 'string' : 'hash']
  1837. : data.map;
  1838. }
  1839. /**
  1840. * Gets the native function at `key` of `object`.
  1841. *
  1842. * @private
  1843. * @param {Object} object The object to query.
  1844. * @param {string} key The key of the method to get.
  1845. * @returns {*} Returns the function if it's native, else `undefined`.
  1846. */
  1847. function getNative(object, key) {
  1848. var value = getValue(object, key);
  1849. return baseIsNative(value) ? value : undefined;
  1850. }
  1851. /**
  1852. * Checks if `value` is suitable for use as unique object key.
  1853. *
  1854. * @private
  1855. * @param {*} value The value to check.
  1856. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1857. */
  1858. function isKeyable(value) {
  1859. var type = typeof value;
  1860. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1861. ? (value !== '__proto__')
  1862. : (value === null);
  1863. }
  1864. /**
  1865. * Checks if `func` has its source masked.
  1866. *
  1867. * @private
  1868. * @param {Function} func The function to check.
  1869. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1870. */
  1871. function isMasked(func) {
  1872. return !!maskSrcKey && (maskSrcKey in func);
  1873. }
  1874. /**
  1875. * Converts `func` to its source code.
  1876. *
  1877. * @private
  1878. * @param {Function} func The function to process.
  1879. * @returns {string} Returns the source code.
  1880. */
  1881. function toSource(func) {
  1882. if (func != null) {
  1883. try {
  1884. return funcToString.call(func);
  1885. } catch (e) {}
  1886. try {
  1887. return (func + '');
  1888. } catch (e) {}
  1889. }
  1890. return '';
  1891. }
  1892. /**
  1893. * Creates a duplicate-free version of an array, using
  1894. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1895. * for equality comparisons, in which only the first occurrence of each
  1896. * element is kept.
  1897. *
  1898. * @static
  1899. * @memberOf _
  1900. * @since 0.1.0
  1901. * @category Array
  1902. * @param {Array} array The array to inspect.
  1903. * @returns {Array} Returns the new duplicate free array.
  1904. * @example
  1905. *
  1906. * _.uniq([2, 1, 2]);
  1907. * // => [2, 1]
  1908. */
  1909. function uniq(array) {
  1910. return (array && array.length)
  1911. ? baseUniq(array)
  1912. : [];
  1913. }
  1914. /**
  1915. * Performs a
  1916. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1917. * comparison between two values to determine if they are equivalent.
  1918. *
  1919. * @static
  1920. * @memberOf _
  1921. * @since 4.0.0
  1922. * @category Lang
  1923. * @param {*} value The value to compare.
  1924. * @param {*} other The other value to compare.
  1925. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1926. * @example
  1927. *
  1928. * var object = { 'a': 1 };
  1929. * var other = { 'a': 1 };
  1930. *
  1931. * _.eq(object, object);
  1932. * // => true
  1933. *
  1934. * _.eq(object, other);
  1935. * // => false
  1936. *
  1937. * _.eq('a', 'a');
  1938. * // => true
  1939. *
  1940. * _.eq('a', Object('a'));
  1941. * // => false
  1942. *
  1943. * _.eq(NaN, NaN);
  1944. * // => true
  1945. */
  1946. function eq(value, other) {
  1947. return value === other || (value !== value && other !== other);
  1948. }
  1949. /**
  1950. * Checks if `value` is classified as a `Function` object.
  1951. *
  1952. * @static
  1953. * @memberOf _
  1954. * @since 0.1.0
  1955. * @category Lang
  1956. * @param {*} value The value to check.
  1957. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1958. * @example
  1959. *
  1960. * _.isFunction(_);
  1961. * // => true
  1962. *
  1963. * _.isFunction(/abc/);
  1964. * // => false
  1965. */
  1966. function isFunction(value) {
  1967. // The use of `Object#toString` avoids issues with the `typeof` operator
  1968. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  1969. var tag = isObject(value) ? objectToString.call(value) : '';
  1970. return tag == funcTag || tag == genTag;
  1971. }
  1972. /**
  1973. * Checks if `value` is the
  1974. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1975. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1976. *
  1977. * @static
  1978. * @memberOf _
  1979. * @since 0.1.0
  1980. * @category Lang
  1981. * @param {*} value The value to check.
  1982. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1983. * @example
  1984. *
  1985. * _.isObject({});
  1986. * // => true
  1987. *
  1988. * _.isObject([1, 2, 3]);
  1989. * // => true
  1990. *
  1991. * _.isObject(_.noop);
  1992. * // => true
  1993. *
  1994. * _.isObject(null);
  1995. * // => false
  1996. */
  1997. function isObject(value) {
  1998. var type = typeof value;
  1999. return !!value && (type == 'object' || type == 'function');
  2000. }
  2001. /**
  2002. * This method returns `undefined`.
  2003. *
  2004. * @static
  2005. * @memberOf _
  2006. * @since 2.3.0
  2007. * @category Util
  2008. * @example
  2009. *
  2010. * _.times(2, _.noop);
  2011. * // => [undefined, undefined]
  2012. */
  2013. function noop() {
  2014. // No operation performed.
  2015. }
  2016. module.exports = uniq;
  2017. /***/ }),
  2018. /***/ 129:
  2019. /***/ (function(module) {
  2020. module.exports = require("child_process");
  2021. /***/ }),
  2022. /***/ 139:
  2023. /***/ (function(module, __unusedexports, __webpack_require__) {
  2024. // Unique ID creation requires a high quality random # generator. In node.js
  2025. // this is pretty straight-forward - we use the crypto API.
  2026. var crypto = __webpack_require__(417);
  2027. module.exports = function nodeRNG() {
  2028. return crypto.randomBytes(16);
  2029. };
  2030. /***/ }),
  2031. /***/ 141:
  2032. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2033. "use strict";
  2034. var net = __webpack_require__(631);
  2035. var tls = __webpack_require__(16);
  2036. var http = __webpack_require__(605);
  2037. var https = __webpack_require__(211);
  2038. var events = __webpack_require__(614);
  2039. var assert = __webpack_require__(357);
  2040. var util = __webpack_require__(669);
  2041. exports.httpOverHttp = httpOverHttp;
  2042. exports.httpsOverHttp = httpsOverHttp;
  2043. exports.httpOverHttps = httpOverHttps;
  2044. exports.httpsOverHttps = httpsOverHttps;
  2045. function httpOverHttp(options) {
  2046. var agent = new TunnelingAgent(options);
  2047. agent.request = http.request;
  2048. return agent;
  2049. }
  2050. function httpsOverHttp(options) {
  2051. var agent = new TunnelingAgent(options);
  2052. agent.request = http.request;
  2053. agent.createSocket = createSecureSocket;
  2054. return agent;
  2055. }
  2056. function httpOverHttps(options) {
  2057. var agent = new TunnelingAgent(options);
  2058. agent.request = https.request;
  2059. return agent;
  2060. }
  2061. function httpsOverHttps(options) {
  2062. var agent = new TunnelingAgent(options);
  2063. agent.request = https.request;
  2064. agent.createSocket = createSecureSocket;
  2065. return agent;
  2066. }
  2067. function TunnelingAgent(options) {
  2068. var self = this;
  2069. self.options = options || {};
  2070. self.proxyOptions = self.options.proxy || {};
  2071. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2072. self.requests = [];
  2073. self.sockets = [];
  2074. self.on('free', function onFree(socket, host, port, localAddress) {
  2075. var options = toOptions(host, port, localAddress);
  2076. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2077. var pending = self.requests[i];
  2078. if (pending.host === options.host && pending.port === options.port) {
  2079. // Detect the request to connect same origin server,
  2080. // reuse the connection.
  2081. self.requests.splice(i, 1);
  2082. pending.request.onSocket(socket);
  2083. return;
  2084. }
  2085. }
  2086. socket.destroy();
  2087. self.removeSocket(socket);
  2088. });
  2089. }
  2090. util.inherits(TunnelingAgent, events.EventEmitter);
  2091. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2092. var self = this;
  2093. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2094. if (self.sockets.length >= this.maxSockets) {
  2095. // We are over limit so we'll add it to the queue.
  2096. self.requests.push(options);
  2097. return;
  2098. }
  2099. // If we are under maxSockets create a new one.
  2100. self.createSocket(options, function(socket) {
  2101. socket.on('free', onFree);
  2102. socket.on('close', onCloseOrRemove);
  2103. socket.on('agentRemove', onCloseOrRemove);
  2104. req.onSocket(socket);
  2105. function onFree() {
  2106. self.emit('free', socket, options);
  2107. }
  2108. function onCloseOrRemove(err) {
  2109. self.removeSocket(socket);
  2110. socket.removeListener('free', onFree);
  2111. socket.removeListener('close', onCloseOrRemove);
  2112. socket.removeListener('agentRemove', onCloseOrRemove);
  2113. }
  2114. });
  2115. };
  2116. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2117. var self = this;
  2118. var placeholder = {};
  2119. self.sockets.push(placeholder);
  2120. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2121. method: 'CONNECT',
  2122. path: options.host + ':' + options.port,
  2123. agent: false
  2124. });
  2125. if (connectOptions.proxyAuth) {
  2126. connectOptions.headers = connectOptions.headers || {};
  2127. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2128. new Buffer(connectOptions.proxyAuth).toString('base64');
  2129. }
  2130. debug('making CONNECT request');
  2131. var connectReq = self.request(connectOptions);
  2132. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2133. connectReq.once('response', onResponse); // for v0.6
  2134. connectReq.once('upgrade', onUpgrade); // for v0.6
  2135. connectReq.once('connect', onConnect); // for v0.7 or later
  2136. connectReq.once('error', onError);
  2137. connectReq.end();
  2138. function onResponse(res) {
  2139. // Very hacky. This is necessary to avoid http-parser leaks.
  2140. res.upgrade = true;
  2141. }
  2142. function onUpgrade(res, socket, head) {
  2143. // Hacky.
  2144. process.nextTick(function() {
  2145. onConnect(res, socket, head);
  2146. });
  2147. }
  2148. function onConnect(res, socket, head) {
  2149. connectReq.removeAllListeners();
  2150. socket.removeAllListeners();
  2151. if (res.statusCode === 200) {
  2152. assert.equal(head.length, 0);
  2153. debug('tunneling connection has established');
  2154. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2155. cb(socket);
  2156. } else {
  2157. debug('tunneling socket could not be established, statusCode=%d',
  2158. res.statusCode);
  2159. var error = new Error('tunneling socket could not be established, ' +
  2160. 'statusCode=' + res.statusCode);
  2161. error.code = 'ECONNRESET';
  2162. options.request.emit('error', error);
  2163. self.removeSocket(placeholder);
  2164. }
  2165. }
  2166. function onError(cause) {
  2167. connectReq.removeAllListeners();
  2168. debug('tunneling socket could not be established, cause=%s\n',
  2169. cause.message, cause.stack);
  2170. var error = new Error('tunneling socket could not be established, ' +
  2171. 'cause=' + cause.message);
  2172. error.code = 'ECONNRESET';
  2173. options.request.emit('error', error);
  2174. self.removeSocket(placeholder);
  2175. }
  2176. };
  2177. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2178. var pos = this.sockets.indexOf(socket)
  2179. if (pos === -1) {
  2180. return;
  2181. }
  2182. this.sockets.splice(pos, 1);
  2183. var pending = this.requests.shift();
  2184. if (pending) {
  2185. // If we have pending requests and a socket gets closed a new one
  2186. // needs to be created to take over in the pool for the one that closed.
  2187. this.createSocket(pending, function(socket) {
  2188. pending.request.onSocket(socket);
  2189. });
  2190. }
  2191. };
  2192. function createSecureSocket(options, cb) {
  2193. var self = this;
  2194. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2195. var hostHeader = options.request.getHeader('host');
  2196. var tlsOptions = mergeOptions({}, self.options, {
  2197. socket: socket,
  2198. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2199. });
  2200. // 0 is dummy port for v0.6
  2201. var secureSocket = tls.connect(0, tlsOptions);
  2202. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2203. cb(secureSocket);
  2204. });
  2205. }
  2206. function toOptions(host, port, localAddress) {
  2207. if (typeof host === 'string') { // since v0.10
  2208. return {
  2209. host: host,
  2210. port: port,
  2211. localAddress: localAddress
  2212. };
  2213. }
  2214. return host; // for v0.11 or later
  2215. }
  2216. function mergeOptions(target) {
  2217. for (var i = 1, len = arguments.length; i < len; ++i) {
  2218. var overrides = arguments[i];
  2219. if (typeof overrides === 'object') {
  2220. var keys = Object.keys(overrides);
  2221. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2222. var k = keys[j];
  2223. if (overrides[k] !== undefined) {
  2224. target[k] = overrides[k];
  2225. }
  2226. }
  2227. }
  2228. }
  2229. return target;
  2230. }
  2231. var debug;
  2232. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2233. debug = function() {
  2234. var args = Array.prototype.slice.call(arguments);
  2235. if (typeof args[0] === 'string') {
  2236. args[0] = 'TUNNEL: ' + args[0];
  2237. } else {
  2238. args.unshift('TUNNEL:');
  2239. }
  2240. console.error.apply(console, args);
  2241. }
  2242. } else {
  2243. debug = function() {};
  2244. }
  2245. exports.debug = debug; // for test
  2246. /***/ }),
  2247. /***/ 143:
  2248. /***/ (function(module, __unusedexports, __webpack_require__) {
  2249. module.exports = withAuthorizationPrefix;
  2250. const atob = __webpack_require__(368);
  2251. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2252. function withAuthorizationPrefix(authorization) {
  2253. if (/^(basic|bearer|token) /i.test(authorization)) {
  2254. return authorization;
  2255. }
  2256. try {
  2257. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2258. return `basic ${authorization}`;
  2259. }
  2260. } catch (error) {}
  2261. if (authorization.split(/\./).length === 3) {
  2262. return `bearer ${authorization}`;
  2263. }
  2264. return `token ${authorization}`;
  2265. }
  2266. /***/ }),
  2267. /***/ 145:
  2268. /***/ (function(module, __unusedexports, __webpack_require__) {
  2269. "use strict";
  2270. const pump = __webpack_require__(453);
  2271. const bufferStream = __webpack_require__(966);
  2272. class MaxBufferError extends Error {
  2273. constructor() {
  2274. super('maxBuffer exceeded');
  2275. this.name = 'MaxBufferError';
  2276. }
  2277. }
  2278. function getStream(inputStream, options) {
  2279. if (!inputStream) {
  2280. return Promise.reject(new Error('Expected a stream'));
  2281. }
  2282. options = Object.assign({maxBuffer: Infinity}, options);
  2283. const {maxBuffer} = options;
  2284. let stream;
  2285. return new Promise((resolve, reject) => {
  2286. const rejectPromise = error => {
  2287. if (error) { // A null check
  2288. error.bufferedData = stream.getBufferedValue();
  2289. }
  2290. reject(error);
  2291. };
  2292. stream = pump(inputStream, bufferStream(options), error => {
  2293. if (error) {
  2294. rejectPromise(error);
  2295. return;
  2296. }
  2297. resolve();
  2298. });
  2299. stream.on('data', () => {
  2300. if (stream.getBufferedLength() > maxBuffer) {
  2301. rejectPromise(new MaxBufferError());
  2302. }
  2303. });
  2304. }).then(() => stream.getBufferedValue());
  2305. }
  2306. module.exports = getStream;
  2307. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2308. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2309. module.exports.MaxBufferError = MaxBufferError;
  2310. /***/ }),
  2311. /***/ 148:
  2312. /***/ (function(module, __unusedexports, __webpack_require__) {
  2313. module.exports = paginatePlugin;
  2314. const iterator = __webpack_require__(8);
  2315. const paginate = __webpack_require__(807);
  2316. function paginatePlugin(octokit) {
  2317. octokit.paginate = paginate.bind(null, octokit);
  2318. octokit.paginate.iterator = iterator.bind(null, octokit);
  2319. }
  2320. /***/ }),
  2321. /***/ 153:
  2322. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2323. "use strict";
  2324. var __importStar = (this && this.__importStar) || function (mod) {
  2325. if (mod && mod.__esModule) return mod;
  2326. var result = {};
  2327. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2328. result["default"] = mod;
  2329. return result;
  2330. };
  2331. Object.defineProperty(exports, "__esModule", { value: true });
  2332. const coreCommand = __importStar(__webpack_require__(431));
  2333. /**
  2334. * Indicates whether the POST action is running
  2335. */
  2336. exports.IsPost = !!process.env['STATE_isPost'];
  2337. /**
  2338. * The repository path for the POST action. The value is empty during the MAIN action.
  2339. */
  2340. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2341. /**
  2342. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2343. */
  2344. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  2345. /**
  2346. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2347. */
  2348. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  2349. /**
  2350. * Save the repository path so the POST action can retrieve the value.
  2351. */
  2352. function setRepositoryPath(repositoryPath) {
  2353. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2354. }
  2355. exports.setRepositoryPath = setRepositoryPath;
  2356. /**
  2357. * Save the SSH key path so the POST action can retrieve the value.
  2358. */
  2359. function setSshKeyPath(sshKeyPath) {
  2360. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  2361. }
  2362. exports.setSshKeyPath = setSshKeyPath;
  2363. /**
  2364. * Save the SSH known hosts path so the POST action can retrieve the value.
  2365. */
  2366. function setSshKnownHostsPath(sshKnownHostsPath) {
  2367. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  2368. }
  2369. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2370. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2371. // This is necessary since we don't have a separate entry point.
  2372. if (!exports.IsPost) {
  2373. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2374. }
  2375. /***/ }),
  2376. /***/ 168:
  2377. /***/ (function(module) {
  2378. "use strict";
  2379. const alias = ['stdin', 'stdout', 'stderr'];
  2380. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2381. module.exports = opts => {
  2382. if (!opts) {
  2383. return null;
  2384. }
  2385. if (opts.stdio && hasAlias(opts)) {
  2386. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2387. }
  2388. if (typeof opts.stdio === 'string') {
  2389. return opts.stdio;
  2390. }
  2391. const stdio = opts.stdio || [];
  2392. if (!Array.isArray(stdio)) {
  2393. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2394. }
  2395. const result = [];
  2396. const len = Math.max(stdio.length, alias.length);
  2397. for (let i = 0; i < len; i++) {
  2398. let value = null;
  2399. if (stdio[i] !== undefined) {
  2400. value = stdio[i];
  2401. } else if (opts[alias[i]] !== undefined) {
  2402. value = opts[alias[i]];
  2403. }
  2404. result[i] = value;
  2405. }
  2406. return result;
  2407. };
  2408. /***/ }),
  2409. /***/ 179:
  2410. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2411. "use strict";
  2412. var net = __webpack_require__(631);
  2413. var tls = __webpack_require__(16);
  2414. var http = __webpack_require__(605);
  2415. var https = __webpack_require__(211);
  2416. var events = __webpack_require__(614);
  2417. var assert = __webpack_require__(357);
  2418. var util = __webpack_require__(669);
  2419. exports.httpOverHttp = httpOverHttp;
  2420. exports.httpsOverHttp = httpsOverHttp;
  2421. exports.httpOverHttps = httpOverHttps;
  2422. exports.httpsOverHttps = httpsOverHttps;
  2423. function httpOverHttp(options) {
  2424. var agent = new TunnelingAgent(options);
  2425. agent.request = http.request;
  2426. return agent;
  2427. }
  2428. function httpsOverHttp(options) {
  2429. var agent = new TunnelingAgent(options);
  2430. agent.request = http.request;
  2431. agent.createSocket = createSecureSocket;
  2432. agent.defaultPort = 443;
  2433. return agent;
  2434. }
  2435. function httpOverHttps(options) {
  2436. var agent = new TunnelingAgent(options);
  2437. agent.request = https.request;
  2438. return agent;
  2439. }
  2440. function httpsOverHttps(options) {
  2441. var agent = new TunnelingAgent(options);
  2442. agent.request = https.request;
  2443. agent.createSocket = createSecureSocket;
  2444. agent.defaultPort = 443;
  2445. return agent;
  2446. }
  2447. function TunnelingAgent(options) {
  2448. var self = this;
  2449. self.options = options || {};
  2450. self.proxyOptions = self.options.proxy || {};
  2451. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2452. self.requests = [];
  2453. self.sockets = [];
  2454. self.on('free', function onFree(socket, host, port, localAddress) {
  2455. var options = toOptions(host, port, localAddress);
  2456. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2457. var pending = self.requests[i];
  2458. if (pending.host === options.host && pending.port === options.port) {
  2459. // Detect the request to connect same origin server,
  2460. // reuse the connection.
  2461. self.requests.splice(i, 1);
  2462. pending.request.onSocket(socket);
  2463. return;
  2464. }
  2465. }
  2466. socket.destroy();
  2467. self.removeSocket(socket);
  2468. });
  2469. }
  2470. util.inherits(TunnelingAgent, events.EventEmitter);
  2471. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2472. var self = this;
  2473. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2474. if (self.sockets.length >= this.maxSockets) {
  2475. // We are over limit so we'll add it to the queue.
  2476. self.requests.push(options);
  2477. return;
  2478. }
  2479. // If we are under maxSockets create a new one.
  2480. self.createSocket(options, function(socket) {
  2481. socket.on('free', onFree);
  2482. socket.on('close', onCloseOrRemove);
  2483. socket.on('agentRemove', onCloseOrRemove);
  2484. req.onSocket(socket);
  2485. function onFree() {
  2486. self.emit('free', socket, options);
  2487. }
  2488. function onCloseOrRemove(err) {
  2489. self.removeSocket(socket);
  2490. socket.removeListener('free', onFree);
  2491. socket.removeListener('close', onCloseOrRemove);
  2492. socket.removeListener('agentRemove', onCloseOrRemove);
  2493. }
  2494. });
  2495. };
  2496. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2497. var self = this;
  2498. var placeholder = {};
  2499. self.sockets.push(placeholder);
  2500. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2501. method: 'CONNECT',
  2502. path: options.host + ':' + options.port,
  2503. agent: false,
  2504. headers: {
  2505. host: options.host + ':' + options.port
  2506. }
  2507. });
  2508. if (options.localAddress) {
  2509. connectOptions.localAddress = options.localAddress;
  2510. }
  2511. if (connectOptions.proxyAuth) {
  2512. connectOptions.headers = connectOptions.headers || {};
  2513. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2514. new Buffer(connectOptions.proxyAuth).toString('base64');
  2515. }
  2516. debug('making CONNECT request');
  2517. var connectReq = self.request(connectOptions);
  2518. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2519. connectReq.once('response', onResponse); // for v0.6
  2520. connectReq.once('upgrade', onUpgrade); // for v0.6
  2521. connectReq.once('connect', onConnect); // for v0.7 or later
  2522. connectReq.once('error', onError);
  2523. connectReq.end();
  2524. function onResponse(res) {
  2525. // Very hacky. This is necessary to avoid http-parser leaks.
  2526. res.upgrade = true;
  2527. }
  2528. function onUpgrade(res, socket, head) {
  2529. // Hacky.
  2530. process.nextTick(function() {
  2531. onConnect(res, socket, head);
  2532. });
  2533. }
  2534. function onConnect(res, socket, head) {
  2535. connectReq.removeAllListeners();
  2536. socket.removeAllListeners();
  2537. if (res.statusCode !== 200) {
  2538. debug('tunneling socket could not be established, statusCode=%d',
  2539. res.statusCode);
  2540. socket.destroy();
  2541. var error = new Error('tunneling socket could not be established, ' +
  2542. 'statusCode=' + res.statusCode);
  2543. error.code = 'ECONNRESET';
  2544. options.request.emit('error', error);
  2545. self.removeSocket(placeholder);
  2546. return;
  2547. }
  2548. if (head.length > 0) {
  2549. debug('got illegal response body from proxy');
  2550. socket.destroy();
  2551. var error = new Error('got illegal response body from proxy');
  2552. error.code = 'ECONNRESET';
  2553. options.request.emit('error', error);
  2554. self.removeSocket(placeholder);
  2555. return;
  2556. }
  2557. debug('tunneling connection has established');
  2558. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2559. return cb(socket);
  2560. }
  2561. function onError(cause) {
  2562. connectReq.removeAllListeners();
  2563. debug('tunneling socket could not be established, cause=%s\n',
  2564. cause.message, cause.stack);
  2565. var error = new Error('tunneling socket could not be established, ' +
  2566. 'cause=' + cause.message);
  2567. error.code = 'ECONNRESET';
  2568. options.request.emit('error', error);
  2569. self.removeSocket(placeholder);
  2570. }
  2571. };
  2572. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2573. var pos = this.sockets.indexOf(socket)
  2574. if (pos === -1) {
  2575. return;
  2576. }
  2577. this.sockets.splice(pos, 1);
  2578. var pending = this.requests.shift();
  2579. if (pending) {
  2580. // If we have pending requests and a socket gets closed a new one
  2581. // needs to be created to take over in the pool for the one that closed.
  2582. this.createSocket(pending, function(socket) {
  2583. pending.request.onSocket(socket);
  2584. });
  2585. }
  2586. };
  2587. function createSecureSocket(options, cb) {
  2588. var self = this;
  2589. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2590. var hostHeader = options.request.getHeader('host');
  2591. var tlsOptions = mergeOptions({}, self.options, {
  2592. socket: socket,
  2593. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2594. });
  2595. // 0 is dummy port for v0.6
  2596. var secureSocket = tls.connect(0, tlsOptions);
  2597. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2598. cb(secureSocket);
  2599. });
  2600. }
  2601. function toOptions(host, port, localAddress) {
  2602. if (typeof host === 'string') { // since v0.10
  2603. return {
  2604. host: host,
  2605. port: port,
  2606. localAddress: localAddress
  2607. };
  2608. }
  2609. return host; // for v0.11 or later
  2610. }
  2611. function mergeOptions(target) {
  2612. for (var i = 1, len = arguments.length; i < len; ++i) {
  2613. var overrides = arguments[i];
  2614. if (typeof overrides === 'object') {
  2615. var keys = Object.keys(overrides);
  2616. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2617. var k = keys[j];
  2618. if (overrides[k] !== undefined) {
  2619. target[k] = overrides[k];
  2620. }
  2621. }
  2622. }
  2623. }
  2624. return target;
  2625. }
  2626. var debug;
  2627. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2628. debug = function() {
  2629. var args = Array.prototype.slice.call(arguments);
  2630. if (typeof args[0] === 'string') {
  2631. args[0] = 'TUNNEL: ' + args[0];
  2632. } else {
  2633. args.unshift('TUNNEL:');
  2634. }
  2635. console.error.apply(console, args);
  2636. }
  2637. } else {
  2638. debug = function() {};
  2639. }
  2640. exports.debug = debug; // for test
  2641. /***/ }),
  2642. /***/ 190:
  2643. /***/ (function(module, __unusedexports, __webpack_require__) {
  2644. module.exports = authenticationPlugin;
  2645. const { createTokenAuth } = __webpack_require__(813);
  2646. const { Deprecation } = __webpack_require__(692);
  2647. const once = __webpack_require__(969);
  2648. const beforeRequest = __webpack_require__(863);
  2649. const requestError = __webpack_require__(991);
  2650. const validate = __webpack_require__(954);
  2651. const withAuthorizationPrefix = __webpack_require__(143);
  2652. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2653. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2654. function authenticationPlugin(octokit, options) {
  2655. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2656. if (options.authStrategy) {
  2657. const auth = options.authStrategy(options.auth);
  2658. octokit.hook.wrap("request", auth.hook);
  2659. octokit.auth = auth;
  2660. return;
  2661. }
  2662. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2663. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2664. if (!options.auth) {
  2665. octokit.auth = () =>
  2666. Promise.resolve({
  2667. type: "unauthenticated"
  2668. });
  2669. return;
  2670. }
  2671. const isBasicAuthString =
  2672. typeof options.auth === "string" &&
  2673. /^basic/.test(withAuthorizationPrefix(options.auth));
  2674. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2675. if (typeof options.auth === "string" && !isBasicAuthString) {
  2676. const auth = createTokenAuth(options.auth);
  2677. octokit.hook.wrap("request", auth.hook);
  2678. octokit.auth = auth;
  2679. return;
  2680. }
  2681. // Otherwise log a deprecation message
  2682. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2683. ? [
  2684. deprecateAuthBasic,
  2685. 'Setting the "new Octokit({ auth })" option to a Basic Auth string is deprecated. Use https://github.com/octokit/auth-basic.js instead. See (https://octokit.github.io/rest.js/#authentication)'
  2686. ]
  2687. : [
  2688. deprecateAuthObject,
  2689. 'Setting the "new Octokit({ auth })" option to an object without also setting the "authStrategy" option is deprecated and will be removed in v17. See (https://octokit.github.io/rest.js/#authentication)'
  2690. ];
  2691. deprecationMethod(
  2692. octokit.log,
  2693. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2694. );
  2695. octokit.auth = () =>
  2696. Promise.resolve({
  2697. type: "deprecated",
  2698. message: deprecationMessapge
  2699. });
  2700. validate(options.auth);
  2701. const state = {
  2702. octokit,
  2703. auth: options.auth
  2704. };
  2705. octokit.hook.before("request", beforeRequest.bind(null, state));
  2706. octokit.hook.error("request", requestError.bind(null, state));
  2707. }
  2708. /***/ }),
  2709. /***/ 197:
  2710. /***/ (function(module, __unusedexports, __webpack_require__) {
  2711. module.exports = isexe
  2712. isexe.sync = sync
  2713. var fs = __webpack_require__(747)
  2714. function isexe (path, options, cb) {
  2715. fs.stat(path, function (er, stat) {
  2716. cb(er, er ? false : checkStat(stat, options))
  2717. })
  2718. }
  2719. function sync (path, options) {
  2720. return checkStat(fs.statSync(path), options)
  2721. }
  2722. function checkStat (stat, options) {
  2723. return stat.isFile() && checkMode(stat, options)
  2724. }
  2725. function checkMode (stat, options) {
  2726. var mod = stat.mode
  2727. var uid = stat.uid
  2728. var gid = stat.gid
  2729. var myUid = options.uid !== undefined ?
  2730. options.uid : process.getuid && process.getuid()
  2731. var myGid = options.gid !== undefined ?
  2732. options.gid : process.getgid && process.getgid()
  2733. var u = parseInt('100', 8)
  2734. var g = parseInt('010', 8)
  2735. var o = parseInt('001', 8)
  2736. var ug = u | g
  2737. var ret = (mod & o) ||
  2738. (mod & g) && gid === myGid ||
  2739. (mod & u) && uid === myUid ||
  2740. (mod & ug) && myUid === 0
  2741. return ret
  2742. }
  2743. /***/ }),
  2744. /***/ 198:
  2745. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2746. "use strict";
  2747. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2748. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2749. return new (P || (P = Promise))(function (resolve, reject) {
  2750. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2751. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2752. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2753. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2754. });
  2755. };
  2756. var __importStar = (this && this.__importStar) || function (mod) {
  2757. if (mod && mod.__esModule) return mod;
  2758. var result = {};
  2759. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2760. result["default"] = mod;
  2761. return result;
  2762. };
  2763. Object.defineProperty(exports, "__esModule", { value: true });
  2764. const core = __importStar(__webpack_require__(470));
  2765. const coreCommand = __importStar(__webpack_require__(431));
  2766. const gitSourceProvider = __importStar(__webpack_require__(293));
  2767. const inputHelper = __importStar(__webpack_require__(821));
  2768. const path = __importStar(__webpack_require__(622));
  2769. const stateHelper = __importStar(__webpack_require__(153));
  2770. function run() {
  2771. return __awaiter(this, void 0, void 0, function* () {
  2772. try {
  2773. const sourceSettings = inputHelper.getInputs();
  2774. try {
  2775. // Register problem matcher
  2776. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2777. // Get sources
  2778. yield gitSourceProvider.getSource(sourceSettings);
  2779. }
  2780. finally {
  2781. // Unregister problem matcher
  2782. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2783. }
  2784. }
  2785. catch (error) {
  2786. core.setFailed(error.message);
  2787. }
  2788. });
  2789. }
  2790. function cleanup() {
  2791. return __awaiter(this, void 0, void 0, function* () {
  2792. try {
  2793. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2794. }
  2795. catch (error) {
  2796. core.warning(error.message);
  2797. }
  2798. });
  2799. }
  2800. // Main
  2801. if (!stateHelper.IsPost) {
  2802. run();
  2803. }
  2804. // Post
  2805. else {
  2806. cleanup();
  2807. }
  2808. /***/ }),
  2809. /***/ 211:
  2810. /***/ (function(module) {
  2811. module.exports = require("https");
  2812. /***/ }),
  2813. /***/ 215:
  2814. /***/ (function(module) {
  2815. module.exports = {"name":"@octokit/rest","version":"16.38.1","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^3.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^16.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:code":"node scripts/update-endpoints/code","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.38.1.tgz","_integrity":"sha512-zyNFx+/Bd1EXt7LQjfrc6H4wryBQ/oDuZeZhGMBSFr1eMPFDmpEweFQR3R25zjKwBQpDY7L5GQO6A3XSaOfV1w==","_from":"@octokit/rest@16.38.1"};
  2816. /***/ }),
  2817. /***/ 227:
  2818. /***/ (function(__unusedmodule, exports) {
  2819. "use strict";
  2820. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2821. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2822. return new (P || (P = Promise))(function (resolve, reject) {
  2823. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2824. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2825. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2826. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2827. });
  2828. };
  2829. Object.defineProperty(exports, "__esModule", { value: true });
  2830. function getCheckoutInfo(git, ref, commit) {
  2831. return __awaiter(this, void 0, void 0, function* () {
  2832. if (!git) {
  2833. throw new Error('Arg git cannot be empty');
  2834. }
  2835. if (!ref && !commit) {
  2836. throw new Error('Args ref and commit cannot both be empty');
  2837. }
  2838. const result = {};
  2839. const upperRef = (ref || '').toUpperCase();
  2840. // SHA only
  2841. if (!ref) {
  2842. result.ref = commit;
  2843. }
  2844. // refs/heads/
  2845. else if (upperRef.startsWith('REFS/HEADS/')) {
  2846. const branch = ref.substring('refs/heads/'.length);
  2847. result.ref = branch;
  2848. result.startPoint = `refs/remotes/origin/${branch}`;
  2849. }
  2850. // refs/pull/
  2851. else if (upperRef.startsWith('REFS/PULL/')) {
  2852. const branch = ref.substring('refs/pull/'.length);
  2853. result.ref = `refs/remotes/pull/${branch}`;
  2854. }
  2855. // refs/tags/
  2856. else if (upperRef.startsWith('REFS/')) {
  2857. result.ref = ref;
  2858. }
  2859. // Unqualified ref, check for a matching branch or tag
  2860. else {
  2861. if (yield git.branchExists(true, `origin/${ref}`)) {
  2862. result.ref = ref;
  2863. result.startPoint = `refs/remotes/origin/${ref}`;
  2864. }
  2865. else if (yield git.tagExists(`${ref}`)) {
  2866. result.ref = `refs/tags/${ref}`;
  2867. }
  2868. else {
  2869. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2870. }
  2871. }
  2872. return result;
  2873. });
  2874. }
  2875. exports.getCheckoutInfo = getCheckoutInfo;
  2876. function getRefSpec(ref, commit) {
  2877. if (!ref && !commit) {
  2878. throw new Error('Args ref and commit cannot both be empty');
  2879. }
  2880. const upperRef = (ref || '').toUpperCase();
  2881. // SHA
  2882. if (commit) {
  2883. // refs/heads
  2884. if (upperRef.startsWith('REFS/HEADS/')) {
  2885. const branch = ref.substring('refs/heads/'.length);
  2886. return [`+${commit}:refs/remotes/origin/${branch}`];
  2887. }
  2888. // refs/pull/
  2889. else if (upperRef.startsWith('REFS/PULL/')) {
  2890. const branch = ref.substring('refs/pull/'.length);
  2891. return [`+${commit}:refs/remotes/pull/${branch}`];
  2892. }
  2893. // refs/tags/
  2894. else if (upperRef.startsWith('REFS/TAGS/')) {
  2895. return [`+${commit}:${ref}`];
  2896. }
  2897. // Otherwise no destination ref
  2898. else {
  2899. return [commit];
  2900. }
  2901. }
  2902. // Unqualified ref, check for a matching branch or tag
  2903. else if (!upperRef.startsWith('REFS/')) {
  2904. return [
  2905. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2906. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2907. ];
  2908. }
  2909. // refs/heads/
  2910. else if (upperRef.startsWith('REFS/HEADS/')) {
  2911. const branch = ref.substring('refs/heads/'.length);
  2912. return [`+${ref}:refs/remotes/origin/${branch}`];
  2913. }
  2914. // refs/pull/
  2915. else if (upperRef.startsWith('REFS/PULL/')) {
  2916. const branch = ref.substring('refs/pull/'.length);
  2917. return [`+${ref}:refs/remotes/pull/${branch}`];
  2918. }
  2919. // refs/tags/
  2920. else {
  2921. return [`+${ref}:${ref}`];
  2922. }
  2923. }
  2924. exports.getRefSpec = getRefSpec;
  2925. /***/ }),
  2926. /***/ 248:
  2927. /***/ (function(module, __unusedexports, __webpack_require__) {
  2928. module.exports = octokitRegisterEndpoints;
  2929. const registerEndpoints = __webpack_require__(899);
  2930. function octokitRegisterEndpoints(octokit) {
  2931. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2932. }
  2933. /***/ }),
  2934. /***/ 260:
  2935. /***/ (function(module, __unusedexports, __webpack_require__) {
  2936. // Note: since nyc uses this module to output coverage, any lines
  2937. // that are in the direct sync flow of nyc's outputCoverage are
  2938. // ignored, since we can never get coverage for them.
  2939. var assert = __webpack_require__(357)
  2940. var signals = __webpack_require__(654)
  2941. var EE = __webpack_require__(614)
  2942. /* istanbul ignore if */
  2943. if (typeof EE !== 'function') {
  2944. EE = EE.EventEmitter
  2945. }
  2946. var emitter
  2947. if (process.__signal_exit_emitter__) {
  2948. emitter = process.__signal_exit_emitter__
  2949. } else {
  2950. emitter = process.__signal_exit_emitter__ = new EE()
  2951. emitter.count = 0
  2952. emitter.emitted = {}
  2953. }
  2954. // Because this emitter is a global, we have to check to see if a
  2955. // previous version of this library failed to enable infinite listeners.
  2956. // I know what you're about to say. But literally everything about
  2957. // signal-exit is a compromise with evil. Get used to it.
  2958. if (!emitter.infinite) {
  2959. emitter.setMaxListeners(Infinity)
  2960. emitter.infinite = true
  2961. }
  2962. module.exports = function (cb, opts) {
  2963. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2964. if (loaded === false) {
  2965. load()
  2966. }
  2967. var ev = 'exit'
  2968. if (opts && opts.alwaysLast) {
  2969. ev = 'afterexit'
  2970. }
  2971. var remove = function () {
  2972. emitter.removeListener(ev, cb)
  2973. if (emitter.listeners('exit').length === 0 &&
  2974. emitter.listeners('afterexit').length === 0) {
  2975. unload()
  2976. }
  2977. }
  2978. emitter.on(ev, cb)
  2979. return remove
  2980. }
  2981. module.exports.unload = unload
  2982. function unload () {
  2983. if (!loaded) {
  2984. return
  2985. }
  2986. loaded = false
  2987. signals.forEach(function (sig) {
  2988. try {
  2989. process.removeListener(sig, sigListeners[sig])
  2990. } catch (er) {}
  2991. })
  2992. process.emit = originalProcessEmit
  2993. process.reallyExit = originalProcessReallyExit
  2994. emitter.count -= 1
  2995. }
  2996. function emit (event, code, signal) {
  2997. if (emitter.emitted[event]) {
  2998. return
  2999. }
  3000. emitter.emitted[event] = true
  3001. emitter.emit(event, code, signal)
  3002. }
  3003. // { <signal>: <listener fn>, ... }
  3004. var sigListeners = {}
  3005. signals.forEach(function (sig) {
  3006. sigListeners[sig] = function listener () {
  3007. // If there are no other listeners, an exit is coming!
  3008. // Simplest way: remove us and then re-send the signal.
  3009. // We know that this will kill the process, so we can
  3010. // safely emit now.
  3011. var listeners = process.listeners(sig)
  3012. if (listeners.length === emitter.count) {
  3013. unload()
  3014. emit('exit', null, sig)
  3015. /* istanbul ignore next */
  3016. emit('afterexit', null, sig)
  3017. /* istanbul ignore next */
  3018. process.kill(process.pid, sig)
  3019. }
  3020. }
  3021. })
  3022. module.exports.signals = function () {
  3023. return signals
  3024. }
  3025. module.exports.load = load
  3026. var loaded = false
  3027. function load () {
  3028. if (loaded) {
  3029. return
  3030. }
  3031. loaded = true
  3032. // This is the number of onSignalExit's that are in play.
  3033. // It's important so that we can count the correct number of
  3034. // listeners on signals, and don't wait for the other one to
  3035. // handle it instead of us.
  3036. emitter.count += 1
  3037. signals = signals.filter(function (sig) {
  3038. try {
  3039. process.on(sig, sigListeners[sig])
  3040. return true
  3041. } catch (er) {
  3042. return false
  3043. }
  3044. })
  3045. process.emit = processEmit
  3046. process.reallyExit = processReallyExit
  3047. }
  3048. var originalProcessReallyExit = process.reallyExit
  3049. function processReallyExit (code) {
  3050. process.exitCode = code || 0
  3051. emit('exit', process.exitCode, null)
  3052. /* istanbul ignore next */
  3053. emit('afterexit', process.exitCode, null)
  3054. /* istanbul ignore next */
  3055. originalProcessReallyExit.call(process, process.exitCode)
  3056. }
  3057. var originalProcessEmit = process.emit
  3058. function processEmit (ev, arg) {
  3059. if (ev === 'exit') {
  3060. if (arg !== undefined) {
  3061. process.exitCode = arg
  3062. }
  3063. var ret = originalProcessEmit.apply(this, arguments)
  3064. emit('exit', process.exitCode, null)
  3065. /* istanbul ignore next */
  3066. emit('afterexit', process.exitCode, null)
  3067. return ret
  3068. } else {
  3069. return originalProcessEmit.apply(this, arguments)
  3070. }
  3071. }
  3072. /***/ }),
  3073. /***/ 262:
  3074. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3075. "use strict";
  3076. Object.defineProperty(exports, "__esModule", { value: true });
  3077. const fs_1 = __webpack_require__(747);
  3078. const os_1 = __webpack_require__(87);
  3079. class Context {
  3080. /**
  3081. * Hydrate the context from the environment
  3082. */
  3083. constructor() {
  3084. this.payload = {};
  3085. if (process.env.GITHUB_EVENT_PATH) {
  3086. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3087. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3088. }
  3089. else {
  3090. const path = process.env.GITHUB_EVENT_PATH;
  3091. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3092. }
  3093. }
  3094. this.eventName = process.env.GITHUB_EVENT_NAME;
  3095. this.sha = process.env.GITHUB_SHA;
  3096. this.ref = process.env.GITHUB_REF;
  3097. this.workflow = process.env.GITHUB_WORKFLOW;
  3098. this.action = process.env.GITHUB_ACTION;
  3099. this.actor = process.env.GITHUB_ACTOR;
  3100. }
  3101. get issue() {
  3102. const payload = this.payload;
  3103. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3104. }
  3105. get repo() {
  3106. if (process.env.GITHUB_REPOSITORY) {
  3107. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3108. return { owner, repo };
  3109. }
  3110. if (this.payload.repository) {
  3111. return {
  3112. owner: this.payload.repository.owner.login,
  3113. repo: this.payload.repository.name
  3114. };
  3115. }
  3116. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3117. }
  3118. }
  3119. exports.Context = Context;
  3120. //# sourceMappingURL=context.js.map
  3121. /***/ }),
  3122. /***/ 265:
  3123. /***/ (function(module, __unusedexports, __webpack_require__) {
  3124. module.exports = getPage
  3125. const deprecate = __webpack_require__(370)
  3126. const getPageLinks = __webpack_require__(577)
  3127. const HttpError = __webpack_require__(297)
  3128. function getPage (octokit, link, which, headers) {
  3129. deprecate(`octokit.get${which.charAt(0).toUpperCase() + which.slice(1)}Page() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  3130. const url = getPageLinks(link)[which]
  3131. if (!url) {
  3132. const urlError = new HttpError(`No ${which} page found`, 404)
  3133. return Promise.reject(urlError)
  3134. }
  3135. const requestOptions = {
  3136. url,
  3137. headers: applyAcceptHeader(link, headers)
  3138. }
  3139. const promise = octokit.request(requestOptions)
  3140. return promise
  3141. }
  3142. function applyAcceptHeader (res, headers) {
  3143. const previous = res.headers && res.headers['x-github-media-type']
  3144. if (!previous || (headers && headers.accept)) {
  3145. return headers
  3146. }
  3147. headers = headers || {}
  3148. headers.accept = 'application/vnd.' + previous
  3149. .replace('; param=', '.')
  3150. .replace('; format=', '+')
  3151. return headers
  3152. }
  3153. /***/ }),
  3154. /***/ 280:
  3155. /***/ (function(module, exports) {
  3156. exports = module.exports = SemVer
  3157. var debug
  3158. /* istanbul ignore next */
  3159. if (typeof process === 'object' &&
  3160. process.env &&
  3161. process.env.NODE_DEBUG &&
  3162. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3163. debug = function () {
  3164. var args = Array.prototype.slice.call(arguments, 0)
  3165. args.unshift('SEMVER')
  3166. console.log.apply(console, args)
  3167. }
  3168. } else {
  3169. debug = function () {}
  3170. }
  3171. // Note: this is the semver.org version of the spec that it implements
  3172. // Not necessarily the package version of this code.
  3173. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3174. var MAX_LENGTH = 256
  3175. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3176. /* istanbul ignore next */ 9007199254740991
  3177. // Max safe segment length for coercion.
  3178. var MAX_SAFE_COMPONENT_LENGTH = 16
  3179. // The actual regexps go on exports.re
  3180. var re = exports.re = []
  3181. var src = exports.src = []
  3182. var R = 0
  3183. // The following Regular Expressions can be used for tokenizing,
  3184. // validating, and parsing SemVer version strings.
  3185. // ## Numeric Identifier
  3186. // A single `0`, or a non-zero digit followed by zero or more digits.
  3187. var NUMERICIDENTIFIER = R++
  3188. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3189. var NUMERICIDENTIFIERLOOSE = R++
  3190. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3191. // ## Non-numeric Identifier
  3192. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3193. // more letters, digits, or hyphens.
  3194. var NONNUMERICIDENTIFIER = R++
  3195. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3196. // ## Main Version
  3197. // Three dot-separated numeric identifiers.
  3198. var MAINVERSION = R++
  3199. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3200. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3201. '(' + src[NUMERICIDENTIFIER] + ')'
  3202. var MAINVERSIONLOOSE = R++
  3203. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3204. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3205. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3206. // ## Pre-release Version Identifier
  3207. // A numeric identifier, or a non-numeric identifier.
  3208. var PRERELEASEIDENTIFIER = R++
  3209. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3210. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3211. var PRERELEASEIDENTIFIERLOOSE = R++
  3212. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3213. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3214. // ## Pre-release Version
  3215. // Hyphen, followed by one or more dot-separated pre-release version
  3216. // identifiers.
  3217. var PRERELEASE = R++
  3218. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3219. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3220. var PRERELEASELOOSE = R++
  3221. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3222. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3223. // ## Build Metadata Identifier
  3224. // Any combination of digits, letters, or hyphens.
  3225. var BUILDIDENTIFIER = R++
  3226. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3227. // ## Build Metadata
  3228. // Plus sign, followed by one or more period-separated build metadata
  3229. // identifiers.
  3230. var BUILD = R++
  3231. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3232. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3233. // ## Full Version String
  3234. // A main version, followed optionally by a pre-release version and
  3235. // build metadata.
  3236. // Note that the only major, minor, patch, and pre-release sections of
  3237. // the version string are capturing groups. The build metadata is not a
  3238. // capturing group, because it should not ever be used in version
  3239. // comparison.
  3240. var FULL = R++
  3241. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3242. src[PRERELEASE] + '?' +
  3243. src[BUILD] + '?'
  3244. src[FULL] = '^' + FULLPLAIN + '$'
  3245. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3246. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3247. // common in the npm registry.
  3248. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3249. src[PRERELEASELOOSE] + '?' +
  3250. src[BUILD] + '?'
  3251. var LOOSE = R++
  3252. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3253. var GTLT = R++
  3254. src[GTLT] = '((?:<|>)?=?)'
  3255. // Something like "2.*" or "1.2.x".
  3256. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3257. // Only the first item is strictly required.
  3258. var XRANGEIDENTIFIERLOOSE = R++
  3259. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3260. var XRANGEIDENTIFIER = R++
  3261. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3262. var XRANGEPLAIN = R++
  3263. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3264. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3265. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3266. '(?:' + src[PRERELEASE] + ')?' +
  3267. src[BUILD] + '?' +
  3268. ')?)?'
  3269. var XRANGEPLAINLOOSE = R++
  3270. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3271. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3272. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3273. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3274. src[BUILD] + '?' +
  3275. ')?)?'
  3276. var XRANGE = R++
  3277. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3278. var XRANGELOOSE = R++
  3279. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3280. // Coercion.
  3281. // Extract anything that could conceivably be a part of a valid semver
  3282. var COERCE = R++
  3283. src[COERCE] = '(?:^|[^\\d])' +
  3284. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3285. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3286. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3287. '(?:$|[^\\d])'
  3288. // Tilde ranges.
  3289. // Meaning is "reasonably at or greater than"
  3290. var LONETILDE = R++
  3291. src[LONETILDE] = '(?:~>?)'
  3292. var TILDETRIM = R++
  3293. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3294. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3295. var tildeTrimReplace = '$1~'
  3296. var TILDE = R++
  3297. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3298. var TILDELOOSE = R++
  3299. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3300. // Caret ranges.
  3301. // Meaning is "at least and backwards compatible with"
  3302. var LONECARET = R++
  3303. src[LONECARET] = '(?:\\^)'
  3304. var CARETTRIM = R++
  3305. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3306. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3307. var caretTrimReplace = '$1^'
  3308. var CARET = R++
  3309. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3310. var CARETLOOSE = R++
  3311. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3312. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3313. var COMPARATORLOOSE = R++
  3314. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3315. var COMPARATOR = R++
  3316. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3317. // An expression to strip any whitespace between the gtlt and the thing
  3318. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3319. var COMPARATORTRIM = R++
  3320. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3321. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3322. // this one has to use the /g flag
  3323. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3324. var comparatorTrimReplace = '$1$2$3'
  3325. // Something like `1.2.3 - 1.2.4`
  3326. // Note that these all use the loose form, because they'll be
  3327. // checked against either the strict or loose comparator form
  3328. // later.
  3329. var HYPHENRANGE = R++
  3330. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3331. '\\s+-\\s+' +
  3332. '(' + src[XRANGEPLAIN] + ')' +
  3333. '\\s*$'
  3334. var HYPHENRANGELOOSE = R++
  3335. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3336. '\\s+-\\s+' +
  3337. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3338. '\\s*$'
  3339. // Star ranges basically just allow anything at all.
  3340. var STAR = R++
  3341. src[STAR] = '(<|>)?=?\\s*\\*'
  3342. // Compile to actual regexp objects.
  3343. // All are flag-free, unless they were created above with a flag.
  3344. for (var i = 0; i < R; i++) {
  3345. debug(i, src[i])
  3346. if (!re[i]) {
  3347. re[i] = new RegExp(src[i])
  3348. }
  3349. }
  3350. exports.parse = parse
  3351. function parse (version, options) {
  3352. if (!options || typeof options !== 'object') {
  3353. options = {
  3354. loose: !!options,
  3355. includePrerelease: false
  3356. }
  3357. }
  3358. if (version instanceof SemVer) {
  3359. return version
  3360. }
  3361. if (typeof version !== 'string') {
  3362. return null
  3363. }
  3364. if (version.length > MAX_LENGTH) {
  3365. return null
  3366. }
  3367. var r = options.loose ? re[LOOSE] : re[FULL]
  3368. if (!r.test(version)) {
  3369. return null
  3370. }
  3371. try {
  3372. return new SemVer(version, options)
  3373. } catch (er) {
  3374. return null
  3375. }
  3376. }
  3377. exports.valid = valid
  3378. function valid (version, options) {
  3379. var v = parse(version, options)
  3380. return v ? v.version : null
  3381. }
  3382. exports.clean = clean
  3383. function clean (version, options) {
  3384. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3385. return s ? s.version : null
  3386. }
  3387. exports.SemVer = SemVer
  3388. function SemVer (version, options) {
  3389. if (!options || typeof options !== 'object') {
  3390. options = {
  3391. loose: !!options,
  3392. includePrerelease: false
  3393. }
  3394. }
  3395. if (version instanceof SemVer) {
  3396. if (version.loose === options.loose) {
  3397. return version
  3398. } else {
  3399. version = version.version
  3400. }
  3401. } else if (typeof version !== 'string') {
  3402. throw new TypeError('Invalid Version: ' + version)
  3403. }
  3404. if (version.length > MAX_LENGTH) {
  3405. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3406. }
  3407. if (!(this instanceof SemVer)) {
  3408. return new SemVer(version, options)
  3409. }
  3410. debug('SemVer', version, options)
  3411. this.options = options
  3412. this.loose = !!options.loose
  3413. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3414. if (!m) {
  3415. throw new TypeError('Invalid Version: ' + version)
  3416. }
  3417. this.raw = version
  3418. // these are actually numbers
  3419. this.major = +m[1]
  3420. this.minor = +m[2]
  3421. this.patch = +m[3]
  3422. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3423. throw new TypeError('Invalid major version')
  3424. }
  3425. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3426. throw new TypeError('Invalid minor version')
  3427. }
  3428. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3429. throw new TypeError('Invalid patch version')
  3430. }
  3431. // numberify any prerelease numeric ids
  3432. if (!m[4]) {
  3433. this.prerelease = []
  3434. } else {
  3435. this.prerelease = m[4].split('.').map(function (id) {
  3436. if (/^[0-9]+$/.test(id)) {
  3437. var num = +id
  3438. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3439. return num
  3440. }
  3441. }
  3442. return id
  3443. })
  3444. }
  3445. this.build = m[5] ? m[5].split('.') : []
  3446. this.format()
  3447. }
  3448. SemVer.prototype.format = function () {
  3449. this.version = this.major + '.' + this.minor + '.' + this.patch
  3450. if (this.prerelease.length) {
  3451. this.version += '-' + this.prerelease.join('.')
  3452. }
  3453. return this.version
  3454. }
  3455. SemVer.prototype.toString = function () {
  3456. return this.version
  3457. }
  3458. SemVer.prototype.compare = function (other) {
  3459. debug('SemVer.compare', this.version, this.options, other)
  3460. if (!(other instanceof SemVer)) {
  3461. other = new SemVer(other, this.options)
  3462. }
  3463. return this.compareMain(other) || this.comparePre(other)
  3464. }
  3465. SemVer.prototype.compareMain = function (other) {
  3466. if (!(other instanceof SemVer)) {
  3467. other = new SemVer(other, this.options)
  3468. }
  3469. return compareIdentifiers(this.major, other.major) ||
  3470. compareIdentifiers(this.minor, other.minor) ||
  3471. compareIdentifiers(this.patch, other.patch)
  3472. }
  3473. SemVer.prototype.comparePre = function (other) {
  3474. if (!(other instanceof SemVer)) {
  3475. other = new SemVer(other, this.options)
  3476. }
  3477. // NOT having a prerelease is > having one
  3478. if (this.prerelease.length && !other.prerelease.length) {
  3479. return -1
  3480. } else if (!this.prerelease.length && other.prerelease.length) {
  3481. return 1
  3482. } else if (!this.prerelease.length && !other.prerelease.length) {
  3483. return 0
  3484. }
  3485. var i = 0
  3486. do {
  3487. var a = this.prerelease[i]
  3488. var b = other.prerelease[i]
  3489. debug('prerelease compare', i, a, b)
  3490. if (a === undefined && b === undefined) {
  3491. return 0
  3492. } else if (b === undefined) {
  3493. return 1
  3494. } else if (a === undefined) {
  3495. return -1
  3496. } else if (a === b) {
  3497. continue
  3498. } else {
  3499. return compareIdentifiers(a, b)
  3500. }
  3501. } while (++i)
  3502. }
  3503. // preminor will bump the version up to the next minor release, and immediately
  3504. // down to pre-release. premajor and prepatch work the same way.
  3505. SemVer.prototype.inc = function (release, identifier) {
  3506. switch (release) {
  3507. case 'premajor':
  3508. this.prerelease.length = 0
  3509. this.patch = 0
  3510. this.minor = 0
  3511. this.major++
  3512. this.inc('pre', identifier)
  3513. break
  3514. case 'preminor':
  3515. this.prerelease.length = 0
  3516. this.patch = 0
  3517. this.minor++
  3518. this.inc('pre', identifier)
  3519. break
  3520. case 'prepatch':
  3521. // If this is already a prerelease, it will bump to the next version
  3522. // drop any prereleases that might already exist, since they are not
  3523. // relevant at this point.
  3524. this.prerelease.length = 0
  3525. this.inc('patch', identifier)
  3526. this.inc('pre', identifier)
  3527. break
  3528. // If the input is a non-prerelease version, this acts the same as
  3529. // prepatch.
  3530. case 'prerelease':
  3531. if (this.prerelease.length === 0) {
  3532. this.inc('patch', identifier)
  3533. }
  3534. this.inc('pre', identifier)
  3535. break
  3536. case 'major':
  3537. // If this is a pre-major version, bump up to the same major version.
  3538. // Otherwise increment major.
  3539. // 1.0.0-5 bumps to 1.0.0
  3540. // 1.1.0 bumps to 2.0.0
  3541. if (this.minor !== 0 ||
  3542. this.patch !== 0 ||
  3543. this.prerelease.length === 0) {
  3544. this.major++
  3545. }
  3546. this.minor = 0
  3547. this.patch = 0
  3548. this.prerelease = []
  3549. break
  3550. case 'minor':
  3551. // If this is a pre-minor version, bump up to the same minor version.
  3552. // Otherwise increment minor.
  3553. // 1.2.0-5 bumps to 1.2.0
  3554. // 1.2.1 bumps to 1.3.0
  3555. if (this.patch !== 0 || this.prerelease.length === 0) {
  3556. this.minor++
  3557. }
  3558. this.patch = 0
  3559. this.prerelease = []
  3560. break
  3561. case 'patch':
  3562. // If this is not a pre-release version, it will increment the patch.
  3563. // If it is a pre-release it will bump up to the same patch version.
  3564. // 1.2.0-5 patches to 1.2.0
  3565. // 1.2.0 patches to 1.2.1
  3566. if (this.prerelease.length === 0) {
  3567. this.patch++
  3568. }
  3569. this.prerelease = []
  3570. break
  3571. // This probably shouldn't be used publicly.
  3572. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3573. case 'pre':
  3574. if (this.prerelease.length === 0) {
  3575. this.prerelease = [0]
  3576. } else {
  3577. var i = this.prerelease.length
  3578. while (--i >= 0) {
  3579. if (typeof this.prerelease[i] === 'number') {
  3580. this.prerelease[i]++
  3581. i = -2
  3582. }
  3583. }
  3584. if (i === -1) {
  3585. // didn't increment anything
  3586. this.prerelease.push(0)
  3587. }
  3588. }
  3589. if (identifier) {
  3590. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3591. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3592. if (this.prerelease[0] === identifier) {
  3593. if (isNaN(this.prerelease[1])) {
  3594. this.prerelease = [identifier, 0]
  3595. }
  3596. } else {
  3597. this.prerelease = [identifier, 0]
  3598. }
  3599. }
  3600. break
  3601. default:
  3602. throw new Error('invalid increment argument: ' + release)
  3603. }
  3604. this.format()
  3605. this.raw = this.version
  3606. return this
  3607. }
  3608. exports.inc = inc
  3609. function inc (version, release, loose, identifier) {
  3610. if (typeof (loose) === 'string') {
  3611. identifier = loose
  3612. loose = undefined
  3613. }
  3614. try {
  3615. return new SemVer(version, loose).inc(release, identifier).version
  3616. } catch (er) {
  3617. return null
  3618. }
  3619. }
  3620. exports.diff = diff
  3621. function diff (version1, version2) {
  3622. if (eq(version1, version2)) {
  3623. return null
  3624. } else {
  3625. var v1 = parse(version1)
  3626. var v2 = parse(version2)
  3627. var prefix = ''
  3628. if (v1.prerelease.length || v2.prerelease.length) {
  3629. prefix = 'pre'
  3630. var defaultResult = 'prerelease'
  3631. }
  3632. for (var key in v1) {
  3633. if (key === 'major' || key === 'minor' || key === 'patch') {
  3634. if (v1[key] !== v2[key]) {
  3635. return prefix + key
  3636. }
  3637. }
  3638. }
  3639. return defaultResult // may be undefined
  3640. }
  3641. }
  3642. exports.compareIdentifiers = compareIdentifiers
  3643. var numeric = /^[0-9]+$/
  3644. function compareIdentifiers (a, b) {
  3645. var anum = numeric.test(a)
  3646. var bnum = numeric.test(b)
  3647. if (anum && bnum) {
  3648. a = +a
  3649. b = +b
  3650. }
  3651. return a === b ? 0
  3652. : (anum && !bnum) ? -1
  3653. : (bnum && !anum) ? 1
  3654. : a < b ? -1
  3655. : 1
  3656. }
  3657. exports.rcompareIdentifiers = rcompareIdentifiers
  3658. function rcompareIdentifiers (a, b) {
  3659. return compareIdentifiers(b, a)
  3660. }
  3661. exports.major = major
  3662. function major (a, loose) {
  3663. return new SemVer(a, loose).major
  3664. }
  3665. exports.minor = minor
  3666. function minor (a, loose) {
  3667. return new SemVer(a, loose).minor
  3668. }
  3669. exports.patch = patch
  3670. function patch (a, loose) {
  3671. return new SemVer(a, loose).patch
  3672. }
  3673. exports.compare = compare
  3674. function compare (a, b, loose) {
  3675. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3676. }
  3677. exports.compareLoose = compareLoose
  3678. function compareLoose (a, b) {
  3679. return compare(a, b, true)
  3680. }
  3681. exports.rcompare = rcompare
  3682. function rcompare (a, b, loose) {
  3683. return compare(b, a, loose)
  3684. }
  3685. exports.sort = sort
  3686. function sort (list, loose) {
  3687. return list.sort(function (a, b) {
  3688. return exports.compare(a, b, loose)
  3689. })
  3690. }
  3691. exports.rsort = rsort
  3692. function rsort (list, loose) {
  3693. return list.sort(function (a, b) {
  3694. return exports.rcompare(a, b, loose)
  3695. })
  3696. }
  3697. exports.gt = gt
  3698. function gt (a, b, loose) {
  3699. return compare(a, b, loose) > 0
  3700. }
  3701. exports.lt = lt
  3702. function lt (a, b, loose) {
  3703. return compare(a, b, loose) < 0
  3704. }
  3705. exports.eq = eq
  3706. function eq (a, b, loose) {
  3707. return compare(a, b, loose) === 0
  3708. }
  3709. exports.neq = neq
  3710. function neq (a, b, loose) {
  3711. return compare(a, b, loose) !== 0
  3712. }
  3713. exports.gte = gte
  3714. function gte (a, b, loose) {
  3715. return compare(a, b, loose) >= 0
  3716. }
  3717. exports.lte = lte
  3718. function lte (a, b, loose) {
  3719. return compare(a, b, loose) <= 0
  3720. }
  3721. exports.cmp = cmp
  3722. function cmp (a, op, b, loose) {
  3723. switch (op) {
  3724. case '===':
  3725. if (typeof a === 'object')
  3726. a = a.version
  3727. if (typeof b === 'object')
  3728. b = b.version
  3729. return a === b
  3730. case '!==':
  3731. if (typeof a === 'object')
  3732. a = a.version
  3733. if (typeof b === 'object')
  3734. b = b.version
  3735. return a !== b
  3736. case '':
  3737. case '=':
  3738. case '==':
  3739. return eq(a, b, loose)
  3740. case '!=':
  3741. return neq(a, b, loose)
  3742. case '>':
  3743. return gt(a, b, loose)
  3744. case '>=':
  3745. return gte(a, b, loose)
  3746. case '<':
  3747. return lt(a, b, loose)
  3748. case '<=':
  3749. return lte(a, b, loose)
  3750. default:
  3751. throw new TypeError('Invalid operator: ' + op)
  3752. }
  3753. }
  3754. exports.Comparator = Comparator
  3755. function Comparator (comp, options) {
  3756. if (!options || typeof options !== 'object') {
  3757. options = {
  3758. loose: !!options,
  3759. includePrerelease: false
  3760. }
  3761. }
  3762. if (comp instanceof Comparator) {
  3763. if (comp.loose === !!options.loose) {
  3764. return comp
  3765. } else {
  3766. comp = comp.value
  3767. }
  3768. }
  3769. if (!(this instanceof Comparator)) {
  3770. return new Comparator(comp, options)
  3771. }
  3772. debug('comparator', comp, options)
  3773. this.options = options
  3774. this.loose = !!options.loose
  3775. this.parse(comp)
  3776. if (this.semver === ANY) {
  3777. this.value = ''
  3778. } else {
  3779. this.value = this.operator + this.semver.version
  3780. }
  3781. debug('comp', this)
  3782. }
  3783. var ANY = {}
  3784. Comparator.prototype.parse = function (comp) {
  3785. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3786. var m = comp.match(r)
  3787. if (!m) {
  3788. throw new TypeError('Invalid comparator: ' + comp)
  3789. }
  3790. this.operator = m[1]
  3791. if (this.operator === '=') {
  3792. this.operator = ''
  3793. }
  3794. // if it literally is just '>' or '' then allow anything.
  3795. if (!m[2]) {
  3796. this.semver = ANY
  3797. } else {
  3798. this.semver = new SemVer(m[2], this.options.loose)
  3799. }
  3800. }
  3801. Comparator.prototype.toString = function () {
  3802. return this.value
  3803. }
  3804. Comparator.prototype.test = function (version) {
  3805. debug('Comparator.test', version, this.options.loose)
  3806. if (this.semver === ANY) {
  3807. return true
  3808. }
  3809. if (typeof version === 'string') {
  3810. version = new SemVer(version, this.options)
  3811. }
  3812. return cmp(version, this.operator, this.semver, this.options)
  3813. }
  3814. Comparator.prototype.intersects = function (comp, options) {
  3815. if (!(comp instanceof Comparator)) {
  3816. throw new TypeError('a Comparator is required')
  3817. }
  3818. if (!options || typeof options !== 'object') {
  3819. options = {
  3820. loose: !!options,
  3821. includePrerelease: false
  3822. }
  3823. }
  3824. var rangeTmp
  3825. if (this.operator === '') {
  3826. rangeTmp = new Range(comp.value, options)
  3827. return satisfies(this.value, rangeTmp, options)
  3828. } else if (comp.operator === '') {
  3829. rangeTmp = new Range(this.value, options)
  3830. return satisfies(comp.semver, rangeTmp, options)
  3831. }
  3832. var sameDirectionIncreasing =
  3833. (this.operator === '>=' || this.operator === '>') &&
  3834. (comp.operator === '>=' || comp.operator === '>')
  3835. var sameDirectionDecreasing =
  3836. (this.operator === '<=' || this.operator === '<') &&
  3837. (comp.operator === '<=' || comp.operator === '<')
  3838. var sameSemVer = this.semver.version === comp.semver.version
  3839. var differentDirectionsInclusive =
  3840. (this.operator === '>=' || this.operator === '<=') &&
  3841. (comp.operator === '>=' || comp.operator === '<=')
  3842. var oppositeDirectionsLessThan =
  3843. cmp(this.semver, '<', comp.semver, options) &&
  3844. ((this.operator === '>=' || this.operator === '>') &&
  3845. (comp.operator === '<=' || comp.operator === '<'))
  3846. var oppositeDirectionsGreaterThan =
  3847. cmp(this.semver, '>', comp.semver, options) &&
  3848. ((this.operator === '<=' || this.operator === '<') &&
  3849. (comp.operator === '>=' || comp.operator === '>'))
  3850. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3851. (sameSemVer && differentDirectionsInclusive) ||
  3852. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3853. }
  3854. exports.Range = Range
  3855. function Range (range, options) {
  3856. if (!options || typeof options !== 'object') {
  3857. options = {
  3858. loose: !!options,
  3859. includePrerelease: false
  3860. }
  3861. }
  3862. if (range instanceof Range) {
  3863. if (range.loose === !!options.loose &&
  3864. range.includePrerelease === !!options.includePrerelease) {
  3865. return range
  3866. } else {
  3867. return new Range(range.raw, options)
  3868. }
  3869. }
  3870. if (range instanceof Comparator) {
  3871. return new Range(range.value, options)
  3872. }
  3873. if (!(this instanceof Range)) {
  3874. return new Range(range, options)
  3875. }
  3876. this.options = options
  3877. this.loose = !!options.loose
  3878. this.includePrerelease = !!options.includePrerelease
  3879. // First, split based on boolean or ||
  3880. this.raw = range
  3881. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3882. return this.parseRange(range.trim())
  3883. }, this).filter(function (c) {
  3884. // throw out any that are not relevant for whatever reason
  3885. return c.length
  3886. })
  3887. if (!this.set.length) {
  3888. throw new TypeError('Invalid SemVer Range: ' + range)
  3889. }
  3890. this.format()
  3891. }
  3892. Range.prototype.format = function () {
  3893. this.range = this.set.map(function (comps) {
  3894. return comps.join(' ').trim()
  3895. }).join('||').trim()
  3896. return this.range
  3897. }
  3898. Range.prototype.toString = function () {
  3899. return this.range
  3900. }
  3901. Range.prototype.parseRange = function (range) {
  3902. var loose = this.options.loose
  3903. range = range.trim()
  3904. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3905. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3906. range = range.replace(hr, hyphenReplace)
  3907. debug('hyphen replace', range)
  3908. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3909. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3910. debug('comparator trim', range, re[COMPARATORTRIM])
  3911. // `~ 1.2.3` => `~1.2.3`
  3912. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3913. // `^ 1.2.3` => `^1.2.3`
  3914. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3915. // normalize spaces
  3916. range = range.split(/\s+/).join(' ')
  3917. // At this point, the range is completely trimmed and
  3918. // ready to be split into comparators.
  3919. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3920. var set = range.split(' ').map(function (comp) {
  3921. return parseComparator(comp, this.options)
  3922. }, this).join(' ').split(/\s+/)
  3923. if (this.options.loose) {
  3924. // in loose mode, throw out any that are not valid comparators
  3925. set = set.filter(function (comp) {
  3926. return !!comp.match(compRe)
  3927. })
  3928. }
  3929. set = set.map(function (comp) {
  3930. return new Comparator(comp, this.options)
  3931. }, this)
  3932. return set
  3933. }
  3934. Range.prototype.intersects = function (range, options) {
  3935. if (!(range instanceof Range)) {
  3936. throw new TypeError('a Range is required')
  3937. }
  3938. return this.set.some(function (thisComparators) {
  3939. return thisComparators.every(function (thisComparator) {
  3940. return range.set.some(function (rangeComparators) {
  3941. return rangeComparators.every(function (rangeComparator) {
  3942. return thisComparator.intersects(rangeComparator, options)
  3943. })
  3944. })
  3945. })
  3946. })
  3947. }
  3948. // Mostly just for testing and legacy API reasons
  3949. exports.toComparators = toComparators
  3950. function toComparators (range, options) {
  3951. return new Range(range, options).set.map(function (comp) {
  3952. return comp.map(function (c) {
  3953. return c.value
  3954. }).join(' ').trim().split(' ')
  3955. })
  3956. }
  3957. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3958. // already replaced the hyphen ranges
  3959. // turn into a set of JUST comparators.
  3960. function parseComparator (comp, options) {
  3961. debug('comp', comp, options)
  3962. comp = replaceCarets(comp, options)
  3963. debug('caret', comp)
  3964. comp = replaceTildes(comp, options)
  3965. debug('tildes', comp)
  3966. comp = replaceXRanges(comp, options)
  3967. debug('xrange', comp)
  3968. comp = replaceStars(comp, options)
  3969. debug('stars', comp)
  3970. return comp
  3971. }
  3972. function isX (id) {
  3973. return !id || id.toLowerCase() === 'x' || id === '*'
  3974. }
  3975. // ~, ~> --> * (any, kinda silly)
  3976. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3977. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3978. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3979. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3980. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3981. function replaceTildes (comp, options) {
  3982. return comp.trim().split(/\s+/).map(function (comp) {
  3983. return replaceTilde(comp, options)
  3984. }).join(' ')
  3985. }
  3986. function replaceTilde (comp, options) {
  3987. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3988. return comp.replace(r, function (_, M, m, p, pr) {
  3989. debug('tilde', comp, _, M, m, p, pr)
  3990. var ret
  3991. if (isX(M)) {
  3992. ret = ''
  3993. } else if (isX(m)) {
  3994. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3995. } else if (isX(p)) {
  3996. // ~1.2 == >=1.2.0 <1.3.0
  3997. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3998. } else if (pr) {
  3999. debug('replaceTilde pr', pr)
  4000. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4001. ' <' + M + '.' + (+m + 1) + '.0'
  4002. } else {
  4003. // ~1.2.3 == >=1.2.3 <1.3.0
  4004. ret = '>=' + M + '.' + m + '.' + p +
  4005. ' <' + M + '.' + (+m + 1) + '.0'
  4006. }
  4007. debug('tilde return', ret)
  4008. return ret
  4009. })
  4010. }
  4011. // ^ --> * (any, kinda silly)
  4012. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4013. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4014. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4015. // ^1.2.3 --> >=1.2.3 <2.0.0
  4016. // ^1.2.0 --> >=1.2.0 <2.0.0
  4017. function replaceCarets (comp, options) {
  4018. return comp.trim().split(/\s+/).map(function (comp) {
  4019. return replaceCaret(comp, options)
  4020. }).join(' ')
  4021. }
  4022. function replaceCaret (comp, options) {
  4023. debug('caret', comp, options)
  4024. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4025. return comp.replace(r, function (_, M, m, p, pr) {
  4026. debug('caret', comp, _, M, m, p, pr)
  4027. var ret
  4028. if (isX(M)) {
  4029. ret = ''
  4030. } else if (isX(m)) {
  4031. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4032. } else if (isX(p)) {
  4033. if (M === '0') {
  4034. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4035. } else {
  4036. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4037. }
  4038. } else if (pr) {
  4039. debug('replaceCaret pr', pr)
  4040. if (M === '0') {
  4041. if (m === '0') {
  4042. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4043. ' <' + M + '.' + m + '.' + (+p + 1)
  4044. } else {
  4045. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4046. ' <' + M + '.' + (+m + 1) + '.0'
  4047. }
  4048. } else {
  4049. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4050. ' <' + (+M + 1) + '.0.0'
  4051. }
  4052. } else {
  4053. debug('no pr')
  4054. if (M === '0') {
  4055. if (m === '0') {
  4056. ret = '>=' + M + '.' + m + '.' + p +
  4057. ' <' + M + '.' + m + '.' + (+p + 1)
  4058. } else {
  4059. ret = '>=' + M + '.' + m + '.' + p +
  4060. ' <' + M + '.' + (+m + 1) + '.0'
  4061. }
  4062. } else {
  4063. ret = '>=' + M + '.' + m + '.' + p +
  4064. ' <' + (+M + 1) + '.0.0'
  4065. }
  4066. }
  4067. debug('caret return', ret)
  4068. return ret
  4069. })
  4070. }
  4071. function replaceXRanges (comp, options) {
  4072. debug('replaceXRanges', comp, options)
  4073. return comp.split(/\s+/).map(function (comp) {
  4074. return replaceXRange(comp, options)
  4075. }).join(' ')
  4076. }
  4077. function replaceXRange (comp, options) {
  4078. comp = comp.trim()
  4079. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4080. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4081. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4082. var xM = isX(M)
  4083. var xm = xM || isX(m)
  4084. var xp = xm || isX(p)
  4085. var anyX = xp
  4086. if (gtlt === '=' && anyX) {
  4087. gtlt = ''
  4088. }
  4089. if (xM) {
  4090. if (gtlt === '>' || gtlt === '<') {
  4091. // nothing is allowed
  4092. ret = '<0.0.0'
  4093. } else {
  4094. // nothing is forbidden
  4095. ret = '*'
  4096. }
  4097. } else if (gtlt && anyX) {
  4098. // we know patch is an x, because we have any x at all.
  4099. // replace X with 0
  4100. if (xm) {
  4101. m = 0
  4102. }
  4103. p = 0
  4104. if (gtlt === '>') {
  4105. // >1 => >=2.0.0
  4106. // >1.2 => >=1.3.0
  4107. // >1.2.3 => >= 1.2.4
  4108. gtlt = '>='
  4109. if (xm) {
  4110. M = +M + 1
  4111. m = 0
  4112. p = 0
  4113. } else {
  4114. m = +m + 1
  4115. p = 0
  4116. }
  4117. } else if (gtlt === '<=') {
  4118. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4119. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4120. gtlt = '<'
  4121. if (xm) {
  4122. M = +M + 1
  4123. } else {
  4124. m = +m + 1
  4125. }
  4126. }
  4127. ret = gtlt + M + '.' + m + '.' + p
  4128. } else if (xm) {
  4129. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4130. } else if (xp) {
  4131. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4132. }
  4133. debug('xRange return', ret)
  4134. return ret
  4135. })
  4136. }
  4137. // Because * is AND-ed with everything else in the comparator,
  4138. // and '' means "any version", just remove the *s entirely.
  4139. function replaceStars (comp, options) {
  4140. debug('replaceStars', comp, options)
  4141. // Looseness is ignored here. star is always as loose as it gets!
  4142. return comp.trim().replace(re[STAR], '')
  4143. }
  4144. // This function is passed to string.replace(re[HYPHENRANGE])
  4145. // M, m, patch, prerelease, build
  4146. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4147. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4148. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4149. function hyphenReplace ($0,
  4150. from, fM, fm, fp, fpr, fb,
  4151. to, tM, tm, tp, tpr, tb) {
  4152. if (isX(fM)) {
  4153. from = ''
  4154. } else if (isX(fm)) {
  4155. from = '>=' + fM + '.0.0'
  4156. } else if (isX(fp)) {
  4157. from = '>=' + fM + '.' + fm + '.0'
  4158. } else {
  4159. from = '>=' + from
  4160. }
  4161. if (isX(tM)) {
  4162. to = ''
  4163. } else if (isX(tm)) {
  4164. to = '<' + (+tM + 1) + '.0.0'
  4165. } else if (isX(tp)) {
  4166. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4167. } else if (tpr) {
  4168. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4169. } else {
  4170. to = '<=' + to
  4171. }
  4172. return (from + ' ' + to).trim()
  4173. }
  4174. // if ANY of the sets match ALL of its comparators, then pass
  4175. Range.prototype.test = function (version) {
  4176. if (!version) {
  4177. return false
  4178. }
  4179. if (typeof version === 'string') {
  4180. version = new SemVer(version, this.options)
  4181. }
  4182. for (var i = 0; i < this.set.length; i++) {
  4183. if (testSet(this.set[i], version, this.options)) {
  4184. return true
  4185. }
  4186. }
  4187. return false
  4188. }
  4189. function testSet (set, version, options) {
  4190. for (var i = 0; i < set.length; i++) {
  4191. if (!set[i].test(version)) {
  4192. return false
  4193. }
  4194. }
  4195. if (version.prerelease.length && !options.includePrerelease) {
  4196. // Find the set of versions that are allowed to have prereleases
  4197. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4198. // That should allow `1.2.3-pr.2` to pass.
  4199. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4200. // even though it's within the range set by the comparators.
  4201. for (i = 0; i < set.length; i++) {
  4202. debug(set[i].semver)
  4203. if (set[i].semver === ANY) {
  4204. continue
  4205. }
  4206. if (set[i].semver.prerelease.length > 0) {
  4207. var allowed = set[i].semver
  4208. if (allowed.major === version.major &&
  4209. allowed.minor === version.minor &&
  4210. allowed.patch === version.patch) {
  4211. return true
  4212. }
  4213. }
  4214. }
  4215. // Version has a -pre, but it's not one of the ones we like.
  4216. return false
  4217. }
  4218. return true
  4219. }
  4220. exports.satisfies = satisfies
  4221. function satisfies (version, range, options) {
  4222. try {
  4223. range = new Range(range, options)
  4224. } catch (er) {
  4225. return false
  4226. }
  4227. return range.test(version)
  4228. }
  4229. exports.maxSatisfying = maxSatisfying
  4230. function maxSatisfying (versions, range, options) {
  4231. var max = null
  4232. var maxSV = null
  4233. try {
  4234. var rangeObj = new Range(range, options)
  4235. } catch (er) {
  4236. return null
  4237. }
  4238. versions.forEach(function (v) {
  4239. if (rangeObj.test(v)) {
  4240. // satisfies(v, range, options)
  4241. if (!max || maxSV.compare(v) === -1) {
  4242. // compare(max, v, true)
  4243. max = v
  4244. maxSV = new SemVer(max, options)
  4245. }
  4246. }
  4247. })
  4248. return max
  4249. }
  4250. exports.minSatisfying = minSatisfying
  4251. function minSatisfying (versions, range, options) {
  4252. var min = null
  4253. var minSV = null
  4254. try {
  4255. var rangeObj = new Range(range, options)
  4256. } catch (er) {
  4257. return null
  4258. }
  4259. versions.forEach(function (v) {
  4260. if (rangeObj.test(v)) {
  4261. // satisfies(v, range, options)
  4262. if (!min || minSV.compare(v) === 1) {
  4263. // compare(min, v, true)
  4264. min = v
  4265. minSV = new SemVer(min, options)
  4266. }
  4267. }
  4268. })
  4269. return min
  4270. }
  4271. exports.minVersion = minVersion
  4272. function minVersion (range, loose) {
  4273. range = new Range(range, loose)
  4274. var minver = new SemVer('0.0.0')
  4275. if (range.test(minver)) {
  4276. return minver
  4277. }
  4278. minver = new SemVer('0.0.0-0')
  4279. if (range.test(minver)) {
  4280. return minver
  4281. }
  4282. minver = null
  4283. for (var i = 0; i < range.set.length; ++i) {
  4284. var comparators = range.set[i]
  4285. comparators.forEach(function (comparator) {
  4286. // Clone to avoid manipulating the comparator's semver object.
  4287. var compver = new SemVer(comparator.semver.version)
  4288. switch (comparator.operator) {
  4289. case '>':
  4290. if (compver.prerelease.length === 0) {
  4291. compver.patch++
  4292. } else {
  4293. compver.prerelease.push(0)
  4294. }
  4295. compver.raw = compver.format()
  4296. /* fallthrough */
  4297. case '':
  4298. case '>=':
  4299. if (!minver || gt(minver, compver)) {
  4300. minver = compver
  4301. }
  4302. break
  4303. case '<':
  4304. case '<=':
  4305. /* Ignore maximum versions */
  4306. break
  4307. /* istanbul ignore next */
  4308. default:
  4309. throw new Error('Unexpected operation: ' + comparator.operator)
  4310. }
  4311. })
  4312. }
  4313. if (minver && range.test(minver)) {
  4314. return minver
  4315. }
  4316. return null
  4317. }
  4318. exports.validRange = validRange
  4319. function validRange (range, options) {
  4320. try {
  4321. // Return '*' instead of '' so that truthiness works.
  4322. // This will throw if it's invalid anyway
  4323. return new Range(range, options).range || '*'
  4324. } catch (er) {
  4325. return null
  4326. }
  4327. }
  4328. // Determine if version is less than all the versions possible in the range
  4329. exports.ltr = ltr
  4330. function ltr (version, range, options) {
  4331. return outside(version, range, '<', options)
  4332. }
  4333. // Determine if version is greater than all the versions possible in the range.
  4334. exports.gtr = gtr
  4335. function gtr (version, range, options) {
  4336. return outside(version, range, '>', options)
  4337. }
  4338. exports.outside = outside
  4339. function outside (version, range, hilo, options) {
  4340. version = new SemVer(version, options)
  4341. range = new Range(range, options)
  4342. var gtfn, ltefn, ltfn, comp, ecomp
  4343. switch (hilo) {
  4344. case '>':
  4345. gtfn = gt
  4346. ltefn = lte
  4347. ltfn = lt
  4348. comp = '>'
  4349. ecomp = '>='
  4350. break
  4351. case '<':
  4352. gtfn = lt
  4353. ltefn = gte
  4354. ltfn = gt
  4355. comp = '<'
  4356. ecomp = '<='
  4357. break
  4358. default:
  4359. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4360. }
  4361. // If it satisifes the range it is not outside
  4362. if (satisfies(version, range, options)) {
  4363. return false
  4364. }
  4365. // From now on, variable terms are as if we're in "gtr" mode.
  4366. // but note that everything is flipped for the "ltr" function.
  4367. for (var i = 0; i < range.set.length; ++i) {
  4368. var comparators = range.set[i]
  4369. var high = null
  4370. var low = null
  4371. comparators.forEach(function (comparator) {
  4372. if (comparator.semver === ANY) {
  4373. comparator = new Comparator('>=0.0.0')
  4374. }
  4375. high = high || comparator
  4376. low = low || comparator
  4377. if (gtfn(comparator.semver, high.semver, options)) {
  4378. high = comparator
  4379. } else if (ltfn(comparator.semver, low.semver, options)) {
  4380. low = comparator
  4381. }
  4382. })
  4383. // If the edge version comparator has a operator then our version
  4384. // isn't outside it
  4385. if (high.operator === comp || high.operator === ecomp) {
  4386. return false
  4387. }
  4388. // If the lowest version comparator has an operator and our version
  4389. // is less than it then it isn't higher than the range
  4390. if ((!low.operator || low.operator === comp) &&
  4391. ltefn(version, low.semver)) {
  4392. return false
  4393. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4394. return false
  4395. }
  4396. }
  4397. return true
  4398. }
  4399. exports.prerelease = prerelease
  4400. function prerelease (version, options) {
  4401. var parsed = parse(version, options)
  4402. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4403. }
  4404. exports.intersects = intersects
  4405. function intersects (r1, r2, options) {
  4406. r1 = new Range(r1, options)
  4407. r2 = new Range(r2, options)
  4408. return r1.intersects(r2)
  4409. }
  4410. exports.coerce = coerce
  4411. function coerce (version) {
  4412. if (version instanceof SemVer) {
  4413. return version
  4414. }
  4415. if (typeof version !== 'string') {
  4416. return null
  4417. }
  4418. var match = version.match(re[COERCE])
  4419. if (match == null) {
  4420. return null
  4421. }
  4422. return parse(match[1] +
  4423. '.' + (match[2] || '0') +
  4424. '.' + (match[3] || '0'))
  4425. }
  4426. /***/ }),
  4427. /***/ 287:
  4428. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4429. "use strict";
  4430. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4431. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4432. return new (P || (P = Promise))(function (resolve, reject) {
  4433. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4434. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4435. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4436. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4437. });
  4438. };
  4439. var __importStar = (this && this.__importStar) || function (mod) {
  4440. if (mod && mod.__esModule) return mod;
  4441. var result = {};
  4442. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4443. result["default"] = mod;
  4444. return result;
  4445. };
  4446. var __importDefault = (this && this.__importDefault) || function (mod) {
  4447. return (mod && mod.__esModule) ? mod : { "default": mod };
  4448. };
  4449. Object.defineProperty(exports, "__esModule", { value: true });
  4450. const assert = __importStar(__webpack_require__(357));
  4451. const core = __importStar(__webpack_require__(470));
  4452. const exec = __importStar(__webpack_require__(986));
  4453. const fs = __importStar(__webpack_require__(747));
  4454. const io = __importStar(__webpack_require__(1));
  4455. const os = __importStar(__webpack_require__(87));
  4456. const path = __importStar(__webpack_require__(622));
  4457. const regexpHelper = __importStar(__webpack_require__(528));
  4458. const stateHelper = __importStar(__webpack_require__(153));
  4459. const v4_1 = __importDefault(__webpack_require__(826));
  4460. const IS_WINDOWS = process.platform === 'win32';
  4461. const HOSTNAME = 'github.com';
  4462. const SSH_COMMAND_KEY = 'core.sshCommand';
  4463. function createAuthHelper(git, settings) {
  4464. return new GitAuthHelper(git, settings);
  4465. }
  4466. exports.createAuthHelper = createAuthHelper;
  4467. class GitAuthHelper {
  4468. constructor(gitCommandManager, gitSourceSettings) {
  4469. this.tokenConfigKey = `http.https://${HOSTNAME}/.extraheader`;
  4470. this.insteadOfKey = `url.https://${HOSTNAME}/.insteadOf`;
  4471. this.insteadOfValue = `git@${HOSTNAME}:`;
  4472. this.sshCommand = '';
  4473. this.sshKeyPath = '';
  4474. this.sshKnownHostsPath = '';
  4475. this.temporaryHomePath = '';
  4476. this.git = gitCommandManager;
  4477. this.settings = gitSourceSettings || {};
  4478. // Token auth header
  4479. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4480. core.setSecret(basicCredential);
  4481. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4482. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4483. }
  4484. configureAuth() {
  4485. return __awaiter(this, void 0, void 0, function* () {
  4486. // Remove possible previous values
  4487. yield this.removeAuth();
  4488. // Configure new values
  4489. yield this.configureSsh();
  4490. yield this.configureToken();
  4491. });
  4492. }
  4493. configureGlobalAuth() {
  4494. return __awaiter(this, void 0, void 0, function* () {
  4495. // Create a temp home directory
  4496. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4497. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4498. const uniqueId = v4_1.default();
  4499. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4500. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4501. // Copy the global git config
  4502. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4503. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4504. let configExists = false;
  4505. try {
  4506. yield fs.promises.stat(gitConfigPath);
  4507. configExists = true;
  4508. }
  4509. catch (err) {
  4510. if (err.code !== 'ENOENT') {
  4511. throw err;
  4512. }
  4513. }
  4514. if (configExists) {
  4515. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4516. yield io.cp(gitConfigPath, newGitConfigPath);
  4517. }
  4518. else {
  4519. yield fs.promises.writeFile(newGitConfigPath, '');
  4520. }
  4521. try {
  4522. // Override HOME
  4523. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4524. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4525. // Configure the token
  4526. yield this.configureToken(newGitConfigPath, true);
  4527. // Configure HTTPS instead of SSH
  4528. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4529. if (!this.settings.sshKey) {
  4530. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4531. }
  4532. }
  4533. catch (err) {
  4534. // Unset in case somehow written to the real global config
  4535. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4536. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4537. throw err;
  4538. }
  4539. });
  4540. }
  4541. configureSubmoduleAuth() {
  4542. return __awaiter(this, void 0, void 0, function* () {
  4543. // Remove possible previous HTTPS instead of SSH
  4544. yield this.removeGitConfig(this.insteadOfKey, true);
  4545. if (this.settings.persistCredentials) {
  4546. // Configure a placeholder value. This approach avoids the credential being captured
  4547. // by process creation audit events, which are commonly logged. For more information,
  4548. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4549. const output = yield this.git.submoduleForeach(`git config --local '${this.tokenConfigKey}' '${this.tokenPlaceholderConfigValue}' && git config --local --show-origin --name-only --get-regexp remote.origin.url`, this.settings.nestedSubmodules);
  4550. // Replace the placeholder
  4551. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4552. for (const configPath of configPaths) {
  4553. core.debug(`Replacing token placeholder in '${configPath}'`);
  4554. this.replaceTokenPlaceholder(configPath);
  4555. }
  4556. if (this.settings.sshKey) {
  4557. // Configure core.sshCommand
  4558. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4559. }
  4560. else {
  4561. // Configure HTTPS instead of SSH
  4562. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4563. }
  4564. }
  4565. });
  4566. }
  4567. removeAuth() {
  4568. return __awaiter(this, void 0, void 0, function* () {
  4569. yield this.removeSsh();
  4570. yield this.removeToken();
  4571. });
  4572. }
  4573. removeGlobalAuth() {
  4574. return __awaiter(this, void 0, void 0, function* () {
  4575. core.info(`Unsetting HOME override`);
  4576. this.git.removeEnvironmentVariable('HOME');
  4577. yield io.rmRF(this.temporaryHomePath);
  4578. });
  4579. }
  4580. configureSsh() {
  4581. return __awaiter(this, void 0, void 0, function* () {
  4582. if (!this.settings.sshKey) {
  4583. return;
  4584. }
  4585. // Write key
  4586. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4587. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4588. const uniqueId = v4_1.default();
  4589. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4590. stateHelper.setSshKeyPath(this.sshKeyPath);
  4591. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4592. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4593. // Remove inherited permissions on Windows
  4594. if (IS_WINDOWS) {
  4595. const icacls = yield io.which('icacls.exe');
  4596. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4597. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4598. }
  4599. // Write known hosts
  4600. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4601. let userKnownHosts = '';
  4602. try {
  4603. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4604. }
  4605. catch (err) {
  4606. if (err.code !== 'ENOENT') {
  4607. throw err;
  4608. }
  4609. }
  4610. let knownHosts = '';
  4611. if (userKnownHosts) {
  4612. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4613. }
  4614. if (this.settings.sshKnownHosts) {
  4615. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4616. }
  4617. knownHosts += `# Begin implicitly added github.com\ngithub.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n# End implicitly added github.com\n`;
  4618. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4619. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4620. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4621. // Configure GIT_SSH_COMMAND
  4622. const sshPath = yield io.which('ssh', true);
  4623. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4624. if (this.settings.sshStrict) {
  4625. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4626. }
  4627. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4628. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4629. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4630. // Configure core.sshCommand
  4631. if (this.settings.persistCredentials) {
  4632. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4633. }
  4634. });
  4635. }
  4636. configureToken(configPath, globalConfig) {
  4637. return __awaiter(this, void 0, void 0, function* () {
  4638. // Validate args
  4639. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4640. // Default config path
  4641. if (!configPath && !globalConfig) {
  4642. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4643. }
  4644. // Configure a placeholder value. This approach avoids the credential being captured
  4645. // by process creation audit events, which are commonly logged. For more information,
  4646. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4647. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4648. // Replace the placeholder
  4649. yield this.replaceTokenPlaceholder(configPath || '');
  4650. });
  4651. }
  4652. replaceTokenPlaceholder(configPath) {
  4653. return __awaiter(this, void 0, void 0, function* () {
  4654. assert.ok(configPath, 'configPath is not defined');
  4655. let content = (yield fs.promises.readFile(configPath)).toString();
  4656. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4657. if (placeholderIndex < 0 ||
  4658. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4659. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4660. }
  4661. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4662. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4663. yield fs.promises.writeFile(configPath, content);
  4664. });
  4665. }
  4666. removeSsh() {
  4667. return __awaiter(this, void 0, void 0, function* () {
  4668. // SSH key
  4669. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4670. if (keyPath) {
  4671. try {
  4672. yield io.rmRF(keyPath);
  4673. }
  4674. catch (err) {
  4675. core.debug(err.message);
  4676. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4677. }
  4678. }
  4679. // SSH known hosts
  4680. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4681. if (knownHostsPath) {
  4682. try {
  4683. yield io.rmRF(knownHostsPath);
  4684. }
  4685. catch (_a) {
  4686. // Intentionally empty
  4687. }
  4688. }
  4689. // SSH command
  4690. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4691. });
  4692. }
  4693. removeToken() {
  4694. return __awaiter(this, void 0, void 0, function* () {
  4695. // HTTP extra header
  4696. yield this.removeGitConfig(this.tokenConfigKey);
  4697. });
  4698. }
  4699. removeGitConfig(configKey, submoduleOnly = false) {
  4700. return __awaiter(this, void 0, void 0, function* () {
  4701. if (!submoduleOnly) {
  4702. if ((yield this.git.configExists(configKey)) &&
  4703. !(yield this.git.tryConfigUnset(configKey))) {
  4704. // Load the config contents
  4705. core.warning(`Failed to remove '${configKey}' from the git config`);
  4706. }
  4707. }
  4708. const pattern = regexpHelper.escape(configKey);
  4709. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4710. });
  4711. }
  4712. }
  4713. /***/ }),
  4714. /***/ 289:
  4715. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4716. "use strict";
  4717. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4718. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4719. return new (P || (P = Promise))(function (resolve, reject) {
  4720. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4721. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4722. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4723. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4724. });
  4725. };
  4726. var __importStar = (this && this.__importStar) || function (mod) {
  4727. if (mod && mod.__esModule) return mod;
  4728. var result = {};
  4729. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4730. result["default"] = mod;
  4731. return result;
  4732. };
  4733. Object.defineProperty(exports, "__esModule", { value: true });
  4734. const core = __importStar(__webpack_require__(470));
  4735. const exec = __importStar(__webpack_require__(986));
  4736. const fshelper = __importStar(__webpack_require__(618));
  4737. const io = __importStar(__webpack_require__(1));
  4738. const path = __importStar(__webpack_require__(622));
  4739. const regexpHelper = __importStar(__webpack_require__(528));
  4740. const retryHelper = __importStar(__webpack_require__(587));
  4741. const git_version_1 = __webpack_require__(559);
  4742. // Auth header not supported before 2.9
  4743. // Wire protocol v2 not supported before 2.18
  4744. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4745. function createCommandManager(workingDirectory, lfs) {
  4746. return __awaiter(this, void 0, void 0, function* () {
  4747. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4748. });
  4749. }
  4750. exports.createCommandManager = createCommandManager;
  4751. class GitCommandManager {
  4752. // Private constructor; use createCommandManager()
  4753. constructor() {
  4754. this.gitEnv = {
  4755. GIT_TERMINAL_PROMPT: '0',
  4756. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4757. };
  4758. this.gitPath = '';
  4759. this.lfs = false;
  4760. this.workingDirectory = '';
  4761. }
  4762. branchDelete(remote, branch) {
  4763. return __awaiter(this, void 0, void 0, function* () {
  4764. const args = ['branch', '--delete', '--force'];
  4765. if (remote) {
  4766. args.push('--remote');
  4767. }
  4768. args.push(branch);
  4769. yield this.execGit(args);
  4770. });
  4771. }
  4772. branchExists(remote, pattern) {
  4773. return __awaiter(this, void 0, void 0, function* () {
  4774. const args = ['branch', '--list'];
  4775. if (remote) {
  4776. args.push('--remote');
  4777. }
  4778. args.push(pattern);
  4779. const output = yield this.execGit(args);
  4780. return !!output.stdout.trim();
  4781. });
  4782. }
  4783. branchList(remote) {
  4784. return __awaiter(this, void 0, void 0, function* () {
  4785. const result = [];
  4786. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4787. // "branch --list" is more difficult when in a detached HEAD state.
  4788. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4789. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4790. const args = ['rev-parse', '--symbolic-full-name'];
  4791. if (remote) {
  4792. args.push('--remotes=origin');
  4793. }
  4794. else {
  4795. args.push('--branches');
  4796. }
  4797. const output = yield this.execGit(args);
  4798. for (let branch of output.stdout.trim().split('\n')) {
  4799. branch = branch.trim();
  4800. if (branch) {
  4801. if (branch.startsWith('refs/heads/')) {
  4802. branch = branch.substr('refs/heads/'.length);
  4803. }
  4804. else if (branch.startsWith('refs/remotes/')) {
  4805. branch = branch.substr('refs/remotes/'.length);
  4806. }
  4807. result.push(branch);
  4808. }
  4809. }
  4810. return result;
  4811. });
  4812. }
  4813. checkout(ref, startPoint) {
  4814. return __awaiter(this, void 0, void 0, function* () {
  4815. const args = ['checkout', '--progress', '--force'];
  4816. if (startPoint) {
  4817. args.push('-B', ref, startPoint);
  4818. }
  4819. else {
  4820. args.push(ref);
  4821. }
  4822. yield this.execGit(args);
  4823. });
  4824. }
  4825. checkoutDetach() {
  4826. return __awaiter(this, void 0, void 0, function* () {
  4827. const args = ['checkout', '--detach'];
  4828. yield this.execGit(args);
  4829. });
  4830. }
  4831. config(configKey, configValue, globalConfig) {
  4832. return __awaiter(this, void 0, void 0, function* () {
  4833. yield this.execGit([
  4834. 'config',
  4835. globalConfig ? '--global' : '--local',
  4836. configKey,
  4837. configValue
  4838. ]);
  4839. });
  4840. }
  4841. configExists(configKey, globalConfig) {
  4842. return __awaiter(this, void 0, void 0, function* () {
  4843. const pattern = regexpHelper.escape(configKey);
  4844. const output = yield this.execGit([
  4845. 'config',
  4846. globalConfig ? '--global' : '--local',
  4847. '--name-only',
  4848. '--get-regexp',
  4849. pattern
  4850. ], true);
  4851. return output.exitCode === 0;
  4852. });
  4853. }
  4854. fetch(fetchDepth, refSpec) {
  4855. return __awaiter(this, void 0, void 0, function* () {
  4856. const args = [
  4857. '-c',
  4858. 'protocol.version=2',
  4859. 'fetch',
  4860. '--no-tags',
  4861. '--prune',
  4862. '--progress',
  4863. '--no-recurse-submodules'
  4864. ];
  4865. if (fetchDepth > 0) {
  4866. args.push(`--depth=${fetchDepth}`);
  4867. }
  4868. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4869. args.push('--unshallow');
  4870. }
  4871. args.push('origin');
  4872. for (const arg of refSpec) {
  4873. args.push(arg);
  4874. }
  4875. const that = this;
  4876. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4877. yield that.execGit(args);
  4878. }));
  4879. });
  4880. }
  4881. getWorkingDirectory() {
  4882. return this.workingDirectory;
  4883. }
  4884. init() {
  4885. return __awaiter(this, void 0, void 0, function* () {
  4886. yield this.execGit(['init', this.workingDirectory]);
  4887. });
  4888. }
  4889. isDetached() {
  4890. return __awaiter(this, void 0, void 0, function* () {
  4891. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  4892. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  4893. return !output.stdout.trim().startsWith('refs/heads/');
  4894. });
  4895. }
  4896. lfsFetch(ref) {
  4897. return __awaiter(this, void 0, void 0, function* () {
  4898. const args = ['lfs', 'fetch', 'origin', ref];
  4899. const that = this;
  4900. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4901. yield that.execGit(args);
  4902. }));
  4903. });
  4904. }
  4905. lfsInstall() {
  4906. return __awaiter(this, void 0, void 0, function* () {
  4907. yield this.execGit(['lfs', 'install', '--local']);
  4908. });
  4909. }
  4910. log1() {
  4911. return __awaiter(this, void 0, void 0, function* () {
  4912. yield this.execGit(['log', '-1']);
  4913. });
  4914. }
  4915. remoteAdd(remoteName, remoteUrl) {
  4916. return __awaiter(this, void 0, void 0, function* () {
  4917. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4918. });
  4919. }
  4920. removeEnvironmentVariable(name) {
  4921. delete this.gitEnv[name];
  4922. }
  4923. setEnvironmentVariable(name, value) {
  4924. this.gitEnv[name] = value;
  4925. }
  4926. setRemoteUrl(value) {
  4927. return __awaiter(this, void 0, void 0, function* () {
  4928. yield this.config('git.remote.url', value);
  4929. });
  4930. }
  4931. submoduleForeach(command, recursive) {
  4932. return __awaiter(this, void 0, void 0, function* () {
  4933. const args = ['submodule', 'foreach'];
  4934. if (recursive) {
  4935. args.push('--recursive');
  4936. }
  4937. args.push(command);
  4938. const output = yield this.execGit(args);
  4939. return output.stdout;
  4940. });
  4941. }
  4942. submoduleSync(recursive) {
  4943. return __awaiter(this, void 0, void 0, function* () {
  4944. const args = ['submodule', 'sync'];
  4945. if (recursive) {
  4946. args.push('--recursive');
  4947. }
  4948. yield this.execGit(args);
  4949. });
  4950. }
  4951. submoduleUpdate(fetchDepth, recursive) {
  4952. return __awaiter(this, void 0, void 0, function* () {
  4953. const args = ['-c', 'protocol.version=2'];
  4954. args.push('submodule', 'update', '--init', '--force');
  4955. if (fetchDepth > 0) {
  4956. args.push(`--depth=${fetchDepth}`);
  4957. }
  4958. if (recursive) {
  4959. args.push('--recursive');
  4960. }
  4961. yield this.execGit(args);
  4962. });
  4963. }
  4964. tagExists(pattern) {
  4965. return __awaiter(this, void 0, void 0, function* () {
  4966. const output = yield this.execGit(['tag', '--list', pattern]);
  4967. return !!output.stdout.trim();
  4968. });
  4969. }
  4970. tryClean() {
  4971. return __awaiter(this, void 0, void 0, function* () {
  4972. const output = yield this.execGit(['clean', '-ffdx'], true);
  4973. return output.exitCode === 0;
  4974. });
  4975. }
  4976. tryConfigUnset(configKey, globalConfig) {
  4977. return __awaiter(this, void 0, void 0, function* () {
  4978. const output = yield this.execGit([
  4979. 'config',
  4980. globalConfig ? '--global' : '--local',
  4981. '--unset-all',
  4982. configKey
  4983. ], true);
  4984. return output.exitCode === 0;
  4985. });
  4986. }
  4987. tryDisableAutomaticGarbageCollection() {
  4988. return __awaiter(this, void 0, void 0, function* () {
  4989. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  4990. return output.exitCode === 0;
  4991. });
  4992. }
  4993. tryGetRemoteUrl() {
  4994. return __awaiter(this, void 0, void 0, function* () {
  4995. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  4996. if (output.exitCode !== 0) {
  4997. return '';
  4998. }
  4999. const stdout = output.stdout.trim();
  5000. if (stdout.includes('\n')) {
  5001. return '';
  5002. }
  5003. return stdout;
  5004. });
  5005. }
  5006. tryReset() {
  5007. return __awaiter(this, void 0, void 0, function* () {
  5008. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5009. return output.exitCode === 0;
  5010. });
  5011. }
  5012. static createCommandManager(workingDirectory, lfs) {
  5013. return __awaiter(this, void 0, void 0, function* () {
  5014. const result = new GitCommandManager();
  5015. yield result.initializeCommandManager(workingDirectory, lfs);
  5016. return result;
  5017. });
  5018. }
  5019. execGit(args, allowAllExitCodes = false) {
  5020. return __awaiter(this, void 0, void 0, function* () {
  5021. fshelper.directoryExistsSync(this.workingDirectory, true);
  5022. const result = new GitOutput();
  5023. const env = {};
  5024. for (const key of Object.keys(process.env)) {
  5025. env[key] = process.env[key];
  5026. }
  5027. for (const key of Object.keys(this.gitEnv)) {
  5028. env[key] = this.gitEnv[key];
  5029. }
  5030. const stdout = [];
  5031. const options = {
  5032. cwd: this.workingDirectory,
  5033. env,
  5034. ignoreReturnCode: allowAllExitCodes,
  5035. listeners: {
  5036. stdout: (data) => {
  5037. stdout.push(data.toString());
  5038. }
  5039. }
  5040. };
  5041. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5042. result.stdout = stdout.join('');
  5043. return result;
  5044. });
  5045. }
  5046. initializeCommandManager(workingDirectory, lfs) {
  5047. return __awaiter(this, void 0, void 0, function* () {
  5048. this.workingDirectory = workingDirectory;
  5049. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5050. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5051. this.lfs = lfs;
  5052. if (!this.lfs) {
  5053. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5054. }
  5055. this.gitPath = yield io.which('git', true);
  5056. // Git version
  5057. core.debug('Getting git version');
  5058. let gitVersion = new git_version_1.GitVersion();
  5059. let gitOutput = yield this.execGit(['version']);
  5060. let stdout = gitOutput.stdout.trim();
  5061. if (!stdout.includes('\n')) {
  5062. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5063. if (match) {
  5064. gitVersion = new git_version_1.GitVersion(match[0]);
  5065. }
  5066. }
  5067. if (!gitVersion.isValid()) {
  5068. throw new Error('Unable to determine git version');
  5069. }
  5070. // Minimum git version
  5071. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5072. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5073. }
  5074. if (this.lfs) {
  5075. // Git-lfs version
  5076. core.debug('Getting git-lfs version');
  5077. let gitLfsVersion = new git_version_1.GitVersion();
  5078. const gitLfsPath = yield io.which('git-lfs', true);
  5079. gitOutput = yield this.execGit(['lfs', 'version']);
  5080. stdout = gitOutput.stdout.trim();
  5081. if (!stdout.includes('\n')) {
  5082. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5083. if (match) {
  5084. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5085. }
  5086. }
  5087. if (!gitLfsVersion.isValid()) {
  5088. throw new Error('Unable to determine git-lfs version');
  5089. }
  5090. // Minimum git-lfs version
  5091. // Note:
  5092. // - Auth header not supported before 2.1
  5093. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5094. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5095. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5096. }
  5097. }
  5098. // Set the user agent
  5099. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5100. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5101. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5102. });
  5103. }
  5104. }
  5105. class GitOutput {
  5106. constructor() {
  5107. this.stdout = '';
  5108. this.exitCode = 0;
  5109. }
  5110. }
  5111. /***/ }),
  5112. /***/ 293:
  5113. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5114. "use strict";
  5115. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5116. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5117. return new (P || (P = Promise))(function (resolve, reject) {
  5118. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5119. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5120. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5121. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5122. });
  5123. };
  5124. var __importStar = (this && this.__importStar) || function (mod) {
  5125. if (mod && mod.__esModule) return mod;
  5126. var result = {};
  5127. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5128. result["default"] = mod;
  5129. return result;
  5130. };
  5131. Object.defineProperty(exports, "__esModule", { value: true });
  5132. const core = __importStar(__webpack_require__(470));
  5133. const fsHelper = __importStar(__webpack_require__(618));
  5134. const gitAuthHelper = __importStar(__webpack_require__(287));
  5135. const gitCommandManager = __importStar(__webpack_require__(289));
  5136. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5137. const githubApiHelper = __importStar(__webpack_require__(464));
  5138. const io = __importStar(__webpack_require__(1));
  5139. const path = __importStar(__webpack_require__(622));
  5140. const refHelper = __importStar(__webpack_require__(227));
  5141. const stateHelper = __importStar(__webpack_require__(153));
  5142. const hostname = 'github.com';
  5143. function getSource(settings) {
  5144. return __awaiter(this, void 0, void 0, function* () {
  5145. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5146. // Remote URL
  5147. const httpsUrl = `https://${hostname}/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  5148. const sshUrl = `git@${hostname}:${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}.git`;
  5149. // Always fetch the workflow repository using the token, not the SSH key
  5150. const initialRemoteUrl = !settings.sshKey || settings.isWorkflowRepository ? httpsUrl : sshUrl;
  5151. // Remove conflicting file path
  5152. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5153. yield io.rmRF(settings.repositoryPath);
  5154. }
  5155. // Create directory
  5156. let isExisting = true;
  5157. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5158. isExisting = false;
  5159. yield io.mkdirP(settings.repositoryPath);
  5160. }
  5161. // Git command manager
  5162. core.startGroup('Getting Git version info');
  5163. const git = yield getGitCommandManager(settings);
  5164. core.endGroup();
  5165. // Prepare existing directory, otherwise recreate
  5166. if (isExisting) {
  5167. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, initialRemoteUrl, [httpsUrl, sshUrl], settings.clean);
  5168. }
  5169. if (!git) {
  5170. // Downloading using REST API
  5171. core.info(`The repository will be downloaded using the GitHub REST API`);
  5172. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5173. if (settings.submodules) {
  5174. throw new Error(`Input 'submodules' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.`);
  5175. }
  5176. else if (settings.sshKey) {
  5177. throw new Error(`Input 'ssh-key' not supported when falling back to download using the GitHub REST API. To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH.`);
  5178. }
  5179. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5180. return;
  5181. }
  5182. // Save state for POST action
  5183. stateHelper.setRepositoryPath(settings.repositoryPath);
  5184. // Initialize the repository
  5185. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5186. yield git.init();
  5187. yield git.remoteAdd('origin', initialRemoteUrl);
  5188. }
  5189. // Disable automatic garbage collection
  5190. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5191. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5192. }
  5193. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5194. try {
  5195. // Configure auth
  5196. core.startGroup('Setting up auth');
  5197. yield authHelper.configureAuth();
  5198. core.endGroup();
  5199. // LFS install
  5200. if (settings.lfs) {
  5201. yield git.lfsInstall();
  5202. }
  5203. // Fetch
  5204. core.startGroup('Fetching the repository');
  5205. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5206. yield git.fetch(settings.fetchDepth, refSpec);
  5207. core.endGroup();
  5208. // Checkout info
  5209. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5210. // LFS fetch
  5211. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5212. // Explicit lfs fetch will fetch lfs objects in parallel.
  5213. if (settings.lfs) {
  5214. core.startGroup('Fetching LFS objects');
  5215. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5216. core.endGroup();
  5217. }
  5218. // Fix URL when using SSH
  5219. if (settings.sshKey && initialRemoteUrl !== sshUrl) {
  5220. yield git.setRemoteUrl(sshUrl);
  5221. }
  5222. // Checkout
  5223. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5224. // Submodules
  5225. if (settings.submodules) {
  5226. try {
  5227. // Temporarily override global config
  5228. core.startGroup('Setting up auth for fetching submodules');
  5229. yield authHelper.configureGlobalAuth();
  5230. core.endGroup();
  5231. // Checkout submodules
  5232. core.startGroup('Fetching submodules');
  5233. yield git.submoduleSync(settings.nestedSubmodules);
  5234. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5235. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5236. core.endGroup();
  5237. // Persist credentials
  5238. if (settings.persistCredentials) {
  5239. core.startGroup('Persisting credentials for submodules');
  5240. yield authHelper.configureSubmoduleAuth();
  5241. core.endGroup();
  5242. }
  5243. }
  5244. finally {
  5245. // Remove temporary global config override
  5246. yield authHelper.removeGlobalAuth();
  5247. }
  5248. }
  5249. // Dump some info about the checked out commit
  5250. yield git.log1();
  5251. }
  5252. finally {
  5253. // Remove auth
  5254. if (!settings.persistCredentials) {
  5255. core.startGroup('Removing auth');
  5256. yield authHelper.removeAuth();
  5257. core.endGroup();
  5258. }
  5259. }
  5260. });
  5261. }
  5262. exports.getSource = getSource;
  5263. function cleanup(repositoryPath) {
  5264. return __awaiter(this, void 0, void 0, function* () {
  5265. // Repo exists?
  5266. if (!repositoryPath ||
  5267. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5268. return;
  5269. }
  5270. let git;
  5271. try {
  5272. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5273. }
  5274. catch (_a) {
  5275. return;
  5276. }
  5277. // Remove auth
  5278. const authHelper = gitAuthHelper.createAuthHelper(git);
  5279. yield authHelper.removeAuth();
  5280. });
  5281. }
  5282. exports.cleanup = cleanup;
  5283. function getGitCommandManager(settings) {
  5284. return __awaiter(this, void 0, void 0, function* () {
  5285. core.info(`Working directory is '${settings.repositoryPath}'`);
  5286. try {
  5287. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5288. }
  5289. catch (err) {
  5290. // Git is required for LFS
  5291. if (settings.lfs) {
  5292. throw err;
  5293. }
  5294. // Otherwise fallback to REST API
  5295. return undefined;
  5296. }
  5297. });
  5298. }
  5299. /***/ }),
  5300. /***/ 294:
  5301. /***/ (function(module, __unusedexports, __webpack_require__) {
  5302. module.exports = parseOptions;
  5303. const { Deprecation } = __webpack_require__(692);
  5304. const { getUserAgent } = __webpack_require__(796);
  5305. const once = __webpack_require__(969);
  5306. const pkg = __webpack_require__(215);
  5307. const deprecateOptionsTimeout = once((log, deprecation) =>
  5308. log.warn(deprecation)
  5309. );
  5310. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5311. const deprecateOptionsHeaders = once((log, deprecation) =>
  5312. log.warn(deprecation)
  5313. );
  5314. function parseOptions(options, log, hook) {
  5315. if (options.headers) {
  5316. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5317. newObj[key.toLowerCase()] = options.headers[key];
  5318. return newObj;
  5319. }, {});
  5320. }
  5321. const clientDefaults = {
  5322. headers: options.headers || {},
  5323. request: options.request || {},
  5324. mediaType: {
  5325. previews: [],
  5326. format: ""
  5327. }
  5328. };
  5329. if (options.baseUrl) {
  5330. clientDefaults.baseUrl = options.baseUrl;
  5331. }
  5332. if (options.userAgent) {
  5333. clientDefaults.headers["user-agent"] = options.userAgent;
  5334. }
  5335. if (options.previews) {
  5336. clientDefaults.mediaType.previews = options.previews;
  5337. }
  5338. if (options.timeZone) {
  5339. clientDefaults.headers["time-zone"] = options.timeZone;
  5340. }
  5341. if (options.timeout) {
  5342. deprecateOptionsTimeout(
  5343. log,
  5344. new Deprecation(
  5345. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5346. )
  5347. );
  5348. clientDefaults.request.timeout = options.timeout;
  5349. }
  5350. if (options.agent) {
  5351. deprecateOptionsAgent(
  5352. log,
  5353. new Deprecation(
  5354. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5355. )
  5356. );
  5357. clientDefaults.request.agent = options.agent;
  5358. }
  5359. if (options.headers) {
  5360. deprecateOptionsHeaders(
  5361. log,
  5362. new Deprecation(
  5363. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5364. )
  5365. );
  5366. }
  5367. const userAgentOption = clientDefaults.headers["user-agent"];
  5368. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5369. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5370. .filter(Boolean)
  5371. .join(" ");
  5372. clientDefaults.request.hook = hook.bind(null, "request");
  5373. return clientDefaults;
  5374. }
  5375. /***/ }),
  5376. /***/ 297:
  5377. /***/ (function(module) {
  5378. module.exports = class HttpError extends Error {
  5379. constructor (message, code, headers) {
  5380. super(message)
  5381. // Maintains proper stack trace (only available on V8)
  5382. /* istanbul ignore next */
  5383. if (Error.captureStackTrace) {
  5384. Error.captureStackTrace(this, this.constructor)
  5385. }
  5386. this.name = 'HttpError'
  5387. this.code = code
  5388. this.headers = headers
  5389. }
  5390. }
  5391. /***/ }),
  5392. /***/ 301:
  5393. /***/ (function(module, __unusedexports, __webpack_require__) {
  5394. /**
  5395. * Some “list” response that can be paginated have a different response structure
  5396. *
  5397. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5398. * /installation/repositories also has `repository_selection`), as well as a key with
  5399. * the list of the items which name varies from endpoint to endpoint:
  5400. *
  5401. * - https://developer.github.com/v3/search/#example (key `items`)
  5402. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5403. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5404. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5405. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5406. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5407. *
  5408. * Octokit normalizes these responses so that paginated results are always returned following
  5409. * the same structure. One challenge is that if the list response has only one page, no Link
  5410. * header is provided, so this header alone is not sufficient to check wether a response is
  5411. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5412. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5413. * property because it also exists in the response of Get the combined status for a specific ref.
  5414. */
  5415. module.exports = normalizePaginatedListResponse;
  5416. const { Deprecation } = __webpack_require__(692);
  5417. const once = __webpack_require__(969);
  5418. const deprecateIncompleteResults = once((log, deprecation) =>
  5419. log.warn(deprecation)
  5420. );
  5421. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5422. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5423. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5424. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5425. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5426. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5427. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5428. function normalizePaginatedListResponse(octokit, url, response) {
  5429. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5430. if (
  5431. !REGEX_IS_SEARCH_PATH.test(path) &&
  5432. !REGEX_IS_CHECKS_PATH.test(path) &&
  5433. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5434. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5435. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5436. ) {
  5437. return;
  5438. }
  5439. // keep the additional properties intact to avoid a breaking change,
  5440. // but log a deprecation warning when accessed
  5441. const incompleteResults = response.data.incomplete_results;
  5442. const repositorySelection = response.data.repository_selection;
  5443. const totalCount = response.data.total_count;
  5444. delete response.data.incomplete_results;
  5445. delete response.data.repository_selection;
  5446. delete response.data.total_count;
  5447. const namespaceKey = Object.keys(response.data)[0];
  5448. response.data = response.data[namespaceKey];
  5449. Object.defineProperty(response.data, namespaceKey, {
  5450. get() {
  5451. deprecateNamespace(
  5452. octokit.log,
  5453. new Deprecation(
  5454. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5455. )
  5456. );
  5457. return response.data;
  5458. }
  5459. });
  5460. if (typeof incompleteResults !== "undefined") {
  5461. Object.defineProperty(response.data, "incomplete_results", {
  5462. get() {
  5463. deprecateIncompleteResults(
  5464. octokit.log,
  5465. new Deprecation(
  5466. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5467. )
  5468. );
  5469. return incompleteResults;
  5470. }
  5471. });
  5472. }
  5473. if (typeof repositorySelection !== "undefined") {
  5474. Object.defineProperty(response.data, "repository_selection", {
  5475. get() {
  5476. deprecateTotalCount(
  5477. octokit.log,
  5478. new Deprecation(
  5479. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5480. )
  5481. );
  5482. return repositorySelection;
  5483. }
  5484. });
  5485. }
  5486. Object.defineProperty(response.data, "total_count", {
  5487. get() {
  5488. deprecateTotalCount(
  5489. octokit.log,
  5490. new Deprecation(
  5491. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5492. )
  5493. );
  5494. return totalCount;
  5495. }
  5496. });
  5497. }
  5498. /***/ }),
  5499. /***/ 323:
  5500. /***/ (function(module) {
  5501. "use strict";
  5502. var isStream = module.exports = function (stream) {
  5503. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5504. };
  5505. isStream.writable = function (stream) {
  5506. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5507. };
  5508. isStream.readable = function (stream) {
  5509. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5510. };
  5511. isStream.duplex = function (stream) {
  5512. return isStream.writable(stream) && isStream.readable(stream);
  5513. };
  5514. isStream.transform = function (stream) {
  5515. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5516. };
  5517. /***/ }),
  5518. /***/ 335:
  5519. /***/ (function(module, __unusedexports, __webpack_require__) {
  5520. module.exports = __webpack_require__(179);
  5521. /***/ }),
  5522. /***/ 336:
  5523. /***/ (function(module, __unusedexports, __webpack_require__) {
  5524. module.exports = hasLastPage
  5525. const deprecate = __webpack_require__(370)
  5526. const getPageLinks = __webpack_require__(577)
  5527. function hasLastPage (link) {
  5528. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5529. return getPageLinks(link).last
  5530. }
  5531. /***/ }),
  5532. /***/ 348:
  5533. /***/ (function(module, __unusedexports, __webpack_require__) {
  5534. "use strict";
  5535. module.exports = validate;
  5536. const { RequestError } = __webpack_require__(463);
  5537. const get = __webpack_require__(854);
  5538. const set = __webpack_require__(883);
  5539. function validate(octokit, options) {
  5540. if (!options.request.validate) {
  5541. return;
  5542. }
  5543. const { validate: params } = options.request;
  5544. Object.keys(params).forEach(parameterName => {
  5545. const parameter = get(params, parameterName);
  5546. const expectedType = parameter.type;
  5547. let parentParameterName;
  5548. let parentValue;
  5549. let parentParamIsPresent = true;
  5550. let parentParameterIsArray = false;
  5551. if (/\./.test(parameterName)) {
  5552. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5553. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5554. if (parentParameterIsArray) {
  5555. parentParameterName = parentParameterName.slice(0, -2);
  5556. }
  5557. parentValue = get(options, parentParameterName);
  5558. parentParamIsPresent =
  5559. parentParameterName === "headers" ||
  5560. (typeof parentValue === "object" && parentValue !== null);
  5561. }
  5562. const values = parentParameterIsArray
  5563. ? (get(options, parentParameterName) || []).map(
  5564. value => value[parameterName.split(/\./).pop()]
  5565. )
  5566. : [get(options, parameterName)];
  5567. values.forEach((value, i) => {
  5568. const valueIsPresent = typeof value !== "undefined";
  5569. const valueIsNull = value === null;
  5570. const currentParameterName = parentParameterIsArray
  5571. ? parameterName.replace(/\[\]/, `[${i}]`)
  5572. : parameterName;
  5573. if (!parameter.required && !valueIsPresent) {
  5574. return;
  5575. }
  5576. // if the parent parameter is of type object but allows null
  5577. // then the child parameters can be ignored
  5578. if (!parentParamIsPresent) {
  5579. return;
  5580. }
  5581. if (parameter.allowNull && valueIsNull) {
  5582. return;
  5583. }
  5584. if (!parameter.allowNull && valueIsNull) {
  5585. throw new RequestError(
  5586. `'${currentParameterName}' cannot be null`,
  5587. 400,
  5588. {
  5589. request: options
  5590. }
  5591. );
  5592. }
  5593. if (parameter.required && !valueIsPresent) {
  5594. throw new RequestError(
  5595. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5596. value
  5597. )}`,
  5598. 400,
  5599. {
  5600. request: options
  5601. }
  5602. );
  5603. }
  5604. // parse to integer before checking for enum
  5605. // so that string "1" will match enum with number 1
  5606. if (expectedType === "integer") {
  5607. const unparsedValue = value;
  5608. value = parseInt(value, 10);
  5609. if (isNaN(value)) {
  5610. throw new RequestError(
  5611. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5612. unparsedValue
  5613. )} is NaN`,
  5614. 400,
  5615. {
  5616. request: options
  5617. }
  5618. );
  5619. }
  5620. }
  5621. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5622. throw new RequestError(
  5623. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5624. value
  5625. )}`,
  5626. 400,
  5627. {
  5628. request: options
  5629. }
  5630. );
  5631. }
  5632. if (parameter.validation) {
  5633. const regex = new RegExp(parameter.validation);
  5634. if (!regex.test(value)) {
  5635. throw new RequestError(
  5636. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5637. value
  5638. )}`,
  5639. 400,
  5640. {
  5641. request: options
  5642. }
  5643. );
  5644. }
  5645. }
  5646. if (expectedType === "object" && typeof value === "string") {
  5647. try {
  5648. value = JSON.parse(value);
  5649. } catch (exception) {
  5650. throw new RequestError(
  5651. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5652. value
  5653. )}`,
  5654. 400,
  5655. {
  5656. request: options
  5657. }
  5658. );
  5659. }
  5660. }
  5661. set(options, parameter.mapTo || currentParameterName, value);
  5662. });
  5663. });
  5664. return options;
  5665. }
  5666. /***/ }),
  5667. /***/ 349:
  5668. /***/ (function(module, __unusedexports, __webpack_require__) {
  5669. module.exports = authenticationRequestError;
  5670. const { RequestError } = __webpack_require__(463);
  5671. function authenticationRequestError(state, error, options) {
  5672. /* istanbul ignore next */
  5673. if (!error.headers) throw error;
  5674. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5675. // handle "2FA required" error only
  5676. if (error.status !== 401 || !otpRequired) {
  5677. throw error;
  5678. }
  5679. if (
  5680. error.status === 401 &&
  5681. otpRequired &&
  5682. error.request &&
  5683. error.request.headers["x-github-otp"]
  5684. ) {
  5685. throw new RequestError(
  5686. "Invalid one-time password for two-factor authentication",
  5687. 401,
  5688. {
  5689. headers: error.headers,
  5690. request: options
  5691. }
  5692. );
  5693. }
  5694. if (typeof state.auth.on2fa !== "function") {
  5695. throw new RequestError(
  5696. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5697. 401,
  5698. {
  5699. headers: error.headers,
  5700. request: options
  5701. }
  5702. );
  5703. }
  5704. return Promise.resolve()
  5705. .then(() => {
  5706. return state.auth.on2fa();
  5707. })
  5708. .then(oneTimePassword => {
  5709. const newOptions = Object.assign(options, {
  5710. headers: Object.assign(
  5711. { "x-github-otp": oneTimePassword },
  5712. options.headers
  5713. )
  5714. });
  5715. return state.octokit.request(newOptions);
  5716. });
  5717. }
  5718. /***/ }),
  5719. /***/ 357:
  5720. /***/ (function(module) {
  5721. module.exports = require("assert");
  5722. /***/ }),
  5723. /***/ 363:
  5724. /***/ (function(module) {
  5725. module.exports = register
  5726. function register (state, name, method, options) {
  5727. if (typeof method !== 'function') {
  5728. throw new Error('method for before hook must be a function')
  5729. }
  5730. if (!options) {
  5731. options = {}
  5732. }
  5733. if (Array.isArray(name)) {
  5734. return name.reverse().reduce(function (callback, name) {
  5735. return register.bind(null, state, name, callback, options)
  5736. }, method)()
  5737. }
  5738. return Promise.resolve()
  5739. .then(function () {
  5740. if (!state.registry[name]) {
  5741. return method(options)
  5742. }
  5743. return (state.registry[name]).reduce(function (method, registered) {
  5744. return registered.hook.bind(null, method, options)
  5745. }, method)()
  5746. })
  5747. }
  5748. /***/ }),
  5749. /***/ 368:
  5750. /***/ (function(module) {
  5751. module.exports = function atob(str) {
  5752. return Buffer.from(str, 'base64').toString('binary')
  5753. }
  5754. /***/ }),
  5755. /***/ 370:
  5756. /***/ (function(module) {
  5757. module.exports = deprecate
  5758. const loggedMessages = {}
  5759. function deprecate (message) {
  5760. if (loggedMessages[message]) {
  5761. return
  5762. }
  5763. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5764. loggedMessages[message] = 1
  5765. }
  5766. /***/ }),
  5767. /***/ 372:
  5768. /***/ (function(module) {
  5769. module.exports = octokitDebug;
  5770. function octokitDebug(octokit) {
  5771. octokit.hook.wrap("request", (request, options) => {
  5772. octokit.log.debug("request", options);
  5773. const start = Date.now();
  5774. const requestOptions = octokit.request.endpoint.parse(options);
  5775. const path = requestOptions.url.replace(options.baseUrl, "");
  5776. return request(options)
  5777. .then(response => {
  5778. octokit.log.info(
  5779. `${requestOptions.method} ${path} - ${
  5780. response.status
  5781. } in ${Date.now() - start}ms`
  5782. );
  5783. return response;
  5784. })
  5785. .catch(error => {
  5786. octokit.log.info(
  5787. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5788. start}ms`
  5789. );
  5790. throw error;
  5791. });
  5792. });
  5793. }
  5794. /***/ }),
  5795. /***/ 385:
  5796. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5797. "use strict";
  5798. Object.defineProperty(exports, '__esModule', { value: true });
  5799. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5800. var isPlainObject = _interopDefault(__webpack_require__(696));
  5801. var universalUserAgent = __webpack_require__(796);
  5802. function lowercaseKeys(object) {
  5803. if (!object) {
  5804. return {};
  5805. }
  5806. return Object.keys(object).reduce((newObj, key) => {
  5807. newObj[key.toLowerCase()] = object[key];
  5808. return newObj;
  5809. }, {});
  5810. }
  5811. function mergeDeep(defaults, options) {
  5812. const result = Object.assign({}, defaults);
  5813. Object.keys(options).forEach(key => {
  5814. if (isPlainObject(options[key])) {
  5815. if (!(key in defaults)) Object.assign(result, {
  5816. [key]: options[key]
  5817. });else result[key] = mergeDeep(defaults[key], options[key]);
  5818. } else {
  5819. Object.assign(result, {
  5820. [key]: options[key]
  5821. });
  5822. }
  5823. });
  5824. return result;
  5825. }
  5826. function merge(defaults, route, options) {
  5827. if (typeof route === "string") {
  5828. let [method, url] = route.split(" ");
  5829. options = Object.assign(url ? {
  5830. method,
  5831. url
  5832. } : {
  5833. url: method
  5834. }, options);
  5835. } else {
  5836. options = Object.assign({}, route);
  5837. } // lowercase header names before merging with defaults to avoid duplicates
  5838. options.headers = lowercaseKeys(options.headers);
  5839. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5840. if (defaults && defaults.mediaType.previews.length) {
  5841. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5842. }
  5843. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5844. return mergedOptions;
  5845. }
  5846. function addQueryParameters(url, parameters) {
  5847. const separator = /\?/.test(url) ? "&" : "?";
  5848. const names = Object.keys(parameters);
  5849. if (names.length === 0) {
  5850. return url;
  5851. }
  5852. return url + separator + names.map(name => {
  5853. if (name === "q") {
  5854. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5855. }
  5856. return `${name}=${encodeURIComponent(parameters[name])}`;
  5857. }).join("&");
  5858. }
  5859. const urlVariableRegex = /\{[^}]+\}/g;
  5860. function removeNonChars(variableName) {
  5861. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5862. }
  5863. function extractUrlVariableNames(url) {
  5864. const matches = url.match(urlVariableRegex);
  5865. if (!matches) {
  5866. return [];
  5867. }
  5868. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5869. }
  5870. function omit(object, keysToOmit) {
  5871. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5872. obj[key] = object[key];
  5873. return obj;
  5874. }, {});
  5875. }
  5876. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5877. // TODO: create separate package.
  5878. //
  5879. // Copyright (c) 2012-2014, Bram Stein
  5880. // All rights reserved.
  5881. // Redistribution and use in source and binary forms, with or without
  5882. // modification, are permitted provided that the following conditions
  5883. // are met:
  5884. // 1. Redistributions of source code must retain the above copyright
  5885. // notice, this list of conditions and the following disclaimer.
  5886. // 2. Redistributions in binary form must reproduce the above copyright
  5887. // notice, this list of conditions and the following disclaimer in the
  5888. // documentation and/or other materials provided with the distribution.
  5889. // 3. The name of the author may not be used to endorse or promote products
  5890. // derived from this software without specific prior written permission.
  5891. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5892. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5893. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5894. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5895. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5896. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5897. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5898. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5899. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5900. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5901. /* istanbul ignore file */
  5902. function encodeReserved(str) {
  5903. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5904. if (!/%[0-9A-Fa-f]/.test(part)) {
  5905. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5906. }
  5907. return part;
  5908. }).join("");
  5909. }
  5910. function encodeUnreserved(str) {
  5911. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5912. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5913. });
  5914. }
  5915. function encodeValue(operator, value, key) {
  5916. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5917. if (key) {
  5918. return encodeUnreserved(key) + "=" + value;
  5919. } else {
  5920. return value;
  5921. }
  5922. }
  5923. function isDefined(value) {
  5924. return value !== undefined && value !== null;
  5925. }
  5926. function isKeyOperator(operator) {
  5927. return operator === ";" || operator === "&" || operator === "?";
  5928. }
  5929. function getValues(context, operator, key, modifier) {
  5930. var value = context[key],
  5931. result = [];
  5932. if (isDefined(value) && value !== "") {
  5933. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5934. value = value.toString();
  5935. if (modifier && modifier !== "*") {
  5936. value = value.substring(0, parseInt(modifier, 10));
  5937. }
  5938. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5939. } else {
  5940. if (modifier === "*") {
  5941. if (Array.isArray(value)) {
  5942. value.filter(isDefined).forEach(function (value) {
  5943. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5944. });
  5945. } else {
  5946. Object.keys(value).forEach(function (k) {
  5947. if (isDefined(value[k])) {
  5948. result.push(encodeValue(operator, value[k], k));
  5949. }
  5950. });
  5951. }
  5952. } else {
  5953. const tmp = [];
  5954. if (Array.isArray(value)) {
  5955. value.filter(isDefined).forEach(function (value) {
  5956. tmp.push(encodeValue(operator, value));
  5957. });
  5958. } else {
  5959. Object.keys(value).forEach(function (k) {
  5960. if (isDefined(value[k])) {
  5961. tmp.push(encodeUnreserved(k));
  5962. tmp.push(encodeValue(operator, value[k].toString()));
  5963. }
  5964. });
  5965. }
  5966. if (isKeyOperator(operator)) {
  5967. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5968. } else if (tmp.length !== 0) {
  5969. result.push(tmp.join(","));
  5970. }
  5971. }
  5972. }
  5973. } else {
  5974. if (operator === ";") {
  5975. if (isDefined(value)) {
  5976. result.push(encodeUnreserved(key));
  5977. }
  5978. } else if (value === "" && (operator === "&" || operator === "?")) {
  5979. result.push(encodeUnreserved(key) + "=");
  5980. } else if (value === "") {
  5981. result.push("");
  5982. }
  5983. }
  5984. return result;
  5985. }
  5986. function parseUrl(template) {
  5987. return {
  5988. expand: expand.bind(null, template)
  5989. };
  5990. }
  5991. function expand(template, context) {
  5992. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5993. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5994. if (expression) {
  5995. let operator = "";
  5996. const values = [];
  5997. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5998. operator = expression.charAt(0);
  5999. expression = expression.substr(1);
  6000. }
  6001. expression.split(/,/g).forEach(function (variable) {
  6002. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6003. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6004. });
  6005. if (operator && operator !== "+") {
  6006. var separator = ",";
  6007. if (operator === "?") {
  6008. separator = "&";
  6009. } else if (operator !== "#") {
  6010. separator = operator;
  6011. }
  6012. return (values.length !== 0 ? operator : "") + values.join(separator);
  6013. } else {
  6014. return values.join(",");
  6015. }
  6016. } else {
  6017. return encodeReserved(literal);
  6018. }
  6019. });
  6020. }
  6021. function parse(options) {
  6022. // https://fetch.spec.whatwg.org/#methods
  6023. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6024. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6025. let headers = Object.assign({}, options.headers);
  6026. let body;
  6027. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6028. const urlVariableNames = extractUrlVariableNames(url);
  6029. url = parseUrl(url).expand(parameters);
  6030. if (!/^http/.test(url)) {
  6031. url = options.baseUrl + url;
  6032. }
  6033. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6034. const remainingParameters = omit(parameters, omittedParameters);
  6035. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6036. if (!isBinaryRequset) {
  6037. if (options.mediaType.format) {
  6038. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6039. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6040. }
  6041. if (options.mediaType.previews.length) {
  6042. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6043. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6044. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6045. return `application/vnd.github.${preview}-preview${format}`;
  6046. }).join(",");
  6047. }
  6048. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6049. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6050. if (["GET", "HEAD"].includes(method)) {
  6051. url = addQueryParameters(url, remainingParameters);
  6052. } else {
  6053. if ("data" in remainingParameters) {
  6054. body = remainingParameters.data;
  6055. } else {
  6056. if (Object.keys(remainingParameters).length) {
  6057. body = remainingParameters;
  6058. } else {
  6059. headers["content-length"] = 0;
  6060. }
  6061. }
  6062. } // default content-type for JSON if body is set
  6063. if (!headers["content-type"] && typeof body !== "undefined") {
  6064. headers["content-type"] = "application/json; charset=utf-8";
  6065. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6066. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6067. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6068. body = "";
  6069. } // Only return body/request keys if present
  6070. return Object.assign({
  6071. method,
  6072. url,
  6073. headers
  6074. }, typeof body !== "undefined" ? {
  6075. body
  6076. } : null, options.request ? {
  6077. request: options.request
  6078. } : null);
  6079. }
  6080. function endpointWithDefaults(defaults, route, options) {
  6081. return parse(merge(defaults, route, options));
  6082. }
  6083. function withDefaults(oldDefaults, newDefaults) {
  6084. const DEFAULTS = merge(oldDefaults, newDefaults);
  6085. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6086. return Object.assign(endpoint, {
  6087. DEFAULTS,
  6088. defaults: withDefaults.bind(null, DEFAULTS),
  6089. merge: merge.bind(null, DEFAULTS),
  6090. parse
  6091. });
  6092. }
  6093. const VERSION = "5.5.1";
  6094. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6095. // So we use RequestParameters and add method as additional required property.
  6096. const DEFAULTS = {
  6097. method: "GET",
  6098. baseUrl: "https://api.github.com",
  6099. headers: {
  6100. accept: "application/vnd.github.v3+json",
  6101. "user-agent": userAgent
  6102. },
  6103. mediaType: {
  6104. format: "",
  6105. previews: []
  6106. }
  6107. };
  6108. const endpoint = withDefaults(null, DEFAULTS);
  6109. exports.endpoint = endpoint;
  6110. //# sourceMappingURL=index.js.map
  6111. /***/ }),
  6112. /***/ 389:
  6113. /***/ (function(module, __unusedexports, __webpack_require__) {
  6114. "use strict";
  6115. const fs = __webpack_require__(747);
  6116. const shebangCommand = __webpack_require__(866);
  6117. function readShebang(command) {
  6118. // Read the first 150 bytes from the file
  6119. const size = 150;
  6120. let buffer;
  6121. if (Buffer.alloc) {
  6122. // Node.js v4.5+ / v5.10+
  6123. buffer = Buffer.alloc(size);
  6124. } else {
  6125. // Old Node.js API
  6126. buffer = new Buffer(size);
  6127. buffer.fill(0); // zero-fill
  6128. }
  6129. let fd;
  6130. try {
  6131. fd = fs.openSync(command, 'r');
  6132. fs.readSync(fd, buffer, 0, size, 0);
  6133. fs.closeSync(fd);
  6134. } catch (e) { /* Empty */ }
  6135. // Attempt to extract shebang (null is returned if not a shebang)
  6136. return shebangCommand(buffer.toString());
  6137. }
  6138. module.exports = readShebang;
  6139. /***/ }),
  6140. /***/ 402:
  6141. /***/ (function(module, __unusedexports, __webpack_require__) {
  6142. module.exports = Octokit;
  6143. const { request } = __webpack_require__(753);
  6144. const Hook = __webpack_require__(523);
  6145. const parseClientOptions = __webpack_require__(294);
  6146. function Octokit(plugins, options) {
  6147. options = options || {};
  6148. const hook = new Hook.Collection();
  6149. const log = Object.assign(
  6150. {
  6151. debug: () => {},
  6152. info: () => {},
  6153. warn: console.warn,
  6154. error: console.error
  6155. },
  6156. options && options.log
  6157. );
  6158. const api = {
  6159. hook,
  6160. log,
  6161. request: request.defaults(parseClientOptions(options, log, hook))
  6162. };
  6163. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6164. return api;
  6165. }
  6166. /***/ }),
  6167. /***/ 413:
  6168. /***/ (function(module) {
  6169. module.exports = require("stream");
  6170. /***/ }),
  6171. /***/ 417:
  6172. /***/ (function(module) {
  6173. module.exports = require("crypto");
  6174. /***/ }),
  6175. /***/ 427:
  6176. /***/ (function(module, __unusedexports, __webpack_require__) {
  6177. "use strict";
  6178. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6179. // In that case, fall back to a deprecated internal.
  6180. const util = __webpack_require__(669);
  6181. let uv;
  6182. if (typeof util.getSystemErrorName === 'function') {
  6183. module.exports = util.getSystemErrorName;
  6184. } else {
  6185. try {
  6186. uv = process.binding('uv');
  6187. if (typeof uv.errname !== 'function') {
  6188. throw new TypeError('uv.errname is not a function');
  6189. }
  6190. } catch (err) {
  6191. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6192. uv = null;
  6193. }
  6194. module.exports = code => errname(uv, code);
  6195. }
  6196. // Used for testing the fallback behavior
  6197. module.exports.__test__ = errname;
  6198. function errname(uv, code) {
  6199. if (uv) {
  6200. return uv.errname(code);
  6201. }
  6202. if (!(code < 0)) {
  6203. throw new Error('err >= 0');
  6204. }
  6205. return `Unknown system error ${code}`;
  6206. }
  6207. /***/ }),
  6208. /***/ 430:
  6209. /***/ (function(module, __unusedexports, __webpack_require__) {
  6210. module.exports = octokitValidate;
  6211. const validate = __webpack_require__(348);
  6212. function octokitValidate(octokit) {
  6213. octokit.hook.before("request", validate.bind(null, octokit));
  6214. }
  6215. /***/ }),
  6216. /***/ 431:
  6217. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6218. "use strict";
  6219. Object.defineProperty(exports, "__esModule", { value: true });
  6220. const os = __webpack_require__(87);
  6221. /**
  6222. * Commands
  6223. *
  6224. * Command Format:
  6225. * ##[name key=value;key=value]message
  6226. *
  6227. * Examples:
  6228. * ##[warning]This is the user warning message
  6229. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6230. */
  6231. function issueCommand(command, properties, message) {
  6232. const cmd = new Command(command, properties, message);
  6233. process.stdout.write(cmd.toString() + os.EOL);
  6234. }
  6235. exports.issueCommand = issueCommand;
  6236. function issue(name, message = '') {
  6237. issueCommand(name, {}, message);
  6238. }
  6239. exports.issue = issue;
  6240. const CMD_STRING = '::';
  6241. class Command {
  6242. constructor(command, properties, message) {
  6243. if (!command) {
  6244. command = 'missing.command';
  6245. }
  6246. this.command = command;
  6247. this.properties = properties;
  6248. this.message = message;
  6249. }
  6250. toString() {
  6251. let cmdStr = CMD_STRING + this.command;
  6252. if (this.properties && Object.keys(this.properties).length > 0) {
  6253. cmdStr += ' ';
  6254. for (const key in this.properties) {
  6255. if (this.properties.hasOwnProperty(key)) {
  6256. const val = this.properties[key];
  6257. if (val) {
  6258. // safely append the val - avoid blowing up when attempting to
  6259. // call .replace() if message is not a string for some reason
  6260. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6261. }
  6262. }
  6263. }
  6264. }
  6265. cmdStr += CMD_STRING;
  6266. // safely append the message - avoid blowing up when attempting to
  6267. // call .replace() if message is not a string for some reason
  6268. const message = `${this.message || ''}`;
  6269. cmdStr += escapeData(message);
  6270. return cmdStr;
  6271. }
  6272. }
  6273. function escapeData(s) {
  6274. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6275. }
  6276. function escape(s) {
  6277. return s
  6278. .replace(/\r/g, '%0D')
  6279. .replace(/\n/g, '%0A')
  6280. .replace(/]/g, '%5D')
  6281. .replace(/;/g, '%3B');
  6282. }
  6283. //# sourceMappingURL=command.js.map
  6284. /***/ }),
  6285. /***/ 438:
  6286. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6287. "use strict";
  6288. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6289. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6290. return new (P || (P = Promise))(function (resolve, reject) {
  6291. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6292. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6293. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6294. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6295. });
  6296. };
  6297. var __importStar = (this && this.__importStar) || function (mod) {
  6298. if (mod && mod.__esModule) return mod;
  6299. var result = {};
  6300. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6301. result["default"] = mod;
  6302. return result;
  6303. };
  6304. Object.defineProperty(exports, "__esModule", { value: true });
  6305. const assert = __importStar(__webpack_require__(357));
  6306. const core = __importStar(__webpack_require__(470));
  6307. const fs = __importStar(__webpack_require__(747));
  6308. const fsHelper = __importStar(__webpack_require__(618));
  6309. const io = __importStar(__webpack_require__(1));
  6310. const path = __importStar(__webpack_require__(622));
  6311. function prepareExistingDirectory(git, repositoryPath, preferredRemoteUrl, allowedRemoteUrls, clean) {
  6312. return __awaiter(this, void 0, void 0, function* () {
  6313. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6314. assert.ok(preferredRemoteUrl, 'Expected preferredRemoteUrl to be defined');
  6315. assert.ok(allowedRemoteUrls, 'Expected allowedRemoteUrls to be defined');
  6316. assert.ok(allowedRemoteUrls.length, 'Expected allowedRemoteUrls to have at least one value');
  6317. // Indicates whether to delete the directory contents
  6318. let remove = false;
  6319. // The remote URL
  6320. let remoteUrl;
  6321. // Check whether using git or REST API
  6322. if (!git) {
  6323. remove = true;
  6324. }
  6325. // Fetch URL does not match
  6326. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6327. allowedRemoteUrls.indexOf((remoteUrl = yield git.tryGetRemoteUrl())) < 0) {
  6328. remove = true;
  6329. }
  6330. else {
  6331. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6332. const lockPaths = [
  6333. path.join(repositoryPath, '.git', 'index.lock'),
  6334. path.join(repositoryPath, '.git', 'shallow.lock')
  6335. ];
  6336. for (const lockPath of lockPaths) {
  6337. try {
  6338. yield io.rmRF(lockPath);
  6339. }
  6340. catch (error) {
  6341. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6342. }
  6343. }
  6344. try {
  6345. core.startGroup('Removing previously created refs, to avoid conflicts');
  6346. // Checkout detached HEAD
  6347. if (!(yield git.isDetached())) {
  6348. yield git.checkoutDetach();
  6349. }
  6350. // Remove all refs/heads/*
  6351. let branches = yield git.branchList(false);
  6352. for (const branch of branches) {
  6353. yield git.branchDelete(false, branch);
  6354. }
  6355. // Remove all refs/remotes/origin/* to avoid conflicts
  6356. branches = yield git.branchList(true);
  6357. for (const branch of branches) {
  6358. yield git.branchDelete(true, branch);
  6359. }
  6360. core.endGroup();
  6361. // Clean
  6362. if (clean) {
  6363. core.startGroup('Cleaning the repository');
  6364. if (!(yield git.tryClean())) {
  6365. 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}'.`);
  6366. remove = true;
  6367. }
  6368. else if (!(yield git.tryReset())) {
  6369. remove = true;
  6370. }
  6371. core.endGroup();
  6372. if (remove) {
  6373. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6374. }
  6375. }
  6376. // Update to the preferred remote URL
  6377. if (remoteUrl !== preferredRemoteUrl) {
  6378. yield git.setRemoteUrl(preferredRemoteUrl);
  6379. }
  6380. }
  6381. catch (error) {
  6382. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6383. remove = true;
  6384. }
  6385. }
  6386. if (remove) {
  6387. // Delete the contents of the directory. Don't delete the directory itself
  6388. // since it might be the current working directory.
  6389. core.info(`Deleting the contents of '${repositoryPath}'`);
  6390. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6391. yield io.rmRF(path.join(repositoryPath, file));
  6392. }
  6393. }
  6394. });
  6395. }
  6396. exports.prepareExistingDirectory = prepareExistingDirectory;
  6397. /***/ }),
  6398. /***/ 453:
  6399. /***/ (function(module, __unusedexports, __webpack_require__) {
  6400. var once = __webpack_require__(969)
  6401. var eos = __webpack_require__(562)
  6402. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6403. var noop = function () {}
  6404. var ancient = /^v?\.0/.test(process.version)
  6405. var isFn = function (fn) {
  6406. return typeof fn === 'function'
  6407. }
  6408. var isFS = function (stream) {
  6409. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6410. if (!fs) return false // browser
  6411. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6412. }
  6413. var isRequest = function (stream) {
  6414. return stream.setHeader && isFn(stream.abort)
  6415. }
  6416. var destroyer = function (stream, reading, writing, callback) {
  6417. callback = once(callback)
  6418. var closed = false
  6419. stream.on('close', function () {
  6420. closed = true
  6421. })
  6422. eos(stream, {readable: reading, writable: writing}, function (err) {
  6423. if (err) return callback(err)
  6424. closed = true
  6425. callback()
  6426. })
  6427. var destroyed = false
  6428. return function (err) {
  6429. if (closed) return
  6430. if (destroyed) return
  6431. destroyed = true
  6432. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6433. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6434. if (isFn(stream.destroy)) return stream.destroy()
  6435. callback(err || new Error('stream was destroyed'))
  6436. }
  6437. }
  6438. var call = function (fn) {
  6439. fn()
  6440. }
  6441. var pipe = function (from, to) {
  6442. return from.pipe(to)
  6443. }
  6444. var pump = function () {
  6445. var streams = Array.prototype.slice.call(arguments)
  6446. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6447. if (Array.isArray(streams[0])) streams = streams[0]
  6448. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6449. var error
  6450. var destroys = streams.map(function (stream, i) {
  6451. var reading = i < streams.length - 1
  6452. var writing = i > 0
  6453. return destroyer(stream, reading, writing, function (err) {
  6454. if (!error) error = err
  6455. if (err) destroys.forEach(call)
  6456. if (reading) return
  6457. destroys.forEach(call)
  6458. callback(error)
  6459. })
  6460. })
  6461. return streams.reduce(pipe)
  6462. }
  6463. module.exports = pump
  6464. /***/ }),
  6465. /***/ 454:
  6466. /***/ (function(module, exports, __webpack_require__) {
  6467. "use strict";
  6468. Object.defineProperty(exports, '__esModule', { value: true });
  6469. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6470. var Stream = _interopDefault(__webpack_require__(413));
  6471. var http = _interopDefault(__webpack_require__(605));
  6472. var Url = _interopDefault(__webpack_require__(835));
  6473. var https = _interopDefault(__webpack_require__(211));
  6474. var zlib = _interopDefault(__webpack_require__(761));
  6475. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6476. // fix for "Readable" isn't a named export issue
  6477. const Readable = Stream.Readable;
  6478. const BUFFER = Symbol('buffer');
  6479. const TYPE = Symbol('type');
  6480. class Blob {
  6481. constructor() {
  6482. this[TYPE] = '';
  6483. const blobParts = arguments[0];
  6484. const options = arguments[1];
  6485. const buffers = [];
  6486. let size = 0;
  6487. if (blobParts) {
  6488. const a = blobParts;
  6489. const length = Number(a.length);
  6490. for (let i = 0; i < length; i++) {
  6491. const element = a[i];
  6492. let buffer;
  6493. if (element instanceof Buffer) {
  6494. buffer = element;
  6495. } else if (ArrayBuffer.isView(element)) {
  6496. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6497. } else if (element instanceof ArrayBuffer) {
  6498. buffer = Buffer.from(element);
  6499. } else if (element instanceof Blob) {
  6500. buffer = element[BUFFER];
  6501. } else {
  6502. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6503. }
  6504. size += buffer.length;
  6505. buffers.push(buffer);
  6506. }
  6507. }
  6508. this[BUFFER] = Buffer.concat(buffers);
  6509. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6510. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6511. this[TYPE] = type;
  6512. }
  6513. }
  6514. get size() {
  6515. return this[BUFFER].length;
  6516. }
  6517. get type() {
  6518. return this[TYPE];
  6519. }
  6520. text() {
  6521. return Promise.resolve(this[BUFFER].toString());
  6522. }
  6523. arrayBuffer() {
  6524. const buf = this[BUFFER];
  6525. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6526. return Promise.resolve(ab);
  6527. }
  6528. stream() {
  6529. const readable = new Readable();
  6530. readable._read = function () {};
  6531. readable.push(this[BUFFER]);
  6532. readable.push(null);
  6533. return readable;
  6534. }
  6535. toString() {
  6536. return '[object Blob]';
  6537. }
  6538. slice() {
  6539. const size = this.size;
  6540. const start = arguments[0];
  6541. const end = arguments[1];
  6542. let relativeStart, relativeEnd;
  6543. if (start === undefined) {
  6544. relativeStart = 0;
  6545. } else if (start < 0) {
  6546. relativeStart = Math.max(size + start, 0);
  6547. } else {
  6548. relativeStart = Math.min(start, size);
  6549. }
  6550. if (end === undefined) {
  6551. relativeEnd = size;
  6552. } else if (end < 0) {
  6553. relativeEnd = Math.max(size + end, 0);
  6554. } else {
  6555. relativeEnd = Math.min(end, size);
  6556. }
  6557. const span = Math.max(relativeEnd - relativeStart, 0);
  6558. const buffer = this[BUFFER];
  6559. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6560. const blob = new Blob([], { type: arguments[2] });
  6561. blob[BUFFER] = slicedBuffer;
  6562. return blob;
  6563. }
  6564. }
  6565. Object.defineProperties(Blob.prototype, {
  6566. size: { enumerable: true },
  6567. type: { enumerable: true },
  6568. slice: { enumerable: true }
  6569. });
  6570. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6571. value: 'Blob',
  6572. writable: false,
  6573. enumerable: false,
  6574. configurable: true
  6575. });
  6576. /**
  6577. * fetch-error.js
  6578. *
  6579. * FetchError interface for operational errors
  6580. */
  6581. /**
  6582. * Create FetchError instance
  6583. *
  6584. * @param String message Error message for human
  6585. * @param String type Error type for machine
  6586. * @param String systemError For Node.js system error
  6587. * @return FetchError
  6588. */
  6589. function FetchError(message, type, systemError) {
  6590. Error.call(this, message);
  6591. this.message = message;
  6592. this.type = type;
  6593. // when err.type is `system`, err.code contains system error code
  6594. if (systemError) {
  6595. this.code = this.errno = systemError.code;
  6596. }
  6597. // hide custom error implementation details from end-users
  6598. Error.captureStackTrace(this, this.constructor);
  6599. }
  6600. FetchError.prototype = Object.create(Error.prototype);
  6601. FetchError.prototype.constructor = FetchError;
  6602. FetchError.prototype.name = 'FetchError';
  6603. let convert;
  6604. try {
  6605. convert = __webpack_require__(18).convert;
  6606. } catch (e) {}
  6607. const INTERNALS = Symbol('Body internals');
  6608. // fix an issue where "PassThrough" isn't a named export for node <10
  6609. const PassThrough = Stream.PassThrough;
  6610. /**
  6611. * Body mixin
  6612. *
  6613. * Ref: https://fetch.spec.whatwg.org/#body
  6614. *
  6615. * @param Stream body Readable stream
  6616. * @param Object opts Response options
  6617. * @return Void
  6618. */
  6619. function Body(body) {
  6620. var _this = this;
  6621. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6622. _ref$size = _ref.size;
  6623. let size = _ref$size === undefined ? 0 : _ref$size;
  6624. var _ref$timeout = _ref.timeout;
  6625. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6626. if (body == null) {
  6627. // body is undefined or null
  6628. body = null;
  6629. } else if (isURLSearchParams(body)) {
  6630. // body is a URLSearchParams
  6631. body = Buffer.from(body.toString());
  6632. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6633. // body is ArrayBuffer
  6634. body = Buffer.from(body);
  6635. } else if (ArrayBuffer.isView(body)) {
  6636. // body is ArrayBufferView
  6637. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6638. } else if (body instanceof Stream) ; else {
  6639. // none of the above
  6640. // coerce to string then buffer
  6641. body = Buffer.from(String(body));
  6642. }
  6643. this[INTERNALS] = {
  6644. body,
  6645. disturbed: false,
  6646. error: null
  6647. };
  6648. this.size = size;
  6649. this.timeout = timeout;
  6650. if (body instanceof Stream) {
  6651. body.on('error', function (err) {
  6652. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6653. _this[INTERNALS].error = error;
  6654. });
  6655. }
  6656. }
  6657. Body.prototype = {
  6658. get body() {
  6659. return this[INTERNALS].body;
  6660. },
  6661. get bodyUsed() {
  6662. return this[INTERNALS].disturbed;
  6663. },
  6664. /**
  6665. * Decode response as ArrayBuffer
  6666. *
  6667. * @return Promise
  6668. */
  6669. arrayBuffer() {
  6670. return consumeBody.call(this).then(function (buf) {
  6671. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6672. });
  6673. },
  6674. /**
  6675. * Return raw response as Blob
  6676. *
  6677. * @return Promise
  6678. */
  6679. blob() {
  6680. let ct = this.headers && this.headers.get('content-type') || '';
  6681. return consumeBody.call(this).then(function (buf) {
  6682. return Object.assign(
  6683. // Prevent copying
  6684. new Blob([], {
  6685. type: ct.toLowerCase()
  6686. }), {
  6687. [BUFFER]: buf
  6688. });
  6689. });
  6690. },
  6691. /**
  6692. * Decode response as json
  6693. *
  6694. * @return Promise
  6695. */
  6696. json() {
  6697. var _this2 = this;
  6698. return consumeBody.call(this).then(function (buffer) {
  6699. try {
  6700. return JSON.parse(buffer.toString());
  6701. } catch (err) {
  6702. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6703. }
  6704. });
  6705. },
  6706. /**
  6707. * Decode response as text
  6708. *
  6709. * @return Promise
  6710. */
  6711. text() {
  6712. return consumeBody.call(this).then(function (buffer) {
  6713. return buffer.toString();
  6714. });
  6715. },
  6716. /**
  6717. * Decode response as buffer (non-spec api)
  6718. *
  6719. * @return Promise
  6720. */
  6721. buffer() {
  6722. return consumeBody.call(this);
  6723. },
  6724. /**
  6725. * Decode response as text, while automatically detecting the encoding and
  6726. * trying to decode to UTF-8 (non-spec api)
  6727. *
  6728. * @return Promise
  6729. */
  6730. textConverted() {
  6731. var _this3 = this;
  6732. return consumeBody.call(this).then(function (buffer) {
  6733. return convertBody(buffer, _this3.headers);
  6734. });
  6735. }
  6736. };
  6737. // In browsers, all properties are enumerable.
  6738. Object.defineProperties(Body.prototype, {
  6739. body: { enumerable: true },
  6740. bodyUsed: { enumerable: true },
  6741. arrayBuffer: { enumerable: true },
  6742. blob: { enumerable: true },
  6743. json: { enumerable: true },
  6744. text: { enumerable: true }
  6745. });
  6746. Body.mixIn = function (proto) {
  6747. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6748. // istanbul ignore else: future proof
  6749. if (!(name in proto)) {
  6750. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6751. Object.defineProperty(proto, name, desc);
  6752. }
  6753. }
  6754. };
  6755. /**
  6756. * Consume and convert an entire Body to a Buffer.
  6757. *
  6758. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6759. *
  6760. * @return Promise
  6761. */
  6762. function consumeBody() {
  6763. var _this4 = this;
  6764. if (this[INTERNALS].disturbed) {
  6765. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6766. }
  6767. this[INTERNALS].disturbed = true;
  6768. if (this[INTERNALS].error) {
  6769. return Body.Promise.reject(this[INTERNALS].error);
  6770. }
  6771. let body = this.body;
  6772. // body is null
  6773. if (body === null) {
  6774. return Body.Promise.resolve(Buffer.alloc(0));
  6775. }
  6776. // body is blob
  6777. if (isBlob(body)) {
  6778. body = body.stream();
  6779. }
  6780. // body is buffer
  6781. if (Buffer.isBuffer(body)) {
  6782. return Body.Promise.resolve(body);
  6783. }
  6784. // istanbul ignore if: should never happen
  6785. if (!(body instanceof Stream)) {
  6786. return Body.Promise.resolve(Buffer.alloc(0));
  6787. }
  6788. // body is stream
  6789. // get ready to actually consume the body
  6790. let accum = [];
  6791. let accumBytes = 0;
  6792. let abort = false;
  6793. return new Body.Promise(function (resolve, reject) {
  6794. let resTimeout;
  6795. // allow timeout on slow response body
  6796. if (_this4.timeout) {
  6797. resTimeout = setTimeout(function () {
  6798. abort = true;
  6799. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6800. }, _this4.timeout);
  6801. }
  6802. // handle stream errors
  6803. body.on('error', function (err) {
  6804. if (err.name === 'AbortError') {
  6805. // if the request was aborted, reject with this Error
  6806. abort = true;
  6807. reject(err);
  6808. } else {
  6809. // other errors, such as incorrect content-encoding
  6810. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6811. }
  6812. });
  6813. body.on('data', function (chunk) {
  6814. if (abort || chunk === null) {
  6815. return;
  6816. }
  6817. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6818. abort = true;
  6819. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6820. return;
  6821. }
  6822. accumBytes += chunk.length;
  6823. accum.push(chunk);
  6824. });
  6825. body.on('end', function () {
  6826. if (abort) {
  6827. return;
  6828. }
  6829. clearTimeout(resTimeout);
  6830. try {
  6831. resolve(Buffer.concat(accum, accumBytes));
  6832. } catch (err) {
  6833. // handle streams that have accumulated too much data (issue #414)
  6834. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6835. }
  6836. });
  6837. });
  6838. }
  6839. /**
  6840. * Detect buffer encoding and convert to target encoding
  6841. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6842. *
  6843. * @param Buffer buffer Incoming buffer
  6844. * @param String encoding Target encoding
  6845. * @return String
  6846. */
  6847. function convertBody(buffer, headers) {
  6848. if (typeof convert !== 'function') {
  6849. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6850. }
  6851. const ct = headers.get('content-type');
  6852. let charset = 'utf-8';
  6853. let res, str;
  6854. // header
  6855. if (ct) {
  6856. res = /charset=([^;]*)/i.exec(ct);
  6857. }
  6858. // no charset in content type, peek at response body for at most 1024 bytes
  6859. str = buffer.slice(0, 1024).toString();
  6860. // html5
  6861. if (!res && str) {
  6862. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6863. }
  6864. // html4
  6865. if (!res && str) {
  6866. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6867. if (res) {
  6868. res = /charset=(.*)/i.exec(res.pop());
  6869. }
  6870. }
  6871. // xml
  6872. if (!res && str) {
  6873. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6874. }
  6875. // found charset
  6876. if (res) {
  6877. charset = res.pop();
  6878. // prevent decode issues when sites use incorrect encoding
  6879. // ref: https://hsivonen.fi/encoding-menu/
  6880. if (charset === 'gb2312' || charset === 'gbk') {
  6881. charset = 'gb18030';
  6882. }
  6883. }
  6884. // turn raw buffers into a single utf-8 buffer
  6885. return convert(buffer, 'UTF-8', charset).toString();
  6886. }
  6887. /**
  6888. * Detect a URLSearchParams object
  6889. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6890. *
  6891. * @param Object obj Object to detect by type or brand
  6892. * @return String
  6893. */
  6894. function isURLSearchParams(obj) {
  6895. // Duck-typing as a necessary condition.
  6896. 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') {
  6897. return false;
  6898. }
  6899. // Brand-checking and more duck-typing as optional condition.
  6900. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6901. }
  6902. /**
  6903. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6904. * @param {*} obj
  6905. * @return {boolean}
  6906. */
  6907. function isBlob(obj) {
  6908. 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]);
  6909. }
  6910. /**
  6911. * Clone body given Res/Req instance
  6912. *
  6913. * @param Mixed instance Response or Request instance
  6914. * @return Mixed
  6915. */
  6916. function clone(instance) {
  6917. let p1, p2;
  6918. let body = instance.body;
  6919. // don't allow cloning a used body
  6920. if (instance.bodyUsed) {
  6921. throw new Error('cannot clone body after it is used');
  6922. }
  6923. // check that body is a stream and not form-data object
  6924. // note: we can't clone the form-data object without having it as a dependency
  6925. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6926. // tee instance body
  6927. p1 = new PassThrough();
  6928. p2 = new PassThrough();
  6929. body.pipe(p1);
  6930. body.pipe(p2);
  6931. // set instance body to teed body and return the other teed body
  6932. instance[INTERNALS].body = p1;
  6933. body = p2;
  6934. }
  6935. return body;
  6936. }
  6937. /**
  6938. * Performs the operation "extract a `Content-Type` value from |object|" as
  6939. * specified in the specification:
  6940. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6941. *
  6942. * This function assumes that instance.body is present.
  6943. *
  6944. * @param Mixed instance Any options.body input
  6945. */
  6946. function extractContentType(body) {
  6947. if (body === null) {
  6948. // body is null
  6949. return null;
  6950. } else if (typeof body === 'string') {
  6951. // body is string
  6952. return 'text/plain;charset=UTF-8';
  6953. } else if (isURLSearchParams(body)) {
  6954. // body is a URLSearchParams
  6955. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6956. } else if (isBlob(body)) {
  6957. // body is blob
  6958. return body.type || null;
  6959. } else if (Buffer.isBuffer(body)) {
  6960. // body is buffer
  6961. return null;
  6962. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6963. // body is ArrayBuffer
  6964. return null;
  6965. } else if (ArrayBuffer.isView(body)) {
  6966. // body is ArrayBufferView
  6967. return null;
  6968. } else if (typeof body.getBoundary === 'function') {
  6969. // detect form data input from form-data module
  6970. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6971. } else if (body instanceof Stream) {
  6972. // body is stream
  6973. // can't really do much about this
  6974. return null;
  6975. } else {
  6976. // Body constructor defaults other things to string
  6977. return 'text/plain;charset=UTF-8';
  6978. }
  6979. }
  6980. /**
  6981. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6982. * For us, we have to explicitly get it with a function.
  6983. *
  6984. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6985. *
  6986. * @param Body instance Instance of Body
  6987. * @return Number? Number of bytes, or null if not possible
  6988. */
  6989. function getTotalBytes(instance) {
  6990. const body = instance.body;
  6991. if (body === null) {
  6992. // body is null
  6993. return 0;
  6994. } else if (isBlob(body)) {
  6995. return body.size;
  6996. } else if (Buffer.isBuffer(body)) {
  6997. // body is buffer
  6998. return body.length;
  6999. } else if (body && typeof body.getLengthSync === 'function') {
  7000. // detect form data input from form-data module
  7001. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7002. body.hasKnownLength && body.hasKnownLength()) {
  7003. // 2.x
  7004. return body.getLengthSync();
  7005. }
  7006. return null;
  7007. } else {
  7008. // body is stream
  7009. return null;
  7010. }
  7011. }
  7012. /**
  7013. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7014. *
  7015. * @param Body instance Instance of Body
  7016. * @return Void
  7017. */
  7018. function writeToStream(dest, instance) {
  7019. const body = instance.body;
  7020. if (body === null) {
  7021. // body is null
  7022. dest.end();
  7023. } else if (isBlob(body)) {
  7024. body.stream().pipe(dest);
  7025. } else if (Buffer.isBuffer(body)) {
  7026. // body is buffer
  7027. dest.write(body);
  7028. dest.end();
  7029. } else {
  7030. // body is stream
  7031. body.pipe(dest);
  7032. }
  7033. }
  7034. // expose Promise
  7035. Body.Promise = global.Promise;
  7036. /**
  7037. * headers.js
  7038. *
  7039. * Headers class offers convenient helpers
  7040. */
  7041. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7042. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7043. function validateName(name) {
  7044. name = `${name}`;
  7045. if (invalidTokenRegex.test(name) || name === '') {
  7046. throw new TypeError(`${name} is not a legal HTTP header name`);
  7047. }
  7048. }
  7049. function validateValue(value) {
  7050. value = `${value}`;
  7051. if (invalidHeaderCharRegex.test(value)) {
  7052. throw new TypeError(`${value} is not a legal HTTP header value`);
  7053. }
  7054. }
  7055. /**
  7056. * Find the key in the map object given a header name.
  7057. *
  7058. * Returns undefined if not found.
  7059. *
  7060. * @param String name Header name
  7061. * @return String|Undefined
  7062. */
  7063. function find(map, name) {
  7064. name = name.toLowerCase();
  7065. for (const key in map) {
  7066. if (key.toLowerCase() === name) {
  7067. return key;
  7068. }
  7069. }
  7070. return undefined;
  7071. }
  7072. const MAP = Symbol('map');
  7073. class Headers {
  7074. /**
  7075. * Headers class
  7076. *
  7077. * @param Object headers Response headers
  7078. * @return Void
  7079. */
  7080. constructor() {
  7081. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7082. this[MAP] = Object.create(null);
  7083. if (init instanceof Headers) {
  7084. const rawHeaders = init.raw();
  7085. const headerNames = Object.keys(rawHeaders);
  7086. for (const headerName of headerNames) {
  7087. for (const value of rawHeaders[headerName]) {
  7088. this.append(headerName, value);
  7089. }
  7090. }
  7091. return;
  7092. }
  7093. // We don't worry about converting prop to ByteString here as append()
  7094. // will handle it.
  7095. if (init == null) ; else if (typeof init === 'object') {
  7096. const method = init[Symbol.iterator];
  7097. if (method != null) {
  7098. if (typeof method !== 'function') {
  7099. throw new TypeError('Header pairs must be iterable');
  7100. }
  7101. // sequence<sequence<ByteString>>
  7102. // Note: per spec we have to first exhaust the lists then process them
  7103. const pairs = [];
  7104. for (const pair of init) {
  7105. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7106. throw new TypeError('Each header pair must be iterable');
  7107. }
  7108. pairs.push(Array.from(pair));
  7109. }
  7110. for (const pair of pairs) {
  7111. if (pair.length !== 2) {
  7112. throw new TypeError('Each header pair must be a name/value tuple');
  7113. }
  7114. this.append(pair[0], pair[1]);
  7115. }
  7116. } else {
  7117. // record<ByteString, ByteString>
  7118. for (const key of Object.keys(init)) {
  7119. const value = init[key];
  7120. this.append(key, value);
  7121. }
  7122. }
  7123. } else {
  7124. throw new TypeError('Provided initializer must be an object');
  7125. }
  7126. }
  7127. /**
  7128. * Return combined header value given name
  7129. *
  7130. * @param String name Header name
  7131. * @return Mixed
  7132. */
  7133. get(name) {
  7134. name = `${name}`;
  7135. validateName(name);
  7136. const key = find(this[MAP], name);
  7137. if (key === undefined) {
  7138. return null;
  7139. }
  7140. return this[MAP][key].join(', ');
  7141. }
  7142. /**
  7143. * Iterate over all headers
  7144. *
  7145. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7146. * @param Boolean thisArg `this` context for callback function
  7147. * @return Void
  7148. */
  7149. forEach(callback) {
  7150. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7151. let pairs = getHeaders(this);
  7152. let i = 0;
  7153. while (i < pairs.length) {
  7154. var _pairs$i = pairs[i];
  7155. const name = _pairs$i[0],
  7156. value = _pairs$i[1];
  7157. callback.call(thisArg, value, name, this);
  7158. pairs = getHeaders(this);
  7159. i++;
  7160. }
  7161. }
  7162. /**
  7163. * Overwrite header values given name
  7164. *
  7165. * @param String name Header name
  7166. * @param String value Header value
  7167. * @return Void
  7168. */
  7169. set(name, value) {
  7170. name = `${name}`;
  7171. value = `${value}`;
  7172. validateName(name);
  7173. validateValue(value);
  7174. const key = find(this[MAP], name);
  7175. this[MAP][key !== undefined ? key : name] = [value];
  7176. }
  7177. /**
  7178. * Append a value onto existing header
  7179. *
  7180. * @param String name Header name
  7181. * @param String value Header value
  7182. * @return Void
  7183. */
  7184. append(name, value) {
  7185. name = `${name}`;
  7186. value = `${value}`;
  7187. validateName(name);
  7188. validateValue(value);
  7189. const key = find(this[MAP], name);
  7190. if (key !== undefined) {
  7191. this[MAP][key].push(value);
  7192. } else {
  7193. this[MAP][name] = [value];
  7194. }
  7195. }
  7196. /**
  7197. * Check for header name existence
  7198. *
  7199. * @param String name Header name
  7200. * @return Boolean
  7201. */
  7202. has(name) {
  7203. name = `${name}`;
  7204. validateName(name);
  7205. return find(this[MAP], name) !== undefined;
  7206. }
  7207. /**
  7208. * Delete all header values given name
  7209. *
  7210. * @param String name Header name
  7211. * @return Void
  7212. */
  7213. delete(name) {
  7214. name = `${name}`;
  7215. validateName(name);
  7216. const key = find(this[MAP], name);
  7217. if (key !== undefined) {
  7218. delete this[MAP][key];
  7219. }
  7220. }
  7221. /**
  7222. * Return raw headers (non-spec api)
  7223. *
  7224. * @return Object
  7225. */
  7226. raw() {
  7227. return this[MAP];
  7228. }
  7229. /**
  7230. * Get an iterator on keys.
  7231. *
  7232. * @return Iterator
  7233. */
  7234. keys() {
  7235. return createHeadersIterator(this, 'key');
  7236. }
  7237. /**
  7238. * Get an iterator on values.
  7239. *
  7240. * @return Iterator
  7241. */
  7242. values() {
  7243. return createHeadersIterator(this, 'value');
  7244. }
  7245. /**
  7246. * Get an iterator on entries.
  7247. *
  7248. * This is the default iterator of the Headers object.
  7249. *
  7250. * @return Iterator
  7251. */
  7252. [Symbol.iterator]() {
  7253. return createHeadersIterator(this, 'key+value');
  7254. }
  7255. }
  7256. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7257. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7258. value: 'Headers',
  7259. writable: false,
  7260. enumerable: false,
  7261. configurable: true
  7262. });
  7263. Object.defineProperties(Headers.prototype, {
  7264. get: { enumerable: true },
  7265. forEach: { enumerable: true },
  7266. set: { enumerable: true },
  7267. append: { enumerable: true },
  7268. has: { enumerable: true },
  7269. delete: { enumerable: true },
  7270. keys: { enumerable: true },
  7271. values: { enumerable: true },
  7272. entries: { enumerable: true }
  7273. });
  7274. function getHeaders(headers) {
  7275. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7276. const keys = Object.keys(headers[MAP]).sort();
  7277. return keys.map(kind === 'key' ? function (k) {
  7278. return k.toLowerCase();
  7279. } : kind === 'value' ? function (k) {
  7280. return headers[MAP][k].join(', ');
  7281. } : function (k) {
  7282. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7283. });
  7284. }
  7285. const INTERNAL = Symbol('internal');
  7286. function createHeadersIterator(target, kind) {
  7287. const iterator = Object.create(HeadersIteratorPrototype);
  7288. iterator[INTERNAL] = {
  7289. target,
  7290. kind,
  7291. index: 0
  7292. };
  7293. return iterator;
  7294. }
  7295. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7296. next() {
  7297. // istanbul ignore if
  7298. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7299. throw new TypeError('Value of `this` is not a HeadersIterator');
  7300. }
  7301. var _INTERNAL = this[INTERNAL];
  7302. const target = _INTERNAL.target,
  7303. kind = _INTERNAL.kind,
  7304. index = _INTERNAL.index;
  7305. const values = getHeaders(target, kind);
  7306. const len = values.length;
  7307. if (index >= len) {
  7308. return {
  7309. value: undefined,
  7310. done: true
  7311. };
  7312. }
  7313. this[INTERNAL].index = index + 1;
  7314. return {
  7315. value: values[index],
  7316. done: false
  7317. };
  7318. }
  7319. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7320. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7321. value: 'HeadersIterator',
  7322. writable: false,
  7323. enumerable: false,
  7324. configurable: true
  7325. });
  7326. /**
  7327. * Export the Headers object in a form that Node.js can consume.
  7328. *
  7329. * @param Headers headers
  7330. * @return Object
  7331. */
  7332. function exportNodeCompatibleHeaders(headers) {
  7333. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7334. // http.request() only supports string as Host header. This hack makes
  7335. // specifying custom Host header possible.
  7336. const hostHeaderKey = find(headers[MAP], 'Host');
  7337. if (hostHeaderKey !== undefined) {
  7338. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7339. }
  7340. return obj;
  7341. }
  7342. /**
  7343. * Create a Headers object from an object of headers, ignoring those that do
  7344. * not conform to HTTP grammar productions.
  7345. *
  7346. * @param Object obj Object of headers
  7347. * @return Headers
  7348. */
  7349. function createHeadersLenient(obj) {
  7350. const headers = new Headers();
  7351. for (const name of Object.keys(obj)) {
  7352. if (invalidTokenRegex.test(name)) {
  7353. continue;
  7354. }
  7355. if (Array.isArray(obj[name])) {
  7356. for (const val of obj[name]) {
  7357. if (invalidHeaderCharRegex.test(val)) {
  7358. continue;
  7359. }
  7360. if (headers[MAP][name] === undefined) {
  7361. headers[MAP][name] = [val];
  7362. } else {
  7363. headers[MAP][name].push(val);
  7364. }
  7365. }
  7366. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7367. headers[MAP][name] = [obj[name]];
  7368. }
  7369. }
  7370. return headers;
  7371. }
  7372. const INTERNALS$1 = Symbol('Response internals');
  7373. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7374. const STATUS_CODES = http.STATUS_CODES;
  7375. /**
  7376. * Response class
  7377. *
  7378. * @param Stream body Readable stream
  7379. * @param Object opts Response options
  7380. * @return Void
  7381. */
  7382. class Response {
  7383. constructor() {
  7384. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7385. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7386. Body.call(this, body, opts);
  7387. const status = opts.status || 200;
  7388. const headers = new Headers(opts.headers);
  7389. if (body != null && !headers.has('Content-Type')) {
  7390. const contentType = extractContentType(body);
  7391. if (contentType) {
  7392. headers.append('Content-Type', contentType);
  7393. }
  7394. }
  7395. this[INTERNALS$1] = {
  7396. url: opts.url,
  7397. status,
  7398. statusText: opts.statusText || STATUS_CODES[status],
  7399. headers,
  7400. counter: opts.counter
  7401. };
  7402. }
  7403. get url() {
  7404. return this[INTERNALS$1].url || '';
  7405. }
  7406. get status() {
  7407. return this[INTERNALS$1].status;
  7408. }
  7409. /**
  7410. * Convenience property representing if the request ended normally
  7411. */
  7412. get ok() {
  7413. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7414. }
  7415. get redirected() {
  7416. return this[INTERNALS$1].counter > 0;
  7417. }
  7418. get statusText() {
  7419. return this[INTERNALS$1].statusText;
  7420. }
  7421. get headers() {
  7422. return this[INTERNALS$1].headers;
  7423. }
  7424. /**
  7425. * Clone this response
  7426. *
  7427. * @return Response
  7428. */
  7429. clone() {
  7430. return new Response(clone(this), {
  7431. url: this.url,
  7432. status: this.status,
  7433. statusText: this.statusText,
  7434. headers: this.headers,
  7435. ok: this.ok,
  7436. redirected: this.redirected
  7437. });
  7438. }
  7439. }
  7440. Body.mixIn(Response.prototype);
  7441. Object.defineProperties(Response.prototype, {
  7442. url: { enumerable: true },
  7443. status: { enumerable: true },
  7444. ok: { enumerable: true },
  7445. redirected: { enumerable: true },
  7446. statusText: { enumerable: true },
  7447. headers: { enumerable: true },
  7448. clone: { enumerable: true }
  7449. });
  7450. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7451. value: 'Response',
  7452. writable: false,
  7453. enumerable: false,
  7454. configurable: true
  7455. });
  7456. const INTERNALS$2 = Symbol('Request internals');
  7457. // fix an issue where "format", "parse" aren't a named export for node <10
  7458. const parse_url = Url.parse;
  7459. const format_url = Url.format;
  7460. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7461. /**
  7462. * Check if a value is an instance of Request.
  7463. *
  7464. * @param Mixed input
  7465. * @return Boolean
  7466. */
  7467. function isRequest(input) {
  7468. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7469. }
  7470. function isAbortSignal(signal) {
  7471. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7472. return !!(proto && proto.constructor.name === 'AbortSignal');
  7473. }
  7474. /**
  7475. * Request class
  7476. *
  7477. * @param Mixed input Url or Request instance
  7478. * @param Object init Custom options
  7479. * @return Void
  7480. */
  7481. class Request {
  7482. constructor(input) {
  7483. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7484. let parsedURL;
  7485. // normalize input
  7486. if (!isRequest(input)) {
  7487. if (input && input.href) {
  7488. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7489. // will fall into this branch also (since their `toString()` will return
  7490. // `href` property anyway)
  7491. parsedURL = parse_url(input.href);
  7492. } else {
  7493. // coerce input to a string before attempting to parse
  7494. parsedURL = parse_url(`${input}`);
  7495. }
  7496. input = {};
  7497. } else {
  7498. parsedURL = parse_url(input.url);
  7499. }
  7500. let method = init.method || input.method || 'GET';
  7501. method = method.toUpperCase();
  7502. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7503. throw new TypeError('Request with GET/HEAD method cannot have body');
  7504. }
  7505. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7506. Body.call(this, inputBody, {
  7507. timeout: init.timeout || input.timeout || 0,
  7508. size: init.size || input.size || 0
  7509. });
  7510. const headers = new Headers(init.headers || input.headers || {});
  7511. if (inputBody != null && !headers.has('Content-Type')) {
  7512. const contentType = extractContentType(inputBody);
  7513. if (contentType) {
  7514. headers.append('Content-Type', contentType);
  7515. }
  7516. }
  7517. let signal = isRequest(input) ? input.signal : null;
  7518. if ('signal' in init) signal = init.signal;
  7519. if (signal != null && !isAbortSignal(signal)) {
  7520. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7521. }
  7522. this[INTERNALS$2] = {
  7523. method,
  7524. redirect: init.redirect || input.redirect || 'follow',
  7525. headers,
  7526. parsedURL,
  7527. signal
  7528. };
  7529. // node-fetch-only options
  7530. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7531. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7532. this.counter = init.counter || input.counter || 0;
  7533. this.agent = init.agent || input.agent;
  7534. }
  7535. get method() {
  7536. return this[INTERNALS$2].method;
  7537. }
  7538. get url() {
  7539. return format_url(this[INTERNALS$2].parsedURL);
  7540. }
  7541. get headers() {
  7542. return this[INTERNALS$2].headers;
  7543. }
  7544. get redirect() {
  7545. return this[INTERNALS$2].redirect;
  7546. }
  7547. get signal() {
  7548. return this[INTERNALS$2].signal;
  7549. }
  7550. /**
  7551. * Clone this request
  7552. *
  7553. * @return Request
  7554. */
  7555. clone() {
  7556. return new Request(this);
  7557. }
  7558. }
  7559. Body.mixIn(Request.prototype);
  7560. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7561. value: 'Request',
  7562. writable: false,
  7563. enumerable: false,
  7564. configurable: true
  7565. });
  7566. Object.defineProperties(Request.prototype, {
  7567. method: { enumerable: true },
  7568. url: { enumerable: true },
  7569. headers: { enumerable: true },
  7570. redirect: { enumerable: true },
  7571. clone: { enumerable: true },
  7572. signal: { enumerable: true }
  7573. });
  7574. /**
  7575. * Convert a Request to Node.js http request options.
  7576. *
  7577. * @param Request A Request instance
  7578. * @return Object The options object to be passed to http.request
  7579. */
  7580. function getNodeRequestOptions(request) {
  7581. const parsedURL = request[INTERNALS$2].parsedURL;
  7582. const headers = new Headers(request[INTERNALS$2].headers);
  7583. // fetch step 1.3
  7584. if (!headers.has('Accept')) {
  7585. headers.set('Accept', '*/*');
  7586. }
  7587. // Basic fetch
  7588. if (!parsedURL.protocol || !parsedURL.hostname) {
  7589. throw new TypeError('Only absolute URLs are supported');
  7590. }
  7591. if (!/^https?:$/.test(parsedURL.protocol)) {
  7592. throw new TypeError('Only HTTP(S) protocols are supported');
  7593. }
  7594. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7595. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7596. }
  7597. // HTTP-network-or-cache fetch steps 2.4-2.7
  7598. let contentLengthValue = null;
  7599. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7600. contentLengthValue = '0';
  7601. }
  7602. if (request.body != null) {
  7603. const totalBytes = getTotalBytes(request);
  7604. if (typeof totalBytes === 'number') {
  7605. contentLengthValue = String(totalBytes);
  7606. }
  7607. }
  7608. if (contentLengthValue) {
  7609. headers.set('Content-Length', contentLengthValue);
  7610. }
  7611. // HTTP-network-or-cache fetch step 2.11
  7612. if (!headers.has('User-Agent')) {
  7613. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7614. }
  7615. // HTTP-network-or-cache fetch step 2.15
  7616. if (request.compress && !headers.has('Accept-Encoding')) {
  7617. headers.set('Accept-Encoding', 'gzip,deflate');
  7618. }
  7619. let agent = request.agent;
  7620. if (typeof agent === 'function') {
  7621. agent = agent(parsedURL);
  7622. }
  7623. if (!headers.has('Connection') && !agent) {
  7624. headers.set('Connection', 'close');
  7625. }
  7626. // HTTP-network fetch step 4.2
  7627. // chunked encoding is handled by Node.js
  7628. return Object.assign({}, parsedURL, {
  7629. method: request.method,
  7630. headers: exportNodeCompatibleHeaders(headers),
  7631. agent
  7632. });
  7633. }
  7634. /**
  7635. * abort-error.js
  7636. *
  7637. * AbortError interface for cancelled requests
  7638. */
  7639. /**
  7640. * Create AbortError instance
  7641. *
  7642. * @param String message Error message for human
  7643. * @return AbortError
  7644. */
  7645. function AbortError(message) {
  7646. Error.call(this, message);
  7647. this.type = 'aborted';
  7648. this.message = message;
  7649. // hide custom error implementation details from end-users
  7650. Error.captureStackTrace(this, this.constructor);
  7651. }
  7652. AbortError.prototype = Object.create(Error.prototype);
  7653. AbortError.prototype.constructor = AbortError;
  7654. AbortError.prototype.name = 'AbortError';
  7655. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7656. const PassThrough$1 = Stream.PassThrough;
  7657. const resolve_url = Url.resolve;
  7658. /**
  7659. * Fetch function
  7660. *
  7661. * @param Mixed url Absolute url or Request instance
  7662. * @param Object opts Fetch options
  7663. * @return Promise
  7664. */
  7665. function fetch(url, opts) {
  7666. // allow custom promise
  7667. if (!fetch.Promise) {
  7668. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7669. }
  7670. Body.Promise = fetch.Promise;
  7671. // wrap http.request into fetch
  7672. return new fetch.Promise(function (resolve, reject) {
  7673. // build request object
  7674. const request = new Request(url, opts);
  7675. const options = getNodeRequestOptions(request);
  7676. const send = (options.protocol === 'https:' ? https : http).request;
  7677. const signal = request.signal;
  7678. let response = null;
  7679. const abort = function abort() {
  7680. let error = new AbortError('The user aborted a request.');
  7681. reject(error);
  7682. if (request.body && request.body instanceof Stream.Readable) {
  7683. request.body.destroy(error);
  7684. }
  7685. if (!response || !response.body) return;
  7686. response.body.emit('error', error);
  7687. };
  7688. if (signal && signal.aborted) {
  7689. abort();
  7690. return;
  7691. }
  7692. const abortAndFinalize = function abortAndFinalize() {
  7693. abort();
  7694. finalize();
  7695. };
  7696. // send request
  7697. const req = send(options);
  7698. let reqTimeout;
  7699. if (signal) {
  7700. signal.addEventListener('abort', abortAndFinalize);
  7701. }
  7702. function finalize() {
  7703. req.abort();
  7704. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7705. clearTimeout(reqTimeout);
  7706. }
  7707. if (request.timeout) {
  7708. req.once('socket', function (socket) {
  7709. reqTimeout = setTimeout(function () {
  7710. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7711. finalize();
  7712. }, request.timeout);
  7713. });
  7714. }
  7715. req.on('error', function (err) {
  7716. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7717. finalize();
  7718. });
  7719. req.on('response', function (res) {
  7720. clearTimeout(reqTimeout);
  7721. const headers = createHeadersLenient(res.headers);
  7722. // HTTP fetch step 5
  7723. if (fetch.isRedirect(res.statusCode)) {
  7724. // HTTP fetch step 5.2
  7725. const location = headers.get('Location');
  7726. // HTTP fetch step 5.3
  7727. const locationURL = location === null ? null : resolve_url(request.url, location);
  7728. // HTTP fetch step 5.5
  7729. switch (request.redirect) {
  7730. case 'error':
  7731. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7732. finalize();
  7733. return;
  7734. case 'manual':
  7735. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7736. if (locationURL !== null) {
  7737. // handle corrupted header
  7738. try {
  7739. headers.set('Location', locationURL);
  7740. } catch (err) {
  7741. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7742. reject(err);
  7743. }
  7744. }
  7745. break;
  7746. case 'follow':
  7747. // HTTP-redirect fetch step 2
  7748. if (locationURL === null) {
  7749. break;
  7750. }
  7751. // HTTP-redirect fetch step 5
  7752. if (request.counter >= request.follow) {
  7753. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7754. finalize();
  7755. return;
  7756. }
  7757. // HTTP-redirect fetch step 6 (counter increment)
  7758. // Create a new Request object.
  7759. const requestOpts = {
  7760. headers: new Headers(request.headers),
  7761. follow: request.follow,
  7762. counter: request.counter + 1,
  7763. agent: request.agent,
  7764. compress: request.compress,
  7765. method: request.method,
  7766. body: request.body,
  7767. signal: request.signal,
  7768. timeout: request.timeout
  7769. };
  7770. // HTTP-redirect fetch step 9
  7771. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7772. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7773. finalize();
  7774. return;
  7775. }
  7776. // HTTP-redirect fetch step 11
  7777. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7778. requestOpts.method = 'GET';
  7779. requestOpts.body = undefined;
  7780. requestOpts.headers.delete('content-length');
  7781. }
  7782. // HTTP-redirect fetch step 15
  7783. resolve(fetch(new Request(locationURL, requestOpts)));
  7784. finalize();
  7785. return;
  7786. }
  7787. }
  7788. // prepare response
  7789. res.once('end', function () {
  7790. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7791. });
  7792. let body = res.pipe(new PassThrough$1());
  7793. const response_options = {
  7794. url: request.url,
  7795. status: res.statusCode,
  7796. statusText: res.statusMessage,
  7797. headers: headers,
  7798. size: request.size,
  7799. timeout: request.timeout,
  7800. counter: request.counter
  7801. };
  7802. // HTTP-network fetch step 12.1.1.3
  7803. const codings = headers.get('Content-Encoding');
  7804. // HTTP-network fetch step 12.1.1.4: handle content codings
  7805. // in following scenarios we ignore compression support
  7806. // 1. compression support is disabled
  7807. // 2. HEAD request
  7808. // 3. no Content-Encoding header
  7809. // 4. no content response (204)
  7810. // 5. content not modified response (304)
  7811. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7812. response = new Response(body, response_options);
  7813. resolve(response);
  7814. return;
  7815. }
  7816. // For Node v6+
  7817. // Be less strict when decoding compressed responses, since sometimes
  7818. // servers send slightly invalid responses that are still accepted
  7819. // by common browsers.
  7820. // Always using Z_SYNC_FLUSH is what cURL does.
  7821. const zlibOptions = {
  7822. flush: zlib.Z_SYNC_FLUSH,
  7823. finishFlush: zlib.Z_SYNC_FLUSH
  7824. };
  7825. // for gzip
  7826. if (codings == 'gzip' || codings == 'x-gzip') {
  7827. body = body.pipe(zlib.createGunzip(zlibOptions));
  7828. response = new Response(body, response_options);
  7829. resolve(response);
  7830. return;
  7831. }
  7832. // for deflate
  7833. if (codings == 'deflate' || codings == 'x-deflate') {
  7834. // handle the infamous raw deflate response from old servers
  7835. // a hack for old IIS and Apache servers
  7836. const raw = res.pipe(new PassThrough$1());
  7837. raw.once('data', function (chunk) {
  7838. // see http://stackoverflow.com/questions/37519828
  7839. if ((chunk[0] & 0x0F) === 0x08) {
  7840. body = body.pipe(zlib.createInflate());
  7841. } else {
  7842. body = body.pipe(zlib.createInflateRaw());
  7843. }
  7844. response = new Response(body, response_options);
  7845. resolve(response);
  7846. });
  7847. return;
  7848. }
  7849. // for br
  7850. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7851. body = body.pipe(zlib.createBrotliDecompress());
  7852. response = new Response(body, response_options);
  7853. resolve(response);
  7854. return;
  7855. }
  7856. // otherwise, use response as-is
  7857. response = new Response(body, response_options);
  7858. resolve(response);
  7859. });
  7860. writeToStream(req, request);
  7861. });
  7862. }
  7863. /**
  7864. * Redirect code matching
  7865. *
  7866. * @param Number code Status code
  7867. * @return Boolean
  7868. */
  7869. fetch.isRedirect = function (code) {
  7870. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7871. };
  7872. // expose Promise
  7873. fetch.Promise = global.Promise;
  7874. module.exports = exports = fetch;
  7875. Object.defineProperty(exports, "__esModule", { value: true });
  7876. exports.default = exports;
  7877. exports.Headers = Headers;
  7878. exports.Request = Request;
  7879. exports.Response = Response;
  7880. exports.FetchError = FetchError;
  7881. /***/ }),
  7882. /***/ 462:
  7883. /***/ (function(module) {
  7884. "use strict";
  7885. // See http://www.robvanderwoude.com/escapechars.php
  7886. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7887. function escapeCommand(arg) {
  7888. // Escape meta chars
  7889. arg = arg.replace(metaCharsRegExp, '^$1');
  7890. return arg;
  7891. }
  7892. function escapeArgument(arg, doubleEscapeMetaChars) {
  7893. // Convert to string
  7894. arg = `${arg}`;
  7895. // Algorithm below is based on https://qntm.org/cmd
  7896. // Sequence of backslashes followed by a double quote:
  7897. // double up all the backslashes and escape the double quote
  7898. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7899. // Sequence of backslashes followed by the end of the string
  7900. // (which will become a double quote later):
  7901. // double up all the backslashes
  7902. arg = arg.replace(/(\\*)$/, '$1$1');
  7903. // All other backslashes occur literally
  7904. // Quote the whole thing:
  7905. arg = `"${arg}"`;
  7906. // Escape meta chars
  7907. arg = arg.replace(metaCharsRegExp, '^$1');
  7908. // Double escape meta chars if necessary
  7909. if (doubleEscapeMetaChars) {
  7910. arg = arg.replace(metaCharsRegExp, '^$1');
  7911. }
  7912. return arg;
  7913. }
  7914. module.exports.command = escapeCommand;
  7915. module.exports.argument = escapeArgument;
  7916. /***/ }),
  7917. /***/ 463:
  7918. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7919. "use strict";
  7920. Object.defineProperty(exports, '__esModule', { value: true });
  7921. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7922. var deprecation = __webpack_require__(692);
  7923. var once = _interopDefault(__webpack_require__(969));
  7924. const logOnce = once(deprecation => console.warn(deprecation));
  7925. /**
  7926. * Error with extra properties to help with debugging
  7927. */
  7928. class RequestError extends Error {
  7929. constructor(message, statusCode, options) {
  7930. super(message); // Maintains proper stack trace (only available on V8)
  7931. /* istanbul ignore next */
  7932. if (Error.captureStackTrace) {
  7933. Error.captureStackTrace(this, this.constructor);
  7934. }
  7935. this.name = "HttpError";
  7936. this.status = statusCode;
  7937. Object.defineProperty(this, "code", {
  7938. get() {
  7939. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7940. return statusCode;
  7941. }
  7942. });
  7943. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7944. const requestCopy = Object.assign({}, options.request);
  7945. if (options.request.headers.authorization) {
  7946. requestCopy.headers = Object.assign({}, options.request.headers, {
  7947. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7948. });
  7949. }
  7950. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7951. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7952. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7953. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7954. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7955. this.request = requestCopy;
  7956. }
  7957. }
  7958. exports.RequestError = RequestError;
  7959. //# sourceMappingURL=index.js.map
  7960. /***/ }),
  7961. /***/ 464:
  7962. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7963. "use strict";
  7964. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7965. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7966. return new (P || (P = Promise))(function (resolve, reject) {
  7967. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7968. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7969. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7970. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7971. });
  7972. };
  7973. var __importStar = (this && this.__importStar) || function (mod) {
  7974. if (mod && mod.__esModule) return mod;
  7975. var result = {};
  7976. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7977. result["default"] = mod;
  7978. return result;
  7979. };
  7980. var __importDefault = (this && this.__importDefault) || function (mod) {
  7981. return (mod && mod.__esModule) ? mod : { "default": mod };
  7982. };
  7983. Object.defineProperty(exports, "__esModule", { value: true });
  7984. const assert = __importStar(__webpack_require__(357));
  7985. const core = __importStar(__webpack_require__(470));
  7986. const fs = __importStar(__webpack_require__(747));
  7987. const github = __importStar(__webpack_require__(469));
  7988. const io = __importStar(__webpack_require__(1));
  7989. const path = __importStar(__webpack_require__(622));
  7990. const retryHelper = __importStar(__webpack_require__(587));
  7991. const toolCache = __importStar(__webpack_require__(533));
  7992. const v4_1 = __importDefault(__webpack_require__(826));
  7993. const IS_WINDOWS = process.platform === 'win32';
  7994. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  7995. return __awaiter(this, void 0, void 0, function* () {
  7996. // Download the archive
  7997. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7998. core.info('Downloading the archive');
  7999. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8000. }));
  8001. // Write archive to disk
  8002. core.info('Writing archive to disk');
  8003. const uniqueId = v4_1.default();
  8004. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8005. yield fs.promises.writeFile(archivePath, archiveData);
  8006. archiveData = Buffer.from(''); // Free memory
  8007. // Extract archive
  8008. core.info('Extracting the archive');
  8009. const extractPath = path.join(repositoryPath, uniqueId);
  8010. yield io.mkdirP(extractPath);
  8011. if (IS_WINDOWS) {
  8012. yield toolCache.extractZip(archivePath, extractPath);
  8013. }
  8014. else {
  8015. yield toolCache.extractTar(archivePath, extractPath);
  8016. }
  8017. io.rmRF(archivePath);
  8018. // Determine the path of the repository content. The archive contains
  8019. // a top-level folder and the repository content is inside.
  8020. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8021. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8022. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8023. core.info(`Resolved version ${archiveVersion}`);
  8024. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8025. // Move the files
  8026. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8027. const sourcePath = path.join(tempRepositoryPath, fileName);
  8028. const targetPath = path.join(repositoryPath, fileName);
  8029. if (IS_WINDOWS) {
  8030. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8031. }
  8032. else {
  8033. yield io.mv(sourcePath, targetPath);
  8034. }
  8035. }
  8036. io.rmRF(extractPath);
  8037. });
  8038. }
  8039. exports.downloadRepository = downloadRepository;
  8040. function downloadArchive(authToken, owner, repo, ref, commit) {
  8041. return __awaiter(this, void 0, void 0, function* () {
  8042. const octokit = new github.GitHub(authToken);
  8043. const params = {
  8044. owner: owner,
  8045. repo: repo,
  8046. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8047. ref: commit || ref
  8048. };
  8049. const response = yield octokit.repos.getArchiveLink(params);
  8050. if (response.status != 200) {
  8051. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8052. }
  8053. return Buffer.from(response.data); // response.data is ArrayBuffer
  8054. });
  8055. }
  8056. /***/ }),
  8057. /***/ 469:
  8058. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8059. "use strict";
  8060. var __importDefault = (this && this.__importDefault) || function (mod) {
  8061. return (mod && mod.__esModule) ? mod : { "default": mod };
  8062. };
  8063. var __importStar = (this && this.__importStar) || function (mod) {
  8064. if (mod && mod.__esModule) return mod;
  8065. var result = {};
  8066. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8067. result["default"] = mod;
  8068. return result;
  8069. };
  8070. Object.defineProperty(exports, "__esModule", { value: true });
  8071. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8072. const graphql_1 = __webpack_require__(898);
  8073. const rest_1 = __importDefault(__webpack_require__(0));
  8074. const Context = __importStar(__webpack_require__(262));
  8075. const httpClient = __importStar(__webpack_require__(539));
  8076. // We need this in order to extend Octokit
  8077. rest_1.default.prototype = new rest_1.default();
  8078. exports.context = new Context.Context();
  8079. class GitHub extends rest_1.default {
  8080. constructor(token, opts) {
  8081. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8082. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8083. }
  8084. /**
  8085. * Disambiguates the constructor overload parameters
  8086. */
  8087. static disambiguate(token, opts) {
  8088. return [
  8089. typeof token === 'string' ? token : '',
  8090. typeof token === 'object' ? token : opts || {}
  8091. ];
  8092. }
  8093. static getOctokitOptions(args) {
  8094. const token = args[0];
  8095. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8096. // Auth
  8097. const auth = GitHub.getAuthString(token, options);
  8098. if (auth) {
  8099. options.auth = auth;
  8100. }
  8101. // Proxy
  8102. const agent = GitHub.getProxyAgent(options);
  8103. if (agent) {
  8104. // Shallow clone - don't mutate the object provided by the caller
  8105. options.request = options.request ? Object.assign({}, options.request) : {};
  8106. // Set the agent
  8107. options.request.agent = agent;
  8108. }
  8109. return options;
  8110. }
  8111. static getGraphQL(args) {
  8112. const defaults = {};
  8113. const token = args[0];
  8114. const options = args[1];
  8115. // Authorization
  8116. const auth = this.getAuthString(token, options);
  8117. if (auth) {
  8118. defaults.headers = {
  8119. authorization: auth
  8120. };
  8121. }
  8122. // Proxy
  8123. const agent = GitHub.getProxyAgent(options);
  8124. if (agent) {
  8125. defaults.request = { agent };
  8126. }
  8127. return graphql_1.graphql.defaults(defaults);
  8128. }
  8129. static getAuthString(token, options) {
  8130. // Validate args
  8131. if (!token && !options.auth) {
  8132. throw new Error('Parameter token or opts.auth is required');
  8133. }
  8134. else if (token && options.auth) {
  8135. throw new Error('Parameters token and opts.auth may not both be specified');
  8136. }
  8137. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8138. }
  8139. static getProxyAgent(options) {
  8140. var _a;
  8141. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8142. const serverUrl = 'https://api.github.com';
  8143. if (httpClient.getProxyUrl(serverUrl)) {
  8144. const hc = new httpClient.HttpClient();
  8145. return hc.getAgent(serverUrl);
  8146. }
  8147. }
  8148. return undefined;
  8149. }
  8150. }
  8151. exports.GitHub = GitHub;
  8152. //# sourceMappingURL=github.js.map
  8153. /***/ }),
  8154. /***/ 470:
  8155. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8156. "use strict";
  8157. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8158. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8159. return new (P || (P = Promise))(function (resolve, reject) {
  8160. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8161. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8162. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8163. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8164. });
  8165. };
  8166. Object.defineProperty(exports, "__esModule", { value: true });
  8167. const command_1 = __webpack_require__(431);
  8168. const os = __webpack_require__(87);
  8169. const path = __webpack_require__(622);
  8170. /**
  8171. * The code to exit an action
  8172. */
  8173. var ExitCode;
  8174. (function (ExitCode) {
  8175. /**
  8176. * A code indicating that the action was successful
  8177. */
  8178. ExitCode[ExitCode["Success"] = 0] = "Success";
  8179. /**
  8180. * A code indicating that the action was a failure
  8181. */
  8182. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8183. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8184. //-----------------------------------------------------------------------
  8185. // Variables
  8186. //-----------------------------------------------------------------------
  8187. /**
  8188. * Sets env variable for this action and future actions in the job
  8189. * @param name the name of the variable to set
  8190. * @param val the value of the variable
  8191. */
  8192. function exportVariable(name, val) {
  8193. process.env[name] = val;
  8194. command_1.issueCommand('set-env', { name }, val);
  8195. }
  8196. exports.exportVariable = exportVariable;
  8197. /**
  8198. * Registers a secret which will get masked from logs
  8199. * @param secret value of the secret
  8200. */
  8201. function setSecret(secret) {
  8202. command_1.issueCommand('add-mask', {}, secret);
  8203. }
  8204. exports.setSecret = setSecret;
  8205. /**
  8206. * Prepends inputPath to the PATH (for this action and future actions)
  8207. * @param inputPath
  8208. */
  8209. function addPath(inputPath) {
  8210. command_1.issueCommand('add-path', {}, inputPath);
  8211. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8212. }
  8213. exports.addPath = addPath;
  8214. /**
  8215. * Gets the value of an input. The value is also trimmed.
  8216. *
  8217. * @param name name of the input to get
  8218. * @param options optional. See InputOptions.
  8219. * @returns string
  8220. */
  8221. function getInput(name, options) {
  8222. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8223. if (options && options.required && !val) {
  8224. throw new Error(`Input required and not supplied: ${name}`);
  8225. }
  8226. return val.trim();
  8227. }
  8228. exports.getInput = getInput;
  8229. /**
  8230. * Sets the value of an output.
  8231. *
  8232. * @param name name of the output to set
  8233. * @param value value to store
  8234. */
  8235. function setOutput(name, value) {
  8236. command_1.issueCommand('set-output', { name }, value);
  8237. }
  8238. exports.setOutput = setOutput;
  8239. //-----------------------------------------------------------------------
  8240. // Results
  8241. //-----------------------------------------------------------------------
  8242. /**
  8243. * Sets the action status to failed.
  8244. * When the action exits it will be with an exit code of 1
  8245. * @param message add error issue message
  8246. */
  8247. function setFailed(message) {
  8248. process.exitCode = ExitCode.Failure;
  8249. error(message);
  8250. }
  8251. exports.setFailed = setFailed;
  8252. //-----------------------------------------------------------------------
  8253. // Logging Commands
  8254. //-----------------------------------------------------------------------
  8255. /**
  8256. * Writes debug message to user log
  8257. * @param message debug message
  8258. */
  8259. function debug(message) {
  8260. command_1.issueCommand('debug', {}, message);
  8261. }
  8262. exports.debug = debug;
  8263. /**
  8264. * Adds an error issue
  8265. * @param message error issue message
  8266. */
  8267. function error(message) {
  8268. command_1.issue('error', message);
  8269. }
  8270. exports.error = error;
  8271. /**
  8272. * Adds an warning issue
  8273. * @param message warning issue message
  8274. */
  8275. function warning(message) {
  8276. command_1.issue('warning', message);
  8277. }
  8278. exports.warning = warning;
  8279. /**
  8280. * Writes info to log with console.log.
  8281. * @param message info message
  8282. */
  8283. function info(message) {
  8284. process.stdout.write(message + os.EOL);
  8285. }
  8286. exports.info = info;
  8287. /**
  8288. * Begin an output group.
  8289. *
  8290. * Output until the next `groupEnd` will be foldable in this group
  8291. *
  8292. * @param name The name of the output group
  8293. */
  8294. function startGroup(name) {
  8295. command_1.issue('group', name);
  8296. }
  8297. exports.startGroup = startGroup;
  8298. /**
  8299. * End an output group.
  8300. */
  8301. function endGroup() {
  8302. command_1.issue('endgroup');
  8303. }
  8304. exports.endGroup = endGroup;
  8305. /**
  8306. * Wrap an asynchronous function call in a group.
  8307. *
  8308. * Returns the same type as the function itself.
  8309. *
  8310. * @param name The name of the group
  8311. * @param fn The function to wrap in the group
  8312. */
  8313. function group(name, fn) {
  8314. return __awaiter(this, void 0, void 0, function* () {
  8315. startGroup(name);
  8316. let result;
  8317. try {
  8318. result = yield fn();
  8319. }
  8320. finally {
  8321. endGroup();
  8322. }
  8323. return result;
  8324. });
  8325. }
  8326. exports.group = group;
  8327. //# sourceMappingURL=core.js.map
  8328. /***/ }),
  8329. /***/ 471:
  8330. /***/ (function(module, __unusedexports, __webpack_require__) {
  8331. module.exports = authenticationBeforeRequest;
  8332. const btoa = __webpack_require__(675);
  8333. const uniq = __webpack_require__(126);
  8334. function authenticationBeforeRequest(state, options) {
  8335. if (!state.auth.type) {
  8336. return;
  8337. }
  8338. if (state.auth.type === "basic") {
  8339. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8340. options.headers.authorization = `Basic ${hash}`;
  8341. return;
  8342. }
  8343. if (state.auth.type === "token") {
  8344. options.headers.authorization = `token ${state.auth.token}`;
  8345. return;
  8346. }
  8347. if (state.auth.type === "app") {
  8348. options.headers.authorization = `Bearer ${state.auth.token}`;
  8349. const acceptHeaders = options.headers.accept
  8350. .split(",")
  8351. .concat("application/vnd.github.machine-man-preview+json");
  8352. options.headers.accept = uniq(acceptHeaders)
  8353. .filter(Boolean)
  8354. .join(",");
  8355. return;
  8356. }
  8357. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8358. if (state.auth.token) {
  8359. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8360. return;
  8361. }
  8362. const key = encodeURIComponent(state.auth.key);
  8363. const secret = encodeURIComponent(state.auth.secret);
  8364. options.url += `client_id=${key}&client_secret=${secret}`;
  8365. }
  8366. /***/ }),
  8367. /***/ 489:
  8368. /***/ (function(module, __unusedexports, __webpack_require__) {
  8369. "use strict";
  8370. const path = __webpack_require__(622);
  8371. const which = __webpack_require__(814);
  8372. const pathKey = __webpack_require__(39)();
  8373. function resolveCommandAttempt(parsed, withoutPathExt) {
  8374. const cwd = process.cwd();
  8375. const hasCustomCwd = parsed.options.cwd != null;
  8376. // If a custom `cwd` was specified, we need to change the process cwd
  8377. // because `which` will do stat calls but does not support a custom cwd
  8378. if (hasCustomCwd) {
  8379. try {
  8380. process.chdir(parsed.options.cwd);
  8381. } catch (err) {
  8382. /* Empty */
  8383. }
  8384. }
  8385. let resolved;
  8386. try {
  8387. resolved = which.sync(parsed.command, {
  8388. path: (parsed.options.env || process.env)[pathKey],
  8389. pathExt: withoutPathExt ? path.delimiter : undefined,
  8390. });
  8391. } catch (e) {
  8392. /* Empty */
  8393. } finally {
  8394. process.chdir(cwd);
  8395. }
  8396. // If we successfully resolved, ensure that an absolute path is returned
  8397. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8398. if (resolved) {
  8399. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8400. }
  8401. return resolved;
  8402. }
  8403. function resolveCommand(parsed) {
  8404. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8405. }
  8406. module.exports = resolveCommand;
  8407. /***/ }),
  8408. /***/ 510:
  8409. /***/ (function(module) {
  8410. module.exports = addHook
  8411. function addHook (state, kind, name, hook) {
  8412. var orig = hook
  8413. if (!state.registry[name]) {
  8414. state.registry[name] = []
  8415. }
  8416. if (kind === 'before') {
  8417. hook = function (method, options) {
  8418. return Promise.resolve()
  8419. .then(orig.bind(null, options))
  8420. .then(method.bind(null, options))
  8421. }
  8422. }
  8423. if (kind === 'after') {
  8424. hook = function (method, options) {
  8425. var result
  8426. return Promise.resolve()
  8427. .then(method.bind(null, options))
  8428. .then(function (result_) {
  8429. result = result_
  8430. return orig(result, options)
  8431. })
  8432. .then(function () {
  8433. return result
  8434. })
  8435. }
  8436. }
  8437. if (kind === 'error') {
  8438. hook = function (method, options) {
  8439. return Promise.resolve()
  8440. .then(method.bind(null, options))
  8441. .catch(function (error) {
  8442. return orig(error, options)
  8443. })
  8444. }
  8445. }
  8446. state.registry[name].push({
  8447. hook: hook,
  8448. orig: orig
  8449. })
  8450. }
  8451. /***/ }),
  8452. /***/ 523:
  8453. /***/ (function(module, __unusedexports, __webpack_require__) {
  8454. var register = __webpack_require__(363)
  8455. var addHook = __webpack_require__(510)
  8456. var removeHook = __webpack_require__(763)
  8457. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8458. var bind = Function.bind
  8459. var bindable = bind.bind(bind)
  8460. function bindApi (hook, state, name) {
  8461. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8462. hook.api = { remove: removeHookRef }
  8463. hook.remove = removeHookRef
  8464. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8465. var args = name ? [state, kind, name] : [state, kind]
  8466. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8467. })
  8468. }
  8469. function HookSingular () {
  8470. var singularHookName = 'h'
  8471. var singularHookState = {
  8472. registry: {}
  8473. }
  8474. var singularHook = register.bind(null, singularHookState, singularHookName)
  8475. bindApi(singularHook, singularHookState, singularHookName)
  8476. return singularHook
  8477. }
  8478. function HookCollection () {
  8479. var state = {
  8480. registry: {}
  8481. }
  8482. var hook = register.bind(null, state)
  8483. bindApi(hook, state)
  8484. return hook
  8485. }
  8486. var collectionHookDeprecationMessageDisplayed = false
  8487. function Hook () {
  8488. if (!collectionHookDeprecationMessageDisplayed) {
  8489. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8490. collectionHookDeprecationMessageDisplayed = true
  8491. }
  8492. return HookCollection()
  8493. }
  8494. Hook.Singular = HookSingular.bind()
  8495. Hook.Collection = HookCollection.bind()
  8496. module.exports = Hook
  8497. // expose constructors as a named property for TypeScript
  8498. module.exports.Hook = Hook
  8499. module.exports.Singular = Hook.Singular
  8500. module.exports.Collection = Hook.Collection
  8501. /***/ }),
  8502. /***/ 528:
  8503. /***/ (function(__unusedmodule, exports) {
  8504. "use strict";
  8505. Object.defineProperty(exports, "__esModule", { value: true });
  8506. function escape(value) {
  8507. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8508. return `\\${x}`;
  8509. });
  8510. }
  8511. exports.escape = escape;
  8512. /***/ }),
  8513. /***/ 529:
  8514. /***/ (function(module, __unusedexports, __webpack_require__) {
  8515. const factory = __webpack_require__(47);
  8516. module.exports = factory();
  8517. /***/ }),
  8518. /***/ 533:
  8519. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8520. "use strict";
  8521. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8522. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8523. return new (P || (P = Promise))(function (resolve, reject) {
  8524. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8525. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8526. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8527. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8528. });
  8529. };
  8530. Object.defineProperty(exports, "__esModule", { value: true });
  8531. const core = __webpack_require__(470);
  8532. const io = __webpack_require__(1);
  8533. const fs = __webpack_require__(747);
  8534. const os = __webpack_require__(87);
  8535. const path = __webpack_require__(622);
  8536. const httpm = __webpack_require__(874);
  8537. const semver = __webpack_require__(656);
  8538. const uuidV4 = __webpack_require__(826);
  8539. const exec_1 = __webpack_require__(986);
  8540. const assert_1 = __webpack_require__(357);
  8541. class HTTPError extends Error {
  8542. constructor(httpStatusCode) {
  8543. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8544. this.httpStatusCode = httpStatusCode;
  8545. Object.setPrototypeOf(this, new.target.prototype);
  8546. }
  8547. }
  8548. exports.HTTPError = HTTPError;
  8549. const IS_WINDOWS = process.platform === 'win32';
  8550. const userAgent = 'actions/tool-cache';
  8551. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8552. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8553. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8554. // If directories not found, place them in common temp locations
  8555. if (!tempDirectory || !cacheRoot) {
  8556. let baseLocation;
  8557. if (IS_WINDOWS) {
  8558. // On windows use the USERPROFILE env variable
  8559. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8560. }
  8561. else {
  8562. if (process.platform === 'darwin') {
  8563. baseLocation = '/Users';
  8564. }
  8565. else {
  8566. baseLocation = '/home';
  8567. }
  8568. }
  8569. if (!tempDirectory) {
  8570. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8571. }
  8572. if (!cacheRoot) {
  8573. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8574. }
  8575. }
  8576. /**
  8577. * Download a tool from an url and stream it into a file
  8578. *
  8579. * @param url url of tool to download
  8580. * @returns path to downloaded tool
  8581. */
  8582. function downloadTool(url) {
  8583. return __awaiter(this, void 0, void 0, function* () {
  8584. // Wrap in a promise so that we can resolve from within stream callbacks
  8585. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8586. try {
  8587. const http = new httpm.HttpClient(userAgent, [], {
  8588. allowRetries: true,
  8589. maxRetries: 3
  8590. });
  8591. const destPath = path.join(tempDirectory, uuidV4());
  8592. yield io.mkdirP(tempDirectory);
  8593. core.debug(`Downloading ${url}`);
  8594. core.debug(`Downloading ${destPath}`);
  8595. if (fs.existsSync(destPath)) {
  8596. throw new Error(`Destination file path ${destPath} already exists`);
  8597. }
  8598. const response = yield http.get(url);
  8599. if (response.message.statusCode !== 200) {
  8600. const err = new HTTPError(response.message.statusCode);
  8601. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8602. throw err;
  8603. }
  8604. const file = fs.createWriteStream(destPath);
  8605. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8606. try {
  8607. const stream = response.message.pipe(file);
  8608. stream.on('close', () => {
  8609. core.debug('download complete');
  8610. resolve(destPath);
  8611. });
  8612. }
  8613. catch (err) {
  8614. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8615. reject(err);
  8616. }
  8617. }));
  8618. file.on('error', err => {
  8619. file.end();
  8620. reject(err);
  8621. });
  8622. }
  8623. catch (err) {
  8624. reject(err);
  8625. }
  8626. }));
  8627. });
  8628. }
  8629. exports.downloadTool = downloadTool;
  8630. /**
  8631. * Extract a .7z file
  8632. *
  8633. * @param file path to the .7z file
  8634. * @param dest destination directory. Optional.
  8635. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8636. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8637. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8638. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8639. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8640. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8641. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8642. * to 7zr.exe can be pass to this function.
  8643. * @returns path to the destination directory
  8644. */
  8645. function extract7z(file, dest, _7zPath) {
  8646. return __awaiter(this, void 0, void 0, function* () {
  8647. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8648. assert_1.ok(file, 'parameter "file" is required');
  8649. dest = dest || (yield _createExtractFolder(dest));
  8650. const originalCwd = process.cwd();
  8651. process.chdir(dest);
  8652. if (_7zPath) {
  8653. try {
  8654. const args = [
  8655. 'x',
  8656. '-bb1',
  8657. '-bd',
  8658. '-sccUTF-8',
  8659. file
  8660. ];
  8661. const options = {
  8662. silent: true
  8663. };
  8664. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8665. }
  8666. finally {
  8667. process.chdir(originalCwd);
  8668. }
  8669. }
  8670. else {
  8671. const escapedScript = path
  8672. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8673. .replace(/'/g, "''")
  8674. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8675. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8676. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8677. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8678. const args = [
  8679. '-NoLogo',
  8680. '-Sta',
  8681. '-NoProfile',
  8682. '-NonInteractive',
  8683. '-ExecutionPolicy',
  8684. 'Unrestricted',
  8685. '-Command',
  8686. command
  8687. ];
  8688. const options = {
  8689. silent: true
  8690. };
  8691. try {
  8692. const powershellPath = yield io.which('powershell', true);
  8693. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8694. }
  8695. finally {
  8696. process.chdir(originalCwd);
  8697. }
  8698. }
  8699. return dest;
  8700. });
  8701. }
  8702. exports.extract7z = extract7z;
  8703. /**
  8704. * Extract a tar
  8705. *
  8706. * @param file path to the tar
  8707. * @param dest destination directory. Optional.
  8708. * @param flags flags for the tar. Optional.
  8709. * @returns path to the destination directory
  8710. */
  8711. function extractTar(file, dest, flags = 'xz') {
  8712. return __awaiter(this, void 0, void 0, function* () {
  8713. if (!file) {
  8714. throw new Error("parameter 'file' is required");
  8715. }
  8716. dest = dest || (yield _createExtractFolder(dest));
  8717. const tarPath = yield io.which('tar', true);
  8718. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8719. return dest;
  8720. });
  8721. }
  8722. exports.extractTar = extractTar;
  8723. /**
  8724. * Extract a zip
  8725. *
  8726. * @param file path to the zip
  8727. * @param dest destination directory. Optional.
  8728. * @returns path to the destination directory
  8729. */
  8730. function extractZip(file, dest) {
  8731. return __awaiter(this, void 0, void 0, function* () {
  8732. if (!file) {
  8733. throw new Error("parameter 'file' is required");
  8734. }
  8735. dest = dest || (yield _createExtractFolder(dest));
  8736. if (IS_WINDOWS) {
  8737. yield extractZipWin(file, dest);
  8738. }
  8739. else {
  8740. yield extractZipNix(file, dest);
  8741. }
  8742. return dest;
  8743. });
  8744. }
  8745. exports.extractZip = extractZip;
  8746. function extractZipWin(file, dest) {
  8747. return __awaiter(this, void 0, void 0, function* () {
  8748. // build the powershell command
  8749. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8750. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8751. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8752. // run powershell
  8753. const powershellPath = yield io.which('powershell');
  8754. const args = [
  8755. '-NoLogo',
  8756. '-Sta',
  8757. '-NoProfile',
  8758. '-NonInteractive',
  8759. '-ExecutionPolicy',
  8760. 'Unrestricted',
  8761. '-Command',
  8762. command
  8763. ];
  8764. yield exec_1.exec(`"${powershellPath}"`, args);
  8765. });
  8766. }
  8767. function extractZipNix(file, dest) {
  8768. return __awaiter(this, void 0, void 0, function* () {
  8769. const unzipPath = yield io.which('unzip');
  8770. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8771. });
  8772. }
  8773. /**
  8774. * Caches a directory and installs it into the tool cacheDir
  8775. *
  8776. * @param sourceDir the directory to cache into tools
  8777. * @param tool tool name
  8778. * @param version version of the tool. semver format
  8779. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8780. */
  8781. function cacheDir(sourceDir, tool, version, arch) {
  8782. return __awaiter(this, void 0, void 0, function* () {
  8783. version = semver.clean(version) || version;
  8784. arch = arch || os.arch();
  8785. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8786. core.debug(`source dir: ${sourceDir}`);
  8787. if (!fs.statSync(sourceDir).isDirectory()) {
  8788. throw new Error('sourceDir is not a directory');
  8789. }
  8790. // Create the tool dir
  8791. const destPath = yield _createToolPath(tool, version, arch);
  8792. // copy each child item. do not move. move can fail on Windows
  8793. // due to anti-virus software having an open handle on a file.
  8794. for (const itemName of fs.readdirSync(sourceDir)) {
  8795. const s = path.join(sourceDir, itemName);
  8796. yield io.cp(s, destPath, { recursive: true });
  8797. }
  8798. // write .complete
  8799. _completeToolPath(tool, version, arch);
  8800. return destPath;
  8801. });
  8802. }
  8803. exports.cacheDir = cacheDir;
  8804. /**
  8805. * Caches a downloaded file (GUID) and installs it
  8806. * into the tool cache with a given targetName
  8807. *
  8808. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8809. * @param targetFile the name of the file name in the tools directory
  8810. * @param tool tool name
  8811. * @param version version of the tool. semver format
  8812. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8813. */
  8814. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8815. return __awaiter(this, void 0, void 0, function* () {
  8816. version = semver.clean(version) || version;
  8817. arch = arch || os.arch();
  8818. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8819. core.debug(`source file: ${sourceFile}`);
  8820. if (!fs.statSync(sourceFile).isFile()) {
  8821. throw new Error('sourceFile is not a file');
  8822. }
  8823. // create the tool dir
  8824. const destFolder = yield _createToolPath(tool, version, arch);
  8825. // copy instead of move. move can fail on Windows due to
  8826. // anti-virus software having an open handle on a file.
  8827. const destPath = path.join(destFolder, targetFile);
  8828. core.debug(`destination file ${destPath}`);
  8829. yield io.cp(sourceFile, destPath);
  8830. // write .complete
  8831. _completeToolPath(tool, version, arch);
  8832. return destFolder;
  8833. });
  8834. }
  8835. exports.cacheFile = cacheFile;
  8836. /**
  8837. * Finds the path to a tool version in the local installed tool cache
  8838. *
  8839. * @param toolName name of the tool
  8840. * @param versionSpec version of the tool
  8841. * @param arch optional arch. defaults to arch of computer
  8842. */
  8843. function find(toolName, versionSpec, arch) {
  8844. if (!toolName) {
  8845. throw new Error('toolName parameter is required');
  8846. }
  8847. if (!versionSpec) {
  8848. throw new Error('versionSpec parameter is required');
  8849. }
  8850. arch = arch || os.arch();
  8851. // attempt to resolve an explicit version
  8852. if (!_isExplicitVersion(versionSpec)) {
  8853. const localVersions = findAllVersions(toolName, arch);
  8854. const match = _evaluateVersions(localVersions, versionSpec);
  8855. versionSpec = match;
  8856. }
  8857. // check for the explicit version in the cache
  8858. let toolPath = '';
  8859. if (versionSpec) {
  8860. versionSpec = semver.clean(versionSpec) || '';
  8861. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8862. core.debug(`checking cache: ${cachePath}`);
  8863. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8864. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8865. toolPath = cachePath;
  8866. }
  8867. else {
  8868. core.debug('not found');
  8869. }
  8870. }
  8871. return toolPath;
  8872. }
  8873. exports.find = find;
  8874. /**
  8875. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8876. *
  8877. * @param toolName name of the tool
  8878. * @param arch optional arch. defaults to arch of computer
  8879. */
  8880. function findAllVersions(toolName, arch) {
  8881. const versions = [];
  8882. arch = arch || os.arch();
  8883. const toolPath = path.join(cacheRoot, toolName);
  8884. if (fs.existsSync(toolPath)) {
  8885. const children = fs.readdirSync(toolPath);
  8886. for (const child of children) {
  8887. if (_isExplicitVersion(child)) {
  8888. const fullPath = path.join(toolPath, child, arch || '');
  8889. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8890. versions.push(child);
  8891. }
  8892. }
  8893. }
  8894. }
  8895. return versions;
  8896. }
  8897. exports.findAllVersions = findAllVersions;
  8898. function _createExtractFolder(dest) {
  8899. return __awaiter(this, void 0, void 0, function* () {
  8900. if (!dest) {
  8901. // create a temp dir
  8902. dest = path.join(tempDirectory, uuidV4());
  8903. }
  8904. yield io.mkdirP(dest);
  8905. return dest;
  8906. });
  8907. }
  8908. function _createToolPath(tool, version, arch) {
  8909. return __awaiter(this, void 0, void 0, function* () {
  8910. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8911. core.debug(`destination ${folderPath}`);
  8912. const markerPath = `${folderPath}.complete`;
  8913. yield io.rmRF(folderPath);
  8914. yield io.rmRF(markerPath);
  8915. yield io.mkdirP(folderPath);
  8916. return folderPath;
  8917. });
  8918. }
  8919. function _completeToolPath(tool, version, arch) {
  8920. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8921. const markerPath = `${folderPath}.complete`;
  8922. fs.writeFileSync(markerPath, '');
  8923. core.debug('finished caching tool');
  8924. }
  8925. function _isExplicitVersion(versionSpec) {
  8926. const c = semver.clean(versionSpec) || '';
  8927. core.debug(`isExplicit: ${c}`);
  8928. const valid = semver.valid(c) != null;
  8929. core.debug(`explicit? ${valid}`);
  8930. return valid;
  8931. }
  8932. function _evaluateVersions(versions, versionSpec) {
  8933. let version = '';
  8934. core.debug(`evaluating ${versions.length} versions`);
  8935. versions = versions.sort((a, b) => {
  8936. if (semver.gt(a, b)) {
  8937. return 1;
  8938. }
  8939. return -1;
  8940. });
  8941. for (let i = versions.length - 1; i >= 0; i--) {
  8942. const potential = versions[i];
  8943. const satisfied = semver.satisfies(potential, versionSpec);
  8944. if (satisfied) {
  8945. version = potential;
  8946. break;
  8947. }
  8948. }
  8949. if (version) {
  8950. core.debug(`matched: ${version}`);
  8951. }
  8952. else {
  8953. core.debug('match not found');
  8954. }
  8955. return version;
  8956. }
  8957. //# sourceMappingURL=tool-cache.js.map
  8958. /***/ }),
  8959. /***/ 536:
  8960. /***/ (function(module, __unusedexports, __webpack_require__) {
  8961. module.exports = hasFirstPage
  8962. const deprecate = __webpack_require__(370)
  8963. const getPageLinks = __webpack_require__(577)
  8964. function hasFirstPage (link) {
  8965. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8966. return getPageLinks(link).first
  8967. }
  8968. /***/ }),
  8969. /***/ 539:
  8970. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8971. "use strict";
  8972. Object.defineProperty(exports, "__esModule", { value: true });
  8973. const url = __webpack_require__(835);
  8974. const http = __webpack_require__(605);
  8975. const https = __webpack_require__(211);
  8976. const pm = __webpack_require__(950);
  8977. let tunnel;
  8978. var HttpCodes;
  8979. (function (HttpCodes) {
  8980. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  8981. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  8982. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  8983. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  8984. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  8985. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  8986. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  8987. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  8988. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  8989. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  8990. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  8991. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  8992. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  8993. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  8994. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  8995. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  8996. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  8997. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  8998. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  8999. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9000. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9001. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9002. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9003. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9004. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9005. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9006. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9007. /**
  9008. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9009. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9010. */
  9011. function getProxyUrl(serverUrl) {
  9012. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9013. return proxyUrl ? proxyUrl.href : '';
  9014. }
  9015. exports.getProxyUrl = getProxyUrl;
  9016. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  9017. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  9018. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9019. const ExponentialBackoffCeiling = 10;
  9020. const ExponentialBackoffTimeSlice = 5;
  9021. class HttpClientResponse {
  9022. constructor(message) {
  9023. this.message = message;
  9024. }
  9025. readBody() {
  9026. return new Promise(async (resolve, reject) => {
  9027. let output = Buffer.alloc(0);
  9028. this.message.on('data', (chunk) => {
  9029. output = Buffer.concat([output, chunk]);
  9030. });
  9031. this.message.on('end', () => {
  9032. resolve(output.toString());
  9033. });
  9034. });
  9035. }
  9036. }
  9037. exports.HttpClientResponse = HttpClientResponse;
  9038. function isHttps(requestUrl) {
  9039. let parsedUrl = url.parse(requestUrl);
  9040. return parsedUrl.protocol === 'https:';
  9041. }
  9042. exports.isHttps = isHttps;
  9043. class HttpClient {
  9044. constructor(userAgent, handlers, requestOptions) {
  9045. this._ignoreSslError = false;
  9046. this._allowRedirects = true;
  9047. this._allowRedirectDowngrade = false;
  9048. this._maxRedirects = 50;
  9049. this._allowRetries = false;
  9050. this._maxRetries = 1;
  9051. this._keepAlive = false;
  9052. this._disposed = false;
  9053. this.userAgent = userAgent;
  9054. this.handlers = handlers || [];
  9055. this.requestOptions = requestOptions;
  9056. if (requestOptions) {
  9057. if (requestOptions.ignoreSslError != null) {
  9058. this._ignoreSslError = requestOptions.ignoreSslError;
  9059. }
  9060. this._socketTimeout = requestOptions.socketTimeout;
  9061. if (requestOptions.allowRedirects != null) {
  9062. this._allowRedirects = requestOptions.allowRedirects;
  9063. }
  9064. if (requestOptions.allowRedirectDowngrade != null) {
  9065. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9066. }
  9067. if (requestOptions.maxRedirects != null) {
  9068. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9069. }
  9070. if (requestOptions.keepAlive != null) {
  9071. this._keepAlive = requestOptions.keepAlive;
  9072. }
  9073. if (requestOptions.allowRetries != null) {
  9074. this._allowRetries = requestOptions.allowRetries;
  9075. }
  9076. if (requestOptions.maxRetries != null) {
  9077. this._maxRetries = requestOptions.maxRetries;
  9078. }
  9079. }
  9080. }
  9081. options(requestUrl, additionalHeaders) {
  9082. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9083. }
  9084. get(requestUrl, additionalHeaders) {
  9085. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9086. }
  9087. del(requestUrl, additionalHeaders) {
  9088. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9089. }
  9090. post(requestUrl, data, additionalHeaders) {
  9091. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9092. }
  9093. patch(requestUrl, data, additionalHeaders) {
  9094. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9095. }
  9096. put(requestUrl, data, additionalHeaders) {
  9097. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9098. }
  9099. head(requestUrl, additionalHeaders) {
  9100. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9101. }
  9102. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9103. return this.request(verb, requestUrl, stream, additionalHeaders);
  9104. }
  9105. /**
  9106. * Makes a raw http request.
  9107. * All other methods such as get, post, patch, and request ultimately call this.
  9108. * Prefer get, del, post and patch
  9109. */
  9110. async request(verb, requestUrl, data, headers) {
  9111. if (this._disposed) {
  9112. throw new Error("Client has already been disposed.");
  9113. }
  9114. let parsedUrl = url.parse(requestUrl);
  9115. let info = this._prepareRequest(verb, parsedUrl, headers);
  9116. // Only perform retries on reads since writes may not be idempotent.
  9117. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  9118. let numTries = 0;
  9119. let response;
  9120. while (numTries < maxTries) {
  9121. response = await this.requestRaw(info, data);
  9122. // Check if it's an authentication challenge
  9123. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  9124. let authenticationHandler;
  9125. for (let i = 0; i < this.handlers.length; i++) {
  9126. if (this.handlers[i].canHandleAuthentication(response)) {
  9127. authenticationHandler = this.handlers[i];
  9128. break;
  9129. }
  9130. }
  9131. if (authenticationHandler) {
  9132. return authenticationHandler.handleAuthentication(this, info, data);
  9133. }
  9134. else {
  9135. // We have received an unauthorized response but have no handlers to handle it.
  9136. // Let the response return to the caller.
  9137. return response;
  9138. }
  9139. }
  9140. let redirectsRemaining = this._maxRedirects;
  9141. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  9142. && this._allowRedirects
  9143. && redirectsRemaining > 0) {
  9144. const redirectUrl = response.message.headers["location"];
  9145. if (!redirectUrl) {
  9146. // if there's no location to redirect to, we won't
  9147. break;
  9148. }
  9149. let parsedRedirectUrl = url.parse(redirectUrl);
  9150. if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
  9151. 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.");
  9152. }
  9153. // we need to finish reading the response before reassigning response
  9154. // which will leak the open socket.
  9155. await response.readBody();
  9156. // let's make the request with the new redirectUrl
  9157. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9158. response = await this.requestRaw(info, data);
  9159. redirectsRemaining--;
  9160. }
  9161. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9162. // If not a retry code, return immediately instead of retrying
  9163. return response;
  9164. }
  9165. numTries += 1;
  9166. if (numTries < maxTries) {
  9167. await response.readBody();
  9168. await this._performExponentialBackoff(numTries);
  9169. }
  9170. }
  9171. return response;
  9172. }
  9173. /**
  9174. * Needs to be called if keepAlive is set to true in request options.
  9175. */
  9176. dispose() {
  9177. if (this._agent) {
  9178. this._agent.destroy();
  9179. }
  9180. this._disposed = true;
  9181. }
  9182. /**
  9183. * Raw request.
  9184. * @param info
  9185. * @param data
  9186. */
  9187. requestRaw(info, data) {
  9188. return new Promise((resolve, reject) => {
  9189. let callbackForResult = function (err, res) {
  9190. if (err) {
  9191. reject(err);
  9192. }
  9193. resolve(res);
  9194. };
  9195. this.requestRawWithCallback(info, data, callbackForResult);
  9196. });
  9197. }
  9198. /**
  9199. * Raw request with callback.
  9200. * @param info
  9201. * @param data
  9202. * @param onResult
  9203. */
  9204. requestRawWithCallback(info, data, onResult) {
  9205. let socket;
  9206. if (typeof (data) === 'string') {
  9207. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  9208. }
  9209. let callbackCalled = false;
  9210. let handleResult = (err, res) => {
  9211. if (!callbackCalled) {
  9212. callbackCalled = true;
  9213. onResult(err, res);
  9214. }
  9215. };
  9216. let req = info.httpModule.request(info.options, (msg) => {
  9217. let res = new HttpClientResponse(msg);
  9218. handleResult(null, res);
  9219. });
  9220. req.on('socket', (sock) => {
  9221. socket = sock;
  9222. });
  9223. // If we ever get disconnected, we want the socket to timeout eventually
  9224. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9225. if (socket) {
  9226. socket.end();
  9227. }
  9228. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9229. });
  9230. req.on('error', function (err) {
  9231. // err has statusCode property
  9232. // res should have headers
  9233. handleResult(err, null);
  9234. });
  9235. if (data && typeof (data) === 'string') {
  9236. req.write(data, 'utf8');
  9237. }
  9238. if (data && typeof (data) !== 'string') {
  9239. data.on('close', function () {
  9240. req.end();
  9241. });
  9242. data.pipe(req);
  9243. }
  9244. else {
  9245. req.end();
  9246. }
  9247. }
  9248. /**
  9249. * Gets an http agent. This function is useful when you need an http agent that handles
  9250. * routing through a proxy server - depending upon the url and proxy environment variables.
  9251. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9252. */
  9253. getAgent(serverUrl) {
  9254. let parsedUrl = url.parse(serverUrl);
  9255. return this._getAgent(parsedUrl);
  9256. }
  9257. _prepareRequest(method, requestUrl, headers) {
  9258. const info = {};
  9259. info.parsedUrl = requestUrl;
  9260. const usingSsl = info.parsedUrl.protocol === 'https:';
  9261. info.httpModule = usingSsl ? https : http;
  9262. const defaultPort = usingSsl ? 443 : 80;
  9263. info.options = {};
  9264. info.options.host = info.parsedUrl.hostname;
  9265. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  9266. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9267. info.options.method = method;
  9268. info.options.headers = this._mergeHeaders(headers);
  9269. if (this.userAgent != null) {
  9270. info.options.headers["user-agent"] = this.userAgent;
  9271. }
  9272. info.options.agent = this._getAgent(info.parsedUrl);
  9273. // gives handlers an opportunity to participate
  9274. if (this.handlers) {
  9275. this.handlers.forEach((handler) => {
  9276. handler.prepareRequest(info.options);
  9277. });
  9278. }
  9279. return info;
  9280. }
  9281. _mergeHeaders(headers) {
  9282. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  9283. if (this.requestOptions && this.requestOptions.headers) {
  9284. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9285. }
  9286. return lowercaseKeys(headers || {});
  9287. }
  9288. _getAgent(parsedUrl) {
  9289. let agent;
  9290. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9291. let useProxy = proxyUrl && proxyUrl.hostname;
  9292. if (this._keepAlive && useProxy) {
  9293. agent = this._proxyAgent;
  9294. }
  9295. if (this._keepAlive && !useProxy) {
  9296. agent = this._agent;
  9297. }
  9298. // if agent is already assigned use that agent.
  9299. if (!!agent) {
  9300. return agent;
  9301. }
  9302. const usingSsl = parsedUrl.protocol === 'https:';
  9303. let maxSockets = 100;
  9304. if (!!this.requestOptions) {
  9305. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9306. }
  9307. if (useProxy) {
  9308. // If using proxy, need tunnel
  9309. if (!tunnel) {
  9310. tunnel = __webpack_require__(335);
  9311. }
  9312. const agentOptions = {
  9313. maxSockets: maxSockets,
  9314. keepAlive: this._keepAlive,
  9315. proxy: {
  9316. proxyAuth: proxyUrl.auth,
  9317. host: proxyUrl.hostname,
  9318. port: proxyUrl.port
  9319. },
  9320. };
  9321. let tunnelAgent;
  9322. const overHttps = proxyUrl.protocol === 'https:';
  9323. if (usingSsl) {
  9324. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9325. }
  9326. else {
  9327. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9328. }
  9329. agent = tunnelAgent(agentOptions);
  9330. this._proxyAgent = agent;
  9331. }
  9332. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9333. if (this._keepAlive && !agent) {
  9334. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9335. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9336. this._agent = agent;
  9337. }
  9338. // if not using private agent and tunnel agent isn't setup then use global agent
  9339. if (!agent) {
  9340. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9341. }
  9342. if (usingSsl && this._ignoreSslError) {
  9343. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9344. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9345. // we have to cast it to any and change it directly
  9346. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  9347. }
  9348. return agent;
  9349. }
  9350. _performExponentialBackoff(retryNumber) {
  9351. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9352. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9353. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9354. }
  9355. }
  9356. exports.HttpClient = HttpClient;
  9357. /***/ }),
  9358. /***/ 550:
  9359. /***/ (function(module, __unusedexports, __webpack_require__) {
  9360. module.exports = getNextPage
  9361. const getPage = __webpack_require__(265)
  9362. function getNextPage (octokit, link, headers) {
  9363. return getPage(octokit, link, 'next', headers)
  9364. }
  9365. /***/ }),
  9366. /***/ 558:
  9367. /***/ (function(module, __unusedexports, __webpack_require__) {
  9368. module.exports = hasPreviousPage
  9369. const deprecate = __webpack_require__(370)
  9370. const getPageLinks = __webpack_require__(577)
  9371. function hasPreviousPage (link) {
  9372. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9373. return getPageLinks(link).prev
  9374. }
  9375. /***/ }),
  9376. /***/ 559:
  9377. /***/ (function(__unusedmodule, exports) {
  9378. "use strict";
  9379. Object.defineProperty(exports, "__esModule", { value: true });
  9380. class GitVersion {
  9381. /**
  9382. * Used for comparing the version of git and git-lfs against the minimum required version
  9383. * @param version the version string, e.g. 1.2 or 1.2.3
  9384. */
  9385. constructor(version) {
  9386. this.major = NaN;
  9387. this.minor = NaN;
  9388. this.patch = NaN;
  9389. if (version) {
  9390. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9391. if (match) {
  9392. this.major = Number(match[1]);
  9393. this.minor = Number(match[2]);
  9394. if (match[4]) {
  9395. this.patch = Number(match[4]);
  9396. }
  9397. }
  9398. }
  9399. }
  9400. /**
  9401. * Compares the instance against a minimum required version
  9402. * @param minimum Minimum version
  9403. */
  9404. checkMinimum(minimum) {
  9405. if (!minimum.isValid()) {
  9406. throw new Error('Arg minimum is not a valid version');
  9407. }
  9408. // Major is insufficient
  9409. if (this.major < minimum.major) {
  9410. return false;
  9411. }
  9412. // Major is equal
  9413. if (this.major === minimum.major) {
  9414. // Minor is insufficient
  9415. if (this.minor < minimum.minor) {
  9416. return false;
  9417. }
  9418. // Minor is equal
  9419. if (this.minor === minimum.minor) {
  9420. // Patch is insufficient
  9421. if (this.patch && this.patch < (minimum.patch || 0)) {
  9422. return false;
  9423. }
  9424. }
  9425. }
  9426. return true;
  9427. }
  9428. /**
  9429. * Indicates whether the instance was constructed from a valid version string
  9430. */
  9431. isValid() {
  9432. return !isNaN(this.major);
  9433. }
  9434. /**
  9435. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9436. */
  9437. toString() {
  9438. let result = '';
  9439. if (this.isValid()) {
  9440. result = `${this.major}.${this.minor}`;
  9441. if (!isNaN(this.patch)) {
  9442. result += `.${this.patch}`;
  9443. }
  9444. }
  9445. return result;
  9446. }
  9447. }
  9448. exports.GitVersion = GitVersion;
  9449. /***/ }),
  9450. /***/ 562:
  9451. /***/ (function(module, __unusedexports, __webpack_require__) {
  9452. var once = __webpack_require__(969);
  9453. var noop = function() {};
  9454. var isRequest = function(stream) {
  9455. return stream.setHeader && typeof stream.abort === 'function';
  9456. };
  9457. var isChildProcess = function(stream) {
  9458. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9459. };
  9460. var eos = function(stream, opts, callback) {
  9461. if (typeof opts === 'function') return eos(stream, null, opts);
  9462. if (!opts) opts = {};
  9463. callback = once(callback || noop);
  9464. var ws = stream._writableState;
  9465. var rs = stream._readableState;
  9466. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9467. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9468. var cancelled = false;
  9469. var onlegacyfinish = function() {
  9470. if (!stream.writable) onfinish();
  9471. };
  9472. var onfinish = function() {
  9473. writable = false;
  9474. if (!readable) callback.call(stream);
  9475. };
  9476. var onend = function() {
  9477. readable = false;
  9478. if (!writable) callback.call(stream);
  9479. };
  9480. var onexit = function(exitCode) {
  9481. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9482. };
  9483. var onerror = function(err) {
  9484. callback.call(stream, err);
  9485. };
  9486. var onclose = function() {
  9487. process.nextTick(onclosenexttick);
  9488. };
  9489. var onclosenexttick = function() {
  9490. if (cancelled) return;
  9491. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9492. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9493. };
  9494. var onrequest = function() {
  9495. stream.req.on('finish', onfinish);
  9496. };
  9497. if (isRequest(stream)) {
  9498. stream.on('complete', onfinish);
  9499. stream.on('abort', onclose);
  9500. if (stream.req) onrequest();
  9501. else stream.on('request', onrequest);
  9502. } else if (writable && !ws) { // legacy streams
  9503. stream.on('end', onlegacyfinish);
  9504. stream.on('close', onlegacyfinish);
  9505. }
  9506. if (isChildProcess(stream)) stream.on('exit', onexit);
  9507. stream.on('end', onend);
  9508. stream.on('finish', onfinish);
  9509. if (opts.error !== false) stream.on('error', onerror);
  9510. stream.on('close', onclose);
  9511. return function() {
  9512. cancelled = true;
  9513. stream.removeListener('complete', onfinish);
  9514. stream.removeListener('abort', onclose);
  9515. stream.removeListener('request', onrequest);
  9516. if (stream.req) stream.req.removeListener('finish', onfinish);
  9517. stream.removeListener('end', onlegacyfinish);
  9518. stream.removeListener('close', onlegacyfinish);
  9519. stream.removeListener('finish', onfinish);
  9520. stream.removeListener('exit', onexit);
  9521. stream.removeListener('end', onend);
  9522. stream.removeListener('error', onerror);
  9523. stream.removeListener('close', onclose);
  9524. };
  9525. };
  9526. module.exports = eos;
  9527. /***/ }),
  9528. /***/ 563:
  9529. /***/ (function(module, __unusedexports, __webpack_require__) {
  9530. module.exports = getPreviousPage
  9531. const getPage = __webpack_require__(265)
  9532. function getPreviousPage (octokit, link, headers) {
  9533. return getPage(octokit, link, 'prev', headers)
  9534. }
  9535. /***/ }),
  9536. /***/ 568:
  9537. /***/ (function(module, __unusedexports, __webpack_require__) {
  9538. "use strict";
  9539. const path = __webpack_require__(622);
  9540. const niceTry = __webpack_require__(948);
  9541. const resolveCommand = __webpack_require__(489);
  9542. const escape = __webpack_require__(462);
  9543. const readShebang = __webpack_require__(389);
  9544. const semver = __webpack_require__(280);
  9545. const isWin = process.platform === 'win32';
  9546. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9547. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9548. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9549. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9550. function detectShebang(parsed) {
  9551. parsed.file = resolveCommand(parsed);
  9552. const shebang = parsed.file && readShebang(parsed.file);
  9553. if (shebang) {
  9554. parsed.args.unshift(parsed.file);
  9555. parsed.command = shebang;
  9556. return resolveCommand(parsed);
  9557. }
  9558. return parsed.file;
  9559. }
  9560. function parseNonShell(parsed) {
  9561. if (!isWin) {
  9562. return parsed;
  9563. }
  9564. // Detect & add support for shebangs
  9565. const commandFile = detectShebang(parsed);
  9566. // We don't need a shell if the command filename is an executable
  9567. const needsShell = !isExecutableRegExp.test(commandFile);
  9568. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9569. // Note that `forceShell` is an hidden option used only in tests
  9570. if (parsed.options.forceShell || needsShell) {
  9571. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9572. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9573. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9574. // we need to double escape them
  9575. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9576. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9577. // This is necessary otherwise it will always fail with ENOENT in those cases
  9578. parsed.command = path.normalize(parsed.command);
  9579. // Escape command & arguments
  9580. parsed.command = escape.command(parsed.command);
  9581. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9582. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9583. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9584. parsed.command = process.env.comspec || 'cmd.exe';
  9585. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9586. }
  9587. return parsed;
  9588. }
  9589. function parseShell(parsed) {
  9590. // If node supports the shell option, there's no need to mimic its behavior
  9591. if (supportsShellOption) {
  9592. return parsed;
  9593. }
  9594. // Mimic node shell option
  9595. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9596. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9597. if (isWin) {
  9598. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9599. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9600. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9601. } else {
  9602. if (typeof parsed.options.shell === 'string') {
  9603. parsed.command = parsed.options.shell;
  9604. } else if (process.platform === 'android') {
  9605. parsed.command = '/system/bin/sh';
  9606. } else {
  9607. parsed.command = '/bin/sh';
  9608. }
  9609. parsed.args = ['-c', shellCommand];
  9610. }
  9611. return parsed;
  9612. }
  9613. function parse(command, args, options) {
  9614. // Normalize arguments, similar to nodejs
  9615. if (args && !Array.isArray(args)) {
  9616. options = args;
  9617. args = null;
  9618. }
  9619. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9620. options = Object.assign({}, options); // Clone object to avoid changing the original
  9621. // Build our parsed object
  9622. const parsed = {
  9623. command,
  9624. args,
  9625. options,
  9626. file: undefined,
  9627. original: {
  9628. command,
  9629. args,
  9630. },
  9631. };
  9632. // Delegate further parsing to shell or non-shell
  9633. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9634. }
  9635. module.exports = parse;
  9636. /***/ }),
  9637. /***/ 577:
  9638. /***/ (function(module) {
  9639. module.exports = getPageLinks
  9640. function getPageLinks (link) {
  9641. link = link.link || link.headers.link || ''
  9642. const links = {}
  9643. // link format:
  9644. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9645. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9646. links[type] = uri
  9647. })
  9648. return links
  9649. }
  9650. /***/ }),
  9651. /***/ 586:
  9652. /***/ (function(module, __unusedexports, __webpack_require__) {
  9653. module.exports = octokitRestApiEndpoints;
  9654. const ROUTES = __webpack_require__(705);
  9655. function octokitRestApiEndpoints(octokit) {
  9656. // Aliasing scopes for backward compatibility
  9657. // See https://github.com/octokit/rest.js/pull/1134
  9658. ROUTES.gitdata = ROUTES.git;
  9659. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9660. ROUTES.pullRequests = ROUTES.pulls;
  9661. octokit.registerEndpoints(ROUTES);
  9662. }
  9663. /***/ }),
  9664. /***/ 587:
  9665. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9666. "use strict";
  9667. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9668. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9669. return new (P || (P = Promise))(function (resolve, reject) {
  9670. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9671. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9672. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9673. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9674. });
  9675. };
  9676. var __importStar = (this && this.__importStar) || function (mod) {
  9677. if (mod && mod.__esModule) return mod;
  9678. var result = {};
  9679. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9680. result["default"] = mod;
  9681. return result;
  9682. };
  9683. Object.defineProperty(exports, "__esModule", { value: true });
  9684. const core = __importStar(__webpack_require__(470));
  9685. const defaultMaxAttempts = 3;
  9686. const defaultMinSeconds = 10;
  9687. const defaultMaxSeconds = 20;
  9688. class RetryHelper {
  9689. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9690. this.maxAttempts = maxAttempts;
  9691. this.minSeconds = Math.floor(minSeconds);
  9692. this.maxSeconds = Math.floor(maxSeconds);
  9693. if (this.minSeconds > this.maxSeconds) {
  9694. throw new Error('min seconds should be less than or equal to max seconds');
  9695. }
  9696. }
  9697. execute(action) {
  9698. return __awaiter(this, void 0, void 0, function* () {
  9699. let attempt = 1;
  9700. while (attempt < this.maxAttempts) {
  9701. // Try
  9702. try {
  9703. return yield action();
  9704. }
  9705. catch (err) {
  9706. core.info(err.message);
  9707. }
  9708. // Sleep
  9709. const seconds = this.getSleepAmount();
  9710. core.info(`Waiting ${seconds} seconds before trying again`);
  9711. yield this.sleep(seconds);
  9712. attempt++;
  9713. }
  9714. // Last attempt
  9715. return yield action();
  9716. });
  9717. }
  9718. getSleepAmount() {
  9719. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9720. this.minSeconds);
  9721. }
  9722. sleep(seconds) {
  9723. return __awaiter(this, void 0, void 0, function* () {
  9724. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9725. });
  9726. }
  9727. }
  9728. exports.RetryHelper = RetryHelper;
  9729. function execute(action) {
  9730. return __awaiter(this, void 0, void 0, function* () {
  9731. const retryHelper = new RetryHelper();
  9732. return yield retryHelper.execute(action);
  9733. });
  9734. }
  9735. exports.execute = execute;
  9736. /***/ }),
  9737. /***/ 605:
  9738. /***/ (function(module) {
  9739. module.exports = require("http");
  9740. /***/ }),
  9741. /***/ 614:
  9742. /***/ (function(module) {
  9743. module.exports = require("events");
  9744. /***/ }),
  9745. /***/ 618:
  9746. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9747. "use strict";
  9748. var __importStar = (this && this.__importStar) || function (mod) {
  9749. if (mod && mod.__esModule) return mod;
  9750. var result = {};
  9751. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9752. result["default"] = mod;
  9753. return result;
  9754. };
  9755. Object.defineProperty(exports, "__esModule", { value: true });
  9756. const fs = __importStar(__webpack_require__(747));
  9757. function directoryExistsSync(path, required) {
  9758. if (!path) {
  9759. throw new Error("Arg 'path' must not be empty");
  9760. }
  9761. let stats;
  9762. try {
  9763. stats = fs.statSync(path);
  9764. }
  9765. catch (error) {
  9766. if (error.code === 'ENOENT') {
  9767. if (!required) {
  9768. return false;
  9769. }
  9770. throw new Error(`Directory '${path}' does not exist`);
  9771. }
  9772. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9773. }
  9774. if (stats.isDirectory()) {
  9775. return true;
  9776. }
  9777. else if (!required) {
  9778. return false;
  9779. }
  9780. throw new Error(`Directory '${path}' does not exist`);
  9781. }
  9782. exports.directoryExistsSync = directoryExistsSync;
  9783. function existsSync(path) {
  9784. if (!path) {
  9785. throw new Error("Arg 'path' must not be empty");
  9786. }
  9787. try {
  9788. fs.statSync(path);
  9789. }
  9790. catch (error) {
  9791. if (error.code === 'ENOENT') {
  9792. return false;
  9793. }
  9794. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9795. }
  9796. return true;
  9797. }
  9798. exports.existsSync = existsSync;
  9799. function fileExistsSync(path) {
  9800. if (!path) {
  9801. throw new Error("Arg 'path' must not be empty");
  9802. }
  9803. let stats;
  9804. try {
  9805. stats = fs.statSync(path);
  9806. }
  9807. catch (error) {
  9808. if (error.code === 'ENOENT') {
  9809. return false;
  9810. }
  9811. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9812. }
  9813. if (!stats.isDirectory()) {
  9814. return true;
  9815. }
  9816. return false;
  9817. }
  9818. exports.fileExistsSync = fileExistsSync;
  9819. /***/ }),
  9820. /***/ 621:
  9821. /***/ (function(module, __unusedexports, __webpack_require__) {
  9822. "use strict";
  9823. const path = __webpack_require__(622);
  9824. const pathKey = __webpack_require__(39);
  9825. module.exports = opts => {
  9826. opts = Object.assign({
  9827. cwd: process.cwd(),
  9828. path: process.env[pathKey()]
  9829. }, opts);
  9830. let prev;
  9831. let pth = path.resolve(opts.cwd);
  9832. const ret = [];
  9833. while (prev !== pth) {
  9834. ret.push(path.join(pth, 'node_modules/.bin'));
  9835. prev = pth;
  9836. pth = path.resolve(pth, '..');
  9837. }
  9838. // ensure the running `node` binary is used
  9839. ret.push(path.dirname(process.execPath));
  9840. return ret.concat(opts.path).join(path.delimiter);
  9841. };
  9842. module.exports.env = opts => {
  9843. opts = Object.assign({
  9844. env: process.env
  9845. }, opts);
  9846. const env = Object.assign({}, opts.env);
  9847. const path = pathKey({env});
  9848. opts.path = env[path];
  9849. env[path] = module.exports(opts);
  9850. return env;
  9851. };
  9852. /***/ }),
  9853. /***/ 622:
  9854. /***/ (function(module) {
  9855. module.exports = require("path");
  9856. /***/ }),
  9857. /***/ 631:
  9858. /***/ (function(module) {
  9859. module.exports = require("net");
  9860. /***/ }),
  9861. /***/ 649:
  9862. /***/ (function(module, __unusedexports, __webpack_require__) {
  9863. module.exports = getLastPage
  9864. const getPage = __webpack_require__(265)
  9865. function getLastPage (octokit, link, headers) {
  9866. return getPage(octokit, link, 'last', headers)
  9867. }
  9868. /***/ }),
  9869. /***/ 654:
  9870. /***/ (function(module) {
  9871. // This is not the set of all possible signals.
  9872. //
  9873. // It IS, however, the set of all signals that trigger
  9874. // an exit on either Linux or BSD systems. Linux is a
  9875. // superset of the signal names supported on BSD, and
  9876. // the unknown signals just fail to register, so we can
  9877. // catch that easily enough.
  9878. //
  9879. // Don't bother with SIGKILL. It's uncatchable, which
  9880. // means that we can't fire any callbacks anyway.
  9881. //
  9882. // If a user does happen to register a handler on a non-
  9883. // fatal signal like SIGWINCH or something, and then
  9884. // exit, it'll end up firing `process.emit('exit')`, so
  9885. // the handler will be fired anyway.
  9886. //
  9887. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9888. // artificially, inherently leave the process in a
  9889. // state from which it is not safe to try and enter JS
  9890. // listeners.
  9891. module.exports = [
  9892. 'SIGABRT',
  9893. 'SIGALRM',
  9894. 'SIGHUP',
  9895. 'SIGINT',
  9896. 'SIGTERM'
  9897. ]
  9898. if (process.platform !== 'win32') {
  9899. module.exports.push(
  9900. 'SIGVTALRM',
  9901. 'SIGXCPU',
  9902. 'SIGXFSZ',
  9903. 'SIGUSR2',
  9904. 'SIGTRAP',
  9905. 'SIGSYS',
  9906. 'SIGQUIT',
  9907. 'SIGIOT'
  9908. // should detect profiler and enable/disable accordingly.
  9909. // see #21
  9910. // 'SIGPROF'
  9911. )
  9912. }
  9913. if (process.platform === 'linux') {
  9914. module.exports.push(
  9915. 'SIGIO',
  9916. 'SIGPOLL',
  9917. 'SIGPWR',
  9918. 'SIGSTKFLT',
  9919. 'SIGUNUSED'
  9920. )
  9921. }
  9922. /***/ }),
  9923. /***/ 656:
  9924. /***/ (function(module, exports) {
  9925. exports = module.exports = SemVer
  9926. var debug
  9927. /* istanbul ignore next */
  9928. if (typeof process === 'object' &&
  9929. process.env &&
  9930. process.env.NODE_DEBUG &&
  9931. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9932. debug = function () {
  9933. var args = Array.prototype.slice.call(arguments, 0)
  9934. args.unshift('SEMVER')
  9935. console.log.apply(console, args)
  9936. }
  9937. } else {
  9938. debug = function () {}
  9939. }
  9940. // Note: this is the semver.org version of the spec that it implements
  9941. // Not necessarily the package version of this code.
  9942. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9943. var MAX_LENGTH = 256
  9944. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9945. /* istanbul ignore next */ 9007199254740991
  9946. // Max safe segment length for coercion.
  9947. var MAX_SAFE_COMPONENT_LENGTH = 16
  9948. // The actual regexps go on exports.re
  9949. var re = exports.re = []
  9950. var src = exports.src = []
  9951. var t = exports.tokens = {}
  9952. var R = 0
  9953. function tok (n) {
  9954. t[n] = R++
  9955. }
  9956. // The following Regular Expressions can be used for tokenizing,
  9957. // validating, and parsing SemVer version strings.
  9958. // ## Numeric Identifier
  9959. // A single `0`, or a non-zero digit followed by zero or more digits.
  9960. tok('NUMERICIDENTIFIER')
  9961. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9962. tok('NUMERICIDENTIFIERLOOSE')
  9963. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9964. // ## Non-numeric Identifier
  9965. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9966. // more letters, digits, or hyphens.
  9967. tok('NONNUMERICIDENTIFIER')
  9968. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9969. // ## Main Version
  9970. // Three dot-separated numeric identifiers.
  9971. tok('MAINVERSION')
  9972. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9973. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9974. '(' + src[t.NUMERICIDENTIFIER] + ')'
  9975. tok('MAINVERSIONLOOSE')
  9976. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9977. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9978. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  9979. // ## Pre-release Version Identifier
  9980. // A numeric identifier, or a non-numeric identifier.
  9981. tok('PRERELEASEIDENTIFIER')
  9982. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  9983. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9984. tok('PRERELEASEIDENTIFIERLOOSE')
  9985. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  9986. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9987. // ## Pre-release Version
  9988. // Hyphen, followed by one or more dot-separated pre-release version
  9989. // identifiers.
  9990. tok('PRERELEASE')
  9991. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  9992. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  9993. tok('PRERELEASELOOSE')
  9994. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  9995. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  9996. // ## Build Metadata Identifier
  9997. // Any combination of digits, letters, or hyphens.
  9998. tok('BUILDIDENTIFIER')
  9999. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10000. // ## Build Metadata
  10001. // Plus sign, followed by one or more period-separated build metadata
  10002. // identifiers.
  10003. tok('BUILD')
  10004. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10005. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10006. // ## Full Version String
  10007. // A main version, followed optionally by a pre-release version and
  10008. // build metadata.
  10009. // Note that the only major, minor, patch, and pre-release sections of
  10010. // the version string are capturing groups. The build metadata is not a
  10011. // capturing group, because it should not ever be used in version
  10012. // comparison.
  10013. tok('FULL')
  10014. tok('FULLPLAIN')
  10015. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10016. src[t.PRERELEASE] + '?' +
  10017. src[t.BUILD] + '?'
  10018. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10019. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10020. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10021. // common in the npm registry.
  10022. tok('LOOSEPLAIN')
  10023. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10024. src[t.PRERELEASELOOSE] + '?' +
  10025. src[t.BUILD] + '?'
  10026. tok('LOOSE')
  10027. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10028. tok('GTLT')
  10029. src[t.GTLT] = '((?:<|>)?=?)'
  10030. // Something like "2.*" or "1.2.x".
  10031. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10032. // Only the first item is strictly required.
  10033. tok('XRANGEIDENTIFIERLOOSE')
  10034. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10035. tok('XRANGEIDENTIFIER')
  10036. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10037. tok('XRANGEPLAIN')
  10038. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10039. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10040. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10041. '(?:' + src[t.PRERELEASE] + ')?' +
  10042. src[t.BUILD] + '?' +
  10043. ')?)?'
  10044. tok('XRANGEPLAINLOOSE')
  10045. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10046. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10047. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10048. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10049. src[t.BUILD] + '?' +
  10050. ')?)?'
  10051. tok('XRANGE')
  10052. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10053. tok('XRANGELOOSE')
  10054. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10055. // Coercion.
  10056. // Extract anything that could conceivably be a part of a valid semver
  10057. tok('COERCE')
  10058. src[t.COERCE] = '(^|[^\\d])' +
  10059. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10060. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10061. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10062. '(?:$|[^\\d])'
  10063. tok('COERCERTL')
  10064. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10065. // Tilde ranges.
  10066. // Meaning is "reasonably at or greater than"
  10067. tok('LONETILDE')
  10068. src[t.LONETILDE] = '(?:~>?)'
  10069. tok('TILDETRIM')
  10070. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10071. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10072. var tildeTrimReplace = '$1~'
  10073. tok('TILDE')
  10074. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10075. tok('TILDELOOSE')
  10076. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10077. // Caret ranges.
  10078. // Meaning is "at least and backwards compatible with"
  10079. tok('LONECARET')
  10080. src[t.LONECARET] = '(?:\\^)'
  10081. tok('CARETTRIM')
  10082. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10083. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10084. var caretTrimReplace = '$1^'
  10085. tok('CARET')
  10086. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10087. tok('CARETLOOSE')
  10088. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10089. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10090. tok('COMPARATORLOOSE')
  10091. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10092. tok('COMPARATOR')
  10093. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10094. // An expression to strip any whitespace between the gtlt and the thing
  10095. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10096. tok('COMPARATORTRIM')
  10097. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10098. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10099. // this one has to use the /g flag
  10100. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10101. var comparatorTrimReplace = '$1$2$3'
  10102. // Something like `1.2.3 - 1.2.4`
  10103. // Note that these all use the loose form, because they'll be
  10104. // checked against either the strict or loose comparator form
  10105. // later.
  10106. tok('HYPHENRANGE')
  10107. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10108. '\\s+-\\s+' +
  10109. '(' + src[t.XRANGEPLAIN] + ')' +
  10110. '\\s*$'
  10111. tok('HYPHENRANGELOOSE')
  10112. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10113. '\\s+-\\s+' +
  10114. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10115. '\\s*$'
  10116. // Star ranges basically just allow anything at all.
  10117. tok('STAR')
  10118. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10119. // Compile to actual regexp objects.
  10120. // All are flag-free, unless they were created above with a flag.
  10121. for (var i = 0; i < R; i++) {
  10122. debug(i, src[i])
  10123. if (!re[i]) {
  10124. re[i] = new RegExp(src[i])
  10125. }
  10126. }
  10127. exports.parse = parse
  10128. function parse (version, options) {
  10129. if (!options || typeof options !== 'object') {
  10130. options = {
  10131. loose: !!options,
  10132. includePrerelease: false
  10133. }
  10134. }
  10135. if (version instanceof SemVer) {
  10136. return version
  10137. }
  10138. if (typeof version !== 'string') {
  10139. return null
  10140. }
  10141. if (version.length > MAX_LENGTH) {
  10142. return null
  10143. }
  10144. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10145. if (!r.test(version)) {
  10146. return null
  10147. }
  10148. try {
  10149. return new SemVer(version, options)
  10150. } catch (er) {
  10151. return null
  10152. }
  10153. }
  10154. exports.valid = valid
  10155. function valid (version, options) {
  10156. var v = parse(version, options)
  10157. return v ? v.version : null
  10158. }
  10159. exports.clean = clean
  10160. function clean (version, options) {
  10161. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10162. return s ? s.version : null
  10163. }
  10164. exports.SemVer = SemVer
  10165. function SemVer (version, options) {
  10166. if (!options || typeof options !== 'object') {
  10167. options = {
  10168. loose: !!options,
  10169. includePrerelease: false
  10170. }
  10171. }
  10172. if (version instanceof SemVer) {
  10173. if (version.loose === options.loose) {
  10174. return version
  10175. } else {
  10176. version = version.version
  10177. }
  10178. } else if (typeof version !== 'string') {
  10179. throw new TypeError('Invalid Version: ' + version)
  10180. }
  10181. if (version.length > MAX_LENGTH) {
  10182. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10183. }
  10184. if (!(this instanceof SemVer)) {
  10185. return new SemVer(version, options)
  10186. }
  10187. debug('SemVer', version, options)
  10188. this.options = options
  10189. this.loose = !!options.loose
  10190. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10191. if (!m) {
  10192. throw new TypeError('Invalid Version: ' + version)
  10193. }
  10194. this.raw = version
  10195. // these are actually numbers
  10196. this.major = +m[1]
  10197. this.minor = +m[2]
  10198. this.patch = +m[3]
  10199. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10200. throw new TypeError('Invalid major version')
  10201. }
  10202. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10203. throw new TypeError('Invalid minor version')
  10204. }
  10205. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10206. throw new TypeError('Invalid patch version')
  10207. }
  10208. // numberify any prerelease numeric ids
  10209. if (!m[4]) {
  10210. this.prerelease = []
  10211. } else {
  10212. this.prerelease = m[4].split('.').map(function (id) {
  10213. if (/^[0-9]+$/.test(id)) {
  10214. var num = +id
  10215. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10216. return num
  10217. }
  10218. }
  10219. return id
  10220. })
  10221. }
  10222. this.build = m[5] ? m[5].split('.') : []
  10223. this.format()
  10224. }
  10225. SemVer.prototype.format = function () {
  10226. this.version = this.major + '.' + this.minor + '.' + this.patch
  10227. if (this.prerelease.length) {
  10228. this.version += '-' + this.prerelease.join('.')
  10229. }
  10230. return this.version
  10231. }
  10232. SemVer.prototype.toString = function () {
  10233. return this.version
  10234. }
  10235. SemVer.prototype.compare = function (other) {
  10236. debug('SemVer.compare', this.version, this.options, other)
  10237. if (!(other instanceof SemVer)) {
  10238. other = new SemVer(other, this.options)
  10239. }
  10240. return this.compareMain(other) || this.comparePre(other)
  10241. }
  10242. SemVer.prototype.compareMain = function (other) {
  10243. if (!(other instanceof SemVer)) {
  10244. other = new SemVer(other, this.options)
  10245. }
  10246. return compareIdentifiers(this.major, other.major) ||
  10247. compareIdentifiers(this.minor, other.minor) ||
  10248. compareIdentifiers(this.patch, other.patch)
  10249. }
  10250. SemVer.prototype.comparePre = function (other) {
  10251. if (!(other instanceof SemVer)) {
  10252. other = new SemVer(other, this.options)
  10253. }
  10254. // NOT having a prerelease is > having one
  10255. if (this.prerelease.length && !other.prerelease.length) {
  10256. return -1
  10257. } else if (!this.prerelease.length && other.prerelease.length) {
  10258. return 1
  10259. } else if (!this.prerelease.length && !other.prerelease.length) {
  10260. return 0
  10261. }
  10262. var i = 0
  10263. do {
  10264. var a = this.prerelease[i]
  10265. var b = other.prerelease[i]
  10266. debug('prerelease compare', i, a, b)
  10267. if (a === undefined && b === undefined) {
  10268. return 0
  10269. } else if (b === undefined) {
  10270. return 1
  10271. } else if (a === undefined) {
  10272. return -1
  10273. } else if (a === b) {
  10274. continue
  10275. } else {
  10276. return compareIdentifiers(a, b)
  10277. }
  10278. } while (++i)
  10279. }
  10280. SemVer.prototype.compareBuild = function (other) {
  10281. if (!(other instanceof SemVer)) {
  10282. other = new SemVer(other, this.options)
  10283. }
  10284. var i = 0
  10285. do {
  10286. var a = this.build[i]
  10287. var b = other.build[i]
  10288. debug('prerelease compare', i, a, b)
  10289. if (a === undefined && b === undefined) {
  10290. return 0
  10291. } else if (b === undefined) {
  10292. return 1
  10293. } else if (a === undefined) {
  10294. return -1
  10295. } else if (a === b) {
  10296. continue
  10297. } else {
  10298. return compareIdentifiers(a, b)
  10299. }
  10300. } while (++i)
  10301. }
  10302. // preminor will bump the version up to the next minor release, and immediately
  10303. // down to pre-release. premajor and prepatch work the same way.
  10304. SemVer.prototype.inc = function (release, identifier) {
  10305. switch (release) {
  10306. case 'premajor':
  10307. this.prerelease.length = 0
  10308. this.patch = 0
  10309. this.minor = 0
  10310. this.major++
  10311. this.inc('pre', identifier)
  10312. break
  10313. case 'preminor':
  10314. this.prerelease.length = 0
  10315. this.patch = 0
  10316. this.minor++
  10317. this.inc('pre', identifier)
  10318. break
  10319. case 'prepatch':
  10320. // If this is already a prerelease, it will bump to the next version
  10321. // drop any prereleases that might already exist, since they are not
  10322. // relevant at this point.
  10323. this.prerelease.length = 0
  10324. this.inc('patch', identifier)
  10325. this.inc('pre', identifier)
  10326. break
  10327. // If the input is a non-prerelease version, this acts the same as
  10328. // prepatch.
  10329. case 'prerelease':
  10330. if (this.prerelease.length === 0) {
  10331. this.inc('patch', identifier)
  10332. }
  10333. this.inc('pre', identifier)
  10334. break
  10335. case 'major':
  10336. // If this is a pre-major version, bump up to the same major version.
  10337. // Otherwise increment major.
  10338. // 1.0.0-5 bumps to 1.0.0
  10339. // 1.1.0 bumps to 2.0.0
  10340. if (this.minor !== 0 ||
  10341. this.patch !== 0 ||
  10342. this.prerelease.length === 0) {
  10343. this.major++
  10344. }
  10345. this.minor = 0
  10346. this.patch = 0
  10347. this.prerelease = []
  10348. break
  10349. case 'minor':
  10350. // If this is a pre-minor version, bump up to the same minor version.
  10351. // Otherwise increment minor.
  10352. // 1.2.0-5 bumps to 1.2.0
  10353. // 1.2.1 bumps to 1.3.0
  10354. if (this.patch !== 0 || this.prerelease.length === 0) {
  10355. this.minor++
  10356. }
  10357. this.patch = 0
  10358. this.prerelease = []
  10359. break
  10360. case 'patch':
  10361. // If this is not a pre-release version, it will increment the patch.
  10362. // If it is a pre-release it will bump up to the same patch version.
  10363. // 1.2.0-5 patches to 1.2.0
  10364. // 1.2.0 patches to 1.2.1
  10365. if (this.prerelease.length === 0) {
  10366. this.patch++
  10367. }
  10368. this.prerelease = []
  10369. break
  10370. // This probably shouldn't be used publicly.
  10371. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10372. case 'pre':
  10373. if (this.prerelease.length === 0) {
  10374. this.prerelease = [0]
  10375. } else {
  10376. var i = this.prerelease.length
  10377. while (--i >= 0) {
  10378. if (typeof this.prerelease[i] === 'number') {
  10379. this.prerelease[i]++
  10380. i = -2
  10381. }
  10382. }
  10383. if (i === -1) {
  10384. // didn't increment anything
  10385. this.prerelease.push(0)
  10386. }
  10387. }
  10388. if (identifier) {
  10389. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10390. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10391. if (this.prerelease[0] === identifier) {
  10392. if (isNaN(this.prerelease[1])) {
  10393. this.prerelease = [identifier, 0]
  10394. }
  10395. } else {
  10396. this.prerelease = [identifier, 0]
  10397. }
  10398. }
  10399. break
  10400. default:
  10401. throw new Error('invalid increment argument: ' + release)
  10402. }
  10403. this.format()
  10404. this.raw = this.version
  10405. return this
  10406. }
  10407. exports.inc = inc
  10408. function inc (version, release, loose, identifier) {
  10409. if (typeof (loose) === 'string') {
  10410. identifier = loose
  10411. loose = undefined
  10412. }
  10413. try {
  10414. return new SemVer(version, loose).inc(release, identifier).version
  10415. } catch (er) {
  10416. return null
  10417. }
  10418. }
  10419. exports.diff = diff
  10420. function diff (version1, version2) {
  10421. if (eq(version1, version2)) {
  10422. return null
  10423. } else {
  10424. var v1 = parse(version1)
  10425. var v2 = parse(version2)
  10426. var prefix = ''
  10427. if (v1.prerelease.length || v2.prerelease.length) {
  10428. prefix = 'pre'
  10429. var defaultResult = 'prerelease'
  10430. }
  10431. for (var key in v1) {
  10432. if (key === 'major' || key === 'minor' || key === 'patch') {
  10433. if (v1[key] !== v2[key]) {
  10434. return prefix + key
  10435. }
  10436. }
  10437. }
  10438. return defaultResult // may be undefined
  10439. }
  10440. }
  10441. exports.compareIdentifiers = compareIdentifiers
  10442. var numeric = /^[0-9]+$/
  10443. function compareIdentifiers (a, b) {
  10444. var anum = numeric.test(a)
  10445. var bnum = numeric.test(b)
  10446. if (anum && bnum) {
  10447. a = +a
  10448. b = +b
  10449. }
  10450. return a === b ? 0
  10451. : (anum && !bnum) ? -1
  10452. : (bnum && !anum) ? 1
  10453. : a < b ? -1
  10454. : 1
  10455. }
  10456. exports.rcompareIdentifiers = rcompareIdentifiers
  10457. function rcompareIdentifiers (a, b) {
  10458. return compareIdentifiers(b, a)
  10459. }
  10460. exports.major = major
  10461. function major (a, loose) {
  10462. return new SemVer(a, loose).major
  10463. }
  10464. exports.minor = minor
  10465. function minor (a, loose) {
  10466. return new SemVer(a, loose).minor
  10467. }
  10468. exports.patch = patch
  10469. function patch (a, loose) {
  10470. return new SemVer(a, loose).patch
  10471. }
  10472. exports.compare = compare
  10473. function compare (a, b, loose) {
  10474. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10475. }
  10476. exports.compareLoose = compareLoose
  10477. function compareLoose (a, b) {
  10478. return compare(a, b, true)
  10479. }
  10480. exports.compareBuild = compareBuild
  10481. function compareBuild (a, b, loose) {
  10482. var versionA = new SemVer(a, loose)
  10483. var versionB = new SemVer(b, loose)
  10484. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10485. }
  10486. exports.rcompare = rcompare
  10487. function rcompare (a, b, loose) {
  10488. return compare(b, a, loose)
  10489. }
  10490. exports.sort = sort
  10491. function sort (list, loose) {
  10492. return list.sort(function (a, b) {
  10493. return exports.compareBuild(a, b, loose)
  10494. })
  10495. }
  10496. exports.rsort = rsort
  10497. function rsort (list, loose) {
  10498. return list.sort(function (a, b) {
  10499. return exports.compareBuild(b, a, loose)
  10500. })
  10501. }
  10502. exports.gt = gt
  10503. function gt (a, b, loose) {
  10504. return compare(a, b, loose) > 0
  10505. }
  10506. exports.lt = lt
  10507. function lt (a, b, loose) {
  10508. return compare(a, b, loose) < 0
  10509. }
  10510. exports.eq = eq
  10511. function eq (a, b, loose) {
  10512. return compare(a, b, loose) === 0
  10513. }
  10514. exports.neq = neq
  10515. function neq (a, b, loose) {
  10516. return compare(a, b, loose) !== 0
  10517. }
  10518. exports.gte = gte
  10519. function gte (a, b, loose) {
  10520. return compare(a, b, loose) >= 0
  10521. }
  10522. exports.lte = lte
  10523. function lte (a, b, loose) {
  10524. return compare(a, b, loose) <= 0
  10525. }
  10526. exports.cmp = cmp
  10527. function cmp (a, op, b, loose) {
  10528. switch (op) {
  10529. case '===':
  10530. if (typeof a === 'object')
  10531. a = a.version
  10532. if (typeof b === 'object')
  10533. b = b.version
  10534. return a === b
  10535. case '!==':
  10536. if (typeof a === 'object')
  10537. a = a.version
  10538. if (typeof b === 'object')
  10539. b = b.version
  10540. return a !== b
  10541. case '':
  10542. case '=':
  10543. case '==':
  10544. return eq(a, b, loose)
  10545. case '!=':
  10546. return neq(a, b, loose)
  10547. case '>':
  10548. return gt(a, b, loose)
  10549. case '>=':
  10550. return gte(a, b, loose)
  10551. case '<':
  10552. return lt(a, b, loose)
  10553. case '<=':
  10554. return lte(a, b, loose)
  10555. default:
  10556. throw new TypeError('Invalid operator: ' + op)
  10557. }
  10558. }
  10559. exports.Comparator = Comparator
  10560. function Comparator (comp, options) {
  10561. if (!options || typeof options !== 'object') {
  10562. options = {
  10563. loose: !!options,
  10564. includePrerelease: false
  10565. }
  10566. }
  10567. if (comp instanceof Comparator) {
  10568. if (comp.loose === !!options.loose) {
  10569. return comp
  10570. } else {
  10571. comp = comp.value
  10572. }
  10573. }
  10574. if (!(this instanceof Comparator)) {
  10575. return new Comparator(comp, options)
  10576. }
  10577. debug('comparator', comp, options)
  10578. this.options = options
  10579. this.loose = !!options.loose
  10580. this.parse(comp)
  10581. if (this.semver === ANY) {
  10582. this.value = ''
  10583. } else {
  10584. this.value = this.operator + this.semver.version
  10585. }
  10586. debug('comp', this)
  10587. }
  10588. var ANY = {}
  10589. Comparator.prototype.parse = function (comp) {
  10590. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10591. var m = comp.match(r)
  10592. if (!m) {
  10593. throw new TypeError('Invalid comparator: ' + comp)
  10594. }
  10595. this.operator = m[1] !== undefined ? m[1] : ''
  10596. if (this.operator === '=') {
  10597. this.operator = ''
  10598. }
  10599. // if it literally is just '>' or '' then allow anything.
  10600. if (!m[2]) {
  10601. this.semver = ANY
  10602. } else {
  10603. this.semver = new SemVer(m[2], this.options.loose)
  10604. }
  10605. }
  10606. Comparator.prototype.toString = function () {
  10607. return this.value
  10608. }
  10609. Comparator.prototype.test = function (version) {
  10610. debug('Comparator.test', version, this.options.loose)
  10611. if (this.semver === ANY || version === ANY) {
  10612. return true
  10613. }
  10614. if (typeof version === 'string') {
  10615. try {
  10616. version = new SemVer(version, this.options)
  10617. } catch (er) {
  10618. return false
  10619. }
  10620. }
  10621. return cmp(version, this.operator, this.semver, this.options)
  10622. }
  10623. Comparator.prototype.intersects = function (comp, options) {
  10624. if (!(comp instanceof Comparator)) {
  10625. throw new TypeError('a Comparator is required')
  10626. }
  10627. if (!options || typeof options !== 'object') {
  10628. options = {
  10629. loose: !!options,
  10630. includePrerelease: false
  10631. }
  10632. }
  10633. var rangeTmp
  10634. if (this.operator === '') {
  10635. if (this.value === '') {
  10636. return true
  10637. }
  10638. rangeTmp = new Range(comp.value, options)
  10639. return satisfies(this.value, rangeTmp, options)
  10640. } else if (comp.operator === '') {
  10641. if (comp.value === '') {
  10642. return true
  10643. }
  10644. rangeTmp = new Range(this.value, options)
  10645. return satisfies(comp.semver, rangeTmp, options)
  10646. }
  10647. var sameDirectionIncreasing =
  10648. (this.operator === '>=' || this.operator === '>') &&
  10649. (comp.operator === '>=' || comp.operator === '>')
  10650. var sameDirectionDecreasing =
  10651. (this.operator === '<=' || this.operator === '<') &&
  10652. (comp.operator === '<=' || comp.operator === '<')
  10653. var sameSemVer = this.semver.version === comp.semver.version
  10654. var differentDirectionsInclusive =
  10655. (this.operator === '>=' || this.operator === '<=') &&
  10656. (comp.operator === '>=' || comp.operator === '<=')
  10657. var oppositeDirectionsLessThan =
  10658. cmp(this.semver, '<', comp.semver, options) &&
  10659. ((this.operator === '>=' || this.operator === '>') &&
  10660. (comp.operator === '<=' || comp.operator === '<'))
  10661. var oppositeDirectionsGreaterThan =
  10662. cmp(this.semver, '>', comp.semver, options) &&
  10663. ((this.operator === '<=' || this.operator === '<') &&
  10664. (comp.operator === '>=' || comp.operator === '>'))
  10665. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10666. (sameSemVer && differentDirectionsInclusive) ||
  10667. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10668. }
  10669. exports.Range = Range
  10670. function Range (range, options) {
  10671. if (!options || typeof options !== 'object') {
  10672. options = {
  10673. loose: !!options,
  10674. includePrerelease: false
  10675. }
  10676. }
  10677. if (range instanceof Range) {
  10678. if (range.loose === !!options.loose &&
  10679. range.includePrerelease === !!options.includePrerelease) {
  10680. return range
  10681. } else {
  10682. return new Range(range.raw, options)
  10683. }
  10684. }
  10685. if (range instanceof Comparator) {
  10686. return new Range(range.value, options)
  10687. }
  10688. if (!(this instanceof Range)) {
  10689. return new Range(range, options)
  10690. }
  10691. this.options = options
  10692. this.loose = !!options.loose
  10693. this.includePrerelease = !!options.includePrerelease
  10694. // First, split based on boolean or ||
  10695. this.raw = range
  10696. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10697. return this.parseRange(range.trim())
  10698. }, this).filter(function (c) {
  10699. // throw out any that are not relevant for whatever reason
  10700. return c.length
  10701. })
  10702. if (!this.set.length) {
  10703. throw new TypeError('Invalid SemVer Range: ' + range)
  10704. }
  10705. this.format()
  10706. }
  10707. Range.prototype.format = function () {
  10708. this.range = this.set.map(function (comps) {
  10709. return comps.join(' ').trim()
  10710. }).join('||').trim()
  10711. return this.range
  10712. }
  10713. Range.prototype.toString = function () {
  10714. return this.range
  10715. }
  10716. Range.prototype.parseRange = function (range) {
  10717. var loose = this.options.loose
  10718. range = range.trim()
  10719. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10720. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10721. range = range.replace(hr, hyphenReplace)
  10722. debug('hyphen replace', range)
  10723. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10724. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10725. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10726. // `~ 1.2.3` => `~1.2.3`
  10727. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10728. // `^ 1.2.3` => `^1.2.3`
  10729. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10730. // normalize spaces
  10731. range = range.split(/\s+/).join(' ')
  10732. // At this point, the range is completely trimmed and
  10733. // ready to be split into comparators.
  10734. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10735. var set = range.split(' ').map(function (comp) {
  10736. return parseComparator(comp, this.options)
  10737. }, this).join(' ').split(/\s+/)
  10738. if (this.options.loose) {
  10739. // in loose mode, throw out any that are not valid comparators
  10740. set = set.filter(function (comp) {
  10741. return !!comp.match(compRe)
  10742. })
  10743. }
  10744. set = set.map(function (comp) {
  10745. return new Comparator(comp, this.options)
  10746. }, this)
  10747. return set
  10748. }
  10749. Range.prototype.intersects = function (range, options) {
  10750. if (!(range instanceof Range)) {
  10751. throw new TypeError('a Range is required')
  10752. }
  10753. return this.set.some(function (thisComparators) {
  10754. return (
  10755. isSatisfiable(thisComparators, options) &&
  10756. range.set.some(function (rangeComparators) {
  10757. return (
  10758. isSatisfiable(rangeComparators, options) &&
  10759. thisComparators.every(function (thisComparator) {
  10760. return rangeComparators.every(function (rangeComparator) {
  10761. return thisComparator.intersects(rangeComparator, options)
  10762. })
  10763. })
  10764. )
  10765. })
  10766. )
  10767. })
  10768. }
  10769. // take a set of comparators and determine whether there
  10770. // exists a version which can satisfy it
  10771. function isSatisfiable (comparators, options) {
  10772. var result = true
  10773. var remainingComparators = comparators.slice()
  10774. var testComparator = remainingComparators.pop()
  10775. while (result && remainingComparators.length) {
  10776. result = remainingComparators.every(function (otherComparator) {
  10777. return testComparator.intersects(otherComparator, options)
  10778. })
  10779. testComparator = remainingComparators.pop()
  10780. }
  10781. return result
  10782. }
  10783. // Mostly just for testing and legacy API reasons
  10784. exports.toComparators = toComparators
  10785. function toComparators (range, options) {
  10786. return new Range(range, options).set.map(function (comp) {
  10787. return comp.map(function (c) {
  10788. return c.value
  10789. }).join(' ').trim().split(' ')
  10790. })
  10791. }
  10792. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10793. // already replaced the hyphen ranges
  10794. // turn into a set of JUST comparators.
  10795. function parseComparator (comp, options) {
  10796. debug('comp', comp, options)
  10797. comp = replaceCarets(comp, options)
  10798. debug('caret', comp)
  10799. comp = replaceTildes(comp, options)
  10800. debug('tildes', comp)
  10801. comp = replaceXRanges(comp, options)
  10802. debug('xrange', comp)
  10803. comp = replaceStars(comp, options)
  10804. debug('stars', comp)
  10805. return comp
  10806. }
  10807. function isX (id) {
  10808. return !id || id.toLowerCase() === 'x' || id === '*'
  10809. }
  10810. // ~, ~> --> * (any, kinda silly)
  10811. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10812. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10813. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10814. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10815. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10816. function replaceTildes (comp, options) {
  10817. return comp.trim().split(/\s+/).map(function (comp) {
  10818. return replaceTilde(comp, options)
  10819. }).join(' ')
  10820. }
  10821. function replaceTilde (comp, options) {
  10822. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10823. return comp.replace(r, function (_, M, m, p, pr) {
  10824. debug('tilde', comp, _, M, m, p, pr)
  10825. var ret
  10826. if (isX(M)) {
  10827. ret = ''
  10828. } else if (isX(m)) {
  10829. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10830. } else if (isX(p)) {
  10831. // ~1.2 == >=1.2.0 <1.3.0
  10832. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10833. } else if (pr) {
  10834. debug('replaceTilde pr', pr)
  10835. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10836. ' <' + M + '.' + (+m + 1) + '.0'
  10837. } else {
  10838. // ~1.2.3 == >=1.2.3 <1.3.0
  10839. ret = '>=' + M + '.' + m + '.' + p +
  10840. ' <' + M + '.' + (+m + 1) + '.0'
  10841. }
  10842. debug('tilde return', ret)
  10843. return ret
  10844. })
  10845. }
  10846. // ^ --> * (any, kinda silly)
  10847. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10848. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10849. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10850. // ^1.2.3 --> >=1.2.3 <2.0.0
  10851. // ^1.2.0 --> >=1.2.0 <2.0.0
  10852. function replaceCarets (comp, options) {
  10853. return comp.trim().split(/\s+/).map(function (comp) {
  10854. return replaceCaret(comp, options)
  10855. }).join(' ')
  10856. }
  10857. function replaceCaret (comp, options) {
  10858. debug('caret', comp, options)
  10859. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10860. return comp.replace(r, function (_, M, m, p, pr) {
  10861. debug('caret', comp, _, M, m, p, pr)
  10862. var ret
  10863. if (isX(M)) {
  10864. ret = ''
  10865. } else if (isX(m)) {
  10866. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10867. } else if (isX(p)) {
  10868. if (M === '0') {
  10869. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10870. } else {
  10871. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10872. }
  10873. } else if (pr) {
  10874. debug('replaceCaret pr', pr)
  10875. if (M === '0') {
  10876. if (m === '0') {
  10877. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10878. ' <' + M + '.' + m + '.' + (+p + 1)
  10879. } else {
  10880. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10881. ' <' + M + '.' + (+m + 1) + '.0'
  10882. }
  10883. } else {
  10884. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10885. ' <' + (+M + 1) + '.0.0'
  10886. }
  10887. } else {
  10888. debug('no pr')
  10889. if (M === '0') {
  10890. if (m === '0') {
  10891. ret = '>=' + M + '.' + m + '.' + p +
  10892. ' <' + M + '.' + m + '.' + (+p + 1)
  10893. } else {
  10894. ret = '>=' + M + '.' + m + '.' + p +
  10895. ' <' + M + '.' + (+m + 1) + '.0'
  10896. }
  10897. } else {
  10898. ret = '>=' + M + '.' + m + '.' + p +
  10899. ' <' + (+M + 1) + '.0.0'
  10900. }
  10901. }
  10902. debug('caret return', ret)
  10903. return ret
  10904. })
  10905. }
  10906. function replaceXRanges (comp, options) {
  10907. debug('replaceXRanges', comp, options)
  10908. return comp.split(/\s+/).map(function (comp) {
  10909. return replaceXRange(comp, options)
  10910. }).join(' ')
  10911. }
  10912. function replaceXRange (comp, options) {
  10913. comp = comp.trim()
  10914. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10915. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10916. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10917. var xM = isX(M)
  10918. var xm = xM || isX(m)
  10919. var xp = xm || isX(p)
  10920. var anyX = xp
  10921. if (gtlt === '=' && anyX) {
  10922. gtlt = ''
  10923. }
  10924. // if we're including prereleases in the match, then we need
  10925. // to fix this to -0, the lowest possible prerelease value
  10926. pr = options.includePrerelease ? '-0' : ''
  10927. if (xM) {
  10928. if (gtlt === '>' || gtlt === '<') {
  10929. // nothing is allowed
  10930. ret = '<0.0.0-0'
  10931. } else {
  10932. // nothing is forbidden
  10933. ret = '*'
  10934. }
  10935. } else if (gtlt && anyX) {
  10936. // we know patch is an x, because we have any x at all.
  10937. // replace X with 0
  10938. if (xm) {
  10939. m = 0
  10940. }
  10941. p = 0
  10942. if (gtlt === '>') {
  10943. // >1 => >=2.0.0
  10944. // >1.2 => >=1.3.0
  10945. // >1.2.3 => >= 1.2.4
  10946. gtlt = '>='
  10947. if (xm) {
  10948. M = +M + 1
  10949. m = 0
  10950. p = 0
  10951. } else {
  10952. m = +m + 1
  10953. p = 0
  10954. }
  10955. } else if (gtlt === '<=') {
  10956. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10957. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10958. gtlt = '<'
  10959. if (xm) {
  10960. M = +M + 1
  10961. } else {
  10962. m = +m + 1
  10963. }
  10964. }
  10965. ret = gtlt + M + '.' + m + '.' + p + pr
  10966. } else if (xm) {
  10967. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10968. } else if (xp) {
  10969. ret = '>=' + M + '.' + m + '.0' + pr +
  10970. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10971. }
  10972. debug('xRange return', ret)
  10973. return ret
  10974. })
  10975. }
  10976. // Because * is AND-ed with everything else in the comparator,
  10977. // and '' means "any version", just remove the *s entirely.
  10978. function replaceStars (comp, options) {
  10979. debug('replaceStars', comp, options)
  10980. // Looseness is ignored here. star is always as loose as it gets!
  10981. return comp.trim().replace(re[t.STAR], '')
  10982. }
  10983. // This function is passed to string.replace(re[t.HYPHENRANGE])
  10984. // M, m, patch, prerelease, build
  10985. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  10986. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  10987. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  10988. function hyphenReplace ($0,
  10989. from, fM, fm, fp, fpr, fb,
  10990. to, tM, tm, tp, tpr, tb) {
  10991. if (isX(fM)) {
  10992. from = ''
  10993. } else if (isX(fm)) {
  10994. from = '>=' + fM + '.0.0'
  10995. } else if (isX(fp)) {
  10996. from = '>=' + fM + '.' + fm + '.0'
  10997. } else {
  10998. from = '>=' + from
  10999. }
  11000. if (isX(tM)) {
  11001. to = ''
  11002. } else if (isX(tm)) {
  11003. to = '<' + (+tM + 1) + '.0.0'
  11004. } else if (isX(tp)) {
  11005. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11006. } else if (tpr) {
  11007. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11008. } else {
  11009. to = '<=' + to
  11010. }
  11011. return (from + ' ' + to).trim()
  11012. }
  11013. // if ANY of the sets match ALL of its comparators, then pass
  11014. Range.prototype.test = function (version) {
  11015. if (!version) {
  11016. return false
  11017. }
  11018. if (typeof version === 'string') {
  11019. try {
  11020. version = new SemVer(version, this.options)
  11021. } catch (er) {
  11022. return false
  11023. }
  11024. }
  11025. for (var i = 0; i < this.set.length; i++) {
  11026. if (testSet(this.set[i], version, this.options)) {
  11027. return true
  11028. }
  11029. }
  11030. return false
  11031. }
  11032. function testSet (set, version, options) {
  11033. for (var i = 0; i < set.length; i++) {
  11034. if (!set[i].test(version)) {
  11035. return false
  11036. }
  11037. }
  11038. if (version.prerelease.length && !options.includePrerelease) {
  11039. // Find the set of versions that are allowed to have prereleases
  11040. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11041. // That should allow `1.2.3-pr.2` to pass.
  11042. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11043. // even though it's within the range set by the comparators.
  11044. for (i = 0; i < set.length; i++) {
  11045. debug(set[i].semver)
  11046. if (set[i].semver === ANY) {
  11047. continue
  11048. }
  11049. if (set[i].semver.prerelease.length > 0) {
  11050. var allowed = set[i].semver
  11051. if (allowed.major === version.major &&
  11052. allowed.minor === version.minor &&
  11053. allowed.patch === version.patch) {
  11054. return true
  11055. }
  11056. }
  11057. }
  11058. // Version has a -pre, but it's not one of the ones we like.
  11059. return false
  11060. }
  11061. return true
  11062. }
  11063. exports.satisfies = satisfies
  11064. function satisfies (version, range, options) {
  11065. try {
  11066. range = new Range(range, options)
  11067. } catch (er) {
  11068. return false
  11069. }
  11070. return range.test(version)
  11071. }
  11072. exports.maxSatisfying = maxSatisfying
  11073. function maxSatisfying (versions, range, options) {
  11074. var max = null
  11075. var maxSV = null
  11076. try {
  11077. var rangeObj = new Range(range, options)
  11078. } catch (er) {
  11079. return null
  11080. }
  11081. versions.forEach(function (v) {
  11082. if (rangeObj.test(v)) {
  11083. // satisfies(v, range, options)
  11084. if (!max || maxSV.compare(v) === -1) {
  11085. // compare(max, v, true)
  11086. max = v
  11087. maxSV = new SemVer(max, options)
  11088. }
  11089. }
  11090. })
  11091. return max
  11092. }
  11093. exports.minSatisfying = minSatisfying
  11094. function minSatisfying (versions, range, options) {
  11095. var min = null
  11096. var minSV = null
  11097. try {
  11098. var rangeObj = new Range(range, options)
  11099. } catch (er) {
  11100. return null
  11101. }
  11102. versions.forEach(function (v) {
  11103. if (rangeObj.test(v)) {
  11104. // satisfies(v, range, options)
  11105. if (!min || minSV.compare(v) === 1) {
  11106. // compare(min, v, true)
  11107. min = v
  11108. minSV = new SemVer(min, options)
  11109. }
  11110. }
  11111. })
  11112. return min
  11113. }
  11114. exports.minVersion = minVersion
  11115. function minVersion (range, loose) {
  11116. range = new Range(range, loose)
  11117. var minver = new SemVer('0.0.0')
  11118. if (range.test(minver)) {
  11119. return minver
  11120. }
  11121. minver = new SemVer('0.0.0-0')
  11122. if (range.test(minver)) {
  11123. return minver
  11124. }
  11125. minver = null
  11126. for (var i = 0; i < range.set.length; ++i) {
  11127. var comparators = range.set[i]
  11128. comparators.forEach(function (comparator) {
  11129. // Clone to avoid manipulating the comparator's semver object.
  11130. var compver = new SemVer(comparator.semver.version)
  11131. switch (comparator.operator) {
  11132. case '>':
  11133. if (compver.prerelease.length === 0) {
  11134. compver.patch++
  11135. } else {
  11136. compver.prerelease.push(0)
  11137. }
  11138. compver.raw = compver.format()
  11139. /* fallthrough */
  11140. case '':
  11141. case '>=':
  11142. if (!minver || gt(minver, compver)) {
  11143. minver = compver
  11144. }
  11145. break
  11146. case '<':
  11147. case '<=':
  11148. /* Ignore maximum versions */
  11149. break
  11150. /* istanbul ignore next */
  11151. default:
  11152. throw new Error('Unexpected operation: ' + comparator.operator)
  11153. }
  11154. })
  11155. }
  11156. if (minver && range.test(minver)) {
  11157. return minver
  11158. }
  11159. return null
  11160. }
  11161. exports.validRange = validRange
  11162. function validRange (range, options) {
  11163. try {
  11164. // Return '*' instead of '' so that truthiness works.
  11165. // This will throw if it's invalid anyway
  11166. return new Range(range, options).range || '*'
  11167. } catch (er) {
  11168. return null
  11169. }
  11170. }
  11171. // Determine if version is less than all the versions possible in the range
  11172. exports.ltr = ltr
  11173. function ltr (version, range, options) {
  11174. return outside(version, range, '<', options)
  11175. }
  11176. // Determine if version is greater than all the versions possible in the range.
  11177. exports.gtr = gtr
  11178. function gtr (version, range, options) {
  11179. return outside(version, range, '>', options)
  11180. }
  11181. exports.outside = outside
  11182. function outside (version, range, hilo, options) {
  11183. version = new SemVer(version, options)
  11184. range = new Range(range, options)
  11185. var gtfn, ltefn, ltfn, comp, ecomp
  11186. switch (hilo) {
  11187. case '>':
  11188. gtfn = gt
  11189. ltefn = lte
  11190. ltfn = lt
  11191. comp = '>'
  11192. ecomp = '>='
  11193. break
  11194. case '<':
  11195. gtfn = lt
  11196. ltefn = gte
  11197. ltfn = gt
  11198. comp = '<'
  11199. ecomp = '<='
  11200. break
  11201. default:
  11202. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11203. }
  11204. // If it satisifes the range it is not outside
  11205. if (satisfies(version, range, options)) {
  11206. return false
  11207. }
  11208. // From now on, variable terms are as if we're in "gtr" mode.
  11209. // but note that everything is flipped for the "ltr" function.
  11210. for (var i = 0; i < range.set.length; ++i) {
  11211. var comparators = range.set[i]
  11212. var high = null
  11213. var low = null
  11214. comparators.forEach(function (comparator) {
  11215. if (comparator.semver === ANY) {
  11216. comparator = new Comparator('>=0.0.0')
  11217. }
  11218. high = high || comparator
  11219. low = low || comparator
  11220. if (gtfn(comparator.semver, high.semver, options)) {
  11221. high = comparator
  11222. } else if (ltfn(comparator.semver, low.semver, options)) {
  11223. low = comparator
  11224. }
  11225. })
  11226. // If the edge version comparator has a operator then our version
  11227. // isn't outside it
  11228. if (high.operator === comp || high.operator === ecomp) {
  11229. return false
  11230. }
  11231. // If the lowest version comparator has an operator and our version
  11232. // is less than it then it isn't higher than the range
  11233. if ((!low.operator || low.operator === comp) &&
  11234. ltefn(version, low.semver)) {
  11235. return false
  11236. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11237. return false
  11238. }
  11239. }
  11240. return true
  11241. }
  11242. exports.prerelease = prerelease
  11243. function prerelease (version, options) {
  11244. var parsed = parse(version, options)
  11245. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11246. }
  11247. exports.intersects = intersects
  11248. function intersects (r1, r2, options) {
  11249. r1 = new Range(r1, options)
  11250. r2 = new Range(r2, options)
  11251. return r1.intersects(r2)
  11252. }
  11253. exports.coerce = coerce
  11254. function coerce (version, options) {
  11255. if (version instanceof SemVer) {
  11256. return version
  11257. }
  11258. if (typeof version === 'number') {
  11259. version = String(version)
  11260. }
  11261. if (typeof version !== 'string') {
  11262. return null
  11263. }
  11264. options = options || {}
  11265. var match = null
  11266. if (!options.rtl) {
  11267. match = version.match(re[t.COERCE])
  11268. } else {
  11269. // Find the right-most coercible string that does not share
  11270. // a terminus with a more left-ward coercible string.
  11271. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11272. //
  11273. // Walk through the string checking with a /g regexp
  11274. // Manually set the index so as to pick up overlapping matches.
  11275. // Stop when we get a match that ends at the string end, since no
  11276. // coercible string can be more right-ward without the same terminus.
  11277. var next
  11278. while ((next = re[t.COERCERTL].exec(version)) &&
  11279. (!match || match.index + match[0].length !== version.length)
  11280. ) {
  11281. if (!match ||
  11282. next.index + next[0].length !== match.index + match[0].length) {
  11283. match = next
  11284. }
  11285. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11286. }
  11287. // leave it in a clean state
  11288. re[t.COERCERTL].lastIndex = -1
  11289. }
  11290. if (match === null) {
  11291. return null
  11292. }
  11293. return parse(match[2] +
  11294. '.' + (match[3] || '0') +
  11295. '.' + (match[4] || '0'), options)
  11296. }
  11297. /***/ }),
  11298. /***/ 669:
  11299. /***/ (function(module) {
  11300. module.exports = require("util");
  11301. /***/ }),
  11302. /***/ 672:
  11303. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11304. "use strict";
  11305. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11306. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11307. return new (P || (P = Promise))(function (resolve, reject) {
  11308. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11309. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11310. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11311. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11312. });
  11313. };
  11314. var _a;
  11315. Object.defineProperty(exports, "__esModule", { value: true });
  11316. const assert_1 = __webpack_require__(357);
  11317. const fs = __webpack_require__(747);
  11318. const path = __webpack_require__(622);
  11319. _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;
  11320. exports.IS_WINDOWS = process.platform === 'win32';
  11321. function exists(fsPath) {
  11322. return __awaiter(this, void 0, void 0, function* () {
  11323. try {
  11324. yield exports.stat(fsPath);
  11325. }
  11326. catch (err) {
  11327. if (err.code === 'ENOENT') {
  11328. return false;
  11329. }
  11330. throw err;
  11331. }
  11332. return true;
  11333. });
  11334. }
  11335. exports.exists = exists;
  11336. function isDirectory(fsPath, useStat = false) {
  11337. return __awaiter(this, void 0, void 0, function* () {
  11338. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11339. return stats.isDirectory();
  11340. });
  11341. }
  11342. exports.isDirectory = isDirectory;
  11343. /**
  11344. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11345. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11346. */
  11347. function isRooted(p) {
  11348. p = normalizeSeparators(p);
  11349. if (!p) {
  11350. throw new Error('isRooted() parameter "p" cannot be empty');
  11351. }
  11352. if (exports.IS_WINDOWS) {
  11353. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11354. ); // e.g. C: or C:\hello
  11355. }
  11356. return p.startsWith('/');
  11357. }
  11358. exports.isRooted = isRooted;
  11359. /**
  11360. * Recursively create a directory at `fsPath`.
  11361. *
  11362. * This implementation is optimistic, meaning it attempts to create the full
  11363. * path first, and backs up the path stack from there.
  11364. *
  11365. * @param fsPath The path to create
  11366. * @param maxDepth The maximum recursion depth
  11367. * @param depth The current recursion depth
  11368. */
  11369. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11370. return __awaiter(this, void 0, void 0, function* () {
  11371. assert_1.ok(fsPath, 'a path argument must be provided');
  11372. fsPath = path.resolve(fsPath);
  11373. if (depth >= maxDepth)
  11374. return exports.mkdir(fsPath);
  11375. try {
  11376. yield exports.mkdir(fsPath);
  11377. return;
  11378. }
  11379. catch (err) {
  11380. switch (err.code) {
  11381. case 'ENOENT': {
  11382. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11383. yield exports.mkdir(fsPath);
  11384. return;
  11385. }
  11386. default: {
  11387. let stats;
  11388. try {
  11389. stats = yield exports.stat(fsPath);
  11390. }
  11391. catch (err2) {
  11392. throw err;
  11393. }
  11394. if (!stats.isDirectory())
  11395. throw err;
  11396. }
  11397. }
  11398. }
  11399. });
  11400. }
  11401. exports.mkdirP = mkdirP;
  11402. /**
  11403. * Best effort attempt to determine whether a file exists and is executable.
  11404. * @param filePath file path to check
  11405. * @param extensions additional file extensions to try
  11406. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11407. */
  11408. function tryGetExecutablePath(filePath, extensions) {
  11409. return __awaiter(this, void 0, void 0, function* () {
  11410. let stats = undefined;
  11411. try {
  11412. // test file exists
  11413. stats = yield exports.stat(filePath);
  11414. }
  11415. catch (err) {
  11416. if (err.code !== 'ENOENT') {
  11417. // eslint-disable-next-line no-console
  11418. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11419. }
  11420. }
  11421. if (stats && stats.isFile()) {
  11422. if (exports.IS_WINDOWS) {
  11423. // on Windows, test for valid extension
  11424. const upperExt = path.extname(filePath).toUpperCase();
  11425. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11426. return filePath;
  11427. }
  11428. }
  11429. else {
  11430. if (isUnixExecutable(stats)) {
  11431. return filePath;
  11432. }
  11433. }
  11434. }
  11435. // try each extension
  11436. const originalFilePath = filePath;
  11437. for (const extension of extensions) {
  11438. filePath = originalFilePath + extension;
  11439. stats = undefined;
  11440. try {
  11441. stats = yield exports.stat(filePath);
  11442. }
  11443. catch (err) {
  11444. if (err.code !== 'ENOENT') {
  11445. // eslint-disable-next-line no-console
  11446. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11447. }
  11448. }
  11449. if (stats && stats.isFile()) {
  11450. if (exports.IS_WINDOWS) {
  11451. // preserve the case of the actual file (since an extension was appended)
  11452. try {
  11453. const directory = path.dirname(filePath);
  11454. const upperName = path.basename(filePath).toUpperCase();
  11455. for (const actualName of yield exports.readdir(directory)) {
  11456. if (upperName === actualName.toUpperCase()) {
  11457. filePath = path.join(directory, actualName);
  11458. break;
  11459. }
  11460. }
  11461. }
  11462. catch (err) {
  11463. // eslint-disable-next-line no-console
  11464. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11465. }
  11466. return filePath;
  11467. }
  11468. else {
  11469. if (isUnixExecutable(stats)) {
  11470. return filePath;
  11471. }
  11472. }
  11473. }
  11474. }
  11475. return '';
  11476. });
  11477. }
  11478. exports.tryGetExecutablePath = tryGetExecutablePath;
  11479. function normalizeSeparators(p) {
  11480. p = p || '';
  11481. if (exports.IS_WINDOWS) {
  11482. // convert slashes on Windows
  11483. p = p.replace(/\//g, '\\');
  11484. // remove redundant slashes
  11485. return p.replace(/\\\\+/g, '\\');
  11486. }
  11487. // remove redundant slashes
  11488. return p.replace(/\/\/+/g, '/');
  11489. }
  11490. // on Mac/Linux, test the execute bit
  11491. // R W X R W X R W X
  11492. // 256 128 64 32 16 8 4 2 1
  11493. function isUnixExecutable(stats) {
  11494. return ((stats.mode & 1) > 0 ||
  11495. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11496. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11497. }
  11498. //# sourceMappingURL=io-util.js.map
  11499. /***/ }),
  11500. /***/ 674:
  11501. /***/ (function(module, __unusedexports, __webpack_require__) {
  11502. module.exports = authenticate;
  11503. const { Deprecation } = __webpack_require__(692);
  11504. const once = __webpack_require__(969);
  11505. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11506. function authenticate(state, options) {
  11507. deprecateAuthenticate(
  11508. state.octokit.log,
  11509. new Deprecation(
  11510. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11511. )
  11512. );
  11513. if (!options) {
  11514. state.auth = false;
  11515. return;
  11516. }
  11517. switch (options.type) {
  11518. case "basic":
  11519. if (!options.username || !options.password) {
  11520. throw new Error(
  11521. "Basic authentication requires both a username and password to be set"
  11522. );
  11523. }
  11524. break;
  11525. case "oauth":
  11526. if (!options.token && !(options.key && options.secret)) {
  11527. throw new Error(
  11528. "OAuth2 authentication requires a token or key & secret to be set"
  11529. );
  11530. }
  11531. break;
  11532. case "token":
  11533. case "app":
  11534. if (!options.token) {
  11535. throw new Error("Token authentication requires a token to be set");
  11536. }
  11537. break;
  11538. default:
  11539. throw new Error(
  11540. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11541. );
  11542. }
  11543. state.auth = options;
  11544. }
  11545. /***/ }),
  11546. /***/ 675:
  11547. /***/ (function(module) {
  11548. module.exports = function btoa(str) {
  11549. return new Buffer(str).toString('base64')
  11550. }
  11551. /***/ }),
  11552. /***/ 692:
  11553. /***/ (function(__unusedmodule, exports) {
  11554. "use strict";
  11555. Object.defineProperty(exports, '__esModule', { value: true });
  11556. class Deprecation extends Error {
  11557. constructor(message) {
  11558. super(message); // Maintains proper stack trace (only available on V8)
  11559. /* istanbul ignore next */
  11560. if (Error.captureStackTrace) {
  11561. Error.captureStackTrace(this, this.constructor);
  11562. }
  11563. this.name = 'Deprecation';
  11564. }
  11565. }
  11566. exports.Deprecation = Deprecation;
  11567. /***/ }),
  11568. /***/ 696:
  11569. /***/ (function(module) {
  11570. "use strict";
  11571. /*!
  11572. * isobject <https://github.com/jonschlinkert/isobject>
  11573. *
  11574. * Copyright (c) 2014-2017, Jon Schlinkert.
  11575. * Released under the MIT License.
  11576. */
  11577. function isObject(val) {
  11578. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11579. }
  11580. /*!
  11581. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11582. *
  11583. * Copyright (c) 2014-2017, Jon Schlinkert.
  11584. * Released under the MIT License.
  11585. */
  11586. function isObjectObject(o) {
  11587. return isObject(o) === true
  11588. && Object.prototype.toString.call(o) === '[object Object]';
  11589. }
  11590. function isPlainObject(o) {
  11591. var ctor,prot;
  11592. if (isObjectObject(o) === false) return false;
  11593. // If has modified constructor
  11594. ctor = o.constructor;
  11595. if (typeof ctor !== 'function') return false;
  11596. // If has modified prototype
  11597. prot = ctor.prototype;
  11598. if (isObjectObject(prot) === false) return false;
  11599. // If constructor does not have an Object-specific method
  11600. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11601. return false;
  11602. }
  11603. // Most likely a plain Object
  11604. return true;
  11605. }
  11606. module.exports = isPlainObject;
  11607. /***/ }),
  11608. /***/ 697:
  11609. /***/ (function(module) {
  11610. "use strict";
  11611. module.exports = (promise, onFinally) => {
  11612. onFinally = onFinally || (() => {});
  11613. return promise.then(
  11614. val => new Promise(resolve => {
  11615. resolve(onFinally());
  11616. }).then(() => val),
  11617. err => new Promise(resolve => {
  11618. resolve(onFinally());
  11619. }).then(() => {
  11620. throw err;
  11621. })
  11622. );
  11623. };
  11624. /***/ }),
  11625. /***/ 705:
  11626. /***/ (function(module) {
  11627. 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"}}};
  11628. /***/ }),
  11629. /***/ 722:
  11630. /***/ (function(module) {
  11631. /**
  11632. * Convert array of 16 byte values to UUID string format of the form:
  11633. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11634. */
  11635. var byteToHex = [];
  11636. for (var i = 0; i < 256; ++i) {
  11637. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11638. }
  11639. function bytesToUuid(buf, offset) {
  11640. var i = offset || 0;
  11641. var bth = byteToHex;
  11642. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11643. return ([bth[buf[i++]], bth[buf[i++]],
  11644. bth[buf[i++]], bth[buf[i++]], '-',
  11645. bth[buf[i++]], bth[buf[i++]], '-',
  11646. bth[buf[i++]], bth[buf[i++]], '-',
  11647. bth[buf[i++]], bth[buf[i++]], '-',
  11648. bth[buf[i++]], bth[buf[i++]],
  11649. bth[buf[i++]], bth[buf[i++]],
  11650. bth[buf[i++]], bth[buf[i++]]]).join('');
  11651. }
  11652. module.exports = bytesToUuid;
  11653. /***/ }),
  11654. /***/ 742:
  11655. /***/ (function(module, __unusedexports, __webpack_require__) {
  11656. var fs = __webpack_require__(747)
  11657. var core
  11658. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11659. core = __webpack_require__(818)
  11660. } else {
  11661. core = __webpack_require__(197)
  11662. }
  11663. module.exports = isexe
  11664. isexe.sync = sync
  11665. function isexe (path, options, cb) {
  11666. if (typeof options === 'function') {
  11667. cb = options
  11668. options = {}
  11669. }
  11670. if (!cb) {
  11671. if (typeof Promise !== 'function') {
  11672. throw new TypeError('callback not provided')
  11673. }
  11674. return new Promise(function (resolve, reject) {
  11675. isexe(path, options || {}, function (er, is) {
  11676. if (er) {
  11677. reject(er)
  11678. } else {
  11679. resolve(is)
  11680. }
  11681. })
  11682. })
  11683. }
  11684. core(path, options || {}, function (er, is) {
  11685. // ignore EACCES because that just means we aren't allowed to run it
  11686. if (er) {
  11687. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11688. er = null
  11689. is = false
  11690. }
  11691. }
  11692. cb(er, is)
  11693. })
  11694. }
  11695. function sync (path, options) {
  11696. // my kingdom for a filtered catch
  11697. try {
  11698. return core.sync(path, options || {})
  11699. } catch (er) {
  11700. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11701. return false
  11702. } else {
  11703. throw er
  11704. }
  11705. }
  11706. }
  11707. /***/ }),
  11708. /***/ 747:
  11709. /***/ (function(module) {
  11710. module.exports = require("fs");
  11711. /***/ }),
  11712. /***/ 753:
  11713. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11714. "use strict";
  11715. Object.defineProperty(exports, '__esModule', { value: true });
  11716. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11717. var endpoint = __webpack_require__(385);
  11718. var universalUserAgent = __webpack_require__(796);
  11719. var isPlainObject = _interopDefault(__webpack_require__(696));
  11720. var nodeFetch = _interopDefault(__webpack_require__(454));
  11721. var requestError = __webpack_require__(463);
  11722. const VERSION = "5.3.1";
  11723. function getBufferResponse(response) {
  11724. return response.arrayBuffer();
  11725. }
  11726. function fetchWrapper(requestOptions) {
  11727. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11728. requestOptions.body = JSON.stringify(requestOptions.body);
  11729. }
  11730. let headers = {};
  11731. let status;
  11732. let url;
  11733. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11734. return fetch(requestOptions.url, Object.assign({
  11735. method: requestOptions.method,
  11736. body: requestOptions.body,
  11737. headers: requestOptions.headers,
  11738. redirect: requestOptions.redirect
  11739. }, requestOptions.request)).then(response => {
  11740. url = response.url;
  11741. status = response.status;
  11742. for (const keyAndValue of response.headers) {
  11743. headers[keyAndValue[0]] = keyAndValue[1];
  11744. }
  11745. if (status === 204 || status === 205) {
  11746. return;
  11747. } // GitHub API returns 200 for HEAD requsets
  11748. if (requestOptions.method === "HEAD") {
  11749. if (status < 400) {
  11750. return;
  11751. }
  11752. throw new requestError.RequestError(response.statusText, status, {
  11753. headers,
  11754. request: requestOptions
  11755. });
  11756. }
  11757. if (status === 304) {
  11758. throw new requestError.RequestError("Not modified", status, {
  11759. headers,
  11760. request: requestOptions
  11761. });
  11762. }
  11763. if (status >= 400) {
  11764. return response.text().then(message => {
  11765. const error = new requestError.RequestError(message, status, {
  11766. headers,
  11767. request: requestOptions
  11768. });
  11769. try {
  11770. let responseBody = JSON.parse(error.message);
  11771. Object.assign(error, responseBody);
  11772. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11773. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11774. } catch (e) {// ignore, see octokit/rest.js#684
  11775. }
  11776. throw error;
  11777. });
  11778. }
  11779. const contentType = response.headers.get("content-type");
  11780. if (/application\/json/.test(contentType)) {
  11781. return response.json();
  11782. }
  11783. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11784. return response.text();
  11785. }
  11786. return getBufferResponse(response);
  11787. }).then(data => {
  11788. return {
  11789. status,
  11790. url,
  11791. headers,
  11792. data
  11793. };
  11794. }).catch(error => {
  11795. if (error instanceof requestError.RequestError) {
  11796. throw error;
  11797. }
  11798. throw new requestError.RequestError(error.message, 500, {
  11799. headers,
  11800. request: requestOptions
  11801. });
  11802. });
  11803. }
  11804. function withDefaults(oldEndpoint, newDefaults) {
  11805. const endpoint = oldEndpoint.defaults(newDefaults);
  11806. const newApi = function (route, parameters) {
  11807. const endpointOptions = endpoint.merge(route, parameters);
  11808. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11809. return fetchWrapper(endpoint.parse(endpointOptions));
  11810. }
  11811. const request = (route, parameters) => {
  11812. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11813. };
  11814. Object.assign(request, {
  11815. endpoint,
  11816. defaults: withDefaults.bind(null, endpoint)
  11817. });
  11818. return endpointOptions.request.hook(request, endpointOptions);
  11819. };
  11820. return Object.assign(newApi, {
  11821. endpoint,
  11822. defaults: withDefaults.bind(null, endpoint)
  11823. });
  11824. }
  11825. const request = withDefaults(endpoint.endpoint, {
  11826. headers: {
  11827. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11828. }
  11829. });
  11830. exports.request = request;
  11831. //# sourceMappingURL=index.js.map
  11832. /***/ }),
  11833. /***/ 761:
  11834. /***/ (function(module) {
  11835. module.exports = require("zlib");
  11836. /***/ }),
  11837. /***/ 763:
  11838. /***/ (function(module) {
  11839. module.exports = removeHook
  11840. function removeHook (state, name, method) {
  11841. if (!state.registry[name]) {
  11842. return
  11843. }
  11844. var index = state.registry[name]
  11845. .map(function (registered) { return registered.orig })
  11846. .indexOf(method)
  11847. if (index === -1) {
  11848. return
  11849. }
  11850. state.registry[name].splice(index, 1)
  11851. }
  11852. /***/ }),
  11853. /***/ 768:
  11854. /***/ (function(module) {
  11855. "use strict";
  11856. module.exports = function (x) {
  11857. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11858. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11859. if (x[x.length - 1] === lf) {
  11860. x = x.slice(0, x.length - 1);
  11861. }
  11862. if (x[x.length - 1] === cr) {
  11863. x = x.slice(0, x.length - 1);
  11864. }
  11865. return x;
  11866. };
  11867. /***/ }),
  11868. /***/ 777:
  11869. /***/ (function(module, __unusedexports, __webpack_require__) {
  11870. module.exports = getFirstPage
  11871. const getPage = __webpack_require__(265)
  11872. function getFirstPage (octokit, link, headers) {
  11873. return getPage(octokit, link, 'first', headers)
  11874. }
  11875. /***/ }),
  11876. /***/ 796:
  11877. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11878. "use strict";
  11879. Object.defineProperty(exports, '__esModule', { value: true });
  11880. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11881. var osName = _interopDefault(__webpack_require__(2));
  11882. function getUserAgent() {
  11883. try {
  11884. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  11885. } catch (error) {
  11886. if (/wmic os get Caption/.test(error.message)) {
  11887. return "Windows <version undetectable>";
  11888. }
  11889. throw error;
  11890. }
  11891. }
  11892. exports.getUserAgent = getUserAgent;
  11893. //# sourceMappingURL=index.js.map
  11894. /***/ }),
  11895. /***/ 807:
  11896. /***/ (function(module, __unusedexports, __webpack_require__) {
  11897. module.exports = paginate;
  11898. const iterator = __webpack_require__(8);
  11899. function paginate(octokit, route, options, mapFn) {
  11900. if (typeof options === "function") {
  11901. mapFn = options;
  11902. options = undefined;
  11903. }
  11904. options = octokit.request.endpoint.merge(route, options);
  11905. return gather(
  11906. octokit,
  11907. [],
  11908. iterator(octokit, options)[Symbol.asyncIterator](),
  11909. mapFn
  11910. );
  11911. }
  11912. function gather(octokit, results, iterator, mapFn) {
  11913. return iterator.next().then(result => {
  11914. if (result.done) {
  11915. return results;
  11916. }
  11917. let earlyExit = false;
  11918. function done() {
  11919. earlyExit = true;
  11920. }
  11921. results = results.concat(
  11922. mapFn ? mapFn(result.value, done) : result.value.data
  11923. );
  11924. if (earlyExit) {
  11925. return results;
  11926. }
  11927. return gather(octokit, results, iterator, mapFn);
  11928. });
  11929. }
  11930. /***/ }),
  11931. /***/ 813:
  11932. /***/ (function(__unusedmodule, exports) {
  11933. "use strict";
  11934. Object.defineProperty(exports, '__esModule', { value: true });
  11935. async function auth(token) {
  11936. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  11937. return {
  11938. type: "token",
  11939. token: token,
  11940. tokenType
  11941. };
  11942. }
  11943. /**
  11944. * Prefix token for usage in the Authorization header
  11945. *
  11946. * @param token OAuth token or JSON Web Token
  11947. */
  11948. function withAuthorizationPrefix(token) {
  11949. if (token.split(/\./).length === 3) {
  11950. return `bearer ${token}`;
  11951. }
  11952. return `token ${token}`;
  11953. }
  11954. async function hook(token, request, route, parameters) {
  11955. const endpoint = request.endpoint.merge(route, parameters);
  11956. endpoint.headers.authorization = withAuthorizationPrefix(token);
  11957. return request(endpoint);
  11958. }
  11959. const createTokenAuth = function createTokenAuth(token) {
  11960. if (!token) {
  11961. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  11962. }
  11963. if (typeof token !== "string") {
  11964. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  11965. }
  11966. token = token.replace(/^(token|bearer) +/i, "");
  11967. return Object.assign(auth.bind(null, token), {
  11968. hook: hook.bind(null, token)
  11969. });
  11970. };
  11971. exports.createTokenAuth = createTokenAuth;
  11972. //# sourceMappingURL=index.js.map
  11973. /***/ }),
  11974. /***/ 814:
  11975. /***/ (function(module, __unusedexports, __webpack_require__) {
  11976. module.exports = which
  11977. which.sync = whichSync
  11978. var isWindows = process.platform === 'win32' ||
  11979. process.env.OSTYPE === 'cygwin' ||
  11980. process.env.OSTYPE === 'msys'
  11981. var path = __webpack_require__(622)
  11982. var COLON = isWindows ? ';' : ':'
  11983. var isexe = __webpack_require__(742)
  11984. function getNotFoundError (cmd) {
  11985. var er = new Error('not found: ' + cmd)
  11986. er.code = 'ENOENT'
  11987. return er
  11988. }
  11989. function getPathInfo (cmd, opt) {
  11990. var colon = opt.colon || COLON
  11991. var pathEnv = opt.path || process.env.PATH || ''
  11992. var pathExt = ['']
  11993. pathEnv = pathEnv.split(colon)
  11994. var pathExtExe = ''
  11995. if (isWindows) {
  11996. pathEnv.unshift(process.cwd())
  11997. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  11998. pathExt = pathExtExe.split(colon)
  11999. // Always test the cmd itself first. isexe will check to make sure
  12000. // it's found in the pathExt set.
  12001. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12002. pathExt.unshift('')
  12003. }
  12004. // If it has a slash, then we don't bother searching the pathenv.
  12005. // just check the file itself, and that's it.
  12006. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12007. pathEnv = ['']
  12008. return {
  12009. env: pathEnv,
  12010. ext: pathExt,
  12011. extExe: pathExtExe
  12012. }
  12013. }
  12014. function which (cmd, opt, cb) {
  12015. if (typeof opt === 'function') {
  12016. cb = opt
  12017. opt = {}
  12018. }
  12019. var info = getPathInfo(cmd, opt)
  12020. var pathEnv = info.env
  12021. var pathExt = info.ext
  12022. var pathExtExe = info.extExe
  12023. var found = []
  12024. ;(function F (i, l) {
  12025. if (i === l) {
  12026. if (opt.all && found.length)
  12027. return cb(null, found)
  12028. else
  12029. return cb(getNotFoundError(cmd))
  12030. }
  12031. var pathPart = pathEnv[i]
  12032. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12033. pathPart = pathPart.slice(1, -1)
  12034. var p = path.join(pathPart, cmd)
  12035. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12036. p = cmd.slice(0, 2) + p
  12037. }
  12038. ;(function E (ii, ll) {
  12039. if (ii === ll) return F(i + 1, l)
  12040. var ext = pathExt[ii]
  12041. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12042. if (!er && is) {
  12043. if (opt.all)
  12044. found.push(p + ext)
  12045. else
  12046. return cb(null, p + ext)
  12047. }
  12048. return E(ii + 1, ll)
  12049. })
  12050. })(0, pathExt.length)
  12051. })(0, pathEnv.length)
  12052. }
  12053. function whichSync (cmd, opt) {
  12054. opt = opt || {}
  12055. var info = getPathInfo(cmd, opt)
  12056. var pathEnv = info.env
  12057. var pathExt = info.ext
  12058. var pathExtExe = info.extExe
  12059. var found = []
  12060. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12061. var pathPart = pathEnv[i]
  12062. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12063. pathPart = pathPart.slice(1, -1)
  12064. var p = path.join(pathPart, cmd)
  12065. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12066. p = cmd.slice(0, 2) + p
  12067. }
  12068. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12069. var cur = p + pathExt[j]
  12070. var is
  12071. try {
  12072. is = isexe.sync(cur, { pathExt: pathExtExe })
  12073. if (is) {
  12074. if (opt.all)
  12075. found.push(cur)
  12076. else
  12077. return cur
  12078. }
  12079. } catch (ex) {}
  12080. }
  12081. }
  12082. if (opt.all && found.length)
  12083. return found
  12084. if (opt.nothrow)
  12085. return null
  12086. throw getNotFoundError(cmd)
  12087. }
  12088. /***/ }),
  12089. /***/ 816:
  12090. /***/ (function(module) {
  12091. "use strict";
  12092. module.exports = /^#!.*/;
  12093. /***/ }),
  12094. /***/ 818:
  12095. /***/ (function(module, __unusedexports, __webpack_require__) {
  12096. module.exports = isexe
  12097. isexe.sync = sync
  12098. var fs = __webpack_require__(747)
  12099. function checkPathExt (path, options) {
  12100. var pathext = options.pathExt !== undefined ?
  12101. options.pathExt : process.env.PATHEXT
  12102. if (!pathext) {
  12103. return true
  12104. }
  12105. pathext = pathext.split(';')
  12106. if (pathext.indexOf('') !== -1) {
  12107. return true
  12108. }
  12109. for (var i = 0; i < pathext.length; i++) {
  12110. var p = pathext[i].toLowerCase()
  12111. if (p && path.substr(-p.length).toLowerCase() === p) {
  12112. return true
  12113. }
  12114. }
  12115. return false
  12116. }
  12117. function checkStat (stat, path, options) {
  12118. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12119. return false
  12120. }
  12121. return checkPathExt(path, options)
  12122. }
  12123. function isexe (path, options, cb) {
  12124. fs.stat(path, function (er, stat) {
  12125. cb(er, er ? false : checkStat(stat, path, options))
  12126. })
  12127. }
  12128. function sync (path, options) {
  12129. return checkStat(fs.statSync(path), path, options)
  12130. }
  12131. /***/ }),
  12132. /***/ 821:
  12133. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12134. "use strict";
  12135. var __importStar = (this && this.__importStar) || function (mod) {
  12136. if (mod && mod.__esModule) return mod;
  12137. var result = {};
  12138. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12139. result["default"] = mod;
  12140. return result;
  12141. };
  12142. Object.defineProperty(exports, "__esModule", { value: true });
  12143. const core = __importStar(__webpack_require__(470));
  12144. const fsHelper = __importStar(__webpack_require__(618));
  12145. const github = __importStar(__webpack_require__(469));
  12146. const path = __importStar(__webpack_require__(622));
  12147. const hostname = 'github.com';
  12148. function getInputs() {
  12149. const result = {};
  12150. // GitHub workspace
  12151. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12152. if (!githubWorkspacePath) {
  12153. throw new Error('GITHUB_WORKSPACE not defined');
  12154. }
  12155. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12156. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12157. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12158. // Qualified repository
  12159. const qualifiedRepository = core.getInput('repository') ||
  12160. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12161. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12162. const splitRepository = qualifiedRepository.split('/');
  12163. if (splitRepository.length !== 2 ||
  12164. !splitRepository[0] ||
  12165. !splitRepository[1]) {
  12166. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12167. }
  12168. result.repositoryOwner = splitRepository[0];
  12169. result.repositoryName = splitRepository[1];
  12170. // Repository path
  12171. result.repositoryPath = core.getInput('path') || '.';
  12172. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12173. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12174. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12175. }
  12176. // Workflow repository?
  12177. result.isWorkflowRepository =
  12178. qualifiedRepository.toUpperCase() ===
  12179. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12180. // Source branch, source version
  12181. result.ref = core.getInput('ref');
  12182. if (!result.ref) {
  12183. if (result.isWorkflowRepository) {
  12184. result.ref = github.context.ref;
  12185. result.commit = github.context.sha;
  12186. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12187. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12188. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12189. result.ref = `refs/heads/${result.ref}`;
  12190. }
  12191. }
  12192. if (!result.ref && !result.commit) {
  12193. result.ref = 'refs/heads/master';
  12194. }
  12195. }
  12196. // SHA?
  12197. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12198. result.commit = result.ref;
  12199. result.ref = '';
  12200. }
  12201. core.debug(`ref = '${result.ref}'`);
  12202. core.debug(`commit = '${result.commit}'`);
  12203. // Clean
  12204. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12205. core.debug(`clean = ${result.clean}`);
  12206. // Fetch depth
  12207. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12208. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12209. result.fetchDepth = 0;
  12210. }
  12211. core.debug(`fetch depth = ${result.fetchDepth}`);
  12212. // LFS
  12213. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12214. core.debug(`lfs = ${result.lfs}`);
  12215. // Submodules
  12216. result.submodules = false;
  12217. result.nestedSubmodules = false;
  12218. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12219. if (submodulesString == 'RECURSIVE') {
  12220. result.submodules = true;
  12221. result.nestedSubmodules = true;
  12222. }
  12223. else if (submodulesString == 'TRUE') {
  12224. result.submodules = true;
  12225. }
  12226. core.debug(`submodules = ${result.submodules}`);
  12227. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12228. // Auth token
  12229. result.authToken = core.getInput('token');
  12230. // SSH
  12231. result.sshKey = core.getInput('ssh-key');
  12232. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12233. result.sshStrict =
  12234. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12235. // Persist credentials
  12236. result.persistCredentials =
  12237. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12238. return result;
  12239. }
  12240. exports.getInputs = getInputs;
  12241. /***/ }),
  12242. /***/ 826:
  12243. /***/ (function(module, __unusedexports, __webpack_require__) {
  12244. var rng = __webpack_require__(139);
  12245. var bytesToUuid = __webpack_require__(722);
  12246. function v4(options, buf, offset) {
  12247. var i = buf && offset || 0;
  12248. if (typeof(options) == 'string') {
  12249. buf = options === 'binary' ? new Array(16) : null;
  12250. options = null;
  12251. }
  12252. options = options || {};
  12253. var rnds = options.random || (options.rng || rng)();
  12254. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12255. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12256. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12257. // Copy bytes to buffer, if provided
  12258. if (buf) {
  12259. for (var ii = 0; ii < 16; ++ii) {
  12260. buf[i + ii] = rnds[ii];
  12261. }
  12262. }
  12263. return buf || bytesToUuid(rnds);
  12264. }
  12265. module.exports = v4;
  12266. /***/ }),
  12267. /***/ 835:
  12268. /***/ (function(module) {
  12269. module.exports = require("url");
  12270. /***/ }),
  12271. /***/ 850:
  12272. /***/ (function(module, __unusedexports, __webpack_require__) {
  12273. module.exports = paginationMethodsPlugin
  12274. function paginationMethodsPlugin (octokit) {
  12275. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  12276. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  12277. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  12278. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  12279. octokit.hasFirstPage = __webpack_require__(536)
  12280. octokit.hasLastPage = __webpack_require__(336)
  12281. octokit.hasNextPage = __webpack_require__(929)
  12282. octokit.hasPreviousPage = __webpack_require__(558)
  12283. }
  12284. /***/ }),
  12285. /***/ 854:
  12286. /***/ (function(module) {
  12287. /**
  12288. * lodash (Custom Build) <https://lodash.com/>
  12289. * Build: `lodash modularize exports="npm" -o ./`
  12290. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12291. * Released under MIT license <https://lodash.com/license>
  12292. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12293. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12294. */
  12295. /** Used as the `TypeError` message for "Functions" methods. */
  12296. var FUNC_ERROR_TEXT = 'Expected a function';
  12297. /** Used to stand-in for `undefined` hash values. */
  12298. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12299. /** Used as references for various `Number` constants. */
  12300. var INFINITY = 1 / 0;
  12301. /** `Object#toString` result references. */
  12302. var funcTag = '[object Function]',
  12303. genTag = '[object GeneratorFunction]',
  12304. symbolTag = '[object Symbol]';
  12305. /** Used to match property names within property paths. */
  12306. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12307. reIsPlainProp = /^\w*$/,
  12308. reLeadingDot = /^\./,
  12309. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12310. /**
  12311. * Used to match `RegExp`
  12312. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12313. */
  12314. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12315. /** Used to match backslashes in property paths. */
  12316. var reEscapeChar = /\\(\\)?/g;
  12317. /** Used to detect host constructors (Safari). */
  12318. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12319. /** Detect free variable `global` from Node.js. */
  12320. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12321. /** Detect free variable `self`. */
  12322. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12323. /** Used as a reference to the global object. */
  12324. var root = freeGlobal || freeSelf || Function('return this')();
  12325. /**
  12326. * Gets the value at `key` of `object`.
  12327. *
  12328. * @private
  12329. * @param {Object} [object] The object to query.
  12330. * @param {string} key The key of the property to get.
  12331. * @returns {*} Returns the property value.
  12332. */
  12333. function getValue(object, key) {
  12334. return object == null ? undefined : object[key];
  12335. }
  12336. /**
  12337. * Checks if `value` is a host object in IE < 9.
  12338. *
  12339. * @private
  12340. * @param {*} value The value to check.
  12341. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12342. */
  12343. function isHostObject(value) {
  12344. // Many host objects are `Object` objects that can coerce to strings
  12345. // despite having improperly defined `toString` methods.
  12346. var result = false;
  12347. if (value != null && typeof value.toString != 'function') {
  12348. try {
  12349. result = !!(value + '');
  12350. } catch (e) {}
  12351. }
  12352. return result;
  12353. }
  12354. /** Used for built-in method references. */
  12355. var arrayProto = Array.prototype,
  12356. funcProto = Function.prototype,
  12357. objectProto = Object.prototype;
  12358. /** Used to detect overreaching core-js shims. */
  12359. var coreJsData = root['__core-js_shared__'];
  12360. /** Used to detect methods masquerading as native. */
  12361. var maskSrcKey = (function() {
  12362. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12363. return uid ? ('Symbol(src)_1.' + uid) : '';
  12364. }());
  12365. /** Used to resolve the decompiled source of functions. */
  12366. var funcToString = funcProto.toString;
  12367. /** Used to check objects for own properties. */
  12368. var hasOwnProperty = objectProto.hasOwnProperty;
  12369. /**
  12370. * Used to resolve the
  12371. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12372. * of values.
  12373. */
  12374. var objectToString = objectProto.toString;
  12375. /** Used to detect if a method is native. */
  12376. var reIsNative = RegExp('^' +
  12377. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12378. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12379. );
  12380. /** Built-in value references. */
  12381. var Symbol = root.Symbol,
  12382. splice = arrayProto.splice;
  12383. /* Built-in method references that are verified to be native. */
  12384. var Map = getNative(root, 'Map'),
  12385. nativeCreate = getNative(Object, 'create');
  12386. /** Used to convert symbols to primitives and strings. */
  12387. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12388. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12389. /**
  12390. * Creates a hash object.
  12391. *
  12392. * @private
  12393. * @constructor
  12394. * @param {Array} [entries] The key-value pairs to cache.
  12395. */
  12396. function Hash(entries) {
  12397. var index = -1,
  12398. length = entries ? entries.length : 0;
  12399. this.clear();
  12400. while (++index < length) {
  12401. var entry = entries[index];
  12402. this.set(entry[0], entry[1]);
  12403. }
  12404. }
  12405. /**
  12406. * Removes all key-value entries from the hash.
  12407. *
  12408. * @private
  12409. * @name clear
  12410. * @memberOf Hash
  12411. */
  12412. function hashClear() {
  12413. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12414. }
  12415. /**
  12416. * Removes `key` and its value from the hash.
  12417. *
  12418. * @private
  12419. * @name delete
  12420. * @memberOf Hash
  12421. * @param {Object} hash The hash to modify.
  12422. * @param {string} key The key of the value to remove.
  12423. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12424. */
  12425. function hashDelete(key) {
  12426. return this.has(key) && delete this.__data__[key];
  12427. }
  12428. /**
  12429. * Gets the hash value for `key`.
  12430. *
  12431. * @private
  12432. * @name get
  12433. * @memberOf Hash
  12434. * @param {string} key The key of the value to get.
  12435. * @returns {*} Returns the entry value.
  12436. */
  12437. function hashGet(key) {
  12438. var data = this.__data__;
  12439. if (nativeCreate) {
  12440. var result = data[key];
  12441. return result === HASH_UNDEFINED ? undefined : result;
  12442. }
  12443. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12444. }
  12445. /**
  12446. * Checks if a hash value for `key` exists.
  12447. *
  12448. * @private
  12449. * @name has
  12450. * @memberOf Hash
  12451. * @param {string} key The key of the entry to check.
  12452. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12453. */
  12454. function hashHas(key) {
  12455. var data = this.__data__;
  12456. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12457. }
  12458. /**
  12459. * Sets the hash `key` to `value`.
  12460. *
  12461. * @private
  12462. * @name set
  12463. * @memberOf Hash
  12464. * @param {string} key The key of the value to set.
  12465. * @param {*} value The value to set.
  12466. * @returns {Object} Returns the hash instance.
  12467. */
  12468. function hashSet(key, value) {
  12469. var data = this.__data__;
  12470. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12471. return this;
  12472. }
  12473. // Add methods to `Hash`.
  12474. Hash.prototype.clear = hashClear;
  12475. Hash.prototype['delete'] = hashDelete;
  12476. Hash.prototype.get = hashGet;
  12477. Hash.prototype.has = hashHas;
  12478. Hash.prototype.set = hashSet;
  12479. /**
  12480. * Creates an list cache object.
  12481. *
  12482. * @private
  12483. * @constructor
  12484. * @param {Array} [entries] The key-value pairs to cache.
  12485. */
  12486. function ListCache(entries) {
  12487. var index = -1,
  12488. length = entries ? entries.length : 0;
  12489. this.clear();
  12490. while (++index < length) {
  12491. var entry = entries[index];
  12492. this.set(entry[0], entry[1]);
  12493. }
  12494. }
  12495. /**
  12496. * Removes all key-value entries from the list cache.
  12497. *
  12498. * @private
  12499. * @name clear
  12500. * @memberOf ListCache
  12501. */
  12502. function listCacheClear() {
  12503. this.__data__ = [];
  12504. }
  12505. /**
  12506. * Removes `key` and its value from the list cache.
  12507. *
  12508. * @private
  12509. * @name delete
  12510. * @memberOf ListCache
  12511. * @param {string} key The key of the value to remove.
  12512. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12513. */
  12514. function listCacheDelete(key) {
  12515. var data = this.__data__,
  12516. index = assocIndexOf(data, key);
  12517. if (index < 0) {
  12518. return false;
  12519. }
  12520. var lastIndex = data.length - 1;
  12521. if (index == lastIndex) {
  12522. data.pop();
  12523. } else {
  12524. splice.call(data, index, 1);
  12525. }
  12526. return true;
  12527. }
  12528. /**
  12529. * Gets the list cache value for `key`.
  12530. *
  12531. * @private
  12532. * @name get
  12533. * @memberOf ListCache
  12534. * @param {string} key The key of the value to get.
  12535. * @returns {*} Returns the entry value.
  12536. */
  12537. function listCacheGet(key) {
  12538. var data = this.__data__,
  12539. index = assocIndexOf(data, key);
  12540. return index < 0 ? undefined : data[index][1];
  12541. }
  12542. /**
  12543. * Checks if a list cache value for `key` exists.
  12544. *
  12545. * @private
  12546. * @name has
  12547. * @memberOf ListCache
  12548. * @param {string} key The key of the entry to check.
  12549. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12550. */
  12551. function listCacheHas(key) {
  12552. return assocIndexOf(this.__data__, key) > -1;
  12553. }
  12554. /**
  12555. * Sets the list cache `key` to `value`.
  12556. *
  12557. * @private
  12558. * @name set
  12559. * @memberOf ListCache
  12560. * @param {string} key The key of the value to set.
  12561. * @param {*} value The value to set.
  12562. * @returns {Object} Returns the list cache instance.
  12563. */
  12564. function listCacheSet(key, value) {
  12565. var data = this.__data__,
  12566. index = assocIndexOf(data, key);
  12567. if (index < 0) {
  12568. data.push([key, value]);
  12569. } else {
  12570. data[index][1] = value;
  12571. }
  12572. return this;
  12573. }
  12574. // Add methods to `ListCache`.
  12575. ListCache.prototype.clear = listCacheClear;
  12576. ListCache.prototype['delete'] = listCacheDelete;
  12577. ListCache.prototype.get = listCacheGet;
  12578. ListCache.prototype.has = listCacheHas;
  12579. ListCache.prototype.set = listCacheSet;
  12580. /**
  12581. * Creates a map cache object to store key-value pairs.
  12582. *
  12583. * @private
  12584. * @constructor
  12585. * @param {Array} [entries] The key-value pairs to cache.
  12586. */
  12587. function MapCache(entries) {
  12588. var index = -1,
  12589. length = entries ? entries.length : 0;
  12590. this.clear();
  12591. while (++index < length) {
  12592. var entry = entries[index];
  12593. this.set(entry[0], entry[1]);
  12594. }
  12595. }
  12596. /**
  12597. * Removes all key-value entries from the map.
  12598. *
  12599. * @private
  12600. * @name clear
  12601. * @memberOf MapCache
  12602. */
  12603. function mapCacheClear() {
  12604. this.__data__ = {
  12605. 'hash': new Hash,
  12606. 'map': new (Map || ListCache),
  12607. 'string': new Hash
  12608. };
  12609. }
  12610. /**
  12611. * Removes `key` and its value from the map.
  12612. *
  12613. * @private
  12614. * @name delete
  12615. * @memberOf MapCache
  12616. * @param {string} key The key of the value to remove.
  12617. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12618. */
  12619. function mapCacheDelete(key) {
  12620. return getMapData(this, key)['delete'](key);
  12621. }
  12622. /**
  12623. * Gets the map value for `key`.
  12624. *
  12625. * @private
  12626. * @name get
  12627. * @memberOf MapCache
  12628. * @param {string} key The key of the value to get.
  12629. * @returns {*} Returns the entry value.
  12630. */
  12631. function mapCacheGet(key) {
  12632. return getMapData(this, key).get(key);
  12633. }
  12634. /**
  12635. * Checks if a map value for `key` exists.
  12636. *
  12637. * @private
  12638. * @name has
  12639. * @memberOf MapCache
  12640. * @param {string} key The key of the entry to check.
  12641. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12642. */
  12643. function mapCacheHas(key) {
  12644. return getMapData(this, key).has(key);
  12645. }
  12646. /**
  12647. * Sets the map `key` to `value`.
  12648. *
  12649. * @private
  12650. * @name set
  12651. * @memberOf MapCache
  12652. * @param {string} key The key of the value to set.
  12653. * @param {*} value The value to set.
  12654. * @returns {Object} Returns the map cache instance.
  12655. */
  12656. function mapCacheSet(key, value) {
  12657. getMapData(this, key).set(key, value);
  12658. return this;
  12659. }
  12660. // Add methods to `MapCache`.
  12661. MapCache.prototype.clear = mapCacheClear;
  12662. MapCache.prototype['delete'] = mapCacheDelete;
  12663. MapCache.prototype.get = mapCacheGet;
  12664. MapCache.prototype.has = mapCacheHas;
  12665. MapCache.prototype.set = mapCacheSet;
  12666. /**
  12667. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12668. *
  12669. * @private
  12670. * @param {Array} array The array to inspect.
  12671. * @param {*} key The key to search for.
  12672. * @returns {number} Returns the index of the matched value, else `-1`.
  12673. */
  12674. function assocIndexOf(array, key) {
  12675. var length = array.length;
  12676. while (length--) {
  12677. if (eq(array[length][0], key)) {
  12678. return length;
  12679. }
  12680. }
  12681. return -1;
  12682. }
  12683. /**
  12684. * The base implementation of `_.get` without support for default values.
  12685. *
  12686. * @private
  12687. * @param {Object} object The object to query.
  12688. * @param {Array|string} path The path of the property to get.
  12689. * @returns {*} Returns the resolved value.
  12690. */
  12691. function baseGet(object, path) {
  12692. path = isKey(path, object) ? [path] : castPath(path);
  12693. var index = 0,
  12694. length = path.length;
  12695. while (object != null && index < length) {
  12696. object = object[toKey(path[index++])];
  12697. }
  12698. return (index && index == length) ? object : undefined;
  12699. }
  12700. /**
  12701. * The base implementation of `_.isNative` without bad shim checks.
  12702. *
  12703. * @private
  12704. * @param {*} value The value to check.
  12705. * @returns {boolean} Returns `true` if `value` is a native function,
  12706. * else `false`.
  12707. */
  12708. function baseIsNative(value) {
  12709. if (!isObject(value) || isMasked(value)) {
  12710. return false;
  12711. }
  12712. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12713. return pattern.test(toSource(value));
  12714. }
  12715. /**
  12716. * The base implementation of `_.toString` which doesn't convert nullish
  12717. * values to empty strings.
  12718. *
  12719. * @private
  12720. * @param {*} value The value to process.
  12721. * @returns {string} Returns the string.
  12722. */
  12723. function baseToString(value) {
  12724. // Exit early for strings to avoid a performance hit in some environments.
  12725. if (typeof value == 'string') {
  12726. return value;
  12727. }
  12728. if (isSymbol(value)) {
  12729. return symbolToString ? symbolToString.call(value) : '';
  12730. }
  12731. var result = (value + '');
  12732. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12733. }
  12734. /**
  12735. * Casts `value` to a path array if it's not one.
  12736. *
  12737. * @private
  12738. * @param {*} value The value to inspect.
  12739. * @returns {Array} Returns the cast property path array.
  12740. */
  12741. function castPath(value) {
  12742. return isArray(value) ? value : stringToPath(value);
  12743. }
  12744. /**
  12745. * Gets the data for `map`.
  12746. *
  12747. * @private
  12748. * @param {Object} map The map to query.
  12749. * @param {string} key The reference key.
  12750. * @returns {*} Returns the map data.
  12751. */
  12752. function getMapData(map, key) {
  12753. var data = map.__data__;
  12754. return isKeyable(key)
  12755. ? data[typeof key == 'string' ? 'string' : 'hash']
  12756. : data.map;
  12757. }
  12758. /**
  12759. * Gets the native function at `key` of `object`.
  12760. *
  12761. * @private
  12762. * @param {Object} object The object to query.
  12763. * @param {string} key The key of the method to get.
  12764. * @returns {*} Returns the function if it's native, else `undefined`.
  12765. */
  12766. function getNative(object, key) {
  12767. var value = getValue(object, key);
  12768. return baseIsNative(value) ? value : undefined;
  12769. }
  12770. /**
  12771. * Checks if `value` is a property name and not a property path.
  12772. *
  12773. * @private
  12774. * @param {*} value The value to check.
  12775. * @param {Object} [object] The object to query keys on.
  12776. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12777. */
  12778. function isKey(value, object) {
  12779. if (isArray(value)) {
  12780. return false;
  12781. }
  12782. var type = typeof value;
  12783. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12784. value == null || isSymbol(value)) {
  12785. return true;
  12786. }
  12787. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12788. (object != null && value in Object(object));
  12789. }
  12790. /**
  12791. * Checks if `value` is suitable for use as unique object key.
  12792. *
  12793. * @private
  12794. * @param {*} value The value to check.
  12795. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12796. */
  12797. function isKeyable(value) {
  12798. var type = typeof value;
  12799. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12800. ? (value !== '__proto__')
  12801. : (value === null);
  12802. }
  12803. /**
  12804. * Checks if `func` has its source masked.
  12805. *
  12806. * @private
  12807. * @param {Function} func The function to check.
  12808. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12809. */
  12810. function isMasked(func) {
  12811. return !!maskSrcKey && (maskSrcKey in func);
  12812. }
  12813. /**
  12814. * Converts `string` to a property path array.
  12815. *
  12816. * @private
  12817. * @param {string} string The string to convert.
  12818. * @returns {Array} Returns the property path array.
  12819. */
  12820. var stringToPath = memoize(function(string) {
  12821. string = toString(string);
  12822. var result = [];
  12823. if (reLeadingDot.test(string)) {
  12824. result.push('');
  12825. }
  12826. string.replace(rePropName, function(match, number, quote, string) {
  12827. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  12828. });
  12829. return result;
  12830. });
  12831. /**
  12832. * Converts `value` to a string key if it's not a string or symbol.
  12833. *
  12834. * @private
  12835. * @param {*} value The value to inspect.
  12836. * @returns {string|symbol} Returns the key.
  12837. */
  12838. function toKey(value) {
  12839. if (typeof value == 'string' || isSymbol(value)) {
  12840. return value;
  12841. }
  12842. var result = (value + '');
  12843. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12844. }
  12845. /**
  12846. * Converts `func` to its source code.
  12847. *
  12848. * @private
  12849. * @param {Function} func The function to process.
  12850. * @returns {string} Returns the source code.
  12851. */
  12852. function toSource(func) {
  12853. if (func != null) {
  12854. try {
  12855. return funcToString.call(func);
  12856. } catch (e) {}
  12857. try {
  12858. return (func + '');
  12859. } catch (e) {}
  12860. }
  12861. return '';
  12862. }
  12863. /**
  12864. * Creates a function that memoizes the result of `func`. If `resolver` is
  12865. * provided, it determines the cache key for storing the result based on the
  12866. * arguments provided to the memoized function. By default, the first argument
  12867. * provided to the memoized function is used as the map cache key. The `func`
  12868. * is invoked with the `this` binding of the memoized function.
  12869. *
  12870. * **Note:** The cache is exposed as the `cache` property on the memoized
  12871. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  12872. * constructor with one whose instances implement the
  12873. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  12874. * method interface of `delete`, `get`, `has`, and `set`.
  12875. *
  12876. * @static
  12877. * @memberOf _
  12878. * @since 0.1.0
  12879. * @category Function
  12880. * @param {Function} func The function to have its output memoized.
  12881. * @param {Function} [resolver] The function to resolve the cache key.
  12882. * @returns {Function} Returns the new memoized function.
  12883. * @example
  12884. *
  12885. * var object = { 'a': 1, 'b': 2 };
  12886. * var other = { 'c': 3, 'd': 4 };
  12887. *
  12888. * var values = _.memoize(_.values);
  12889. * values(object);
  12890. * // => [1, 2]
  12891. *
  12892. * values(other);
  12893. * // => [3, 4]
  12894. *
  12895. * object.a = 2;
  12896. * values(object);
  12897. * // => [1, 2]
  12898. *
  12899. * // Modify the result cache.
  12900. * values.cache.set(object, ['a', 'b']);
  12901. * values(object);
  12902. * // => ['a', 'b']
  12903. *
  12904. * // Replace `_.memoize.Cache`.
  12905. * _.memoize.Cache = WeakMap;
  12906. */
  12907. function memoize(func, resolver) {
  12908. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  12909. throw new TypeError(FUNC_ERROR_TEXT);
  12910. }
  12911. var memoized = function() {
  12912. var args = arguments,
  12913. key = resolver ? resolver.apply(this, args) : args[0],
  12914. cache = memoized.cache;
  12915. if (cache.has(key)) {
  12916. return cache.get(key);
  12917. }
  12918. var result = func.apply(this, args);
  12919. memoized.cache = cache.set(key, result);
  12920. return result;
  12921. };
  12922. memoized.cache = new (memoize.Cache || MapCache);
  12923. return memoized;
  12924. }
  12925. // Assign cache to `_.memoize`.
  12926. memoize.Cache = MapCache;
  12927. /**
  12928. * Performs a
  12929. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12930. * comparison between two values to determine if they are equivalent.
  12931. *
  12932. * @static
  12933. * @memberOf _
  12934. * @since 4.0.0
  12935. * @category Lang
  12936. * @param {*} value The value to compare.
  12937. * @param {*} other The other value to compare.
  12938. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12939. * @example
  12940. *
  12941. * var object = { 'a': 1 };
  12942. * var other = { 'a': 1 };
  12943. *
  12944. * _.eq(object, object);
  12945. * // => true
  12946. *
  12947. * _.eq(object, other);
  12948. * // => false
  12949. *
  12950. * _.eq('a', 'a');
  12951. * // => true
  12952. *
  12953. * _.eq('a', Object('a'));
  12954. * // => false
  12955. *
  12956. * _.eq(NaN, NaN);
  12957. * // => true
  12958. */
  12959. function eq(value, other) {
  12960. return value === other || (value !== value && other !== other);
  12961. }
  12962. /**
  12963. * Checks if `value` is classified as an `Array` object.
  12964. *
  12965. * @static
  12966. * @memberOf _
  12967. * @since 0.1.0
  12968. * @category Lang
  12969. * @param {*} value The value to check.
  12970. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12971. * @example
  12972. *
  12973. * _.isArray([1, 2, 3]);
  12974. * // => true
  12975. *
  12976. * _.isArray(document.body.children);
  12977. * // => false
  12978. *
  12979. * _.isArray('abc');
  12980. * // => false
  12981. *
  12982. * _.isArray(_.noop);
  12983. * // => false
  12984. */
  12985. var isArray = Array.isArray;
  12986. /**
  12987. * Checks if `value` is classified as a `Function` object.
  12988. *
  12989. * @static
  12990. * @memberOf _
  12991. * @since 0.1.0
  12992. * @category Lang
  12993. * @param {*} value The value to check.
  12994. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12995. * @example
  12996. *
  12997. * _.isFunction(_);
  12998. * // => true
  12999. *
  13000. * _.isFunction(/abc/);
  13001. * // => false
  13002. */
  13003. function isFunction(value) {
  13004. // The use of `Object#toString` avoids issues with the `typeof` operator
  13005. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  13006. var tag = isObject(value) ? objectToString.call(value) : '';
  13007. return tag == funcTag || tag == genTag;
  13008. }
  13009. /**
  13010. * Checks if `value` is the
  13011. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  13012. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  13013. *
  13014. * @static
  13015. * @memberOf _
  13016. * @since 0.1.0
  13017. * @category Lang
  13018. * @param {*} value The value to check.
  13019. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  13020. * @example
  13021. *
  13022. * _.isObject({});
  13023. * // => true
  13024. *
  13025. * _.isObject([1, 2, 3]);
  13026. * // => true
  13027. *
  13028. * _.isObject(_.noop);
  13029. * // => true
  13030. *
  13031. * _.isObject(null);
  13032. * // => false
  13033. */
  13034. function isObject(value) {
  13035. var type = typeof value;
  13036. return !!value && (type == 'object' || type == 'function');
  13037. }
  13038. /**
  13039. * Checks if `value` is object-like. A value is object-like if it's not `null`
  13040. * and has a `typeof` result of "object".
  13041. *
  13042. * @static
  13043. * @memberOf _
  13044. * @since 4.0.0
  13045. * @category Lang
  13046. * @param {*} value The value to check.
  13047. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  13048. * @example
  13049. *
  13050. * _.isObjectLike({});
  13051. * // => true
  13052. *
  13053. * _.isObjectLike([1, 2, 3]);
  13054. * // => true
  13055. *
  13056. * _.isObjectLike(_.noop);
  13057. * // => false
  13058. *
  13059. * _.isObjectLike(null);
  13060. * // => false
  13061. */
  13062. function isObjectLike(value) {
  13063. return !!value && typeof value == 'object';
  13064. }
  13065. /**
  13066. * Checks if `value` is classified as a `Symbol` primitive or object.
  13067. *
  13068. * @static
  13069. * @memberOf _
  13070. * @since 4.0.0
  13071. * @category Lang
  13072. * @param {*} value The value to check.
  13073. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13074. * @example
  13075. *
  13076. * _.isSymbol(Symbol.iterator);
  13077. * // => true
  13078. *
  13079. * _.isSymbol('abc');
  13080. * // => false
  13081. */
  13082. function isSymbol(value) {
  13083. return typeof value == 'symbol' ||
  13084. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13085. }
  13086. /**
  13087. * Converts `value` to a string. An empty string is returned for `null`
  13088. * and `undefined` values. The sign of `-0` is preserved.
  13089. *
  13090. * @static
  13091. * @memberOf _
  13092. * @since 4.0.0
  13093. * @category Lang
  13094. * @param {*} value The value to process.
  13095. * @returns {string} Returns the string.
  13096. * @example
  13097. *
  13098. * _.toString(null);
  13099. * // => ''
  13100. *
  13101. * _.toString(-0);
  13102. * // => '-0'
  13103. *
  13104. * _.toString([1, 2, 3]);
  13105. * // => '1,2,3'
  13106. */
  13107. function toString(value) {
  13108. return value == null ? '' : baseToString(value);
  13109. }
  13110. /**
  13111. * Gets the value at `path` of `object`. If the resolved value is
  13112. * `undefined`, the `defaultValue` is returned in its place.
  13113. *
  13114. * @static
  13115. * @memberOf _
  13116. * @since 3.7.0
  13117. * @category Object
  13118. * @param {Object} object The object to query.
  13119. * @param {Array|string} path The path of the property to get.
  13120. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13121. * @returns {*} Returns the resolved value.
  13122. * @example
  13123. *
  13124. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13125. *
  13126. * _.get(object, 'a[0].b.c');
  13127. * // => 3
  13128. *
  13129. * _.get(object, ['a', '0', 'b', 'c']);
  13130. * // => 3
  13131. *
  13132. * _.get(object, 'a.b.c', 'default');
  13133. * // => 'default'
  13134. */
  13135. function get(object, path, defaultValue) {
  13136. var result = object == null ? undefined : baseGet(object, path);
  13137. return result === undefined ? defaultValue : result;
  13138. }
  13139. module.exports = get;
  13140. /***/ }),
  13141. /***/ 855:
  13142. /***/ (function(module, __unusedexports, __webpack_require__) {
  13143. module.exports = registerPlugin;
  13144. const factory = __webpack_require__(47);
  13145. function registerPlugin(plugins, pluginFunction) {
  13146. return factory(
  13147. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  13148. );
  13149. }
  13150. /***/ }),
  13151. /***/ 856:
  13152. /***/ (function(module, __unusedexports, __webpack_require__) {
  13153. module.exports = __webpack_require__(141);
  13154. /***/ }),
  13155. /***/ 863:
  13156. /***/ (function(module, __unusedexports, __webpack_require__) {
  13157. module.exports = authenticationBeforeRequest;
  13158. const btoa = __webpack_require__(675);
  13159. const withAuthorizationPrefix = __webpack_require__(143);
  13160. function authenticationBeforeRequest(state, options) {
  13161. if (typeof state.auth === "string") {
  13162. options.headers.authorization = withAuthorizationPrefix(state.auth);
  13163. return;
  13164. }
  13165. if (state.auth.username) {
  13166. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  13167. options.headers.authorization = `Basic ${hash}`;
  13168. if (state.otp) {
  13169. options.headers["x-github-otp"] = state.otp;
  13170. }
  13171. return;
  13172. }
  13173. if (state.auth.clientId) {
  13174. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  13175. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  13176. // URL though: `/applications/:client_id/tokens/:access_token`.
  13177. //
  13178. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  13179. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  13180. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  13181. //
  13182. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  13183. // as well as "/applications/123/tokens/token456"
  13184. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  13185. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  13186. options.headers.authorization = `Basic ${hash}`;
  13187. return;
  13188. }
  13189. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  13190. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  13191. return;
  13192. }
  13193. return Promise.resolve()
  13194. .then(() => {
  13195. return state.auth();
  13196. })
  13197. .then(authorization => {
  13198. options.headers.authorization = withAuthorizationPrefix(authorization);
  13199. });
  13200. }
  13201. /***/ }),
  13202. /***/ 866:
  13203. /***/ (function(module, __unusedexports, __webpack_require__) {
  13204. "use strict";
  13205. var shebangRegex = __webpack_require__(816);
  13206. module.exports = function (str) {
  13207. var match = str.match(shebangRegex);
  13208. if (!match) {
  13209. return null;
  13210. }
  13211. var arr = match[0].replace(/#! ?/, '').split(' ');
  13212. var bin = arr[0].split('/').pop();
  13213. var arg = arr[1];
  13214. return (bin === 'env' ?
  13215. arg :
  13216. bin + (arg ? ' ' + arg : '')
  13217. );
  13218. };
  13219. /***/ }),
  13220. /***/ 874:
  13221. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13222. "use strict";
  13223. // Copyright (c) Microsoft. All rights reserved.
  13224. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  13225. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13226. return new (P || (P = Promise))(function (resolve, reject) {
  13227. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13228. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13229. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  13230. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13231. });
  13232. };
  13233. Object.defineProperty(exports, "__esModule", { value: true });
  13234. const url = __webpack_require__(835);
  13235. const http = __webpack_require__(605);
  13236. const https = __webpack_require__(211);
  13237. let fs;
  13238. let tunnel;
  13239. var HttpCodes;
  13240. (function (HttpCodes) {
  13241. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  13242. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  13243. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  13244. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  13245. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  13246. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  13247. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  13248. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  13249. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  13250. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  13251. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  13252. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  13253. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  13254. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  13255. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  13256. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  13257. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  13258. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  13259. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  13260. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  13261. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  13262. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  13263. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  13264. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  13265. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  13266. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  13267. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  13268. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  13269. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  13270. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  13271. const ExponentialBackoffCeiling = 10;
  13272. const ExponentialBackoffTimeSlice = 5;
  13273. class HttpClientResponse {
  13274. constructor(message) {
  13275. this.message = message;
  13276. }
  13277. readBody() {
  13278. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  13279. let output = '';
  13280. this.message.on('data', (chunk) => {
  13281. output += chunk;
  13282. });
  13283. this.message.on('end', () => {
  13284. resolve(output);
  13285. });
  13286. }));
  13287. }
  13288. }
  13289. exports.HttpClientResponse = HttpClientResponse;
  13290. function isHttps(requestUrl) {
  13291. let parsedUrl = url.parse(requestUrl);
  13292. return parsedUrl.protocol === 'https:';
  13293. }
  13294. exports.isHttps = isHttps;
  13295. var EnvironmentVariables;
  13296. (function (EnvironmentVariables) {
  13297. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  13298. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  13299. })(EnvironmentVariables || (EnvironmentVariables = {}));
  13300. class HttpClient {
  13301. constructor(userAgent, handlers, requestOptions) {
  13302. this._ignoreSslError = false;
  13303. this._allowRedirects = true;
  13304. this._maxRedirects = 50;
  13305. this._allowRetries = false;
  13306. this._maxRetries = 1;
  13307. this._keepAlive = false;
  13308. this._disposed = false;
  13309. this.userAgent = userAgent;
  13310. this.handlers = handlers || [];
  13311. this.requestOptions = requestOptions;
  13312. if (requestOptions) {
  13313. if (requestOptions.ignoreSslError != null) {
  13314. this._ignoreSslError = requestOptions.ignoreSslError;
  13315. }
  13316. this._socketTimeout = requestOptions.socketTimeout;
  13317. this._httpProxy = requestOptions.proxy;
  13318. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  13319. this._httpProxyBypassHosts = [];
  13320. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  13321. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  13322. });
  13323. }
  13324. this._certConfig = requestOptions.cert;
  13325. if (this._certConfig) {
  13326. // If using cert, need fs
  13327. fs = __webpack_require__(747);
  13328. // cache the cert content into memory, so we don't have to read it from disk every time
  13329. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  13330. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  13331. }
  13332. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  13333. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  13334. }
  13335. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  13336. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  13337. }
  13338. }
  13339. if (requestOptions.allowRedirects != null) {
  13340. this._allowRedirects = requestOptions.allowRedirects;
  13341. }
  13342. if (requestOptions.maxRedirects != null) {
  13343. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  13344. }
  13345. if (requestOptions.keepAlive != null) {
  13346. this._keepAlive = requestOptions.keepAlive;
  13347. }
  13348. if (requestOptions.allowRetries != null) {
  13349. this._allowRetries = requestOptions.allowRetries;
  13350. }
  13351. if (requestOptions.maxRetries != null) {
  13352. this._maxRetries = requestOptions.maxRetries;
  13353. }
  13354. }
  13355. }
  13356. options(requestUrl, additionalHeaders) {
  13357. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  13358. }
  13359. get(requestUrl, additionalHeaders) {
  13360. return this.request('GET', requestUrl, null, additionalHeaders || {});
  13361. }
  13362. del(requestUrl, additionalHeaders) {
  13363. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  13364. }
  13365. post(requestUrl, data, additionalHeaders) {
  13366. return this.request('POST', requestUrl, data, additionalHeaders || {});
  13367. }
  13368. patch(requestUrl, data, additionalHeaders) {
  13369. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  13370. }
  13371. put(requestUrl, data, additionalHeaders) {
  13372. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  13373. }
  13374. head(requestUrl, additionalHeaders) {
  13375. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  13376. }
  13377. sendStream(verb, requestUrl, stream, additionalHeaders) {
  13378. return this.request(verb, requestUrl, stream, additionalHeaders);
  13379. }
  13380. /**
  13381. * Makes a raw http request.
  13382. * All other methods such as get, post, patch, and request ultimately call this.
  13383. * Prefer get, del, post and patch
  13384. */
  13385. request(verb, requestUrl, data, headers) {
  13386. return __awaiter(this, void 0, void 0, function* () {
  13387. if (this._disposed) {
  13388. throw new Error("Client has already been disposed.");
  13389. }
  13390. let info = this._prepareRequest(verb, requestUrl, headers);
  13391. // Only perform retries on reads since writes may not be idempotent.
  13392. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  13393. let numTries = 0;
  13394. let response;
  13395. while (numTries < maxTries) {
  13396. response = yield this.requestRaw(info, data);
  13397. // Check if it's an authentication challenge
  13398. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  13399. let authenticationHandler;
  13400. for (let i = 0; i < this.handlers.length; i++) {
  13401. if (this.handlers[i].canHandleAuthentication(response)) {
  13402. authenticationHandler = this.handlers[i];
  13403. break;
  13404. }
  13405. }
  13406. if (authenticationHandler) {
  13407. return authenticationHandler.handleAuthentication(this, info, data);
  13408. }
  13409. else {
  13410. // We have received an unauthorized response but have no handlers to handle it.
  13411. // Let the response return to the caller.
  13412. return response;
  13413. }
  13414. }
  13415. let redirectsRemaining = this._maxRedirects;
  13416. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  13417. && this._allowRedirects
  13418. && redirectsRemaining > 0) {
  13419. const redirectUrl = response.message.headers["location"];
  13420. if (!redirectUrl) {
  13421. // if there's no location to redirect to, we won't
  13422. break;
  13423. }
  13424. // we need to finish reading the response before reassigning response
  13425. // which will leak the open socket.
  13426. yield response.readBody();
  13427. // let's make the request with the new redirectUrl
  13428. info = this._prepareRequest(verb, redirectUrl, headers);
  13429. response = yield this.requestRaw(info, data);
  13430. redirectsRemaining--;
  13431. }
  13432. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  13433. // If not a retry code, return immediately instead of retrying
  13434. return response;
  13435. }
  13436. numTries += 1;
  13437. if (numTries < maxTries) {
  13438. yield response.readBody();
  13439. yield this._performExponentialBackoff(numTries);
  13440. }
  13441. }
  13442. return response;
  13443. });
  13444. }
  13445. /**
  13446. * Needs to be called if keepAlive is set to true in request options.
  13447. */
  13448. dispose() {
  13449. if (this._agent) {
  13450. this._agent.destroy();
  13451. }
  13452. this._disposed = true;
  13453. }
  13454. /**
  13455. * Raw request.
  13456. * @param info
  13457. * @param data
  13458. */
  13459. requestRaw(info, data) {
  13460. return new Promise((resolve, reject) => {
  13461. let callbackForResult = function (err, res) {
  13462. if (err) {
  13463. reject(err);
  13464. }
  13465. resolve(res);
  13466. };
  13467. this.requestRawWithCallback(info, data, callbackForResult);
  13468. });
  13469. }
  13470. /**
  13471. * Raw request with callback.
  13472. * @param info
  13473. * @param data
  13474. * @param onResult
  13475. */
  13476. requestRawWithCallback(info, data, onResult) {
  13477. let socket;
  13478. let isDataString = typeof (data) === 'string';
  13479. if (typeof (data) === 'string') {
  13480. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13481. }
  13482. let callbackCalled = false;
  13483. let handleResult = (err, res) => {
  13484. if (!callbackCalled) {
  13485. callbackCalled = true;
  13486. onResult(err, res);
  13487. }
  13488. };
  13489. let req = info.httpModule.request(info.options, (msg) => {
  13490. let res = new HttpClientResponse(msg);
  13491. handleResult(null, res);
  13492. });
  13493. req.on('socket', (sock) => {
  13494. socket = sock;
  13495. });
  13496. // If we ever get disconnected, we want the socket to timeout eventually
  13497. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13498. if (socket) {
  13499. socket.end();
  13500. }
  13501. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13502. });
  13503. req.on('error', function (err) {
  13504. // err has statusCode property
  13505. // res should have headers
  13506. handleResult(err, null);
  13507. });
  13508. if (data && typeof (data) === 'string') {
  13509. req.write(data, 'utf8');
  13510. }
  13511. if (data && typeof (data) !== 'string') {
  13512. data.on('close', function () {
  13513. req.end();
  13514. });
  13515. data.pipe(req);
  13516. }
  13517. else {
  13518. req.end();
  13519. }
  13520. }
  13521. _prepareRequest(method, requestUrl, headers) {
  13522. const info = {};
  13523. info.parsedUrl = url.parse(requestUrl);
  13524. const usingSsl = info.parsedUrl.protocol === 'https:';
  13525. info.httpModule = usingSsl ? https : http;
  13526. const defaultPort = usingSsl ? 443 : 80;
  13527. info.options = {};
  13528. info.options.host = info.parsedUrl.hostname;
  13529. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13530. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13531. info.options.method = method;
  13532. info.options.headers = this._mergeHeaders(headers);
  13533. info.options.headers["user-agent"] = this.userAgent;
  13534. info.options.agent = this._getAgent(requestUrl);
  13535. // gives handlers an opportunity to participate
  13536. if (this.handlers && !this._isPresigned(requestUrl)) {
  13537. this.handlers.forEach((handler) => {
  13538. handler.prepareRequest(info.options);
  13539. });
  13540. }
  13541. return info;
  13542. }
  13543. _isPresigned(requestUrl) {
  13544. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13545. const patterns = this.requestOptions.presignedUrlPatterns;
  13546. for (let i = 0; i < patterns.length; i++) {
  13547. if (requestUrl.match(patterns[i])) {
  13548. return true;
  13549. }
  13550. }
  13551. }
  13552. return false;
  13553. }
  13554. _mergeHeaders(headers) {
  13555. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13556. if (this.requestOptions && this.requestOptions.headers) {
  13557. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13558. }
  13559. return lowercaseKeys(headers || {});
  13560. }
  13561. _getAgent(requestUrl) {
  13562. let agent;
  13563. let proxy = this._getProxy(requestUrl);
  13564. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13565. if (this._keepAlive && useProxy) {
  13566. agent = this._proxyAgent;
  13567. }
  13568. if (this._keepAlive && !useProxy) {
  13569. agent = this._agent;
  13570. }
  13571. // if agent is already assigned use that agent.
  13572. if (!!agent) {
  13573. return agent;
  13574. }
  13575. let parsedUrl = url.parse(requestUrl);
  13576. const usingSsl = parsedUrl.protocol === 'https:';
  13577. let maxSockets = 100;
  13578. if (!!this.requestOptions) {
  13579. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13580. }
  13581. if (useProxy) {
  13582. // If using proxy, need tunnel
  13583. if (!tunnel) {
  13584. tunnel = __webpack_require__(856);
  13585. }
  13586. const agentOptions = {
  13587. maxSockets: maxSockets,
  13588. keepAlive: this._keepAlive,
  13589. proxy: {
  13590. proxyAuth: proxy.proxyAuth,
  13591. host: proxy.proxyUrl.hostname,
  13592. port: proxy.proxyUrl.port
  13593. },
  13594. };
  13595. let tunnelAgent;
  13596. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13597. if (usingSsl) {
  13598. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13599. }
  13600. else {
  13601. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13602. }
  13603. agent = tunnelAgent(agentOptions);
  13604. this._proxyAgent = agent;
  13605. }
  13606. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13607. if (this._keepAlive && !agent) {
  13608. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13609. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13610. this._agent = agent;
  13611. }
  13612. // if not using private agent and tunnel agent isn't setup then use global agent
  13613. if (!agent) {
  13614. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13615. }
  13616. if (usingSsl && this._ignoreSslError) {
  13617. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13618. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13619. // we have to cast it to any and change it directly
  13620. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13621. }
  13622. if (usingSsl && this._certConfig) {
  13623. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13624. }
  13625. return agent;
  13626. }
  13627. _getProxy(requestUrl) {
  13628. const parsedUrl = url.parse(requestUrl);
  13629. let usingSsl = parsedUrl.protocol === 'https:';
  13630. let proxyConfig = this._httpProxy;
  13631. // fallback to http_proxy and https_proxy env
  13632. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13633. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13634. if (!proxyConfig) {
  13635. if (https_proxy && usingSsl) {
  13636. proxyConfig = {
  13637. proxyUrl: https_proxy
  13638. };
  13639. }
  13640. else if (http_proxy) {
  13641. proxyConfig = {
  13642. proxyUrl: http_proxy
  13643. };
  13644. }
  13645. }
  13646. let proxyUrl;
  13647. let proxyAuth;
  13648. if (proxyConfig) {
  13649. if (proxyConfig.proxyUrl.length > 0) {
  13650. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13651. }
  13652. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13653. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13654. }
  13655. }
  13656. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13657. }
  13658. _isBypassProxy(requestUrl) {
  13659. if (!this._httpProxyBypassHosts) {
  13660. return false;
  13661. }
  13662. let bypass = false;
  13663. this._httpProxyBypassHosts.forEach(bypassHost => {
  13664. if (bypassHost.test(requestUrl)) {
  13665. bypass = true;
  13666. }
  13667. });
  13668. return bypass;
  13669. }
  13670. _performExponentialBackoff(retryNumber) {
  13671. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13672. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13673. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13674. }
  13675. }
  13676. exports.HttpClient = HttpClient;
  13677. /***/ }),
  13678. /***/ 881:
  13679. /***/ (function(module) {
  13680. "use strict";
  13681. const isWin = process.platform === 'win32';
  13682. function notFoundError(original, syscall) {
  13683. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13684. code: 'ENOENT',
  13685. errno: 'ENOENT',
  13686. syscall: `${syscall} ${original.command}`,
  13687. path: original.command,
  13688. spawnargs: original.args,
  13689. });
  13690. }
  13691. function hookChildProcess(cp, parsed) {
  13692. if (!isWin) {
  13693. return;
  13694. }
  13695. const originalEmit = cp.emit;
  13696. cp.emit = function (name, arg1) {
  13697. // If emitting "exit" event and exit code is 1, we need to check if
  13698. // the command exists and emit an "error" instead
  13699. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13700. if (name === 'exit') {
  13701. const err = verifyENOENT(arg1, parsed, 'spawn');
  13702. if (err) {
  13703. return originalEmit.call(cp, 'error', err);
  13704. }
  13705. }
  13706. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13707. };
  13708. }
  13709. function verifyENOENT(status, parsed) {
  13710. if (isWin && status === 1 && !parsed.file) {
  13711. return notFoundError(parsed.original, 'spawn');
  13712. }
  13713. return null;
  13714. }
  13715. function verifyENOENTSync(status, parsed) {
  13716. if (isWin && status === 1 && !parsed.file) {
  13717. return notFoundError(parsed.original, 'spawnSync');
  13718. }
  13719. return null;
  13720. }
  13721. module.exports = {
  13722. hookChildProcess,
  13723. verifyENOENT,
  13724. verifyENOENTSync,
  13725. notFoundError,
  13726. };
  13727. /***/ }),
  13728. /***/ 883:
  13729. /***/ (function(module) {
  13730. /**
  13731. * lodash (Custom Build) <https://lodash.com/>
  13732. * Build: `lodash modularize exports="npm" -o ./`
  13733. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13734. * Released under MIT license <https://lodash.com/license>
  13735. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13736. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13737. */
  13738. /** Used as the `TypeError` message for "Functions" methods. */
  13739. var FUNC_ERROR_TEXT = 'Expected a function';
  13740. /** Used to stand-in for `undefined` hash values. */
  13741. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13742. /** Used as references for various `Number` constants. */
  13743. var INFINITY = 1 / 0,
  13744. MAX_SAFE_INTEGER = 9007199254740991;
  13745. /** `Object#toString` result references. */
  13746. var funcTag = '[object Function]',
  13747. genTag = '[object GeneratorFunction]',
  13748. symbolTag = '[object Symbol]';
  13749. /** Used to match property names within property paths. */
  13750. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13751. reIsPlainProp = /^\w*$/,
  13752. reLeadingDot = /^\./,
  13753. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13754. /**
  13755. * Used to match `RegExp`
  13756. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13757. */
  13758. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13759. /** Used to match backslashes in property paths. */
  13760. var reEscapeChar = /\\(\\)?/g;
  13761. /** Used to detect host constructors (Safari). */
  13762. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13763. /** Used to detect unsigned integer values. */
  13764. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13765. /** Detect free variable `global` from Node.js. */
  13766. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13767. /** Detect free variable `self`. */
  13768. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13769. /** Used as a reference to the global object. */
  13770. var root = freeGlobal || freeSelf || Function('return this')();
  13771. /**
  13772. * Gets the value at `key` of `object`.
  13773. *
  13774. * @private
  13775. * @param {Object} [object] The object to query.
  13776. * @param {string} key The key of the property to get.
  13777. * @returns {*} Returns the property value.
  13778. */
  13779. function getValue(object, key) {
  13780. return object == null ? undefined : object[key];
  13781. }
  13782. /**
  13783. * Checks if `value` is a host object in IE < 9.
  13784. *
  13785. * @private
  13786. * @param {*} value The value to check.
  13787. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13788. */
  13789. function isHostObject(value) {
  13790. // Many host objects are `Object` objects that can coerce to strings
  13791. // despite having improperly defined `toString` methods.
  13792. var result = false;
  13793. if (value != null && typeof value.toString != 'function') {
  13794. try {
  13795. result = !!(value + '');
  13796. } catch (e) {}
  13797. }
  13798. return result;
  13799. }
  13800. /** Used for built-in method references. */
  13801. var arrayProto = Array.prototype,
  13802. funcProto = Function.prototype,
  13803. objectProto = Object.prototype;
  13804. /** Used to detect overreaching core-js shims. */
  13805. var coreJsData = root['__core-js_shared__'];
  13806. /** Used to detect methods masquerading as native. */
  13807. var maskSrcKey = (function() {
  13808. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  13809. return uid ? ('Symbol(src)_1.' + uid) : '';
  13810. }());
  13811. /** Used to resolve the decompiled source of functions. */
  13812. var funcToString = funcProto.toString;
  13813. /** Used to check objects for own properties. */
  13814. var hasOwnProperty = objectProto.hasOwnProperty;
  13815. /**
  13816. * Used to resolve the
  13817. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  13818. * of values.
  13819. */
  13820. var objectToString = objectProto.toString;
  13821. /** Used to detect if a method is native. */
  13822. var reIsNative = RegExp('^' +
  13823. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  13824. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  13825. );
  13826. /** Built-in value references. */
  13827. var Symbol = root.Symbol,
  13828. splice = arrayProto.splice;
  13829. /* Built-in method references that are verified to be native. */
  13830. var Map = getNative(root, 'Map'),
  13831. nativeCreate = getNative(Object, 'create');
  13832. /** Used to convert symbols to primitives and strings. */
  13833. var symbolProto = Symbol ? Symbol.prototype : undefined,
  13834. symbolToString = symbolProto ? symbolProto.toString : undefined;
  13835. /**
  13836. * Creates a hash object.
  13837. *
  13838. * @private
  13839. * @constructor
  13840. * @param {Array} [entries] The key-value pairs to cache.
  13841. */
  13842. function Hash(entries) {
  13843. var index = -1,
  13844. length = entries ? entries.length : 0;
  13845. this.clear();
  13846. while (++index < length) {
  13847. var entry = entries[index];
  13848. this.set(entry[0], entry[1]);
  13849. }
  13850. }
  13851. /**
  13852. * Removes all key-value entries from the hash.
  13853. *
  13854. * @private
  13855. * @name clear
  13856. * @memberOf Hash
  13857. */
  13858. function hashClear() {
  13859. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  13860. }
  13861. /**
  13862. * Removes `key` and its value from the hash.
  13863. *
  13864. * @private
  13865. * @name delete
  13866. * @memberOf Hash
  13867. * @param {Object} hash The hash to modify.
  13868. * @param {string} key The key of the value to remove.
  13869. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13870. */
  13871. function hashDelete(key) {
  13872. return this.has(key) && delete this.__data__[key];
  13873. }
  13874. /**
  13875. * Gets the hash value for `key`.
  13876. *
  13877. * @private
  13878. * @name get
  13879. * @memberOf Hash
  13880. * @param {string} key The key of the value to get.
  13881. * @returns {*} Returns the entry value.
  13882. */
  13883. function hashGet(key) {
  13884. var data = this.__data__;
  13885. if (nativeCreate) {
  13886. var result = data[key];
  13887. return result === HASH_UNDEFINED ? undefined : result;
  13888. }
  13889. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  13890. }
  13891. /**
  13892. * Checks if a hash value for `key` exists.
  13893. *
  13894. * @private
  13895. * @name has
  13896. * @memberOf Hash
  13897. * @param {string} key The key of the entry to check.
  13898. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13899. */
  13900. function hashHas(key) {
  13901. var data = this.__data__;
  13902. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  13903. }
  13904. /**
  13905. * Sets the hash `key` to `value`.
  13906. *
  13907. * @private
  13908. * @name set
  13909. * @memberOf Hash
  13910. * @param {string} key The key of the value to set.
  13911. * @param {*} value The value to set.
  13912. * @returns {Object} Returns the hash instance.
  13913. */
  13914. function hashSet(key, value) {
  13915. var data = this.__data__;
  13916. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  13917. return this;
  13918. }
  13919. // Add methods to `Hash`.
  13920. Hash.prototype.clear = hashClear;
  13921. Hash.prototype['delete'] = hashDelete;
  13922. Hash.prototype.get = hashGet;
  13923. Hash.prototype.has = hashHas;
  13924. Hash.prototype.set = hashSet;
  13925. /**
  13926. * Creates an list cache object.
  13927. *
  13928. * @private
  13929. * @constructor
  13930. * @param {Array} [entries] The key-value pairs to cache.
  13931. */
  13932. function ListCache(entries) {
  13933. var index = -1,
  13934. length = entries ? entries.length : 0;
  13935. this.clear();
  13936. while (++index < length) {
  13937. var entry = entries[index];
  13938. this.set(entry[0], entry[1]);
  13939. }
  13940. }
  13941. /**
  13942. * Removes all key-value entries from the list cache.
  13943. *
  13944. * @private
  13945. * @name clear
  13946. * @memberOf ListCache
  13947. */
  13948. function listCacheClear() {
  13949. this.__data__ = [];
  13950. }
  13951. /**
  13952. * Removes `key` and its value from the list cache.
  13953. *
  13954. * @private
  13955. * @name delete
  13956. * @memberOf ListCache
  13957. * @param {string} key The key of the value to remove.
  13958. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13959. */
  13960. function listCacheDelete(key) {
  13961. var data = this.__data__,
  13962. index = assocIndexOf(data, key);
  13963. if (index < 0) {
  13964. return false;
  13965. }
  13966. var lastIndex = data.length - 1;
  13967. if (index == lastIndex) {
  13968. data.pop();
  13969. } else {
  13970. splice.call(data, index, 1);
  13971. }
  13972. return true;
  13973. }
  13974. /**
  13975. * Gets the list cache value for `key`.
  13976. *
  13977. * @private
  13978. * @name get
  13979. * @memberOf ListCache
  13980. * @param {string} key The key of the value to get.
  13981. * @returns {*} Returns the entry value.
  13982. */
  13983. function listCacheGet(key) {
  13984. var data = this.__data__,
  13985. index = assocIndexOf(data, key);
  13986. return index < 0 ? undefined : data[index][1];
  13987. }
  13988. /**
  13989. * Checks if a list cache value for `key` exists.
  13990. *
  13991. * @private
  13992. * @name has
  13993. * @memberOf ListCache
  13994. * @param {string} key The key of the entry to check.
  13995. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13996. */
  13997. function listCacheHas(key) {
  13998. return assocIndexOf(this.__data__, key) > -1;
  13999. }
  14000. /**
  14001. * Sets the list cache `key` to `value`.
  14002. *
  14003. * @private
  14004. * @name set
  14005. * @memberOf ListCache
  14006. * @param {string} key The key of the value to set.
  14007. * @param {*} value The value to set.
  14008. * @returns {Object} Returns the list cache instance.
  14009. */
  14010. function listCacheSet(key, value) {
  14011. var data = this.__data__,
  14012. index = assocIndexOf(data, key);
  14013. if (index < 0) {
  14014. data.push([key, value]);
  14015. } else {
  14016. data[index][1] = value;
  14017. }
  14018. return this;
  14019. }
  14020. // Add methods to `ListCache`.
  14021. ListCache.prototype.clear = listCacheClear;
  14022. ListCache.prototype['delete'] = listCacheDelete;
  14023. ListCache.prototype.get = listCacheGet;
  14024. ListCache.prototype.has = listCacheHas;
  14025. ListCache.prototype.set = listCacheSet;
  14026. /**
  14027. * Creates a map cache object to store key-value pairs.
  14028. *
  14029. * @private
  14030. * @constructor
  14031. * @param {Array} [entries] The key-value pairs to cache.
  14032. */
  14033. function MapCache(entries) {
  14034. var index = -1,
  14035. length = entries ? entries.length : 0;
  14036. this.clear();
  14037. while (++index < length) {
  14038. var entry = entries[index];
  14039. this.set(entry[0], entry[1]);
  14040. }
  14041. }
  14042. /**
  14043. * Removes all key-value entries from the map.
  14044. *
  14045. * @private
  14046. * @name clear
  14047. * @memberOf MapCache
  14048. */
  14049. function mapCacheClear() {
  14050. this.__data__ = {
  14051. 'hash': new Hash,
  14052. 'map': new (Map || ListCache),
  14053. 'string': new Hash
  14054. };
  14055. }
  14056. /**
  14057. * Removes `key` and its value from the map.
  14058. *
  14059. * @private
  14060. * @name delete
  14061. * @memberOf MapCache
  14062. * @param {string} key The key of the value to remove.
  14063. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  14064. */
  14065. function mapCacheDelete(key) {
  14066. return getMapData(this, key)['delete'](key);
  14067. }
  14068. /**
  14069. * Gets the map value for `key`.
  14070. *
  14071. * @private
  14072. * @name get
  14073. * @memberOf MapCache
  14074. * @param {string} key The key of the value to get.
  14075. * @returns {*} Returns the entry value.
  14076. */
  14077. function mapCacheGet(key) {
  14078. return getMapData(this, key).get(key);
  14079. }
  14080. /**
  14081. * Checks if a map value for `key` exists.
  14082. *
  14083. * @private
  14084. * @name has
  14085. * @memberOf MapCache
  14086. * @param {string} key The key of the entry to check.
  14087. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14088. */
  14089. function mapCacheHas(key) {
  14090. return getMapData(this, key).has(key);
  14091. }
  14092. /**
  14093. * Sets the map `key` to `value`.
  14094. *
  14095. * @private
  14096. * @name set
  14097. * @memberOf MapCache
  14098. * @param {string} key The key of the value to set.
  14099. * @param {*} value The value to set.
  14100. * @returns {Object} Returns the map cache instance.
  14101. */
  14102. function mapCacheSet(key, value) {
  14103. getMapData(this, key).set(key, value);
  14104. return this;
  14105. }
  14106. // Add methods to `MapCache`.
  14107. MapCache.prototype.clear = mapCacheClear;
  14108. MapCache.prototype['delete'] = mapCacheDelete;
  14109. MapCache.prototype.get = mapCacheGet;
  14110. MapCache.prototype.has = mapCacheHas;
  14111. MapCache.prototype.set = mapCacheSet;
  14112. /**
  14113. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  14114. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14115. * for equality comparisons.
  14116. *
  14117. * @private
  14118. * @param {Object} object The object to modify.
  14119. * @param {string} key The key of the property to assign.
  14120. * @param {*} value The value to assign.
  14121. */
  14122. function assignValue(object, key, value) {
  14123. var objValue = object[key];
  14124. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  14125. (value === undefined && !(key in object))) {
  14126. object[key] = value;
  14127. }
  14128. }
  14129. /**
  14130. * Gets the index at which the `key` is found in `array` of key-value pairs.
  14131. *
  14132. * @private
  14133. * @param {Array} array The array to inspect.
  14134. * @param {*} key The key to search for.
  14135. * @returns {number} Returns the index of the matched value, else `-1`.
  14136. */
  14137. function assocIndexOf(array, key) {
  14138. var length = array.length;
  14139. while (length--) {
  14140. if (eq(array[length][0], key)) {
  14141. return length;
  14142. }
  14143. }
  14144. return -1;
  14145. }
  14146. /**
  14147. * The base implementation of `_.isNative` without bad shim checks.
  14148. *
  14149. * @private
  14150. * @param {*} value The value to check.
  14151. * @returns {boolean} Returns `true` if `value` is a native function,
  14152. * else `false`.
  14153. */
  14154. function baseIsNative(value) {
  14155. if (!isObject(value) || isMasked(value)) {
  14156. return false;
  14157. }
  14158. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  14159. return pattern.test(toSource(value));
  14160. }
  14161. /**
  14162. * The base implementation of `_.set`.
  14163. *
  14164. * @private
  14165. * @param {Object} object The object to modify.
  14166. * @param {Array|string} path The path of the property to set.
  14167. * @param {*} value The value to set.
  14168. * @param {Function} [customizer] The function to customize path creation.
  14169. * @returns {Object} Returns `object`.
  14170. */
  14171. function baseSet(object, path, value, customizer) {
  14172. if (!isObject(object)) {
  14173. return object;
  14174. }
  14175. path = isKey(path, object) ? [path] : castPath(path);
  14176. var index = -1,
  14177. length = path.length,
  14178. lastIndex = length - 1,
  14179. nested = object;
  14180. while (nested != null && ++index < length) {
  14181. var key = toKey(path[index]),
  14182. newValue = value;
  14183. if (index != lastIndex) {
  14184. var objValue = nested[key];
  14185. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  14186. if (newValue === undefined) {
  14187. newValue = isObject(objValue)
  14188. ? objValue
  14189. : (isIndex(path[index + 1]) ? [] : {});
  14190. }
  14191. }
  14192. assignValue(nested, key, newValue);
  14193. nested = nested[key];
  14194. }
  14195. return object;
  14196. }
  14197. /**
  14198. * The base implementation of `_.toString` which doesn't convert nullish
  14199. * values to empty strings.
  14200. *
  14201. * @private
  14202. * @param {*} value The value to process.
  14203. * @returns {string} Returns the string.
  14204. */
  14205. function baseToString(value) {
  14206. // Exit early for strings to avoid a performance hit in some environments.
  14207. if (typeof value == 'string') {
  14208. return value;
  14209. }
  14210. if (isSymbol(value)) {
  14211. return symbolToString ? symbolToString.call(value) : '';
  14212. }
  14213. var result = (value + '');
  14214. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14215. }
  14216. /**
  14217. * Casts `value` to a path array if it's not one.
  14218. *
  14219. * @private
  14220. * @param {*} value The value to inspect.
  14221. * @returns {Array} Returns the cast property path array.
  14222. */
  14223. function castPath(value) {
  14224. return isArray(value) ? value : stringToPath(value);
  14225. }
  14226. /**
  14227. * Gets the data for `map`.
  14228. *
  14229. * @private
  14230. * @param {Object} map The map to query.
  14231. * @param {string} key The reference key.
  14232. * @returns {*} Returns the map data.
  14233. */
  14234. function getMapData(map, key) {
  14235. var data = map.__data__;
  14236. return isKeyable(key)
  14237. ? data[typeof key == 'string' ? 'string' : 'hash']
  14238. : data.map;
  14239. }
  14240. /**
  14241. * Gets the native function at `key` of `object`.
  14242. *
  14243. * @private
  14244. * @param {Object} object The object to query.
  14245. * @param {string} key The key of the method to get.
  14246. * @returns {*} Returns the function if it's native, else `undefined`.
  14247. */
  14248. function getNative(object, key) {
  14249. var value = getValue(object, key);
  14250. return baseIsNative(value) ? value : undefined;
  14251. }
  14252. /**
  14253. * Checks if `value` is a valid array-like index.
  14254. *
  14255. * @private
  14256. * @param {*} value The value to check.
  14257. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  14258. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  14259. */
  14260. function isIndex(value, length) {
  14261. length = length == null ? MAX_SAFE_INTEGER : length;
  14262. return !!length &&
  14263. (typeof value == 'number' || reIsUint.test(value)) &&
  14264. (value > -1 && value % 1 == 0 && value < length);
  14265. }
  14266. /**
  14267. * Checks if `value` is a property name and not a property path.
  14268. *
  14269. * @private
  14270. * @param {*} value The value to check.
  14271. * @param {Object} [object] The object to query keys on.
  14272. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  14273. */
  14274. function isKey(value, object) {
  14275. if (isArray(value)) {
  14276. return false;
  14277. }
  14278. var type = typeof value;
  14279. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  14280. value == null || isSymbol(value)) {
  14281. return true;
  14282. }
  14283. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  14284. (object != null && value in Object(object));
  14285. }
  14286. /**
  14287. * Checks if `value` is suitable for use as unique object key.
  14288. *
  14289. * @private
  14290. * @param {*} value The value to check.
  14291. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  14292. */
  14293. function isKeyable(value) {
  14294. var type = typeof value;
  14295. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  14296. ? (value !== '__proto__')
  14297. : (value === null);
  14298. }
  14299. /**
  14300. * Checks if `func` has its source masked.
  14301. *
  14302. * @private
  14303. * @param {Function} func The function to check.
  14304. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  14305. */
  14306. function isMasked(func) {
  14307. return !!maskSrcKey && (maskSrcKey in func);
  14308. }
  14309. /**
  14310. * Converts `string` to a property path array.
  14311. *
  14312. * @private
  14313. * @param {string} string The string to convert.
  14314. * @returns {Array} Returns the property path array.
  14315. */
  14316. var stringToPath = memoize(function(string) {
  14317. string = toString(string);
  14318. var result = [];
  14319. if (reLeadingDot.test(string)) {
  14320. result.push('');
  14321. }
  14322. string.replace(rePropName, function(match, number, quote, string) {
  14323. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  14324. });
  14325. return result;
  14326. });
  14327. /**
  14328. * Converts `value` to a string key if it's not a string or symbol.
  14329. *
  14330. * @private
  14331. * @param {*} value The value to inspect.
  14332. * @returns {string|symbol} Returns the key.
  14333. */
  14334. function toKey(value) {
  14335. if (typeof value == 'string' || isSymbol(value)) {
  14336. return value;
  14337. }
  14338. var result = (value + '');
  14339. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14340. }
  14341. /**
  14342. * Converts `func` to its source code.
  14343. *
  14344. * @private
  14345. * @param {Function} func The function to process.
  14346. * @returns {string} Returns the source code.
  14347. */
  14348. function toSource(func) {
  14349. if (func != null) {
  14350. try {
  14351. return funcToString.call(func);
  14352. } catch (e) {}
  14353. try {
  14354. return (func + '');
  14355. } catch (e) {}
  14356. }
  14357. return '';
  14358. }
  14359. /**
  14360. * Creates a function that memoizes the result of `func`. If `resolver` is
  14361. * provided, it determines the cache key for storing the result based on the
  14362. * arguments provided to the memoized function. By default, the first argument
  14363. * provided to the memoized function is used as the map cache key. The `func`
  14364. * is invoked with the `this` binding of the memoized function.
  14365. *
  14366. * **Note:** The cache is exposed as the `cache` property on the memoized
  14367. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  14368. * constructor with one whose instances implement the
  14369. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  14370. * method interface of `delete`, `get`, `has`, and `set`.
  14371. *
  14372. * @static
  14373. * @memberOf _
  14374. * @since 0.1.0
  14375. * @category Function
  14376. * @param {Function} func The function to have its output memoized.
  14377. * @param {Function} [resolver] The function to resolve the cache key.
  14378. * @returns {Function} Returns the new memoized function.
  14379. * @example
  14380. *
  14381. * var object = { 'a': 1, 'b': 2 };
  14382. * var other = { 'c': 3, 'd': 4 };
  14383. *
  14384. * var values = _.memoize(_.values);
  14385. * values(object);
  14386. * // => [1, 2]
  14387. *
  14388. * values(other);
  14389. * // => [3, 4]
  14390. *
  14391. * object.a = 2;
  14392. * values(object);
  14393. * // => [1, 2]
  14394. *
  14395. * // Modify the result cache.
  14396. * values.cache.set(object, ['a', 'b']);
  14397. * values(object);
  14398. * // => ['a', 'b']
  14399. *
  14400. * // Replace `_.memoize.Cache`.
  14401. * _.memoize.Cache = WeakMap;
  14402. */
  14403. function memoize(func, resolver) {
  14404. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  14405. throw new TypeError(FUNC_ERROR_TEXT);
  14406. }
  14407. var memoized = function() {
  14408. var args = arguments,
  14409. key = resolver ? resolver.apply(this, args) : args[0],
  14410. cache = memoized.cache;
  14411. if (cache.has(key)) {
  14412. return cache.get(key);
  14413. }
  14414. var result = func.apply(this, args);
  14415. memoized.cache = cache.set(key, result);
  14416. return result;
  14417. };
  14418. memoized.cache = new (memoize.Cache || MapCache);
  14419. return memoized;
  14420. }
  14421. // Assign cache to `_.memoize`.
  14422. memoize.Cache = MapCache;
  14423. /**
  14424. * Performs a
  14425. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14426. * comparison between two values to determine if they are equivalent.
  14427. *
  14428. * @static
  14429. * @memberOf _
  14430. * @since 4.0.0
  14431. * @category Lang
  14432. * @param {*} value The value to compare.
  14433. * @param {*} other The other value to compare.
  14434. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  14435. * @example
  14436. *
  14437. * var object = { 'a': 1 };
  14438. * var other = { 'a': 1 };
  14439. *
  14440. * _.eq(object, object);
  14441. * // => true
  14442. *
  14443. * _.eq(object, other);
  14444. * // => false
  14445. *
  14446. * _.eq('a', 'a');
  14447. * // => true
  14448. *
  14449. * _.eq('a', Object('a'));
  14450. * // => false
  14451. *
  14452. * _.eq(NaN, NaN);
  14453. * // => true
  14454. */
  14455. function eq(value, other) {
  14456. return value === other || (value !== value && other !== other);
  14457. }
  14458. /**
  14459. * Checks if `value` is classified as an `Array` object.
  14460. *
  14461. * @static
  14462. * @memberOf _
  14463. * @since 0.1.0
  14464. * @category Lang
  14465. * @param {*} value The value to check.
  14466. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14467. * @example
  14468. *
  14469. * _.isArray([1, 2, 3]);
  14470. * // => true
  14471. *
  14472. * _.isArray(document.body.children);
  14473. * // => false
  14474. *
  14475. * _.isArray('abc');
  14476. * // => false
  14477. *
  14478. * _.isArray(_.noop);
  14479. * // => false
  14480. */
  14481. var isArray = Array.isArray;
  14482. /**
  14483. * Checks if `value` is classified as a `Function` object.
  14484. *
  14485. * @static
  14486. * @memberOf _
  14487. * @since 0.1.0
  14488. * @category Lang
  14489. * @param {*} value The value to check.
  14490. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14491. * @example
  14492. *
  14493. * _.isFunction(_);
  14494. * // => true
  14495. *
  14496. * _.isFunction(/abc/);
  14497. * // => false
  14498. */
  14499. function isFunction(value) {
  14500. // The use of `Object#toString` avoids issues with the `typeof` operator
  14501. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14502. var tag = isObject(value) ? objectToString.call(value) : '';
  14503. return tag == funcTag || tag == genTag;
  14504. }
  14505. /**
  14506. * Checks if `value` is the
  14507. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14508. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14509. *
  14510. * @static
  14511. * @memberOf _
  14512. * @since 0.1.0
  14513. * @category Lang
  14514. * @param {*} value The value to check.
  14515. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14516. * @example
  14517. *
  14518. * _.isObject({});
  14519. * // => true
  14520. *
  14521. * _.isObject([1, 2, 3]);
  14522. * // => true
  14523. *
  14524. * _.isObject(_.noop);
  14525. * // => true
  14526. *
  14527. * _.isObject(null);
  14528. * // => false
  14529. */
  14530. function isObject(value) {
  14531. var type = typeof value;
  14532. return !!value && (type == 'object' || type == 'function');
  14533. }
  14534. /**
  14535. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14536. * and has a `typeof` result of "object".
  14537. *
  14538. * @static
  14539. * @memberOf _
  14540. * @since 4.0.0
  14541. * @category Lang
  14542. * @param {*} value The value to check.
  14543. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14544. * @example
  14545. *
  14546. * _.isObjectLike({});
  14547. * // => true
  14548. *
  14549. * _.isObjectLike([1, 2, 3]);
  14550. * // => true
  14551. *
  14552. * _.isObjectLike(_.noop);
  14553. * // => false
  14554. *
  14555. * _.isObjectLike(null);
  14556. * // => false
  14557. */
  14558. function isObjectLike(value) {
  14559. return !!value && typeof value == 'object';
  14560. }
  14561. /**
  14562. * Checks if `value` is classified as a `Symbol` primitive or object.
  14563. *
  14564. * @static
  14565. * @memberOf _
  14566. * @since 4.0.0
  14567. * @category Lang
  14568. * @param {*} value The value to check.
  14569. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14570. * @example
  14571. *
  14572. * _.isSymbol(Symbol.iterator);
  14573. * // => true
  14574. *
  14575. * _.isSymbol('abc');
  14576. * // => false
  14577. */
  14578. function isSymbol(value) {
  14579. return typeof value == 'symbol' ||
  14580. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14581. }
  14582. /**
  14583. * Converts `value` to a string. An empty string is returned for `null`
  14584. * and `undefined` values. The sign of `-0` is preserved.
  14585. *
  14586. * @static
  14587. * @memberOf _
  14588. * @since 4.0.0
  14589. * @category Lang
  14590. * @param {*} value The value to process.
  14591. * @returns {string} Returns the string.
  14592. * @example
  14593. *
  14594. * _.toString(null);
  14595. * // => ''
  14596. *
  14597. * _.toString(-0);
  14598. * // => '-0'
  14599. *
  14600. * _.toString([1, 2, 3]);
  14601. * // => '1,2,3'
  14602. */
  14603. function toString(value) {
  14604. return value == null ? '' : baseToString(value);
  14605. }
  14606. /**
  14607. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14608. * it's created. Arrays are created for missing index properties while objects
  14609. * are created for all other missing properties. Use `_.setWith` to customize
  14610. * `path` creation.
  14611. *
  14612. * **Note:** This method mutates `object`.
  14613. *
  14614. * @static
  14615. * @memberOf _
  14616. * @since 3.7.0
  14617. * @category Object
  14618. * @param {Object} object The object to modify.
  14619. * @param {Array|string} path The path of the property to set.
  14620. * @param {*} value The value to set.
  14621. * @returns {Object} Returns `object`.
  14622. * @example
  14623. *
  14624. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14625. *
  14626. * _.set(object, 'a[0].b.c', 4);
  14627. * console.log(object.a[0].b.c);
  14628. * // => 4
  14629. *
  14630. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14631. * console.log(object.x[0].y.z);
  14632. * // => 5
  14633. */
  14634. function set(object, path, value) {
  14635. return object == null ? object : baseSet(object, path, value);
  14636. }
  14637. module.exports = set;
  14638. /***/ }),
  14639. /***/ 898:
  14640. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14641. "use strict";
  14642. Object.defineProperty(exports, '__esModule', { value: true });
  14643. var request = __webpack_require__(753);
  14644. var universalUserAgent = __webpack_require__(796);
  14645. const VERSION = "4.3.1";
  14646. class GraphqlError extends Error {
  14647. constructor(request, response) {
  14648. const message = response.data.errors[0].message;
  14649. super(message);
  14650. Object.assign(this, response.data);
  14651. this.name = "GraphqlError";
  14652. this.request = request; // Maintains proper stack trace (only available on V8)
  14653. /* istanbul ignore next */
  14654. if (Error.captureStackTrace) {
  14655. Error.captureStackTrace(this, this.constructor);
  14656. }
  14657. }
  14658. }
  14659. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14660. function graphql(request, query, options) {
  14661. options = typeof query === "string" ? options = Object.assign({
  14662. query
  14663. }, options) : options = query;
  14664. const requestOptions = Object.keys(options).reduce((result, key) => {
  14665. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14666. result[key] = options[key];
  14667. return result;
  14668. }
  14669. if (!result.variables) {
  14670. result.variables = {};
  14671. }
  14672. result.variables[key] = options[key];
  14673. return result;
  14674. }, {});
  14675. return request(requestOptions).then(response => {
  14676. if (response.data.errors) {
  14677. throw new GraphqlError(requestOptions, {
  14678. data: response.data
  14679. });
  14680. }
  14681. return response.data.data;
  14682. });
  14683. }
  14684. function withDefaults(request$1, newDefaults) {
  14685. const newRequest = request$1.defaults(newDefaults);
  14686. const newApi = (query, options) => {
  14687. return graphql(newRequest, query, options);
  14688. };
  14689. return Object.assign(newApi, {
  14690. defaults: withDefaults.bind(null, newRequest),
  14691. endpoint: request.request.endpoint
  14692. });
  14693. }
  14694. const graphql$1 = withDefaults(request.request, {
  14695. headers: {
  14696. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14697. },
  14698. method: "POST",
  14699. url: "/graphql"
  14700. });
  14701. function withCustomRequest(customRequest) {
  14702. return withDefaults(customRequest, {
  14703. method: "POST",
  14704. url: "/graphql"
  14705. });
  14706. }
  14707. exports.graphql = graphql$1;
  14708. exports.withCustomRequest = withCustomRequest;
  14709. //# sourceMappingURL=index.js.map
  14710. /***/ }),
  14711. /***/ 899:
  14712. /***/ (function(module, __unusedexports, __webpack_require__) {
  14713. module.exports = registerEndpoints;
  14714. const { Deprecation } = __webpack_require__(692);
  14715. function registerEndpoints(octokit, routes) {
  14716. Object.keys(routes).forEach(namespaceName => {
  14717. if (!octokit[namespaceName]) {
  14718. octokit[namespaceName] = {};
  14719. }
  14720. Object.keys(routes[namespaceName]).forEach(apiName => {
  14721. const apiOptions = routes[namespaceName][apiName];
  14722. const endpointDefaults = ["method", "url", "headers"].reduce(
  14723. (map, key) => {
  14724. if (typeof apiOptions[key] !== "undefined") {
  14725. map[key] = apiOptions[key];
  14726. }
  14727. return map;
  14728. },
  14729. {}
  14730. );
  14731. endpointDefaults.request = {
  14732. validate: apiOptions.params
  14733. };
  14734. let request = octokit.request.defaults(endpointDefaults);
  14735. // patch request & endpoint methods to support deprecated parameters.
  14736. // Not the most elegant solution, but we don’t want to move deprecation
  14737. // logic into octokit/endpoint.js as it’s out of scope
  14738. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14739. key => apiOptions.params[key].deprecated
  14740. );
  14741. if (hasDeprecatedParam) {
  14742. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14743. request = patch(
  14744. octokit.request.defaults(endpointDefaults),
  14745. `.${namespaceName}.${apiName}()`
  14746. );
  14747. request.endpoint = patch(
  14748. request.endpoint,
  14749. `.${namespaceName}.${apiName}.endpoint()`
  14750. );
  14751. request.endpoint.merge = patch(
  14752. request.endpoint.merge,
  14753. `.${namespaceName}.${apiName}.endpoint.merge()`
  14754. );
  14755. }
  14756. if (apiOptions.deprecated) {
  14757. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14758. octokit.log.warn(
  14759. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14760. );
  14761. octokit[namespaceName][apiName] = request;
  14762. return request.apply(null, arguments);
  14763. };
  14764. return;
  14765. }
  14766. octokit[namespaceName][apiName] = request;
  14767. });
  14768. });
  14769. }
  14770. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14771. const patchedMethod = options => {
  14772. options = Object.assign({}, options);
  14773. Object.keys(options).forEach(key => {
  14774. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14775. const aliasKey = apiOptions.params[key].alias;
  14776. octokit.log.warn(
  14777. new Deprecation(
  14778. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14779. )
  14780. );
  14781. if (!(aliasKey in options)) {
  14782. options[aliasKey] = options[key];
  14783. }
  14784. delete options[key];
  14785. }
  14786. });
  14787. return method(options);
  14788. };
  14789. Object.keys(method).forEach(key => {
  14790. patchedMethod[key] = method[key];
  14791. });
  14792. return patchedMethod;
  14793. }
  14794. /***/ }),
  14795. /***/ 929:
  14796. /***/ (function(module, __unusedexports, __webpack_require__) {
  14797. module.exports = hasNextPage
  14798. const deprecate = __webpack_require__(370)
  14799. const getPageLinks = __webpack_require__(577)
  14800. function hasNextPage (link) {
  14801. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  14802. return getPageLinks(link).next
  14803. }
  14804. /***/ }),
  14805. /***/ 948:
  14806. /***/ (function(module) {
  14807. "use strict";
  14808. /**
  14809. * Tries to execute a function and discards any error that occurs.
  14810. * @param {Function} fn - Function that might or might not throw an error.
  14811. * @returns {?*} Return-value of the function when no error occurred.
  14812. */
  14813. module.exports = function(fn) {
  14814. try { return fn() } catch (e) {}
  14815. }
  14816. /***/ }),
  14817. /***/ 950:
  14818. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14819. "use strict";
  14820. Object.defineProperty(exports, "__esModule", { value: true });
  14821. const url = __webpack_require__(835);
  14822. function getProxyUrl(reqUrl) {
  14823. let usingSsl = reqUrl.protocol === 'https:';
  14824. let proxyUrl;
  14825. if (checkBypass(reqUrl)) {
  14826. return proxyUrl;
  14827. }
  14828. let proxyVar;
  14829. if (usingSsl) {
  14830. proxyVar = process.env["https_proxy"] ||
  14831. process.env["HTTPS_PROXY"];
  14832. }
  14833. else {
  14834. proxyVar = process.env["http_proxy"] ||
  14835. process.env["HTTP_PROXY"];
  14836. }
  14837. if (proxyVar) {
  14838. proxyUrl = url.parse(proxyVar);
  14839. }
  14840. return proxyUrl;
  14841. }
  14842. exports.getProxyUrl = getProxyUrl;
  14843. function checkBypass(reqUrl) {
  14844. if (!reqUrl.hostname) {
  14845. return false;
  14846. }
  14847. let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
  14848. if (!noProxy) {
  14849. return false;
  14850. }
  14851. // Determine the request port
  14852. let reqPort;
  14853. if (reqUrl.port) {
  14854. reqPort = Number(reqUrl.port);
  14855. }
  14856. else if (reqUrl.protocol === 'http:') {
  14857. reqPort = 80;
  14858. }
  14859. else if (reqUrl.protocol === 'https:') {
  14860. reqPort = 443;
  14861. }
  14862. // Format the request hostname and hostname with port
  14863. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  14864. if (typeof reqPort === 'number') {
  14865. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  14866. }
  14867. // Compare request host against noproxy
  14868. for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
  14869. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  14870. return true;
  14871. }
  14872. }
  14873. return false;
  14874. }
  14875. exports.checkBypass = checkBypass;
  14876. /***/ }),
  14877. /***/ 954:
  14878. /***/ (function(module) {
  14879. module.exports = validateAuth;
  14880. function validateAuth(auth) {
  14881. if (typeof auth === "string") {
  14882. return;
  14883. }
  14884. if (typeof auth === "function") {
  14885. return;
  14886. }
  14887. if (auth.username && auth.password) {
  14888. return;
  14889. }
  14890. if (auth.clientId && auth.clientSecret) {
  14891. return;
  14892. }
  14893. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  14894. }
  14895. /***/ }),
  14896. /***/ 955:
  14897. /***/ (function(module, __unusedexports, __webpack_require__) {
  14898. "use strict";
  14899. const path = __webpack_require__(622);
  14900. const childProcess = __webpack_require__(129);
  14901. const crossSpawn = __webpack_require__(20);
  14902. const stripEof = __webpack_require__(768);
  14903. const npmRunPath = __webpack_require__(621);
  14904. const isStream = __webpack_require__(323);
  14905. const _getStream = __webpack_require__(145);
  14906. const pFinally = __webpack_require__(697);
  14907. const onExit = __webpack_require__(260);
  14908. const errname = __webpack_require__(427);
  14909. const stdio = __webpack_require__(168);
  14910. const TEN_MEGABYTES = 1000 * 1000 * 10;
  14911. function handleArgs(cmd, args, opts) {
  14912. let parsed;
  14913. opts = Object.assign({
  14914. extendEnv: true,
  14915. env: {}
  14916. }, opts);
  14917. if (opts.extendEnv) {
  14918. opts.env = Object.assign({}, process.env, opts.env);
  14919. }
  14920. if (opts.__winShell === true) {
  14921. delete opts.__winShell;
  14922. parsed = {
  14923. command: cmd,
  14924. args,
  14925. options: opts,
  14926. file: cmd,
  14927. original: {
  14928. cmd,
  14929. args
  14930. }
  14931. };
  14932. } else {
  14933. parsed = crossSpawn._parse(cmd, args, opts);
  14934. }
  14935. opts = Object.assign({
  14936. maxBuffer: TEN_MEGABYTES,
  14937. buffer: true,
  14938. stripEof: true,
  14939. preferLocal: true,
  14940. localDir: parsed.options.cwd || process.cwd(),
  14941. encoding: 'utf8',
  14942. reject: true,
  14943. cleanup: true
  14944. }, parsed.options);
  14945. opts.stdio = stdio(opts);
  14946. if (opts.preferLocal) {
  14947. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  14948. }
  14949. if (opts.detached) {
  14950. // #115
  14951. opts.cleanup = false;
  14952. }
  14953. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  14954. // #116
  14955. parsed.args.unshift('/q');
  14956. }
  14957. return {
  14958. cmd: parsed.command,
  14959. args: parsed.args,
  14960. opts,
  14961. parsed
  14962. };
  14963. }
  14964. function handleInput(spawned, input) {
  14965. if (input === null || input === undefined) {
  14966. return;
  14967. }
  14968. if (isStream(input)) {
  14969. input.pipe(spawned.stdin);
  14970. } else {
  14971. spawned.stdin.end(input);
  14972. }
  14973. }
  14974. function handleOutput(opts, val) {
  14975. if (val && opts.stripEof) {
  14976. val = stripEof(val);
  14977. }
  14978. return val;
  14979. }
  14980. function handleShell(fn, cmd, opts) {
  14981. let file = '/bin/sh';
  14982. let args = ['-c', cmd];
  14983. opts = Object.assign({}, opts);
  14984. if (process.platform === 'win32') {
  14985. opts.__winShell = true;
  14986. file = process.env.comspec || 'cmd.exe';
  14987. args = ['/s', '/c', `"${cmd}"`];
  14988. opts.windowsVerbatimArguments = true;
  14989. }
  14990. if (opts.shell) {
  14991. file = opts.shell;
  14992. delete opts.shell;
  14993. }
  14994. return fn(file, args, opts);
  14995. }
  14996. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  14997. if (!process[stream]) {
  14998. return null;
  14999. }
  15000. let ret;
  15001. if (!buffer) {
  15002. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  15003. ret = new Promise((resolve, reject) => {
  15004. process[stream]
  15005. .once('end', resolve)
  15006. .once('error', reject);
  15007. });
  15008. } else if (encoding) {
  15009. ret = _getStream(process[stream], {
  15010. encoding,
  15011. maxBuffer
  15012. });
  15013. } else {
  15014. ret = _getStream.buffer(process[stream], {maxBuffer});
  15015. }
  15016. return ret.catch(err => {
  15017. err.stream = stream;
  15018. err.message = `${stream} ${err.message}`;
  15019. throw err;
  15020. });
  15021. }
  15022. function makeError(result, options) {
  15023. const {stdout, stderr} = result;
  15024. let err = result.error;
  15025. const {code, signal} = result;
  15026. const {parsed, joinedCmd} = options;
  15027. const timedOut = options.timedOut || false;
  15028. if (!err) {
  15029. let output = '';
  15030. if (Array.isArray(parsed.opts.stdio)) {
  15031. if (parsed.opts.stdio[2] !== 'inherit') {
  15032. output += output.length > 0 ? stderr : `\n${stderr}`;
  15033. }
  15034. if (parsed.opts.stdio[1] !== 'inherit') {
  15035. output += `\n${stdout}`;
  15036. }
  15037. } else if (parsed.opts.stdio !== 'inherit') {
  15038. output = `\n${stderr}${stdout}`;
  15039. }
  15040. err = new Error(`Command failed: ${joinedCmd}${output}`);
  15041. err.code = code < 0 ? errname(code) : code;
  15042. }
  15043. err.stdout = stdout;
  15044. err.stderr = stderr;
  15045. err.failed = true;
  15046. err.signal = signal || null;
  15047. err.cmd = joinedCmd;
  15048. err.timedOut = timedOut;
  15049. return err;
  15050. }
  15051. function joinCmd(cmd, args) {
  15052. let joinedCmd = cmd;
  15053. if (Array.isArray(args) && args.length > 0) {
  15054. joinedCmd += ' ' + args.join(' ');
  15055. }
  15056. return joinedCmd;
  15057. }
  15058. module.exports = (cmd, args, opts) => {
  15059. const parsed = handleArgs(cmd, args, opts);
  15060. const {encoding, buffer, maxBuffer} = parsed.opts;
  15061. const joinedCmd = joinCmd(cmd, args);
  15062. let spawned;
  15063. try {
  15064. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  15065. } catch (err) {
  15066. return Promise.reject(err);
  15067. }
  15068. let removeExitHandler;
  15069. if (parsed.opts.cleanup) {
  15070. removeExitHandler = onExit(() => {
  15071. spawned.kill();
  15072. });
  15073. }
  15074. let timeoutId = null;
  15075. let timedOut = false;
  15076. const cleanup = () => {
  15077. if (timeoutId) {
  15078. clearTimeout(timeoutId);
  15079. timeoutId = null;
  15080. }
  15081. if (removeExitHandler) {
  15082. removeExitHandler();
  15083. }
  15084. };
  15085. if (parsed.opts.timeout > 0) {
  15086. timeoutId = setTimeout(() => {
  15087. timeoutId = null;
  15088. timedOut = true;
  15089. spawned.kill(parsed.opts.killSignal);
  15090. }, parsed.opts.timeout);
  15091. }
  15092. const processDone = new Promise(resolve => {
  15093. spawned.on('exit', (code, signal) => {
  15094. cleanup();
  15095. resolve({code, signal});
  15096. });
  15097. spawned.on('error', err => {
  15098. cleanup();
  15099. resolve({error: err});
  15100. });
  15101. if (spawned.stdin) {
  15102. spawned.stdin.on('error', err => {
  15103. cleanup();
  15104. resolve({error: err});
  15105. });
  15106. }
  15107. });
  15108. function destroy() {
  15109. if (spawned.stdout) {
  15110. spawned.stdout.destroy();
  15111. }
  15112. if (spawned.stderr) {
  15113. spawned.stderr.destroy();
  15114. }
  15115. }
  15116. const handlePromise = () => pFinally(Promise.all([
  15117. processDone,
  15118. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  15119. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  15120. ]).then(arr => {
  15121. const result = arr[0];
  15122. result.stdout = arr[1];
  15123. result.stderr = arr[2];
  15124. if (result.error || result.code !== 0 || result.signal !== null) {
  15125. const err = makeError(result, {
  15126. joinedCmd,
  15127. parsed,
  15128. timedOut
  15129. });
  15130. // TODO: missing some timeout logic for killed
  15131. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  15132. // err.killed = spawned.killed || killed;
  15133. err.killed = err.killed || spawned.killed;
  15134. if (!parsed.opts.reject) {
  15135. return err;
  15136. }
  15137. throw err;
  15138. }
  15139. return {
  15140. stdout: handleOutput(parsed.opts, result.stdout),
  15141. stderr: handleOutput(parsed.opts, result.stderr),
  15142. code: 0,
  15143. failed: false,
  15144. killed: false,
  15145. signal: null,
  15146. cmd: joinedCmd,
  15147. timedOut: false
  15148. };
  15149. }), destroy);
  15150. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  15151. handleInput(spawned, parsed.opts.input);
  15152. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  15153. spawned.catch = onrejected => handlePromise().catch(onrejected);
  15154. return spawned;
  15155. };
  15156. // TODO: set `stderr: 'ignore'` when that option is implemented
  15157. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  15158. // TODO: set `stdout: 'ignore'` when that option is implemented
  15159. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  15160. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  15161. module.exports.sync = (cmd, args, opts) => {
  15162. const parsed = handleArgs(cmd, args, opts);
  15163. const joinedCmd = joinCmd(cmd, args);
  15164. if (isStream(parsed.opts.input)) {
  15165. throw new TypeError('The `input` option cannot be a stream in sync mode');
  15166. }
  15167. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  15168. result.code = result.status;
  15169. if (result.error || result.status !== 0 || result.signal !== null) {
  15170. const err = makeError(result, {
  15171. joinedCmd,
  15172. parsed
  15173. });
  15174. if (!parsed.opts.reject) {
  15175. return err;
  15176. }
  15177. throw err;
  15178. }
  15179. return {
  15180. stdout: handleOutput(parsed.opts, result.stdout),
  15181. stderr: handleOutput(parsed.opts, result.stderr),
  15182. code: 0,
  15183. failed: false,
  15184. signal: null,
  15185. cmd: joinedCmd,
  15186. timedOut: false
  15187. };
  15188. };
  15189. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  15190. /***/ }),
  15191. /***/ 966:
  15192. /***/ (function(module, __unusedexports, __webpack_require__) {
  15193. "use strict";
  15194. const {PassThrough} = __webpack_require__(413);
  15195. module.exports = options => {
  15196. options = Object.assign({}, options);
  15197. const {array} = options;
  15198. let {encoding} = options;
  15199. const buffer = encoding === 'buffer';
  15200. let objectMode = false;
  15201. if (array) {
  15202. objectMode = !(encoding || buffer);
  15203. } else {
  15204. encoding = encoding || 'utf8';
  15205. }
  15206. if (buffer) {
  15207. encoding = null;
  15208. }
  15209. let len = 0;
  15210. const ret = [];
  15211. const stream = new PassThrough({objectMode});
  15212. if (encoding) {
  15213. stream.setEncoding(encoding);
  15214. }
  15215. stream.on('data', chunk => {
  15216. ret.push(chunk);
  15217. if (objectMode) {
  15218. len = ret.length;
  15219. } else {
  15220. len += chunk.length;
  15221. }
  15222. });
  15223. stream.getBufferedValue = () => {
  15224. if (array) {
  15225. return ret;
  15226. }
  15227. return buffer ? Buffer.concat(ret, len) : ret.join('');
  15228. };
  15229. stream.getBufferedLength = () => len;
  15230. return stream;
  15231. };
  15232. /***/ }),
  15233. /***/ 969:
  15234. /***/ (function(module, __unusedexports, __webpack_require__) {
  15235. var wrappy = __webpack_require__(11)
  15236. module.exports = wrappy(once)
  15237. module.exports.strict = wrappy(onceStrict)
  15238. once.proto = once(function () {
  15239. Object.defineProperty(Function.prototype, 'once', {
  15240. value: function () {
  15241. return once(this)
  15242. },
  15243. configurable: true
  15244. })
  15245. Object.defineProperty(Function.prototype, 'onceStrict', {
  15246. value: function () {
  15247. return onceStrict(this)
  15248. },
  15249. configurable: true
  15250. })
  15251. })
  15252. function once (fn) {
  15253. var f = function () {
  15254. if (f.called) return f.value
  15255. f.called = true
  15256. return f.value = fn.apply(this, arguments)
  15257. }
  15258. f.called = false
  15259. return f
  15260. }
  15261. function onceStrict (fn) {
  15262. var f = function () {
  15263. if (f.called)
  15264. throw new Error(f.onceError)
  15265. f.called = true
  15266. return f.value = fn.apply(this, arguments)
  15267. }
  15268. var name = fn.name || 'Function wrapped with `once`'
  15269. f.onceError = name + " shouldn't be called more than once"
  15270. f.called = false
  15271. return f
  15272. }
  15273. /***/ }),
  15274. /***/ 986:
  15275. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  15276. "use strict";
  15277. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  15278. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  15279. return new (P || (P = Promise))(function (resolve, reject) {
  15280. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  15281. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  15282. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  15283. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15284. });
  15285. };
  15286. Object.defineProperty(exports, "__esModule", { value: true });
  15287. const tr = __webpack_require__(9);
  15288. /**
  15289. * Exec a command.
  15290. * Output will be streamed to the live console.
  15291. * Returns promise with return code
  15292. *
  15293. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  15294. * @param args optional arguments for tool. Escaping is handled by the lib.
  15295. * @param options optional exec options. See ExecOptions
  15296. * @returns Promise<number> exit code
  15297. */
  15298. function exec(commandLine, args, options) {
  15299. return __awaiter(this, void 0, void 0, function* () {
  15300. const commandArgs = tr.argStringToArray(commandLine);
  15301. if (commandArgs.length === 0) {
  15302. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  15303. }
  15304. // Path to tool to execute should be first arg
  15305. const toolPath = commandArgs[0];
  15306. args = commandArgs.slice(1).concat(args || []);
  15307. const runner = new tr.ToolRunner(toolPath, args, options);
  15308. return runner.exec();
  15309. });
  15310. }
  15311. exports.exec = exec;
  15312. //# sourceMappingURL=exec.js.map
  15313. /***/ }),
  15314. /***/ 991:
  15315. /***/ (function(module, __unusedexports, __webpack_require__) {
  15316. module.exports = authenticationRequestError;
  15317. const { RequestError } = __webpack_require__(463);
  15318. function authenticationRequestError(state, error, options) {
  15319. if (!error.headers) throw error;
  15320. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  15321. // handle "2FA required" error only
  15322. if (error.status !== 401 || !otpRequired) {
  15323. throw error;
  15324. }
  15325. if (
  15326. error.status === 401 &&
  15327. otpRequired &&
  15328. error.request &&
  15329. error.request.headers["x-github-otp"]
  15330. ) {
  15331. if (state.otp) {
  15332. delete state.otp; // no longer valid, request again
  15333. } else {
  15334. throw new RequestError(
  15335. "Invalid one-time password for two-factor authentication",
  15336. 401,
  15337. {
  15338. headers: error.headers,
  15339. request: options
  15340. }
  15341. );
  15342. }
  15343. }
  15344. if (typeof state.auth.on2fa !== "function") {
  15345. throw new RequestError(
  15346. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  15347. 401,
  15348. {
  15349. headers: error.headers,
  15350. request: options
  15351. }
  15352. );
  15353. }
  15354. return Promise.resolve()
  15355. .then(() => {
  15356. return state.auth.on2fa();
  15357. })
  15358. .then(oneTimePassword => {
  15359. const newOptions = Object.assign(options, {
  15360. headers: Object.assign(options.headers, {
  15361. "x-github-otp": oneTimePassword
  15362. })
  15363. });
  15364. return state.octokit.request(newOptions).then(response => {
  15365. // If OTP still valid, then persist it for following requests
  15366. state.otp = oneTimePassword;
  15367. return response;
  15368. });
  15369. });
  15370. }
  15371. /***/ })
  15372. /******/ });