index.js 677 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682176831768417685176861768717688176891769017691176921769317694176951769617697
  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.debug(`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. core.startGroup('Initializing the repository');
  5187. yield git.init();
  5188. yield git.remoteAdd('origin', initialRemoteUrl);
  5189. core.endGroup();
  5190. }
  5191. // Disable automatic garbage collection
  5192. core.startGroup('Disabling automatic garbage collection');
  5193. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5194. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5195. }
  5196. core.endGroup();
  5197. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5198. try {
  5199. // Configure auth
  5200. core.startGroup('Setting up auth');
  5201. yield authHelper.configureAuth();
  5202. core.endGroup();
  5203. // LFS install
  5204. if (settings.lfs) {
  5205. yield git.lfsInstall();
  5206. }
  5207. // Fetch
  5208. core.startGroup('Fetching the repository');
  5209. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5210. yield git.fetch(settings.fetchDepth, refSpec);
  5211. core.endGroup();
  5212. // Checkout info
  5213. core.startGroup('Determining the checkout info');
  5214. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5215. core.endGroup();
  5216. // LFS fetch
  5217. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5218. // Explicit lfs fetch will fetch lfs objects in parallel.
  5219. if (settings.lfs) {
  5220. core.startGroup('Fetching LFS objects');
  5221. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5222. core.endGroup();
  5223. }
  5224. // Fix URL when using SSH
  5225. if (settings.sshKey && initialRemoteUrl !== sshUrl) {
  5226. core.startGroup('Updating the remote URL');
  5227. yield git.setRemoteUrl(sshUrl);
  5228. core.endGroup();
  5229. }
  5230. // Checkout
  5231. core.startGroup('Checking out the ref');
  5232. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5233. core.endGroup();
  5234. // Submodules
  5235. if (settings.submodules) {
  5236. try {
  5237. // Temporarily override global config
  5238. core.startGroup('Setting up auth for fetching submodules');
  5239. yield authHelper.configureGlobalAuth();
  5240. core.endGroup();
  5241. // Checkout submodules
  5242. core.startGroup('Fetching submodules');
  5243. yield git.submoduleSync(settings.nestedSubmodules);
  5244. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5245. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5246. core.endGroup();
  5247. // Persist credentials
  5248. if (settings.persistCredentials) {
  5249. core.startGroup('Persisting credentials for submodules');
  5250. yield authHelper.configureSubmoduleAuth();
  5251. core.endGroup();
  5252. }
  5253. }
  5254. finally {
  5255. // Remove temporary global config override
  5256. yield authHelper.removeGlobalAuth();
  5257. }
  5258. }
  5259. // Dump some info about the checked out commit
  5260. yield git.log1();
  5261. }
  5262. finally {
  5263. // Remove auth
  5264. if (!settings.persistCredentials) {
  5265. core.startGroup('Removing auth');
  5266. yield authHelper.removeAuth();
  5267. core.endGroup();
  5268. }
  5269. }
  5270. });
  5271. }
  5272. exports.getSource = getSource;
  5273. function cleanup(repositoryPath) {
  5274. return __awaiter(this, void 0, void 0, function* () {
  5275. // Repo exists?
  5276. if (!repositoryPath ||
  5277. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5278. return;
  5279. }
  5280. let git;
  5281. try {
  5282. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5283. }
  5284. catch (_a) {
  5285. return;
  5286. }
  5287. // Remove auth
  5288. const authHelper = gitAuthHelper.createAuthHelper(git);
  5289. yield authHelper.removeAuth();
  5290. });
  5291. }
  5292. exports.cleanup = cleanup;
  5293. function getGitCommandManager(settings) {
  5294. return __awaiter(this, void 0, void 0, function* () {
  5295. core.info(`Working directory is '${settings.repositoryPath}'`);
  5296. try {
  5297. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5298. }
  5299. catch (err) {
  5300. // Git is required for LFS
  5301. if (settings.lfs) {
  5302. throw err;
  5303. }
  5304. // Otherwise fallback to REST API
  5305. return undefined;
  5306. }
  5307. });
  5308. }
  5309. /***/ }),
  5310. /***/ 294:
  5311. /***/ (function(module, __unusedexports, __webpack_require__) {
  5312. module.exports = parseOptions;
  5313. const { Deprecation } = __webpack_require__(692);
  5314. const { getUserAgent } = __webpack_require__(796);
  5315. const once = __webpack_require__(969);
  5316. const pkg = __webpack_require__(215);
  5317. const deprecateOptionsTimeout = once((log, deprecation) =>
  5318. log.warn(deprecation)
  5319. );
  5320. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5321. const deprecateOptionsHeaders = once((log, deprecation) =>
  5322. log.warn(deprecation)
  5323. );
  5324. function parseOptions(options, log, hook) {
  5325. if (options.headers) {
  5326. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5327. newObj[key.toLowerCase()] = options.headers[key];
  5328. return newObj;
  5329. }, {});
  5330. }
  5331. const clientDefaults = {
  5332. headers: options.headers || {},
  5333. request: options.request || {},
  5334. mediaType: {
  5335. previews: [],
  5336. format: ""
  5337. }
  5338. };
  5339. if (options.baseUrl) {
  5340. clientDefaults.baseUrl = options.baseUrl;
  5341. }
  5342. if (options.userAgent) {
  5343. clientDefaults.headers["user-agent"] = options.userAgent;
  5344. }
  5345. if (options.previews) {
  5346. clientDefaults.mediaType.previews = options.previews;
  5347. }
  5348. if (options.timeZone) {
  5349. clientDefaults.headers["time-zone"] = options.timeZone;
  5350. }
  5351. if (options.timeout) {
  5352. deprecateOptionsTimeout(
  5353. log,
  5354. new Deprecation(
  5355. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5356. )
  5357. );
  5358. clientDefaults.request.timeout = options.timeout;
  5359. }
  5360. if (options.agent) {
  5361. deprecateOptionsAgent(
  5362. log,
  5363. new Deprecation(
  5364. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5365. )
  5366. );
  5367. clientDefaults.request.agent = options.agent;
  5368. }
  5369. if (options.headers) {
  5370. deprecateOptionsHeaders(
  5371. log,
  5372. new Deprecation(
  5373. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5374. )
  5375. );
  5376. }
  5377. const userAgentOption = clientDefaults.headers["user-agent"];
  5378. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5379. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5380. .filter(Boolean)
  5381. .join(" ");
  5382. clientDefaults.request.hook = hook.bind(null, "request");
  5383. return clientDefaults;
  5384. }
  5385. /***/ }),
  5386. /***/ 297:
  5387. /***/ (function(module) {
  5388. module.exports = class HttpError extends Error {
  5389. constructor (message, code, headers) {
  5390. super(message)
  5391. // Maintains proper stack trace (only available on V8)
  5392. /* istanbul ignore next */
  5393. if (Error.captureStackTrace) {
  5394. Error.captureStackTrace(this, this.constructor)
  5395. }
  5396. this.name = 'HttpError'
  5397. this.code = code
  5398. this.headers = headers
  5399. }
  5400. }
  5401. /***/ }),
  5402. /***/ 301:
  5403. /***/ (function(module, __unusedexports, __webpack_require__) {
  5404. /**
  5405. * Some “list” response that can be paginated have a different response structure
  5406. *
  5407. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5408. * /installation/repositories also has `repository_selection`), as well as a key with
  5409. * the list of the items which name varies from endpoint to endpoint:
  5410. *
  5411. * - https://developer.github.com/v3/search/#example (key `items`)
  5412. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5413. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5414. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5415. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5416. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5417. *
  5418. * Octokit normalizes these responses so that paginated results are always returned following
  5419. * the same structure. One challenge is that if the list response has only one page, no Link
  5420. * header is provided, so this header alone is not sufficient to check wether a response is
  5421. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5422. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5423. * property because it also exists in the response of Get the combined status for a specific ref.
  5424. */
  5425. module.exports = normalizePaginatedListResponse;
  5426. const { Deprecation } = __webpack_require__(692);
  5427. const once = __webpack_require__(969);
  5428. const deprecateIncompleteResults = once((log, deprecation) =>
  5429. log.warn(deprecation)
  5430. );
  5431. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5432. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5433. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5434. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5435. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5436. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5437. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5438. function normalizePaginatedListResponse(octokit, url, response) {
  5439. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5440. if (
  5441. !REGEX_IS_SEARCH_PATH.test(path) &&
  5442. !REGEX_IS_CHECKS_PATH.test(path) &&
  5443. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5444. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5445. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5446. ) {
  5447. return;
  5448. }
  5449. // keep the additional properties intact to avoid a breaking change,
  5450. // but log a deprecation warning when accessed
  5451. const incompleteResults = response.data.incomplete_results;
  5452. const repositorySelection = response.data.repository_selection;
  5453. const totalCount = response.data.total_count;
  5454. delete response.data.incomplete_results;
  5455. delete response.data.repository_selection;
  5456. delete response.data.total_count;
  5457. const namespaceKey = Object.keys(response.data)[0];
  5458. response.data = response.data[namespaceKey];
  5459. Object.defineProperty(response.data, namespaceKey, {
  5460. get() {
  5461. deprecateNamespace(
  5462. octokit.log,
  5463. new Deprecation(
  5464. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5465. )
  5466. );
  5467. return response.data;
  5468. }
  5469. });
  5470. if (typeof incompleteResults !== "undefined") {
  5471. Object.defineProperty(response.data, "incomplete_results", {
  5472. get() {
  5473. deprecateIncompleteResults(
  5474. octokit.log,
  5475. new Deprecation(
  5476. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5477. )
  5478. );
  5479. return incompleteResults;
  5480. }
  5481. });
  5482. }
  5483. if (typeof repositorySelection !== "undefined") {
  5484. Object.defineProperty(response.data, "repository_selection", {
  5485. get() {
  5486. deprecateTotalCount(
  5487. octokit.log,
  5488. new Deprecation(
  5489. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5490. )
  5491. );
  5492. return repositorySelection;
  5493. }
  5494. });
  5495. }
  5496. Object.defineProperty(response.data, "total_count", {
  5497. get() {
  5498. deprecateTotalCount(
  5499. octokit.log,
  5500. new Deprecation(
  5501. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5502. )
  5503. );
  5504. return totalCount;
  5505. }
  5506. });
  5507. }
  5508. /***/ }),
  5509. /***/ 323:
  5510. /***/ (function(module) {
  5511. "use strict";
  5512. var isStream = module.exports = function (stream) {
  5513. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5514. };
  5515. isStream.writable = function (stream) {
  5516. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5517. };
  5518. isStream.readable = function (stream) {
  5519. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5520. };
  5521. isStream.duplex = function (stream) {
  5522. return isStream.writable(stream) && isStream.readable(stream);
  5523. };
  5524. isStream.transform = function (stream) {
  5525. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5526. };
  5527. /***/ }),
  5528. /***/ 335:
  5529. /***/ (function(module, __unusedexports, __webpack_require__) {
  5530. module.exports = __webpack_require__(179);
  5531. /***/ }),
  5532. /***/ 336:
  5533. /***/ (function(module, __unusedexports, __webpack_require__) {
  5534. module.exports = hasLastPage
  5535. const deprecate = __webpack_require__(370)
  5536. const getPageLinks = __webpack_require__(577)
  5537. function hasLastPage (link) {
  5538. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5539. return getPageLinks(link).last
  5540. }
  5541. /***/ }),
  5542. /***/ 348:
  5543. /***/ (function(module, __unusedexports, __webpack_require__) {
  5544. "use strict";
  5545. module.exports = validate;
  5546. const { RequestError } = __webpack_require__(463);
  5547. const get = __webpack_require__(854);
  5548. const set = __webpack_require__(883);
  5549. function validate(octokit, options) {
  5550. if (!options.request.validate) {
  5551. return;
  5552. }
  5553. const { validate: params } = options.request;
  5554. Object.keys(params).forEach(parameterName => {
  5555. const parameter = get(params, parameterName);
  5556. const expectedType = parameter.type;
  5557. let parentParameterName;
  5558. let parentValue;
  5559. let parentParamIsPresent = true;
  5560. let parentParameterIsArray = false;
  5561. if (/\./.test(parameterName)) {
  5562. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5563. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5564. if (parentParameterIsArray) {
  5565. parentParameterName = parentParameterName.slice(0, -2);
  5566. }
  5567. parentValue = get(options, parentParameterName);
  5568. parentParamIsPresent =
  5569. parentParameterName === "headers" ||
  5570. (typeof parentValue === "object" && parentValue !== null);
  5571. }
  5572. const values = parentParameterIsArray
  5573. ? (get(options, parentParameterName) || []).map(
  5574. value => value[parameterName.split(/\./).pop()]
  5575. )
  5576. : [get(options, parameterName)];
  5577. values.forEach((value, i) => {
  5578. const valueIsPresent = typeof value !== "undefined";
  5579. const valueIsNull = value === null;
  5580. const currentParameterName = parentParameterIsArray
  5581. ? parameterName.replace(/\[\]/, `[${i}]`)
  5582. : parameterName;
  5583. if (!parameter.required && !valueIsPresent) {
  5584. return;
  5585. }
  5586. // if the parent parameter is of type object but allows null
  5587. // then the child parameters can be ignored
  5588. if (!parentParamIsPresent) {
  5589. return;
  5590. }
  5591. if (parameter.allowNull && valueIsNull) {
  5592. return;
  5593. }
  5594. if (!parameter.allowNull && valueIsNull) {
  5595. throw new RequestError(
  5596. `'${currentParameterName}' cannot be null`,
  5597. 400,
  5598. {
  5599. request: options
  5600. }
  5601. );
  5602. }
  5603. if (parameter.required && !valueIsPresent) {
  5604. throw new RequestError(
  5605. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5606. value
  5607. )}`,
  5608. 400,
  5609. {
  5610. request: options
  5611. }
  5612. );
  5613. }
  5614. // parse to integer before checking for enum
  5615. // so that string "1" will match enum with number 1
  5616. if (expectedType === "integer") {
  5617. const unparsedValue = value;
  5618. value = parseInt(value, 10);
  5619. if (isNaN(value)) {
  5620. throw new RequestError(
  5621. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5622. unparsedValue
  5623. )} is NaN`,
  5624. 400,
  5625. {
  5626. request: options
  5627. }
  5628. );
  5629. }
  5630. }
  5631. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5632. throw new RequestError(
  5633. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5634. value
  5635. )}`,
  5636. 400,
  5637. {
  5638. request: options
  5639. }
  5640. );
  5641. }
  5642. if (parameter.validation) {
  5643. const regex = new RegExp(parameter.validation);
  5644. if (!regex.test(value)) {
  5645. throw new RequestError(
  5646. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5647. value
  5648. )}`,
  5649. 400,
  5650. {
  5651. request: options
  5652. }
  5653. );
  5654. }
  5655. }
  5656. if (expectedType === "object" && typeof value === "string") {
  5657. try {
  5658. value = JSON.parse(value);
  5659. } catch (exception) {
  5660. throw new RequestError(
  5661. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5662. value
  5663. )}`,
  5664. 400,
  5665. {
  5666. request: options
  5667. }
  5668. );
  5669. }
  5670. }
  5671. set(options, parameter.mapTo || currentParameterName, value);
  5672. });
  5673. });
  5674. return options;
  5675. }
  5676. /***/ }),
  5677. /***/ 349:
  5678. /***/ (function(module, __unusedexports, __webpack_require__) {
  5679. module.exports = authenticationRequestError;
  5680. const { RequestError } = __webpack_require__(463);
  5681. function authenticationRequestError(state, error, options) {
  5682. /* istanbul ignore next */
  5683. if (!error.headers) throw error;
  5684. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5685. // handle "2FA required" error only
  5686. if (error.status !== 401 || !otpRequired) {
  5687. throw error;
  5688. }
  5689. if (
  5690. error.status === 401 &&
  5691. otpRequired &&
  5692. error.request &&
  5693. error.request.headers["x-github-otp"]
  5694. ) {
  5695. throw new RequestError(
  5696. "Invalid one-time password for two-factor authentication",
  5697. 401,
  5698. {
  5699. headers: error.headers,
  5700. request: options
  5701. }
  5702. );
  5703. }
  5704. if (typeof state.auth.on2fa !== "function") {
  5705. throw new RequestError(
  5706. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5707. 401,
  5708. {
  5709. headers: error.headers,
  5710. request: options
  5711. }
  5712. );
  5713. }
  5714. return Promise.resolve()
  5715. .then(() => {
  5716. return state.auth.on2fa();
  5717. })
  5718. .then(oneTimePassword => {
  5719. const newOptions = Object.assign(options, {
  5720. headers: Object.assign(
  5721. { "x-github-otp": oneTimePassword },
  5722. options.headers
  5723. )
  5724. });
  5725. return state.octokit.request(newOptions);
  5726. });
  5727. }
  5728. /***/ }),
  5729. /***/ 357:
  5730. /***/ (function(module) {
  5731. module.exports = require("assert");
  5732. /***/ }),
  5733. /***/ 363:
  5734. /***/ (function(module) {
  5735. module.exports = register
  5736. function register (state, name, method, options) {
  5737. if (typeof method !== 'function') {
  5738. throw new Error('method for before hook must be a function')
  5739. }
  5740. if (!options) {
  5741. options = {}
  5742. }
  5743. if (Array.isArray(name)) {
  5744. return name.reverse().reduce(function (callback, name) {
  5745. return register.bind(null, state, name, callback, options)
  5746. }, method)()
  5747. }
  5748. return Promise.resolve()
  5749. .then(function () {
  5750. if (!state.registry[name]) {
  5751. return method(options)
  5752. }
  5753. return (state.registry[name]).reduce(function (method, registered) {
  5754. return registered.hook.bind(null, method, options)
  5755. }, method)()
  5756. })
  5757. }
  5758. /***/ }),
  5759. /***/ 368:
  5760. /***/ (function(module) {
  5761. module.exports = function atob(str) {
  5762. return Buffer.from(str, 'base64').toString('binary')
  5763. }
  5764. /***/ }),
  5765. /***/ 370:
  5766. /***/ (function(module) {
  5767. module.exports = deprecate
  5768. const loggedMessages = {}
  5769. function deprecate (message) {
  5770. if (loggedMessages[message]) {
  5771. return
  5772. }
  5773. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5774. loggedMessages[message] = 1
  5775. }
  5776. /***/ }),
  5777. /***/ 372:
  5778. /***/ (function(module) {
  5779. module.exports = octokitDebug;
  5780. function octokitDebug(octokit) {
  5781. octokit.hook.wrap("request", (request, options) => {
  5782. octokit.log.debug("request", options);
  5783. const start = Date.now();
  5784. const requestOptions = octokit.request.endpoint.parse(options);
  5785. const path = requestOptions.url.replace(options.baseUrl, "");
  5786. return request(options)
  5787. .then(response => {
  5788. octokit.log.info(
  5789. `${requestOptions.method} ${path} - ${
  5790. response.status
  5791. } in ${Date.now() - start}ms`
  5792. );
  5793. return response;
  5794. })
  5795. .catch(error => {
  5796. octokit.log.info(
  5797. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5798. start}ms`
  5799. );
  5800. throw error;
  5801. });
  5802. });
  5803. }
  5804. /***/ }),
  5805. /***/ 385:
  5806. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5807. "use strict";
  5808. Object.defineProperty(exports, '__esModule', { value: true });
  5809. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5810. var isPlainObject = _interopDefault(__webpack_require__(696));
  5811. var universalUserAgent = __webpack_require__(796);
  5812. function lowercaseKeys(object) {
  5813. if (!object) {
  5814. return {};
  5815. }
  5816. return Object.keys(object).reduce((newObj, key) => {
  5817. newObj[key.toLowerCase()] = object[key];
  5818. return newObj;
  5819. }, {});
  5820. }
  5821. function mergeDeep(defaults, options) {
  5822. const result = Object.assign({}, defaults);
  5823. Object.keys(options).forEach(key => {
  5824. if (isPlainObject(options[key])) {
  5825. if (!(key in defaults)) Object.assign(result, {
  5826. [key]: options[key]
  5827. });else result[key] = mergeDeep(defaults[key], options[key]);
  5828. } else {
  5829. Object.assign(result, {
  5830. [key]: options[key]
  5831. });
  5832. }
  5833. });
  5834. return result;
  5835. }
  5836. function merge(defaults, route, options) {
  5837. if (typeof route === "string") {
  5838. let [method, url] = route.split(" ");
  5839. options = Object.assign(url ? {
  5840. method,
  5841. url
  5842. } : {
  5843. url: method
  5844. }, options);
  5845. } else {
  5846. options = Object.assign({}, route);
  5847. } // lowercase header names before merging with defaults to avoid duplicates
  5848. options.headers = lowercaseKeys(options.headers);
  5849. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5850. if (defaults && defaults.mediaType.previews.length) {
  5851. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5852. }
  5853. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5854. return mergedOptions;
  5855. }
  5856. function addQueryParameters(url, parameters) {
  5857. const separator = /\?/.test(url) ? "&" : "?";
  5858. const names = Object.keys(parameters);
  5859. if (names.length === 0) {
  5860. return url;
  5861. }
  5862. return url + separator + names.map(name => {
  5863. if (name === "q") {
  5864. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5865. }
  5866. return `${name}=${encodeURIComponent(parameters[name])}`;
  5867. }).join("&");
  5868. }
  5869. const urlVariableRegex = /\{[^}]+\}/g;
  5870. function removeNonChars(variableName) {
  5871. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5872. }
  5873. function extractUrlVariableNames(url) {
  5874. const matches = url.match(urlVariableRegex);
  5875. if (!matches) {
  5876. return [];
  5877. }
  5878. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5879. }
  5880. function omit(object, keysToOmit) {
  5881. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5882. obj[key] = object[key];
  5883. return obj;
  5884. }, {});
  5885. }
  5886. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5887. // TODO: create separate package.
  5888. //
  5889. // Copyright (c) 2012-2014, Bram Stein
  5890. // All rights reserved.
  5891. // Redistribution and use in source and binary forms, with or without
  5892. // modification, are permitted provided that the following conditions
  5893. // are met:
  5894. // 1. Redistributions of source code must retain the above copyright
  5895. // notice, this list of conditions and the following disclaimer.
  5896. // 2. Redistributions in binary form must reproduce the above copyright
  5897. // notice, this list of conditions and the following disclaimer in the
  5898. // documentation and/or other materials provided with the distribution.
  5899. // 3. The name of the author may not be used to endorse or promote products
  5900. // derived from this software without specific prior written permission.
  5901. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5902. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5903. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5904. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5905. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5906. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5907. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5908. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5909. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5910. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5911. /* istanbul ignore file */
  5912. function encodeReserved(str) {
  5913. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5914. if (!/%[0-9A-Fa-f]/.test(part)) {
  5915. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5916. }
  5917. return part;
  5918. }).join("");
  5919. }
  5920. function encodeUnreserved(str) {
  5921. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5922. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5923. });
  5924. }
  5925. function encodeValue(operator, value, key) {
  5926. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5927. if (key) {
  5928. return encodeUnreserved(key) + "=" + value;
  5929. } else {
  5930. return value;
  5931. }
  5932. }
  5933. function isDefined(value) {
  5934. return value !== undefined && value !== null;
  5935. }
  5936. function isKeyOperator(operator) {
  5937. return operator === ";" || operator === "&" || operator === "?";
  5938. }
  5939. function getValues(context, operator, key, modifier) {
  5940. var value = context[key],
  5941. result = [];
  5942. if (isDefined(value) && value !== "") {
  5943. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5944. value = value.toString();
  5945. if (modifier && modifier !== "*") {
  5946. value = value.substring(0, parseInt(modifier, 10));
  5947. }
  5948. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5949. } else {
  5950. if (modifier === "*") {
  5951. if (Array.isArray(value)) {
  5952. value.filter(isDefined).forEach(function (value) {
  5953. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5954. });
  5955. } else {
  5956. Object.keys(value).forEach(function (k) {
  5957. if (isDefined(value[k])) {
  5958. result.push(encodeValue(operator, value[k], k));
  5959. }
  5960. });
  5961. }
  5962. } else {
  5963. const tmp = [];
  5964. if (Array.isArray(value)) {
  5965. value.filter(isDefined).forEach(function (value) {
  5966. tmp.push(encodeValue(operator, value));
  5967. });
  5968. } else {
  5969. Object.keys(value).forEach(function (k) {
  5970. if (isDefined(value[k])) {
  5971. tmp.push(encodeUnreserved(k));
  5972. tmp.push(encodeValue(operator, value[k].toString()));
  5973. }
  5974. });
  5975. }
  5976. if (isKeyOperator(operator)) {
  5977. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5978. } else if (tmp.length !== 0) {
  5979. result.push(tmp.join(","));
  5980. }
  5981. }
  5982. }
  5983. } else {
  5984. if (operator === ";") {
  5985. if (isDefined(value)) {
  5986. result.push(encodeUnreserved(key));
  5987. }
  5988. } else if (value === "" && (operator === "&" || operator === "?")) {
  5989. result.push(encodeUnreserved(key) + "=");
  5990. } else if (value === "") {
  5991. result.push("");
  5992. }
  5993. }
  5994. return result;
  5995. }
  5996. function parseUrl(template) {
  5997. return {
  5998. expand: expand.bind(null, template)
  5999. };
  6000. }
  6001. function expand(template, context) {
  6002. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6003. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6004. if (expression) {
  6005. let operator = "";
  6006. const values = [];
  6007. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6008. operator = expression.charAt(0);
  6009. expression = expression.substr(1);
  6010. }
  6011. expression.split(/,/g).forEach(function (variable) {
  6012. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6013. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6014. });
  6015. if (operator && operator !== "+") {
  6016. var separator = ",";
  6017. if (operator === "?") {
  6018. separator = "&";
  6019. } else if (operator !== "#") {
  6020. separator = operator;
  6021. }
  6022. return (values.length !== 0 ? operator : "") + values.join(separator);
  6023. } else {
  6024. return values.join(",");
  6025. }
  6026. } else {
  6027. return encodeReserved(literal);
  6028. }
  6029. });
  6030. }
  6031. function parse(options) {
  6032. // https://fetch.spec.whatwg.org/#methods
  6033. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6034. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6035. let headers = Object.assign({}, options.headers);
  6036. let body;
  6037. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6038. const urlVariableNames = extractUrlVariableNames(url);
  6039. url = parseUrl(url).expand(parameters);
  6040. if (!/^http/.test(url)) {
  6041. url = options.baseUrl + url;
  6042. }
  6043. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6044. const remainingParameters = omit(parameters, omittedParameters);
  6045. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6046. if (!isBinaryRequset) {
  6047. if (options.mediaType.format) {
  6048. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6049. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6050. }
  6051. if (options.mediaType.previews.length) {
  6052. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6053. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6054. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6055. return `application/vnd.github.${preview}-preview${format}`;
  6056. }).join(",");
  6057. }
  6058. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6059. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6060. if (["GET", "HEAD"].includes(method)) {
  6061. url = addQueryParameters(url, remainingParameters);
  6062. } else {
  6063. if ("data" in remainingParameters) {
  6064. body = remainingParameters.data;
  6065. } else {
  6066. if (Object.keys(remainingParameters).length) {
  6067. body = remainingParameters;
  6068. } else {
  6069. headers["content-length"] = 0;
  6070. }
  6071. }
  6072. } // default content-type for JSON if body is set
  6073. if (!headers["content-type"] && typeof body !== "undefined") {
  6074. headers["content-type"] = "application/json; charset=utf-8";
  6075. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6076. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6077. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6078. body = "";
  6079. } // Only return body/request keys if present
  6080. return Object.assign({
  6081. method,
  6082. url,
  6083. headers
  6084. }, typeof body !== "undefined" ? {
  6085. body
  6086. } : null, options.request ? {
  6087. request: options.request
  6088. } : null);
  6089. }
  6090. function endpointWithDefaults(defaults, route, options) {
  6091. return parse(merge(defaults, route, options));
  6092. }
  6093. function withDefaults(oldDefaults, newDefaults) {
  6094. const DEFAULTS = merge(oldDefaults, newDefaults);
  6095. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6096. return Object.assign(endpoint, {
  6097. DEFAULTS,
  6098. defaults: withDefaults.bind(null, DEFAULTS),
  6099. merge: merge.bind(null, DEFAULTS),
  6100. parse
  6101. });
  6102. }
  6103. const VERSION = "5.5.1";
  6104. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6105. // So we use RequestParameters and add method as additional required property.
  6106. const DEFAULTS = {
  6107. method: "GET",
  6108. baseUrl: "https://api.github.com",
  6109. headers: {
  6110. accept: "application/vnd.github.v3+json",
  6111. "user-agent": userAgent
  6112. },
  6113. mediaType: {
  6114. format: "",
  6115. previews: []
  6116. }
  6117. };
  6118. const endpoint = withDefaults(null, DEFAULTS);
  6119. exports.endpoint = endpoint;
  6120. //# sourceMappingURL=index.js.map
  6121. /***/ }),
  6122. /***/ 389:
  6123. /***/ (function(module, __unusedexports, __webpack_require__) {
  6124. "use strict";
  6125. const fs = __webpack_require__(747);
  6126. const shebangCommand = __webpack_require__(866);
  6127. function readShebang(command) {
  6128. // Read the first 150 bytes from the file
  6129. const size = 150;
  6130. let buffer;
  6131. if (Buffer.alloc) {
  6132. // Node.js v4.5+ / v5.10+
  6133. buffer = Buffer.alloc(size);
  6134. } else {
  6135. // Old Node.js API
  6136. buffer = new Buffer(size);
  6137. buffer.fill(0); // zero-fill
  6138. }
  6139. let fd;
  6140. try {
  6141. fd = fs.openSync(command, 'r');
  6142. fs.readSync(fd, buffer, 0, size, 0);
  6143. fs.closeSync(fd);
  6144. } catch (e) { /* Empty */ }
  6145. // Attempt to extract shebang (null is returned if not a shebang)
  6146. return shebangCommand(buffer.toString());
  6147. }
  6148. module.exports = readShebang;
  6149. /***/ }),
  6150. /***/ 402:
  6151. /***/ (function(module, __unusedexports, __webpack_require__) {
  6152. module.exports = Octokit;
  6153. const { request } = __webpack_require__(753);
  6154. const Hook = __webpack_require__(523);
  6155. const parseClientOptions = __webpack_require__(294);
  6156. function Octokit(plugins, options) {
  6157. options = options || {};
  6158. const hook = new Hook.Collection();
  6159. const log = Object.assign(
  6160. {
  6161. debug: () => {},
  6162. info: () => {},
  6163. warn: console.warn,
  6164. error: console.error
  6165. },
  6166. options && options.log
  6167. );
  6168. const api = {
  6169. hook,
  6170. log,
  6171. request: request.defaults(parseClientOptions(options, log, hook))
  6172. };
  6173. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6174. return api;
  6175. }
  6176. /***/ }),
  6177. /***/ 413:
  6178. /***/ (function(module) {
  6179. module.exports = require("stream");
  6180. /***/ }),
  6181. /***/ 417:
  6182. /***/ (function(module) {
  6183. module.exports = require("crypto");
  6184. /***/ }),
  6185. /***/ 427:
  6186. /***/ (function(module, __unusedexports, __webpack_require__) {
  6187. "use strict";
  6188. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6189. // In that case, fall back to a deprecated internal.
  6190. const util = __webpack_require__(669);
  6191. let uv;
  6192. if (typeof util.getSystemErrorName === 'function') {
  6193. module.exports = util.getSystemErrorName;
  6194. } else {
  6195. try {
  6196. uv = process.binding('uv');
  6197. if (typeof uv.errname !== 'function') {
  6198. throw new TypeError('uv.errname is not a function');
  6199. }
  6200. } catch (err) {
  6201. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6202. uv = null;
  6203. }
  6204. module.exports = code => errname(uv, code);
  6205. }
  6206. // Used for testing the fallback behavior
  6207. module.exports.__test__ = errname;
  6208. function errname(uv, code) {
  6209. if (uv) {
  6210. return uv.errname(code);
  6211. }
  6212. if (!(code < 0)) {
  6213. throw new Error('err >= 0');
  6214. }
  6215. return `Unknown system error ${code}`;
  6216. }
  6217. /***/ }),
  6218. /***/ 430:
  6219. /***/ (function(module, __unusedexports, __webpack_require__) {
  6220. module.exports = octokitValidate;
  6221. const validate = __webpack_require__(348);
  6222. function octokitValidate(octokit) {
  6223. octokit.hook.before("request", validate.bind(null, octokit));
  6224. }
  6225. /***/ }),
  6226. /***/ 431:
  6227. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6228. "use strict";
  6229. Object.defineProperty(exports, "__esModule", { value: true });
  6230. const os = __webpack_require__(87);
  6231. /**
  6232. * Commands
  6233. *
  6234. * Command Format:
  6235. * ##[name key=value;key=value]message
  6236. *
  6237. * Examples:
  6238. * ##[warning]This is the user warning message
  6239. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6240. */
  6241. function issueCommand(command, properties, message) {
  6242. const cmd = new Command(command, properties, message);
  6243. process.stdout.write(cmd.toString() + os.EOL);
  6244. }
  6245. exports.issueCommand = issueCommand;
  6246. function issue(name, message = '') {
  6247. issueCommand(name, {}, message);
  6248. }
  6249. exports.issue = issue;
  6250. const CMD_STRING = '::';
  6251. class Command {
  6252. constructor(command, properties, message) {
  6253. if (!command) {
  6254. command = 'missing.command';
  6255. }
  6256. this.command = command;
  6257. this.properties = properties;
  6258. this.message = message;
  6259. }
  6260. toString() {
  6261. let cmdStr = CMD_STRING + this.command;
  6262. if (this.properties && Object.keys(this.properties).length > 0) {
  6263. cmdStr += ' ';
  6264. for (const key in this.properties) {
  6265. if (this.properties.hasOwnProperty(key)) {
  6266. const val = this.properties[key];
  6267. if (val) {
  6268. // safely append the val - avoid blowing up when attempting to
  6269. // call .replace() if message is not a string for some reason
  6270. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6271. }
  6272. }
  6273. }
  6274. }
  6275. cmdStr += CMD_STRING;
  6276. // safely append the message - avoid blowing up when attempting to
  6277. // call .replace() if message is not a string for some reason
  6278. const message = `${this.message || ''}`;
  6279. cmdStr += escapeData(message);
  6280. return cmdStr;
  6281. }
  6282. }
  6283. function escapeData(s) {
  6284. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6285. }
  6286. function escape(s) {
  6287. return s
  6288. .replace(/\r/g, '%0D')
  6289. .replace(/\n/g, '%0A')
  6290. .replace(/]/g, '%5D')
  6291. .replace(/;/g, '%3B');
  6292. }
  6293. //# sourceMappingURL=command.js.map
  6294. /***/ }),
  6295. /***/ 438:
  6296. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6297. "use strict";
  6298. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6299. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6300. return new (P || (P = Promise))(function (resolve, reject) {
  6301. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6302. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6303. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6304. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6305. });
  6306. };
  6307. var __importStar = (this && this.__importStar) || function (mod) {
  6308. if (mod && mod.__esModule) return mod;
  6309. var result = {};
  6310. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6311. result["default"] = mod;
  6312. return result;
  6313. };
  6314. Object.defineProperty(exports, "__esModule", { value: true });
  6315. const assert = __importStar(__webpack_require__(357));
  6316. const core = __importStar(__webpack_require__(470));
  6317. const fs = __importStar(__webpack_require__(747));
  6318. const fsHelper = __importStar(__webpack_require__(618));
  6319. const io = __importStar(__webpack_require__(1));
  6320. const path = __importStar(__webpack_require__(622));
  6321. function prepareExistingDirectory(git, repositoryPath, preferredRemoteUrl, allowedRemoteUrls, clean) {
  6322. return __awaiter(this, void 0, void 0, function* () {
  6323. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6324. assert.ok(preferredRemoteUrl, 'Expected preferredRemoteUrl to be defined');
  6325. assert.ok(allowedRemoteUrls, 'Expected allowedRemoteUrls to be defined');
  6326. assert.ok(allowedRemoteUrls.length, 'Expected allowedRemoteUrls to have at least one value');
  6327. // Indicates whether to delete the directory contents
  6328. let remove = false;
  6329. // The remote URL
  6330. let remoteUrl;
  6331. // Check whether using git or REST API
  6332. if (!git) {
  6333. remove = true;
  6334. }
  6335. // Fetch URL does not match
  6336. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6337. allowedRemoteUrls.indexOf((remoteUrl = yield git.tryGetRemoteUrl())) < 0) {
  6338. remove = true;
  6339. }
  6340. else {
  6341. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6342. const lockPaths = [
  6343. path.join(repositoryPath, '.git', 'index.lock'),
  6344. path.join(repositoryPath, '.git', 'shallow.lock')
  6345. ];
  6346. for (const lockPath of lockPaths) {
  6347. try {
  6348. yield io.rmRF(lockPath);
  6349. }
  6350. catch (error) {
  6351. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6352. }
  6353. }
  6354. try {
  6355. core.startGroup('Removing previously created refs, to avoid conflicts');
  6356. // Checkout detached HEAD
  6357. if (!(yield git.isDetached())) {
  6358. yield git.checkoutDetach();
  6359. }
  6360. // Remove all refs/heads/*
  6361. let branches = yield git.branchList(false);
  6362. for (const branch of branches) {
  6363. yield git.branchDelete(false, branch);
  6364. }
  6365. // Remove all refs/remotes/origin/* to avoid conflicts
  6366. branches = yield git.branchList(true);
  6367. for (const branch of branches) {
  6368. yield git.branchDelete(true, branch);
  6369. }
  6370. core.endGroup();
  6371. // Clean
  6372. if (clean) {
  6373. core.startGroup('Cleaning the repository');
  6374. if (!(yield git.tryClean())) {
  6375. 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}'.`);
  6376. remove = true;
  6377. }
  6378. else if (!(yield git.tryReset())) {
  6379. remove = true;
  6380. }
  6381. core.endGroup();
  6382. if (remove) {
  6383. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6384. }
  6385. }
  6386. // Update to the preferred remote URL
  6387. if (remoteUrl !== preferredRemoteUrl) {
  6388. core.startGroup('Updating the remote URL');
  6389. yield git.setRemoteUrl(preferredRemoteUrl);
  6390. core.endGroup();
  6391. }
  6392. }
  6393. catch (error) {
  6394. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6395. remove = true;
  6396. }
  6397. }
  6398. if (remove) {
  6399. // Delete the contents of the directory. Don't delete the directory itself
  6400. // since it might be the current working directory.
  6401. core.info(`Deleting the contents of '${repositoryPath}'`);
  6402. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6403. yield io.rmRF(path.join(repositoryPath, file));
  6404. }
  6405. }
  6406. });
  6407. }
  6408. exports.prepareExistingDirectory = prepareExistingDirectory;
  6409. /***/ }),
  6410. /***/ 453:
  6411. /***/ (function(module, __unusedexports, __webpack_require__) {
  6412. var once = __webpack_require__(969)
  6413. var eos = __webpack_require__(562)
  6414. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6415. var noop = function () {}
  6416. var ancient = /^v?\.0/.test(process.version)
  6417. var isFn = function (fn) {
  6418. return typeof fn === 'function'
  6419. }
  6420. var isFS = function (stream) {
  6421. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6422. if (!fs) return false // browser
  6423. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6424. }
  6425. var isRequest = function (stream) {
  6426. return stream.setHeader && isFn(stream.abort)
  6427. }
  6428. var destroyer = function (stream, reading, writing, callback) {
  6429. callback = once(callback)
  6430. var closed = false
  6431. stream.on('close', function () {
  6432. closed = true
  6433. })
  6434. eos(stream, {readable: reading, writable: writing}, function (err) {
  6435. if (err) return callback(err)
  6436. closed = true
  6437. callback()
  6438. })
  6439. var destroyed = false
  6440. return function (err) {
  6441. if (closed) return
  6442. if (destroyed) return
  6443. destroyed = true
  6444. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6445. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6446. if (isFn(stream.destroy)) return stream.destroy()
  6447. callback(err || new Error('stream was destroyed'))
  6448. }
  6449. }
  6450. var call = function (fn) {
  6451. fn()
  6452. }
  6453. var pipe = function (from, to) {
  6454. return from.pipe(to)
  6455. }
  6456. var pump = function () {
  6457. var streams = Array.prototype.slice.call(arguments)
  6458. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6459. if (Array.isArray(streams[0])) streams = streams[0]
  6460. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6461. var error
  6462. var destroys = streams.map(function (stream, i) {
  6463. var reading = i < streams.length - 1
  6464. var writing = i > 0
  6465. return destroyer(stream, reading, writing, function (err) {
  6466. if (!error) error = err
  6467. if (err) destroys.forEach(call)
  6468. if (reading) return
  6469. destroys.forEach(call)
  6470. callback(error)
  6471. })
  6472. })
  6473. return streams.reduce(pipe)
  6474. }
  6475. module.exports = pump
  6476. /***/ }),
  6477. /***/ 454:
  6478. /***/ (function(module, exports, __webpack_require__) {
  6479. "use strict";
  6480. Object.defineProperty(exports, '__esModule', { value: true });
  6481. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6482. var Stream = _interopDefault(__webpack_require__(413));
  6483. var http = _interopDefault(__webpack_require__(605));
  6484. var Url = _interopDefault(__webpack_require__(835));
  6485. var https = _interopDefault(__webpack_require__(211));
  6486. var zlib = _interopDefault(__webpack_require__(761));
  6487. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6488. // fix for "Readable" isn't a named export issue
  6489. const Readable = Stream.Readable;
  6490. const BUFFER = Symbol('buffer');
  6491. const TYPE = Symbol('type');
  6492. class Blob {
  6493. constructor() {
  6494. this[TYPE] = '';
  6495. const blobParts = arguments[0];
  6496. const options = arguments[1];
  6497. const buffers = [];
  6498. let size = 0;
  6499. if (blobParts) {
  6500. const a = blobParts;
  6501. const length = Number(a.length);
  6502. for (let i = 0; i < length; i++) {
  6503. const element = a[i];
  6504. let buffer;
  6505. if (element instanceof Buffer) {
  6506. buffer = element;
  6507. } else if (ArrayBuffer.isView(element)) {
  6508. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6509. } else if (element instanceof ArrayBuffer) {
  6510. buffer = Buffer.from(element);
  6511. } else if (element instanceof Blob) {
  6512. buffer = element[BUFFER];
  6513. } else {
  6514. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6515. }
  6516. size += buffer.length;
  6517. buffers.push(buffer);
  6518. }
  6519. }
  6520. this[BUFFER] = Buffer.concat(buffers);
  6521. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6522. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6523. this[TYPE] = type;
  6524. }
  6525. }
  6526. get size() {
  6527. return this[BUFFER].length;
  6528. }
  6529. get type() {
  6530. return this[TYPE];
  6531. }
  6532. text() {
  6533. return Promise.resolve(this[BUFFER].toString());
  6534. }
  6535. arrayBuffer() {
  6536. const buf = this[BUFFER];
  6537. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6538. return Promise.resolve(ab);
  6539. }
  6540. stream() {
  6541. const readable = new Readable();
  6542. readable._read = function () {};
  6543. readable.push(this[BUFFER]);
  6544. readable.push(null);
  6545. return readable;
  6546. }
  6547. toString() {
  6548. return '[object Blob]';
  6549. }
  6550. slice() {
  6551. const size = this.size;
  6552. const start = arguments[0];
  6553. const end = arguments[1];
  6554. let relativeStart, relativeEnd;
  6555. if (start === undefined) {
  6556. relativeStart = 0;
  6557. } else if (start < 0) {
  6558. relativeStart = Math.max(size + start, 0);
  6559. } else {
  6560. relativeStart = Math.min(start, size);
  6561. }
  6562. if (end === undefined) {
  6563. relativeEnd = size;
  6564. } else if (end < 0) {
  6565. relativeEnd = Math.max(size + end, 0);
  6566. } else {
  6567. relativeEnd = Math.min(end, size);
  6568. }
  6569. const span = Math.max(relativeEnd - relativeStart, 0);
  6570. const buffer = this[BUFFER];
  6571. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6572. const blob = new Blob([], { type: arguments[2] });
  6573. blob[BUFFER] = slicedBuffer;
  6574. return blob;
  6575. }
  6576. }
  6577. Object.defineProperties(Blob.prototype, {
  6578. size: { enumerable: true },
  6579. type: { enumerable: true },
  6580. slice: { enumerable: true }
  6581. });
  6582. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6583. value: 'Blob',
  6584. writable: false,
  6585. enumerable: false,
  6586. configurable: true
  6587. });
  6588. /**
  6589. * fetch-error.js
  6590. *
  6591. * FetchError interface for operational errors
  6592. */
  6593. /**
  6594. * Create FetchError instance
  6595. *
  6596. * @param String message Error message for human
  6597. * @param String type Error type for machine
  6598. * @param String systemError For Node.js system error
  6599. * @return FetchError
  6600. */
  6601. function FetchError(message, type, systemError) {
  6602. Error.call(this, message);
  6603. this.message = message;
  6604. this.type = type;
  6605. // when err.type is `system`, err.code contains system error code
  6606. if (systemError) {
  6607. this.code = this.errno = systemError.code;
  6608. }
  6609. // hide custom error implementation details from end-users
  6610. Error.captureStackTrace(this, this.constructor);
  6611. }
  6612. FetchError.prototype = Object.create(Error.prototype);
  6613. FetchError.prototype.constructor = FetchError;
  6614. FetchError.prototype.name = 'FetchError';
  6615. let convert;
  6616. try {
  6617. convert = __webpack_require__(18).convert;
  6618. } catch (e) {}
  6619. const INTERNALS = Symbol('Body internals');
  6620. // fix an issue where "PassThrough" isn't a named export for node <10
  6621. const PassThrough = Stream.PassThrough;
  6622. /**
  6623. * Body mixin
  6624. *
  6625. * Ref: https://fetch.spec.whatwg.org/#body
  6626. *
  6627. * @param Stream body Readable stream
  6628. * @param Object opts Response options
  6629. * @return Void
  6630. */
  6631. function Body(body) {
  6632. var _this = this;
  6633. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6634. _ref$size = _ref.size;
  6635. let size = _ref$size === undefined ? 0 : _ref$size;
  6636. var _ref$timeout = _ref.timeout;
  6637. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6638. if (body == null) {
  6639. // body is undefined or null
  6640. body = null;
  6641. } else if (isURLSearchParams(body)) {
  6642. // body is a URLSearchParams
  6643. body = Buffer.from(body.toString());
  6644. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6645. // body is ArrayBuffer
  6646. body = Buffer.from(body);
  6647. } else if (ArrayBuffer.isView(body)) {
  6648. // body is ArrayBufferView
  6649. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6650. } else if (body instanceof Stream) ; else {
  6651. // none of the above
  6652. // coerce to string then buffer
  6653. body = Buffer.from(String(body));
  6654. }
  6655. this[INTERNALS] = {
  6656. body,
  6657. disturbed: false,
  6658. error: null
  6659. };
  6660. this.size = size;
  6661. this.timeout = timeout;
  6662. if (body instanceof Stream) {
  6663. body.on('error', function (err) {
  6664. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6665. _this[INTERNALS].error = error;
  6666. });
  6667. }
  6668. }
  6669. Body.prototype = {
  6670. get body() {
  6671. return this[INTERNALS].body;
  6672. },
  6673. get bodyUsed() {
  6674. return this[INTERNALS].disturbed;
  6675. },
  6676. /**
  6677. * Decode response as ArrayBuffer
  6678. *
  6679. * @return Promise
  6680. */
  6681. arrayBuffer() {
  6682. return consumeBody.call(this).then(function (buf) {
  6683. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6684. });
  6685. },
  6686. /**
  6687. * Return raw response as Blob
  6688. *
  6689. * @return Promise
  6690. */
  6691. blob() {
  6692. let ct = this.headers && this.headers.get('content-type') || '';
  6693. return consumeBody.call(this).then(function (buf) {
  6694. return Object.assign(
  6695. // Prevent copying
  6696. new Blob([], {
  6697. type: ct.toLowerCase()
  6698. }), {
  6699. [BUFFER]: buf
  6700. });
  6701. });
  6702. },
  6703. /**
  6704. * Decode response as json
  6705. *
  6706. * @return Promise
  6707. */
  6708. json() {
  6709. var _this2 = this;
  6710. return consumeBody.call(this).then(function (buffer) {
  6711. try {
  6712. return JSON.parse(buffer.toString());
  6713. } catch (err) {
  6714. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6715. }
  6716. });
  6717. },
  6718. /**
  6719. * Decode response as text
  6720. *
  6721. * @return Promise
  6722. */
  6723. text() {
  6724. return consumeBody.call(this).then(function (buffer) {
  6725. return buffer.toString();
  6726. });
  6727. },
  6728. /**
  6729. * Decode response as buffer (non-spec api)
  6730. *
  6731. * @return Promise
  6732. */
  6733. buffer() {
  6734. return consumeBody.call(this);
  6735. },
  6736. /**
  6737. * Decode response as text, while automatically detecting the encoding and
  6738. * trying to decode to UTF-8 (non-spec api)
  6739. *
  6740. * @return Promise
  6741. */
  6742. textConverted() {
  6743. var _this3 = this;
  6744. return consumeBody.call(this).then(function (buffer) {
  6745. return convertBody(buffer, _this3.headers);
  6746. });
  6747. }
  6748. };
  6749. // In browsers, all properties are enumerable.
  6750. Object.defineProperties(Body.prototype, {
  6751. body: { enumerable: true },
  6752. bodyUsed: { enumerable: true },
  6753. arrayBuffer: { enumerable: true },
  6754. blob: { enumerable: true },
  6755. json: { enumerable: true },
  6756. text: { enumerable: true }
  6757. });
  6758. Body.mixIn = function (proto) {
  6759. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6760. // istanbul ignore else: future proof
  6761. if (!(name in proto)) {
  6762. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6763. Object.defineProperty(proto, name, desc);
  6764. }
  6765. }
  6766. };
  6767. /**
  6768. * Consume and convert an entire Body to a Buffer.
  6769. *
  6770. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6771. *
  6772. * @return Promise
  6773. */
  6774. function consumeBody() {
  6775. var _this4 = this;
  6776. if (this[INTERNALS].disturbed) {
  6777. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6778. }
  6779. this[INTERNALS].disturbed = true;
  6780. if (this[INTERNALS].error) {
  6781. return Body.Promise.reject(this[INTERNALS].error);
  6782. }
  6783. let body = this.body;
  6784. // body is null
  6785. if (body === null) {
  6786. return Body.Promise.resolve(Buffer.alloc(0));
  6787. }
  6788. // body is blob
  6789. if (isBlob(body)) {
  6790. body = body.stream();
  6791. }
  6792. // body is buffer
  6793. if (Buffer.isBuffer(body)) {
  6794. return Body.Promise.resolve(body);
  6795. }
  6796. // istanbul ignore if: should never happen
  6797. if (!(body instanceof Stream)) {
  6798. return Body.Promise.resolve(Buffer.alloc(0));
  6799. }
  6800. // body is stream
  6801. // get ready to actually consume the body
  6802. let accum = [];
  6803. let accumBytes = 0;
  6804. let abort = false;
  6805. return new Body.Promise(function (resolve, reject) {
  6806. let resTimeout;
  6807. // allow timeout on slow response body
  6808. if (_this4.timeout) {
  6809. resTimeout = setTimeout(function () {
  6810. abort = true;
  6811. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6812. }, _this4.timeout);
  6813. }
  6814. // handle stream errors
  6815. body.on('error', function (err) {
  6816. if (err.name === 'AbortError') {
  6817. // if the request was aborted, reject with this Error
  6818. abort = true;
  6819. reject(err);
  6820. } else {
  6821. // other errors, such as incorrect content-encoding
  6822. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6823. }
  6824. });
  6825. body.on('data', function (chunk) {
  6826. if (abort || chunk === null) {
  6827. return;
  6828. }
  6829. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6830. abort = true;
  6831. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6832. return;
  6833. }
  6834. accumBytes += chunk.length;
  6835. accum.push(chunk);
  6836. });
  6837. body.on('end', function () {
  6838. if (abort) {
  6839. return;
  6840. }
  6841. clearTimeout(resTimeout);
  6842. try {
  6843. resolve(Buffer.concat(accum, accumBytes));
  6844. } catch (err) {
  6845. // handle streams that have accumulated too much data (issue #414)
  6846. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6847. }
  6848. });
  6849. });
  6850. }
  6851. /**
  6852. * Detect buffer encoding and convert to target encoding
  6853. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6854. *
  6855. * @param Buffer buffer Incoming buffer
  6856. * @param String encoding Target encoding
  6857. * @return String
  6858. */
  6859. function convertBody(buffer, headers) {
  6860. if (typeof convert !== 'function') {
  6861. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6862. }
  6863. const ct = headers.get('content-type');
  6864. let charset = 'utf-8';
  6865. let res, str;
  6866. // header
  6867. if (ct) {
  6868. res = /charset=([^;]*)/i.exec(ct);
  6869. }
  6870. // no charset in content type, peek at response body for at most 1024 bytes
  6871. str = buffer.slice(0, 1024).toString();
  6872. // html5
  6873. if (!res && str) {
  6874. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6875. }
  6876. // html4
  6877. if (!res && str) {
  6878. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6879. if (res) {
  6880. res = /charset=(.*)/i.exec(res.pop());
  6881. }
  6882. }
  6883. // xml
  6884. if (!res && str) {
  6885. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6886. }
  6887. // found charset
  6888. if (res) {
  6889. charset = res.pop();
  6890. // prevent decode issues when sites use incorrect encoding
  6891. // ref: https://hsivonen.fi/encoding-menu/
  6892. if (charset === 'gb2312' || charset === 'gbk') {
  6893. charset = 'gb18030';
  6894. }
  6895. }
  6896. // turn raw buffers into a single utf-8 buffer
  6897. return convert(buffer, 'UTF-8', charset).toString();
  6898. }
  6899. /**
  6900. * Detect a URLSearchParams object
  6901. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6902. *
  6903. * @param Object obj Object to detect by type or brand
  6904. * @return String
  6905. */
  6906. function isURLSearchParams(obj) {
  6907. // Duck-typing as a necessary condition.
  6908. 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') {
  6909. return false;
  6910. }
  6911. // Brand-checking and more duck-typing as optional condition.
  6912. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6913. }
  6914. /**
  6915. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6916. * @param {*} obj
  6917. * @return {boolean}
  6918. */
  6919. function isBlob(obj) {
  6920. 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]);
  6921. }
  6922. /**
  6923. * Clone body given Res/Req instance
  6924. *
  6925. * @param Mixed instance Response or Request instance
  6926. * @return Mixed
  6927. */
  6928. function clone(instance) {
  6929. let p1, p2;
  6930. let body = instance.body;
  6931. // don't allow cloning a used body
  6932. if (instance.bodyUsed) {
  6933. throw new Error('cannot clone body after it is used');
  6934. }
  6935. // check that body is a stream and not form-data object
  6936. // note: we can't clone the form-data object without having it as a dependency
  6937. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6938. // tee instance body
  6939. p1 = new PassThrough();
  6940. p2 = new PassThrough();
  6941. body.pipe(p1);
  6942. body.pipe(p2);
  6943. // set instance body to teed body and return the other teed body
  6944. instance[INTERNALS].body = p1;
  6945. body = p2;
  6946. }
  6947. return body;
  6948. }
  6949. /**
  6950. * Performs the operation "extract a `Content-Type` value from |object|" as
  6951. * specified in the specification:
  6952. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6953. *
  6954. * This function assumes that instance.body is present.
  6955. *
  6956. * @param Mixed instance Any options.body input
  6957. */
  6958. function extractContentType(body) {
  6959. if (body === null) {
  6960. // body is null
  6961. return null;
  6962. } else if (typeof body === 'string') {
  6963. // body is string
  6964. return 'text/plain;charset=UTF-8';
  6965. } else if (isURLSearchParams(body)) {
  6966. // body is a URLSearchParams
  6967. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6968. } else if (isBlob(body)) {
  6969. // body is blob
  6970. return body.type || null;
  6971. } else if (Buffer.isBuffer(body)) {
  6972. // body is buffer
  6973. return null;
  6974. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6975. // body is ArrayBuffer
  6976. return null;
  6977. } else if (ArrayBuffer.isView(body)) {
  6978. // body is ArrayBufferView
  6979. return null;
  6980. } else if (typeof body.getBoundary === 'function') {
  6981. // detect form data input from form-data module
  6982. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6983. } else if (body instanceof Stream) {
  6984. // body is stream
  6985. // can't really do much about this
  6986. return null;
  6987. } else {
  6988. // Body constructor defaults other things to string
  6989. return 'text/plain;charset=UTF-8';
  6990. }
  6991. }
  6992. /**
  6993. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6994. * For us, we have to explicitly get it with a function.
  6995. *
  6996. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6997. *
  6998. * @param Body instance Instance of Body
  6999. * @return Number? Number of bytes, or null if not possible
  7000. */
  7001. function getTotalBytes(instance) {
  7002. const body = instance.body;
  7003. if (body === null) {
  7004. // body is null
  7005. return 0;
  7006. } else if (isBlob(body)) {
  7007. return body.size;
  7008. } else if (Buffer.isBuffer(body)) {
  7009. // body is buffer
  7010. return body.length;
  7011. } else if (body && typeof body.getLengthSync === 'function') {
  7012. // detect form data input from form-data module
  7013. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  7014. body.hasKnownLength && body.hasKnownLength()) {
  7015. // 2.x
  7016. return body.getLengthSync();
  7017. }
  7018. return null;
  7019. } else {
  7020. // body is stream
  7021. return null;
  7022. }
  7023. }
  7024. /**
  7025. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7026. *
  7027. * @param Body instance Instance of Body
  7028. * @return Void
  7029. */
  7030. function writeToStream(dest, instance) {
  7031. const body = instance.body;
  7032. if (body === null) {
  7033. // body is null
  7034. dest.end();
  7035. } else if (isBlob(body)) {
  7036. body.stream().pipe(dest);
  7037. } else if (Buffer.isBuffer(body)) {
  7038. // body is buffer
  7039. dest.write(body);
  7040. dest.end();
  7041. } else {
  7042. // body is stream
  7043. body.pipe(dest);
  7044. }
  7045. }
  7046. // expose Promise
  7047. Body.Promise = global.Promise;
  7048. /**
  7049. * headers.js
  7050. *
  7051. * Headers class offers convenient helpers
  7052. */
  7053. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7054. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7055. function validateName(name) {
  7056. name = `${name}`;
  7057. if (invalidTokenRegex.test(name) || name === '') {
  7058. throw new TypeError(`${name} is not a legal HTTP header name`);
  7059. }
  7060. }
  7061. function validateValue(value) {
  7062. value = `${value}`;
  7063. if (invalidHeaderCharRegex.test(value)) {
  7064. throw new TypeError(`${value} is not a legal HTTP header value`);
  7065. }
  7066. }
  7067. /**
  7068. * Find the key in the map object given a header name.
  7069. *
  7070. * Returns undefined if not found.
  7071. *
  7072. * @param String name Header name
  7073. * @return String|Undefined
  7074. */
  7075. function find(map, name) {
  7076. name = name.toLowerCase();
  7077. for (const key in map) {
  7078. if (key.toLowerCase() === name) {
  7079. return key;
  7080. }
  7081. }
  7082. return undefined;
  7083. }
  7084. const MAP = Symbol('map');
  7085. class Headers {
  7086. /**
  7087. * Headers class
  7088. *
  7089. * @param Object headers Response headers
  7090. * @return Void
  7091. */
  7092. constructor() {
  7093. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7094. this[MAP] = Object.create(null);
  7095. if (init instanceof Headers) {
  7096. const rawHeaders = init.raw();
  7097. const headerNames = Object.keys(rawHeaders);
  7098. for (const headerName of headerNames) {
  7099. for (const value of rawHeaders[headerName]) {
  7100. this.append(headerName, value);
  7101. }
  7102. }
  7103. return;
  7104. }
  7105. // We don't worry about converting prop to ByteString here as append()
  7106. // will handle it.
  7107. if (init == null) ; else if (typeof init === 'object') {
  7108. const method = init[Symbol.iterator];
  7109. if (method != null) {
  7110. if (typeof method !== 'function') {
  7111. throw new TypeError('Header pairs must be iterable');
  7112. }
  7113. // sequence<sequence<ByteString>>
  7114. // Note: per spec we have to first exhaust the lists then process them
  7115. const pairs = [];
  7116. for (const pair of init) {
  7117. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7118. throw new TypeError('Each header pair must be iterable');
  7119. }
  7120. pairs.push(Array.from(pair));
  7121. }
  7122. for (const pair of pairs) {
  7123. if (pair.length !== 2) {
  7124. throw new TypeError('Each header pair must be a name/value tuple');
  7125. }
  7126. this.append(pair[0], pair[1]);
  7127. }
  7128. } else {
  7129. // record<ByteString, ByteString>
  7130. for (const key of Object.keys(init)) {
  7131. const value = init[key];
  7132. this.append(key, value);
  7133. }
  7134. }
  7135. } else {
  7136. throw new TypeError('Provided initializer must be an object');
  7137. }
  7138. }
  7139. /**
  7140. * Return combined header value given name
  7141. *
  7142. * @param String name Header name
  7143. * @return Mixed
  7144. */
  7145. get(name) {
  7146. name = `${name}`;
  7147. validateName(name);
  7148. const key = find(this[MAP], name);
  7149. if (key === undefined) {
  7150. return null;
  7151. }
  7152. return this[MAP][key].join(', ');
  7153. }
  7154. /**
  7155. * Iterate over all headers
  7156. *
  7157. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7158. * @param Boolean thisArg `this` context for callback function
  7159. * @return Void
  7160. */
  7161. forEach(callback) {
  7162. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7163. let pairs = getHeaders(this);
  7164. let i = 0;
  7165. while (i < pairs.length) {
  7166. var _pairs$i = pairs[i];
  7167. const name = _pairs$i[0],
  7168. value = _pairs$i[1];
  7169. callback.call(thisArg, value, name, this);
  7170. pairs = getHeaders(this);
  7171. i++;
  7172. }
  7173. }
  7174. /**
  7175. * Overwrite header values given name
  7176. *
  7177. * @param String name Header name
  7178. * @param String value Header value
  7179. * @return Void
  7180. */
  7181. set(name, value) {
  7182. name = `${name}`;
  7183. value = `${value}`;
  7184. validateName(name);
  7185. validateValue(value);
  7186. const key = find(this[MAP], name);
  7187. this[MAP][key !== undefined ? key : name] = [value];
  7188. }
  7189. /**
  7190. * Append a value onto existing header
  7191. *
  7192. * @param String name Header name
  7193. * @param String value Header value
  7194. * @return Void
  7195. */
  7196. append(name, value) {
  7197. name = `${name}`;
  7198. value = `${value}`;
  7199. validateName(name);
  7200. validateValue(value);
  7201. const key = find(this[MAP], name);
  7202. if (key !== undefined) {
  7203. this[MAP][key].push(value);
  7204. } else {
  7205. this[MAP][name] = [value];
  7206. }
  7207. }
  7208. /**
  7209. * Check for header name existence
  7210. *
  7211. * @param String name Header name
  7212. * @return Boolean
  7213. */
  7214. has(name) {
  7215. name = `${name}`;
  7216. validateName(name);
  7217. return find(this[MAP], name) !== undefined;
  7218. }
  7219. /**
  7220. * Delete all header values given name
  7221. *
  7222. * @param String name Header name
  7223. * @return Void
  7224. */
  7225. delete(name) {
  7226. name = `${name}`;
  7227. validateName(name);
  7228. const key = find(this[MAP], name);
  7229. if (key !== undefined) {
  7230. delete this[MAP][key];
  7231. }
  7232. }
  7233. /**
  7234. * Return raw headers (non-spec api)
  7235. *
  7236. * @return Object
  7237. */
  7238. raw() {
  7239. return this[MAP];
  7240. }
  7241. /**
  7242. * Get an iterator on keys.
  7243. *
  7244. * @return Iterator
  7245. */
  7246. keys() {
  7247. return createHeadersIterator(this, 'key');
  7248. }
  7249. /**
  7250. * Get an iterator on values.
  7251. *
  7252. * @return Iterator
  7253. */
  7254. values() {
  7255. return createHeadersIterator(this, 'value');
  7256. }
  7257. /**
  7258. * Get an iterator on entries.
  7259. *
  7260. * This is the default iterator of the Headers object.
  7261. *
  7262. * @return Iterator
  7263. */
  7264. [Symbol.iterator]() {
  7265. return createHeadersIterator(this, 'key+value');
  7266. }
  7267. }
  7268. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7269. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7270. value: 'Headers',
  7271. writable: false,
  7272. enumerable: false,
  7273. configurable: true
  7274. });
  7275. Object.defineProperties(Headers.prototype, {
  7276. get: { enumerable: true },
  7277. forEach: { enumerable: true },
  7278. set: { enumerable: true },
  7279. append: { enumerable: true },
  7280. has: { enumerable: true },
  7281. delete: { enumerable: true },
  7282. keys: { enumerable: true },
  7283. values: { enumerable: true },
  7284. entries: { enumerable: true }
  7285. });
  7286. function getHeaders(headers) {
  7287. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7288. const keys = Object.keys(headers[MAP]).sort();
  7289. return keys.map(kind === 'key' ? function (k) {
  7290. return k.toLowerCase();
  7291. } : kind === 'value' ? function (k) {
  7292. return headers[MAP][k].join(', ');
  7293. } : function (k) {
  7294. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7295. });
  7296. }
  7297. const INTERNAL = Symbol('internal');
  7298. function createHeadersIterator(target, kind) {
  7299. const iterator = Object.create(HeadersIteratorPrototype);
  7300. iterator[INTERNAL] = {
  7301. target,
  7302. kind,
  7303. index: 0
  7304. };
  7305. return iterator;
  7306. }
  7307. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7308. next() {
  7309. // istanbul ignore if
  7310. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7311. throw new TypeError('Value of `this` is not a HeadersIterator');
  7312. }
  7313. var _INTERNAL = this[INTERNAL];
  7314. const target = _INTERNAL.target,
  7315. kind = _INTERNAL.kind,
  7316. index = _INTERNAL.index;
  7317. const values = getHeaders(target, kind);
  7318. const len = values.length;
  7319. if (index >= len) {
  7320. return {
  7321. value: undefined,
  7322. done: true
  7323. };
  7324. }
  7325. this[INTERNAL].index = index + 1;
  7326. return {
  7327. value: values[index],
  7328. done: false
  7329. };
  7330. }
  7331. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7332. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7333. value: 'HeadersIterator',
  7334. writable: false,
  7335. enumerable: false,
  7336. configurable: true
  7337. });
  7338. /**
  7339. * Export the Headers object in a form that Node.js can consume.
  7340. *
  7341. * @param Headers headers
  7342. * @return Object
  7343. */
  7344. function exportNodeCompatibleHeaders(headers) {
  7345. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7346. // http.request() only supports string as Host header. This hack makes
  7347. // specifying custom Host header possible.
  7348. const hostHeaderKey = find(headers[MAP], 'Host');
  7349. if (hostHeaderKey !== undefined) {
  7350. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7351. }
  7352. return obj;
  7353. }
  7354. /**
  7355. * Create a Headers object from an object of headers, ignoring those that do
  7356. * not conform to HTTP grammar productions.
  7357. *
  7358. * @param Object obj Object of headers
  7359. * @return Headers
  7360. */
  7361. function createHeadersLenient(obj) {
  7362. const headers = new Headers();
  7363. for (const name of Object.keys(obj)) {
  7364. if (invalidTokenRegex.test(name)) {
  7365. continue;
  7366. }
  7367. if (Array.isArray(obj[name])) {
  7368. for (const val of obj[name]) {
  7369. if (invalidHeaderCharRegex.test(val)) {
  7370. continue;
  7371. }
  7372. if (headers[MAP][name] === undefined) {
  7373. headers[MAP][name] = [val];
  7374. } else {
  7375. headers[MAP][name].push(val);
  7376. }
  7377. }
  7378. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7379. headers[MAP][name] = [obj[name]];
  7380. }
  7381. }
  7382. return headers;
  7383. }
  7384. const INTERNALS$1 = Symbol('Response internals');
  7385. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7386. const STATUS_CODES = http.STATUS_CODES;
  7387. /**
  7388. * Response class
  7389. *
  7390. * @param Stream body Readable stream
  7391. * @param Object opts Response options
  7392. * @return Void
  7393. */
  7394. class Response {
  7395. constructor() {
  7396. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7397. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7398. Body.call(this, body, opts);
  7399. const status = opts.status || 200;
  7400. const headers = new Headers(opts.headers);
  7401. if (body != null && !headers.has('Content-Type')) {
  7402. const contentType = extractContentType(body);
  7403. if (contentType) {
  7404. headers.append('Content-Type', contentType);
  7405. }
  7406. }
  7407. this[INTERNALS$1] = {
  7408. url: opts.url,
  7409. status,
  7410. statusText: opts.statusText || STATUS_CODES[status],
  7411. headers,
  7412. counter: opts.counter
  7413. };
  7414. }
  7415. get url() {
  7416. return this[INTERNALS$1].url || '';
  7417. }
  7418. get status() {
  7419. return this[INTERNALS$1].status;
  7420. }
  7421. /**
  7422. * Convenience property representing if the request ended normally
  7423. */
  7424. get ok() {
  7425. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7426. }
  7427. get redirected() {
  7428. return this[INTERNALS$1].counter > 0;
  7429. }
  7430. get statusText() {
  7431. return this[INTERNALS$1].statusText;
  7432. }
  7433. get headers() {
  7434. return this[INTERNALS$1].headers;
  7435. }
  7436. /**
  7437. * Clone this response
  7438. *
  7439. * @return Response
  7440. */
  7441. clone() {
  7442. return new Response(clone(this), {
  7443. url: this.url,
  7444. status: this.status,
  7445. statusText: this.statusText,
  7446. headers: this.headers,
  7447. ok: this.ok,
  7448. redirected: this.redirected
  7449. });
  7450. }
  7451. }
  7452. Body.mixIn(Response.prototype);
  7453. Object.defineProperties(Response.prototype, {
  7454. url: { enumerable: true },
  7455. status: { enumerable: true },
  7456. ok: { enumerable: true },
  7457. redirected: { enumerable: true },
  7458. statusText: { enumerable: true },
  7459. headers: { enumerable: true },
  7460. clone: { enumerable: true }
  7461. });
  7462. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7463. value: 'Response',
  7464. writable: false,
  7465. enumerable: false,
  7466. configurable: true
  7467. });
  7468. const INTERNALS$2 = Symbol('Request internals');
  7469. // fix an issue where "format", "parse" aren't a named export for node <10
  7470. const parse_url = Url.parse;
  7471. const format_url = Url.format;
  7472. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7473. /**
  7474. * Check if a value is an instance of Request.
  7475. *
  7476. * @param Mixed input
  7477. * @return Boolean
  7478. */
  7479. function isRequest(input) {
  7480. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7481. }
  7482. function isAbortSignal(signal) {
  7483. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7484. return !!(proto && proto.constructor.name === 'AbortSignal');
  7485. }
  7486. /**
  7487. * Request class
  7488. *
  7489. * @param Mixed input Url or Request instance
  7490. * @param Object init Custom options
  7491. * @return Void
  7492. */
  7493. class Request {
  7494. constructor(input) {
  7495. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7496. let parsedURL;
  7497. // normalize input
  7498. if (!isRequest(input)) {
  7499. if (input && input.href) {
  7500. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7501. // will fall into this branch also (since their `toString()` will return
  7502. // `href` property anyway)
  7503. parsedURL = parse_url(input.href);
  7504. } else {
  7505. // coerce input to a string before attempting to parse
  7506. parsedURL = parse_url(`${input}`);
  7507. }
  7508. input = {};
  7509. } else {
  7510. parsedURL = parse_url(input.url);
  7511. }
  7512. let method = init.method || input.method || 'GET';
  7513. method = method.toUpperCase();
  7514. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7515. throw new TypeError('Request with GET/HEAD method cannot have body');
  7516. }
  7517. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7518. Body.call(this, inputBody, {
  7519. timeout: init.timeout || input.timeout || 0,
  7520. size: init.size || input.size || 0
  7521. });
  7522. const headers = new Headers(init.headers || input.headers || {});
  7523. if (inputBody != null && !headers.has('Content-Type')) {
  7524. const contentType = extractContentType(inputBody);
  7525. if (contentType) {
  7526. headers.append('Content-Type', contentType);
  7527. }
  7528. }
  7529. let signal = isRequest(input) ? input.signal : null;
  7530. if ('signal' in init) signal = init.signal;
  7531. if (signal != null && !isAbortSignal(signal)) {
  7532. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7533. }
  7534. this[INTERNALS$2] = {
  7535. method,
  7536. redirect: init.redirect || input.redirect || 'follow',
  7537. headers,
  7538. parsedURL,
  7539. signal
  7540. };
  7541. // node-fetch-only options
  7542. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7543. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7544. this.counter = init.counter || input.counter || 0;
  7545. this.agent = init.agent || input.agent;
  7546. }
  7547. get method() {
  7548. return this[INTERNALS$2].method;
  7549. }
  7550. get url() {
  7551. return format_url(this[INTERNALS$2].parsedURL);
  7552. }
  7553. get headers() {
  7554. return this[INTERNALS$2].headers;
  7555. }
  7556. get redirect() {
  7557. return this[INTERNALS$2].redirect;
  7558. }
  7559. get signal() {
  7560. return this[INTERNALS$2].signal;
  7561. }
  7562. /**
  7563. * Clone this request
  7564. *
  7565. * @return Request
  7566. */
  7567. clone() {
  7568. return new Request(this);
  7569. }
  7570. }
  7571. Body.mixIn(Request.prototype);
  7572. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7573. value: 'Request',
  7574. writable: false,
  7575. enumerable: false,
  7576. configurable: true
  7577. });
  7578. Object.defineProperties(Request.prototype, {
  7579. method: { enumerable: true },
  7580. url: { enumerable: true },
  7581. headers: { enumerable: true },
  7582. redirect: { enumerable: true },
  7583. clone: { enumerable: true },
  7584. signal: { enumerable: true }
  7585. });
  7586. /**
  7587. * Convert a Request to Node.js http request options.
  7588. *
  7589. * @param Request A Request instance
  7590. * @return Object The options object to be passed to http.request
  7591. */
  7592. function getNodeRequestOptions(request) {
  7593. const parsedURL = request[INTERNALS$2].parsedURL;
  7594. const headers = new Headers(request[INTERNALS$2].headers);
  7595. // fetch step 1.3
  7596. if (!headers.has('Accept')) {
  7597. headers.set('Accept', '*/*');
  7598. }
  7599. // Basic fetch
  7600. if (!parsedURL.protocol || !parsedURL.hostname) {
  7601. throw new TypeError('Only absolute URLs are supported');
  7602. }
  7603. if (!/^https?:$/.test(parsedURL.protocol)) {
  7604. throw new TypeError('Only HTTP(S) protocols are supported');
  7605. }
  7606. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7607. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7608. }
  7609. // HTTP-network-or-cache fetch steps 2.4-2.7
  7610. let contentLengthValue = null;
  7611. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7612. contentLengthValue = '0';
  7613. }
  7614. if (request.body != null) {
  7615. const totalBytes = getTotalBytes(request);
  7616. if (typeof totalBytes === 'number') {
  7617. contentLengthValue = String(totalBytes);
  7618. }
  7619. }
  7620. if (contentLengthValue) {
  7621. headers.set('Content-Length', contentLengthValue);
  7622. }
  7623. // HTTP-network-or-cache fetch step 2.11
  7624. if (!headers.has('User-Agent')) {
  7625. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7626. }
  7627. // HTTP-network-or-cache fetch step 2.15
  7628. if (request.compress && !headers.has('Accept-Encoding')) {
  7629. headers.set('Accept-Encoding', 'gzip,deflate');
  7630. }
  7631. let agent = request.agent;
  7632. if (typeof agent === 'function') {
  7633. agent = agent(parsedURL);
  7634. }
  7635. if (!headers.has('Connection') && !agent) {
  7636. headers.set('Connection', 'close');
  7637. }
  7638. // HTTP-network fetch step 4.2
  7639. // chunked encoding is handled by Node.js
  7640. return Object.assign({}, parsedURL, {
  7641. method: request.method,
  7642. headers: exportNodeCompatibleHeaders(headers),
  7643. agent
  7644. });
  7645. }
  7646. /**
  7647. * abort-error.js
  7648. *
  7649. * AbortError interface for cancelled requests
  7650. */
  7651. /**
  7652. * Create AbortError instance
  7653. *
  7654. * @param String message Error message for human
  7655. * @return AbortError
  7656. */
  7657. function AbortError(message) {
  7658. Error.call(this, message);
  7659. this.type = 'aborted';
  7660. this.message = message;
  7661. // hide custom error implementation details from end-users
  7662. Error.captureStackTrace(this, this.constructor);
  7663. }
  7664. AbortError.prototype = Object.create(Error.prototype);
  7665. AbortError.prototype.constructor = AbortError;
  7666. AbortError.prototype.name = 'AbortError';
  7667. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7668. const PassThrough$1 = Stream.PassThrough;
  7669. const resolve_url = Url.resolve;
  7670. /**
  7671. * Fetch function
  7672. *
  7673. * @param Mixed url Absolute url or Request instance
  7674. * @param Object opts Fetch options
  7675. * @return Promise
  7676. */
  7677. function fetch(url, opts) {
  7678. // allow custom promise
  7679. if (!fetch.Promise) {
  7680. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7681. }
  7682. Body.Promise = fetch.Promise;
  7683. // wrap http.request into fetch
  7684. return new fetch.Promise(function (resolve, reject) {
  7685. // build request object
  7686. const request = new Request(url, opts);
  7687. const options = getNodeRequestOptions(request);
  7688. const send = (options.protocol === 'https:' ? https : http).request;
  7689. const signal = request.signal;
  7690. let response = null;
  7691. const abort = function abort() {
  7692. let error = new AbortError('The user aborted a request.');
  7693. reject(error);
  7694. if (request.body && request.body instanceof Stream.Readable) {
  7695. request.body.destroy(error);
  7696. }
  7697. if (!response || !response.body) return;
  7698. response.body.emit('error', error);
  7699. };
  7700. if (signal && signal.aborted) {
  7701. abort();
  7702. return;
  7703. }
  7704. const abortAndFinalize = function abortAndFinalize() {
  7705. abort();
  7706. finalize();
  7707. };
  7708. // send request
  7709. const req = send(options);
  7710. let reqTimeout;
  7711. if (signal) {
  7712. signal.addEventListener('abort', abortAndFinalize);
  7713. }
  7714. function finalize() {
  7715. req.abort();
  7716. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7717. clearTimeout(reqTimeout);
  7718. }
  7719. if (request.timeout) {
  7720. req.once('socket', function (socket) {
  7721. reqTimeout = setTimeout(function () {
  7722. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7723. finalize();
  7724. }, request.timeout);
  7725. });
  7726. }
  7727. req.on('error', function (err) {
  7728. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7729. finalize();
  7730. });
  7731. req.on('response', function (res) {
  7732. clearTimeout(reqTimeout);
  7733. const headers = createHeadersLenient(res.headers);
  7734. // HTTP fetch step 5
  7735. if (fetch.isRedirect(res.statusCode)) {
  7736. // HTTP fetch step 5.2
  7737. const location = headers.get('Location');
  7738. // HTTP fetch step 5.3
  7739. const locationURL = location === null ? null : resolve_url(request.url, location);
  7740. // HTTP fetch step 5.5
  7741. switch (request.redirect) {
  7742. case 'error':
  7743. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7744. finalize();
  7745. return;
  7746. case 'manual':
  7747. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7748. if (locationURL !== null) {
  7749. // handle corrupted header
  7750. try {
  7751. headers.set('Location', locationURL);
  7752. } catch (err) {
  7753. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7754. reject(err);
  7755. }
  7756. }
  7757. break;
  7758. case 'follow':
  7759. // HTTP-redirect fetch step 2
  7760. if (locationURL === null) {
  7761. break;
  7762. }
  7763. // HTTP-redirect fetch step 5
  7764. if (request.counter >= request.follow) {
  7765. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7766. finalize();
  7767. return;
  7768. }
  7769. // HTTP-redirect fetch step 6 (counter increment)
  7770. // Create a new Request object.
  7771. const requestOpts = {
  7772. headers: new Headers(request.headers),
  7773. follow: request.follow,
  7774. counter: request.counter + 1,
  7775. agent: request.agent,
  7776. compress: request.compress,
  7777. method: request.method,
  7778. body: request.body,
  7779. signal: request.signal,
  7780. timeout: request.timeout
  7781. };
  7782. // HTTP-redirect fetch step 9
  7783. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7784. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7785. finalize();
  7786. return;
  7787. }
  7788. // HTTP-redirect fetch step 11
  7789. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7790. requestOpts.method = 'GET';
  7791. requestOpts.body = undefined;
  7792. requestOpts.headers.delete('content-length');
  7793. }
  7794. // HTTP-redirect fetch step 15
  7795. resolve(fetch(new Request(locationURL, requestOpts)));
  7796. finalize();
  7797. return;
  7798. }
  7799. }
  7800. // prepare response
  7801. res.once('end', function () {
  7802. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7803. });
  7804. let body = res.pipe(new PassThrough$1());
  7805. const response_options = {
  7806. url: request.url,
  7807. status: res.statusCode,
  7808. statusText: res.statusMessage,
  7809. headers: headers,
  7810. size: request.size,
  7811. timeout: request.timeout,
  7812. counter: request.counter
  7813. };
  7814. // HTTP-network fetch step 12.1.1.3
  7815. const codings = headers.get('Content-Encoding');
  7816. // HTTP-network fetch step 12.1.1.4: handle content codings
  7817. // in following scenarios we ignore compression support
  7818. // 1. compression support is disabled
  7819. // 2. HEAD request
  7820. // 3. no Content-Encoding header
  7821. // 4. no content response (204)
  7822. // 5. content not modified response (304)
  7823. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7824. response = new Response(body, response_options);
  7825. resolve(response);
  7826. return;
  7827. }
  7828. // For Node v6+
  7829. // Be less strict when decoding compressed responses, since sometimes
  7830. // servers send slightly invalid responses that are still accepted
  7831. // by common browsers.
  7832. // Always using Z_SYNC_FLUSH is what cURL does.
  7833. const zlibOptions = {
  7834. flush: zlib.Z_SYNC_FLUSH,
  7835. finishFlush: zlib.Z_SYNC_FLUSH
  7836. };
  7837. // for gzip
  7838. if (codings == 'gzip' || codings == 'x-gzip') {
  7839. body = body.pipe(zlib.createGunzip(zlibOptions));
  7840. response = new Response(body, response_options);
  7841. resolve(response);
  7842. return;
  7843. }
  7844. // for deflate
  7845. if (codings == 'deflate' || codings == 'x-deflate') {
  7846. // handle the infamous raw deflate response from old servers
  7847. // a hack for old IIS and Apache servers
  7848. const raw = res.pipe(new PassThrough$1());
  7849. raw.once('data', function (chunk) {
  7850. // see http://stackoverflow.com/questions/37519828
  7851. if ((chunk[0] & 0x0F) === 0x08) {
  7852. body = body.pipe(zlib.createInflate());
  7853. } else {
  7854. body = body.pipe(zlib.createInflateRaw());
  7855. }
  7856. response = new Response(body, response_options);
  7857. resolve(response);
  7858. });
  7859. return;
  7860. }
  7861. // for br
  7862. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7863. body = body.pipe(zlib.createBrotliDecompress());
  7864. response = new Response(body, response_options);
  7865. resolve(response);
  7866. return;
  7867. }
  7868. // otherwise, use response as-is
  7869. response = new Response(body, response_options);
  7870. resolve(response);
  7871. });
  7872. writeToStream(req, request);
  7873. });
  7874. }
  7875. /**
  7876. * Redirect code matching
  7877. *
  7878. * @param Number code Status code
  7879. * @return Boolean
  7880. */
  7881. fetch.isRedirect = function (code) {
  7882. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7883. };
  7884. // expose Promise
  7885. fetch.Promise = global.Promise;
  7886. module.exports = exports = fetch;
  7887. Object.defineProperty(exports, "__esModule", { value: true });
  7888. exports.default = exports;
  7889. exports.Headers = Headers;
  7890. exports.Request = Request;
  7891. exports.Response = Response;
  7892. exports.FetchError = FetchError;
  7893. /***/ }),
  7894. /***/ 462:
  7895. /***/ (function(module) {
  7896. "use strict";
  7897. // See http://www.robvanderwoude.com/escapechars.php
  7898. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7899. function escapeCommand(arg) {
  7900. // Escape meta chars
  7901. arg = arg.replace(metaCharsRegExp, '^$1');
  7902. return arg;
  7903. }
  7904. function escapeArgument(arg, doubleEscapeMetaChars) {
  7905. // Convert to string
  7906. arg = `${arg}`;
  7907. // Algorithm below is based on https://qntm.org/cmd
  7908. // Sequence of backslashes followed by a double quote:
  7909. // double up all the backslashes and escape the double quote
  7910. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7911. // Sequence of backslashes followed by the end of the string
  7912. // (which will become a double quote later):
  7913. // double up all the backslashes
  7914. arg = arg.replace(/(\\*)$/, '$1$1');
  7915. // All other backslashes occur literally
  7916. // Quote the whole thing:
  7917. arg = `"${arg}"`;
  7918. // Escape meta chars
  7919. arg = arg.replace(metaCharsRegExp, '^$1');
  7920. // Double escape meta chars if necessary
  7921. if (doubleEscapeMetaChars) {
  7922. arg = arg.replace(metaCharsRegExp, '^$1');
  7923. }
  7924. return arg;
  7925. }
  7926. module.exports.command = escapeCommand;
  7927. module.exports.argument = escapeArgument;
  7928. /***/ }),
  7929. /***/ 463:
  7930. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7931. "use strict";
  7932. Object.defineProperty(exports, '__esModule', { value: true });
  7933. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7934. var deprecation = __webpack_require__(692);
  7935. var once = _interopDefault(__webpack_require__(969));
  7936. const logOnce = once(deprecation => console.warn(deprecation));
  7937. /**
  7938. * Error with extra properties to help with debugging
  7939. */
  7940. class RequestError extends Error {
  7941. constructor(message, statusCode, options) {
  7942. super(message); // Maintains proper stack trace (only available on V8)
  7943. /* istanbul ignore next */
  7944. if (Error.captureStackTrace) {
  7945. Error.captureStackTrace(this, this.constructor);
  7946. }
  7947. this.name = "HttpError";
  7948. this.status = statusCode;
  7949. Object.defineProperty(this, "code", {
  7950. get() {
  7951. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7952. return statusCode;
  7953. }
  7954. });
  7955. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7956. const requestCopy = Object.assign({}, options.request);
  7957. if (options.request.headers.authorization) {
  7958. requestCopy.headers = Object.assign({}, options.request.headers, {
  7959. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7960. });
  7961. }
  7962. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7963. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7964. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7965. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7966. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7967. this.request = requestCopy;
  7968. }
  7969. }
  7970. exports.RequestError = RequestError;
  7971. //# sourceMappingURL=index.js.map
  7972. /***/ }),
  7973. /***/ 464:
  7974. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7975. "use strict";
  7976. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7977. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7978. return new (P || (P = Promise))(function (resolve, reject) {
  7979. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7980. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7981. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7982. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7983. });
  7984. };
  7985. var __importStar = (this && this.__importStar) || function (mod) {
  7986. if (mod && mod.__esModule) return mod;
  7987. var result = {};
  7988. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7989. result["default"] = mod;
  7990. return result;
  7991. };
  7992. var __importDefault = (this && this.__importDefault) || function (mod) {
  7993. return (mod && mod.__esModule) ? mod : { "default": mod };
  7994. };
  7995. Object.defineProperty(exports, "__esModule", { value: true });
  7996. const assert = __importStar(__webpack_require__(357));
  7997. const core = __importStar(__webpack_require__(470));
  7998. const fs = __importStar(__webpack_require__(747));
  7999. const github = __importStar(__webpack_require__(469));
  8000. const io = __importStar(__webpack_require__(1));
  8001. const path = __importStar(__webpack_require__(622));
  8002. const retryHelper = __importStar(__webpack_require__(587));
  8003. const toolCache = __importStar(__webpack_require__(533));
  8004. const v4_1 = __importDefault(__webpack_require__(826));
  8005. const IS_WINDOWS = process.platform === 'win32';
  8006. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  8007. return __awaiter(this, void 0, void 0, function* () {
  8008. // Download the archive
  8009. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  8010. core.info('Downloading the archive');
  8011. return yield downloadArchive(authToken, owner, repo, ref, commit);
  8012. }));
  8013. // Write archive to disk
  8014. core.info('Writing archive to disk');
  8015. const uniqueId = v4_1.default();
  8016. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  8017. yield fs.promises.writeFile(archivePath, archiveData);
  8018. archiveData = Buffer.from(''); // Free memory
  8019. // Extract archive
  8020. core.info('Extracting the archive');
  8021. const extractPath = path.join(repositoryPath, uniqueId);
  8022. yield io.mkdirP(extractPath);
  8023. if (IS_WINDOWS) {
  8024. yield toolCache.extractZip(archivePath, extractPath);
  8025. }
  8026. else {
  8027. yield toolCache.extractTar(archivePath, extractPath);
  8028. }
  8029. io.rmRF(archivePath);
  8030. // Determine the path of the repository content. The archive contains
  8031. // a top-level folder and the repository content is inside.
  8032. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8033. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8034. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8035. core.info(`Resolved version ${archiveVersion}`);
  8036. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8037. // Move the files
  8038. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8039. const sourcePath = path.join(tempRepositoryPath, fileName);
  8040. const targetPath = path.join(repositoryPath, fileName);
  8041. if (IS_WINDOWS) {
  8042. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8043. }
  8044. else {
  8045. yield io.mv(sourcePath, targetPath);
  8046. }
  8047. }
  8048. io.rmRF(extractPath);
  8049. });
  8050. }
  8051. exports.downloadRepository = downloadRepository;
  8052. function downloadArchive(authToken, owner, repo, ref, commit) {
  8053. return __awaiter(this, void 0, void 0, function* () {
  8054. const octokit = new github.GitHub(authToken);
  8055. const params = {
  8056. owner: owner,
  8057. repo: repo,
  8058. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8059. ref: commit || ref
  8060. };
  8061. const response = yield octokit.repos.getArchiveLink(params);
  8062. if (response.status != 200) {
  8063. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8064. }
  8065. return Buffer.from(response.data); // response.data is ArrayBuffer
  8066. });
  8067. }
  8068. /***/ }),
  8069. /***/ 469:
  8070. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8071. "use strict";
  8072. var __importDefault = (this && this.__importDefault) || function (mod) {
  8073. return (mod && mod.__esModule) ? mod : { "default": mod };
  8074. };
  8075. var __importStar = (this && this.__importStar) || function (mod) {
  8076. if (mod && mod.__esModule) return mod;
  8077. var result = {};
  8078. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8079. result["default"] = mod;
  8080. return result;
  8081. };
  8082. Object.defineProperty(exports, "__esModule", { value: true });
  8083. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8084. const graphql_1 = __webpack_require__(898);
  8085. const rest_1 = __importDefault(__webpack_require__(0));
  8086. const Context = __importStar(__webpack_require__(262));
  8087. const httpClient = __importStar(__webpack_require__(539));
  8088. // We need this in order to extend Octokit
  8089. rest_1.default.prototype = new rest_1.default();
  8090. exports.context = new Context.Context();
  8091. class GitHub extends rest_1.default {
  8092. constructor(token, opts) {
  8093. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8094. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8095. }
  8096. /**
  8097. * Disambiguates the constructor overload parameters
  8098. */
  8099. static disambiguate(token, opts) {
  8100. return [
  8101. typeof token === 'string' ? token : '',
  8102. typeof token === 'object' ? token : opts || {}
  8103. ];
  8104. }
  8105. static getOctokitOptions(args) {
  8106. const token = args[0];
  8107. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8108. // Auth
  8109. const auth = GitHub.getAuthString(token, options);
  8110. if (auth) {
  8111. options.auth = auth;
  8112. }
  8113. // Proxy
  8114. const agent = GitHub.getProxyAgent(options);
  8115. if (agent) {
  8116. // Shallow clone - don't mutate the object provided by the caller
  8117. options.request = options.request ? Object.assign({}, options.request) : {};
  8118. // Set the agent
  8119. options.request.agent = agent;
  8120. }
  8121. return options;
  8122. }
  8123. static getGraphQL(args) {
  8124. const defaults = {};
  8125. const token = args[0];
  8126. const options = args[1];
  8127. // Authorization
  8128. const auth = this.getAuthString(token, options);
  8129. if (auth) {
  8130. defaults.headers = {
  8131. authorization: auth
  8132. };
  8133. }
  8134. // Proxy
  8135. const agent = GitHub.getProxyAgent(options);
  8136. if (agent) {
  8137. defaults.request = { agent };
  8138. }
  8139. return graphql_1.graphql.defaults(defaults);
  8140. }
  8141. static getAuthString(token, options) {
  8142. // Validate args
  8143. if (!token && !options.auth) {
  8144. throw new Error('Parameter token or opts.auth is required');
  8145. }
  8146. else if (token && options.auth) {
  8147. throw new Error('Parameters token and opts.auth may not both be specified');
  8148. }
  8149. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8150. }
  8151. static getProxyAgent(options) {
  8152. var _a;
  8153. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8154. const serverUrl = 'https://api.github.com';
  8155. if (httpClient.getProxyUrl(serverUrl)) {
  8156. const hc = new httpClient.HttpClient();
  8157. return hc.getAgent(serverUrl);
  8158. }
  8159. }
  8160. return undefined;
  8161. }
  8162. }
  8163. exports.GitHub = GitHub;
  8164. //# sourceMappingURL=github.js.map
  8165. /***/ }),
  8166. /***/ 470:
  8167. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8168. "use strict";
  8169. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8170. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8171. return new (P || (P = Promise))(function (resolve, reject) {
  8172. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8173. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8174. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8175. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8176. });
  8177. };
  8178. Object.defineProperty(exports, "__esModule", { value: true });
  8179. const command_1 = __webpack_require__(431);
  8180. const os = __webpack_require__(87);
  8181. const path = __webpack_require__(622);
  8182. /**
  8183. * The code to exit an action
  8184. */
  8185. var ExitCode;
  8186. (function (ExitCode) {
  8187. /**
  8188. * A code indicating that the action was successful
  8189. */
  8190. ExitCode[ExitCode["Success"] = 0] = "Success";
  8191. /**
  8192. * A code indicating that the action was a failure
  8193. */
  8194. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8195. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8196. //-----------------------------------------------------------------------
  8197. // Variables
  8198. //-----------------------------------------------------------------------
  8199. /**
  8200. * Sets env variable for this action and future actions in the job
  8201. * @param name the name of the variable to set
  8202. * @param val the value of the variable
  8203. */
  8204. function exportVariable(name, val) {
  8205. process.env[name] = val;
  8206. command_1.issueCommand('set-env', { name }, val);
  8207. }
  8208. exports.exportVariable = exportVariable;
  8209. /**
  8210. * Registers a secret which will get masked from logs
  8211. * @param secret value of the secret
  8212. */
  8213. function setSecret(secret) {
  8214. command_1.issueCommand('add-mask', {}, secret);
  8215. }
  8216. exports.setSecret = setSecret;
  8217. /**
  8218. * Prepends inputPath to the PATH (for this action and future actions)
  8219. * @param inputPath
  8220. */
  8221. function addPath(inputPath) {
  8222. command_1.issueCommand('add-path', {}, inputPath);
  8223. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8224. }
  8225. exports.addPath = addPath;
  8226. /**
  8227. * Gets the value of an input. The value is also trimmed.
  8228. *
  8229. * @param name name of the input to get
  8230. * @param options optional. See InputOptions.
  8231. * @returns string
  8232. */
  8233. function getInput(name, options) {
  8234. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8235. if (options && options.required && !val) {
  8236. throw new Error(`Input required and not supplied: ${name}`);
  8237. }
  8238. return val.trim();
  8239. }
  8240. exports.getInput = getInput;
  8241. /**
  8242. * Sets the value of an output.
  8243. *
  8244. * @param name name of the output to set
  8245. * @param value value to store
  8246. */
  8247. function setOutput(name, value) {
  8248. command_1.issueCommand('set-output', { name }, value);
  8249. }
  8250. exports.setOutput = setOutput;
  8251. //-----------------------------------------------------------------------
  8252. // Results
  8253. //-----------------------------------------------------------------------
  8254. /**
  8255. * Sets the action status to failed.
  8256. * When the action exits it will be with an exit code of 1
  8257. * @param message add error issue message
  8258. */
  8259. function setFailed(message) {
  8260. process.exitCode = ExitCode.Failure;
  8261. error(message);
  8262. }
  8263. exports.setFailed = setFailed;
  8264. //-----------------------------------------------------------------------
  8265. // Logging Commands
  8266. //-----------------------------------------------------------------------
  8267. /**
  8268. * Writes debug message to user log
  8269. * @param message debug message
  8270. */
  8271. function debug(message) {
  8272. command_1.issueCommand('debug', {}, message);
  8273. }
  8274. exports.debug = debug;
  8275. /**
  8276. * Adds an error issue
  8277. * @param message error issue message
  8278. */
  8279. function error(message) {
  8280. command_1.issue('error', message);
  8281. }
  8282. exports.error = error;
  8283. /**
  8284. * Adds an warning issue
  8285. * @param message warning issue message
  8286. */
  8287. function warning(message) {
  8288. command_1.issue('warning', message);
  8289. }
  8290. exports.warning = warning;
  8291. /**
  8292. * Writes info to log with console.log.
  8293. * @param message info message
  8294. */
  8295. function info(message) {
  8296. process.stdout.write(message + os.EOL);
  8297. }
  8298. exports.info = info;
  8299. /**
  8300. * Begin an output group.
  8301. *
  8302. * Output until the next `groupEnd` will be foldable in this group
  8303. *
  8304. * @param name The name of the output group
  8305. */
  8306. function startGroup(name) {
  8307. command_1.issue('group', name);
  8308. }
  8309. exports.startGroup = startGroup;
  8310. /**
  8311. * End an output group.
  8312. */
  8313. function endGroup() {
  8314. command_1.issue('endgroup');
  8315. }
  8316. exports.endGroup = endGroup;
  8317. /**
  8318. * Wrap an asynchronous function call in a group.
  8319. *
  8320. * Returns the same type as the function itself.
  8321. *
  8322. * @param name The name of the group
  8323. * @param fn The function to wrap in the group
  8324. */
  8325. function group(name, fn) {
  8326. return __awaiter(this, void 0, void 0, function* () {
  8327. startGroup(name);
  8328. let result;
  8329. try {
  8330. result = yield fn();
  8331. }
  8332. finally {
  8333. endGroup();
  8334. }
  8335. return result;
  8336. });
  8337. }
  8338. exports.group = group;
  8339. //# sourceMappingURL=core.js.map
  8340. /***/ }),
  8341. /***/ 471:
  8342. /***/ (function(module, __unusedexports, __webpack_require__) {
  8343. module.exports = authenticationBeforeRequest;
  8344. const btoa = __webpack_require__(675);
  8345. const uniq = __webpack_require__(126);
  8346. function authenticationBeforeRequest(state, options) {
  8347. if (!state.auth.type) {
  8348. return;
  8349. }
  8350. if (state.auth.type === "basic") {
  8351. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8352. options.headers.authorization = `Basic ${hash}`;
  8353. return;
  8354. }
  8355. if (state.auth.type === "token") {
  8356. options.headers.authorization = `token ${state.auth.token}`;
  8357. return;
  8358. }
  8359. if (state.auth.type === "app") {
  8360. options.headers.authorization = `Bearer ${state.auth.token}`;
  8361. const acceptHeaders = options.headers.accept
  8362. .split(",")
  8363. .concat("application/vnd.github.machine-man-preview+json");
  8364. options.headers.accept = uniq(acceptHeaders)
  8365. .filter(Boolean)
  8366. .join(",");
  8367. return;
  8368. }
  8369. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8370. if (state.auth.token) {
  8371. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8372. return;
  8373. }
  8374. const key = encodeURIComponent(state.auth.key);
  8375. const secret = encodeURIComponent(state.auth.secret);
  8376. options.url += `client_id=${key}&client_secret=${secret}`;
  8377. }
  8378. /***/ }),
  8379. /***/ 489:
  8380. /***/ (function(module, __unusedexports, __webpack_require__) {
  8381. "use strict";
  8382. const path = __webpack_require__(622);
  8383. const which = __webpack_require__(814);
  8384. const pathKey = __webpack_require__(39)();
  8385. function resolveCommandAttempt(parsed, withoutPathExt) {
  8386. const cwd = process.cwd();
  8387. const hasCustomCwd = parsed.options.cwd != null;
  8388. // If a custom `cwd` was specified, we need to change the process cwd
  8389. // because `which` will do stat calls but does not support a custom cwd
  8390. if (hasCustomCwd) {
  8391. try {
  8392. process.chdir(parsed.options.cwd);
  8393. } catch (err) {
  8394. /* Empty */
  8395. }
  8396. }
  8397. let resolved;
  8398. try {
  8399. resolved = which.sync(parsed.command, {
  8400. path: (parsed.options.env || process.env)[pathKey],
  8401. pathExt: withoutPathExt ? path.delimiter : undefined,
  8402. });
  8403. } catch (e) {
  8404. /* Empty */
  8405. } finally {
  8406. process.chdir(cwd);
  8407. }
  8408. // If we successfully resolved, ensure that an absolute path is returned
  8409. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8410. if (resolved) {
  8411. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8412. }
  8413. return resolved;
  8414. }
  8415. function resolveCommand(parsed) {
  8416. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8417. }
  8418. module.exports = resolveCommand;
  8419. /***/ }),
  8420. /***/ 510:
  8421. /***/ (function(module) {
  8422. module.exports = addHook
  8423. function addHook (state, kind, name, hook) {
  8424. var orig = hook
  8425. if (!state.registry[name]) {
  8426. state.registry[name] = []
  8427. }
  8428. if (kind === 'before') {
  8429. hook = function (method, options) {
  8430. return Promise.resolve()
  8431. .then(orig.bind(null, options))
  8432. .then(method.bind(null, options))
  8433. }
  8434. }
  8435. if (kind === 'after') {
  8436. hook = function (method, options) {
  8437. var result
  8438. return Promise.resolve()
  8439. .then(method.bind(null, options))
  8440. .then(function (result_) {
  8441. result = result_
  8442. return orig(result, options)
  8443. })
  8444. .then(function () {
  8445. return result
  8446. })
  8447. }
  8448. }
  8449. if (kind === 'error') {
  8450. hook = function (method, options) {
  8451. return Promise.resolve()
  8452. .then(method.bind(null, options))
  8453. .catch(function (error) {
  8454. return orig(error, options)
  8455. })
  8456. }
  8457. }
  8458. state.registry[name].push({
  8459. hook: hook,
  8460. orig: orig
  8461. })
  8462. }
  8463. /***/ }),
  8464. /***/ 523:
  8465. /***/ (function(module, __unusedexports, __webpack_require__) {
  8466. var register = __webpack_require__(363)
  8467. var addHook = __webpack_require__(510)
  8468. var removeHook = __webpack_require__(763)
  8469. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8470. var bind = Function.bind
  8471. var bindable = bind.bind(bind)
  8472. function bindApi (hook, state, name) {
  8473. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8474. hook.api = { remove: removeHookRef }
  8475. hook.remove = removeHookRef
  8476. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8477. var args = name ? [state, kind, name] : [state, kind]
  8478. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8479. })
  8480. }
  8481. function HookSingular () {
  8482. var singularHookName = 'h'
  8483. var singularHookState = {
  8484. registry: {}
  8485. }
  8486. var singularHook = register.bind(null, singularHookState, singularHookName)
  8487. bindApi(singularHook, singularHookState, singularHookName)
  8488. return singularHook
  8489. }
  8490. function HookCollection () {
  8491. var state = {
  8492. registry: {}
  8493. }
  8494. var hook = register.bind(null, state)
  8495. bindApi(hook, state)
  8496. return hook
  8497. }
  8498. var collectionHookDeprecationMessageDisplayed = false
  8499. function Hook () {
  8500. if (!collectionHookDeprecationMessageDisplayed) {
  8501. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8502. collectionHookDeprecationMessageDisplayed = true
  8503. }
  8504. return HookCollection()
  8505. }
  8506. Hook.Singular = HookSingular.bind()
  8507. Hook.Collection = HookCollection.bind()
  8508. module.exports = Hook
  8509. // expose constructors as a named property for TypeScript
  8510. module.exports.Hook = Hook
  8511. module.exports.Singular = Hook.Singular
  8512. module.exports.Collection = Hook.Collection
  8513. /***/ }),
  8514. /***/ 528:
  8515. /***/ (function(__unusedmodule, exports) {
  8516. "use strict";
  8517. Object.defineProperty(exports, "__esModule", { value: true });
  8518. function escape(value) {
  8519. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8520. return `\\${x}`;
  8521. });
  8522. }
  8523. exports.escape = escape;
  8524. /***/ }),
  8525. /***/ 529:
  8526. /***/ (function(module, __unusedexports, __webpack_require__) {
  8527. const factory = __webpack_require__(47);
  8528. module.exports = factory();
  8529. /***/ }),
  8530. /***/ 533:
  8531. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8532. "use strict";
  8533. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8534. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8535. return new (P || (P = Promise))(function (resolve, reject) {
  8536. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8537. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8538. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8539. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8540. });
  8541. };
  8542. Object.defineProperty(exports, "__esModule", { value: true });
  8543. const core = __webpack_require__(470);
  8544. const io = __webpack_require__(1);
  8545. const fs = __webpack_require__(747);
  8546. const os = __webpack_require__(87);
  8547. const path = __webpack_require__(622);
  8548. const httpm = __webpack_require__(874);
  8549. const semver = __webpack_require__(656);
  8550. const uuidV4 = __webpack_require__(826);
  8551. const exec_1 = __webpack_require__(986);
  8552. const assert_1 = __webpack_require__(357);
  8553. class HTTPError extends Error {
  8554. constructor(httpStatusCode) {
  8555. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8556. this.httpStatusCode = httpStatusCode;
  8557. Object.setPrototypeOf(this, new.target.prototype);
  8558. }
  8559. }
  8560. exports.HTTPError = HTTPError;
  8561. const IS_WINDOWS = process.platform === 'win32';
  8562. const userAgent = 'actions/tool-cache';
  8563. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8564. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8565. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8566. // If directories not found, place them in common temp locations
  8567. if (!tempDirectory || !cacheRoot) {
  8568. let baseLocation;
  8569. if (IS_WINDOWS) {
  8570. // On windows use the USERPROFILE env variable
  8571. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8572. }
  8573. else {
  8574. if (process.platform === 'darwin') {
  8575. baseLocation = '/Users';
  8576. }
  8577. else {
  8578. baseLocation = '/home';
  8579. }
  8580. }
  8581. if (!tempDirectory) {
  8582. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8583. }
  8584. if (!cacheRoot) {
  8585. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8586. }
  8587. }
  8588. /**
  8589. * Download a tool from an url and stream it into a file
  8590. *
  8591. * @param url url of tool to download
  8592. * @returns path to downloaded tool
  8593. */
  8594. function downloadTool(url) {
  8595. return __awaiter(this, void 0, void 0, function* () {
  8596. // Wrap in a promise so that we can resolve from within stream callbacks
  8597. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8598. try {
  8599. const http = new httpm.HttpClient(userAgent, [], {
  8600. allowRetries: true,
  8601. maxRetries: 3
  8602. });
  8603. const destPath = path.join(tempDirectory, uuidV4());
  8604. yield io.mkdirP(tempDirectory);
  8605. core.debug(`Downloading ${url}`);
  8606. core.debug(`Downloading ${destPath}`);
  8607. if (fs.existsSync(destPath)) {
  8608. throw new Error(`Destination file path ${destPath} already exists`);
  8609. }
  8610. const response = yield http.get(url);
  8611. if (response.message.statusCode !== 200) {
  8612. const err = new HTTPError(response.message.statusCode);
  8613. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8614. throw err;
  8615. }
  8616. const file = fs.createWriteStream(destPath);
  8617. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8618. try {
  8619. const stream = response.message.pipe(file);
  8620. stream.on('close', () => {
  8621. core.debug('download complete');
  8622. resolve(destPath);
  8623. });
  8624. }
  8625. catch (err) {
  8626. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8627. reject(err);
  8628. }
  8629. }));
  8630. file.on('error', err => {
  8631. file.end();
  8632. reject(err);
  8633. });
  8634. }
  8635. catch (err) {
  8636. reject(err);
  8637. }
  8638. }));
  8639. });
  8640. }
  8641. exports.downloadTool = downloadTool;
  8642. /**
  8643. * Extract a .7z file
  8644. *
  8645. * @param file path to the .7z file
  8646. * @param dest destination directory. Optional.
  8647. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8648. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8649. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8650. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8651. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8652. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8653. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8654. * to 7zr.exe can be pass to this function.
  8655. * @returns path to the destination directory
  8656. */
  8657. function extract7z(file, dest, _7zPath) {
  8658. return __awaiter(this, void 0, void 0, function* () {
  8659. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8660. assert_1.ok(file, 'parameter "file" is required');
  8661. dest = dest || (yield _createExtractFolder(dest));
  8662. const originalCwd = process.cwd();
  8663. process.chdir(dest);
  8664. if (_7zPath) {
  8665. try {
  8666. const args = [
  8667. 'x',
  8668. '-bb1',
  8669. '-bd',
  8670. '-sccUTF-8',
  8671. file
  8672. ];
  8673. const options = {
  8674. silent: true
  8675. };
  8676. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8677. }
  8678. finally {
  8679. process.chdir(originalCwd);
  8680. }
  8681. }
  8682. else {
  8683. const escapedScript = path
  8684. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8685. .replace(/'/g, "''")
  8686. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8687. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8688. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8689. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8690. const args = [
  8691. '-NoLogo',
  8692. '-Sta',
  8693. '-NoProfile',
  8694. '-NonInteractive',
  8695. '-ExecutionPolicy',
  8696. 'Unrestricted',
  8697. '-Command',
  8698. command
  8699. ];
  8700. const options = {
  8701. silent: true
  8702. };
  8703. try {
  8704. const powershellPath = yield io.which('powershell', true);
  8705. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8706. }
  8707. finally {
  8708. process.chdir(originalCwd);
  8709. }
  8710. }
  8711. return dest;
  8712. });
  8713. }
  8714. exports.extract7z = extract7z;
  8715. /**
  8716. * Extract a tar
  8717. *
  8718. * @param file path to the tar
  8719. * @param dest destination directory. Optional.
  8720. * @param flags flags for the tar. Optional.
  8721. * @returns path to the destination directory
  8722. */
  8723. function extractTar(file, dest, flags = 'xz') {
  8724. return __awaiter(this, void 0, void 0, function* () {
  8725. if (!file) {
  8726. throw new Error("parameter 'file' is required");
  8727. }
  8728. dest = dest || (yield _createExtractFolder(dest));
  8729. const tarPath = yield io.which('tar', true);
  8730. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8731. return dest;
  8732. });
  8733. }
  8734. exports.extractTar = extractTar;
  8735. /**
  8736. * Extract a zip
  8737. *
  8738. * @param file path to the zip
  8739. * @param dest destination directory. Optional.
  8740. * @returns path to the destination directory
  8741. */
  8742. function extractZip(file, dest) {
  8743. return __awaiter(this, void 0, void 0, function* () {
  8744. if (!file) {
  8745. throw new Error("parameter 'file' is required");
  8746. }
  8747. dest = dest || (yield _createExtractFolder(dest));
  8748. if (IS_WINDOWS) {
  8749. yield extractZipWin(file, dest);
  8750. }
  8751. else {
  8752. yield extractZipNix(file, dest);
  8753. }
  8754. return dest;
  8755. });
  8756. }
  8757. exports.extractZip = extractZip;
  8758. function extractZipWin(file, dest) {
  8759. return __awaiter(this, void 0, void 0, function* () {
  8760. // build the powershell command
  8761. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8762. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8763. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8764. // run powershell
  8765. const powershellPath = yield io.which('powershell');
  8766. const args = [
  8767. '-NoLogo',
  8768. '-Sta',
  8769. '-NoProfile',
  8770. '-NonInteractive',
  8771. '-ExecutionPolicy',
  8772. 'Unrestricted',
  8773. '-Command',
  8774. command
  8775. ];
  8776. yield exec_1.exec(`"${powershellPath}"`, args);
  8777. });
  8778. }
  8779. function extractZipNix(file, dest) {
  8780. return __awaiter(this, void 0, void 0, function* () {
  8781. const unzipPath = yield io.which('unzip');
  8782. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8783. });
  8784. }
  8785. /**
  8786. * Caches a directory and installs it into the tool cacheDir
  8787. *
  8788. * @param sourceDir the directory to cache into tools
  8789. * @param tool tool name
  8790. * @param version version of the tool. semver format
  8791. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8792. */
  8793. function cacheDir(sourceDir, tool, version, arch) {
  8794. return __awaiter(this, void 0, void 0, function* () {
  8795. version = semver.clean(version) || version;
  8796. arch = arch || os.arch();
  8797. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8798. core.debug(`source dir: ${sourceDir}`);
  8799. if (!fs.statSync(sourceDir).isDirectory()) {
  8800. throw new Error('sourceDir is not a directory');
  8801. }
  8802. // Create the tool dir
  8803. const destPath = yield _createToolPath(tool, version, arch);
  8804. // copy each child item. do not move. move can fail on Windows
  8805. // due to anti-virus software having an open handle on a file.
  8806. for (const itemName of fs.readdirSync(sourceDir)) {
  8807. const s = path.join(sourceDir, itemName);
  8808. yield io.cp(s, destPath, { recursive: true });
  8809. }
  8810. // write .complete
  8811. _completeToolPath(tool, version, arch);
  8812. return destPath;
  8813. });
  8814. }
  8815. exports.cacheDir = cacheDir;
  8816. /**
  8817. * Caches a downloaded file (GUID) and installs it
  8818. * into the tool cache with a given targetName
  8819. *
  8820. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8821. * @param targetFile the name of the file name in the tools directory
  8822. * @param tool tool name
  8823. * @param version version of the tool. semver format
  8824. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8825. */
  8826. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8827. return __awaiter(this, void 0, void 0, function* () {
  8828. version = semver.clean(version) || version;
  8829. arch = arch || os.arch();
  8830. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8831. core.debug(`source file: ${sourceFile}`);
  8832. if (!fs.statSync(sourceFile).isFile()) {
  8833. throw new Error('sourceFile is not a file');
  8834. }
  8835. // create the tool dir
  8836. const destFolder = yield _createToolPath(tool, version, arch);
  8837. // copy instead of move. move can fail on Windows due to
  8838. // anti-virus software having an open handle on a file.
  8839. const destPath = path.join(destFolder, targetFile);
  8840. core.debug(`destination file ${destPath}`);
  8841. yield io.cp(sourceFile, destPath);
  8842. // write .complete
  8843. _completeToolPath(tool, version, arch);
  8844. return destFolder;
  8845. });
  8846. }
  8847. exports.cacheFile = cacheFile;
  8848. /**
  8849. * Finds the path to a tool version in the local installed tool cache
  8850. *
  8851. * @param toolName name of the tool
  8852. * @param versionSpec version of the tool
  8853. * @param arch optional arch. defaults to arch of computer
  8854. */
  8855. function find(toolName, versionSpec, arch) {
  8856. if (!toolName) {
  8857. throw new Error('toolName parameter is required');
  8858. }
  8859. if (!versionSpec) {
  8860. throw new Error('versionSpec parameter is required');
  8861. }
  8862. arch = arch || os.arch();
  8863. // attempt to resolve an explicit version
  8864. if (!_isExplicitVersion(versionSpec)) {
  8865. const localVersions = findAllVersions(toolName, arch);
  8866. const match = _evaluateVersions(localVersions, versionSpec);
  8867. versionSpec = match;
  8868. }
  8869. // check for the explicit version in the cache
  8870. let toolPath = '';
  8871. if (versionSpec) {
  8872. versionSpec = semver.clean(versionSpec) || '';
  8873. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8874. core.debug(`checking cache: ${cachePath}`);
  8875. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8876. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8877. toolPath = cachePath;
  8878. }
  8879. else {
  8880. core.debug('not found');
  8881. }
  8882. }
  8883. return toolPath;
  8884. }
  8885. exports.find = find;
  8886. /**
  8887. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8888. *
  8889. * @param toolName name of the tool
  8890. * @param arch optional arch. defaults to arch of computer
  8891. */
  8892. function findAllVersions(toolName, arch) {
  8893. const versions = [];
  8894. arch = arch || os.arch();
  8895. const toolPath = path.join(cacheRoot, toolName);
  8896. if (fs.existsSync(toolPath)) {
  8897. const children = fs.readdirSync(toolPath);
  8898. for (const child of children) {
  8899. if (_isExplicitVersion(child)) {
  8900. const fullPath = path.join(toolPath, child, arch || '');
  8901. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8902. versions.push(child);
  8903. }
  8904. }
  8905. }
  8906. }
  8907. return versions;
  8908. }
  8909. exports.findAllVersions = findAllVersions;
  8910. function _createExtractFolder(dest) {
  8911. return __awaiter(this, void 0, void 0, function* () {
  8912. if (!dest) {
  8913. // create a temp dir
  8914. dest = path.join(tempDirectory, uuidV4());
  8915. }
  8916. yield io.mkdirP(dest);
  8917. return dest;
  8918. });
  8919. }
  8920. function _createToolPath(tool, version, arch) {
  8921. return __awaiter(this, void 0, void 0, function* () {
  8922. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8923. core.debug(`destination ${folderPath}`);
  8924. const markerPath = `${folderPath}.complete`;
  8925. yield io.rmRF(folderPath);
  8926. yield io.rmRF(markerPath);
  8927. yield io.mkdirP(folderPath);
  8928. return folderPath;
  8929. });
  8930. }
  8931. function _completeToolPath(tool, version, arch) {
  8932. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8933. const markerPath = `${folderPath}.complete`;
  8934. fs.writeFileSync(markerPath, '');
  8935. core.debug('finished caching tool');
  8936. }
  8937. function _isExplicitVersion(versionSpec) {
  8938. const c = semver.clean(versionSpec) || '';
  8939. core.debug(`isExplicit: ${c}`);
  8940. const valid = semver.valid(c) != null;
  8941. core.debug(`explicit? ${valid}`);
  8942. return valid;
  8943. }
  8944. function _evaluateVersions(versions, versionSpec) {
  8945. let version = '';
  8946. core.debug(`evaluating ${versions.length} versions`);
  8947. versions = versions.sort((a, b) => {
  8948. if (semver.gt(a, b)) {
  8949. return 1;
  8950. }
  8951. return -1;
  8952. });
  8953. for (let i = versions.length - 1; i >= 0; i--) {
  8954. const potential = versions[i];
  8955. const satisfied = semver.satisfies(potential, versionSpec);
  8956. if (satisfied) {
  8957. version = potential;
  8958. break;
  8959. }
  8960. }
  8961. if (version) {
  8962. core.debug(`matched: ${version}`);
  8963. }
  8964. else {
  8965. core.debug('match not found');
  8966. }
  8967. return version;
  8968. }
  8969. //# sourceMappingURL=tool-cache.js.map
  8970. /***/ }),
  8971. /***/ 536:
  8972. /***/ (function(module, __unusedexports, __webpack_require__) {
  8973. module.exports = hasFirstPage
  8974. const deprecate = __webpack_require__(370)
  8975. const getPageLinks = __webpack_require__(577)
  8976. function hasFirstPage (link) {
  8977. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8978. return getPageLinks(link).first
  8979. }
  8980. /***/ }),
  8981. /***/ 539:
  8982. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8983. "use strict";
  8984. Object.defineProperty(exports, "__esModule", { value: true });
  8985. const url = __webpack_require__(835);
  8986. const http = __webpack_require__(605);
  8987. const https = __webpack_require__(211);
  8988. const pm = __webpack_require__(950);
  8989. let tunnel;
  8990. var HttpCodes;
  8991. (function (HttpCodes) {
  8992. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  8993. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  8994. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  8995. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  8996. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  8997. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  8998. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  8999. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  9000. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  9001. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  9002. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  9003. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  9004. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  9005. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  9006. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  9007. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  9008. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  9009. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  9010. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  9011. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  9012. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  9013. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  9014. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  9015. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  9016. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  9017. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9018. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9019. /**
  9020. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9021. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9022. */
  9023. function getProxyUrl(serverUrl) {
  9024. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9025. return proxyUrl ? proxyUrl.href : '';
  9026. }
  9027. exports.getProxyUrl = getProxyUrl;
  9028. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  9029. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  9030. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9031. const ExponentialBackoffCeiling = 10;
  9032. const ExponentialBackoffTimeSlice = 5;
  9033. class HttpClientResponse {
  9034. constructor(message) {
  9035. this.message = message;
  9036. }
  9037. readBody() {
  9038. return new Promise(async (resolve, reject) => {
  9039. let output = Buffer.alloc(0);
  9040. this.message.on('data', (chunk) => {
  9041. output = Buffer.concat([output, chunk]);
  9042. });
  9043. this.message.on('end', () => {
  9044. resolve(output.toString());
  9045. });
  9046. });
  9047. }
  9048. }
  9049. exports.HttpClientResponse = HttpClientResponse;
  9050. function isHttps(requestUrl) {
  9051. let parsedUrl = url.parse(requestUrl);
  9052. return parsedUrl.protocol === 'https:';
  9053. }
  9054. exports.isHttps = isHttps;
  9055. class HttpClient {
  9056. constructor(userAgent, handlers, requestOptions) {
  9057. this._ignoreSslError = false;
  9058. this._allowRedirects = true;
  9059. this._allowRedirectDowngrade = false;
  9060. this._maxRedirects = 50;
  9061. this._allowRetries = false;
  9062. this._maxRetries = 1;
  9063. this._keepAlive = false;
  9064. this._disposed = false;
  9065. this.userAgent = userAgent;
  9066. this.handlers = handlers || [];
  9067. this.requestOptions = requestOptions;
  9068. if (requestOptions) {
  9069. if (requestOptions.ignoreSslError != null) {
  9070. this._ignoreSslError = requestOptions.ignoreSslError;
  9071. }
  9072. this._socketTimeout = requestOptions.socketTimeout;
  9073. if (requestOptions.allowRedirects != null) {
  9074. this._allowRedirects = requestOptions.allowRedirects;
  9075. }
  9076. if (requestOptions.allowRedirectDowngrade != null) {
  9077. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9078. }
  9079. if (requestOptions.maxRedirects != null) {
  9080. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9081. }
  9082. if (requestOptions.keepAlive != null) {
  9083. this._keepAlive = requestOptions.keepAlive;
  9084. }
  9085. if (requestOptions.allowRetries != null) {
  9086. this._allowRetries = requestOptions.allowRetries;
  9087. }
  9088. if (requestOptions.maxRetries != null) {
  9089. this._maxRetries = requestOptions.maxRetries;
  9090. }
  9091. }
  9092. }
  9093. options(requestUrl, additionalHeaders) {
  9094. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9095. }
  9096. get(requestUrl, additionalHeaders) {
  9097. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9098. }
  9099. del(requestUrl, additionalHeaders) {
  9100. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9101. }
  9102. post(requestUrl, data, additionalHeaders) {
  9103. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9104. }
  9105. patch(requestUrl, data, additionalHeaders) {
  9106. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9107. }
  9108. put(requestUrl, data, additionalHeaders) {
  9109. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9110. }
  9111. head(requestUrl, additionalHeaders) {
  9112. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9113. }
  9114. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9115. return this.request(verb, requestUrl, stream, additionalHeaders);
  9116. }
  9117. /**
  9118. * Makes a raw http request.
  9119. * All other methods such as get, post, patch, and request ultimately call this.
  9120. * Prefer get, del, post and patch
  9121. */
  9122. async request(verb, requestUrl, data, headers) {
  9123. if (this._disposed) {
  9124. throw new Error("Client has already been disposed.");
  9125. }
  9126. let parsedUrl = url.parse(requestUrl);
  9127. let info = this._prepareRequest(verb, parsedUrl, headers);
  9128. // Only perform retries on reads since writes may not be idempotent.
  9129. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  9130. let numTries = 0;
  9131. let response;
  9132. while (numTries < maxTries) {
  9133. response = await this.requestRaw(info, data);
  9134. // Check if it's an authentication challenge
  9135. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  9136. let authenticationHandler;
  9137. for (let i = 0; i < this.handlers.length; i++) {
  9138. if (this.handlers[i].canHandleAuthentication(response)) {
  9139. authenticationHandler = this.handlers[i];
  9140. break;
  9141. }
  9142. }
  9143. if (authenticationHandler) {
  9144. return authenticationHandler.handleAuthentication(this, info, data);
  9145. }
  9146. else {
  9147. // We have received an unauthorized response but have no handlers to handle it.
  9148. // Let the response return to the caller.
  9149. return response;
  9150. }
  9151. }
  9152. let redirectsRemaining = this._maxRedirects;
  9153. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  9154. && this._allowRedirects
  9155. && redirectsRemaining > 0) {
  9156. const redirectUrl = response.message.headers["location"];
  9157. if (!redirectUrl) {
  9158. // if there's no location to redirect to, we won't
  9159. break;
  9160. }
  9161. let parsedRedirectUrl = url.parse(redirectUrl);
  9162. if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
  9163. 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.");
  9164. }
  9165. // we need to finish reading the response before reassigning response
  9166. // which will leak the open socket.
  9167. await response.readBody();
  9168. // let's make the request with the new redirectUrl
  9169. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9170. response = await this.requestRaw(info, data);
  9171. redirectsRemaining--;
  9172. }
  9173. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9174. // If not a retry code, return immediately instead of retrying
  9175. return response;
  9176. }
  9177. numTries += 1;
  9178. if (numTries < maxTries) {
  9179. await response.readBody();
  9180. await this._performExponentialBackoff(numTries);
  9181. }
  9182. }
  9183. return response;
  9184. }
  9185. /**
  9186. * Needs to be called if keepAlive is set to true in request options.
  9187. */
  9188. dispose() {
  9189. if (this._agent) {
  9190. this._agent.destroy();
  9191. }
  9192. this._disposed = true;
  9193. }
  9194. /**
  9195. * Raw request.
  9196. * @param info
  9197. * @param data
  9198. */
  9199. requestRaw(info, data) {
  9200. return new Promise((resolve, reject) => {
  9201. let callbackForResult = function (err, res) {
  9202. if (err) {
  9203. reject(err);
  9204. }
  9205. resolve(res);
  9206. };
  9207. this.requestRawWithCallback(info, data, callbackForResult);
  9208. });
  9209. }
  9210. /**
  9211. * Raw request with callback.
  9212. * @param info
  9213. * @param data
  9214. * @param onResult
  9215. */
  9216. requestRawWithCallback(info, data, onResult) {
  9217. let socket;
  9218. if (typeof (data) === 'string') {
  9219. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  9220. }
  9221. let callbackCalled = false;
  9222. let handleResult = (err, res) => {
  9223. if (!callbackCalled) {
  9224. callbackCalled = true;
  9225. onResult(err, res);
  9226. }
  9227. };
  9228. let req = info.httpModule.request(info.options, (msg) => {
  9229. let res = new HttpClientResponse(msg);
  9230. handleResult(null, res);
  9231. });
  9232. req.on('socket', (sock) => {
  9233. socket = sock;
  9234. });
  9235. // If we ever get disconnected, we want the socket to timeout eventually
  9236. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9237. if (socket) {
  9238. socket.end();
  9239. }
  9240. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9241. });
  9242. req.on('error', function (err) {
  9243. // err has statusCode property
  9244. // res should have headers
  9245. handleResult(err, null);
  9246. });
  9247. if (data && typeof (data) === 'string') {
  9248. req.write(data, 'utf8');
  9249. }
  9250. if (data && typeof (data) !== 'string') {
  9251. data.on('close', function () {
  9252. req.end();
  9253. });
  9254. data.pipe(req);
  9255. }
  9256. else {
  9257. req.end();
  9258. }
  9259. }
  9260. /**
  9261. * Gets an http agent. This function is useful when you need an http agent that handles
  9262. * routing through a proxy server - depending upon the url and proxy environment variables.
  9263. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9264. */
  9265. getAgent(serverUrl) {
  9266. let parsedUrl = url.parse(serverUrl);
  9267. return this._getAgent(parsedUrl);
  9268. }
  9269. _prepareRequest(method, requestUrl, headers) {
  9270. const info = {};
  9271. info.parsedUrl = requestUrl;
  9272. const usingSsl = info.parsedUrl.protocol === 'https:';
  9273. info.httpModule = usingSsl ? https : http;
  9274. const defaultPort = usingSsl ? 443 : 80;
  9275. info.options = {};
  9276. info.options.host = info.parsedUrl.hostname;
  9277. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  9278. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9279. info.options.method = method;
  9280. info.options.headers = this._mergeHeaders(headers);
  9281. if (this.userAgent != null) {
  9282. info.options.headers["user-agent"] = this.userAgent;
  9283. }
  9284. info.options.agent = this._getAgent(info.parsedUrl);
  9285. // gives handlers an opportunity to participate
  9286. if (this.handlers) {
  9287. this.handlers.forEach((handler) => {
  9288. handler.prepareRequest(info.options);
  9289. });
  9290. }
  9291. return info;
  9292. }
  9293. _mergeHeaders(headers) {
  9294. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  9295. if (this.requestOptions && this.requestOptions.headers) {
  9296. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9297. }
  9298. return lowercaseKeys(headers || {});
  9299. }
  9300. _getAgent(parsedUrl) {
  9301. let agent;
  9302. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9303. let useProxy = proxyUrl && proxyUrl.hostname;
  9304. if (this._keepAlive && useProxy) {
  9305. agent = this._proxyAgent;
  9306. }
  9307. if (this._keepAlive && !useProxy) {
  9308. agent = this._agent;
  9309. }
  9310. // if agent is already assigned use that agent.
  9311. if (!!agent) {
  9312. return agent;
  9313. }
  9314. const usingSsl = parsedUrl.protocol === 'https:';
  9315. let maxSockets = 100;
  9316. if (!!this.requestOptions) {
  9317. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9318. }
  9319. if (useProxy) {
  9320. // If using proxy, need tunnel
  9321. if (!tunnel) {
  9322. tunnel = __webpack_require__(335);
  9323. }
  9324. const agentOptions = {
  9325. maxSockets: maxSockets,
  9326. keepAlive: this._keepAlive,
  9327. proxy: {
  9328. proxyAuth: proxyUrl.auth,
  9329. host: proxyUrl.hostname,
  9330. port: proxyUrl.port
  9331. },
  9332. };
  9333. let tunnelAgent;
  9334. const overHttps = proxyUrl.protocol === 'https:';
  9335. if (usingSsl) {
  9336. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9337. }
  9338. else {
  9339. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9340. }
  9341. agent = tunnelAgent(agentOptions);
  9342. this._proxyAgent = agent;
  9343. }
  9344. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9345. if (this._keepAlive && !agent) {
  9346. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9347. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9348. this._agent = agent;
  9349. }
  9350. // if not using private agent and tunnel agent isn't setup then use global agent
  9351. if (!agent) {
  9352. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9353. }
  9354. if (usingSsl && this._ignoreSslError) {
  9355. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9356. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9357. // we have to cast it to any and change it directly
  9358. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  9359. }
  9360. return agent;
  9361. }
  9362. _performExponentialBackoff(retryNumber) {
  9363. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9364. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9365. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9366. }
  9367. }
  9368. exports.HttpClient = HttpClient;
  9369. /***/ }),
  9370. /***/ 550:
  9371. /***/ (function(module, __unusedexports, __webpack_require__) {
  9372. module.exports = getNextPage
  9373. const getPage = __webpack_require__(265)
  9374. function getNextPage (octokit, link, headers) {
  9375. return getPage(octokit, link, 'next', headers)
  9376. }
  9377. /***/ }),
  9378. /***/ 558:
  9379. /***/ (function(module, __unusedexports, __webpack_require__) {
  9380. module.exports = hasPreviousPage
  9381. const deprecate = __webpack_require__(370)
  9382. const getPageLinks = __webpack_require__(577)
  9383. function hasPreviousPage (link) {
  9384. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9385. return getPageLinks(link).prev
  9386. }
  9387. /***/ }),
  9388. /***/ 559:
  9389. /***/ (function(__unusedmodule, exports) {
  9390. "use strict";
  9391. Object.defineProperty(exports, "__esModule", { value: true });
  9392. class GitVersion {
  9393. /**
  9394. * Used for comparing the version of git and git-lfs against the minimum required version
  9395. * @param version the version string, e.g. 1.2 or 1.2.3
  9396. */
  9397. constructor(version) {
  9398. this.major = NaN;
  9399. this.minor = NaN;
  9400. this.patch = NaN;
  9401. if (version) {
  9402. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9403. if (match) {
  9404. this.major = Number(match[1]);
  9405. this.minor = Number(match[2]);
  9406. if (match[4]) {
  9407. this.patch = Number(match[4]);
  9408. }
  9409. }
  9410. }
  9411. }
  9412. /**
  9413. * Compares the instance against a minimum required version
  9414. * @param minimum Minimum version
  9415. */
  9416. checkMinimum(minimum) {
  9417. if (!minimum.isValid()) {
  9418. throw new Error('Arg minimum is not a valid version');
  9419. }
  9420. // Major is insufficient
  9421. if (this.major < minimum.major) {
  9422. return false;
  9423. }
  9424. // Major is equal
  9425. if (this.major === minimum.major) {
  9426. // Minor is insufficient
  9427. if (this.minor < minimum.minor) {
  9428. return false;
  9429. }
  9430. // Minor is equal
  9431. if (this.minor === minimum.minor) {
  9432. // Patch is insufficient
  9433. if (this.patch && this.patch < (minimum.patch || 0)) {
  9434. return false;
  9435. }
  9436. }
  9437. }
  9438. return true;
  9439. }
  9440. /**
  9441. * Indicates whether the instance was constructed from a valid version string
  9442. */
  9443. isValid() {
  9444. return !isNaN(this.major);
  9445. }
  9446. /**
  9447. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9448. */
  9449. toString() {
  9450. let result = '';
  9451. if (this.isValid()) {
  9452. result = `${this.major}.${this.minor}`;
  9453. if (!isNaN(this.patch)) {
  9454. result += `.${this.patch}`;
  9455. }
  9456. }
  9457. return result;
  9458. }
  9459. }
  9460. exports.GitVersion = GitVersion;
  9461. /***/ }),
  9462. /***/ 562:
  9463. /***/ (function(module, __unusedexports, __webpack_require__) {
  9464. var once = __webpack_require__(969);
  9465. var noop = function() {};
  9466. var isRequest = function(stream) {
  9467. return stream.setHeader && typeof stream.abort === 'function';
  9468. };
  9469. var isChildProcess = function(stream) {
  9470. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9471. };
  9472. var eos = function(stream, opts, callback) {
  9473. if (typeof opts === 'function') return eos(stream, null, opts);
  9474. if (!opts) opts = {};
  9475. callback = once(callback || noop);
  9476. var ws = stream._writableState;
  9477. var rs = stream._readableState;
  9478. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9479. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9480. var cancelled = false;
  9481. var onlegacyfinish = function() {
  9482. if (!stream.writable) onfinish();
  9483. };
  9484. var onfinish = function() {
  9485. writable = false;
  9486. if (!readable) callback.call(stream);
  9487. };
  9488. var onend = function() {
  9489. readable = false;
  9490. if (!writable) callback.call(stream);
  9491. };
  9492. var onexit = function(exitCode) {
  9493. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9494. };
  9495. var onerror = function(err) {
  9496. callback.call(stream, err);
  9497. };
  9498. var onclose = function() {
  9499. process.nextTick(onclosenexttick);
  9500. };
  9501. var onclosenexttick = function() {
  9502. if (cancelled) return;
  9503. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9504. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9505. };
  9506. var onrequest = function() {
  9507. stream.req.on('finish', onfinish);
  9508. };
  9509. if (isRequest(stream)) {
  9510. stream.on('complete', onfinish);
  9511. stream.on('abort', onclose);
  9512. if (stream.req) onrequest();
  9513. else stream.on('request', onrequest);
  9514. } else if (writable && !ws) { // legacy streams
  9515. stream.on('end', onlegacyfinish);
  9516. stream.on('close', onlegacyfinish);
  9517. }
  9518. if (isChildProcess(stream)) stream.on('exit', onexit);
  9519. stream.on('end', onend);
  9520. stream.on('finish', onfinish);
  9521. if (opts.error !== false) stream.on('error', onerror);
  9522. stream.on('close', onclose);
  9523. return function() {
  9524. cancelled = true;
  9525. stream.removeListener('complete', onfinish);
  9526. stream.removeListener('abort', onclose);
  9527. stream.removeListener('request', onrequest);
  9528. if (stream.req) stream.req.removeListener('finish', onfinish);
  9529. stream.removeListener('end', onlegacyfinish);
  9530. stream.removeListener('close', onlegacyfinish);
  9531. stream.removeListener('finish', onfinish);
  9532. stream.removeListener('exit', onexit);
  9533. stream.removeListener('end', onend);
  9534. stream.removeListener('error', onerror);
  9535. stream.removeListener('close', onclose);
  9536. };
  9537. };
  9538. module.exports = eos;
  9539. /***/ }),
  9540. /***/ 563:
  9541. /***/ (function(module, __unusedexports, __webpack_require__) {
  9542. module.exports = getPreviousPage
  9543. const getPage = __webpack_require__(265)
  9544. function getPreviousPage (octokit, link, headers) {
  9545. return getPage(octokit, link, 'prev', headers)
  9546. }
  9547. /***/ }),
  9548. /***/ 568:
  9549. /***/ (function(module, __unusedexports, __webpack_require__) {
  9550. "use strict";
  9551. const path = __webpack_require__(622);
  9552. const niceTry = __webpack_require__(948);
  9553. const resolveCommand = __webpack_require__(489);
  9554. const escape = __webpack_require__(462);
  9555. const readShebang = __webpack_require__(389);
  9556. const semver = __webpack_require__(280);
  9557. const isWin = process.platform === 'win32';
  9558. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9559. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9560. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9561. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9562. function detectShebang(parsed) {
  9563. parsed.file = resolveCommand(parsed);
  9564. const shebang = parsed.file && readShebang(parsed.file);
  9565. if (shebang) {
  9566. parsed.args.unshift(parsed.file);
  9567. parsed.command = shebang;
  9568. return resolveCommand(parsed);
  9569. }
  9570. return parsed.file;
  9571. }
  9572. function parseNonShell(parsed) {
  9573. if (!isWin) {
  9574. return parsed;
  9575. }
  9576. // Detect & add support for shebangs
  9577. const commandFile = detectShebang(parsed);
  9578. // We don't need a shell if the command filename is an executable
  9579. const needsShell = !isExecutableRegExp.test(commandFile);
  9580. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9581. // Note that `forceShell` is an hidden option used only in tests
  9582. if (parsed.options.forceShell || needsShell) {
  9583. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9584. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9585. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9586. // we need to double escape them
  9587. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9588. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9589. // This is necessary otherwise it will always fail with ENOENT in those cases
  9590. parsed.command = path.normalize(parsed.command);
  9591. // Escape command & arguments
  9592. parsed.command = escape.command(parsed.command);
  9593. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9594. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9595. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9596. parsed.command = process.env.comspec || 'cmd.exe';
  9597. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9598. }
  9599. return parsed;
  9600. }
  9601. function parseShell(parsed) {
  9602. // If node supports the shell option, there's no need to mimic its behavior
  9603. if (supportsShellOption) {
  9604. return parsed;
  9605. }
  9606. // Mimic node shell option
  9607. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9608. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9609. if (isWin) {
  9610. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9611. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9612. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9613. } else {
  9614. if (typeof parsed.options.shell === 'string') {
  9615. parsed.command = parsed.options.shell;
  9616. } else if (process.platform === 'android') {
  9617. parsed.command = '/system/bin/sh';
  9618. } else {
  9619. parsed.command = '/bin/sh';
  9620. }
  9621. parsed.args = ['-c', shellCommand];
  9622. }
  9623. return parsed;
  9624. }
  9625. function parse(command, args, options) {
  9626. // Normalize arguments, similar to nodejs
  9627. if (args && !Array.isArray(args)) {
  9628. options = args;
  9629. args = null;
  9630. }
  9631. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9632. options = Object.assign({}, options); // Clone object to avoid changing the original
  9633. // Build our parsed object
  9634. const parsed = {
  9635. command,
  9636. args,
  9637. options,
  9638. file: undefined,
  9639. original: {
  9640. command,
  9641. args,
  9642. },
  9643. };
  9644. // Delegate further parsing to shell or non-shell
  9645. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9646. }
  9647. module.exports = parse;
  9648. /***/ }),
  9649. /***/ 577:
  9650. /***/ (function(module) {
  9651. module.exports = getPageLinks
  9652. function getPageLinks (link) {
  9653. link = link.link || link.headers.link || ''
  9654. const links = {}
  9655. // link format:
  9656. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9657. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9658. links[type] = uri
  9659. })
  9660. return links
  9661. }
  9662. /***/ }),
  9663. /***/ 586:
  9664. /***/ (function(module, __unusedexports, __webpack_require__) {
  9665. module.exports = octokitRestApiEndpoints;
  9666. const ROUTES = __webpack_require__(705);
  9667. function octokitRestApiEndpoints(octokit) {
  9668. // Aliasing scopes for backward compatibility
  9669. // See https://github.com/octokit/rest.js/pull/1134
  9670. ROUTES.gitdata = ROUTES.git;
  9671. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9672. ROUTES.pullRequests = ROUTES.pulls;
  9673. octokit.registerEndpoints(ROUTES);
  9674. }
  9675. /***/ }),
  9676. /***/ 587:
  9677. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9678. "use strict";
  9679. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9680. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9681. return new (P || (P = Promise))(function (resolve, reject) {
  9682. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9683. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9684. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9685. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9686. });
  9687. };
  9688. var __importStar = (this && this.__importStar) || function (mod) {
  9689. if (mod && mod.__esModule) return mod;
  9690. var result = {};
  9691. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9692. result["default"] = mod;
  9693. return result;
  9694. };
  9695. Object.defineProperty(exports, "__esModule", { value: true });
  9696. const core = __importStar(__webpack_require__(470));
  9697. const defaultMaxAttempts = 3;
  9698. const defaultMinSeconds = 10;
  9699. const defaultMaxSeconds = 20;
  9700. class RetryHelper {
  9701. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9702. this.maxAttempts = maxAttempts;
  9703. this.minSeconds = Math.floor(minSeconds);
  9704. this.maxSeconds = Math.floor(maxSeconds);
  9705. if (this.minSeconds > this.maxSeconds) {
  9706. throw new Error('min seconds should be less than or equal to max seconds');
  9707. }
  9708. }
  9709. execute(action) {
  9710. return __awaiter(this, void 0, void 0, function* () {
  9711. let attempt = 1;
  9712. while (attempt < this.maxAttempts) {
  9713. // Try
  9714. try {
  9715. return yield action();
  9716. }
  9717. catch (err) {
  9718. core.info(err.message);
  9719. }
  9720. // Sleep
  9721. const seconds = this.getSleepAmount();
  9722. core.info(`Waiting ${seconds} seconds before trying again`);
  9723. yield this.sleep(seconds);
  9724. attempt++;
  9725. }
  9726. // Last attempt
  9727. return yield action();
  9728. });
  9729. }
  9730. getSleepAmount() {
  9731. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9732. this.minSeconds);
  9733. }
  9734. sleep(seconds) {
  9735. return __awaiter(this, void 0, void 0, function* () {
  9736. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9737. });
  9738. }
  9739. }
  9740. exports.RetryHelper = RetryHelper;
  9741. function execute(action) {
  9742. return __awaiter(this, void 0, void 0, function* () {
  9743. const retryHelper = new RetryHelper();
  9744. return yield retryHelper.execute(action);
  9745. });
  9746. }
  9747. exports.execute = execute;
  9748. /***/ }),
  9749. /***/ 605:
  9750. /***/ (function(module) {
  9751. module.exports = require("http");
  9752. /***/ }),
  9753. /***/ 614:
  9754. /***/ (function(module) {
  9755. module.exports = require("events");
  9756. /***/ }),
  9757. /***/ 618:
  9758. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9759. "use strict";
  9760. var __importStar = (this && this.__importStar) || function (mod) {
  9761. if (mod && mod.__esModule) return mod;
  9762. var result = {};
  9763. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9764. result["default"] = mod;
  9765. return result;
  9766. };
  9767. Object.defineProperty(exports, "__esModule", { value: true });
  9768. const fs = __importStar(__webpack_require__(747));
  9769. function directoryExistsSync(path, required) {
  9770. if (!path) {
  9771. throw new Error("Arg 'path' must not be empty");
  9772. }
  9773. let stats;
  9774. try {
  9775. stats = fs.statSync(path);
  9776. }
  9777. catch (error) {
  9778. if (error.code === 'ENOENT') {
  9779. if (!required) {
  9780. return false;
  9781. }
  9782. throw new Error(`Directory '${path}' does not exist`);
  9783. }
  9784. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9785. }
  9786. if (stats.isDirectory()) {
  9787. return true;
  9788. }
  9789. else if (!required) {
  9790. return false;
  9791. }
  9792. throw new Error(`Directory '${path}' does not exist`);
  9793. }
  9794. exports.directoryExistsSync = directoryExistsSync;
  9795. function existsSync(path) {
  9796. if (!path) {
  9797. throw new Error("Arg 'path' must not be empty");
  9798. }
  9799. try {
  9800. fs.statSync(path);
  9801. }
  9802. catch (error) {
  9803. if (error.code === 'ENOENT') {
  9804. return false;
  9805. }
  9806. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9807. }
  9808. return true;
  9809. }
  9810. exports.existsSync = existsSync;
  9811. function fileExistsSync(path) {
  9812. if (!path) {
  9813. throw new Error("Arg 'path' must not be empty");
  9814. }
  9815. let stats;
  9816. try {
  9817. stats = fs.statSync(path);
  9818. }
  9819. catch (error) {
  9820. if (error.code === 'ENOENT') {
  9821. return false;
  9822. }
  9823. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9824. }
  9825. if (!stats.isDirectory()) {
  9826. return true;
  9827. }
  9828. return false;
  9829. }
  9830. exports.fileExistsSync = fileExistsSync;
  9831. /***/ }),
  9832. /***/ 621:
  9833. /***/ (function(module, __unusedexports, __webpack_require__) {
  9834. "use strict";
  9835. const path = __webpack_require__(622);
  9836. const pathKey = __webpack_require__(39);
  9837. module.exports = opts => {
  9838. opts = Object.assign({
  9839. cwd: process.cwd(),
  9840. path: process.env[pathKey()]
  9841. }, opts);
  9842. let prev;
  9843. let pth = path.resolve(opts.cwd);
  9844. const ret = [];
  9845. while (prev !== pth) {
  9846. ret.push(path.join(pth, 'node_modules/.bin'));
  9847. prev = pth;
  9848. pth = path.resolve(pth, '..');
  9849. }
  9850. // ensure the running `node` binary is used
  9851. ret.push(path.dirname(process.execPath));
  9852. return ret.concat(opts.path).join(path.delimiter);
  9853. };
  9854. module.exports.env = opts => {
  9855. opts = Object.assign({
  9856. env: process.env
  9857. }, opts);
  9858. const env = Object.assign({}, opts.env);
  9859. const path = pathKey({env});
  9860. opts.path = env[path];
  9861. env[path] = module.exports(opts);
  9862. return env;
  9863. };
  9864. /***/ }),
  9865. /***/ 622:
  9866. /***/ (function(module) {
  9867. module.exports = require("path");
  9868. /***/ }),
  9869. /***/ 631:
  9870. /***/ (function(module) {
  9871. module.exports = require("net");
  9872. /***/ }),
  9873. /***/ 649:
  9874. /***/ (function(module, __unusedexports, __webpack_require__) {
  9875. module.exports = getLastPage
  9876. const getPage = __webpack_require__(265)
  9877. function getLastPage (octokit, link, headers) {
  9878. return getPage(octokit, link, 'last', headers)
  9879. }
  9880. /***/ }),
  9881. /***/ 654:
  9882. /***/ (function(module) {
  9883. // This is not the set of all possible signals.
  9884. //
  9885. // It IS, however, the set of all signals that trigger
  9886. // an exit on either Linux or BSD systems. Linux is a
  9887. // superset of the signal names supported on BSD, and
  9888. // the unknown signals just fail to register, so we can
  9889. // catch that easily enough.
  9890. //
  9891. // Don't bother with SIGKILL. It's uncatchable, which
  9892. // means that we can't fire any callbacks anyway.
  9893. //
  9894. // If a user does happen to register a handler on a non-
  9895. // fatal signal like SIGWINCH or something, and then
  9896. // exit, it'll end up firing `process.emit('exit')`, so
  9897. // the handler will be fired anyway.
  9898. //
  9899. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9900. // artificially, inherently leave the process in a
  9901. // state from which it is not safe to try and enter JS
  9902. // listeners.
  9903. module.exports = [
  9904. 'SIGABRT',
  9905. 'SIGALRM',
  9906. 'SIGHUP',
  9907. 'SIGINT',
  9908. 'SIGTERM'
  9909. ]
  9910. if (process.platform !== 'win32') {
  9911. module.exports.push(
  9912. 'SIGVTALRM',
  9913. 'SIGXCPU',
  9914. 'SIGXFSZ',
  9915. 'SIGUSR2',
  9916. 'SIGTRAP',
  9917. 'SIGSYS',
  9918. 'SIGQUIT',
  9919. 'SIGIOT'
  9920. // should detect profiler and enable/disable accordingly.
  9921. // see #21
  9922. // 'SIGPROF'
  9923. )
  9924. }
  9925. if (process.platform === 'linux') {
  9926. module.exports.push(
  9927. 'SIGIO',
  9928. 'SIGPOLL',
  9929. 'SIGPWR',
  9930. 'SIGSTKFLT',
  9931. 'SIGUNUSED'
  9932. )
  9933. }
  9934. /***/ }),
  9935. /***/ 656:
  9936. /***/ (function(module, exports) {
  9937. exports = module.exports = SemVer
  9938. var debug
  9939. /* istanbul ignore next */
  9940. if (typeof process === 'object' &&
  9941. process.env &&
  9942. process.env.NODE_DEBUG &&
  9943. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9944. debug = function () {
  9945. var args = Array.prototype.slice.call(arguments, 0)
  9946. args.unshift('SEMVER')
  9947. console.log.apply(console, args)
  9948. }
  9949. } else {
  9950. debug = function () {}
  9951. }
  9952. // Note: this is the semver.org version of the spec that it implements
  9953. // Not necessarily the package version of this code.
  9954. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9955. var MAX_LENGTH = 256
  9956. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9957. /* istanbul ignore next */ 9007199254740991
  9958. // Max safe segment length for coercion.
  9959. var MAX_SAFE_COMPONENT_LENGTH = 16
  9960. // The actual regexps go on exports.re
  9961. var re = exports.re = []
  9962. var src = exports.src = []
  9963. var t = exports.tokens = {}
  9964. var R = 0
  9965. function tok (n) {
  9966. t[n] = R++
  9967. }
  9968. // The following Regular Expressions can be used for tokenizing,
  9969. // validating, and parsing SemVer version strings.
  9970. // ## Numeric Identifier
  9971. // A single `0`, or a non-zero digit followed by zero or more digits.
  9972. tok('NUMERICIDENTIFIER')
  9973. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9974. tok('NUMERICIDENTIFIERLOOSE')
  9975. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9976. // ## Non-numeric Identifier
  9977. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9978. // more letters, digits, or hyphens.
  9979. tok('NONNUMERICIDENTIFIER')
  9980. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9981. // ## Main Version
  9982. // Three dot-separated numeric identifiers.
  9983. tok('MAINVERSION')
  9984. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9985. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9986. '(' + src[t.NUMERICIDENTIFIER] + ')'
  9987. tok('MAINVERSIONLOOSE')
  9988. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9989. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9990. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  9991. // ## Pre-release Version Identifier
  9992. // A numeric identifier, or a non-numeric identifier.
  9993. tok('PRERELEASEIDENTIFIER')
  9994. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  9995. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9996. tok('PRERELEASEIDENTIFIERLOOSE')
  9997. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  9998. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9999. // ## Pre-release Version
  10000. // Hyphen, followed by one or more dot-separated pre-release version
  10001. // identifiers.
  10002. tok('PRERELEASE')
  10003. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  10004. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  10005. tok('PRERELEASELOOSE')
  10006. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  10007. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  10008. // ## Build Metadata Identifier
  10009. // Any combination of digits, letters, or hyphens.
  10010. tok('BUILDIDENTIFIER')
  10011. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  10012. // ## Build Metadata
  10013. // Plus sign, followed by one or more period-separated build metadata
  10014. // identifiers.
  10015. tok('BUILD')
  10016. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  10017. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10018. // ## Full Version String
  10019. // A main version, followed optionally by a pre-release version and
  10020. // build metadata.
  10021. // Note that the only major, minor, patch, and pre-release sections of
  10022. // the version string are capturing groups. The build metadata is not a
  10023. // capturing group, because it should not ever be used in version
  10024. // comparison.
  10025. tok('FULL')
  10026. tok('FULLPLAIN')
  10027. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10028. src[t.PRERELEASE] + '?' +
  10029. src[t.BUILD] + '?'
  10030. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10031. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10032. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10033. // common in the npm registry.
  10034. tok('LOOSEPLAIN')
  10035. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10036. src[t.PRERELEASELOOSE] + '?' +
  10037. src[t.BUILD] + '?'
  10038. tok('LOOSE')
  10039. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10040. tok('GTLT')
  10041. src[t.GTLT] = '((?:<|>)?=?)'
  10042. // Something like "2.*" or "1.2.x".
  10043. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10044. // Only the first item is strictly required.
  10045. tok('XRANGEIDENTIFIERLOOSE')
  10046. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10047. tok('XRANGEIDENTIFIER')
  10048. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10049. tok('XRANGEPLAIN')
  10050. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10051. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10052. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10053. '(?:' + src[t.PRERELEASE] + ')?' +
  10054. src[t.BUILD] + '?' +
  10055. ')?)?'
  10056. tok('XRANGEPLAINLOOSE')
  10057. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10058. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10059. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10060. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10061. src[t.BUILD] + '?' +
  10062. ')?)?'
  10063. tok('XRANGE')
  10064. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10065. tok('XRANGELOOSE')
  10066. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10067. // Coercion.
  10068. // Extract anything that could conceivably be a part of a valid semver
  10069. tok('COERCE')
  10070. src[t.COERCE] = '(^|[^\\d])' +
  10071. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10072. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10073. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10074. '(?:$|[^\\d])'
  10075. tok('COERCERTL')
  10076. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10077. // Tilde ranges.
  10078. // Meaning is "reasonably at or greater than"
  10079. tok('LONETILDE')
  10080. src[t.LONETILDE] = '(?:~>?)'
  10081. tok('TILDETRIM')
  10082. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10083. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10084. var tildeTrimReplace = '$1~'
  10085. tok('TILDE')
  10086. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10087. tok('TILDELOOSE')
  10088. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10089. // Caret ranges.
  10090. // Meaning is "at least and backwards compatible with"
  10091. tok('LONECARET')
  10092. src[t.LONECARET] = '(?:\\^)'
  10093. tok('CARETTRIM')
  10094. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10095. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10096. var caretTrimReplace = '$1^'
  10097. tok('CARET')
  10098. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10099. tok('CARETLOOSE')
  10100. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10101. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10102. tok('COMPARATORLOOSE')
  10103. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10104. tok('COMPARATOR')
  10105. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10106. // An expression to strip any whitespace between the gtlt and the thing
  10107. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10108. tok('COMPARATORTRIM')
  10109. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10110. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10111. // this one has to use the /g flag
  10112. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10113. var comparatorTrimReplace = '$1$2$3'
  10114. // Something like `1.2.3 - 1.2.4`
  10115. // Note that these all use the loose form, because they'll be
  10116. // checked against either the strict or loose comparator form
  10117. // later.
  10118. tok('HYPHENRANGE')
  10119. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10120. '\\s+-\\s+' +
  10121. '(' + src[t.XRANGEPLAIN] + ')' +
  10122. '\\s*$'
  10123. tok('HYPHENRANGELOOSE')
  10124. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10125. '\\s+-\\s+' +
  10126. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10127. '\\s*$'
  10128. // Star ranges basically just allow anything at all.
  10129. tok('STAR')
  10130. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10131. // Compile to actual regexp objects.
  10132. // All are flag-free, unless they were created above with a flag.
  10133. for (var i = 0; i < R; i++) {
  10134. debug(i, src[i])
  10135. if (!re[i]) {
  10136. re[i] = new RegExp(src[i])
  10137. }
  10138. }
  10139. exports.parse = parse
  10140. function parse (version, options) {
  10141. if (!options || typeof options !== 'object') {
  10142. options = {
  10143. loose: !!options,
  10144. includePrerelease: false
  10145. }
  10146. }
  10147. if (version instanceof SemVer) {
  10148. return version
  10149. }
  10150. if (typeof version !== 'string') {
  10151. return null
  10152. }
  10153. if (version.length > MAX_LENGTH) {
  10154. return null
  10155. }
  10156. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10157. if (!r.test(version)) {
  10158. return null
  10159. }
  10160. try {
  10161. return new SemVer(version, options)
  10162. } catch (er) {
  10163. return null
  10164. }
  10165. }
  10166. exports.valid = valid
  10167. function valid (version, options) {
  10168. var v = parse(version, options)
  10169. return v ? v.version : null
  10170. }
  10171. exports.clean = clean
  10172. function clean (version, options) {
  10173. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10174. return s ? s.version : null
  10175. }
  10176. exports.SemVer = SemVer
  10177. function SemVer (version, options) {
  10178. if (!options || typeof options !== 'object') {
  10179. options = {
  10180. loose: !!options,
  10181. includePrerelease: false
  10182. }
  10183. }
  10184. if (version instanceof SemVer) {
  10185. if (version.loose === options.loose) {
  10186. return version
  10187. } else {
  10188. version = version.version
  10189. }
  10190. } else if (typeof version !== 'string') {
  10191. throw new TypeError('Invalid Version: ' + version)
  10192. }
  10193. if (version.length > MAX_LENGTH) {
  10194. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10195. }
  10196. if (!(this instanceof SemVer)) {
  10197. return new SemVer(version, options)
  10198. }
  10199. debug('SemVer', version, options)
  10200. this.options = options
  10201. this.loose = !!options.loose
  10202. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10203. if (!m) {
  10204. throw new TypeError('Invalid Version: ' + version)
  10205. }
  10206. this.raw = version
  10207. // these are actually numbers
  10208. this.major = +m[1]
  10209. this.minor = +m[2]
  10210. this.patch = +m[3]
  10211. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10212. throw new TypeError('Invalid major version')
  10213. }
  10214. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10215. throw new TypeError('Invalid minor version')
  10216. }
  10217. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10218. throw new TypeError('Invalid patch version')
  10219. }
  10220. // numberify any prerelease numeric ids
  10221. if (!m[4]) {
  10222. this.prerelease = []
  10223. } else {
  10224. this.prerelease = m[4].split('.').map(function (id) {
  10225. if (/^[0-9]+$/.test(id)) {
  10226. var num = +id
  10227. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10228. return num
  10229. }
  10230. }
  10231. return id
  10232. })
  10233. }
  10234. this.build = m[5] ? m[5].split('.') : []
  10235. this.format()
  10236. }
  10237. SemVer.prototype.format = function () {
  10238. this.version = this.major + '.' + this.minor + '.' + this.patch
  10239. if (this.prerelease.length) {
  10240. this.version += '-' + this.prerelease.join('.')
  10241. }
  10242. return this.version
  10243. }
  10244. SemVer.prototype.toString = function () {
  10245. return this.version
  10246. }
  10247. SemVer.prototype.compare = function (other) {
  10248. debug('SemVer.compare', this.version, this.options, other)
  10249. if (!(other instanceof SemVer)) {
  10250. other = new SemVer(other, this.options)
  10251. }
  10252. return this.compareMain(other) || this.comparePre(other)
  10253. }
  10254. SemVer.prototype.compareMain = function (other) {
  10255. if (!(other instanceof SemVer)) {
  10256. other = new SemVer(other, this.options)
  10257. }
  10258. return compareIdentifiers(this.major, other.major) ||
  10259. compareIdentifiers(this.minor, other.minor) ||
  10260. compareIdentifiers(this.patch, other.patch)
  10261. }
  10262. SemVer.prototype.comparePre = function (other) {
  10263. if (!(other instanceof SemVer)) {
  10264. other = new SemVer(other, this.options)
  10265. }
  10266. // NOT having a prerelease is > having one
  10267. if (this.prerelease.length && !other.prerelease.length) {
  10268. return -1
  10269. } else if (!this.prerelease.length && other.prerelease.length) {
  10270. return 1
  10271. } else if (!this.prerelease.length && !other.prerelease.length) {
  10272. return 0
  10273. }
  10274. var i = 0
  10275. do {
  10276. var a = this.prerelease[i]
  10277. var b = other.prerelease[i]
  10278. debug('prerelease compare', i, a, b)
  10279. if (a === undefined && b === undefined) {
  10280. return 0
  10281. } else if (b === undefined) {
  10282. return 1
  10283. } else if (a === undefined) {
  10284. return -1
  10285. } else if (a === b) {
  10286. continue
  10287. } else {
  10288. return compareIdentifiers(a, b)
  10289. }
  10290. } while (++i)
  10291. }
  10292. SemVer.prototype.compareBuild = function (other) {
  10293. if (!(other instanceof SemVer)) {
  10294. other = new SemVer(other, this.options)
  10295. }
  10296. var i = 0
  10297. do {
  10298. var a = this.build[i]
  10299. var b = other.build[i]
  10300. debug('prerelease compare', i, a, b)
  10301. if (a === undefined && b === undefined) {
  10302. return 0
  10303. } else if (b === undefined) {
  10304. return 1
  10305. } else if (a === undefined) {
  10306. return -1
  10307. } else if (a === b) {
  10308. continue
  10309. } else {
  10310. return compareIdentifiers(a, b)
  10311. }
  10312. } while (++i)
  10313. }
  10314. // preminor will bump the version up to the next minor release, and immediately
  10315. // down to pre-release. premajor and prepatch work the same way.
  10316. SemVer.prototype.inc = function (release, identifier) {
  10317. switch (release) {
  10318. case 'premajor':
  10319. this.prerelease.length = 0
  10320. this.patch = 0
  10321. this.minor = 0
  10322. this.major++
  10323. this.inc('pre', identifier)
  10324. break
  10325. case 'preminor':
  10326. this.prerelease.length = 0
  10327. this.patch = 0
  10328. this.minor++
  10329. this.inc('pre', identifier)
  10330. break
  10331. case 'prepatch':
  10332. // If this is already a prerelease, it will bump to the next version
  10333. // drop any prereleases that might already exist, since they are not
  10334. // relevant at this point.
  10335. this.prerelease.length = 0
  10336. this.inc('patch', identifier)
  10337. this.inc('pre', identifier)
  10338. break
  10339. // If the input is a non-prerelease version, this acts the same as
  10340. // prepatch.
  10341. case 'prerelease':
  10342. if (this.prerelease.length === 0) {
  10343. this.inc('patch', identifier)
  10344. }
  10345. this.inc('pre', identifier)
  10346. break
  10347. case 'major':
  10348. // If this is a pre-major version, bump up to the same major version.
  10349. // Otherwise increment major.
  10350. // 1.0.0-5 bumps to 1.0.0
  10351. // 1.1.0 bumps to 2.0.0
  10352. if (this.minor !== 0 ||
  10353. this.patch !== 0 ||
  10354. this.prerelease.length === 0) {
  10355. this.major++
  10356. }
  10357. this.minor = 0
  10358. this.patch = 0
  10359. this.prerelease = []
  10360. break
  10361. case 'minor':
  10362. // If this is a pre-minor version, bump up to the same minor version.
  10363. // Otherwise increment minor.
  10364. // 1.2.0-5 bumps to 1.2.0
  10365. // 1.2.1 bumps to 1.3.0
  10366. if (this.patch !== 0 || this.prerelease.length === 0) {
  10367. this.minor++
  10368. }
  10369. this.patch = 0
  10370. this.prerelease = []
  10371. break
  10372. case 'patch':
  10373. // If this is not a pre-release version, it will increment the patch.
  10374. // If it is a pre-release it will bump up to the same patch version.
  10375. // 1.2.0-5 patches to 1.2.0
  10376. // 1.2.0 patches to 1.2.1
  10377. if (this.prerelease.length === 0) {
  10378. this.patch++
  10379. }
  10380. this.prerelease = []
  10381. break
  10382. // This probably shouldn't be used publicly.
  10383. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10384. case 'pre':
  10385. if (this.prerelease.length === 0) {
  10386. this.prerelease = [0]
  10387. } else {
  10388. var i = this.prerelease.length
  10389. while (--i >= 0) {
  10390. if (typeof this.prerelease[i] === 'number') {
  10391. this.prerelease[i]++
  10392. i = -2
  10393. }
  10394. }
  10395. if (i === -1) {
  10396. // didn't increment anything
  10397. this.prerelease.push(0)
  10398. }
  10399. }
  10400. if (identifier) {
  10401. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10402. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10403. if (this.prerelease[0] === identifier) {
  10404. if (isNaN(this.prerelease[1])) {
  10405. this.prerelease = [identifier, 0]
  10406. }
  10407. } else {
  10408. this.prerelease = [identifier, 0]
  10409. }
  10410. }
  10411. break
  10412. default:
  10413. throw new Error('invalid increment argument: ' + release)
  10414. }
  10415. this.format()
  10416. this.raw = this.version
  10417. return this
  10418. }
  10419. exports.inc = inc
  10420. function inc (version, release, loose, identifier) {
  10421. if (typeof (loose) === 'string') {
  10422. identifier = loose
  10423. loose = undefined
  10424. }
  10425. try {
  10426. return new SemVer(version, loose).inc(release, identifier).version
  10427. } catch (er) {
  10428. return null
  10429. }
  10430. }
  10431. exports.diff = diff
  10432. function diff (version1, version2) {
  10433. if (eq(version1, version2)) {
  10434. return null
  10435. } else {
  10436. var v1 = parse(version1)
  10437. var v2 = parse(version2)
  10438. var prefix = ''
  10439. if (v1.prerelease.length || v2.prerelease.length) {
  10440. prefix = 'pre'
  10441. var defaultResult = 'prerelease'
  10442. }
  10443. for (var key in v1) {
  10444. if (key === 'major' || key === 'minor' || key === 'patch') {
  10445. if (v1[key] !== v2[key]) {
  10446. return prefix + key
  10447. }
  10448. }
  10449. }
  10450. return defaultResult // may be undefined
  10451. }
  10452. }
  10453. exports.compareIdentifiers = compareIdentifiers
  10454. var numeric = /^[0-9]+$/
  10455. function compareIdentifiers (a, b) {
  10456. var anum = numeric.test(a)
  10457. var bnum = numeric.test(b)
  10458. if (anum && bnum) {
  10459. a = +a
  10460. b = +b
  10461. }
  10462. return a === b ? 0
  10463. : (anum && !bnum) ? -1
  10464. : (bnum && !anum) ? 1
  10465. : a < b ? -1
  10466. : 1
  10467. }
  10468. exports.rcompareIdentifiers = rcompareIdentifiers
  10469. function rcompareIdentifiers (a, b) {
  10470. return compareIdentifiers(b, a)
  10471. }
  10472. exports.major = major
  10473. function major (a, loose) {
  10474. return new SemVer(a, loose).major
  10475. }
  10476. exports.minor = minor
  10477. function minor (a, loose) {
  10478. return new SemVer(a, loose).minor
  10479. }
  10480. exports.patch = patch
  10481. function patch (a, loose) {
  10482. return new SemVer(a, loose).patch
  10483. }
  10484. exports.compare = compare
  10485. function compare (a, b, loose) {
  10486. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10487. }
  10488. exports.compareLoose = compareLoose
  10489. function compareLoose (a, b) {
  10490. return compare(a, b, true)
  10491. }
  10492. exports.compareBuild = compareBuild
  10493. function compareBuild (a, b, loose) {
  10494. var versionA = new SemVer(a, loose)
  10495. var versionB = new SemVer(b, loose)
  10496. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10497. }
  10498. exports.rcompare = rcompare
  10499. function rcompare (a, b, loose) {
  10500. return compare(b, a, loose)
  10501. }
  10502. exports.sort = sort
  10503. function sort (list, loose) {
  10504. return list.sort(function (a, b) {
  10505. return exports.compareBuild(a, b, loose)
  10506. })
  10507. }
  10508. exports.rsort = rsort
  10509. function rsort (list, loose) {
  10510. return list.sort(function (a, b) {
  10511. return exports.compareBuild(b, a, loose)
  10512. })
  10513. }
  10514. exports.gt = gt
  10515. function gt (a, b, loose) {
  10516. return compare(a, b, loose) > 0
  10517. }
  10518. exports.lt = lt
  10519. function lt (a, b, loose) {
  10520. return compare(a, b, loose) < 0
  10521. }
  10522. exports.eq = eq
  10523. function eq (a, b, loose) {
  10524. return compare(a, b, loose) === 0
  10525. }
  10526. exports.neq = neq
  10527. function neq (a, b, loose) {
  10528. return compare(a, b, loose) !== 0
  10529. }
  10530. exports.gte = gte
  10531. function gte (a, b, loose) {
  10532. return compare(a, b, loose) >= 0
  10533. }
  10534. exports.lte = lte
  10535. function lte (a, b, loose) {
  10536. return compare(a, b, loose) <= 0
  10537. }
  10538. exports.cmp = cmp
  10539. function cmp (a, op, b, loose) {
  10540. switch (op) {
  10541. case '===':
  10542. if (typeof a === 'object')
  10543. a = a.version
  10544. if (typeof b === 'object')
  10545. b = b.version
  10546. return a === b
  10547. case '!==':
  10548. if (typeof a === 'object')
  10549. a = a.version
  10550. if (typeof b === 'object')
  10551. b = b.version
  10552. return a !== b
  10553. case '':
  10554. case '=':
  10555. case '==':
  10556. return eq(a, b, loose)
  10557. case '!=':
  10558. return neq(a, b, loose)
  10559. case '>':
  10560. return gt(a, b, loose)
  10561. case '>=':
  10562. return gte(a, b, loose)
  10563. case '<':
  10564. return lt(a, b, loose)
  10565. case '<=':
  10566. return lte(a, b, loose)
  10567. default:
  10568. throw new TypeError('Invalid operator: ' + op)
  10569. }
  10570. }
  10571. exports.Comparator = Comparator
  10572. function Comparator (comp, options) {
  10573. if (!options || typeof options !== 'object') {
  10574. options = {
  10575. loose: !!options,
  10576. includePrerelease: false
  10577. }
  10578. }
  10579. if (comp instanceof Comparator) {
  10580. if (comp.loose === !!options.loose) {
  10581. return comp
  10582. } else {
  10583. comp = comp.value
  10584. }
  10585. }
  10586. if (!(this instanceof Comparator)) {
  10587. return new Comparator(comp, options)
  10588. }
  10589. debug('comparator', comp, options)
  10590. this.options = options
  10591. this.loose = !!options.loose
  10592. this.parse(comp)
  10593. if (this.semver === ANY) {
  10594. this.value = ''
  10595. } else {
  10596. this.value = this.operator + this.semver.version
  10597. }
  10598. debug('comp', this)
  10599. }
  10600. var ANY = {}
  10601. Comparator.prototype.parse = function (comp) {
  10602. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10603. var m = comp.match(r)
  10604. if (!m) {
  10605. throw new TypeError('Invalid comparator: ' + comp)
  10606. }
  10607. this.operator = m[1] !== undefined ? m[1] : ''
  10608. if (this.operator === '=') {
  10609. this.operator = ''
  10610. }
  10611. // if it literally is just '>' or '' then allow anything.
  10612. if (!m[2]) {
  10613. this.semver = ANY
  10614. } else {
  10615. this.semver = new SemVer(m[2], this.options.loose)
  10616. }
  10617. }
  10618. Comparator.prototype.toString = function () {
  10619. return this.value
  10620. }
  10621. Comparator.prototype.test = function (version) {
  10622. debug('Comparator.test', version, this.options.loose)
  10623. if (this.semver === ANY || version === ANY) {
  10624. return true
  10625. }
  10626. if (typeof version === 'string') {
  10627. try {
  10628. version = new SemVer(version, this.options)
  10629. } catch (er) {
  10630. return false
  10631. }
  10632. }
  10633. return cmp(version, this.operator, this.semver, this.options)
  10634. }
  10635. Comparator.prototype.intersects = function (comp, options) {
  10636. if (!(comp instanceof Comparator)) {
  10637. throw new TypeError('a Comparator is required')
  10638. }
  10639. if (!options || typeof options !== 'object') {
  10640. options = {
  10641. loose: !!options,
  10642. includePrerelease: false
  10643. }
  10644. }
  10645. var rangeTmp
  10646. if (this.operator === '') {
  10647. if (this.value === '') {
  10648. return true
  10649. }
  10650. rangeTmp = new Range(comp.value, options)
  10651. return satisfies(this.value, rangeTmp, options)
  10652. } else if (comp.operator === '') {
  10653. if (comp.value === '') {
  10654. return true
  10655. }
  10656. rangeTmp = new Range(this.value, options)
  10657. return satisfies(comp.semver, rangeTmp, options)
  10658. }
  10659. var sameDirectionIncreasing =
  10660. (this.operator === '>=' || this.operator === '>') &&
  10661. (comp.operator === '>=' || comp.operator === '>')
  10662. var sameDirectionDecreasing =
  10663. (this.operator === '<=' || this.operator === '<') &&
  10664. (comp.operator === '<=' || comp.operator === '<')
  10665. var sameSemVer = this.semver.version === comp.semver.version
  10666. var differentDirectionsInclusive =
  10667. (this.operator === '>=' || this.operator === '<=') &&
  10668. (comp.operator === '>=' || comp.operator === '<=')
  10669. var oppositeDirectionsLessThan =
  10670. cmp(this.semver, '<', comp.semver, options) &&
  10671. ((this.operator === '>=' || this.operator === '>') &&
  10672. (comp.operator === '<=' || comp.operator === '<'))
  10673. var oppositeDirectionsGreaterThan =
  10674. cmp(this.semver, '>', comp.semver, options) &&
  10675. ((this.operator === '<=' || this.operator === '<') &&
  10676. (comp.operator === '>=' || comp.operator === '>'))
  10677. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10678. (sameSemVer && differentDirectionsInclusive) ||
  10679. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10680. }
  10681. exports.Range = Range
  10682. function Range (range, options) {
  10683. if (!options || typeof options !== 'object') {
  10684. options = {
  10685. loose: !!options,
  10686. includePrerelease: false
  10687. }
  10688. }
  10689. if (range instanceof Range) {
  10690. if (range.loose === !!options.loose &&
  10691. range.includePrerelease === !!options.includePrerelease) {
  10692. return range
  10693. } else {
  10694. return new Range(range.raw, options)
  10695. }
  10696. }
  10697. if (range instanceof Comparator) {
  10698. return new Range(range.value, options)
  10699. }
  10700. if (!(this instanceof Range)) {
  10701. return new Range(range, options)
  10702. }
  10703. this.options = options
  10704. this.loose = !!options.loose
  10705. this.includePrerelease = !!options.includePrerelease
  10706. // First, split based on boolean or ||
  10707. this.raw = range
  10708. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10709. return this.parseRange(range.trim())
  10710. }, this).filter(function (c) {
  10711. // throw out any that are not relevant for whatever reason
  10712. return c.length
  10713. })
  10714. if (!this.set.length) {
  10715. throw new TypeError('Invalid SemVer Range: ' + range)
  10716. }
  10717. this.format()
  10718. }
  10719. Range.prototype.format = function () {
  10720. this.range = this.set.map(function (comps) {
  10721. return comps.join(' ').trim()
  10722. }).join('||').trim()
  10723. return this.range
  10724. }
  10725. Range.prototype.toString = function () {
  10726. return this.range
  10727. }
  10728. Range.prototype.parseRange = function (range) {
  10729. var loose = this.options.loose
  10730. range = range.trim()
  10731. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10732. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10733. range = range.replace(hr, hyphenReplace)
  10734. debug('hyphen replace', range)
  10735. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10736. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10737. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10738. // `~ 1.2.3` => `~1.2.3`
  10739. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10740. // `^ 1.2.3` => `^1.2.3`
  10741. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10742. // normalize spaces
  10743. range = range.split(/\s+/).join(' ')
  10744. // At this point, the range is completely trimmed and
  10745. // ready to be split into comparators.
  10746. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10747. var set = range.split(' ').map(function (comp) {
  10748. return parseComparator(comp, this.options)
  10749. }, this).join(' ').split(/\s+/)
  10750. if (this.options.loose) {
  10751. // in loose mode, throw out any that are not valid comparators
  10752. set = set.filter(function (comp) {
  10753. return !!comp.match(compRe)
  10754. })
  10755. }
  10756. set = set.map(function (comp) {
  10757. return new Comparator(comp, this.options)
  10758. }, this)
  10759. return set
  10760. }
  10761. Range.prototype.intersects = function (range, options) {
  10762. if (!(range instanceof Range)) {
  10763. throw new TypeError('a Range is required')
  10764. }
  10765. return this.set.some(function (thisComparators) {
  10766. return (
  10767. isSatisfiable(thisComparators, options) &&
  10768. range.set.some(function (rangeComparators) {
  10769. return (
  10770. isSatisfiable(rangeComparators, options) &&
  10771. thisComparators.every(function (thisComparator) {
  10772. return rangeComparators.every(function (rangeComparator) {
  10773. return thisComparator.intersects(rangeComparator, options)
  10774. })
  10775. })
  10776. )
  10777. })
  10778. )
  10779. })
  10780. }
  10781. // take a set of comparators and determine whether there
  10782. // exists a version which can satisfy it
  10783. function isSatisfiable (comparators, options) {
  10784. var result = true
  10785. var remainingComparators = comparators.slice()
  10786. var testComparator = remainingComparators.pop()
  10787. while (result && remainingComparators.length) {
  10788. result = remainingComparators.every(function (otherComparator) {
  10789. return testComparator.intersects(otherComparator, options)
  10790. })
  10791. testComparator = remainingComparators.pop()
  10792. }
  10793. return result
  10794. }
  10795. // Mostly just for testing and legacy API reasons
  10796. exports.toComparators = toComparators
  10797. function toComparators (range, options) {
  10798. return new Range(range, options).set.map(function (comp) {
  10799. return comp.map(function (c) {
  10800. return c.value
  10801. }).join(' ').trim().split(' ')
  10802. })
  10803. }
  10804. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10805. // already replaced the hyphen ranges
  10806. // turn into a set of JUST comparators.
  10807. function parseComparator (comp, options) {
  10808. debug('comp', comp, options)
  10809. comp = replaceCarets(comp, options)
  10810. debug('caret', comp)
  10811. comp = replaceTildes(comp, options)
  10812. debug('tildes', comp)
  10813. comp = replaceXRanges(comp, options)
  10814. debug('xrange', comp)
  10815. comp = replaceStars(comp, options)
  10816. debug('stars', comp)
  10817. return comp
  10818. }
  10819. function isX (id) {
  10820. return !id || id.toLowerCase() === 'x' || id === '*'
  10821. }
  10822. // ~, ~> --> * (any, kinda silly)
  10823. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10824. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10825. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10826. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10827. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10828. function replaceTildes (comp, options) {
  10829. return comp.trim().split(/\s+/).map(function (comp) {
  10830. return replaceTilde(comp, options)
  10831. }).join(' ')
  10832. }
  10833. function replaceTilde (comp, options) {
  10834. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10835. return comp.replace(r, function (_, M, m, p, pr) {
  10836. debug('tilde', comp, _, M, m, p, pr)
  10837. var ret
  10838. if (isX(M)) {
  10839. ret = ''
  10840. } else if (isX(m)) {
  10841. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10842. } else if (isX(p)) {
  10843. // ~1.2 == >=1.2.0 <1.3.0
  10844. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10845. } else if (pr) {
  10846. debug('replaceTilde pr', pr)
  10847. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10848. ' <' + M + '.' + (+m + 1) + '.0'
  10849. } else {
  10850. // ~1.2.3 == >=1.2.3 <1.3.0
  10851. ret = '>=' + M + '.' + m + '.' + p +
  10852. ' <' + M + '.' + (+m + 1) + '.0'
  10853. }
  10854. debug('tilde return', ret)
  10855. return ret
  10856. })
  10857. }
  10858. // ^ --> * (any, kinda silly)
  10859. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10860. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10861. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10862. // ^1.2.3 --> >=1.2.3 <2.0.0
  10863. // ^1.2.0 --> >=1.2.0 <2.0.0
  10864. function replaceCarets (comp, options) {
  10865. return comp.trim().split(/\s+/).map(function (comp) {
  10866. return replaceCaret(comp, options)
  10867. }).join(' ')
  10868. }
  10869. function replaceCaret (comp, options) {
  10870. debug('caret', comp, options)
  10871. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10872. return comp.replace(r, function (_, M, m, p, pr) {
  10873. debug('caret', comp, _, M, m, p, pr)
  10874. var ret
  10875. if (isX(M)) {
  10876. ret = ''
  10877. } else if (isX(m)) {
  10878. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10879. } else if (isX(p)) {
  10880. if (M === '0') {
  10881. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10882. } else {
  10883. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10884. }
  10885. } else if (pr) {
  10886. debug('replaceCaret pr', pr)
  10887. if (M === '0') {
  10888. if (m === '0') {
  10889. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10890. ' <' + M + '.' + m + '.' + (+p + 1)
  10891. } else {
  10892. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10893. ' <' + M + '.' + (+m + 1) + '.0'
  10894. }
  10895. } else {
  10896. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10897. ' <' + (+M + 1) + '.0.0'
  10898. }
  10899. } else {
  10900. debug('no pr')
  10901. if (M === '0') {
  10902. if (m === '0') {
  10903. ret = '>=' + M + '.' + m + '.' + p +
  10904. ' <' + M + '.' + m + '.' + (+p + 1)
  10905. } else {
  10906. ret = '>=' + M + '.' + m + '.' + p +
  10907. ' <' + M + '.' + (+m + 1) + '.0'
  10908. }
  10909. } else {
  10910. ret = '>=' + M + '.' + m + '.' + p +
  10911. ' <' + (+M + 1) + '.0.0'
  10912. }
  10913. }
  10914. debug('caret return', ret)
  10915. return ret
  10916. })
  10917. }
  10918. function replaceXRanges (comp, options) {
  10919. debug('replaceXRanges', comp, options)
  10920. return comp.split(/\s+/).map(function (comp) {
  10921. return replaceXRange(comp, options)
  10922. }).join(' ')
  10923. }
  10924. function replaceXRange (comp, options) {
  10925. comp = comp.trim()
  10926. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10927. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10928. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10929. var xM = isX(M)
  10930. var xm = xM || isX(m)
  10931. var xp = xm || isX(p)
  10932. var anyX = xp
  10933. if (gtlt === '=' && anyX) {
  10934. gtlt = ''
  10935. }
  10936. // if we're including prereleases in the match, then we need
  10937. // to fix this to -0, the lowest possible prerelease value
  10938. pr = options.includePrerelease ? '-0' : ''
  10939. if (xM) {
  10940. if (gtlt === '>' || gtlt === '<') {
  10941. // nothing is allowed
  10942. ret = '<0.0.0-0'
  10943. } else {
  10944. // nothing is forbidden
  10945. ret = '*'
  10946. }
  10947. } else if (gtlt && anyX) {
  10948. // we know patch is an x, because we have any x at all.
  10949. // replace X with 0
  10950. if (xm) {
  10951. m = 0
  10952. }
  10953. p = 0
  10954. if (gtlt === '>') {
  10955. // >1 => >=2.0.0
  10956. // >1.2 => >=1.3.0
  10957. // >1.2.3 => >= 1.2.4
  10958. gtlt = '>='
  10959. if (xm) {
  10960. M = +M + 1
  10961. m = 0
  10962. p = 0
  10963. } else {
  10964. m = +m + 1
  10965. p = 0
  10966. }
  10967. } else if (gtlt === '<=') {
  10968. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10969. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10970. gtlt = '<'
  10971. if (xm) {
  10972. M = +M + 1
  10973. } else {
  10974. m = +m + 1
  10975. }
  10976. }
  10977. ret = gtlt + M + '.' + m + '.' + p + pr
  10978. } else if (xm) {
  10979. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10980. } else if (xp) {
  10981. ret = '>=' + M + '.' + m + '.0' + pr +
  10982. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10983. }
  10984. debug('xRange return', ret)
  10985. return ret
  10986. })
  10987. }
  10988. // Because * is AND-ed with everything else in the comparator,
  10989. // and '' means "any version", just remove the *s entirely.
  10990. function replaceStars (comp, options) {
  10991. debug('replaceStars', comp, options)
  10992. // Looseness is ignored here. star is always as loose as it gets!
  10993. return comp.trim().replace(re[t.STAR], '')
  10994. }
  10995. // This function is passed to string.replace(re[t.HYPHENRANGE])
  10996. // M, m, patch, prerelease, build
  10997. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  10998. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  10999. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  11000. function hyphenReplace ($0,
  11001. from, fM, fm, fp, fpr, fb,
  11002. to, tM, tm, tp, tpr, tb) {
  11003. if (isX(fM)) {
  11004. from = ''
  11005. } else if (isX(fm)) {
  11006. from = '>=' + fM + '.0.0'
  11007. } else if (isX(fp)) {
  11008. from = '>=' + fM + '.' + fm + '.0'
  11009. } else {
  11010. from = '>=' + from
  11011. }
  11012. if (isX(tM)) {
  11013. to = ''
  11014. } else if (isX(tm)) {
  11015. to = '<' + (+tM + 1) + '.0.0'
  11016. } else if (isX(tp)) {
  11017. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11018. } else if (tpr) {
  11019. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11020. } else {
  11021. to = '<=' + to
  11022. }
  11023. return (from + ' ' + to).trim()
  11024. }
  11025. // if ANY of the sets match ALL of its comparators, then pass
  11026. Range.prototype.test = function (version) {
  11027. if (!version) {
  11028. return false
  11029. }
  11030. if (typeof version === 'string') {
  11031. try {
  11032. version = new SemVer(version, this.options)
  11033. } catch (er) {
  11034. return false
  11035. }
  11036. }
  11037. for (var i = 0; i < this.set.length; i++) {
  11038. if (testSet(this.set[i], version, this.options)) {
  11039. return true
  11040. }
  11041. }
  11042. return false
  11043. }
  11044. function testSet (set, version, options) {
  11045. for (var i = 0; i < set.length; i++) {
  11046. if (!set[i].test(version)) {
  11047. return false
  11048. }
  11049. }
  11050. if (version.prerelease.length && !options.includePrerelease) {
  11051. // Find the set of versions that are allowed to have prereleases
  11052. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11053. // That should allow `1.2.3-pr.2` to pass.
  11054. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11055. // even though it's within the range set by the comparators.
  11056. for (i = 0; i < set.length; i++) {
  11057. debug(set[i].semver)
  11058. if (set[i].semver === ANY) {
  11059. continue
  11060. }
  11061. if (set[i].semver.prerelease.length > 0) {
  11062. var allowed = set[i].semver
  11063. if (allowed.major === version.major &&
  11064. allowed.minor === version.minor &&
  11065. allowed.patch === version.patch) {
  11066. return true
  11067. }
  11068. }
  11069. }
  11070. // Version has a -pre, but it's not one of the ones we like.
  11071. return false
  11072. }
  11073. return true
  11074. }
  11075. exports.satisfies = satisfies
  11076. function satisfies (version, range, options) {
  11077. try {
  11078. range = new Range(range, options)
  11079. } catch (er) {
  11080. return false
  11081. }
  11082. return range.test(version)
  11083. }
  11084. exports.maxSatisfying = maxSatisfying
  11085. function maxSatisfying (versions, range, options) {
  11086. var max = null
  11087. var maxSV = null
  11088. try {
  11089. var rangeObj = new Range(range, options)
  11090. } catch (er) {
  11091. return null
  11092. }
  11093. versions.forEach(function (v) {
  11094. if (rangeObj.test(v)) {
  11095. // satisfies(v, range, options)
  11096. if (!max || maxSV.compare(v) === -1) {
  11097. // compare(max, v, true)
  11098. max = v
  11099. maxSV = new SemVer(max, options)
  11100. }
  11101. }
  11102. })
  11103. return max
  11104. }
  11105. exports.minSatisfying = minSatisfying
  11106. function minSatisfying (versions, range, options) {
  11107. var min = null
  11108. var minSV = null
  11109. try {
  11110. var rangeObj = new Range(range, options)
  11111. } catch (er) {
  11112. return null
  11113. }
  11114. versions.forEach(function (v) {
  11115. if (rangeObj.test(v)) {
  11116. // satisfies(v, range, options)
  11117. if (!min || minSV.compare(v) === 1) {
  11118. // compare(min, v, true)
  11119. min = v
  11120. minSV = new SemVer(min, options)
  11121. }
  11122. }
  11123. })
  11124. return min
  11125. }
  11126. exports.minVersion = minVersion
  11127. function minVersion (range, loose) {
  11128. range = new Range(range, loose)
  11129. var minver = new SemVer('0.0.0')
  11130. if (range.test(minver)) {
  11131. return minver
  11132. }
  11133. minver = new SemVer('0.0.0-0')
  11134. if (range.test(minver)) {
  11135. return minver
  11136. }
  11137. minver = null
  11138. for (var i = 0; i < range.set.length; ++i) {
  11139. var comparators = range.set[i]
  11140. comparators.forEach(function (comparator) {
  11141. // Clone to avoid manipulating the comparator's semver object.
  11142. var compver = new SemVer(comparator.semver.version)
  11143. switch (comparator.operator) {
  11144. case '>':
  11145. if (compver.prerelease.length === 0) {
  11146. compver.patch++
  11147. } else {
  11148. compver.prerelease.push(0)
  11149. }
  11150. compver.raw = compver.format()
  11151. /* fallthrough */
  11152. case '':
  11153. case '>=':
  11154. if (!minver || gt(minver, compver)) {
  11155. minver = compver
  11156. }
  11157. break
  11158. case '<':
  11159. case '<=':
  11160. /* Ignore maximum versions */
  11161. break
  11162. /* istanbul ignore next */
  11163. default:
  11164. throw new Error('Unexpected operation: ' + comparator.operator)
  11165. }
  11166. })
  11167. }
  11168. if (minver && range.test(minver)) {
  11169. return minver
  11170. }
  11171. return null
  11172. }
  11173. exports.validRange = validRange
  11174. function validRange (range, options) {
  11175. try {
  11176. // Return '*' instead of '' so that truthiness works.
  11177. // This will throw if it's invalid anyway
  11178. return new Range(range, options).range || '*'
  11179. } catch (er) {
  11180. return null
  11181. }
  11182. }
  11183. // Determine if version is less than all the versions possible in the range
  11184. exports.ltr = ltr
  11185. function ltr (version, range, options) {
  11186. return outside(version, range, '<', options)
  11187. }
  11188. // Determine if version is greater than all the versions possible in the range.
  11189. exports.gtr = gtr
  11190. function gtr (version, range, options) {
  11191. return outside(version, range, '>', options)
  11192. }
  11193. exports.outside = outside
  11194. function outside (version, range, hilo, options) {
  11195. version = new SemVer(version, options)
  11196. range = new Range(range, options)
  11197. var gtfn, ltefn, ltfn, comp, ecomp
  11198. switch (hilo) {
  11199. case '>':
  11200. gtfn = gt
  11201. ltefn = lte
  11202. ltfn = lt
  11203. comp = '>'
  11204. ecomp = '>='
  11205. break
  11206. case '<':
  11207. gtfn = lt
  11208. ltefn = gte
  11209. ltfn = gt
  11210. comp = '<'
  11211. ecomp = '<='
  11212. break
  11213. default:
  11214. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11215. }
  11216. // If it satisifes the range it is not outside
  11217. if (satisfies(version, range, options)) {
  11218. return false
  11219. }
  11220. // From now on, variable terms are as if we're in "gtr" mode.
  11221. // but note that everything is flipped for the "ltr" function.
  11222. for (var i = 0; i < range.set.length; ++i) {
  11223. var comparators = range.set[i]
  11224. var high = null
  11225. var low = null
  11226. comparators.forEach(function (comparator) {
  11227. if (comparator.semver === ANY) {
  11228. comparator = new Comparator('>=0.0.0')
  11229. }
  11230. high = high || comparator
  11231. low = low || comparator
  11232. if (gtfn(comparator.semver, high.semver, options)) {
  11233. high = comparator
  11234. } else if (ltfn(comparator.semver, low.semver, options)) {
  11235. low = comparator
  11236. }
  11237. })
  11238. // If the edge version comparator has a operator then our version
  11239. // isn't outside it
  11240. if (high.operator === comp || high.operator === ecomp) {
  11241. return false
  11242. }
  11243. // If the lowest version comparator has an operator and our version
  11244. // is less than it then it isn't higher than the range
  11245. if ((!low.operator || low.operator === comp) &&
  11246. ltefn(version, low.semver)) {
  11247. return false
  11248. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11249. return false
  11250. }
  11251. }
  11252. return true
  11253. }
  11254. exports.prerelease = prerelease
  11255. function prerelease (version, options) {
  11256. var parsed = parse(version, options)
  11257. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11258. }
  11259. exports.intersects = intersects
  11260. function intersects (r1, r2, options) {
  11261. r1 = new Range(r1, options)
  11262. r2 = new Range(r2, options)
  11263. return r1.intersects(r2)
  11264. }
  11265. exports.coerce = coerce
  11266. function coerce (version, options) {
  11267. if (version instanceof SemVer) {
  11268. return version
  11269. }
  11270. if (typeof version === 'number') {
  11271. version = String(version)
  11272. }
  11273. if (typeof version !== 'string') {
  11274. return null
  11275. }
  11276. options = options || {}
  11277. var match = null
  11278. if (!options.rtl) {
  11279. match = version.match(re[t.COERCE])
  11280. } else {
  11281. // Find the right-most coercible string that does not share
  11282. // a terminus with a more left-ward coercible string.
  11283. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11284. //
  11285. // Walk through the string checking with a /g regexp
  11286. // Manually set the index so as to pick up overlapping matches.
  11287. // Stop when we get a match that ends at the string end, since no
  11288. // coercible string can be more right-ward without the same terminus.
  11289. var next
  11290. while ((next = re[t.COERCERTL].exec(version)) &&
  11291. (!match || match.index + match[0].length !== version.length)
  11292. ) {
  11293. if (!match ||
  11294. next.index + next[0].length !== match.index + match[0].length) {
  11295. match = next
  11296. }
  11297. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11298. }
  11299. // leave it in a clean state
  11300. re[t.COERCERTL].lastIndex = -1
  11301. }
  11302. if (match === null) {
  11303. return null
  11304. }
  11305. return parse(match[2] +
  11306. '.' + (match[3] || '0') +
  11307. '.' + (match[4] || '0'), options)
  11308. }
  11309. /***/ }),
  11310. /***/ 669:
  11311. /***/ (function(module) {
  11312. module.exports = require("util");
  11313. /***/ }),
  11314. /***/ 672:
  11315. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11316. "use strict";
  11317. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11318. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11319. return new (P || (P = Promise))(function (resolve, reject) {
  11320. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11321. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11322. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11323. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11324. });
  11325. };
  11326. var _a;
  11327. Object.defineProperty(exports, "__esModule", { value: true });
  11328. const assert_1 = __webpack_require__(357);
  11329. const fs = __webpack_require__(747);
  11330. const path = __webpack_require__(622);
  11331. _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;
  11332. exports.IS_WINDOWS = process.platform === 'win32';
  11333. function exists(fsPath) {
  11334. return __awaiter(this, void 0, void 0, function* () {
  11335. try {
  11336. yield exports.stat(fsPath);
  11337. }
  11338. catch (err) {
  11339. if (err.code === 'ENOENT') {
  11340. return false;
  11341. }
  11342. throw err;
  11343. }
  11344. return true;
  11345. });
  11346. }
  11347. exports.exists = exists;
  11348. function isDirectory(fsPath, useStat = false) {
  11349. return __awaiter(this, void 0, void 0, function* () {
  11350. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11351. return stats.isDirectory();
  11352. });
  11353. }
  11354. exports.isDirectory = isDirectory;
  11355. /**
  11356. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11357. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11358. */
  11359. function isRooted(p) {
  11360. p = normalizeSeparators(p);
  11361. if (!p) {
  11362. throw new Error('isRooted() parameter "p" cannot be empty');
  11363. }
  11364. if (exports.IS_WINDOWS) {
  11365. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11366. ); // e.g. C: or C:\hello
  11367. }
  11368. return p.startsWith('/');
  11369. }
  11370. exports.isRooted = isRooted;
  11371. /**
  11372. * Recursively create a directory at `fsPath`.
  11373. *
  11374. * This implementation is optimistic, meaning it attempts to create the full
  11375. * path first, and backs up the path stack from there.
  11376. *
  11377. * @param fsPath The path to create
  11378. * @param maxDepth The maximum recursion depth
  11379. * @param depth The current recursion depth
  11380. */
  11381. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11382. return __awaiter(this, void 0, void 0, function* () {
  11383. assert_1.ok(fsPath, 'a path argument must be provided');
  11384. fsPath = path.resolve(fsPath);
  11385. if (depth >= maxDepth)
  11386. return exports.mkdir(fsPath);
  11387. try {
  11388. yield exports.mkdir(fsPath);
  11389. return;
  11390. }
  11391. catch (err) {
  11392. switch (err.code) {
  11393. case 'ENOENT': {
  11394. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11395. yield exports.mkdir(fsPath);
  11396. return;
  11397. }
  11398. default: {
  11399. let stats;
  11400. try {
  11401. stats = yield exports.stat(fsPath);
  11402. }
  11403. catch (err2) {
  11404. throw err;
  11405. }
  11406. if (!stats.isDirectory())
  11407. throw err;
  11408. }
  11409. }
  11410. }
  11411. });
  11412. }
  11413. exports.mkdirP = mkdirP;
  11414. /**
  11415. * Best effort attempt to determine whether a file exists and is executable.
  11416. * @param filePath file path to check
  11417. * @param extensions additional file extensions to try
  11418. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11419. */
  11420. function tryGetExecutablePath(filePath, extensions) {
  11421. return __awaiter(this, void 0, void 0, function* () {
  11422. let stats = undefined;
  11423. try {
  11424. // test file exists
  11425. stats = yield exports.stat(filePath);
  11426. }
  11427. catch (err) {
  11428. if (err.code !== 'ENOENT') {
  11429. // eslint-disable-next-line no-console
  11430. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11431. }
  11432. }
  11433. if (stats && stats.isFile()) {
  11434. if (exports.IS_WINDOWS) {
  11435. // on Windows, test for valid extension
  11436. const upperExt = path.extname(filePath).toUpperCase();
  11437. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11438. return filePath;
  11439. }
  11440. }
  11441. else {
  11442. if (isUnixExecutable(stats)) {
  11443. return filePath;
  11444. }
  11445. }
  11446. }
  11447. // try each extension
  11448. const originalFilePath = filePath;
  11449. for (const extension of extensions) {
  11450. filePath = originalFilePath + extension;
  11451. stats = undefined;
  11452. try {
  11453. stats = yield exports.stat(filePath);
  11454. }
  11455. catch (err) {
  11456. if (err.code !== 'ENOENT') {
  11457. // eslint-disable-next-line no-console
  11458. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11459. }
  11460. }
  11461. if (stats && stats.isFile()) {
  11462. if (exports.IS_WINDOWS) {
  11463. // preserve the case of the actual file (since an extension was appended)
  11464. try {
  11465. const directory = path.dirname(filePath);
  11466. const upperName = path.basename(filePath).toUpperCase();
  11467. for (const actualName of yield exports.readdir(directory)) {
  11468. if (upperName === actualName.toUpperCase()) {
  11469. filePath = path.join(directory, actualName);
  11470. break;
  11471. }
  11472. }
  11473. }
  11474. catch (err) {
  11475. // eslint-disable-next-line no-console
  11476. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11477. }
  11478. return filePath;
  11479. }
  11480. else {
  11481. if (isUnixExecutable(stats)) {
  11482. return filePath;
  11483. }
  11484. }
  11485. }
  11486. }
  11487. return '';
  11488. });
  11489. }
  11490. exports.tryGetExecutablePath = tryGetExecutablePath;
  11491. function normalizeSeparators(p) {
  11492. p = p || '';
  11493. if (exports.IS_WINDOWS) {
  11494. // convert slashes on Windows
  11495. p = p.replace(/\//g, '\\');
  11496. // remove redundant slashes
  11497. return p.replace(/\\\\+/g, '\\');
  11498. }
  11499. // remove redundant slashes
  11500. return p.replace(/\/\/+/g, '/');
  11501. }
  11502. // on Mac/Linux, test the execute bit
  11503. // R W X R W X R W X
  11504. // 256 128 64 32 16 8 4 2 1
  11505. function isUnixExecutable(stats) {
  11506. return ((stats.mode & 1) > 0 ||
  11507. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11508. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11509. }
  11510. //# sourceMappingURL=io-util.js.map
  11511. /***/ }),
  11512. /***/ 674:
  11513. /***/ (function(module, __unusedexports, __webpack_require__) {
  11514. module.exports = authenticate;
  11515. const { Deprecation } = __webpack_require__(692);
  11516. const once = __webpack_require__(969);
  11517. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11518. function authenticate(state, options) {
  11519. deprecateAuthenticate(
  11520. state.octokit.log,
  11521. new Deprecation(
  11522. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11523. )
  11524. );
  11525. if (!options) {
  11526. state.auth = false;
  11527. return;
  11528. }
  11529. switch (options.type) {
  11530. case "basic":
  11531. if (!options.username || !options.password) {
  11532. throw new Error(
  11533. "Basic authentication requires both a username and password to be set"
  11534. );
  11535. }
  11536. break;
  11537. case "oauth":
  11538. if (!options.token && !(options.key && options.secret)) {
  11539. throw new Error(
  11540. "OAuth2 authentication requires a token or key & secret to be set"
  11541. );
  11542. }
  11543. break;
  11544. case "token":
  11545. case "app":
  11546. if (!options.token) {
  11547. throw new Error("Token authentication requires a token to be set");
  11548. }
  11549. break;
  11550. default:
  11551. throw new Error(
  11552. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11553. );
  11554. }
  11555. state.auth = options;
  11556. }
  11557. /***/ }),
  11558. /***/ 675:
  11559. /***/ (function(module) {
  11560. module.exports = function btoa(str) {
  11561. return new Buffer(str).toString('base64')
  11562. }
  11563. /***/ }),
  11564. /***/ 692:
  11565. /***/ (function(__unusedmodule, exports) {
  11566. "use strict";
  11567. Object.defineProperty(exports, '__esModule', { value: true });
  11568. class Deprecation extends Error {
  11569. constructor(message) {
  11570. super(message); // Maintains proper stack trace (only available on V8)
  11571. /* istanbul ignore next */
  11572. if (Error.captureStackTrace) {
  11573. Error.captureStackTrace(this, this.constructor);
  11574. }
  11575. this.name = 'Deprecation';
  11576. }
  11577. }
  11578. exports.Deprecation = Deprecation;
  11579. /***/ }),
  11580. /***/ 696:
  11581. /***/ (function(module) {
  11582. "use strict";
  11583. /*!
  11584. * isobject <https://github.com/jonschlinkert/isobject>
  11585. *
  11586. * Copyright (c) 2014-2017, Jon Schlinkert.
  11587. * Released under the MIT License.
  11588. */
  11589. function isObject(val) {
  11590. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11591. }
  11592. /*!
  11593. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11594. *
  11595. * Copyright (c) 2014-2017, Jon Schlinkert.
  11596. * Released under the MIT License.
  11597. */
  11598. function isObjectObject(o) {
  11599. return isObject(o) === true
  11600. && Object.prototype.toString.call(o) === '[object Object]';
  11601. }
  11602. function isPlainObject(o) {
  11603. var ctor,prot;
  11604. if (isObjectObject(o) === false) return false;
  11605. // If has modified constructor
  11606. ctor = o.constructor;
  11607. if (typeof ctor !== 'function') return false;
  11608. // If has modified prototype
  11609. prot = ctor.prototype;
  11610. if (isObjectObject(prot) === false) return false;
  11611. // If constructor does not have an Object-specific method
  11612. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11613. return false;
  11614. }
  11615. // Most likely a plain Object
  11616. return true;
  11617. }
  11618. module.exports = isPlainObject;
  11619. /***/ }),
  11620. /***/ 697:
  11621. /***/ (function(module) {
  11622. "use strict";
  11623. module.exports = (promise, onFinally) => {
  11624. onFinally = onFinally || (() => {});
  11625. return promise.then(
  11626. val => new Promise(resolve => {
  11627. resolve(onFinally());
  11628. }).then(() => val),
  11629. err => new Promise(resolve => {
  11630. resolve(onFinally());
  11631. }).then(() => {
  11632. throw err;
  11633. })
  11634. );
  11635. };
  11636. /***/ }),
  11637. /***/ 705:
  11638. /***/ (function(module) {
  11639. 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"}}};
  11640. /***/ }),
  11641. /***/ 722:
  11642. /***/ (function(module) {
  11643. /**
  11644. * Convert array of 16 byte values to UUID string format of the form:
  11645. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11646. */
  11647. var byteToHex = [];
  11648. for (var i = 0; i < 256; ++i) {
  11649. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11650. }
  11651. function bytesToUuid(buf, offset) {
  11652. var i = offset || 0;
  11653. var bth = byteToHex;
  11654. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11655. return ([bth[buf[i++]], bth[buf[i++]],
  11656. bth[buf[i++]], bth[buf[i++]], '-',
  11657. bth[buf[i++]], bth[buf[i++]], '-',
  11658. bth[buf[i++]], bth[buf[i++]], '-',
  11659. bth[buf[i++]], bth[buf[i++]], '-',
  11660. bth[buf[i++]], bth[buf[i++]],
  11661. bth[buf[i++]], bth[buf[i++]],
  11662. bth[buf[i++]], bth[buf[i++]]]).join('');
  11663. }
  11664. module.exports = bytesToUuid;
  11665. /***/ }),
  11666. /***/ 742:
  11667. /***/ (function(module, __unusedexports, __webpack_require__) {
  11668. var fs = __webpack_require__(747)
  11669. var core
  11670. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11671. core = __webpack_require__(818)
  11672. } else {
  11673. core = __webpack_require__(197)
  11674. }
  11675. module.exports = isexe
  11676. isexe.sync = sync
  11677. function isexe (path, options, cb) {
  11678. if (typeof options === 'function') {
  11679. cb = options
  11680. options = {}
  11681. }
  11682. if (!cb) {
  11683. if (typeof Promise !== 'function') {
  11684. throw new TypeError('callback not provided')
  11685. }
  11686. return new Promise(function (resolve, reject) {
  11687. isexe(path, options || {}, function (er, is) {
  11688. if (er) {
  11689. reject(er)
  11690. } else {
  11691. resolve(is)
  11692. }
  11693. })
  11694. })
  11695. }
  11696. core(path, options || {}, function (er, is) {
  11697. // ignore EACCES because that just means we aren't allowed to run it
  11698. if (er) {
  11699. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11700. er = null
  11701. is = false
  11702. }
  11703. }
  11704. cb(er, is)
  11705. })
  11706. }
  11707. function sync (path, options) {
  11708. // my kingdom for a filtered catch
  11709. try {
  11710. return core.sync(path, options || {})
  11711. } catch (er) {
  11712. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11713. return false
  11714. } else {
  11715. throw er
  11716. }
  11717. }
  11718. }
  11719. /***/ }),
  11720. /***/ 747:
  11721. /***/ (function(module) {
  11722. module.exports = require("fs");
  11723. /***/ }),
  11724. /***/ 753:
  11725. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11726. "use strict";
  11727. Object.defineProperty(exports, '__esModule', { value: true });
  11728. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11729. var endpoint = __webpack_require__(385);
  11730. var universalUserAgent = __webpack_require__(796);
  11731. var isPlainObject = _interopDefault(__webpack_require__(696));
  11732. var nodeFetch = _interopDefault(__webpack_require__(454));
  11733. var requestError = __webpack_require__(463);
  11734. const VERSION = "5.3.1";
  11735. function getBufferResponse(response) {
  11736. return response.arrayBuffer();
  11737. }
  11738. function fetchWrapper(requestOptions) {
  11739. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11740. requestOptions.body = JSON.stringify(requestOptions.body);
  11741. }
  11742. let headers = {};
  11743. let status;
  11744. let url;
  11745. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11746. return fetch(requestOptions.url, Object.assign({
  11747. method: requestOptions.method,
  11748. body: requestOptions.body,
  11749. headers: requestOptions.headers,
  11750. redirect: requestOptions.redirect
  11751. }, requestOptions.request)).then(response => {
  11752. url = response.url;
  11753. status = response.status;
  11754. for (const keyAndValue of response.headers) {
  11755. headers[keyAndValue[0]] = keyAndValue[1];
  11756. }
  11757. if (status === 204 || status === 205) {
  11758. return;
  11759. } // GitHub API returns 200 for HEAD requsets
  11760. if (requestOptions.method === "HEAD") {
  11761. if (status < 400) {
  11762. return;
  11763. }
  11764. throw new requestError.RequestError(response.statusText, status, {
  11765. headers,
  11766. request: requestOptions
  11767. });
  11768. }
  11769. if (status === 304) {
  11770. throw new requestError.RequestError("Not modified", status, {
  11771. headers,
  11772. request: requestOptions
  11773. });
  11774. }
  11775. if (status >= 400) {
  11776. return response.text().then(message => {
  11777. const error = new requestError.RequestError(message, status, {
  11778. headers,
  11779. request: requestOptions
  11780. });
  11781. try {
  11782. let responseBody = JSON.parse(error.message);
  11783. Object.assign(error, responseBody);
  11784. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11785. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11786. } catch (e) {// ignore, see octokit/rest.js#684
  11787. }
  11788. throw error;
  11789. });
  11790. }
  11791. const contentType = response.headers.get("content-type");
  11792. if (/application\/json/.test(contentType)) {
  11793. return response.json();
  11794. }
  11795. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11796. return response.text();
  11797. }
  11798. return getBufferResponse(response);
  11799. }).then(data => {
  11800. return {
  11801. status,
  11802. url,
  11803. headers,
  11804. data
  11805. };
  11806. }).catch(error => {
  11807. if (error instanceof requestError.RequestError) {
  11808. throw error;
  11809. }
  11810. throw new requestError.RequestError(error.message, 500, {
  11811. headers,
  11812. request: requestOptions
  11813. });
  11814. });
  11815. }
  11816. function withDefaults(oldEndpoint, newDefaults) {
  11817. const endpoint = oldEndpoint.defaults(newDefaults);
  11818. const newApi = function (route, parameters) {
  11819. const endpointOptions = endpoint.merge(route, parameters);
  11820. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11821. return fetchWrapper(endpoint.parse(endpointOptions));
  11822. }
  11823. const request = (route, parameters) => {
  11824. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11825. };
  11826. Object.assign(request, {
  11827. endpoint,
  11828. defaults: withDefaults.bind(null, endpoint)
  11829. });
  11830. return endpointOptions.request.hook(request, endpointOptions);
  11831. };
  11832. return Object.assign(newApi, {
  11833. endpoint,
  11834. defaults: withDefaults.bind(null, endpoint)
  11835. });
  11836. }
  11837. const request = withDefaults(endpoint.endpoint, {
  11838. headers: {
  11839. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11840. }
  11841. });
  11842. exports.request = request;
  11843. //# sourceMappingURL=index.js.map
  11844. /***/ }),
  11845. /***/ 761:
  11846. /***/ (function(module) {
  11847. module.exports = require("zlib");
  11848. /***/ }),
  11849. /***/ 763:
  11850. /***/ (function(module) {
  11851. module.exports = removeHook
  11852. function removeHook (state, name, method) {
  11853. if (!state.registry[name]) {
  11854. return
  11855. }
  11856. var index = state.registry[name]
  11857. .map(function (registered) { return registered.orig })
  11858. .indexOf(method)
  11859. if (index === -1) {
  11860. return
  11861. }
  11862. state.registry[name].splice(index, 1)
  11863. }
  11864. /***/ }),
  11865. /***/ 768:
  11866. /***/ (function(module) {
  11867. "use strict";
  11868. module.exports = function (x) {
  11869. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11870. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11871. if (x[x.length - 1] === lf) {
  11872. x = x.slice(0, x.length - 1);
  11873. }
  11874. if (x[x.length - 1] === cr) {
  11875. x = x.slice(0, x.length - 1);
  11876. }
  11877. return x;
  11878. };
  11879. /***/ }),
  11880. /***/ 777:
  11881. /***/ (function(module, __unusedexports, __webpack_require__) {
  11882. module.exports = getFirstPage
  11883. const getPage = __webpack_require__(265)
  11884. function getFirstPage (octokit, link, headers) {
  11885. return getPage(octokit, link, 'first', headers)
  11886. }
  11887. /***/ }),
  11888. /***/ 796:
  11889. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11890. "use strict";
  11891. Object.defineProperty(exports, '__esModule', { value: true });
  11892. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11893. var osName = _interopDefault(__webpack_require__(2));
  11894. function getUserAgent() {
  11895. try {
  11896. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  11897. } catch (error) {
  11898. if (/wmic os get Caption/.test(error.message)) {
  11899. return "Windows <version undetectable>";
  11900. }
  11901. throw error;
  11902. }
  11903. }
  11904. exports.getUserAgent = getUserAgent;
  11905. //# sourceMappingURL=index.js.map
  11906. /***/ }),
  11907. /***/ 807:
  11908. /***/ (function(module, __unusedexports, __webpack_require__) {
  11909. module.exports = paginate;
  11910. const iterator = __webpack_require__(8);
  11911. function paginate(octokit, route, options, mapFn) {
  11912. if (typeof options === "function") {
  11913. mapFn = options;
  11914. options = undefined;
  11915. }
  11916. options = octokit.request.endpoint.merge(route, options);
  11917. return gather(
  11918. octokit,
  11919. [],
  11920. iterator(octokit, options)[Symbol.asyncIterator](),
  11921. mapFn
  11922. );
  11923. }
  11924. function gather(octokit, results, iterator, mapFn) {
  11925. return iterator.next().then(result => {
  11926. if (result.done) {
  11927. return results;
  11928. }
  11929. let earlyExit = false;
  11930. function done() {
  11931. earlyExit = true;
  11932. }
  11933. results = results.concat(
  11934. mapFn ? mapFn(result.value, done) : result.value.data
  11935. );
  11936. if (earlyExit) {
  11937. return results;
  11938. }
  11939. return gather(octokit, results, iterator, mapFn);
  11940. });
  11941. }
  11942. /***/ }),
  11943. /***/ 813:
  11944. /***/ (function(__unusedmodule, exports) {
  11945. "use strict";
  11946. Object.defineProperty(exports, '__esModule', { value: true });
  11947. async function auth(token) {
  11948. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  11949. return {
  11950. type: "token",
  11951. token: token,
  11952. tokenType
  11953. };
  11954. }
  11955. /**
  11956. * Prefix token for usage in the Authorization header
  11957. *
  11958. * @param token OAuth token or JSON Web Token
  11959. */
  11960. function withAuthorizationPrefix(token) {
  11961. if (token.split(/\./).length === 3) {
  11962. return `bearer ${token}`;
  11963. }
  11964. return `token ${token}`;
  11965. }
  11966. async function hook(token, request, route, parameters) {
  11967. const endpoint = request.endpoint.merge(route, parameters);
  11968. endpoint.headers.authorization = withAuthorizationPrefix(token);
  11969. return request(endpoint);
  11970. }
  11971. const createTokenAuth = function createTokenAuth(token) {
  11972. if (!token) {
  11973. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  11974. }
  11975. if (typeof token !== "string") {
  11976. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  11977. }
  11978. token = token.replace(/^(token|bearer) +/i, "");
  11979. return Object.assign(auth.bind(null, token), {
  11980. hook: hook.bind(null, token)
  11981. });
  11982. };
  11983. exports.createTokenAuth = createTokenAuth;
  11984. //# sourceMappingURL=index.js.map
  11985. /***/ }),
  11986. /***/ 814:
  11987. /***/ (function(module, __unusedexports, __webpack_require__) {
  11988. module.exports = which
  11989. which.sync = whichSync
  11990. var isWindows = process.platform === 'win32' ||
  11991. process.env.OSTYPE === 'cygwin' ||
  11992. process.env.OSTYPE === 'msys'
  11993. var path = __webpack_require__(622)
  11994. var COLON = isWindows ? ';' : ':'
  11995. var isexe = __webpack_require__(742)
  11996. function getNotFoundError (cmd) {
  11997. var er = new Error('not found: ' + cmd)
  11998. er.code = 'ENOENT'
  11999. return er
  12000. }
  12001. function getPathInfo (cmd, opt) {
  12002. var colon = opt.colon || COLON
  12003. var pathEnv = opt.path || process.env.PATH || ''
  12004. var pathExt = ['']
  12005. pathEnv = pathEnv.split(colon)
  12006. var pathExtExe = ''
  12007. if (isWindows) {
  12008. pathEnv.unshift(process.cwd())
  12009. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  12010. pathExt = pathExtExe.split(colon)
  12011. // Always test the cmd itself first. isexe will check to make sure
  12012. // it's found in the pathExt set.
  12013. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  12014. pathExt.unshift('')
  12015. }
  12016. // If it has a slash, then we don't bother searching the pathenv.
  12017. // just check the file itself, and that's it.
  12018. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12019. pathEnv = ['']
  12020. return {
  12021. env: pathEnv,
  12022. ext: pathExt,
  12023. extExe: pathExtExe
  12024. }
  12025. }
  12026. function which (cmd, opt, cb) {
  12027. if (typeof opt === 'function') {
  12028. cb = opt
  12029. opt = {}
  12030. }
  12031. var info = getPathInfo(cmd, opt)
  12032. var pathEnv = info.env
  12033. var pathExt = info.ext
  12034. var pathExtExe = info.extExe
  12035. var found = []
  12036. ;(function F (i, l) {
  12037. if (i === l) {
  12038. if (opt.all && found.length)
  12039. return cb(null, found)
  12040. else
  12041. return cb(getNotFoundError(cmd))
  12042. }
  12043. var pathPart = pathEnv[i]
  12044. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12045. pathPart = pathPart.slice(1, -1)
  12046. var p = path.join(pathPart, cmd)
  12047. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12048. p = cmd.slice(0, 2) + p
  12049. }
  12050. ;(function E (ii, ll) {
  12051. if (ii === ll) return F(i + 1, l)
  12052. var ext = pathExt[ii]
  12053. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12054. if (!er && is) {
  12055. if (opt.all)
  12056. found.push(p + ext)
  12057. else
  12058. return cb(null, p + ext)
  12059. }
  12060. return E(ii + 1, ll)
  12061. })
  12062. })(0, pathExt.length)
  12063. })(0, pathEnv.length)
  12064. }
  12065. function whichSync (cmd, opt) {
  12066. opt = opt || {}
  12067. var info = getPathInfo(cmd, opt)
  12068. var pathEnv = info.env
  12069. var pathExt = info.ext
  12070. var pathExtExe = info.extExe
  12071. var found = []
  12072. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12073. var pathPart = pathEnv[i]
  12074. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12075. pathPart = pathPart.slice(1, -1)
  12076. var p = path.join(pathPart, cmd)
  12077. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12078. p = cmd.slice(0, 2) + p
  12079. }
  12080. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12081. var cur = p + pathExt[j]
  12082. var is
  12083. try {
  12084. is = isexe.sync(cur, { pathExt: pathExtExe })
  12085. if (is) {
  12086. if (opt.all)
  12087. found.push(cur)
  12088. else
  12089. return cur
  12090. }
  12091. } catch (ex) {}
  12092. }
  12093. }
  12094. if (opt.all && found.length)
  12095. return found
  12096. if (opt.nothrow)
  12097. return null
  12098. throw getNotFoundError(cmd)
  12099. }
  12100. /***/ }),
  12101. /***/ 816:
  12102. /***/ (function(module) {
  12103. "use strict";
  12104. module.exports = /^#!.*/;
  12105. /***/ }),
  12106. /***/ 818:
  12107. /***/ (function(module, __unusedexports, __webpack_require__) {
  12108. module.exports = isexe
  12109. isexe.sync = sync
  12110. var fs = __webpack_require__(747)
  12111. function checkPathExt (path, options) {
  12112. var pathext = options.pathExt !== undefined ?
  12113. options.pathExt : process.env.PATHEXT
  12114. if (!pathext) {
  12115. return true
  12116. }
  12117. pathext = pathext.split(';')
  12118. if (pathext.indexOf('') !== -1) {
  12119. return true
  12120. }
  12121. for (var i = 0; i < pathext.length; i++) {
  12122. var p = pathext[i].toLowerCase()
  12123. if (p && path.substr(-p.length).toLowerCase() === p) {
  12124. return true
  12125. }
  12126. }
  12127. return false
  12128. }
  12129. function checkStat (stat, path, options) {
  12130. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12131. return false
  12132. }
  12133. return checkPathExt(path, options)
  12134. }
  12135. function isexe (path, options, cb) {
  12136. fs.stat(path, function (er, stat) {
  12137. cb(er, er ? false : checkStat(stat, path, options))
  12138. })
  12139. }
  12140. function sync (path, options) {
  12141. return checkStat(fs.statSync(path), path, options)
  12142. }
  12143. /***/ }),
  12144. /***/ 821:
  12145. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12146. "use strict";
  12147. var __importStar = (this && this.__importStar) || function (mod) {
  12148. if (mod && mod.__esModule) return mod;
  12149. var result = {};
  12150. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12151. result["default"] = mod;
  12152. return result;
  12153. };
  12154. Object.defineProperty(exports, "__esModule", { value: true });
  12155. const core = __importStar(__webpack_require__(470));
  12156. const fsHelper = __importStar(__webpack_require__(618));
  12157. const github = __importStar(__webpack_require__(469));
  12158. const path = __importStar(__webpack_require__(622));
  12159. const hostname = 'github.com';
  12160. function getInputs() {
  12161. const result = {};
  12162. // GitHub workspace
  12163. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12164. if (!githubWorkspacePath) {
  12165. throw new Error('GITHUB_WORKSPACE not defined');
  12166. }
  12167. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12168. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12169. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12170. // Qualified repository
  12171. const qualifiedRepository = core.getInput('repository') ||
  12172. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12173. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12174. const splitRepository = qualifiedRepository.split('/');
  12175. if (splitRepository.length !== 2 ||
  12176. !splitRepository[0] ||
  12177. !splitRepository[1]) {
  12178. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12179. }
  12180. result.repositoryOwner = splitRepository[0];
  12181. result.repositoryName = splitRepository[1];
  12182. // Repository path
  12183. result.repositoryPath = core.getInput('path') || '.';
  12184. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12185. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12186. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12187. }
  12188. // Workflow repository?
  12189. result.isWorkflowRepository =
  12190. qualifiedRepository.toUpperCase() ===
  12191. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12192. // Source branch, source version
  12193. result.ref = core.getInput('ref');
  12194. if (!result.ref) {
  12195. if (result.isWorkflowRepository) {
  12196. result.ref = github.context.ref;
  12197. result.commit = github.context.sha;
  12198. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12199. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12200. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12201. result.ref = `refs/heads/${result.ref}`;
  12202. }
  12203. }
  12204. if (!result.ref && !result.commit) {
  12205. result.ref = 'refs/heads/master';
  12206. }
  12207. }
  12208. // SHA?
  12209. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12210. result.commit = result.ref;
  12211. result.ref = '';
  12212. }
  12213. core.debug(`ref = '${result.ref}'`);
  12214. core.debug(`commit = '${result.commit}'`);
  12215. // Clean
  12216. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12217. core.debug(`clean = ${result.clean}`);
  12218. // Fetch depth
  12219. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12220. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12221. result.fetchDepth = 0;
  12222. }
  12223. core.debug(`fetch depth = ${result.fetchDepth}`);
  12224. // LFS
  12225. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12226. core.debug(`lfs = ${result.lfs}`);
  12227. // Submodules
  12228. result.submodules = false;
  12229. result.nestedSubmodules = false;
  12230. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12231. if (submodulesString == 'RECURSIVE') {
  12232. result.submodules = true;
  12233. result.nestedSubmodules = true;
  12234. }
  12235. else if (submodulesString == 'TRUE') {
  12236. result.submodules = true;
  12237. }
  12238. core.debug(`submodules = ${result.submodules}`);
  12239. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12240. // Auth token
  12241. result.authToken = core.getInput('token');
  12242. // SSH
  12243. result.sshKey = core.getInput('ssh-key');
  12244. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12245. result.sshStrict =
  12246. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12247. // Persist credentials
  12248. result.persistCredentials =
  12249. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12250. return result;
  12251. }
  12252. exports.getInputs = getInputs;
  12253. /***/ }),
  12254. /***/ 826:
  12255. /***/ (function(module, __unusedexports, __webpack_require__) {
  12256. var rng = __webpack_require__(139);
  12257. var bytesToUuid = __webpack_require__(722);
  12258. function v4(options, buf, offset) {
  12259. var i = buf && offset || 0;
  12260. if (typeof(options) == 'string') {
  12261. buf = options === 'binary' ? new Array(16) : null;
  12262. options = null;
  12263. }
  12264. options = options || {};
  12265. var rnds = options.random || (options.rng || rng)();
  12266. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12267. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12268. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12269. // Copy bytes to buffer, if provided
  12270. if (buf) {
  12271. for (var ii = 0; ii < 16; ++ii) {
  12272. buf[i + ii] = rnds[ii];
  12273. }
  12274. }
  12275. return buf || bytesToUuid(rnds);
  12276. }
  12277. module.exports = v4;
  12278. /***/ }),
  12279. /***/ 835:
  12280. /***/ (function(module) {
  12281. module.exports = require("url");
  12282. /***/ }),
  12283. /***/ 850:
  12284. /***/ (function(module, __unusedexports, __webpack_require__) {
  12285. module.exports = paginationMethodsPlugin
  12286. function paginationMethodsPlugin (octokit) {
  12287. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  12288. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  12289. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  12290. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  12291. octokit.hasFirstPage = __webpack_require__(536)
  12292. octokit.hasLastPage = __webpack_require__(336)
  12293. octokit.hasNextPage = __webpack_require__(929)
  12294. octokit.hasPreviousPage = __webpack_require__(558)
  12295. }
  12296. /***/ }),
  12297. /***/ 854:
  12298. /***/ (function(module) {
  12299. /**
  12300. * lodash (Custom Build) <https://lodash.com/>
  12301. * Build: `lodash modularize exports="npm" -o ./`
  12302. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12303. * Released under MIT license <https://lodash.com/license>
  12304. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12305. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12306. */
  12307. /** Used as the `TypeError` message for "Functions" methods. */
  12308. var FUNC_ERROR_TEXT = 'Expected a function';
  12309. /** Used to stand-in for `undefined` hash values. */
  12310. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12311. /** Used as references for various `Number` constants. */
  12312. var INFINITY = 1 / 0;
  12313. /** `Object#toString` result references. */
  12314. var funcTag = '[object Function]',
  12315. genTag = '[object GeneratorFunction]',
  12316. symbolTag = '[object Symbol]';
  12317. /** Used to match property names within property paths. */
  12318. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12319. reIsPlainProp = /^\w*$/,
  12320. reLeadingDot = /^\./,
  12321. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12322. /**
  12323. * Used to match `RegExp`
  12324. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12325. */
  12326. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12327. /** Used to match backslashes in property paths. */
  12328. var reEscapeChar = /\\(\\)?/g;
  12329. /** Used to detect host constructors (Safari). */
  12330. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12331. /** Detect free variable `global` from Node.js. */
  12332. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12333. /** Detect free variable `self`. */
  12334. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12335. /** Used as a reference to the global object. */
  12336. var root = freeGlobal || freeSelf || Function('return this')();
  12337. /**
  12338. * Gets the value at `key` of `object`.
  12339. *
  12340. * @private
  12341. * @param {Object} [object] The object to query.
  12342. * @param {string} key The key of the property to get.
  12343. * @returns {*} Returns the property value.
  12344. */
  12345. function getValue(object, key) {
  12346. return object == null ? undefined : object[key];
  12347. }
  12348. /**
  12349. * Checks if `value` is a host object in IE < 9.
  12350. *
  12351. * @private
  12352. * @param {*} value The value to check.
  12353. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12354. */
  12355. function isHostObject(value) {
  12356. // Many host objects are `Object` objects that can coerce to strings
  12357. // despite having improperly defined `toString` methods.
  12358. var result = false;
  12359. if (value != null && typeof value.toString != 'function') {
  12360. try {
  12361. result = !!(value + '');
  12362. } catch (e) {}
  12363. }
  12364. return result;
  12365. }
  12366. /** Used for built-in method references. */
  12367. var arrayProto = Array.prototype,
  12368. funcProto = Function.prototype,
  12369. objectProto = Object.prototype;
  12370. /** Used to detect overreaching core-js shims. */
  12371. var coreJsData = root['__core-js_shared__'];
  12372. /** Used to detect methods masquerading as native. */
  12373. var maskSrcKey = (function() {
  12374. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12375. return uid ? ('Symbol(src)_1.' + uid) : '';
  12376. }());
  12377. /** Used to resolve the decompiled source of functions. */
  12378. var funcToString = funcProto.toString;
  12379. /** Used to check objects for own properties. */
  12380. var hasOwnProperty = objectProto.hasOwnProperty;
  12381. /**
  12382. * Used to resolve the
  12383. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12384. * of values.
  12385. */
  12386. var objectToString = objectProto.toString;
  12387. /** Used to detect if a method is native. */
  12388. var reIsNative = RegExp('^' +
  12389. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12390. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12391. );
  12392. /** Built-in value references. */
  12393. var Symbol = root.Symbol,
  12394. splice = arrayProto.splice;
  12395. /* Built-in method references that are verified to be native. */
  12396. var Map = getNative(root, 'Map'),
  12397. nativeCreate = getNative(Object, 'create');
  12398. /** Used to convert symbols to primitives and strings. */
  12399. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12400. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12401. /**
  12402. * Creates a hash object.
  12403. *
  12404. * @private
  12405. * @constructor
  12406. * @param {Array} [entries] The key-value pairs to cache.
  12407. */
  12408. function Hash(entries) {
  12409. var index = -1,
  12410. length = entries ? entries.length : 0;
  12411. this.clear();
  12412. while (++index < length) {
  12413. var entry = entries[index];
  12414. this.set(entry[0], entry[1]);
  12415. }
  12416. }
  12417. /**
  12418. * Removes all key-value entries from the hash.
  12419. *
  12420. * @private
  12421. * @name clear
  12422. * @memberOf Hash
  12423. */
  12424. function hashClear() {
  12425. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12426. }
  12427. /**
  12428. * Removes `key` and its value from the hash.
  12429. *
  12430. * @private
  12431. * @name delete
  12432. * @memberOf Hash
  12433. * @param {Object} hash The hash to modify.
  12434. * @param {string} key The key of the value to remove.
  12435. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12436. */
  12437. function hashDelete(key) {
  12438. return this.has(key) && delete this.__data__[key];
  12439. }
  12440. /**
  12441. * Gets the hash value for `key`.
  12442. *
  12443. * @private
  12444. * @name get
  12445. * @memberOf Hash
  12446. * @param {string} key The key of the value to get.
  12447. * @returns {*} Returns the entry value.
  12448. */
  12449. function hashGet(key) {
  12450. var data = this.__data__;
  12451. if (nativeCreate) {
  12452. var result = data[key];
  12453. return result === HASH_UNDEFINED ? undefined : result;
  12454. }
  12455. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12456. }
  12457. /**
  12458. * Checks if a hash value for `key` exists.
  12459. *
  12460. * @private
  12461. * @name has
  12462. * @memberOf Hash
  12463. * @param {string} key The key of the entry to check.
  12464. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12465. */
  12466. function hashHas(key) {
  12467. var data = this.__data__;
  12468. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12469. }
  12470. /**
  12471. * Sets the hash `key` to `value`.
  12472. *
  12473. * @private
  12474. * @name set
  12475. * @memberOf Hash
  12476. * @param {string} key The key of the value to set.
  12477. * @param {*} value The value to set.
  12478. * @returns {Object} Returns the hash instance.
  12479. */
  12480. function hashSet(key, value) {
  12481. var data = this.__data__;
  12482. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12483. return this;
  12484. }
  12485. // Add methods to `Hash`.
  12486. Hash.prototype.clear = hashClear;
  12487. Hash.prototype['delete'] = hashDelete;
  12488. Hash.prototype.get = hashGet;
  12489. Hash.prototype.has = hashHas;
  12490. Hash.prototype.set = hashSet;
  12491. /**
  12492. * Creates an list cache object.
  12493. *
  12494. * @private
  12495. * @constructor
  12496. * @param {Array} [entries] The key-value pairs to cache.
  12497. */
  12498. function ListCache(entries) {
  12499. var index = -1,
  12500. length = entries ? entries.length : 0;
  12501. this.clear();
  12502. while (++index < length) {
  12503. var entry = entries[index];
  12504. this.set(entry[0], entry[1]);
  12505. }
  12506. }
  12507. /**
  12508. * Removes all key-value entries from the list cache.
  12509. *
  12510. * @private
  12511. * @name clear
  12512. * @memberOf ListCache
  12513. */
  12514. function listCacheClear() {
  12515. this.__data__ = [];
  12516. }
  12517. /**
  12518. * Removes `key` and its value from the list cache.
  12519. *
  12520. * @private
  12521. * @name delete
  12522. * @memberOf ListCache
  12523. * @param {string} key The key of the value to remove.
  12524. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12525. */
  12526. function listCacheDelete(key) {
  12527. var data = this.__data__,
  12528. index = assocIndexOf(data, key);
  12529. if (index < 0) {
  12530. return false;
  12531. }
  12532. var lastIndex = data.length - 1;
  12533. if (index == lastIndex) {
  12534. data.pop();
  12535. } else {
  12536. splice.call(data, index, 1);
  12537. }
  12538. return true;
  12539. }
  12540. /**
  12541. * Gets the list cache value for `key`.
  12542. *
  12543. * @private
  12544. * @name get
  12545. * @memberOf ListCache
  12546. * @param {string} key The key of the value to get.
  12547. * @returns {*} Returns the entry value.
  12548. */
  12549. function listCacheGet(key) {
  12550. var data = this.__data__,
  12551. index = assocIndexOf(data, key);
  12552. return index < 0 ? undefined : data[index][1];
  12553. }
  12554. /**
  12555. * Checks if a list cache value for `key` exists.
  12556. *
  12557. * @private
  12558. * @name has
  12559. * @memberOf ListCache
  12560. * @param {string} key The key of the entry to check.
  12561. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12562. */
  12563. function listCacheHas(key) {
  12564. return assocIndexOf(this.__data__, key) > -1;
  12565. }
  12566. /**
  12567. * Sets the list cache `key` to `value`.
  12568. *
  12569. * @private
  12570. * @name set
  12571. * @memberOf ListCache
  12572. * @param {string} key The key of the value to set.
  12573. * @param {*} value The value to set.
  12574. * @returns {Object} Returns the list cache instance.
  12575. */
  12576. function listCacheSet(key, value) {
  12577. var data = this.__data__,
  12578. index = assocIndexOf(data, key);
  12579. if (index < 0) {
  12580. data.push([key, value]);
  12581. } else {
  12582. data[index][1] = value;
  12583. }
  12584. return this;
  12585. }
  12586. // Add methods to `ListCache`.
  12587. ListCache.prototype.clear = listCacheClear;
  12588. ListCache.prototype['delete'] = listCacheDelete;
  12589. ListCache.prototype.get = listCacheGet;
  12590. ListCache.prototype.has = listCacheHas;
  12591. ListCache.prototype.set = listCacheSet;
  12592. /**
  12593. * Creates a map cache object to store key-value pairs.
  12594. *
  12595. * @private
  12596. * @constructor
  12597. * @param {Array} [entries] The key-value pairs to cache.
  12598. */
  12599. function MapCache(entries) {
  12600. var index = -1,
  12601. length = entries ? entries.length : 0;
  12602. this.clear();
  12603. while (++index < length) {
  12604. var entry = entries[index];
  12605. this.set(entry[0], entry[1]);
  12606. }
  12607. }
  12608. /**
  12609. * Removes all key-value entries from the map.
  12610. *
  12611. * @private
  12612. * @name clear
  12613. * @memberOf MapCache
  12614. */
  12615. function mapCacheClear() {
  12616. this.__data__ = {
  12617. 'hash': new Hash,
  12618. 'map': new (Map || ListCache),
  12619. 'string': new Hash
  12620. };
  12621. }
  12622. /**
  12623. * Removes `key` and its value from the map.
  12624. *
  12625. * @private
  12626. * @name delete
  12627. * @memberOf MapCache
  12628. * @param {string} key The key of the value to remove.
  12629. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12630. */
  12631. function mapCacheDelete(key) {
  12632. return getMapData(this, key)['delete'](key);
  12633. }
  12634. /**
  12635. * Gets the map value for `key`.
  12636. *
  12637. * @private
  12638. * @name get
  12639. * @memberOf MapCache
  12640. * @param {string} key The key of the value to get.
  12641. * @returns {*} Returns the entry value.
  12642. */
  12643. function mapCacheGet(key) {
  12644. return getMapData(this, key).get(key);
  12645. }
  12646. /**
  12647. * Checks if a map value for `key` exists.
  12648. *
  12649. * @private
  12650. * @name has
  12651. * @memberOf MapCache
  12652. * @param {string} key The key of the entry to check.
  12653. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12654. */
  12655. function mapCacheHas(key) {
  12656. return getMapData(this, key).has(key);
  12657. }
  12658. /**
  12659. * Sets the map `key` to `value`.
  12660. *
  12661. * @private
  12662. * @name set
  12663. * @memberOf MapCache
  12664. * @param {string} key The key of the value to set.
  12665. * @param {*} value The value to set.
  12666. * @returns {Object} Returns the map cache instance.
  12667. */
  12668. function mapCacheSet(key, value) {
  12669. getMapData(this, key).set(key, value);
  12670. return this;
  12671. }
  12672. // Add methods to `MapCache`.
  12673. MapCache.prototype.clear = mapCacheClear;
  12674. MapCache.prototype['delete'] = mapCacheDelete;
  12675. MapCache.prototype.get = mapCacheGet;
  12676. MapCache.prototype.has = mapCacheHas;
  12677. MapCache.prototype.set = mapCacheSet;
  12678. /**
  12679. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12680. *
  12681. * @private
  12682. * @param {Array} array The array to inspect.
  12683. * @param {*} key The key to search for.
  12684. * @returns {number} Returns the index of the matched value, else `-1`.
  12685. */
  12686. function assocIndexOf(array, key) {
  12687. var length = array.length;
  12688. while (length--) {
  12689. if (eq(array[length][0], key)) {
  12690. return length;
  12691. }
  12692. }
  12693. return -1;
  12694. }
  12695. /**
  12696. * The base implementation of `_.get` without support for default values.
  12697. *
  12698. * @private
  12699. * @param {Object} object The object to query.
  12700. * @param {Array|string} path The path of the property to get.
  12701. * @returns {*} Returns the resolved value.
  12702. */
  12703. function baseGet(object, path) {
  12704. path = isKey(path, object) ? [path] : castPath(path);
  12705. var index = 0,
  12706. length = path.length;
  12707. while (object != null && index < length) {
  12708. object = object[toKey(path[index++])];
  12709. }
  12710. return (index && index == length) ? object : undefined;
  12711. }
  12712. /**
  12713. * The base implementation of `_.isNative` without bad shim checks.
  12714. *
  12715. * @private
  12716. * @param {*} value The value to check.
  12717. * @returns {boolean} Returns `true` if `value` is a native function,
  12718. * else `false`.
  12719. */
  12720. function baseIsNative(value) {
  12721. if (!isObject(value) || isMasked(value)) {
  12722. return false;
  12723. }
  12724. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12725. return pattern.test(toSource(value));
  12726. }
  12727. /**
  12728. * The base implementation of `_.toString` which doesn't convert nullish
  12729. * values to empty strings.
  12730. *
  12731. * @private
  12732. * @param {*} value The value to process.
  12733. * @returns {string} Returns the string.
  12734. */
  12735. function baseToString(value) {
  12736. // Exit early for strings to avoid a performance hit in some environments.
  12737. if (typeof value == 'string') {
  12738. return value;
  12739. }
  12740. if (isSymbol(value)) {
  12741. return symbolToString ? symbolToString.call(value) : '';
  12742. }
  12743. var result = (value + '');
  12744. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12745. }
  12746. /**
  12747. * Casts `value` to a path array if it's not one.
  12748. *
  12749. * @private
  12750. * @param {*} value The value to inspect.
  12751. * @returns {Array} Returns the cast property path array.
  12752. */
  12753. function castPath(value) {
  12754. return isArray(value) ? value : stringToPath(value);
  12755. }
  12756. /**
  12757. * Gets the data for `map`.
  12758. *
  12759. * @private
  12760. * @param {Object} map The map to query.
  12761. * @param {string} key The reference key.
  12762. * @returns {*} Returns the map data.
  12763. */
  12764. function getMapData(map, key) {
  12765. var data = map.__data__;
  12766. return isKeyable(key)
  12767. ? data[typeof key == 'string' ? 'string' : 'hash']
  12768. : data.map;
  12769. }
  12770. /**
  12771. * Gets the native function at `key` of `object`.
  12772. *
  12773. * @private
  12774. * @param {Object} object The object to query.
  12775. * @param {string} key The key of the method to get.
  12776. * @returns {*} Returns the function if it's native, else `undefined`.
  12777. */
  12778. function getNative(object, key) {
  12779. var value = getValue(object, key);
  12780. return baseIsNative(value) ? value : undefined;
  12781. }
  12782. /**
  12783. * Checks if `value` is a property name and not a property path.
  12784. *
  12785. * @private
  12786. * @param {*} value The value to check.
  12787. * @param {Object} [object] The object to query keys on.
  12788. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12789. */
  12790. function isKey(value, object) {
  12791. if (isArray(value)) {
  12792. return false;
  12793. }
  12794. var type = typeof value;
  12795. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12796. value == null || isSymbol(value)) {
  12797. return true;
  12798. }
  12799. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12800. (object != null && value in Object(object));
  12801. }
  12802. /**
  12803. * Checks if `value` is suitable for use as unique object key.
  12804. *
  12805. * @private
  12806. * @param {*} value The value to check.
  12807. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12808. */
  12809. function isKeyable(value) {
  12810. var type = typeof value;
  12811. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12812. ? (value !== '__proto__')
  12813. : (value === null);
  12814. }
  12815. /**
  12816. * Checks if `func` has its source masked.
  12817. *
  12818. * @private
  12819. * @param {Function} func The function to check.
  12820. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12821. */
  12822. function isMasked(func) {
  12823. return !!maskSrcKey && (maskSrcKey in func);
  12824. }
  12825. /**
  12826. * Converts `string` to a property path array.
  12827. *
  12828. * @private
  12829. * @param {string} string The string to convert.
  12830. * @returns {Array} Returns the property path array.
  12831. */
  12832. var stringToPath = memoize(function(string) {
  12833. string = toString(string);
  12834. var result = [];
  12835. if (reLeadingDot.test(string)) {
  12836. result.push('');
  12837. }
  12838. string.replace(rePropName, function(match, number, quote, string) {
  12839. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  12840. });
  12841. return result;
  12842. });
  12843. /**
  12844. * Converts `value` to a string key if it's not a string or symbol.
  12845. *
  12846. * @private
  12847. * @param {*} value The value to inspect.
  12848. * @returns {string|symbol} Returns the key.
  12849. */
  12850. function toKey(value) {
  12851. if (typeof value == 'string' || isSymbol(value)) {
  12852. return value;
  12853. }
  12854. var result = (value + '');
  12855. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12856. }
  12857. /**
  12858. * Converts `func` to its source code.
  12859. *
  12860. * @private
  12861. * @param {Function} func The function to process.
  12862. * @returns {string} Returns the source code.
  12863. */
  12864. function toSource(func) {
  12865. if (func != null) {
  12866. try {
  12867. return funcToString.call(func);
  12868. } catch (e) {}
  12869. try {
  12870. return (func + '');
  12871. } catch (e) {}
  12872. }
  12873. return '';
  12874. }
  12875. /**
  12876. * Creates a function that memoizes the result of `func`. If `resolver` is
  12877. * provided, it determines the cache key for storing the result based on the
  12878. * arguments provided to the memoized function. By default, the first argument
  12879. * provided to the memoized function is used as the map cache key. The `func`
  12880. * is invoked with the `this` binding of the memoized function.
  12881. *
  12882. * **Note:** The cache is exposed as the `cache` property on the memoized
  12883. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  12884. * constructor with one whose instances implement the
  12885. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  12886. * method interface of `delete`, `get`, `has`, and `set`.
  12887. *
  12888. * @static
  12889. * @memberOf _
  12890. * @since 0.1.0
  12891. * @category Function
  12892. * @param {Function} func The function to have its output memoized.
  12893. * @param {Function} [resolver] The function to resolve the cache key.
  12894. * @returns {Function} Returns the new memoized function.
  12895. * @example
  12896. *
  12897. * var object = { 'a': 1, 'b': 2 };
  12898. * var other = { 'c': 3, 'd': 4 };
  12899. *
  12900. * var values = _.memoize(_.values);
  12901. * values(object);
  12902. * // => [1, 2]
  12903. *
  12904. * values(other);
  12905. * // => [3, 4]
  12906. *
  12907. * object.a = 2;
  12908. * values(object);
  12909. * // => [1, 2]
  12910. *
  12911. * // Modify the result cache.
  12912. * values.cache.set(object, ['a', 'b']);
  12913. * values(object);
  12914. * // => ['a', 'b']
  12915. *
  12916. * // Replace `_.memoize.Cache`.
  12917. * _.memoize.Cache = WeakMap;
  12918. */
  12919. function memoize(func, resolver) {
  12920. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  12921. throw new TypeError(FUNC_ERROR_TEXT);
  12922. }
  12923. var memoized = function() {
  12924. var args = arguments,
  12925. key = resolver ? resolver.apply(this, args) : args[0],
  12926. cache = memoized.cache;
  12927. if (cache.has(key)) {
  12928. return cache.get(key);
  12929. }
  12930. var result = func.apply(this, args);
  12931. memoized.cache = cache.set(key, result);
  12932. return result;
  12933. };
  12934. memoized.cache = new (memoize.Cache || MapCache);
  12935. return memoized;
  12936. }
  12937. // Assign cache to `_.memoize`.
  12938. memoize.Cache = MapCache;
  12939. /**
  12940. * Performs a
  12941. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12942. * comparison between two values to determine if they are equivalent.
  12943. *
  12944. * @static
  12945. * @memberOf _
  12946. * @since 4.0.0
  12947. * @category Lang
  12948. * @param {*} value The value to compare.
  12949. * @param {*} other The other value to compare.
  12950. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12951. * @example
  12952. *
  12953. * var object = { 'a': 1 };
  12954. * var other = { 'a': 1 };
  12955. *
  12956. * _.eq(object, object);
  12957. * // => true
  12958. *
  12959. * _.eq(object, other);
  12960. * // => false
  12961. *
  12962. * _.eq('a', 'a');
  12963. * // => true
  12964. *
  12965. * _.eq('a', Object('a'));
  12966. * // => false
  12967. *
  12968. * _.eq(NaN, NaN);
  12969. * // => true
  12970. */
  12971. function eq(value, other) {
  12972. return value === other || (value !== value && other !== other);
  12973. }
  12974. /**
  12975. * Checks if `value` is classified as an `Array` object.
  12976. *
  12977. * @static
  12978. * @memberOf _
  12979. * @since 0.1.0
  12980. * @category Lang
  12981. * @param {*} value The value to check.
  12982. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12983. * @example
  12984. *
  12985. * _.isArray([1, 2, 3]);
  12986. * // => true
  12987. *
  12988. * _.isArray(document.body.children);
  12989. * // => false
  12990. *
  12991. * _.isArray('abc');
  12992. * // => false
  12993. *
  12994. * _.isArray(_.noop);
  12995. * // => false
  12996. */
  12997. var isArray = Array.isArray;
  12998. /**
  12999. * Checks if `value` is classified as a `Function` object.
  13000. *
  13001. * @static
  13002. * @memberOf _
  13003. * @since 0.1.0
  13004. * @category Lang
  13005. * @param {*} value The value to check.
  13006. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  13007. * @example
  13008. *
  13009. * _.isFunction(_);
  13010. * // => true
  13011. *
  13012. * _.isFunction(/abc/);
  13013. * // => false
  13014. */
  13015. function isFunction(value) {
  13016. // The use of `Object#toString` avoids issues with the `typeof` operator
  13017. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  13018. var tag = isObject(value) ? objectToString.call(value) : '';
  13019. return tag == funcTag || tag == genTag;
  13020. }
  13021. /**
  13022. * Checks if `value` is the
  13023. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  13024. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  13025. *
  13026. * @static
  13027. * @memberOf _
  13028. * @since 0.1.0
  13029. * @category Lang
  13030. * @param {*} value The value to check.
  13031. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  13032. * @example
  13033. *
  13034. * _.isObject({});
  13035. * // => true
  13036. *
  13037. * _.isObject([1, 2, 3]);
  13038. * // => true
  13039. *
  13040. * _.isObject(_.noop);
  13041. * // => true
  13042. *
  13043. * _.isObject(null);
  13044. * // => false
  13045. */
  13046. function isObject(value) {
  13047. var type = typeof value;
  13048. return !!value && (type == 'object' || type == 'function');
  13049. }
  13050. /**
  13051. * Checks if `value` is object-like. A value is object-like if it's not `null`
  13052. * and has a `typeof` result of "object".
  13053. *
  13054. * @static
  13055. * @memberOf _
  13056. * @since 4.0.0
  13057. * @category Lang
  13058. * @param {*} value The value to check.
  13059. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  13060. * @example
  13061. *
  13062. * _.isObjectLike({});
  13063. * // => true
  13064. *
  13065. * _.isObjectLike([1, 2, 3]);
  13066. * // => true
  13067. *
  13068. * _.isObjectLike(_.noop);
  13069. * // => false
  13070. *
  13071. * _.isObjectLike(null);
  13072. * // => false
  13073. */
  13074. function isObjectLike(value) {
  13075. return !!value && typeof value == 'object';
  13076. }
  13077. /**
  13078. * Checks if `value` is classified as a `Symbol` primitive or object.
  13079. *
  13080. * @static
  13081. * @memberOf _
  13082. * @since 4.0.0
  13083. * @category Lang
  13084. * @param {*} value The value to check.
  13085. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13086. * @example
  13087. *
  13088. * _.isSymbol(Symbol.iterator);
  13089. * // => true
  13090. *
  13091. * _.isSymbol('abc');
  13092. * // => false
  13093. */
  13094. function isSymbol(value) {
  13095. return typeof value == 'symbol' ||
  13096. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13097. }
  13098. /**
  13099. * Converts `value` to a string. An empty string is returned for `null`
  13100. * and `undefined` values. The sign of `-0` is preserved.
  13101. *
  13102. * @static
  13103. * @memberOf _
  13104. * @since 4.0.0
  13105. * @category Lang
  13106. * @param {*} value The value to process.
  13107. * @returns {string} Returns the string.
  13108. * @example
  13109. *
  13110. * _.toString(null);
  13111. * // => ''
  13112. *
  13113. * _.toString(-0);
  13114. * // => '-0'
  13115. *
  13116. * _.toString([1, 2, 3]);
  13117. * // => '1,2,3'
  13118. */
  13119. function toString(value) {
  13120. return value == null ? '' : baseToString(value);
  13121. }
  13122. /**
  13123. * Gets the value at `path` of `object`. If the resolved value is
  13124. * `undefined`, the `defaultValue` is returned in its place.
  13125. *
  13126. * @static
  13127. * @memberOf _
  13128. * @since 3.7.0
  13129. * @category Object
  13130. * @param {Object} object The object to query.
  13131. * @param {Array|string} path The path of the property to get.
  13132. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13133. * @returns {*} Returns the resolved value.
  13134. * @example
  13135. *
  13136. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13137. *
  13138. * _.get(object, 'a[0].b.c');
  13139. * // => 3
  13140. *
  13141. * _.get(object, ['a', '0', 'b', 'c']);
  13142. * // => 3
  13143. *
  13144. * _.get(object, 'a.b.c', 'default');
  13145. * // => 'default'
  13146. */
  13147. function get(object, path, defaultValue) {
  13148. var result = object == null ? undefined : baseGet(object, path);
  13149. return result === undefined ? defaultValue : result;
  13150. }
  13151. module.exports = get;
  13152. /***/ }),
  13153. /***/ 855:
  13154. /***/ (function(module, __unusedexports, __webpack_require__) {
  13155. module.exports = registerPlugin;
  13156. const factory = __webpack_require__(47);
  13157. function registerPlugin(plugins, pluginFunction) {
  13158. return factory(
  13159. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  13160. );
  13161. }
  13162. /***/ }),
  13163. /***/ 856:
  13164. /***/ (function(module, __unusedexports, __webpack_require__) {
  13165. module.exports = __webpack_require__(141);
  13166. /***/ }),
  13167. /***/ 863:
  13168. /***/ (function(module, __unusedexports, __webpack_require__) {
  13169. module.exports = authenticationBeforeRequest;
  13170. const btoa = __webpack_require__(675);
  13171. const withAuthorizationPrefix = __webpack_require__(143);
  13172. function authenticationBeforeRequest(state, options) {
  13173. if (typeof state.auth === "string") {
  13174. options.headers.authorization = withAuthorizationPrefix(state.auth);
  13175. return;
  13176. }
  13177. if (state.auth.username) {
  13178. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  13179. options.headers.authorization = `Basic ${hash}`;
  13180. if (state.otp) {
  13181. options.headers["x-github-otp"] = state.otp;
  13182. }
  13183. return;
  13184. }
  13185. if (state.auth.clientId) {
  13186. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  13187. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  13188. // URL though: `/applications/:client_id/tokens/:access_token`.
  13189. //
  13190. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  13191. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  13192. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  13193. //
  13194. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  13195. // as well as "/applications/123/tokens/token456"
  13196. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  13197. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  13198. options.headers.authorization = `Basic ${hash}`;
  13199. return;
  13200. }
  13201. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  13202. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  13203. return;
  13204. }
  13205. return Promise.resolve()
  13206. .then(() => {
  13207. return state.auth();
  13208. })
  13209. .then(authorization => {
  13210. options.headers.authorization = withAuthorizationPrefix(authorization);
  13211. });
  13212. }
  13213. /***/ }),
  13214. /***/ 866:
  13215. /***/ (function(module, __unusedexports, __webpack_require__) {
  13216. "use strict";
  13217. var shebangRegex = __webpack_require__(816);
  13218. module.exports = function (str) {
  13219. var match = str.match(shebangRegex);
  13220. if (!match) {
  13221. return null;
  13222. }
  13223. var arr = match[0].replace(/#! ?/, '').split(' ');
  13224. var bin = arr[0].split('/').pop();
  13225. var arg = arr[1];
  13226. return (bin === 'env' ?
  13227. arg :
  13228. bin + (arg ? ' ' + arg : '')
  13229. );
  13230. };
  13231. /***/ }),
  13232. /***/ 874:
  13233. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13234. "use strict";
  13235. // Copyright (c) Microsoft. All rights reserved.
  13236. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  13237. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13238. return new (P || (P = Promise))(function (resolve, reject) {
  13239. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13240. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13241. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  13242. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13243. });
  13244. };
  13245. Object.defineProperty(exports, "__esModule", { value: true });
  13246. const url = __webpack_require__(835);
  13247. const http = __webpack_require__(605);
  13248. const https = __webpack_require__(211);
  13249. let fs;
  13250. let tunnel;
  13251. var HttpCodes;
  13252. (function (HttpCodes) {
  13253. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  13254. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  13255. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  13256. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  13257. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  13258. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  13259. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  13260. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  13261. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  13262. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  13263. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  13264. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  13265. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  13266. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  13267. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  13268. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  13269. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  13270. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  13271. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  13272. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  13273. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  13274. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  13275. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  13276. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  13277. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  13278. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  13279. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  13280. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  13281. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  13282. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  13283. const ExponentialBackoffCeiling = 10;
  13284. const ExponentialBackoffTimeSlice = 5;
  13285. class HttpClientResponse {
  13286. constructor(message) {
  13287. this.message = message;
  13288. }
  13289. readBody() {
  13290. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  13291. let output = '';
  13292. this.message.on('data', (chunk) => {
  13293. output += chunk;
  13294. });
  13295. this.message.on('end', () => {
  13296. resolve(output);
  13297. });
  13298. }));
  13299. }
  13300. }
  13301. exports.HttpClientResponse = HttpClientResponse;
  13302. function isHttps(requestUrl) {
  13303. let parsedUrl = url.parse(requestUrl);
  13304. return parsedUrl.protocol === 'https:';
  13305. }
  13306. exports.isHttps = isHttps;
  13307. var EnvironmentVariables;
  13308. (function (EnvironmentVariables) {
  13309. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  13310. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  13311. })(EnvironmentVariables || (EnvironmentVariables = {}));
  13312. class HttpClient {
  13313. constructor(userAgent, handlers, requestOptions) {
  13314. this._ignoreSslError = false;
  13315. this._allowRedirects = true;
  13316. this._maxRedirects = 50;
  13317. this._allowRetries = false;
  13318. this._maxRetries = 1;
  13319. this._keepAlive = false;
  13320. this._disposed = false;
  13321. this.userAgent = userAgent;
  13322. this.handlers = handlers || [];
  13323. this.requestOptions = requestOptions;
  13324. if (requestOptions) {
  13325. if (requestOptions.ignoreSslError != null) {
  13326. this._ignoreSslError = requestOptions.ignoreSslError;
  13327. }
  13328. this._socketTimeout = requestOptions.socketTimeout;
  13329. this._httpProxy = requestOptions.proxy;
  13330. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  13331. this._httpProxyBypassHosts = [];
  13332. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  13333. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  13334. });
  13335. }
  13336. this._certConfig = requestOptions.cert;
  13337. if (this._certConfig) {
  13338. // If using cert, need fs
  13339. fs = __webpack_require__(747);
  13340. // cache the cert content into memory, so we don't have to read it from disk every time
  13341. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  13342. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  13343. }
  13344. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  13345. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  13346. }
  13347. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  13348. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  13349. }
  13350. }
  13351. if (requestOptions.allowRedirects != null) {
  13352. this._allowRedirects = requestOptions.allowRedirects;
  13353. }
  13354. if (requestOptions.maxRedirects != null) {
  13355. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  13356. }
  13357. if (requestOptions.keepAlive != null) {
  13358. this._keepAlive = requestOptions.keepAlive;
  13359. }
  13360. if (requestOptions.allowRetries != null) {
  13361. this._allowRetries = requestOptions.allowRetries;
  13362. }
  13363. if (requestOptions.maxRetries != null) {
  13364. this._maxRetries = requestOptions.maxRetries;
  13365. }
  13366. }
  13367. }
  13368. options(requestUrl, additionalHeaders) {
  13369. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  13370. }
  13371. get(requestUrl, additionalHeaders) {
  13372. return this.request('GET', requestUrl, null, additionalHeaders || {});
  13373. }
  13374. del(requestUrl, additionalHeaders) {
  13375. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  13376. }
  13377. post(requestUrl, data, additionalHeaders) {
  13378. return this.request('POST', requestUrl, data, additionalHeaders || {});
  13379. }
  13380. patch(requestUrl, data, additionalHeaders) {
  13381. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  13382. }
  13383. put(requestUrl, data, additionalHeaders) {
  13384. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  13385. }
  13386. head(requestUrl, additionalHeaders) {
  13387. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  13388. }
  13389. sendStream(verb, requestUrl, stream, additionalHeaders) {
  13390. return this.request(verb, requestUrl, stream, additionalHeaders);
  13391. }
  13392. /**
  13393. * Makes a raw http request.
  13394. * All other methods such as get, post, patch, and request ultimately call this.
  13395. * Prefer get, del, post and patch
  13396. */
  13397. request(verb, requestUrl, data, headers) {
  13398. return __awaiter(this, void 0, void 0, function* () {
  13399. if (this._disposed) {
  13400. throw new Error("Client has already been disposed.");
  13401. }
  13402. let info = this._prepareRequest(verb, requestUrl, headers);
  13403. // Only perform retries on reads since writes may not be idempotent.
  13404. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  13405. let numTries = 0;
  13406. let response;
  13407. while (numTries < maxTries) {
  13408. response = yield this.requestRaw(info, data);
  13409. // Check if it's an authentication challenge
  13410. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  13411. let authenticationHandler;
  13412. for (let i = 0; i < this.handlers.length; i++) {
  13413. if (this.handlers[i].canHandleAuthentication(response)) {
  13414. authenticationHandler = this.handlers[i];
  13415. break;
  13416. }
  13417. }
  13418. if (authenticationHandler) {
  13419. return authenticationHandler.handleAuthentication(this, info, data);
  13420. }
  13421. else {
  13422. // We have received an unauthorized response but have no handlers to handle it.
  13423. // Let the response return to the caller.
  13424. return response;
  13425. }
  13426. }
  13427. let redirectsRemaining = this._maxRedirects;
  13428. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  13429. && this._allowRedirects
  13430. && redirectsRemaining > 0) {
  13431. const redirectUrl = response.message.headers["location"];
  13432. if (!redirectUrl) {
  13433. // if there's no location to redirect to, we won't
  13434. break;
  13435. }
  13436. // we need to finish reading the response before reassigning response
  13437. // which will leak the open socket.
  13438. yield response.readBody();
  13439. // let's make the request with the new redirectUrl
  13440. info = this._prepareRequest(verb, redirectUrl, headers);
  13441. response = yield this.requestRaw(info, data);
  13442. redirectsRemaining--;
  13443. }
  13444. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  13445. // If not a retry code, return immediately instead of retrying
  13446. return response;
  13447. }
  13448. numTries += 1;
  13449. if (numTries < maxTries) {
  13450. yield response.readBody();
  13451. yield this._performExponentialBackoff(numTries);
  13452. }
  13453. }
  13454. return response;
  13455. });
  13456. }
  13457. /**
  13458. * Needs to be called if keepAlive is set to true in request options.
  13459. */
  13460. dispose() {
  13461. if (this._agent) {
  13462. this._agent.destroy();
  13463. }
  13464. this._disposed = true;
  13465. }
  13466. /**
  13467. * Raw request.
  13468. * @param info
  13469. * @param data
  13470. */
  13471. requestRaw(info, data) {
  13472. return new Promise((resolve, reject) => {
  13473. let callbackForResult = function (err, res) {
  13474. if (err) {
  13475. reject(err);
  13476. }
  13477. resolve(res);
  13478. };
  13479. this.requestRawWithCallback(info, data, callbackForResult);
  13480. });
  13481. }
  13482. /**
  13483. * Raw request with callback.
  13484. * @param info
  13485. * @param data
  13486. * @param onResult
  13487. */
  13488. requestRawWithCallback(info, data, onResult) {
  13489. let socket;
  13490. let isDataString = typeof (data) === 'string';
  13491. if (typeof (data) === 'string') {
  13492. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13493. }
  13494. let callbackCalled = false;
  13495. let handleResult = (err, res) => {
  13496. if (!callbackCalled) {
  13497. callbackCalled = true;
  13498. onResult(err, res);
  13499. }
  13500. };
  13501. let req = info.httpModule.request(info.options, (msg) => {
  13502. let res = new HttpClientResponse(msg);
  13503. handleResult(null, res);
  13504. });
  13505. req.on('socket', (sock) => {
  13506. socket = sock;
  13507. });
  13508. // If we ever get disconnected, we want the socket to timeout eventually
  13509. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13510. if (socket) {
  13511. socket.end();
  13512. }
  13513. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13514. });
  13515. req.on('error', function (err) {
  13516. // err has statusCode property
  13517. // res should have headers
  13518. handleResult(err, null);
  13519. });
  13520. if (data && typeof (data) === 'string') {
  13521. req.write(data, 'utf8');
  13522. }
  13523. if (data && typeof (data) !== 'string') {
  13524. data.on('close', function () {
  13525. req.end();
  13526. });
  13527. data.pipe(req);
  13528. }
  13529. else {
  13530. req.end();
  13531. }
  13532. }
  13533. _prepareRequest(method, requestUrl, headers) {
  13534. const info = {};
  13535. info.parsedUrl = url.parse(requestUrl);
  13536. const usingSsl = info.parsedUrl.protocol === 'https:';
  13537. info.httpModule = usingSsl ? https : http;
  13538. const defaultPort = usingSsl ? 443 : 80;
  13539. info.options = {};
  13540. info.options.host = info.parsedUrl.hostname;
  13541. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13542. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13543. info.options.method = method;
  13544. info.options.headers = this._mergeHeaders(headers);
  13545. info.options.headers["user-agent"] = this.userAgent;
  13546. info.options.agent = this._getAgent(requestUrl);
  13547. // gives handlers an opportunity to participate
  13548. if (this.handlers && !this._isPresigned(requestUrl)) {
  13549. this.handlers.forEach((handler) => {
  13550. handler.prepareRequest(info.options);
  13551. });
  13552. }
  13553. return info;
  13554. }
  13555. _isPresigned(requestUrl) {
  13556. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13557. const patterns = this.requestOptions.presignedUrlPatterns;
  13558. for (let i = 0; i < patterns.length; i++) {
  13559. if (requestUrl.match(patterns[i])) {
  13560. return true;
  13561. }
  13562. }
  13563. }
  13564. return false;
  13565. }
  13566. _mergeHeaders(headers) {
  13567. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13568. if (this.requestOptions && this.requestOptions.headers) {
  13569. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13570. }
  13571. return lowercaseKeys(headers || {});
  13572. }
  13573. _getAgent(requestUrl) {
  13574. let agent;
  13575. let proxy = this._getProxy(requestUrl);
  13576. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13577. if (this._keepAlive && useProxy) {
  13578. agent = this._proxyAgent;
  13579. }
  13580. if (this._keepAlive && !useProxy) {
  13581. agent = this._agent;
  13582. }
  13583. // if agent is already assigned use that agent.
  13584. if (!!agent) {
  13585. return agent;
  13586. }
  13587. let parsedUrl = url.parse(requestUrl);
  13588. const usingSsl = parsedUrl.protocol === 'https:';
  13589. let maxSockets = 100;
  13590. if (!!this.requestOptions) {
  13591. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13592. }
  13593. if (useProxy) {
  13594. // If using proxy, need tunnel
  13595. if (!tunnel) {
  13596. tunnel = __webpack_require__(856);
  13597. }
  13598. const agentOptions = {
  13599. maxSockets: maxSockets,
  13600. keepAlive: this._keepAlive,
  13601. proxy: {
  13602. proxyAuth: proxy.proxyAuth,
  13603. host: proxy.proxyUrl.hostname,
  13604. port: proxy.proxyUrl.port
  13605. },
  13606. };
  13607. let tunnelAgent;
  13608. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13609. if (usingSsl) {
  13610. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13611. }
  13612. else {
  13613. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13614. }
  13615. agent = tunnelAgent(agentOptions);
  13616. this._proxyAgent = agent;
  13617. }
  13618. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13619. if (this._keepAlive && !agent) {
  13620. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13621. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13622. this._agent = agent;
  13623. }
  13624. // if not using private agent and tunnel agent isn't setup then use global agent
  13625. if (!agent) {
  13626. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13627. }
  13628. if (usingSsl && this._ignoreSslError) {
  13629. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13630. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13631. // we have to cast it to any and change it directly
  13632. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13633. }
  13634. if (usingSsl && this._certConfig) {
  13635. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13636. }
  13637. return agent;
  13638. }
  13639. _getProxy(requestUrl) {
  13640. const parsedUrl = url.parse(requestUrl);
  13641. let usingSsl = parsedUrl.protocol === 'https:';
  13642. let proxyConfig = this._httpProxy;
  13643. // fallback to http_proxy and https_proxy env
  13644. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13645. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13646. if (!proxyConfig) {
  13647. if (https_proxy && usingSsl) {
  13648. proxyConfig = {
  13649. proxyUrl: https_proxy
  13650. };
  13651. }
  13652. else if (http_proxy) {
  13653. proxyConfig = {
  13654. proxyUrl: http_proxy
  13655. };
  13656. }
  13657. }
  13658. let proxyUrl;
  13659. let proxyAuth;
  13660. if (proxyConfig) {
  13661. if (proxyConfig.proxyUrl.length > 0) {
  13662. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13663. }
  13664. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13665. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13666. }
  13667. }
  13668. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13669. }
  13670. _isBypassProxy(requestUrl) {
  13671. if (!this._httpProxyBypassHosts) {
  13672. return false;
  13673. }
  13674. let bypass = false;
  13675. this._httpProxyBypassHosts.forEach(bypassHost => {
  13676. if (bypassHost.test(requestUrl)) {
  13677. bypass = true;
  13678. }
  13679. });
  13680. return bypass;
  13681. }
  13682. _performExponentialBackoff(retryNumber) {
  13683. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13684. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13685. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13686. }
  13687. }
  13688. exports.HttpClient = HttpClient;
  13689. /***/ }),
  13690. /***/ 881:
  13691. /***/ (function(module) {
  13692. "use strict";
  13693. const isWin = process.platform === 'win32';
  13694. function notFoundError(original, syscall) {
  13695. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13696. code: 'ENOENT',
  13697. errno: 'ENOENT',
  13698. syscall: `${syscall} ${original.command}`,
  13699. path: original.command,
  13700. spawnargs: original.args,
  13701. });
  13702. }
  13703. function hookChildProcess(cp, parsed) {
  13704. if (!isWin) {
  13705. return;
  13706. }
  13707. const originalEmit = cp.emit;
  13708. cp.emit = function (name, arg1) {
  13709. // If emitting "exit" event and exit code is 1, we need to check if
  13710. // the command exists and emit an "error" instead
  13711. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13712. if (name === 'exit') {
  13713. const err = verifyENOENT(arg1, parsed, 'spawn');
  13714. if (err) {
  13715. return originalEmit.call(cp, 'error', err);
  13716. }
  13717. }
  13718. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13719. };
  13720. }
  13721. function verifyENOENT(status, parsed) {
  13722. if (isWin && status === 1 && !parsed.file) {
  13723. return notFoundError(parsed.original, 'spawn');
  13724. }
  13725. return null;
  13726. }
  13727. function verifyENOENTSync(status, parsed) {
  13728. if (isWin && status === 1 && !parsed.file) {
  13729. return notFoundError(parsed.original, 'spawnSync');
  13730. }
  13731. return null;
  13732. }
  13733. module.exports = {
  13734. hookChildProcess,
  13735. verifyENOENT,
  13736. verifyENOENTSync,
  13737. notFoundError,
  13738. };
  13739. /***/ }),
  13740. /***/ 883:
  13741. /***/ (function(module) {
  13742. /**
  13743. * lodash (Custom Build) <https://lodash.com/>
  13744. * Build: `lodash modularize exports="npm" -o ./`
  13745. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13746. * Released under MIT license <https://lodash.com/license>
  13747. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13748. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13749. */
  13750. /** Used as the `TypeError` message for "Functions" methods. */
  13751. var FUNC_ERROR_TEXT = 'Expected a function';
  13752. /** Used to stand-in for `undefined` hash values. */
  13753. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13754. /** Used as references for various `Number` constants. */
  13755. var INFINITY = 1 / 0,
  13756. MAX_SAFE_INTEGER = 9007199254740991;
  13757. /** `Object#toString` result references. */
  13758. var funcTag = '[object Function]',
  13759. genTag = '[object GeneratorFunction]',
  13760. symbolTag = '[object Symbol]';
  13761. /** Used to match property names within property paths. */
  13762. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13763. reIsPlainProp = /^\w*$/,
  13764. reLeadingDot = /^\./,
  13765. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13766. /**
  13767. * Used to match `RegExp`
  13768. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13769. */
  13770. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13771. /** Used to match backslashes in property paths. */
  13772. var reEscapeChar = /\\(\\)?/g;
  13773. /** Used to detect host constructors (Safari). */
  13774. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13775. /** Used to detect unsigned integer values. */
  13776. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13777. /** Detect free variable `global` from Node.js. */
  13778. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13779. /** Detect free variable `self`. */
  13780. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13781. /** Used as a reference to the global object. */
  13782. var root = freeGlobal || freeSelf || Function('return this')();
  13783. /**
  13784. * Gets the value at `key` of `object`.
  13785. *
  13786. * @private
  13787. * @param {Object} [object] The object to query.
  13788. * @param {string} key The key of the property to get.
  13789. * @returns {*} Returns the property value.
  13790. */
  13791. function getValue(object, key) {
  13792. return object == null ? undefined : object[key];
  13793. }
  13794. /**
  13795. * Checks if `value` is a host object in IE < 9.
  13796. *
  13797. * @private
  13798. * @param {*} value The value to check.
  13799. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13800. */
  13801. function isHostObject(value) {
  13802. // Many host objects are `Object` objects that can coerce to strings
  13803. // despite having improperly defined `toString` methods.
  13804. var result = false;
  13805. if (value != null && typeof value.toString != 'function') {
  13806. try {
  13807. result = !!(value + '');
  13808. } catch (e) {}
  13809. }
  13810. return result;
  13811. }
  13812. /** Used for built-in method references. */
  13813. var arrayProto = Array.prototype,
  13814. funcProto = Function.prototype,
  13815. objectProto = Object.prototype;
  13816. /** Used to detect overreaching core-js shims. */
  13817. var coreJsData = root['__core-js_shared__'];
  13818. /** Used to detect methods masquerading as native. */
  13819. var maskSrcKey = (function() {
  13820. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  13821. return uid ? ('Symbol(src)_1.' + uid) : '';
  13822. }());
  13823. /** Used to resolve the decompiled source of functions. */
  13824. var funcToString = funcProto.toString;
  13825. /** Used to check objects for own properties. */
  13826. var hasOwnProperty = objectProto.hasOwnProperty;
  13827. /**
  13828. * Used to resolve the
  13829. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  13830. * of values.
  13831. */
  13832. var objectToString = objectProto.toString;
  13833. /** Used to detect if a method is native. */
  13834. var reIsNative = RegExp('^' +
  13835. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  13836. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  13837. );
  13838. /** Built-in value references. */
  13839. var Symbol = root.Symbol,
  13840. splice = arrayProto.splice;
  13841. /* Built-in method references that are verified to be native. */
  13842. var Map = getNative(root, 'Map'),
  13843. nativeCreate = getNative(Object, 'create');
  13844. /** Used to convert symbols to primitives and strings. */
  13845. var symbolProto = Symbol ? Symbol.prototype : undefined,
  13846. symbolToString = symbolProto ? symbolProto.toString : undefined;
  13847. /**
  13848. * Creates a hash object.
  13849. *
  13850. * @private
  13851. * @constructor
  13852. * @param {Array} [entries] The key-value pairs to cache.
  13853. */
  13854. function Hash(entries) {
  13855. var index = -1,
  13856. length = entries ? entries.length : 0;
  13857. this.clear();
  13858. while (++index < length) {
  13859. var entry = entries[index];
  13860. this.set(entry[0], entry[1]);
  13861. }
  13862. }
  13863. /**
  13864. * Removes all key-value entries from the hash.
  13865. *
  13866. * @private
  13867. * @name clear
  13868. * @memberOf Hash
  13869. */
  13870. function hashClear() {
  13871. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  13872. }
  13873. /**
  13874. * Removes `key` and its value from the hash.
  13875. *
  13876. * @private
  13877. * @name delete
  13878. * @memberOf Hash
  13879. * @param {Object} hash The hash to modify.
  13880. * @param {string} key The key of the value to remove.
  13881. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13882. */
  13883. function hashDelete(key) {
  13884. return this.has(key) && delete this.__data__[key];
  13885. }
  13886. /**
  13887. * Gets the hash value for `key`.
  13888. *
  13889. * @private
  13890. * @name get
  13891. * @memberOf Hash
  13892. * @param {string} key The key of the value to get.
  13893. * @returns {*} Returns the entry value.
  13894. */
  13895. function hashGet(key) {
  13896. var data = this.__data__;
  13897. if (nativeCreate) {
  13898. var result = data[key];
  13899. return result === HASH_UNDEFINED ? undefined : result;
  13900. }
  13901. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  13902. }
  13903. /**
  13904. * Checks if a hash value for `key` exists.
  13905. *
  13906. * @private
  13907. * @name has
  13908. * @memberOf Hash
  13909. * @param {string} key The key of the entry to check.
  13910. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13911. */
  13912. function hashHas(key) {
  13913. var data = this.__data__;
  13914. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  13915. }
  13916. /**
  13917. * Sets the hash `key` to `value`.
  13918. *
  13919. * @private
  13920. * @name set
  13921. * @memberOf Hash
  13922. * @param {string} key The key of the value to set.
  13923. * @param {*} value The value to set.
  13924. * @returns {Object} Returns the hash instance.
  13925. */
  13926. function hashSet(key, value) {
  13927. var data = this.__data__;
  13928. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  13929. return this;
  13930. }
  13931. // Add methods to `Hash`.
  13932. Hash.prototype.clear = hashClear;
  13933. Hash.prototype['delete'] = hashDelete;
  13934. Hash.prototype.get = hashGet;
  13935. Hash.prototype.has = hashHas;
  13936. Hash.prototype.set = hashSet;
  13937. /**
  13938. * Creates an list cache object.
  13939. *
  13940. * @private
  13941. * @constructor
  13942. * @param {Array} [entries] The key-value pairs to cache.
  13943. */
  13944. function ListCache(entries) {
  13945. var index = -1,
  13946. length = entries ? entries.length : 0;
  13947. this.clear();
  13948. while (++index < length) {
  13949. var entry = entries[index];
  13950. this.set(entry[0], entry[1]);
  13951. }
  13952. }
  13953. /**
  13954. * Removes all key-value entries from the list cache.
  13955. *
  13956. * @private
  13957. * @name clear
  13958. * @memberOf ListCache
  13959. */
  13960. function listCacheClear() {
  13961. this.__data__ = [];
  13962. }
  13963. /**
  13964. * Removes `key` and its value from the list cache.
  13965. *
  13966. * @private
  13967. * @name delete
  13968. * @memberOf ListCache
  13969. * @param {string} key The key of the value to remove.
  13970. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13971. */
  13972. function listCacheDelete(key) {
  13973. var data = this.__data__,
  13974. index = assocIndexOf(data, key);
  13975. if (index < 0) {
  13976. return false;
  13977. }
  13978. var lastIndex = data.length - 1;
  13979. if (index == lastIndex) {
  13980. data.pop();
  13981. } else {
  13982. splice.call(data, index, 1);
  13983. }
  13984. return true;
  13985. }
  13986. /**
  13987. * Gets the list cache value for `key`.
  13988. *
  13989. * @private
  13990. * @name get
  13991. * @memberOf ListCache
  13992. * @param {string} key The key of the value to get.
  13993. * @returns {*} Returns the entry value.
  13994. */
  13995. function listCacheGet(key) {
  13996. var data = this.__data__,
  13997. index = assocIndexOf(data, key);
  13998. return index < 0 ? undefined : data[index][1];
  13999. }
  14000. /**
  14001. * Checks if a list cache value for `key` exists.
  14002. *
  14003. * @private
  14004. * @name has
  14005. * @memberOf ListCache
  14006. * @param {string} key The key of the entry to check.
  14007. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14008. */
  14009. function listCacheHas(key) {
  14010. return assocIndexOf(this.__data__, key) > -1;
  14011. }
  14012. /**
  14013. * Sets the list cache `key` to `value`.
  14014. *
  14015. * @private
  14016. * @name set
  14017. * @memberOf ListCache
  14018. * @param {string} key The key of the value to set.
  14019. * @param {*} value The value to set.
  14020. * @returns {Object} Returns the list cache instance.
  14021. */
  14022. function listCacheSet(key, value) {
  14023. var data = this.__data__,
  14024. index = assocIndexOf(data, key);
  14025. if (index < 0) {
  14026. data.push([key, value]);
  14027. } else {
  14028. data[index][1] = value;
  14029. }
  14030. return this;
  14031. }
  14032. // Add methods to `ListCache`.
  14033. ListCache.prototype.clear = listCacheClear;
  14034. ListCache.prototype['delete'] = listCacheDelete;
  14035. ListCache.prototype.get = listCacheGet;
  14036. ListCache.prototype.has = listCacheHas;
  14037. ListCache.prototype.set = listCacheSet;
  14038. /**
  14039. * Creates a map cache object to store key-value pairs.
  14040. *
  14041. * @private
  14042. * @constructor
  14043. * @param {Array} [entries] The key-value pairs to cache.
  14044. */
  14045. function MapCache(entries) {
  14046. var index = -1,
  14047. length = entries ? entries.length : 0;
  14048. this.clear();
  14049. while (++index < length) {
  14050. var entry = entries[index];
  14051. this.set(entry[0], entry[1]);
  14052. }
  14053. }
  14054. /**
  14055. * Removes all key-value entries from the map.
  14056. *
  14057. * @private
  14058. * @name clear
  14059. * @memberOf MapCache
  14060. */
  14061. function mapCacheClear() {
  14062. this.__data__ = {
  14063. 'hash': new Hash,
  14064. 'map': new (Map || ListCache),
  14065. 'string': new Hash
  14066. };
  14067. }
  14068. /**
  14069. * Removes `key` and its value from the map.
  14070. *
  14071. * @private
  14072. * @name delete
  14073. * @memberOf MapCache
  14074. * @param {string} key The key of the value to remove.
  14075. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  14076. */
  14077. function mapCacheDelete(key) {
  14078. return getMapData(this, key)['delete'](key);
  14079. }
  14080. /**
  14081. * Gets the map value for `key`.
  14082. *
  14083. * @private
  14084. * @name get
  14085. * @memberOf MapCache
  14086. * @param {string} key The key of the value to get.
  14087. * @returns {*} Returns the entry value.
  14088. */
  14089. function mapCacheGet(key) {
  14090. return getMapData(this, key).get(key);
  14091. }
  14092. /**
  14093. * Checks if a map value for `key` exists.
  14094. *
  14095. * @private
  14096. * @name has
  14097. * @memberOf MapCache
  14098. * @param {string} key The key of the entry to check.
  14099. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14100. */
  14101. function mapCacheHas(key) {
  14102. return getMapData(this, key).has(key);
  14103. }
  14104. /**
  14105. * Sets the map `key` to `value`.
  14106. *
  14107. * @private
  14108. * @name set
  14109. * @memberOf MapCache
  14110. * @param {string} key The key of the value to set.
  14111. * @param {*} value The value to set.
  14112. * @returns {Object} Returns the map cache instance.
  14113. */
  14114. function mapCacheSet(key, value) {
  14115. getMapData(this, key).set(key, value);
  14116. return this;
  14117. }
  14118. // Add methods to `MapCache`.
  14119. MapCache.prototype.clear = mapCacheClear;
  14120. MapCache.prototype['delete'] = mapCacheDelete;
  14121. MapCache.prototype.get = mapCacheGet;
  14122. MapCache.prototype.has = mapCacheHas;
  14123. MapCache.prototype.set = mapCacheSet;
  14124. /**
  14125. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  14126. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14127. * for equality comparisons.
  14128. *
  14129. * @private
  14130. * @param {Object} object The object to modify.
  14131. * @param {string} key The key of the property to assign.
  14132. * @param {*} value The value to assign.
  14133. */
  14134. function assignValue(object, key, value) {
  14135. var objValue = object[key];
  14136. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  14137. (value === undefined && !(key in object))) {
  14138. object[key] = value;
  14139. }
  14140. }
  14141. /**
  14142. * Gets the index at which the `key` is found in `array` of key-value pairs.
  14143. *
  14144. * @private
  14145. * @param {Array} array The array to inspect.
  14146. * @param {*} key The key to search for.
  14147. * @returns {number} Returns the index of the matched value, else `-1`.
  14148. */
  14149. function assocIndexOf(array, key) {
  14150. var length = array.length;
  14151. while (length--) {
  14152. if (eq(array[length][0], key)) {
  14153. return length;
  14154. }
  14155. }
  14156. return -1;
  14157. }
  14158. /**
  14159. * The base implementation of `_.isNative` without bad shim checks.
  14160. *
  14161. * @private
  14162. * @param {*} value The value to check.
  14163. * @returns {boolean} Returns `true` if `value` is a native function,
  14164. * else `false`.
  14165. */
  14166. function baseIsNative(value) {
  14167. if (!isObject(value) || isMasked(value)) {
  14168. return false;
  14169. }
  14170. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  14171. return pattern.test(toSource(value));
  14172. }
  14173. /**
  14174. * The base implementation of `_.set`.
  14175. *
  14176. * @private
  14177. * @param {Object} object The object to modify.
  14178. * @param {Array|string} path The path of the property to set.
  14179. * @param {*} value The value to set.
  14180. * @param {Function} [customizer] The function to customize path creation.
  14181. * @returns {Object} Returns `object`.
  14182. */
  14183. function baseSet(object, path, value, customizer) {
  14184. if (!isObject(object)) {
  14185. return object;
  14186. }
  14187. path = isKey(path, object) ? [path] : castPath(path);
  14188. var index = -1,
  14189. length = path.length,
  14190. lastIndex = length - 1,
  14191. nested = object;
  14192. while (nested != null && ++index < length) {
  14193. var key = toKey(path[index]),
  14194. newValue = value;
  14195. if (index != lastIndex) {
  14196. var objValue = nested[key];
  14197. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  14198. if (newValue === undefined) {
  14199. newValue = isObject(objValue)
  14200. ? objValue
  14201. : (isIndex(path[index + 1]) ? [] : {});
  14202. }
  14203. }
  14204. assignValue(nested, key, newValue);
  14205. nested = nested[key];
  14206. }
  14207. return object;
  14208. }
  14209. /**
  14210. * The base implementation of `_.toString` which doesn't convert nullish
  14211. * values to empty strings.
  14212. *
  14213. * @private
  14214. * @param {*} value The value to process.
  14215. * @returns {string} Returns the string.
  14216. */
  14217. function baseToString(value) {
  14218. // Exit early for strings to avoid a performance hit in some environments.
  14219. if (typeof value == 'string') {
  14220. return value;
  14221. }
  14222. if (isSymbol(value)) {
  14223. return symbolToString ? symbolToString.call(value) : '';
  14224. }
  14225. var result = (value + '');
  14226. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14227. }
  14228. /**
  14229. * Casts `value` to a path array if it's not one.
  14230. *
  14231. * @private
  14232. * @param {*} value The value to inspect.
  14233. * @returns {Array} Returns the cast property path array.
  14234. */
  14235. function castPath(value) {
  14236. return isArray(value) ? value : stringToPath(value);
  14237. }
  14238. /**
  14239. * Gets the data for `map`.
  14240. *
  14241. * @private
  14242. * @param {Object} map The map to query.
  14243. * @param {string} key The reference key.
  14244. * @returns {*} Returns the map data.
  14245. */
  14246. function getMapData(map, key) {
  14247. var data = map.__data__;
  14248. return isKeyable(key)
  14249. ? data[typeof key == 'string' ? 'string' : 'hash']
  14250. : data.map;
  14251. }
  14252. /**
  14253. * Gets the native function at `key` of `object`.
  14254. *
  14255. * @private
  14256. * @param {Object} object The object to query.
  14257. * @param {string} key The key of the method to get.
  14258. * @returns {*} Returns the function if it's native, else `undefined`.
  14259. */
  14260. function getNative(object, key) {
  14261. var value = getValue(object, key);
  14262. return baseIsNative(value) ? value : undefined;
  14263. }
  14264. /**
  14265. * Checks if `value` is a valid array-like index.
  14266. *
  14267. * @private
  14268. * @param {*} value The value to check.
  14269. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  14270. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  14271. */
  14272. function isIndex(value, length) {
  14273. length = length == null ? MAX_SAFE_INTEGER : length;
  14274. return !!length &&
  14275. (typeof value == 'number' || reIsUint.test(value)) &&
  14276. (value > -1 && value % 1 == 0 && value < length);
  14277. }
  14278. /**
  14279. * Checks if `value` is a property name and not a property path.
  14280. *
  14281. * @private
  14282. * @param {*} value The value to check.
  14283. * @param {Object} [object] The object to query keys on.
  14284. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  14285. */
  14286. function isKey(value, object) {
  14287. if (isArray(value)) {
  14288. return false;
  14289. }
  14290. var type = typeof value;
  14291. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  14292. value == null || isSymbol(value)) {
  14293. return true;
  14294. }
  14295. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  14296. (object != null && value in Object(object));
  14297. }
  14298. /**
  14299. * Checks if `value` is suitable for use as unique object key.
  14300. *
  14301. * @private
  14302. * @param {*} value The value to check.
  14303. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  14304. */
  14305. function isKeyable(value) {
  14306. var type = typeof value;
  14307. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  14308. ? (value !== '__proto__')
  14309. : (value === null);
  14310. }
  14311. /**
  14312. * Checks if `func` has its source masked.
  14313. *
  14314. * @private
  14315. * @param {Function} func The function to check.
  14316. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  14317. */
  14318. function isMasked(func) {
  14319. return !!maskSrcKey && (maskSrcKey in func);
  14320. }
  14321. /**
  14322. * Converts `string` to a property path array.
  14323. *
  14324. * @private
  14325. * @param {string} string The string to convert.
  14326. * @returns {Array} Returns the property path array.
  14327. */
  14328. var stringToPath = memoize(function(string) {
  14329. string = toString(string);
  14330. var result = [];
  14331. if (reLeadingDot.test(string)) {
  14332. result.push('');
  14333. }
  14334. string.replace(rePropName, function(match, number, quote, string) {
  14335. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  14336. });
  14337. return result;
  14338. });
  14339. /**
  14340. * Converts `value` to a string key if it's not a string or symbol.
  14341. *
  14342. * @private
  14343. * @param {*} value The value to inspect.
  14344. * @returns {string|symbol} Returns the key.
  14345. */
  14346. function toKey(value) {
  14347. if (typeof value == 'string' || isSymbol(value)) {
  14348. return value;
  14349. }
  14350. var result = (value + '');
  14351. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14352. }
  14353. /**
  14354. * Converts `func` to its source code.
  14355. *
  14356. * @private
  14357. * @param {Function} func The function to process.
  14358. * @returns {string} Returns the source code.
  14359. */
  14360. function toSource(func) {
  14361. if (func != null) {
  14362. try {
  14363. return funcToString.call(func);
  14364. } catch (e) {}
  14365. try {
  14366. return (func + '');
  14367. } catch (e) {}
  14368. }
  14369. return '';
  14370. }
  14371. /**
  14372. * Creates a function that memoizes the result of `func`. If `resolver` is
  14373. * provided, it determines the cache key for storing the result based on the
  14374. * arguments provided to the memoized function. By default, the first argument
  14375. * provided to the memoized function is used as the map cache key. The `func`
  14376. * is invoked with the `this` binding of the memoized function.
  14377. *
  14378. * **Note:** The cache is exposed as the `cache` property on the memoized
  14379. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  14380. * constructor with one whose instances implement the
  14381. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  14382. * method interface of `delete`, `get`, `has`, and `set`.
  14383. *
  14384. * @static
  14385. * @memberOf _
  14386. * @since 0.1.0
  14387. * @category Function
  14388. * @param {Function} func The function to have its output memoized.
  14389. * @param {Function} [resolver] The function to resolve the cache key.
  14390. * @returns {Function} Returns the new memoized function.
  14391. * @example
  14392. *
  14393. * var object = { 'a': 1, 'b': 2 };
  14394. * var other = { 'c': 3, 'd': 4 };
  14395. *
  14396. * var values = _.memoize(_.values);
  14397. * values(object);
  14398. * // => [1, 2]
  14399. *
  14400. * values(other);
  14401. * // => [3, 4]
  14402. *
  14403. * object.a = 2;
  14404. * values(object);
  14405. * // => [1, 2]
  14406. *
  14407. * // Modify the result cache.
  14408. * values.cache.set(object, ['a', 'b']);
  14409. * values(object);
  14410. * // => ['a', 'b']
  14411. *
  14412. * // Replace `_.memoize.Cache`.
  14413. * _.memoize.Cache = WeakMap;
  14414. */
  14415. function memoize(func, resolver) {
  14416. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  14417. throw new TypeError(FUNC_ERROR_TEXT);
  14418. }
  14419. var memoized = function() {
  14420. var args = arguments,
  14421. key = resolver ? resolver.apply(this, args) : args[0],
  14422. cache = memoized.cache;
  14423. if (cache.has(key)) {
  14424. return cache.get(key);
  14425. }
  14426. var result = func.apply(this, args);
  14427. memoized.cache = cache.set(key, result);
  14428. return result;
  14429. };
  14430. memoized.cache = new (memoize.Cache || MapCache);
  14431. return memoized;
  14432. }
  14433. // Assign cache to `_.memoize`.
  14434. memoize.Cache = MapCache;
  14435. /**
  14436. * Performs a
  14437. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14438. * comparison between two values to determine if they are equivalent.
  14439. *
  14440. * @static
  14441. * @memberOf _
  14442. * @since 4.0.0
  14443. * @category Lang
  14444. * @param {*} value The value to compare.
  14445. * @param {*} other The other value to compare.
  14446. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  14447. * @example
  14448. *
  14449. * var object = { 'a': 1 };
  14450. * var other = { 'a': 1 };
  14451. *
  14452. * _.eq(object, object);
  14453. * // => true
  14454. *
  14455. * _.eq(object, other);
  14456. * // => false
  14457. *
  14458. * _.eq('a', 'a');
  14459. * // => true
  14460. *
  14461. * _.eq('a', Object('a'));
  14462. * // => false
  14463. *
  14464. * _.eq(NaN, NaN);
  14465. * // => true
  14466. */
  14467. function eq(value, other) {
  14468. return value === other || (value !== value && other !== other);
  14469. }
  14470. /**
  14471. * Checks if `value` is classified as an `Array` object.
  14472. *
  14473. * @static
  14474. * @memberOf _
  14475. * @since 0.1.0
  14476. * @category Lang
  14477. * @param {*} value The value to check.
  14478. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14479. * @example
  14480. *
  14481. * _.isArray([1, 2, 3]);
  14482. * // => true
  14483. *
  14484. * _.isArray(document.body.children);
  14485. * // => false
  14486. *
  14487. * _.isArray('abc');
  14488. * // => false
  14489. *
  14490. * _.isArray(_.noop);
  14491. * // => false
  14492. */
  14493. var isArray = Array.isArray;
  14494. /**
  14495. * Checks if `value` is classified as a `Function` object.
  14496. *
  14497. * @static
  14498. * @memberOf _
  14499. * @since 0.1.0
  14500. * @category Lang
  14501. * @param {*} value The value to check.
  14502. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14503. * @example
  14504. *
  14505. * _.isFunction(_);
  14506. * // => true
  14507. *
  14508. * _.isFunction(/abc/);
  14509. * // => false
  14510. */
  14511. function isFunction(value) {
  14512. // The use of `Object#toString` avoids issues with the `typeof` operator
  14513. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14514. var tag = isObject(value) ? objectToString.call(value) : '';
  14515. return tag == funcTag || tag == genTag;
  14516. }
  14517. /**
  14518. * Checks if `value` is the
  14519. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14520. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14521. *
  14522. * @static
  14523. * @memberOf _
  14524. * @since 0.1.0
  14525. * @category Lang
  14526. * @param {*} value The value to check.
  14527. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14528. * @example
  14529. *
  14530. * _.isObject({});
  14531. * // => true
  14532. *
  14533. * _.isObject([1, 2, 3]);
  14534. * // => true
  14535. *
  14536. * _.isObject(_.noop);
  14537. * // => true
  14538. *
  14539. * _.isObject(null);
  14540. * // => false
  14541. */
  14542. function isObject(value) {
  14543. var type = typeof value;
  14544. return !!value && (type == 'object' || type == 'function');
  14545. }
  14546. /**
  14547. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14548. * and has a `typeof` result of "object".
  14549. *
  14550. * @static
  14551. * @memberOf _
  14552. * @since 4.0.0
  14553. * @category Lang
  14554. * @param {*} value The value to check.
  14555. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14556. * @example
  14557. *
  14558. * _.isObjectLike({});
  14559. * // => true
  14560. *
  14561. * _.isObjectLike([1, 2, 3]);
  14562. * // => true
  14563. *
  14564. * _.isObjectLike(_.noop);
  14565. * // => false
  14566. *
  14567. * _.isObjectLike(null);
  14568. * // => false
  14569. */
  14570. function isObjectLike(value) {
  14571. return !!value && typeof value == 'object';
  14572. }
  14573. /**
  14574. * Checks if `value` is classified as a `Symbol` primitive or object.
  14575. *
  14576. * @static
  14577. * @memberOf _
  14578. * @since 4.0.0
  14579. * @category Lang
  14580. * @param {*} value The value to check.
  14581. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14582. * @example
  14583. *
  14584. * _.isSymbol(Symbol.iterator);
  14585. * // => true
  14586. *
  14587. * _.isSymbol('abc');
  14588. * // => false
  14589. */
  14590. function isSymbol(value) {
  14591. return typeof value == 'symbol' ||
  14592. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14593. }
  14594. /**
  14595. * Converts `value` to a string. An empty string is returned for `null`
  14596. * and `undefined` values. The sign of `-0` is preserved.
  14597. *
  14598. * @static
  14599. * @memberOf _
  14600. * @since 4.0.0
  14601. * @category Lang
  14602. * @param {*} value The value to process.
  14603. * @returns {string} Returns the string.
  14604. * @example
  14605. *
  14606. * _.toString(null);
  14607. * // => ''
  14608. *
  14609. * _.toString(-0);
  14610. * // => '-0'
  14611. *
  14612. * _.toString([1, 2, 3]);
  14613. * // => '1,2,3'
  14614. */
  14615. function toString(value) {
  14616. return value == null ? '' : baseToString(value);
  14617. }
  14618. /**
  14619. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14620. * it's created. Arrays are created for missing index properties while objects
  14621. * are created for all other missing properties. Use `_.setWith` to customize
  14622. * `path` creation.
  14623. *
  14624. * **Note:** This method mutates `object`.
  14625. *
  14626. * @static
  14627. * @memberOf _
  14628. * @since 3.7.0
  14629. * @category Object
  14630. * @param {Object} object The object to modify.
  14631. * @param {Array|string} path The path of the property to set.
  14632. * @param {*} value The value to set.
  14633. * @returns {Object} Returns `object`.
  14634. * @example
  14635. *
  14636. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14637. *
  14638. * _.set(object, 'a[0].b.c', 4);
  14639. * console.log(object.a[0].b.c);
  14640. * // => 4
  14641. *
  14642. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14643. * console.log(object.x[0].y.z);
  14644. * // => 5
  14645. */
  14646. function set(object, path, value) {
  14647. return object == null ? object : baseSet(object, path, value);
  14648. }
  14649. module.exports = set;
  14650. /***/ }),
  14651. /***/ 898:
  14652. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14653. "use strict";
  14654. Object.defineProperty(exports, '__esModule', { value: true });
  14655. var request = __webpack_require__(753);
  14656. var universalUserAgent = __webpack_require__(796);
  14657. const VERSION = "4.3.1";
  14658. class GraphqlError extends Error {
  14659. constructor(request, response) {
  14660. const message = response.data.errors[0].message;
  14661. super(message);
  14662. Object.assign(this, response.data);
  14663. this.name = "GraphqlError";
  14664. this.request = request; // Maintains proper stack trace (only available on V8)
  14665. /* istanbul ignore next */
  14666. if (Error.captureStackTrace) {
  14667. Error.captureStackTrace(this, this.constructor);
  14668. }
  14669. }
  14670. }
  14671. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14672. function graphql(request, query, options) {
  14673. options = typeof query === "string" ? options = Object.assign({
  14674. query
  14675. }, options) : options = query;
  14676. const requestOptions = Object.keys(options).reduce((result, key) => {
  14677. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14678. result[key] = options[key];
  14679. return result;
  14680. }
  14681. if (!result.variables) {
  14682. result.variables = {};
  14683. }
  14684. result.variables[key] = options[key];
  14685. return result;
  14686. }, {});
  14687. return request(requestOptions).then(response => {
  14688. if (response.data.errors) {
  14689. throw new GraphqlError(requestOptions, {
  14690. data: response.data
  14691. });
  14692. }
  14693. return response.data.data;
  14694. });
  14695. }
  14696. function withDefaults(request$1, newDefaults) {
  14697. const newRequest = request$1.defaults(newDefaults);
  14698. const newApi = (query, options) => {
  14699. return graphql(newRequest, query, options);
  14700. };
  14701. return Object.assign(newApi, {
  14702. defaults: withDefaults.bind(null, newRequest),
  14703. endpoint: request.request.endpoint
  14704. });
  14705. }
  14706. const graphql$1 = withDefaults(request.request, {
  14707. headers: {
  14708. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14709. },
  14710. method: "POST",
  14711. url: "/graphql"
  14712. });
  14713. function withCustomRequest(customRequest) {
  14714. return withDefaults(customRequest, {
  14715. method: "POST",
  14716. url: "/graphql"
  14717. });
  14718. }
  14719. exports.graphql = graphql$1;
  14720. exports.withCustomRequest = withCustomRequest;
  14721. //# sourceMappingURL=index.js.map
  14722. /***/ }),
  14723. /***/ 899:
  14724. /***/ (function(module, __unusedexports, __webpack_require__) {
  14725. module.exports = registerEndpoints;
  14726. const { Deprecation } = __webpack_require__(692);
  14727. function registerEndpoints(octokit, routes) {
  14728. Object.keys(routes).forEach(namespaceName => {
  14729. if (!octokit[namespaceName]) {
  14730. octokit[namespaceName] = {};
  14731. }
  14732. Object.keys(routes[namespaceName]).forEach(apiName => {
  14733. const apiOptions = routes[namespaceName][apiName];
  14734. const endpointDefaults = ["method", "url", "headers"].reduce(
  14735. (map, key) => {
  14736. if (typeof apiOptions[key] !== "undefined") {
  14737. map[key] = apiOptions[key];
  14738. }
  14739. return map;
  14740. },
  14741. {}
  14742. );
  14743. endpointDefaults.request = {
  14744. validate: apiOptions.params
  14745. };
  14746. let request = octokit.request.defaults(endpointDefaults);
  14747. // patch request & endpoint methods to support deprecated parameters.
  14748. // Not the most elegant solution, but we don’t want to move deprecation
  14749. // logic into octokit/endpoint.js as it’s out of scope
  14750. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14751. key => apiOptions.params[key].deprecated
  14752. );
  14753. if (hasDeprecatedParam) {
  14754. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14755. request = patch(
  14756. octokit.request.defaults(endpointDefaults),
  14757. `.${namespaceName}.${apiName}()`
  14758. );
  14759. request.endpoint = patch(
  14760. request.endpoint,
  14761. `.${namespaceName}.${apiName}.endpoint()`
  14762. );
  14763. request.endpoint.merge = patch(
  14764. request.endpoint.merge,
  14765. `.${namespaceName}.${apiName}.endpoint.merge()`
  14766. );
  14767. }
  14768. if (apiOptions.deprecated) {
  14769. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14770. octokit.log.warn(
  14771. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14772. );
  14773. octokit[namespaceName][apiName] = request;
  14774. return request.apply(null, arguments);
  14775. };
  14776. return;
  14777. }
  14778. octokit[namespaceName][apiName] = request;
  14779. });
  14780. });
  14781. }
  14782. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14783. const patchedMethod = options => {
  14784. options = Object.assign({}, options);
  14785. Object.keys(options).forEach(key => {
  14786. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14787. const aliasKey = apiOptions.params[key].alias;
  14788. octokit.log.warn(
  14789. new Deprecation(
  14790. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14791. )
  14792. );
  14793. if (!(aliasKey in options)) {
  14794. options[aliasKey] = options[key];
  14795. }
  14796. delete options[key];
  14797. }
  14798. });
  14799. return method(options);
  14800. };
  14801. Object.keys(method).forEach(key => {
  14802. patchedMethod[key] = method[key];
  14803. });
  14804. return patchedMethod;
  14805. }
  14806. /***/ }),
  14807. /***/ 929:
  14808. /***/ (function(module, __unusedexports, __webpack_require__) {
  14809. module.exports = hasNextPage
  14810. const deprecate = __webpack_require__(370)
  14811. const getPageLinks = __webpack_require__(577)
  14812. function hasNextPage (link) {
  14813. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  14814. return getPageLinks(link).next
  14815. }
  14816. /***/ }),
  14817. /***/ 948:
  14818. /***/ (function(module) {
  14819. "use strict";
  14820. /**
  14821. * Tries to execute a function and discards any error that occurs.
  14822. * @param {Function} fn - Function that might or might not throw an error.
  14823. * @returns {?*} Return-value of the function when no error occurred.
  14824. */
  14825. module.exports = function(fn) {
  14826. try { return fn() } catch (e) {}
  14827. }
  14828. /***/ }),
  14829. /***/ 950:
  14830. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14831. "use strict";
  14832. Object.defineProperty(exports, "__esModule", { value: true });
  14833. const url = __webpack_require__(835);
  14834. function getProxyUrl(reqUrl) {
  14835. let usingSsl = reqUrl.protocol === 'https:';
  14836. let proxyUrl;
  14837. if (checkBypass(reqUrl)) {
  14838. return proxyUrl;
  14839. }
  14840. let proxyVar;
  14841. if (usingSsl) {
  14842. proxyVar = process.env["https_proxy"] ||
  14843. process.env["HTTPS_PROXY"];
  14844. }
  14845. else {
  14846. proxyVar = process.env["http_proxy"] ||
  14847. process.env["HTTP_PROXY"];
  14848. }
  14849. if (proxyVar) {
  14850. proxyUrl = url.parse(proxyVar);
  14851. }
  14852. return proxyUrl;
  14853. }
  14854. exports.getProxyUrl = getProxyUrl;
  14855. function checkBypass(reqUrl) {
  14856. if (!reqUrl.hostname) {
  14857. return false;
  14858. }
  14859. let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
  14860. if (!noProxy) {
  14861. return false;
  14862. }
  14863. // Determine the request port
  14864. let reqPort;
  14865. if (reqUrl.port) {
  14866. reqPort = Number(reqUrl.port);
  14867. }
  14868. else if (reqUrl.protocol === 'http:') {
  14869. reqPort = 80;
  14870. }
  14871. else if (reqUrl.protocol === 'https:') {
  14872. reqPort = 443;
  14873. }
  14874. // Format the request hostname and hostname with port
  14875. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  14876. if (typeof reqPort === 'number') {
  14877. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  14878. }
  14879. // Compare request host against noproxy
  14880. for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
  14881. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  14882. return true;
  14883. }
  14884. }
  14885. return false;
  14886. }
  14887. exports.checkBypass = checkBypass;
  14888. /***/ }),
  14889. /***/ 954:
  14890. /***/ (function(module) {
  14891. module.exports = validateAuth;
  14892. function validateAuth(auth) {
  14893. if (typeof auth === "string") {
  14894. return;
  14895. }
  14896. if (typeof auth === "function") {
  14897. return;
  14898. }
  14899. if (auth.username && auth.password) {
  14900. return;
  14901. }
  14902. if (auth.clientId && auth.clientSecret) {
  14903. return;
  14904. }
  14905. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  14906. }
  14907. /***/ }),
  14908. /***/ 955:
  14909. /***/ (function(module, __unusedexports, __webpack_require__) {
  14910. "use strict";
  14911. const path = __webpack_require__(622);
  14912. const childProcess = __webpack_require__(129);
  14913. const crossSpawn = __webpack_require__(20);
  14914. const stripEof = __webpack_require__(768);
  14915. const npmRunPath = __webpack_require__(621);
  14916. const isStream = __webpack_require__(323);
  14917. const _getStream = __webpack_require__(145);
  14918. const pFinally = __webpack_require__(697);
  14919. const onExit = __webpack_require__(260);
  14920. const errname = __webpack_require__(427);
  14921. const stdio = __webpack_require__(168);
  14922. const TEN_MEGABYTES = 1000 * 1000 * 10;
  14923. function handleArgs(cmd, args, opts) {
  14924. let parsed;
  14925. opts = Object.assign({
  14926. extendEnv: true,
  14927. env: {}
  14928. }, opts);
  14929. if (opts.extendEnv) {
  14930. opts.env = Object.assign({}, process.env, opts.env);
  14931. }
  14932. if (opts.__winShell === true) {
  14933. delete opts.__winShell;
  14934. parsed = {
  14935. command: cmd,
  14936. args,
  14937. options: opts,
  14938. file: cmd,
  14939. original: {
  14940. cmd,
  14941. args
  14942. }
  14943. };
  14944. } else {
  14945. parsed = crossSpawn._parse(cmd, args, opts);
  14946. }
  14947. opts = Object.assign({
  14948. maxBuffer: TEN_MEGABYTES,
  14949. buffer: true,
  14950. stripEof: true,
  14951. preferLocal: true,
  14952. localDir: parsed.options.cwd || process.cwd(),
  14953. encoding: 'utf8',
  14954. reject: true,
  14955. cleanup: true
  14956. }, parsed.options);
  14957. opts.stdio = stdio(opts);
  14958. if (opts.preferLocal) {
  14959. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  14960. }
  14961. if (opts.detached) {
  14962. // #115
  14963. opts.cleanup = false;
  14964. }
  14965. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  14966. // #116
  14967. parsed.args.unshift('/q');
  14968. }
  14969. return {
  14970. cmd: parsed.command,
  14971. args: parsed.args,
  14972. opts,
  14973. parsed
  14974. };
  14975. }
  14976. function handleInput(spawned, input) {
  14977. if (input === null || input === undefined) {
  14978. return;
  14979. }
  14980. if (isStream(input)) {
  14981. input.pipe(spawned.stdin);
  14982. } else {
  14983. spawned.stdin.end(input);
  14984. }
  14985. }
  14986. function handleOutput(opts, val) {
  14987. if (val && opts.stripEof) {
  14988. val = stripEof(val);
  14989. }
  14990. return val;
  14991. }
  14992. function handleShell(fn, cmd, opts) {
  14993. let file = '/bin/sh';
  14994. let args = ['-c', cmd];
  14995. opts = Object.assign({}, opts);
  14996. if (process.platform === 'win32') {
  14997. opts.__winShell = true;
  14998. file = process.env.comspec || 'cmd.exe';
  14999. args = ['/s', '/c', `"${cmd}"`];
  15000. opts.windowsVerbatimArguments = true;
  15001. }
  15002. if (opts.shell) {
  15003. file = opts.shell;
  15004. delete opts.shell;
  15005. }
  15006. return fn(file, args, opts);
  15007. }
  15008. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  15009. if (!process[stream]) {
  15010. return null;
  15011. }
  15012. let ret;
  15013. if (!buffer) {
  15014. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  15015. ret = new Promise((resolve, reject) => {
  15016. process[stream]
  15017. .once('end', resolve)
  15018. .once('error', reject);
  15019. });
  15020. } else if (encoding) {
  15021. ret = _getStream(process[stream], {
  15022. encoding,
  15023. maxBuffer
  15024. });
  15025. } else {
  15026. ret = _getStream.buffer(process[stream], {maxBuffer});
  15027. }
  15028. return ret.catch(err => {
  15029. err.stream = stream;
  15030. err.message = `${stream} ${err.message}`;
  15031. throw err;
  15032. });
  15033. }
  15034. function makeError(result, options) {
  15035. const {stdout, stderr} = result;
  15036. let err = result.error;
  15037. const {code, signal} = result;
  15038. const {parsed, joinedCmd} = options;
  15039. const timedOut = options.timedOut || false;
  15040. if (!err) {
  15041. let output = '';
  15042. if (Array.isArray(parsed.opts.stdio)) {
  15043. if (parsed.opts.stdio[2] !== 'inherit') {
  15044. output += output.length > 0 ? stderr : `\n${stderr}`;
  15045. }
  15046. if (parsed.opts.stdio[1] !== 'inherit') {
  15047. output += `\n${stdout}`;
  15048. }
  15049. } else if (parsed.opts.stdio !== 'inherit') {
  15050. output = `\n${stderr}${stdout}`;
  15051. }
  15052. err = new Error(`Command failed: ${joinedCmd}${output}`);
  15053. err.code = code < 0 ? errname(code) : code;
  15054. }
  15055. err.stdout = stdout;
  15056. err.stderr = stderr;
  15057. err.failed = true;
  15058. err.signal = signal || null;
  15059. err.cmd = joinedCmd;
  15060. err.timedOut = timedOut;
  15061. return err;
  15062. }
  15063. function joinCmd(cmd, args) {
  15064. let joinedCmd = cmd;
  15065. if (Array.isArray(args) && args.length > 0) {
  15066. joinedCmd += ' ' + args.join(' ');
  15067. }
  15068. return joinedCmd;
  15069. }
  15070. module.exports = (cmd, args, opts) => {
  15071. const parsed = handleArgs(cmd, args, opts);
  15072. const {encoding, buffer, maxBuffer} = parsed.opts;
  15073. const joinedCmd = joinCmd(cmd, args);
  15074. let spawned;
  15075. try {
  15076. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  15077. } catch (err) {
  15078. return Promise.reject(err);
  15079. }
  15080. let removeExitHandler;
  15081. if (parsed.opts.cleanup) {
  15082. removeExitHandler = onExit(() => {
  15083. spawned.kill();
  15084. });
  15085. }
  15086. let timeoutId = null;
  15087. let timedOut = false;
  15088. const cleanup = () => {
  15089. if (timeoutId) {
  15090. clearTimeout(timeoutId);
  15091. timeoutId = null;
  15092. }
  15093. if (removeExitHandler) {
  15094. removeExitHandler();
  15095. }
  15096. };
  15097. if (parsed.opts.timeout > 0) {
  15098. timeoutId = setTimeout(() => {
  15099. timeoutId = null;
  15100. timedOut = true;
  15101. spawned.kill(parsed.opts.killSignal);
  15102. }, parsed.opts.timeout);
  15103. }
  15104. const processDone = new Promise(resolve => {
  15105. spawned.on('exit', (code, signal) => {
  15106. cleanup();
  15107. resolve({code, signal});
  15108. });
  15109. spawned.on('error', err => {
  15110. cleanup();
  15111. resolve({error: err});
  15112. });
  15113. if (spawned.stdin) {
  15114. spawned.stdin.on('error', err => {
  15115. cleanup();
  15116. resolve({error: err});
  15117. });
  15118. }
  15119. });
  15120. function destroy() {
  15121. if (spawned.stdout) {
  15122. spawned.stdout.destroy();
  15123. }
  15124. if (spawned.stderr) {
  15125. spawned.stderr.destroy();
  15126. }
  15127. }
  15128. const handlePromise = () => pFinally(Promise.all([
  15129. processDone,
  15130. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  15131. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  15132. ]).then(arr => {
  15133. const result = arr[0];
  15134. result.stdout = arr[1];
  15135. result.stderr = arr[2];
  15136. if (result.error || result.code !== 0 || result.signal !== null) {
  15137. const err = makeError(result, {
  15138. joinedCmd,
  15139. parsed,
  15140. timedOut
  15141. });
  15142. // TODO: missing some timeout logic for killed
  15143. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  15144. // err.killed = spawned.killed || killed;
  15145. err.killed = err.killed || spawned.killed;
  15146. if (!parsed.opts.reject) {
  15147. return err;
  15148. }
  15149. throw err;
  15150. }
  15151. return {
  15152. stdout: handleOutput(parsed.opts, result.stdout),
  15153. stderr: handleOutput(parsed.opts, result.stderr),
  15154. code: 0,
  15155. failed: false,
  15156. killed: false,
  15157. signal: null,
  15158. cmd: joinedCmd,
  15159. timedOut: false
  15160. };
  15161. }), destroy);
  15162. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  15163. handleInput(spawned, parsed.opts.input);
  15164. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  15165. spawned.catch = onrejected => handlePromise().catch(onrejected);
  15166. return spawned;
  15167. };
  15168. // TODO: set `stderr: 'ignore'` when that option is implemented
  15169. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  15170. // TODO: set `stdout: 'ignore'` when that option is implemented
  15171. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  15172. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  15173. module.exports.sync = (cmd, args, opts) => {
  15174. const parsed = handleArgs(cmd, args, opts);
  15175. const joinedCmd = joinCmd(cmd, args);
  15176. if (isStream(parsed.opts.input)) {
  15177. throw new TypeError('The `input` option cannot be a stream in sync mode');
  15178. }
  15179. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  15180. result.code = result.status;
  15181. if (result.error || result.status !== 0 || result.signal !== null) {
  15182. const err = makeError(result, {
  15183. joinedCmd,
  15184. parsed
  15185. });
  15186. if (!parsed.opts.reject) {
  15187. return err;
  15188. }
  15189. throw err;
  15190. }
  15191. return {
  15192. stdout: handleOutput(parsed.opts, result.stdout),
  15193. stderr: handleOutput(parsed.opts, result.stderr),
  15194. code: 0,
  15195. failed: false,
  15196. signal: null,
  15197. cmd: joinedCmd,
  15198. timedOut: false
  15199. };
  15200. };
  15201. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  15202. /***/ }),
  15203. /***/ 966:
  15204. /***/ (function(module, __unusedexports, __webpack_require__) {
  15205. "use strict";
  15206. const {PassThrough} = __webpack_require__(413);
  15207. module.exports = options => {
  15208. options = Object.assign({}, options);
  15209. const {array} = options;
  15210. let {encoding} = options;
  15211. const buffer = encoding === 'buffer';
  15212. let objectMode = false;
  15213. if (array) {
  15214. objectMode = !(encoding || buffer);
  15215. } else {
  15216. encoding = encoding || 'utf8';
  15217. }
  15218. if (buffer) {
  15219. encoding = null;
  15220. }
  15221. let len = 0;
  15222. const ret = [];
  15223. const stream = new PassThrough({objectMode});
  15224. if (encoding) {
  15225. stream.setEncoding(encoding);
  15226. }
  15227. stream.on('data', chunk => {
  15228. ret.push(chunk);
  15229. if (objectMode) {
  15230. len = ret.length;
  15231. } else {
  15232. len += chunk.length;
  15233. }
  15234. });
  15235. stream.getBufferedValue = () => {
  15236. if (array) {
  15237. return ret;
  15238. }
  15239. return buffer ? Buffer.concat(ret, len) : ret.join('');
  15240. };
  15241. stream.getBufferedLength = () => len;
  15242. return stream;
  15243. };
  15244. /***/ }),
  15245. /***/ 969:
  15246. /***/ (function(module, __unusedexports, __webpack_require__) {
  15247. var wrappy = __webpack_require__(11)
  15248. module.exports = wrappy(once)
  15249. module.exports.strict = wrappy(onceStrict)
  15250. once.proto = once(function () {
  15251. Object.defineProperty(Function.prototype, 'once', {
  15252. value: function () {
  15253. return once(this)
  15254. },
  15255. configurable: true
  15256. })
  15257. Object.defineProperty(Function.prototype, 'onceStrict', {
  15258. value: function () {
  15259. return onceStrict(this)
  15260. },
  15261. configurable: true
  15262. })
  15263. })
  15264. function once (fn) {
  15265. var f = function () {
  15266. if (f.called) return f.value
  15267. f.called = true
  15268. return f.value = fn.apply(this, arguments)
  15269. }
  15270. f.called = false
  15271. return f
  15272. }
  15273. function onceStrict (fn) {
  15274. var f = function () {
  15275. if (f.called)
  15276. throw new Error(f.onceError)
  15277. f.called = true
  15278. return f.value = fn.apply(this, arguments)
  15279. }
  15280. var name = fn.name || 'Function wrapped with `once`'
  15281. f.onceError = name + " shouldn't be called more than once"
  15282. f.called = false
  15283. return f
  15284. }
  15285. /***/ }),
  15286. /***/ 986:
  15287. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  15288. "use strict";
  15289. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  15290. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  15291. return new (P || (P = Promise))(function (resolve, reject) {
  15292. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  15293. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  15294. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  15295. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15296. });
  15297. };
  15298. Object.defineProperty(exports, "__esModule", { value: true });
  15299. const tr = __webpack_require__(9);
  15300. /**
  15301. * Exec a command.
  15302. * Output will be streamed to the live console.
  15303. * Returns promise with return code
  15304. *
  15305. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  15306. * @param args optional arguments for tool. Escaping is handled by the lib.
  15307. * @param options optional exec options. See ExecOptions
  15308. * @returns Promise<number> exit code
  15309. */
  15310. function exec(commandLine, args, options) {
  15311. return __awaiter(this, void 0, void 0, function* () {
  15312. const commandArgs = tr.argStringToArray(commandLine);
  15313. if (commandArgs.length === 0) {
  15314. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  15315. }
  15316. // Path to tool to execute should be first arg
  15317. const toolPath = commandArgs[0];
  15318. args = commandArgs.slice(1).concat(args || []);
  15319. const runner = new tr.ToolRunner(toolPath, args, options);
  15320. return runner.exec();
  15321. });
  15322. }
  15323. exports.exec = exec;
  15324. //# sourceMappingURL=exec.js.map
  15325. /***/ }),
  15326. /***/ 991:
  15327. /***/ (function(module, __unusedexports, __webpack_require__) {
  15328. module.exports = authenticationRequestError;
  15329. const { RequestError } = __webpack_require__(463);
  15330. function authenticationRequestError(state, error, options) {
  15331. if (!error.headers) throw error;
  15332. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  15333. // handle "2FA required" error only
  15334. if (error.status !== 401 || !otpRequired) {
  15335. throw error;
  15336. }
  15337. if (
  15338. error.status === 401 &&
  15339. otpRequired &&
  15340. error.request &&
  15341. error.request.headers["x-github-otp"]
  15342. ) {
  15343. if (state.otp) {
  15344. delete state.otp; // no longer valid, request again
  15345. } else {
  15346. throw new RequestError(
  15347. "Invalid one-time password for two-factor authentication",
  15348. 401,
  15349. {
  15350. headers: error.headers,
  15351. request: options
  15352. }
  15353. );
  15354. }
  15355. }
  15356. if (typeof state.auth.on2fa !== "function") {
  15357. throw new RequestError(
  15358. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  15359. 401,
  15360. {
  15361. headers: error.headers,
  15362. request: options
  15363. }
  15364. );
  15365. }
  15366. return Promise.resolve()
  15367. .then(() => {
  15368. return state.auth.on2fa();
  15369. })
  15370. .then(oneTimePassword => {
  15371. const newOptions = Object.assign(options, {
  15372. headers: Object.assign(options.headers, {
  15373. "x-github-otp": oneTimePassword
  15374. })
  15375. });
  15376. return state.octokit.request(newOptions).then(response => {
  15377. // If OTP still valid, then persist it for following requests
  15378. state.otp = oneTimePassword;
  15379. return response;
  15380. });
  15381. });
  15382. }
  15383. /***/ })
  15384. /******/ });