index.js 676 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012301330143015301630173018301930203021302230233024302530263027302830293030303130323033303430353036303730383039304030413042304330443045304630473048304930503051305230533054305530563057305830593060306130623063306430653066306730683069307030713072307330743075307630773078307930803081308230833084308530863087308830893090309130923093309430953096309730983099310031013102310331043105310631073108310931103111311231133114311531163117311831193120312131223123312431253126312731283129313031313132313331343135313631373138313931403141314231433144314531463147314831493150315131523153315431553156315731583159316031613162316331643165316631673168316931703171317231733174317531763177317831793180318131823183318431853186318731883189319031913192319331943195319631973198319932003201320232033204320532063207320832093210321132123213321432153216321732183219322032213222322332243225322632273228322932303231323232333234323532363237323832393240324132423243324432453246324732483249325032513252325332543255325632573258325932603261326232633264326532663267326832693270327132723273327432753276327732783279328032813282328332843285328632873288328932903291329232933294329532963297329832993300330133023303330433053306330733083309331033113312331333143315331633173318331933203321332233233324332533263327332833293330333133323333333433353336333733383339334033413342334333443345334633473348334933503351335233533354335533563357335833593360336133623363336433653366336733683369337033713372337333743375337633773378337933803381338233833384338533863387338833893390339133923393339433953396339733983399340034013402340334043405340634073408340934103411341234133414341534163417341834193420342134223423342434253426342734283429343034313432343334343435343634373438343934403441344234433444344534463447344834493450345134523453345434553456345734583459346034613462346334643465346634673468346934703471347234733474347534763477347834793480348134823483348434853486348734883489349034913492349334943495349634973498349935003501350235033504350535063507350835093510351135123513351435153516351735183519352035213522352335243525352635273528352935303531353235333534353535363537353835393540354135423543354435453546354735483549355035513552355335543555355635573558355935603561356235633564356535663567356835693570357135723573357435753576357735783579358035813582358335843585358635873588358935903591359235933594359535963597359835993600360136023603360436053606360736083609361036113612361336143615361636173618361936203621362236233624362536263627362836293630363136323633363436353636363736383639364036413642364336443645364636473648364936503651365236533654365536563657365836593660366136623663366436653666366736683669367036713672367336743675367636773678367936803681368236833684368536863687368836893690369136923693369436953696369736983699370037013702370337043705370637073708370937103711371237133714371537163717371837193720372137223723372437253726372737283729373037313732373337343735373637373738373937403741374237433744374537463747374837493750375137523753375437553756375737583759376037613762376337643765376637673768376937703771377237733774377537763777377837793780378137823783378437853786378737883789379037913792379337943795379637973798379938003801380238033804380538063807380838093810381138123813381438153816381738183819382038213822382338243825382638273828382938303831383238333834383538363837383838393840384138423843384438453846384738483849385038513852385338543855385638573858385938603861386238633864386538663867386838693870387138723873387438753876387738783879388038813882388338843885388638873888388938903891389238933894389538963897389838993900390139023903390439053906390739083909391039113912391339143915391639173918391939203921392239233924392539263927392839293930393139323933393439353936393739383939394039413942394339443945394639473948394939503951395239533954395539563957395839593960396139623963396439653966396739683969397039713972397339743975397639773978397939803981398239833984398539863987398839893990399139923993399439953996399739983999400040014002400340044005400640074008400940104011401240134014401540164017401840194020402140224023402440254026402740284029403040314032403340344035403640374038403940404041404240434044404540464047404840494050405140524053405440554056405740584059406040614062406340644065406640674068406940704071407240734074407540764077407840794080408140824083408440854086408740884089409040914092409340944095409640974098409941004101410241034104410541064107410841094110411141124113411441154116411741184119412041214122412341244125412641274128412941304131413241334134413541364137413841394140414141424143414441454146414741484149415041514152415341544155415641574158415941604161416241634164416541664167416841694170417141724173417441754176417741784179418041814182418341844185418641874188418941904191419241934194419541964197419841994200420142024203420442054206420742084209421042114212421342144215421642174218421942204221422242234224422542264227422842294230423142324233423442354236423742384239424042414242424342444245424642474248424942504251425242534254425542564257425842594260426142624263426442654266426742684269427042714272427342744275427642774278427942804281428242834284428542864287428842894290429142924293429442954296429742984299430043014302430343044305430643074308430943104311431243134314431543164317431843194320432143224323432443254326432743284329433043314332433343344335433643374338433943404341434243434344434543464347434843494350435143524353435443554356435743584359436043614362436343644365436643674368436943704371437243734374437543764377437843794380438143824383438443854386438743884389439043914392439343944395439643974398439944004401440244034404440544064407440844094410441144124413441444154416441744184419442044214422442344244425442644274428442944304431443244334434443544364437443844394440444144424443444444454446444744484449445044514452445344544455445644574458445944604461446244634464446544664467446844694470447144724473447444754476447744784479448044814482448344844485448644874488448944904491449244934494449544964497449844994500450145024503450445054506450745084509451045114512451345144515451645174518451945204521452245234524452545264527452845294530453145324533453445354536453745384539454045414542454345444545454645474548454945504551455245534554455545564557455845594560456145624563456445654566456745684569457045714572457345744575457645774578457945804581458245834584458545864587458845894590459145924593459445954596459745984599460046014602460346044605460646074608460946104611461246134614461546164617461846194620462146224623462446254626462746284629463046314632463346344635463646374638463946404641464246434644464546464647464846494650465146524653465446554656465746584659466046614662466346644665466646674668466946704671467246734674467546764677467846794680468146824683468446854686468746884689469046914692469346944695469646974698469947004701470247034704470547064707470847094710471147124713471447154716471747184719472047214722472347244725472647274728472947304731473247334734473547364737473847394740474147424743474447454746474747484749475047514752475347544755475647574758475947604761476247634764476547664767476847694770477147724773477447754776477747784779478047814782478347844785478647874788478947904791479247934794479547964797479847994800480148024803480448054806480748084809481048114812481348144815481648174818481948204821482248234824482548264827482848294830483148324833483448354836483748384839484048414842484348444845484648474848484948504851485248534854485548564857485848594860486148624863486448654866486748684869487048714872487348744875487648774878487948804881488248834884488548864887488848894890489148924893489448954896489748984899490049014902490349044905490649074908490949104911491249134914491549164917491849194920492149224923492449254926492749284929493049314932493349344935493649374938493949404941494249434944494549464947494849494950495149524953495449554956495749584959496049614962496349644965496649674968496949704971497249734974497549764977497849794980498149824983498449854986498749884989499049914992499349944995499649974998499950005001500250035004500550065007500850095010501150125013501450155016501750185019502050215022502350245025502650275028502950305031503250335034503550365037503850395040504150425043504450455046504750485049505050515052505350545055505650575058505950605061506250635064506550665067506850695070507150725073507450755076507750785079508050815082508350845085508650875088508950905091509250935094509550965097509850995100510151025103510451055106510751085109511051115112511351145115511651175118511951205121512251235124512551265127512851295130513151325133513451355136513751385139514051415142514351445145514651475148514951505151515251535154515551565157515851595160516151625163516451655166516751685169517051715172517351745175517651775178517951805181518251835184518551865187518851895190519151925193519451955196519751985199520052015202520352045205520652075208520952105211521252135214521552165217521852195220522152225223522452255226522752285229523052315232523352345235523652375238523952405241524252435244524552465247524852495250525152525253525452555256525752585259526052615262526352645265526652675268526952705271527252735274527552765277527852795280528152825283528452855286528752885289529052915292529352945295529652975298529953005301530253035304530553065307530853095310531153125313531453155316531753185319532053215322532353245325532653275328532953305331533253335334533553365337533853395340534153425343534453455346534753485349535053515352535353545355535653575358535953605361536253635364536553665367536853695370537153725373537453755376537753785379538053815382538353845385538653875388538953905391539253935394539553965397539853995400540154025403540454055406540754085409541054115412541354145415541654175418541954205421542254235424542554265427542854295430543154325433543454355436543754385439544054415442544354445445544654475448544954505451545254535454545554565457545854595460546154625463546454655466546754685469547054715472547354745475547654775478547954805481548254835484548554865487548854895490549154925493549454955496549754985499550055015502550355045505550655075508550955105511551255135514551555165517551855195520552155225523552455255526552755285529553055315532553355345535553655375538553955405541554255435544554555465547554855495550555155525553555455555556555755585559556055615562556355645565556655675568556955705571557255735574557555765577557855795580558155825583558455855586558755885589559055915592559355945595559655975598559956005601560256035604560556065607560856095610561156125613561456155616561756185619562056215622562356245625562656275628562956305631563256335634563556365637563856395640564156425643564456455646564756485649565056515652565356545655565656575658565956605661566256635664566556665667566856695670567156725673567456755676567756785679568056815682568356845685568656875688568956905691569256935694569556965697569856995700570157025703570457055706570757085709571057115712571357145715571657175718571957205721572257235724572557265727572857295730573157325733573457355736573757385739574057415742574357445745574657475748574957505751575257535754575557565757575857595760576157625763576457655766576757685769577057715772577357745775577657775778577957805781578257835784578557865787578857895790579157925793579457955796579757985799580058015802580358045805580658075808580958105811581258135814581558165817581858195820582158225823582458255826582758285829583058315832583358345835583658375838583958405841584258435844584558465847584858495850585158525853585458555856585758585859586058615862586358645865586658675868586958705871587258735874587558765877587858795880588158825883588458855886588758885889589058915892589358945895589658975898589959005901590259035904590559065907590859095910591159125913591459155916591759185919592059215922592359245925592659275928592959305931593259335934593559365937593859395940594159425943594459455946594759485949595059515952595359545955595659575958595959605961596259635964596559665967596859695970597159725973597459755976597759785979598059815982598359845985598659875988598959905991599259935994599559965997599859996000600160026003600460056006600760086009601060116012601360146015601660176018601960206021602260236024602560266027602860296030603160326033603460356036603760386039604060416042604360446045604660476048604960506051605260536054605560566057605860596060606160626063606460656066606760686069607060716072607360746075607660776078607960806081608260836084608560866087608860896090609160926093609460956096609760986099610061016102610361046105610661076108610961106111611261136114611561166117611861196120612161226123612461256126612761286129613061316132613361346135613661376138613961406141614261436144614561466147614861496150615161526153615461556156615761586159616061616162616361646165616661676168616961706171617261736174617561766177617861796180618161826183618461856186618761886189619061916192619361946195619661976198619962006201620262036204620562066207620862096210621162126213621462156216621762186219622062216222622362246225622662276228622962306231623262336234623562366237623862396240624162426243624462456246624762486249625062516252625362546255625662576258625962606261626262636264626562666267626862696270627162726273627462756276627762786279628062816282628362846285628662876288628962906291629262936294629562966297629862996300630163026303630463056306630763086309631063116312631363146315631663176318631963206321632263236324632563266327632863296330633163326333633463356336633763386339634063416342634363446345634663476348634963506351635263536354635563566357635863596360636163626363636463656366636763686369637063716372637363746375637663776378637963806381638263836384638563866387638863896390639163926393639463956396639763986399640064016402640364046405640664076408640964106411641264136414641564166417641864196420642164226423642464256426642764286429643064316432643364346435643664376438643964406441644264436444644564466447644864496450645164526453645464556456645764586459646064616462646364646465646664676468646964706471647264736474647564766477647864796480648164826483648464856486648764886489649064916492649364946495649664976498649965006501650265036504650565066507650865096510651165126513651465156516651765186519652065216522652365246525652665276528652965306531653265336534653565366537653865396540654165426543654465456546654765486549655065516552655365546555655665576558655965606561656265636564656565666567656865696570657165726573657465756576657765786579658065816582658365846585658665876588658965906591659265936594659565966597659865996600660166026603660466056606660766086609661066116612661366146615661666176618661966206621662266236624662566266627662866296630663166326633663466356636663766386639664066416642664366446645664666476648664966506651665266536654665566566657665866596660666166626663666466656666666766686669667066716672667366746675667666776678667966806681668266836684668566866687668866896690669166926693669466956696669766986699670067016702670367046705670667076708670967106711671267136714671567166717671867196720672167226723672467256726672767286729673067316732673367346735673667376738673967406741674267436744674567466747674867496750675167526753675467556756675767586759676067616762676367646765676667676768676967706771677267736774677567766777677867796780678167826783678467856786678767886789679067916792679367946795679667976798679968006801680268036804680568066807680868096810681168126813681468156816681768186819682068216822682368246825682668276828682968306831683268336834683568366837683868396840684168426843684468456846684768486849685068516852685368546855685668576858685968606861686268636864686568666867686868696870687168726873687468756876687768786879688068816882688368846885688668876888688968906891689268936894689568966897689868996900690169026903690469056906690769086909691069116912691369146915691669176918691969206921692269236924692569266927692869296930693169326933693469356936693769386939694069416942694369446945694669476948694969506951695269536954695569566957695869596960696169626963696469656966696769686969697069716972697369746975697669776978697969806981698269836984698569866987698869896990699169926993699469956996699769986999700070017002700370047005700670077008700970107011701270137014701570167017701870197020702170227023702470257026702770287029703070317032703370347035703670377038703970407041704270437044704570467047704870497050705170527053705470557056705770587059706070617062706370647065706670677068706970707071707270737074707570767077707870797080708170827083708470857086708770887089709070917092709370947095709670977098709971007101710271037104710571067107710871097110711171127113711471157116711771187119712071217122712371247125712671277128712971307131713271337134713571367137713871397140714171427143714471457146714771487149715071517152715371547155715671577158715971607161716271637164716571667167716871697170717171727173717471757176717771787179718071817182718371847185718671877188718971907191719271937194719571967197719871997200720172027203720472057206720772087209721072117212721372147215721672177218721972207221722272237224722572267227722872297230723172327233723472357236723772387239724072417242724372447245724672477248724972507251725272537254725572567257725872597260726172627263726472657266726772687269727072717272727372747275727672777278727972807281728272837284728572867287728872897290729172927293729472957296729772987299730073017302730373047305730673077308730973107311731273137314731573167317731873197320732173227323732473257326732773287329733073317332733373347335733673377338733973407341734273437344734573467347734873497350735173527353735473557356735773587359736073617362736373647365736673677368736973707371737273737374737573767377737873797380738173827383738473857386738773887389739073917392739373947395739673977398739974007401740274037404740574067407740874097410741174127413741474157416741774187419742074217422742374247425742674277428742974307431743274337434743574367437743874397440744174427443744474457446744774487449745074517452745374547455745674577458745974607461746274637464746574667467746874697470747174727473747474757476747774787479748074817482748374847485748674877488748974907491749274937494749574967497749874997500750175027503750475057506750775087509751075117512751375147515751675177518751975207521752275237524752575267527752875297530753175327533753475357536753775387539754075417542754375447545754675477548754975507551755275537554755575567557755875597560756175627563756475657566756775687569757075717572757375747575757675777578757975807581758275837584758575867587758875897590759175927593759475957596759775987599760076017602760376047605760676077608760976107611761276137614761576167617761876197620762176227623762476257626762776287629763076317632763376347635763676377638763976407641764276437644764576467647764876497650765176527653765476557656765776587659766076617662766376647665766676677668766976707671767276737674767576767677767876797680768176827683768476857686768776887689769076917692769376947695769676977698769977007701770277037704770577067707770877097710771177127713771477157716771777187719772077217722772377247725772677277728772977307731773277337734773577367737773877397740774177427743774477457746774777487749775077517752775377547755775677577758775977607761776277637764776577667767776877697770777177727773777477757776777777787779778077817782778377847785778677877788778977907791779277937794779577967797779877997800780178027803780478057806780778087809781078117812781378147815781678177818781978207821782278237824782578267827782878297830783178327833783478357836783778387839784078417842784378447845784678477848784978507851785278537854785578567857785878597860786178627863786478657866786778687869787078717872787378747875787678777878787978807881788278837884788578867887788878897890789178927893789478957896789778987899790079017902790379047905790679077908790979107911791279137914791579167917791879197920792179227923792479257926792779287929793079317932793379347935793679377938793979407941794279437944794579467947794879497950795179527953795479557956795779587959796079617962796379647965796679677968796979707971797279737974797579767977797879797980798179827983798479857986798779887989799079917992799379947995799679977998799980008001800280038004800580068007800880098010801180128013801480158016801780188019802080218022802380248025802680278028802980308031803280338034803580368037803880398040804180428043804480458046804780488049805080518052805380548055805680578058805980608061806280638064806580668067806880698070807180728073807480758076807780788079808080818082808380848085808680878088808980908091809280938094809580968097809880998100810181028103810481058106810781088109811081118112811381148115811681178118811981208121812281238124812581268127812881298130813181328133813481358136813781388139814081418142814381448145814681478148814981508151815281538154815581568157815881598160816181628163816481658166816781688169817081718172817381748175817681778178817981808181818281838184818581868187818881898190819181928193819481958196819781988199820082018202820382048205820682078208820982108211821282138214821582168217821882198220822182228223822482258226822782288229823082318232823382348235823682378238823982408241824282438244824582468247824882498250825182528253825482558256825782588259826082618262826382648265826682678268826982708271827282738274827582768277827882798280828182828283828482858286828782888289829082918292829382948295829682978298829983008301830283038304830583068307830883098310831183128313831483158316831783188319832083218322832383248325832683278328832983308331833283338334833583368337833883398340834183428343834483458346834783488349835083518352835383548355835683578358835983608361836283638364836583668367836883698370837183728373837483758376837783788379838083818382838383848385838683878388838983908391839283938394839583968397839883998400840184028403840484058406840784088409841084118412841384148415841684178418841984208421842284238424842584268427842884298430843184328433843484358436843784388439844084418442844384448445844684478448844984508451845284538454845584568457845884598460846184628463846484658466846784688469847084718472847384748475847684778478847984808481848284838484848584868487848884898490849184928493849484958496849784988499850085018502850385048505850685078508850985108511851285138514851585168517851885198520852185228523852485258526852785288529853085318532853385348535853685378538853985408541854285438544854585468547854885498550855185528553855485558556855785588559856085618562856385648565856685678568856985708571857285738574857585768577857885798580858185828583858485858586858785888589859085918592859385948595859685978598859986008601860286038604860586068607860886098610861186128613861486158616861786188619862086218622862386248625862686278628862986308631863286338634863586368637863886398640864186428643864486458646864786488649865086518652865386548655865686578658865986608661866286638664866586668667866886698670867186728673867486758676867786788679868086818682868386848685868686878688868986908691869286938694869586968697869886998700870187028703870487058706870787088709871087118712871387148715871687178718871987208721872287238724872587268727872887298730873187328733873487358736873787388739874087418742874387448745874687478748874987508751875287538754875587568757875887598760876187628763876487658766876787688769877087718772877387748775877687778778877987808781878287838784878587868787878887898790879187928793879487958796879787988799880088018802880388048805880688078808880988108811881288138814881588168817881888198820882188228823882488258826882788288829883088318832883388348835883688378838883988408841884288438844884588468847884888498850885188528853885488558856885788588859886088618862886388648865886688678868886988708871887288738874887588768877887888798880888188828883888488858886888788888889889088918892889388948895889688978898889989008901890289038904890589068907890889098910891189128913891489158916891789188919892089218922892389248925892689278928892989308931893289338934893589368937893889398940894189428943894489458946894789488949895089518952895389548955895689578958895989608961896289638964896589668967896889698970897189728973897489758976897789788979898089818982898389848985898689878988898989908991899289938994899589968997899889999000900190029003900490059006900790089009901090119012901390149015901690179018901990209021902290239024902590269027902890299030903190329033903490359036903790389039904090419042904390449045904690479048904990509051905290539054905590569057905890599060906190629063906490659066906790689069907090719072907390749075907690779078907990809081908290839084908590869087908890899090909190929093909490959096909790989099910091019102910391049105910691079108910991109111911291139114911591169117911891199120912191229123912491259126912791289129913091319132913391349135913691379138913991409141914291439144914591469147914891499150915191529153915491559156915791589159916091619162916391649165916691679168916991709171917291739174917591769177917891799180918191829183918491859186918791889189919091919192919391949195919691979198919992009201920292039204920592069207920892099210921192129213921492159216921792189219922092219222922392249225922692279228922992309231923292339234923592369237923892399240924192429243924492459246924792489249925092519252925392549255925692579258925992609261926292639264926592669267926892699270927192729273927492759276927792789279928092819282928392849285928692879288928992909291929292939294929592969297929892999300930193029303930493059306930793089309931093119312931393149315931693179318931993209321932293239324932593269327932893299330933193329333933493359336933793389339934093419342934393449345934693479348934993509351935293539354935593569357935893599360936193629363936493659366936793689369937093719372937393749375937693779378937993809381938293839384938593869387938893899390939193929393939493959396939793989399940094019402940394049405940694079408940994109411941294139414941594169417941894199420942194229423942494259426942794289429943094319432943394349435943694379438943994409441944294439444944594469447944894499450945194529453945494559456945794589459946094619462946394649465946694679468946994709471947294739474947594769477947894799480948194829483948494859486948794889489949094919492949394949495949694979498949995009501950295039504950595069507950895099510951195129513951495159516951795189519952095219522952395249525952695279528952995309531953295339534953595369537953895399540954195429543954495459546954795489549955095519552955395549555955695579558955995609561956295639564956595669567956895699570957195729573957495759576957795789579958095819582958395849585958695879588958995909591959295939594959595969597959895999600960196029603960496059606960796089609961096119612961396149615961696179618961996209621962296239624962596269627962896299630963196329633963496359636963796389639964096419642964396449645964696479648964996509651965296539654965596569657965896599660966196629663966496659666966796689669967096719672967396749675967696779678967996809681968296839684968596869687968896899690969196929693969496959696969796989699970097019702970397049705970697079708970997109711971297139714971597169717971897199720972197229723972497259726972797289729973097319732973397349735973697379738973997409741974297439744974597469747974897499750975197529753975497559756975797589759976097619762976397649765976697679768976997709771977297739774977597769777977897799780978197829783978497859786978797889789979097919792979397949795979697979798979998009801980298039804980598069807980898099810981198129813981498159816981798189819982098219822982398249825982698279828982998309831983298339834983598369837983898399840984198429843984498459846984798489849985098519852985398549855985698579858985998609861986298639864986598669867986898699870987198729873987498759876987798789879988098819882988398849885988698879888988998909891989298939894989598969897989898999900990199029903990499059906990799089909991099119912991399149915991699179918991999209921992299239924992599269927992899299930993199329933993499359936993799389939994099419942994399449945994699479948994999509951995299539954995599569957995899599960996199629963996499659966996799689969997099719972997399749975997699779978997999809981998299839984998599869987998899899990999199929993999499959996999799989999100001000110002100031000410005100061000710008100091001010011100121001310014100151001610017100181001910020100211002210023100241002510026100271002810029100301003110032100331003410035100361003710038100391004010041100421004310044100451004610047100481004910050100511005210053100541005510056100571005810059100601006110062100631006410065100661006710068100691007010071100721007310074100751007610077100781007910080100811008210083100841008510086100871008810089100901009110092100931009410095100961009710098100991010010101101021010310104101051010610107101081010910110101111011210113101141011510116101171011810119101201012110122101231012410125101261012710128101291013010131101321013310134101351013610137101381013910140101411014210143101441014510146101471014810149101501015110152101531015410155101561015710158101591016010161101621016310164101651016610167101681016910170101711017210173101741017510176101771017810179101801018110182101831018410185101861018710188101891019010191101921019310194101951019610197101981019910200102011020210203102041020510206102071020810209102101021110212102131021410215102161021710218102191022010221102221022310224102251022610227102281022910230102311023210233102341023510236102371023810239102401024110242102431024410245102461024710248102491025010251102521025310254102551025610257102581025910260102611026210263102641026510266102671026810269102701027110272102731027410275102761027710278102791028010281102821028310284102851028610287102881028910290102911029210293102941029510296102971029810299103001030110302103031030410305103061030710308103091031010311103121031310314103151031610317103181031910320103211032210323103241032510326103271032810329103301033110332103331033410335103361033710338103391034010341103421034310344103451034610347103481034910350103511035210353103541035510356103571035810359103601036110362103631036410365103661036710368103691037010371103721037310374103751037610377103781037910380103811038210383103841038510386103871038810389103901039110392103931039410395103961039710398103991040010401104021040310404104051040610407104081040910410104111041210413104141041510416104171041810419104201042110422104231042410425104261042710428104291043010431104321043310434104351043610437104381043910440104411044210443104441044510446104471044810449104501045110452104531045410455104561045710458104591046010461104621046310464104651046610467104681046910470104711047210473104741047510476104771047810479104801048110482104831048410485104861048710488104891049010491104921049310494104951049610497104981049910500105011050210503105041050510506105071050810509105101051110512105131051410515105161051710518105191052010521105221052310524105251052610527105281052910530105311053210533105341053510536105371053810539105401054110542105431054410545105461054710548105491055010551105521055310554105551055610557105581055910560105611056210563105641056510566105671056810569105701057110572105731057410575105761057710578105791058010581105821058310584105851058610587105881058910590105911059210593105941059510596105971059810599106001060110602106031060410605106061060710608106091061010611106121061310614106151061610617106181061910620106211062210623106241062510626106271062810629106301063110632106331063410635106361063710638106391064010641106421064310644106451064610647106481064910650106511065210653106541065510656106571065810659106601066110662106631066410665106661066710668106691067010671106721067310674106751067610677106781067910680106811068210683106841068510686106871068810689106901069110692106931069410695106961069710698106991070010701107021070310704107051070610707107081070910710107111071210713107141071510716107171071810719107201072110722107231072410725107261072710728107291073010731107321073310734107351073610737107381073910740107411074210743107441074510746107471074810749107501075110752107531075410755107561075710758107591076010761107621076310764107651076610767107681076910770107711077210773107741077510776107771077810779107801078110782107831078410785107861078710788107891079010791107921079310794107951079610797107981079910800108011080210803108041080510806108071080810809108101081110812108131081410815108161081710818108191082010821108221082310824108251082610827108281082910830108311083210833108341083510836108371083810839108401084110842108431084410845108461084710848108491085010851108521085310854108551085610857108581085910860108611086210863108641086510866108671086810869108701087110872108731087410875108761087710878108791088010881108821088310884108851088610887108881088910890108911089210893108941089510896108971089810899109001090110902109031090410905109061090710908109091091010911109121091310914109151091610917109181091910920109211092210923109241092510926109271092810929109301093110932109331093410935109361093710938109391094010941109421094310944109451094610947109481094910950109511095210953109541095510956109571095810959109601096110962109631096410965109661096710968109691097010971109721097310974109751097610977109781097910980109811098210983109841098510986109871098810989109901099110992109931099410995109961099710998109991100011001110021100311004110051100611007110081100911010110111101211013110141101511016110171101811019110201102111022110231102411025110261102711028110291103011031110321103311034110351103611037110381103911040110411104211043110441104511046110471104811049110501105111052110531105411055110561105711058110591106011061110621106311064110651106611067110681106911070110711107211073110741107511076110771107811079110801108111082110831108411085110861108711088110891109011091110921109311094110951109611097110981109911100111011110211103111041110511106111071110811109111101111111112111131111411115111161111711118111191112011121111221112311124111251112611127111281112911130111311113211133111341113511136111371113811139111401114111142111431114411145111461114711148111491115011151111521115311154111551115611157111581115911160111611116211163111641116511166111671116811169111701117111172111731117411175111761117711178111791118011181111821118311184111851118611187111881118911190111911119211193111941119511196111971119811199112001120111202112031120411205112061120711208112091121011211112121121311214112151121611217112181121911220112211122211223112241122511226112271122811229112301123111232112331123411235112361123711238112391124011241112421124311244112451124611247112481124911250112511125211253112541125511256112571125811259112601126111262112631126411265112661126711268112691127011271112721127311274112751127611277112781127911280112811128211283112841128511286112871128811289112901129111292112931129411295112961129711298112991130011301113021130311304113051130611307113081130911310113111131211313113141131511316113171131811319113201132111322113231132411325113261132711328113291133011331113321133311334113351133611337113381133911340113411134211343113441134511346113471134811349113501135111352113531135411355113561135711358113591136011361113621136311364113651136611367113681136911370113711137211373113741137511376113771137811379113801138111382113831138411385113861138711388113891139011391113921139311394113951139611397113981139911400114011140211403114041140511406114071140811409114101141111412114131141411415114161141711418114191142011421114221142311424114251142611427114281142911430114311143211433114341143511436114371143811439114401144111442114431144411445114461144711448114491145011451114521145311454114551145611457114581145911460114611146211463114641146511466114671146811469114701147111472114731147411475114761147711478114791148011481114821148311484114851148611487114881148911490114911149211493114941149511496114971149811499115001150111502115031150411505115061150711508115091151011511115121151311514115151151611517115181151911520115211152211523115241152511526115271152811529115301153111532115331153411535115361153711538115391154011541115421154311544115451154611547115481154911550115511155211553115541155511556115571155811559115601156111562115631156411565115661156711568115691157011571115721157311574115751157611577115781157911580115811158211583115841158511586115871158811589115901159111592115931159411595115961159711598115991160011601116021160311604116051160611607116081160911610116111161211613116141161511616116171161811619116201162111622116231162411625116261162711628116291163011631116321163311634116351163611637116381163911640116411164211643116441164511646116471164811649116501165111652116531165411655116561165711658116591166011661116621166311664116651166611667116681166911670116711167211673116741167511676116771167811679116801168111682116831168411685116861168711688116891169011691116921169311694116951169611697116981169911700117011170211703117041170511706117071170811709117101171111712117131171411715117161171711718117191172011721117221172311724117251172611727117281172911730117311173211733117341173511736117371173811739117401174111742117431174411745117461174711748117491175011751117521175311754117551175611757117581175911760117611176211763117641176511766117671176811769117701177111772117731177411775117761177711778117791178011781117821178311784117851178611787117881178911790117911179211793117941179511796117971179811799118001180111802118031180411805118061180711808118091181011811118121181311814118151181611817118181181911820118211182211823118241182511826118271182811829118301183111832118331183411835118361183711838118391184011841118421184311844118451184611847118481184911850118511185211853118541185511856118571185811859118601186111862118631186411865118661186711868118691187011871118721187311874118751187611877118781187911880118811188211883118841188511886118871188811889118901189111892118931189411895118961189711898118991190011901119021190311904119051190611907119081190911910119111191211913119141191511916119171191811919119201192111922119231192411925119261192711928119291193011931119321193311934119351193611937119381193911940119411194211943119441194511946119471194811949119501195111952119531195411955119561195711958119591196011961119621196311964119651196611967119681196911970119711197211973119741197511976119771197811979119801198111982119831198411985119861198711988119891199011991119921199311994119951199611997119981199912000120011200212003120041200512006120071200812009120101201112012120131201412015120161201712018120191202012021120221202312024120251202612027120281202912030120311203212033120341203512036120371203812039120401204112042120431204412045120461204712048120491205012051120521205312054120551205612057120581205912060120611206212063120641206512066120671206812069120701207112072120731207412075120761207712078120791208012081120821208312084120851208612087120881208912090120911209212093120941209512096120971209812099121001210112102121031210412105121061210712108121091211012111121121211312114121151211612117121181211912120121211212212123121241212512126121271212812129121301213112132121331213412135121361213712138121391214012141121421214312144121451214612147121481214912150121511215212153121541215512156121571215812159121601216112162121631216412165121661216712168121691217012171121721217312174121751217612177121781217912180121811218212183121841218512186121871218812189121901219112192121931219412195121961219712198121991220012201122021220312204122051220612207122081220912210122111221212213122141221512216122171221812219122201222112222122231222412225122261222712228122291223012231122321223312234122351223612237122381223912240122411224212243122441224512246122471224812249122501225112252122531225412255122561225712258122591226012261122621226312264122651226612267122681226912270122711227212273122741227512276122771227812279122801228112282122831228412285122861228712288122891229012291122921229312294122951229612297122981229912300123011230212303123041230512306123071230812309123101231112312123131231412315123161231712318123191232012321123221232312324123251232612327123281232912330123311233212333123341233512336123371233812339123401234112342123431234412345123461234712348123491235012351123521235312354123551235612357123581235912360123611236212363123641236512366123671236812369123701237112372123731237412375123761237712378123791238012381123821238312384123851238612387123881238912390123911239212393123941239512396123971239812399124001240112402124031240412405124061240712408124091241012411124121241312414124151241612417124181241912420124211242212423124241242512426124271242812429124301243112432124331243412435124361243712438124391244012441124421244312444124451244612447124481244912450124511245212453124541245512456124571245812459124601246112462124631246412465124661246712468124691247012471124721247312474124751247612477124781247912480124811248212483124841248512486124871248812489124901249112492124931249412495124961249712498124991250012501125021250312504125051250612507125081250912510125111251212513125141251512516125171251812519125201252112522125231252412525125261252712528125291253012531125321253312534125351253612537125381253912540125411254212543125441254512546125471254812549125501255112552125531255412555125561255712558125591256012561125621256312564125651256612567125681256912570125711257212573125741257512576125771257812579125801258112582125831258412585125861258712588125891259012591125921259312594125951259612597125981259912600126011260212603126041260512606126071260812609126101261112612126131261412615126161261712618126191262012621126221262312624126251262612627126281262912630126311263212633126341263512636126371263812639126401264112642126431264412645126461264712648126491265012651126521265312654126551265612657126581265912660126611266212663126641266512666126671266812669126701267112672126731267412675126761267712678126791268012681126821268312684126851268612687126881268912690126911269212693126941269512696126971269812699127001270112702127031270412705127061270712708127091271012711127121271312714127151271612717127181271912720127211272212723127241272512726127271272812729127301273112732127331273412735127361273712738127391274012741127421274312744127451274612747127481274912750127511275212753127541275512756127571275812759127601276112762127631276412765127661276712768127691277012771127721277312774127751277612777127781277912780127811278212783127841278512786127871278812789127901279112792127931279412795127961279712798127991280012801128021280312804128051280612807128081280912810128111281212813128141281512816128171281812819128201282112822128231282412825128261282712828128291283012831128321283312834128351283612837128381283912840128411284212843128441284512846128471284812849128501285112852128531285412855128561285712858128591286012861128621286312864128651286612867128681286912870128711287212873128741287512876128771287812879128801288112882128831288412885128861288712888128891289012891128921289312894128951289612897128981289912900129011290212903129041290512906129071290812909129101291112912129131291412915129161291712918129191292012921129221292312924129251292612927129281292912930129311293212933129341293512936129371293812939129401294112942129431294412945129461294712948129491295012951129521295312954129551295612957129581295912960129611296212963129641296512966129671296812969129701297112972129731297412975129761297712978129791298012981129821298312984129851298612987129881298912990129911299212993129941299512996129971299812999130001300113002130031300413005130061300713008130091301013011130121301313014130151301613017130181301913020130211302213023130241302513026130271302813029130301303113032130331303413035130361303713038130391304013041130421304313044130451304613047130481304913050130511305213053130541305513056130571305813059130601306113062130631306413065130661306713068130691307013071130721307313074130751307613077130781307913080130811308213083130841308513086130871308813089130901309113092130931309413095130961309713098130991310013101131021310313104131051310613107131081310913110131111311213113131141311513116131171311813119131201312113122131231312413125131261312713128131291313013131131321313313134131351313613137131381313913140131411314213143131441314513146131471314813149131501315113152131531315413155131561315713158131591316013161131621316313164131651316613167131681316913170131711317213173131741317513176131771317813179131801318113182131831318413185131861318713188131891319013191131921319313194131951319613197131981319913200132011320213203132041320513206132071320813209132101321113212132131321413215132161321713218132191322013221132221322313224132251322613227132281322913230132311323213233132341323513236132371323813239132401324113242132431324413245132461324713248132491325013251132521325313254132551325613257132581325913260132611326213263132641326513266132671326813269132701327113272132731327413275132761327713278132791328013281132821328313284132851328613287132881328913290132911329213293132941329513296132971329813299133001330113302133031330413305133061330713308133091331013311133121331313314133151331613317133181331913320133211332213323133241332513326133271332813329133301333113332133331333413335133361333713338133391334013341133421334313344133451334613347133481334913350133511335213353133541335513356133571335813359133601336113362133631336413365133661336713368133691337013371133721337313374133751337613377133781337913380133811338213383133841338513386133871338813389133901339113392133931339413395133961339713398133991340013401134021340313404134051340613407134081340913410134111341213413134141341513416134171341813419134201342113422134231342413425134261342713428134291343013431134321343313434134351343613437134381343913440134411344213443134441344513446134471344813449134501345113452134531345413455134561345713458134591346013461134621346313464134651346613467134681346913470134711347213473134741347513476134771347813479134801348113482134831348413485134861348713488134891349013491134921349313494134951349613497134981349913500135011350213503135041350513506135071350813509135101351113512135131351413515135161351713518135191352013521135221352313524135251352613527135281352913530135311353213533135341353513536135371353813539135401354113542135431354413545135461354713548135491355013551135521355313554135551355613557135581355913560135611356213563135641356513566135671356813569135701357113572135731357413575135761357713578135791358013581135821358313584135851358613587135881358913590135911359213593135941359513596135971359813599136001360113602136031360413605136061360713608136091361013611136121361313614136151361613617136181361913620136211362213623136241362513626136271362813629136301363113632136331363413635136361363713638136391364013641136421364313644136451364613647136481364913650136511365213653136541365513656136571365813659136601366113662136631366413665136661366713668136691367013671136721367313674136751367613677136781367913680136811368213683136841368513686136871368813689136901369113692136931369413695136961369713698136991370013701137021370313704137051370613707137081370913710137111371213713137141371513716137171371813719137201372113722137231372413725137261372713728137291373013731137321373313734137351373613737137381373913740137411374213743137441374513746137471374813749137501375113752137531375413755137561375713758137591376013761137621376313764137651376613767137681376913770137711377213773137741377513776137771377813779137801378113782137831378413785137861378713788137891379013791137921379313794137951379613797137981379913800138011380213803138041380513806138071380813809138101381113812138131381413815138161381713818138191382013821138221382313824138251382613827138281382913830138311383213833138341383513836138371383813839138401384113842138431384413845138461384713848138491385013851138521385313854138551385613857138581385913860138611386213863138641386513866138671386813869138701387113872138731387413875138761387713878138791388013881138821388313884138851388613887138881388913890138911389213893138941389513896138971389813899139001390113902139031390413905139061390713908139091391013911139121391313914139151391613917139181391913920139211392213923139241392513926139271392813929139301393113932139331393413935139361393713938139391394013941139421394313944139451394613947139481394913950139511395213953139541395513956139571395813959139601396113962139631396413965139661396713968139691397013971139721397313974139751397613977139781397913980139811398213983139841398513986139871398813989139901399113992139931399413995139961399713998139991400014001140021400314004140051400614007140081400914010140111401214013140141401514016140171401814019140201402114022140231402414025140261402714028140291403014031140321403314034140351403614037140381403914040140411404214043140441404514046140471404814049140501405114052140531405414055140561405714058140591406014061140621406314064140651406614067140681406914070140711407214073140741407514076140771407814079140801408114082140831408414085140861408714088140891409014091140921409314094140951409614097140981409914100141011410214103141041410514106141071410814109141101411114112141131411414115141161411714118141191412014121141221412314124141251412614127141281412914130141311413214133141341413514136141371413814139141401414114142141431414414145141461414714148141491415014151141521415314154141551415614157141581415914160141611416214163141641416514166141671416814169141701417114172141731417414175141761417714178141791418014181141821418314184141851418614187141881418914190141911419214193141941419514196141971419814199142001420114202142031420414205142061420714208142091421014211142121421314214142151421614217142181421914220142211422214223142241422514226142271422814229142301423114232142331423414235142361423714238142391424014241142421424314244142451424614247142481424914250142511425214253142541425514256142571425814259142601426114262142631426414265142661426714268142691427014271142721427314274142751427614277142781427914280142811428214283142841428514286142871428814289142901429114292142931429414295142961429714298142991430014301143021430314304143051430614307143081430914310143111431214313143141431514316143171431814319143201432114322143231432414325143261432714328143291433014331143321433314334143351433614337143381433914340143411434214343143441434514346143471434814349143501435114352143531435414355143561435714358143591436014361143621436314364143651436614367143681436914370143711437214373143741437514376143771437814379143801438114382143831438414385143861438714388143891439014391143921439314394143951439614397143981439914400144011440214403144041440514406144071440814409144101441114412144131441414415144161441714418144191442014421144221442314424144251442614427144281442914430144311443214433144341443514436144371443814439144401444114442144431444414445144461444714448144491445014451144521445314454144551445614457144581445914460144611446214463144641446514466144671446814469144701447114472144731447414475144761447714478144791448014481144821448314484144851448614487144881448914490144911449214493144941449514496144971449814499145001450114502145031450414505145061450714508145091451014511145121451314514145151451614517145181451914520145211452214523145241452514526145271452814529145301453114532145331453414535145361453714538145391454014541145421454314544145451454614547145481454914550145511455214553145541455514556145571455814559145601456114562145631456414565145661456714568145691457014571145721457314574145751457614577145781457914580145811458214583145841458514586145871458814589145901459114592145931459414595145961459714598145991460014601146021460314604146051460614607146081460914610146111461214613146141461514616146171461814619146201462114622146231462414625146261462714628146291463014631146321463314634146351463614637146381463914640146411464214643146441464514646146471464814649146501465114652146531465414655146561465714658146591466014661146621466314664146651466614667146681466914670146711467214673146741467514676146771467814679146801468114682146831468414685146861468714688146891469014691146921469314694146951469614697146981469914700147011470214703147041470514706147071470814709147101471114712147131471414715147161471714718147191472014721147221472314724147251472614727147281472914730147311473214733147341473514736147371473814739147401474114742147431474414745147461474714748147491475014751147521475314754147551475614757147581475914760147611476214763147641476514766147671476814769147701477114772147731477414775147761477714778147791478014781147821478314784147851478614787147881478914790147911479214793147941479514796147971479814799148001480114802148031480414805148061480714808148091481014811148121481314814148151481614817148181481914820148211482214823148241482514826148271482814829148301483114832148331483414835148361483714838148391484014841148421484314844148451484614847148481484914850148511485214853148541485514856148571485814859148601486114862148631486414865148661486714868148691487014871148721487314874148751487614877148781487914880148811488214883148841488514886148871488814889148901489114892148931489414895148961489714898148991490014901149021490314904149051490614907149081490914910149111491214913149141491514916149171491814919149201492114922149231492414925149261492714928149291493014931149321493314934149351493614937149381493914940149411494214943149441494514946149471494814949149501495114952149531495414955149561495714958149591496014961149621496314964149651496614967149681496914970149711497214973149741497514976149771497814979149801498114982149831498414985149861498714988149891499014991149921499314994149951499614997149981499915000150011500215003150041500515006150071500815009150101501115012150131501415015150161501715018150191502015021150221502315024150251502615027150281502915030150311503215033150341503515036150371503815039150401504115042150431504415045150461504715048150491505015051150521505315054150551505615057150581505915060150611506215063150641506515066150671506815069150701507115072150731507415075150761507715078150791508015081150821508315084150851508615087150881508915090150911509215093150941509515096150971509815099151001510115102151031510415105151061510715108151091511015111151121511315114151151511615117151181511915120151211512215123151241512515126151271512815129151301513115132151331513415135151361513715138151391514015141151421514315144151451514615147151481514915150151511515215153151541515515156151571515815159151601516115162151631516415165151661516715168151691517015171151721517315174151751517615177151781517915180151811518215183151841518515186151871518815189151901519115192151931519415195151961519715198151991520015201152021520315204152051520615207152081520915210152111521215213152141521515216152171521815219152201522115222152231522415225152261522715228152291523015231152321523315234152351523615237152381523915240152411524215243152441524515246152471524815249152501525115252152531525415255152561525715258152591526015261152621526315264152651526615267152681526915270152711527215273152741527515276152771527815279152801528115282152831528415285152861528715288152891529015291152921529315294152951529615297152981529915300153011530215303153041530515306153071530815309153101531115312153131531415315153161531715318153191532015321153221532315324153251532615327153281532915330153311533215333153341533515336153371533815339153401534115342153431534415345153461534715348153491535015351153521535315354153551535615357153581535915360153611536215363153641536515366153671536815369153701537115372153731537415375153761537715378153791538015381153821538315384153851538615387153881538915390153911539215393153941539515396153971539815399154001540115402154031540415405154061540715408154091541015411154121541315414154151541615417154181541915420154211542215423154241542515426154271542815429154301543115432154331543415435154361543715438154391544015441154421544315444154451544615447154481544915450154511545215453154541545515456154571545815459154601546115462154631546415465154661546715468154691547015471154721547315474154751547615477154781547915480154811548215483154841548515486154871548815489154901549115492154931549415495154961549715498154991550015501155021550315504155051550615507155081550915510155111551215513155141551515516155171551815519155201552115522155231552415525155261552715528155291553015531155321553315534155351553615537155381553915540155411554215543155441554515546155471554815549155501555115552155531555415555155561555715558155591556015561155621556315564155651556615567155681556915570155711557215573155741557515576155771557815579155801558115582155831558415585155861558715588155891559015591155921559315594155951559615597155981559915600156011560215603156041560515606156071560815609156101561115612156131561415615156161561715618156191562015621156221562315624156251562615627156281562915630156311563215633156341563515636156371563815639156401564115642156431564415645156461564715648156491565015651156521565315654156551565615657156581565915660156611566215663156641566515666156671566815669156701567115672156731567415675156761567715678156791568015681156821568315684156851568615687156881568915690156911569215693156941569515696156971569815699157001570115702157031570415705157061570715708157091571015711157121571315714157151571615717157181571915720157211572215723157241572515726157271572815729157301573115732157331573415735157361573715738157391574015741157421574315744157451574615747157481574915750157511575215753157541575515756157571575815759157601576115762157631576415765157661576715768157691577015771157721577315774157751577615777157781577915780157811578215783157841578515786157871578815789157901579115792157931579415795157961579715798157991580015801158021580315804158051580615807158081580915810158111581215813158141581515816158171581815819158201582115822158231582415825158261582715828158291583015831158321583315834158351583615837158381583915840158411584215843158441584515846158471584815849158501585115852158531585415855158561585715858158591586015861158621586315864158651586615867158681586915870158711587215873158741587515876158771587815879158801588115882158831588415885158861588715888158891589015891158921589315894158951589615897158981589915900159011590215903159041590515906159071590815909159101591115912159131591415915159161591715918159191592015921159221592315924159251592615927159281592915930159311593215933159341593515936159371593815939159401594115942159431594415945159461594715948159491595015951159521595315954159551595615957159581595915960159611596215963159641596515966159671596815969159701597115972159731597415975159761597715978159791598015981159821598315984159851598615987159881598915990159911599215993159941599515996159971599815999160001600116002160031600416005160061600716008160091601016011160121601316014160151601616017160181601916020160211602216023160241602516026160271602816029160301603116032160331603416035160361603716038160391604016041160421604316044160451604616047160481604916050160511605216053160541605516056160571605816059160601606116062160631606416065160661606716068160691607016071160721607316074160751607616077160781607916080160811608216083160841608516086160871608816089160901609116092160931609416095160961609716098160991610016101161021610316104161051610616107161081610916110161111611216113161141611516116161171611816119161201612116122161231612416125161261612716128161291613016131161321613316134161351613616137161381613916140161411614216143161441614516146161471614816149161501615116152161531615416155161561615716158161591616016161161621616316164161651616616167161681616916170161711617216173161741617516176161771617816179161801618116182161831618416185161861618716188161891619016191161921619316194161951619616197161981619916200162011620216203162041620516206162071620816209162101621116212162131621416215162161621716218162191622016221162221622316224162251622616227162281622916230162311623216233162341623516236162371623816239162401624116242162431624416245162461624716248162491625016251162521625316254162551625616257162581625916260162611626216263162641626516266162671626816269162701627116272162731627416275162761627716278162791628016281162821628316284162851628616287162881628916290162911629216293162941629516296162971629816299163001630116302163031630416305163061630716308163091631016311163121631316314163151631616317163181631916320163211632216323163241632516326163271632816329163301633116332163331633416335163361633716338163391634016341163421634316344163451634616347163481634916350163511635216353163541635516356163571635816359163601636116362163631636416365163661636716368163691637016371163721637316374163751637616377163781637916380163811638216383163841638516386163871638816389163901639116392163931639416395163961639716398163991640016401164021640316404164051640616407164081640916410164111641216413164141641516416164171641816419164201642116422164231642416425164261642716428164291643016431164321643316434164351643616437164381643916440164411644216443164441644516446164471644816449164501645116452164531645416455164561645716458164591646016461164621646316464164651646616467164681646916470164711647216473164741647516476164771647816479164801648116482164831648416485164861648716488164891649016491164921649316494164951649616497164981649916500165011650216503165041650516506165071650816509165101651116512165131651416515165161651716518165191652016521165221652316524165251652616527165281652916530165311653216533165341653516536165371653816539165401654116542165431654416545165461654716548165491655016551165521655316554165551655616557165581655916560165611656216563165641656516566165671656816569165701657116572165731657416575165761657716578165791658016581165821658316584165851658616587165881658916590165911659216593165941659516596165971659816599166001660116602166031660416605166061660716608166091661016611166121661316614166151661616617166181661916620166211662216623166241662516626166271662816629166301663116632166331663416635166361663716638166391664016641166421664316644166451664616647166481664916650166511665216653166541665516656166571665816659166601666116662166631666416665166661666716668166691667016671166721667316674166751667616677166781667916680166811668216683166841668516686166871668816689166901669116692166931669416695166961669716698166991670016701167021670316704167051670616707167081670916710167111671216713167141671516716167171671816719167201672116722167231672416725167261672716728167291673016731167321673316734167351673616737167381673916740167411674216743167441674516746167471674816749167501675116752167531675416755167561675716758167591676016761167621676316764167651676616767167681676916770167711677216773167741677516776167771677816779167801678116782167831678416785167861678716788167891679016791167921679316794167951679616797167981679916800168011680216803168041680516806168071680816809168101681116812168131681416815168161681716818168191682016821168221682316824168251682616827168281682916830168311683216833168341683516836168371683816839168401684116842168431684416845168461684716848168491685016851168521685316854168551685616857168581685916860168611686216863168641686516866168671686816869168701687116872168731687416875168761687716878168791688016881168821688316884168851688616887168881688916890168911689216893168941689516896168971689816899169001690116902169031690416905169061690716908169091691016911169121691316914169151691616917169181691916920169211692216923169241692516926169271692816929169301693116932169331693416935169361693716938169391694016941169421694316944169451694616947169481694916950169511695216953169541695516956169571695816959169601696116962169631696416965169661696716968169691697016971169721697316974169751697616977169781697916980169811698216983169841698516986169871698816989169901699116992169931699416995169961699716998169991700017001170021700317004170051700617007170081700917010170111701217013170141701517016170171701817019170201702117022170231702417025170261702717028170291703017031170321703317034170351703617037170381703917040170411704217043170441704517046170471704817049170501705117052170531705417055170561705717058170591706017061170621706317064170651706617067170681706917070170711707217073170741707517076170771707817079170801708117082170831708417085170861708717088170891709017091170921709317094170951709617097170981709917100171011710217103171041710517106171071710817109171101711117112171131711417115171161711717118171191712017121171221712317124171251712617127171281712917130171311713217133171341713517136171371713817139171401714117142171431714417145171461714717148171491715017151171521715317154171551715617157171581715917160171611716217163171641716517166171671716817169171701717117172171731717417175171761717717178171791718017181171821718317184171851718617187171881718917190171911719217193171941719517196171971719817199172001720117202172031720417205172061720717208172091721017211172121721317214172151721617217172181721917220172211722217223172241722517226172271722817229172301723117232172331723417235172361723717238172391724017241172421724317244172451724617247172481724917250172511725217253172541725517256172571725817259172601726117262172631726417265172661726717268172691727017271172721727317274172751727617277172781727917280172811728217283172841728517286172871728817289172901729117292172931729417295172961729717298172991730017301173021730317304173051730617307173081730917310173111731217313173141731517316173171731817319173201732117322173231732417325173261732717328173291733017331173321733317334173351733617337173381733917340173411734217343173441734517346173471734817349173501735117352173531735417355173561735717358173591736017361173621736317364173651736617367173681736917370173711737217373173741737517376173771737817379173801738117382173831738417385173861738717388173891739017391173921739317394173951739617397173981739917400174011740217403174041740517406174071740817409174101741117412174131741417415174161741717418174191742017421174221742317424174251742617427174281742917430174311743217433174341743517436174371743817439174401744117442174431744417445174461744717448174491745017451174521745317454174551745617457174581745917460174611746217463174641746517466174671746817469174701747117472174731747417475174761747717478174791748017481174821748317484174851748617487174881748917490174911749217493174941749517496174971749817499175001750117502175031750417505175061750717508175091751017511175121751317514175151751617517175181751917520175211752217523175241752517526175271752817529175301753117532175331753417535175361753717538175391754017541175421754317544175451754617547175481754917550175511755217553175541755517556175571755817559175601756117562175631756417565175661756717568175691757017571175721757317574175751757617577175781757917580175811758217583175841758517586175871758817589175901759117592175931759417595175961759717598175991760017601176021760317604176051760617607176081760917610176111761217613176141761517616176171761817619176201762117622176231762417625176261762717628176291763017631176321763317634176351763617637176381763917640176411764217643176441764517646176471764817649176501765117652176531765417655176561765717658176591766017661176621766317664176651766617667176681766917670176711767217673176741767517676176771767817679176801768117682
  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. /***/ 81:
  1164. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  1165. "use strict";
  1166. var __importStar = (this && this.__importStar) || function (mod) {
  1167. if (mod && mod.__esModule) return mod;
  1168. var result = {};
  1169. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  1170. result["default"] = mod;
  1171. return result;
  1172. };
  1173. Object.defineProperty(exports, "__esModule", { value: true });
  1174. const assert = __importStar(__webpack_require__(357));
  1175. const url_1 = __webpack_require__(835);
  1176. function getApiUrl() {
  1177. return process.env['GITHUB_API_URL'] || 'https://api.github.com';
  1178. }
  1179. exports.getApiUrl = getApiUrl;
  1180. function getFetchUrl(settings) {
  1181. assert.ok(settings.repositoryOwner, 'settings.repositoryOwner must be defined');
  1182. assert.ok(settings.repositoryName, 'settings.repositoryName must be defined');
  1183. const serviceUrl = getServerUrl();
  1184. const encodedOwner = encodeURIComponent(settings.repositoryOwner);
  1185. const encodedName = encodeURIComponent(settings.repositoryName);
  1186. if (settings.sshKey) {
  1187. return `git@${serviceUrl.hostname}:${encodedOwner}/${encodedName}.git`;
  1188. }
  1189. // "origin" is SCHEME://HOSTNAME[:PORT]
  1190. return `${serviceUrl.origin}/${encodedOwner}/${encodedName}`;
  1191. }
  1192. exports.getFetchUrl = getFetchUrl;
  1193. function getServerUrl() {
  1194. return new url_1.URL(process.env['GITHUB_URL'] || 'https://github.com');
  1195. }
  1196. exports.getServerUrl = getServerUrl;
  1197. /***/ }),
  1198. /***/ 87:
  1199. /***/ (function(module) {
  1200. module.exports = require("os");
  1201. /***/ }),
  1202. /***/ 118:
  1203. /***/ (function(module, __unusedexports, __webpack_require__) {
  1204. "use strict";
  1205. const os = __webpack_require__(87);
  1206. const nameMap = new Map([
  1207. [19, 'Catalina'],
  1208. [18, 'Mojave'],
  1209. [17, 'High Sierra'],
  1210. [16, 'Sierra'],
  1211. [15, 'El Capitan'],
  1212. [14, 'Yosemite'],
  1213. [13, 'Mavericks'],
  1214. [12, 'Mountain Lion'],
  1215. [11, 'Lion'],
  1216. [10, 'Snow Leopard'],
  1217. [9, 'Leopard'],
  1218. [8, 'Tiger'],
  1219. [7, 'Panther'],
  1220. [6, 'Jaguar'],
  1221. [5, 'Puma']
  1222. ]);
  1223. const macosRelease = release => {
  1224. release = Number((release || os.release()).split('.')[0]);
  1225. return {
  1226. name: nameMap.get(release),
  1227. version: '10.' + (release - 4)
  1228. };
  1229. };
  1230. module.exports = macosRelease;
  1231. // TODO: remove this in the next major version
  1232. module.exports.default = macosRelease;
  1233. /***/ }),
  1234. /***/ 126:
  1235. /***/ (function(module) {
  1236. /**
  1237. * lodash (Custom Build) <https://lodash.com/>
  1238. * Build: `lodash modularize exports="npm" -o ./`
  1239. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1240. * Released under MIT license <https://lodash.com/license>
  1241. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1242. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1243. */
  1244. /** Used as the size to enable large array optimizations. */
  1245. var LARGE_ARRAY_SIZE = 200;
  1246. /** Used to stand-in for `undefined` hash values. */
  1247. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1248. /** Used as references for various `Number` constants. */
  1249. var INFINITY = 1 / 0;
  1250. /** `Object#toString` result references. */
  1251. var funcTag = '[object Function]',
  1252. genTag = '[object GeneratorFunction]';
  1253. /**
  1254. * Used to match `RegExp`
  1255. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1256. */
  1257. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1258. /** Used to detect host constructors (Safari). */
  1259. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1260. /** Detect free variable `global` from Node.js. */
  1261. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1262. /** Detect free variable `self`. */
  1263. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1264. /** Used as a reference to the global object. */
  1265. var root = freeGlobal || freeSelf || Function('return this')();
  1266. /**
  1267. * A specialized version of `_.includes` for arrays without support for
  1268. * specifying an index to search from.
  1269. *
  1270. * @private
  1271. * @param {Array} [array] The array to inspect.
  1272. * @param {*} target The value to search for.
  1273. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1274. */
  1275. function arrayIncludes(array, value) {
  1276. var length = array ? array.length : 0;
  1277. return !!length && baseIndexOf(array, value, 0) > -1;
  1278. }
  1279. /**
  1280. * This function is like `arrayIncludes` except that it accepts a comparator.
  1281. *
  1282. * @private
  1283. * @param {Array} [array] The array to inspect.
  1284. * @param {*} target The value to search for.
  1285. * @param {Function} comparator The comparator invoked per element.
  1286. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1287. */
  1288. function arrayIncludesWith(array, value, comparator) {
  1289. var index = -1,
  1290. length = array ? array.length : 0;
  1291. while (++index < length) {
  1292. if (comparator(value, array[index])) {
  1293. return true;
  1294. }
  1295. }
  1296. return false;
  1297. }
  1298. /**
  1299. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1300. * support for iteratee shorthands.
  1301. *
  1302. * @private
  1303. * @param {Array} array The array to inspect.
  1304. * @param {Function} predicate The function invoked per iteration.
  1305. * @param {number} fromIndex The index to search from.
  1306. * @param {boolean} [fromRight] Specify iterating from right to left.
  1307. * @returns {number} Returns the index of the matched value, else `-1`.
  1308. */
  1309. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1310. var length = array.length,
  1311. index = fromIndex + (fromRight ? 1 : -1);
  1312. while ((fromRight ? index-- : ++index < length)) {
  1313. if (predicate(array[index], index, array)) {
  1314. return index;
  1315. }
  1316. }
  1317. return -1;
  1318. }
  1319. /**
  1320. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1321. *
  1322. * @private
  1323. * @param {Array} array The array to inspect.
  1324. * @param {*} value The value to search for.
  1325. * @param {number} fromIndex The index to search from.
  1326. * @returns {number} Returns the index of the matched value, else `-1`.
  1327. */
  1328. function baseIndexOf(array, value, fromIndex) {
  1329. if (value !== value) {
  1330. return baseFindIndex(array, baseIsNaN, fromIndex);
  1331. }
  1332. var index = fromIndex - 1,
  1333. length = array.length;
  1334. while (++index < length) {
  1335. if (array[index] === value) {
  1336. return index;
  1337. }
  1338. }
  1339. return -1;
  1340. }
  1341. /**
  1342. * The base implementation of `_.isNaN` without support for number objects.
  1343. *
  1344. * @private
  1345. * @param {*} value The value to check.
  1346. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1347. */
  1348. function baseIsNaN(value) {
  1349. return value !== value;
  1350. }
  1351. /**
  1352. * Checks if a cache value for `key` exists.
  1353. *
  1354. * @private
  1355. * @param {Object} cache The cache to query.
  1356. * @param {string} key The key of the entry to check.
  1357. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1358. */
  1359. function cacheHas(cache, key) {
  1360. return cache.has(key);
  1361. }
  1362. /**
  1363. * Gets the value at `key` of `object`.
  1364. *
  1365. * @private
  1366. * @param {Object} [object] The object to query.
  1367. * @param {string} key The key of the property to get.
  1368. * @returns {*} Returns the property value.
  1369. */
  1370. function getValue(object, key) {
  1371. return object == null ? undefined : object[key];
  1372. }
  1373. /**
  1374. * Checks if `value` is a host object in IE < 9.
  1375. *
  1376. * @private
  1377. * @param {*} value The value to check.
  1378. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1379. */
  1380. function isHostObject(value) {
  1381. // Many host objects are `Object` objects that can coerce to strings
  1382. // despite having improperly defined `toString` methods.
  1383. var result = false;
  1384. if (value != null && typeof value.toString != 'function') {
  1385. try {
  1386. result = !!(value + '');
  1387. } catch (e) {}
  1388. }
  1389. return result;
  1390. }
  1391. /**
  1392. * Converts `set` to an array of its values.
  1393. *
  1394. * @private
  1395. * @param {Object} set The set to convert.
  1396. * @returns {Array} Returns the values.
  1397. */
  1398. function setToArray(set) {
  1399. var index = -1,
  1400. result = Array(set.size);
  1401. set.forEach(function(value) {
  1402. result[++index] = value;
  1403. });
  1404. return result;
  1405. }
  1406. /** Used for built-in method references. */
  1407. var arrayProto = Array.prototype,
  1408. funcProto = Function.prototype,
  1409. objectProto = Object.prototype;
  1410. /** Used to detect overreaching core-js shims. */
  1411. var coreJsData = root['__core-js_shared__'];
  1412. /** Used to detect methods masquerading as native. */
  1413. var maskSrcKey = (function() {
  1414. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1415. return uid ? ('Symbol(src)_1.' + uid) : '';
  1416. }());
  1417. /** Used to resolve the decompiled source of functions. */
  1418. var funcToString = funcProto.toString;
  1419. /** Used to check objects for own properties. */
  1420. var hasOwnProperty = objectProto.hasOwnProperty;
  1421. /**
  1422. * Used to resolve the
  1423. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1424. * of values.
  1425. */
  1426. var objectToString = objectProto.toString;
  1427. /** Used to detect if a method is native. */
  1428. var reIsNative = RegExp('^' +
  1429. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1430. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1431. );
  1432. /** Built-in value references. */
  1433. var splice = arrayProto.splice;
  1434. /* Built-in method references that are verified to be native. */
  1435. var Map = getNative(root, 'Map'),
  1436. Set = getNative(root, 'Set'),
  1437. nativeCreate = getNative(Object, 'create');
  1438. /**
  1439. * Creates a hash object.
  1440. *
  1441. * @private
  1442. * @constructor
  1443. * @param {Array} [entries] The key-value pairs to cache.
  1444. */
  1445. function Hash(entries) {
  1446. var index = -1,
  1447. length = entries ? entries.length : 0;
  1448. this.clear();
  1449. while (++index < length) {
  1450. var entry = entries[index];
  1451. this.set(entry[0], entry[1]);
  1452. }
  1453. }
  1454. /**
  1455. * Removes all key-value entries from the hash.
  1456. *
  1457. * @private
  1458. * @name clear
  1459. * @memberOf Hash
  1460. */
  1461. function hashClear() {
  1462. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1463. }
  1464. /**
  1465. * Removes `key` and its value from the hash.
  1466. *
  1467. * @private
  1468. * @name delete
  1469. * @memberOf Hash
  1470. * @param {Object} hash The hash to modify.
  1471. * @param {string} key The key of the value to remove.
  1472. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1473. */
  1474. function hashDelete(key) {
  1475. return this.has(key) && delete this.__data__[key];
  1476. }
  1477. /**
  1478. * Gets the hash value for `key`.
  1479. *
  1480. * @private
  1481. * @name get
  1482. * @memberOf Hash
  1483. * @param {string} key The key of the value to get.
  1484. * @returns {*} Returns the entry value.
  1485. */
  1486. function hashGet(key) {
  1487. var data = this.__data__;
  1488. if (nativeCreate) {
  1489. var result = data[key];
  1490. return result === HASH_UNDEFINED ? undefined : result;
  1491. }
  1492. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1493. }
  1494. /**
  1495. * Checks if a hash value for `key` exists.
  1496. *
  1497. * @private
  1498. * @name has
  1499. * @memberOf Hash
  1500. * @param {string} key The key of the entry to check.
  1501. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1502. */
  1503. function hashHas(key) {
  1504. var data = this.__data__;
  1505. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1506. }
  1507. /**
  1508. * Sets the hash `key` to `value`.
  1509. *
  1510. * @private
  1511. * @name set
  1512. * @memberOf Hash
  1513. * @param {string} key The key of the value to set.
  1514. * @param {*} value The value to set.
  1515. * @returns {Object} Returns the hash instance.
  1516. */
  1517. function hashSet(key, value) {
  1518. var data = this.__data__;
  1519. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1520. return this;
  1521. }
  1522. // Add methods to `Hash`.
  1523. Hash.prototype.clear = hashClear;
  1524. Hash.prototype['delete'] = hashDelete;
  1525. Hash.prototype.get = hashGet;
  1526. Hash.prototype.has = hashHas;
  1527. Hash.prototype.set = hashSet;
  1528. /**
  1529. * Creates an list cache object.
  1530. *
  1531. * @private
  1532. * @constructor
  1533. * @param {Array} [entries] The key-value pairs to cache.
  1534. */
  1535. function ListCache(entries) {
  1536. var index = -1,
  1537. length = entries ? entries.length : 0;
  1538. this.clear();
  1539. while (++index < length) {
  1540. var entry = entries[index];
  1541. this.set(entry[0], entry[1]);
  1542. }
  1543. }
  1544. /**
  1545. * Removes all key-value entries from the list cache.
  1546. *
  1547. * @private
  1548. * @name clear
  1549. * @memberOf ListCache
  1550. */
  1551. function listCacheClear() {
  1552. this.__data__ = [];
  1553. }
  1554. /**
  1555. * Removes `key` and its value from the list cache.
  1556. *
  1557. * @private
  1558. * @name delete
  1559. * @memberOf ListCache
  1560. * @param {string} key The key of the value to remove.
  1561. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1562. */
  1563. function listCacheDelete(key) {
  1564. var data = this.__data__,
  1565. index = assocIndexOf(data, key);
  1566. if (index < 0) {
  1567. return false;
  1568. }
  1569. var lastIndex = data.length - 1;
  1570. if (index == lastIndex) {
  1571. data.pop();
  1572. } else {
  1573. splice.call(data, index, 1);
  1574. }
  1575. return true;
  1576. }
  1577. /**
  1578. * Gets the list cache value for `key`.
  1579. *
  1580. * @private
  1581. * @name get
  1582. * @memberOf ListCache
  1583. * @param {string} key The key of the value to get.
  1584. * @returns {*} Returns the entry value.
  1585. */
  1586. function listCacheGet(key) {
  1587. var data = this.__data__,
  1588. index = assocIndexOf(data, key);
  1589. return index < 0 ? undefined : data[index][1];
  1590. }
  1591. /**
  1592. * Checks if a list cache value for `key` exists.
  1593. *
  1594. * @private
  1595. * @name has
  1596. * @memberOf ListCache
  1597. * @param {string} key The key of the entry to check.
  1598. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1599. */
  1600. function listCacheHas(key) {
  1601. return assocIndexOf(this.__data__, key) > -1;
  1602. }
  1603. /**
  1604. * Sets the list cache `key` to `value`.
  1605. *
  1606. * @private
  1607. * @name set
  1608. * @memberOf ListCache
  1609. * @param {string} key The key of the value to set.
  1610. * @param {*} value The value to set.
  1611. * @returns {Object} Returns the list cache instance.
  1612. */
  1613. function listCacheSet(key, value) {
  1614. var data = this.__data__,
  1615. index = assocIndexOf(data, key);
  1616. if (index < 0) {
  1617. data.push([key, value]);
  1618. } else {
  1619. data[index][1] = value;
  1620. }
  1621. return this;
  1622. }
  1623. // Add methods to `ListCache`.
  1624. ListCache.prototype.clear = listCacheClear;
  1625. ListCache.prototype['delete'] = listCacheDelete;
  1626. ListCache.prototype.get = listCacheGet;
  1627. ListCache.prototype.has = listCacheHas;
  1628. ListCache.prototype.set = listCacheSet;
  1629. /**
  1630. * Creates a map cache object to store key-value pairs.
  1631. *
  1632. * @private
  1633. * @constructor
  1634. * @param {Array} [entries] The key-value pairs to cache.
  1635. */
  1636. function MapCache(entries) {
  1637. var index = -1,
  1638. length = entries ? entries.length : 0;
  1639. this.clear();
  1640. while (++index < length) {
  1641. var entry = entries[index];
  1642. this.set(entry[0], entry[1]);
  1643. }
  1644. }
  1645. /**
  1646. * Removes all key-value entries from the map.
  1647. *
  1648. * @private
  1649. * @name clear
  1650. * @memberOf MapCache
  1651. */
  1652. function mapCacheClear() {
  1653. this.__data__ = {
  1654. 'hash': new Hash,
  1655. 'map': new (Map || ListCache),
  1656. 'string': new Hash
  1657. };
  1658. }
  1659. /**
  1660. * Removes `key` and its value from the map.
  1661. *
  1662. * @private
  1663. * @name delete
  1664. * @memberOf MapCache
  1665. * @param {string} key The key of the value to remove.
  1666. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1667. */
  1668. function mapCacheDelete(key) {
  1669. return getMapData(this, key)['delete'](key);
  1670. }
  1671. /**
  1672. * Gets the map value for `key`.
  1673. *
  1674. * @private
  1675. * @name get
  1676. * @memberOf MapCache
  1677. * @param {string} key The key of the value to get.
  1678. * @returns {*} Returns the entry value.
  1679. */
  1680. function mapCacheGet(key) {
  1681. return getMapData(this, key).get(key);
  1682. }
  1683. /**
  1684. * Checks if a map value for `key` exists.
  1685. *
  1686. * @private
  1687. * @name has
  1688. * @memberOf MapCache
  1689. * @param {string} key The key of the entry to check.
  1690. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1691. */
  1692. function mapCacheHas(key) {
  1693. return getMapData(this, key).has(key);
  1694. }
  1695. /**
  1696. * Sets the map `key` to `value`.
  1697. *
  1698. * @private
  1699. * @name set
  1700. * @memberOf MapCache
  1701. * @param {string} key The key of the value to set.
  1702. * @param {*} value The value to set.
  1703. * @returns {Object} Returns the map cache instance.
  1704. */
  1705. function mapCacheSet(key, value) {
  1706. getMapData(this, key).set(key, value);
  1707. return this;
  1708. }
  1709. // Add methods to `MapCache`.
  1710. MapCache.prototype.clear = mapCacheClear;
  1711. MapCache.prototype['delete'] = mapCacheDelete;
  1712. MapCache.prototype.get = mapCacheGet;
  1713. MapCache.prototype.has = mapCacheHas;
  1714. MapCache.prototype.set = mapCacheSet;
  1715. /**
  1716. *
  1717. * Creates an array cache object to store unique values.
  1718. *
  1719. * @private
  1720. * @constructor
  1721. * @param {Array} [values] The values to cache.
  1722. */
  1723. function SetCache(values) {
  1724. var index = -1,
  1725. length = values ? values.length : 0;
  1726. this.__data__ = new MapCache;
  1727. while (++index < length) {
  1728. this.add(values[index]);
  1729. }
  1730. }
  1731. /**
  1732. * Adds `value` to the array cache.
  1733. *
  1734. * @private
  1735. * @name add
  1736. * @memberOf SetCache
  1737. * @alias push
  1738. * @param {*} value The value to cache.
  1739. * @returns {Object} Returns the cache instance.
  1740. */
  1741. function setCacheAdd(value) {
  1742. this.__data__.set(value, HASH_UNDEFINED);
  1743. return this;
  1744. }
  1745. /**
  1746. * Checks if `value` is in the array cache.
  1747. *
  1748. * @private
  1749. * @name has
  1750. * @memberOf SetCache
  1751. * @param {*} value The value to search for.
  1752. * @returns {number} Returns `true` if `value` is found, else `false`.
  1753. */
  1754. function setCacheHas(value) {
  1755. return this.__data__.has(value);
  1756. }
  1757. // Add methods to `SetCache`.
  1758. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1759. SetCache.prototype.has = setCacheHas;
  1760. /**
  1761. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1762. *
  1763. * @private
  1764. * @param {Array} array The array to inspect.
  1765. * @param {*} key The key to search for.
  1766. * @returns {number} Returns the index of the matched value, else `-1`.
  1767. */
  1768. function assocIndexOf(array, key) {
  1769. var length = array.length;
  1770. while (length--) {
  1771. if (eq(array[length][0], key)) {
  1772. return length;
  1773. }
  1774. }
  1775. return -1;
  1776. }
  1777. /**
  1778. * The base implementation of `_.isNative` without bad shim checks.
  1779. *
  1780. * @private
  1781. * @param {*} value The value to check.
  1782. * @returns {boolean} Returns `true` if `value` is a native function,
  1783. * else `false`.
  1784. */
  1785. function baseIsNative(value) {
  1786. if (!isObject(value) || isMasked(value)) {
  1787. return false;
  1788. }
  1789. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1790. return pattern.test(toSource(value));
  1791. }
  1792. /**
  1793. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1794. *
  1795. * @private
  1796. * @param {Array} array The array to inspect.
  1797. * @param {Function} [iteratee] The iteratee invoked per element.
  1798. * @param {Function} [comparator] The comparator invoked per element.
  1799. * @returns {Array} Returns the new duplicate free array.
  1800. */
  1801. function baseUniq(array, iteratee, comparator) {
  1802. var index = -1,
  1803. includes = arrayIncludes,
  1804. length = array.length,
  1805. isCommon = true,
  1806. result = [],
  1807. seen = result;
  1808. if (comparator) {
  1809. isCommon = false;
  1810. includes = arrayIncludesWith;
  1811. }
  1812. else if (length >= LARGE_ARRAY_SIZE) {
  1813. var set = iteratee ? null : createSet(array);
  1814. if (set) {
  1815. return setToArray(set);
  1816. }
  1817. isCommon = false;
  1818. includes = cacheHas;
  1819. seen = new SetCache;
  1820. }
  1821. else {
  1822. seen = iteratee ? [] : result;
  1823. }
  1824. outer:
  1825. while (++index < length) {
  1826. var value = array[index],
  1827. computed = iteratee ? iteratee(value) : value;
  1828. value = (comparator || value !== 0) ? value : 0;
  1829. if (isCommon && computed === computed) {
  1830. var seenIndex = seen.length;
  1831. while (seenIndex--) {
  1832. if (seen[seenIndex] === computed) {
  1833. continue outer;
  1834. }
  1835. }
  1836. if (iteratee) {
  1837. seen.push(computed);
  1838. }
  1839. result.push(value);
  1840. }
  1841. else if (!includes(seen, computed, comparator)) {
  1842. if (seen !== result) {
  1843. seen.push(computed);
  1844. }
  1845. result.push(value);
  1846. }
  1847. }
  1848. return result;
  1849. }
  1850. /**
  1851. * Creates a set object of `values`.
  1852. *
  1853. * @private
  1854. * @param {Array} values The values to add to the set.
  1855. * @returns {Object} Returns the new set.
  1856. */
  1857. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1858. return new Set(values);
  1859. };
  1860. /**
  1861. * Gets the data for `map`.
  1862. *
  1863. * @private
  1864. * @param {Object} map The map to query.
  1865. * @param {string} key The reference key.
  1866. * @returns {*} Returns the map data.
  1867. */
  1868. function getMapData(map, key) {
  1869. var data = map.__data__;
  1870. return isKeyable(key)
  1871. ? data[typeof key == 'string' ? 'string' : 'hash']
  1872. : data.map;
  1873. }
  1874. /**
  1875. * Gets the native function at `key` of `object`.
  1876. *
  1877. * @private
  1878. * @param {Object} object The object to query.
  1879. * @param {string} key The key of the method to get.
  1880. * @returns {*} Returns the function if it's native, else `undefined`.
  1881. */
  1882. function getNative(object, key) {
  1883. var value = getValue(object, key);
  1884. return baseIsNative(value) ? value : undefined;
  1885. }
  1886. /**
  1887. * Checks if `value` is suitable for use as unique object key.
  1888. *
  1889. * @private
  1890. * @param {*} value The value to check.
  1891. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1892. */
  1893. function isKeyable(value) {
  1894. var type = typeof value;
  1895. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1896. ? (value !== '__proto__')
  1897. : (value === null);
  1898. }
  1899. /**
  1900. * Checks if `func` has its source masked.
  1901. *
  1902. * @private
  1903. * @param {Function} func The function to check.
  1904. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1905. */
  1906. function isMasked(func) {
  1907. return !!maskSrcKey && (maskSrcKey in func);
  1908. }
  1909. /**
  1910. * Converts `func` to its source code.
  1911. *
  1912. * @private
  1913. * @param {Function} func The function to process.
  1914. * @returns {string} Returns the source code.
  1915. */
  1916. function toSource(func) {
  1917. if (func != null) {
  1918. try {
  1919. return funcToString.call(func);
  1920. } catch (e) {}
  1921. try {
  1922. return (func + '');
  1923. } catch (e) {}
  1924. }
  1925. return '';
  1926. }
  1927. /**
  1928. * Creates a duplicate-free version of an array, using
  1929. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1930. * for equality comparisons, in which only the first occurrence of each
  1931. * element is kept.
  1932. *
  1933. * @static
  1934. * @memberOf _
  1935. * @since 0.1.0
  1936. * @category Array
  1937. * @param {Array} array The array to inspect.
  1938. * @returns {Array} Returns the new duplicate free array.
  1939. * @example
  1940. *
  1941. * _.uniq([2, 1, 2]);
  1942. * // => [2, 1]
  1943. */
  1944. function uniq(array) {
  1945. return (array && array.length)
  1946. ? baseUniq(array)
  1947. : [];
  1948. }
  1949. /**
  1950. * Performs a
  1951. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1952. * comparison between two values to determine if they are equivalent.
  1953. *
  1954. * @static
  1955. * @memberOf _
  1956. * @since 4.0.0
  1957. * @category Lang
  1958. * @param {*} value The value to compare.
  1959. * @param {*} other The other value to compare.
  1960. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1961. * @example
  1962. *
  1963. * var object = { 'a': 1 };
  1964. * var other = { 'a': 1 };
  1965. *
  1966. * _.eq(object, object);
  1967. * // => true
  1968. *
  1969. * _.eq(object, other);
  1970. * // => false
  1971. *
  1972. * _.eq('a', 'a');
  1973. * // => true
  1974. *
  1975. * _.eq('a', Object('a'));
  1976. * // => false
  1977. *
  1978. * _.eq(NaN, NaN);
  1979. * // => true
  1980. */
  1981. function eq(value, other) {
  1982. return value === other || (value !== value && other !== other);
  1983. }
  1984. /**
  1985. * Checks if `value` is classified as a `Function` object.
  1986. *
  1987. * @static
  1988. * @memberOf _
  1989. * @since 0.1.0
  1990. * @category Lang
  1991. * @param {*} value The value to check.
  1992. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1993. * @example
  1994. *
  1995. * _.isFunction(_);
  1996. * // => true
  1997. *
  1998. * _.isFunction(/abc/);
  1999. * // => false
  2000. */
  2001. function isFunction(value) {
  2002. // The use of `Object#toString` avoids issues with the `typeof` operator
  2003. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  2004. var tag = isObject(value) ? objectToString.call(value) : '';
  2005. return tag == funcTag || tag == genTag;
  2006. }
  2007. /**
  2008. * Checks if `value` is the
  2009. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  2010. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  2011. *
  2012. * @static
  2013. * @memberOf _
  2014. * @since 0.1.0
  2015. * @category Lang
  2016. * @param {*} value The value to check.
  2017. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  2018. * @example
  2019. *
  2020. * _.isObject({});
  2021. * // => true
  2022. *
  2023. * _.isObject([1, 2, 3]);
  2024. * // => true
  2025. *
  2026. * _.isObject(_.noop);
  2027. * // => true
  2028. *
  2029. * _.isObject(null);
  2030. * // => false
  2031. */
  2032. function isObject(value) {
  2033. var type = typeof value;
  2034. return !!value && (type == 'object' || type == 'function');
  2035. }
  2036. /**
  2037. * This method returns `undefined`.
  2038. *
  2039. * @static
  2040. * @memberOf _
  2041. * @since 2.3.0
  2042. * @category Util
  2043. * @example
  2044. *
  2045. * _.times(2, _.noop);
  2046. * // => [undefined, undefined]
  2047. */
  2048. function noop() {
  2049. // No operation performed.
  2050. }
  2051. module.exports = uniq;
  2052. /***/ }),
  2053. /***/ 129:
  2054. /***/ (function(module) {
  2055. module.exports = require("child_process");
  2056. /***/ }),
  2057. /***/ 139:
  2058. /***/ (function(module, __unusedexports, __webpack_require__) {
  2059. // Unique ID creation requires a high quality random # generator. In node.js
  2060. // this is pretty straight-forward - we use the crypto API.
  2061. var crypto = __webpack_require__(417);
  2062. module.exports = function nodeRNG() {
  2063. return crypto.randomBytes(16);
  2064. };
  2065. /***/ }),
  2066. /***/ 141:
  2067. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2068. "use strict";
  2069. var net = __webpack_require__(631);
  2070. var tls = __webpack_require__(16);
  2071. var http = __webpack_require__(605);
  2072. var https = __webpack_require__(211);
  2073. var events = __webpack_require__(614);
  2074. var assert = __webpack_require__(357);
  2075. var util = __webpack_require__(669);
  2076. exports.httpOverHttp = httpOverHttp;
  2077. exports.httpsOverHttp = httpsOverHttp;
  2078. exports.httpOverHttps = httpOverHttps;
  2079. exports.httpsOverHttps = httpsOverHttps;
  2080. function httpOverHttp(options) {
  2081. var agent = new TunnelingAgent(options);
  2082. agent.request = http.request;
  2083. return agent;
  2084. }
  2085. function httpsOverHttp(options) {
  2086. var agent = new TunnelingAgent(options);
  2087. agent.request = http.request;
  2088. agent.createSocket = createSecureSocket;
  2089. return agent;
  2090. }
  2091. function httpOverHttps(options) {
  2092. var agent = new TunnelingAgent(options);
  2093. agent.request = https.request;
  2094. return agent;
  2095. }
  2096. function httpsOverHttps(options) {
  2097. var agent = new TunnelingAgent(options);
  2098. agent.request = https.request;
  2099. agent.createSocket = createSecureSocket;
  2100. return agent;
  2101. }
  2102. function TunnelingAgent(options) {
  2103. var self = this;
  2104. self.options = options || {};
  2105. self.proxyOptions = self.options.proxy || {};
  2106. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2107. self.requests = [];
  2108. self.sockets = [];
  2109. self.on('free', function onFree(socket, host, port, localAddress) {
  2110. var options = toOptions(host, port, localAddress);
  2111. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2112. var pending = self.requests[i];
  2113. if (pending.host === options.host && pending.port === options.port) {
  2114. // Detect the request to connect same origin server,
  2115. // reuse the connection.
  2116. self.requests.splice(i, 1);
  2117. pending.request.onSocket(socket);
  2118. return;
  2119. }
  2120. }
  2121. socket.destroy();
  2122. self.removeSocket(socket);
  2123. });
  2124. }
  2125. util.inherits(TunnelingAgent, events.EventEmitter);
  2126. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2127. var self = this;
  2128. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2129. if (self.sockets.length >= this.maxSockets) {
  2130. // We are over limit so we'll add it to the queue.
  2131. self.requests.push(options);
  2132. return;
  2133. }
  2134. // If we are under maxSockets create a new one.
  2135. self.createSocket(options, function(socket) {
  2136. socket.on('free', onFree);
  2137. socket.on('close', onCloseOrRemove);
  2138. socket.on('agentRemove', onCloseOrRemove);
  2139. req.onSocket(socket);
  2140. function onFree() {
  2141. self.emit('free', socket, options);
  2142. }
  2143. function onCloseOrRemove(err) {
  2144. self.removeSocket(socket);
  2145. socket.removeListener('free', onFree);
  2146. socket.removeListener('close', onCloseOrRemove);
  2147. socket.removeListener('agentRemove', onCloseOrRemove);
  2148. }
  2149. });
  2150. };
  2151. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2152. var self = this;
  2153. var placeholder = {};
  2154. self.sockets.push(placeholder);
  2155. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2156. method: 'CONNECT',
  2157. path: options.host + ':' + options.port,
  2158. agent: false
  2159. });
  2160. if (connectOptions.proxyAuth) {
  2161. connectOptions.headers = connectOptions.headers || {};
  2162. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2163. new Buffer(connectOptions.proxyAuth).toString('base64');
  2164. }
  2165. debug('making CONNECT request');
  2166. var connectReq = self.request(connectOptions);
  2167. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2168. connectReq.once('response', onResponse); // for v0.6
  2169. connectReq.once('upgrade', onUpgrade); // for v0.6
  2170. connectReq.once('connect', onConnect); // for v0.7 or later
  2171. connectReq.once('error', onError);
  2172. connectReq.end();
  2173. function onResponse(res) {
  2174. // Very hacky. This is necessary to avoid http-parser leaks.
  2175. res.upgrade = true;
  2176. }
  2177. function onUpgrade(res, socket, head) {
  2178. // Hacky.
  2179. process.nextTick(function() {
  2180. onConnect(res, socket, head);
  2181. });
  2182. }
  2183. function onConnect(res, socket, head) {
  2184. connectReq.removeAllListeners();
  2185. socket.removeAllListeners();
  2186. if (res.statusCode === 200) {
  2187. assert.equal(head.length, 0);
  2188. debug('tunneling connection has established');
  2189. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2190. cb(socket);
  2191. } else {
  2192. debug('tunneling socket could not be established, statusCode=%d',
  2193. res.statusCode);
  2194. var error = new Error('tunneling socket could not be established, ' +
  2195. 'statusCode=' + res.statusCode);
  2196. error.code = 'ECONNRESET';
  2197. options.request.emit('error', error);
  2198. self.removeSocket(placeholder);
  2199. }
  2200. }
  2201. function onError(cause) {
  2202. connectReq.removeAllListeners();
  2203. debug('tunneling socket could not be established, cause=%s\n',
  2204. cause.message, cause.stack);
  2205. var error = new Error('tunneling socket could not be established, ' +
  2206. 'cause=' + cause.message);
  2207. error.code = 'ECONNRESET';
  2208. options.request.emit('error', error);
  2209. self.removeSocket(placeholder);
  2210. }
  2211. };
  2212. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2213. var pos = this.sockets.indexOf(socket)
  2214. if (pos === -1) {
  2215. return;
  2216. }
  2217. this.sockets.splice(pos, 1);
  2218. var pending = this.requests.shift();
  2219. if (pending) {
  2220. // If we have pending requests and a socket gets closed a new one
  2221. // needs to be created to take over in the pool for the one that closed.
  2222. this.createSocket(pending, function(socket) {
  2223. pending.request.onSocket(socket);
  2224. });
  2225. }
  2226. };
  2227. function createSecureSocket(options, cb) {
  2228. var self = this;
  2229. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2230. var hostHeader = options.request.getHeader('host');
  2231. var tlsOptions = mergeOptions({}, self.options, {
  2232. socket: socket,
  2233. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2234. });
  2235. // 0 is dummy port for v0.6
  2236. var secureSocket = tls.connect(0, tlsOptions);
  2237. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2238. cb(secureSocket);
  2239. });
  2240. }
  2241. function toOptions(host, port, localAddress) {
  2242. if (typeof host === 'string') { // since v0.10
  2243. return {
  2244. host: host,
  2245. port: port,
  2246. localAddress: localAddress
  2247. };
  2248. }
  2249. return host; // for v0.11 or later
  2250. }
  2251. function mergeOptions(target) {
  2252. for (var i = 1, len = arguments.length; i < len; ++i) {
  2253. var overrides = arguments[i];
  2254. if (typeof overrides === 'object') {
  2255. var keys = Object.keys(overrides);
  2256. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2257. var k = keys[j];
  2258. if (overrides[k] !== undefined) {
  2259. target[k] = overrides[k];
  2260. }
  2261. }
  2262. }
  2263. }
  2264. return target;
  2265. }
  2266. var debug;
  2267. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2268. debug = function() {
  2269. var args = Array.prototype.slice.call(arguments);
  2270. if (typeof args[0] === 'string') {
  2271. args[0] = 'TUNNEL: ' + args[0];
  2272. } else {
  2273. args.unshift('TUNNEL:');
  2274. }
  2275. console.error.apply(console, args);
  2276. }
  2277. } else {
  2278. debug = function() {};
  2279. }
  2280. exports.debug = debug; // for test
  2281. /***/ }),
  2282. /***/ 143:
  2283. /***/ (function(module, __unusedexports, __webpack_require__) {
  2284. module.exports = withAuthorizationPrefix;
  2285. const atob = __webpack_require__(368);
  2286. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2287. function withAuthorizationPrefix(authorization) {
  2288. if (/^(basic|bearer|token) /i.test(authorization)) {
  2289. return authorization;
  2290. }
  2291. try {
  2292. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2293. return `basic ${authorization}`;
  2294. }
  2295. } catch (error) {}
  2296. if (authorization.split(/\./).length === 3) {
  2297. return `bearer ${authorization}`;
  2298. }
  2299. return `token ${authorization}`;
  2300. }
  2301. /***/ }),
  2302. /***/ 145:
  2303. /***/ (function(module, __unusedexports, __webpack_require__) {
  2304. "use strict";
  2305. const pump = __webpack_require__(453);
  2306. const bufferStream = __webpack_require__(966);
  2307. class MaxBufferError extends Error {
  2308. constructor() {
  2309. super('maxBuffer exceeded');
  2310. this.name = 'MaxBufferError';
  2311. }
  2312. }
  2313. function getStream(inputStream, options) {
  2314. if (!inputStream) {
  2315. return Promise.reject(new Error('Expected a stream'));
  2316. }
  2317. options = Object.assign({maxBuffer: Infinity}, options);
  2318. const {maxBuffer} = options;
  2319. let stream;
  2320. return new Promise((resolve, reject) => {
  2321. const rejectPromise = error => {
  2322. if (error) { // A null check
  2323. error.bufferedData = stream.getBufferedValue();
  2324. }
  2325. reject(error);
  2326. };
  2327. stream = pump(inputStream, bufferStream(options), error => {
  2328. if (error) {
  2329. rejectPromise(error);
  2330. return;
  2331. }
  2332. resolve();
  2333. });
  2334. stream.on('data', () => {
  2335. if (stream.getBufferedLength() > maxBuffer) {
  2336. rejectPromise(new MaxBufferError());
  2337. }
  2338. });
  2339. }).then(() => stream.getBufferedValue());
  2340. }
  2341. module.exports = getStream;
  2342. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2343. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2344. module.exports.MaxBufferError = MaxBufferError;
  2345. /***/ }),
  2346. /***/ 148:
  2347. /***/ (function(module, __unusedexports, __webpack_require__) {
  2348. module.exports = paginatePlugin;
  2349. const iterator = __webpack_require__(8);
  2350. const paginate = __webpack_require__(807);
  2351. function paginatePlugin(octokit) {
  2352. octokit.paginate = paginate.bind(null, octokit);
  2353. octokit.paginate.iterator = iterator.bind(null, octokit);
  2354. }
  2355. /***/ }),
  2356. /***/ 153:
  2357. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2358. "use strict";
  2359. var __importStar = (this && this.__importStar) || function (mod) {
  2360. if (mod && mod.__esModule) return mod;
  2361. var result = {};
  2362. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2363. result["default"] = mod;
  2364. return result;
  2365. };
  2366. Object.defineProperty(exports, "__esModule", { value: true });
  2367. const coreCommand = __importStar(__webpack_require__(431));
  2368. /**
  2369. * Indicates whether the POST action is running
  2370. */
  2371. exports.IsPost = !!process.env['STATE_isPost'];
  2372. /**
  2373. * The repository path for the POST action. The value is empty during the MAIN action.
  2374. */
  2375. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2376. /**
  2377. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2378. */
  2379. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  2380. /**
  2381. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2382. */
  2383. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  2384. /**
  2385. * Save the repository path so the POST action can retrieve the value.
  2386. */
  2387. function setRepositoryPath(repositoryPath) {
  2388. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2389. }
  2390. exports.setRepositoryPath = setRepositoryPath;
  2391. /**
  2392. * Save the SSH key path so the POST action can retrieve the value.
  2393. */
  2394. function setSshKeyPath(sshKeyPath) {
  2395. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  2396. }
  2397. exports.setSshKeyPath = setSshKeyPath;
  2398. /**
  2399. * Save the SSH known hosts path so the POST action can retrieve the value.
  2400. */
  2401. function setSshKnownHostsPath(sshKnownHostsPath) {
  2402. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  2403. }
  2404. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2405. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2406. // This is necessary since we don't have a separate entry point.
  2407. if (!exports.IsPost) {
  2408. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2409. }
  2410. /***/ }),
  2411. /***/ 168:
  2412. /***/ (function(module) {
  2413. "use strict";
  2414. const alias = ['stdin', 'stdout', 'stderr'];
  2415. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2416. module.exports = opts => {
  2417. if (!opts) {
  2418. return null;
  2419. }
  2420. if (opts.stdio && hasAlias(opts)) {
  2421. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2422. }
  2423. if (typeof opts.stdio === 'string') {
  2424. return opts.stdio;
  2425. }
  2426. const stdio = opts.stdio || [];
  2427. if (!Array.isArray(stdio)) {
  2428. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2429. }
  2430. const result = [];
  2431. const len = Math.max(stdio.length, alias.length);
  2432. for (let i = 0; i < len; i++) {
  2433. let value = null;
  2434. if (stdio[i] !== undefined) {
  2435. value = stdio[i];
  2436. } else if (opts[alias[i]] !== undefined) {
  2437. value = opts[alias[i]];
  2438. }
  2439. result[i] = value;
  2440. }
  2441. return result;
  2442. };
  2443. /***/ }),
  2444. /***/ 179:
  2445. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2446. "use strict";
  2447. var net = __webpack_require__(631);
  2448. var tls = __webpack_require__(16);
  2449. var http = __webpack_require__(605);
  2450. var https = __webpack_require__(211);
  2451. var events = __webpack_require__(614);
  2452. var assert = __webpack_require__(357);
  2453. var util = __webpack_require__(669);
  2454. exports.httpOverHttp = httpOverHttp;
  2455. exports.httpsOverHttp = httpsOverHttp;
  2456. exports.httpOverHttps = httpOverHttps;
  2457. exports.httpsOverHttps = httpsOverHttps;
  2458. function httpOverHttp(options) {
  2459. var agent = new TunnelingAgent(options);
  2460. agent.request = http.request;
  2461. return agent;
  2462. }
  2463. function httpsOverHttp(options) {
  2464. var agent = new TunnelingAgent(options);
  2465. agent.request = http.request;
  2466. agent.createSocket = createSecureSocket;
  2467. agent.defaultPort = 443;
  2468. return agent;
  2469. }
  2470. function httpOverHttps(options) {
  2471. var agent = new TunnelingAgent(options);
  2472. agent.request = https.request;
  2473. return agent;
  2474. }
  2475. function httpsOverHttps(options) {
  2476. var agent = new TunnelingAgent(options);
  2477. agent.request = https.request;
  2478. agent.createSocket = createSecureSocket;
  2479. agent.defaultPort = 443;
  2480. return agent;
  2481. }
  2482. function TunnelingAgent(options) {
  2483. var self = this;
  2484. self.options = options || {};
  2485. self.proxyOptions = self.options.proxy || {};
  2486. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2487. self.requests = [];
  2488. self.sockets = [];
  2489. self.on('free', function onFree(socket, host, port, localAddress) {
  2490. var options = toOptions(host, port, localAddress);
  2491. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2492. var pending = self.requests[i];
  2493. if (pending.host === options.host && pending.port === options.port) {
  2494. // Detect the request to connect same origin server,
  2495. // reuse the connection.
  2496. self.requests.splice(i, 1);
  2497. pending.request.onSocket(socket);
  2498. return;
  2499. }
  2500. }
  2501. socket.destroy();
  2502. self.removeSocket(socket);
  2503. });
  2504. }
  2505. util.inherits(TunnelingAgent, events.EventEmitter);
  2506. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2507. var self = this;
  2508. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2509. if (self.sockets.length >= this.maxSockets) {
  2510. // We are over limit so we'll add it to the queue.
  2511. self.requests.push(options);
  2512. return;
  2513. }
  2514. // If we are under maxSockets create a new one.
  2515. self.createSocket(options, function(socket) {
  2516. socket.on('free', onFree);
  2517. socket.on('close', onCloseOrRemove);
  2518. socket.on('agentRemove', onCloseOrRemove);
  2519. req.onSocket(socket);
  2520. function onFree() {
  2521. self.emit('free', socket, options);
  2522. }
  2523. function onCloseOrRemove(err) {
  2524. self.removeSocket(socket);
  2525. socket.removeListener('free', onFree);
  2526. socket.removeListener('close', onCloseOrRemove);
  2527. socket.removeListener('agentRemove', onCloseOrRemove);
  2528. }
  2529. });
  2530. };
  2531. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2532. var self = this;
  2533. var placeholder = {};
  2534. self.sockets.push(placeholder);
  2535. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2536. method: 'CONNECT',
  2537. path: options.host + ':' + options.port,
  2538. agent: false,
  2539. headers: {
  2540. host: options.host + ':' + options.port
  2541. }
  2542. });
  2543. if (options.localAddress) {
  2544. connectOptions.localAddress = options.localAddress;
  2545. }
  2546. if (connectOptions.proxyAuth) {
  2547. connectOptions.headers = connectOptions.headers || {};
  2548. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2549. new Buffer(connectOptions.proxyAuth).toString('base64');
  2550. }
  2551. debug('making CONNECT request');
  2552. var connectReq = self.request(connectOptions);
  2553. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2554. connectReq.once('response', onResponse); // for v0.6
  2555. connectReq.once('upgrade', onUpgrade); // for v0.6
  2556. connectReq.once('connect', onConnect); // for v0.7 or later
  2557. connectReq.once('error', onError);
  2558. connectReq.end();
  2559. function onResponse(res) {
  2560. // Very hacky. This is necessary to avoid http-parser leaks.
  2561. res.upgrade = true;
  2562. }
  2563. function onUpgrade(res, socket, head) {
  2564. // Hacky.
  2565. process.nextTick(function() {
  2566. onConnect(res, socket, head);
  2567. });
  2568. }
  2569. function onConnect(res, socket, head) {
  2570. connectReq.removeAllListeners();
  2571. socket.removeAllListeners();
  2572. if (res.statusCode !== 200) {
  2573. debug('tunneling socket could not be established, statusCode=%d',
  2574. res.statusCode);
  2575. socket.destroy();
  2576. var error = new Error('tunneling socket could not be established, ' +
  2577. 'statusCode=' + res.statusCode);
  2578. error.code = 'ECONNRESET';
  2579. options.request.emit('error', error);
  2580. self.removeSocket(placeholder);
  2581. return;
  2582. }
  2583. if (head.length > 0) {
  2584. debug('got illegal response body from proxy');
  2585. socket.destroy();
  2586. var error = new Error('got illegal response body from proxy');
  2587. error.code = 'ECONNRESET';
  2588. options.request.emit('error', error);
  2589. self.removeSocket(placeholder);
  2590. return;
  2591. }
  2592. debug('tunneling connection has established');
  2593. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2594. return cb(socket);
  2595. }
  2596. function onError(cause) {
  2597. connectReq.removeAllListeners();
  2598. debug('tunneling socket could not be established, cause=%s\n',
  2599. cause.message, cause.stack);
  2600. var error = new Error('tunneling socket could not be established, ' +
  2601. 'cause=' + cause.message);
  2602. error.code = 'ECONNRESET';
  2603. options.request.emit('error', error);
  2604. self.removeSocket(placeholder);
  2605. }
  2606. };
  2607. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2608. var pos = this.sockets.indexOf(socket)
  2609. if (pos === -1) {
  2610. return;
  2611. }
  2612. this.sockets.splice(pos, 1);
  2613. var pending = this.requests.shift();
  2614. if (pending) {
  2615. // If we have pending requests and a socket gets closed a new one
  2616. // needs to be created to take over in the pool for the one that closed.
  2617. this.createSocket(pending, function(socket) {
  2618. pending.request.onSocket(socket);
  2619. });
  2620. }
  2621. };
  2622. function createSecureSocket(options, cb) {
  2623. var self = this;
  2624. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2625. var hostHeader = options.request.getHeader('host');
  2626. var tlsOptions = mergeOptions({}, self.options, {
  2627. socket: socket,
  2628. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2629. });
  2630. // 0 is dummy port for v0.6
  2631. var secureSocket = tls.connect(0, tlsOptions);
  2632. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2633. cb(secureSocket);
  2634. });
  2635. }
  2636. function toOptions(host, port, localAddress) {
  2637. if (typeof host === 'string') { // since v0.10
  2638. return {
  2639. host: host,
  2640. port: port,
  2641. localAddress: localAddress
  2642. };
  2643. }
  2644. return host; // for v0.11 or later
  2645. }
  2646. function mergeOptions(target) {
  2647. for (var i = 1, len = arguments.length; i < len; ++i) {
  2648. var overrides = arguments[i];
  2649. if (typeof overrides === 'object') {
  2650. var keys = Object.keys(overrides);
  2651. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2652. var k = keys[j];
  2653. if (overrides[k] !== undefined) {
  2654. target[k] = overrides[k];
  2655. }
  2656. }
  2657. }
  2658. }
  2659. return target;
  2660. }
  2661. var debug;
  2662. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2663. debug = function() {
  2664. var args = Array.prototype.slice.call(arguments);
  2665. if (typeof args[0] === 'string') {
  2666. args[0] = 'TUNNEL: ' + args[0];
  2667. } else {
  2668. args.unshift('TUNNEL:');
  2669. }
  2670. console.error.apply(console, args);
  2671. }
  2672. } else {
  2673. debug = function() {};
  2674. }
  2675. exports.debug = debug; // for test
  2676. /***/ }),
  2677. /***/ 190:
  2678. /***/ (function(module, __unusedexports, __webpack_require__) {
  2679. module.exports = authenticationPlugin;
  2680. const { createTokenAuth } = __webpack_require__(813);
  2681. const { Deprecation } = __webpack_require__(692);
  2682. const once = __webpack_require__(969);
  2683. const beforeRequest = __webpack_require__(863);
  2684. const requestError = __webpack_require__(991);
  2685. const validate = __webpack_require__(954);
  2686. const withAuthorizationPrefix = __webpack_require__(143);
  2687. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2688. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2689. function authenticationPlugin(octokit, options) {
  2690. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2691. if (options.authStrategy) {
  2692. const auth = options.authStrategy(options.auth);
  2693. octokit.hook.wrap("request", auth.hook);
  2694. octokit.auth = auth;
  2695. return;
  2696. }
  2697. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2698. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2699. if (!options.auth) {
  2700. octokit.auth = () =>
  2701. Promise.resolve({
  2702. type: "unauthenticated"
  2703. });
  2704. return;
  2705. }
  2706. const isBasicAuthString =
  2707. typeof options.auth === "string" &&
  2708. /^basic/.test(withAuthorizationPrefix(options.auth));
  2709. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2710. if (typeof options.auth === "string" && !isBasicAuthString) {
  2711. const auth = createTokenAuth(options.auth);
  2712. octokit.hook.wrap("request", auth.hook);
  2713. octokit.auth = auth;
  2714. return;
  2715. }
  2716. // Otherwise log a deprecation message
  2717. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2718. ? [
  2719. deprecateAuthBasic,
  2720. '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)'
  2721. ]
  2722. : [
  2723. deprecateAuthObject,
  2724. '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)'
  2725. ];
  2726. deprecationMethod(
  2727. octokit.log,
  2728. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2729. );
  2730. octokit.auth = () =>
  2731. Promise.resolve({
  2732. type: "deprecated",
  2733. message: deprecationMessapge
  2734. });
  2735. validate(options.auth);
  2736. const state = {
  2737. octokit,
  2738. auth: options.auth
  2739. };
  2740. octokit.hook.before("request", beforeRequest.bind(null, state));
  2741. octokit.hook.error("request", requestError.bind(null, state));
  2742. }
  2743. /***/ }),
  2744. /***/ 197:
  2745. /***/ (function(module, __unusedexports, __webpack_require__) {
  2746. module.exports = isexe
  2747. isexe.sync = sync
  2748. var fs = __webpack_require__(747)
  2749. function isexe (path, options, cb) {
  2750. fs.stat(path, function (er, stat) {
  2751. cb(er, er ? false : checkStat(stat, options))
  2752. })
  2753. }
  2754. function sync (path, options) {
  2755. return checkStat(fs.statSync(path), options)
  2756. }
  2757. function checkStat (stat, options) {
  2758. return stat.isFile() && checkMode(stat, options)
  2759. }
  2760. function checkMode (stat, options) {
  2761. var mod = stat.mode
  2762. var uid = stat.uid
  2763. var gid = stat.gid
  2764. var myUid = options.uid !== undefined ?
  2765. options.uid : process.getuid && process.getuid()
  2766. var myGid = options.gid !== undefined ?
  2767. options.gid : process.getgid && process.getgid()
  2768. var u = parseInt('100', 8)
  2769. var g = parseInt('010', 8)
  2770. var o = parseInt('001', 8)
  2771. var ug = u | g
  2772. var ret = (mod & o) ||
  2773. (mod & g) && gid === myGid ||
  2774. (mod & u) && uid === myUid ||
  2775. (mod & ug) && myUid === 0
  2776. return ret
  2777. }
  2778. /***/ }),
  2779. /***/ 198:
  2780. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2781. "use strict";
  2782. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2783. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2784. return new (P || (P = Promise))(function (resolve, reject) {
  2785. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2786. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2787. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2788. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2789. });
  2790. };
  2791. var __importStar = (this && this.__importStar) || function (mod) {
  2792. if (mod && mod.__esModule) return mod;
  2793. var result = {};
  2794. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2795. result["default"] = mod;
  2796. return result;
  2797. };
  2798. Object.defineProperty(exports, "__esModule", { value: true });
  2799. const core = __importStar(__webpack_require__(470));
  2800. const coreCommand = __importStar(__webpack_require__(431));
  2801. const gitSourceProvider = __importStar(__webpack_require__(293));
  2802. const inputHelper = __importStar(__webpack_require__(821));
  2803. const path = __importStar(__webpack_require__(622));
  2804. const stateHelper = __importStar(__webpack_require__(153));
  2805. function run() {
  2806. return __awaiter(this, void 0, void 0, function* () {
  2807. try {
  2808. const sourceSettings = inputHelper.getInputs();
  2809. try {
  2810. // Register problem matcher
  2811. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2812. // Get sources
  2813. yield gitSourceProvider.getSource(sourceSettings);
  2814. }
  2815. finally {
  2816. // Unregister problem matcher
  2817. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2818. }
  2819. }
  2820. catch (error) {
  2821. core.setFailed(error.message);
  2822. }
  2823. });
  2824. }
  2825. function cleanup() {
  2826. return __awaiter(this, void 0, void 0, function* () {
  2827. try {
  2828. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2829. }
  2830. catch (error) {
  2831. core.warning(error.message);
  2832. }
  2833. });
  2834. }
  2835. // Main
  2836. if (!stateHelper.IsPost) {
  2837. run();
  2838. }
  2839. // Post
  2840. else {
  2841. cleanup();
  2842. }
  2843. /***/ }),
  2844. /***/ 211:
  2845. /***/ (function(module) {
  2846. module.exports = require("https");
  2847. /***/ }),
  2848. /***/ 215:
  2849. /***/ (function(module) {
  2850. 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"};
  2851. /***/ }),
  2852. /***/ 227:
  2853. /***/ (function(__unusedmodule, exports) {
  2854. "use strict";
  2855. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2856. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2857. return new (P || (P = Promise))(function (resolve, reject) {
  2858. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2859. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2860. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2861. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2862. });
  2863. };
  2864. Object.defineProperty(exports, "__esModule", { value: true });
  2865. function getCheckoutInfo(git, ref, commit) {
  2866. return __awaiter(this, void 0, void 0, function* () {
  2867. if (!git) {
  2868. throw new Error('Arg git cannot be empty');
  2869. }
  2870. if (!ref && !commit) {
  2871. throw new Error('Args ref and commit cannot both be empty');
  2872. }
  2873. const result = {};
  2874. const upperRef = (ref || '').toUpperCase();
  2875. // SHA only
  2876. if (!ref) {
  2877. result.ref = commit;
  2878. }
  2879. // refs/heads/
  2880. else if (upperRef.startsWith('REFS/HEADS/')) {
  2881. const branch = ref.substring('refs/heads/'.length);
  2882. result.ref = branch;
  2883. result.startPoint = `refs/remotes/origin/${branch}`;
  2884. }
  2885. // refs/pull/
  2886. else if (upperRef.startsWith('REFS/PULL/')) {
  2887. const branch = ref.substring('refs/pull/'.length);
  2888. result.ref = `refs/remotes/pull/${branch}`;
  2889. }
  2890. // refs/tags/
  2891. else if (upperRef.startsWith('REFS/')) {
  2892. result.ref = ref;
  2893. }
  2894. // Unqualified ref, check for a matching branch or tag
  2895. else {
  2896. if (yield git.branchExists(true, `origin/${ref}`)) {
  2897. result.ref = ref;
  2898. result.startPoint = `refs/remotes/origin/${ref}`;
  2899. }
  2900. else if (yield git.tagExists(`${ref}`)) {
  2901. result.ref = `refs/tags/${ref}`;
  2902. }
  2903. else {
  2904. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2905. }
  2906. }
  2907. return result;
  2908. });
  2909. }
  2910. exports.getCheckoutInfo = getCheckoutInfo;
  2911. function getRefSpec(ref, commit) {
  2912. if (!ref && !commit) {
  2913. throw new Error('Args ref and commit cannot both be empty');
  2914. }
  2915. const upperRef = (ref || '').toUpperCase();
  2916. // SHA
  2917. if (commit) {
  2918. // refs/heads
  2919. if (upperRef.startsWith('REFS/HEADS/')) {
  2920. const branch = ref.substring('refs/heads/'.length);
  2921. return [`+${commit}:refs/remotes/origin/${branch}`];
  2922. }
  2923. // refs/pull/
  2924. else if (upperRef.startsWith('REFS/PULL/')) {
  2925. const branch = ref.substring('refs/pull/'.length);
  2926. return [`+${commit}:refs/remotes/pull/${branch}`];
  2927. }
  2928. // refs/tags/
  2929. else if (upperRef.startsWith('REFS/TAGS/')) {
  2930. return [`+${commit}:${ref}`];
  2931. }
  2932. // Otherwise no destination ref
  2933. else {
  2934. return [commit];
  2935. }
  2936. }
  2937. // Unqualified ref, check for a matching branch or tag
  2938. else if (!upperRef.startsWith('REFS/')) {
  2939. return [
  2940. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2941. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2942. ];
  2943. }
  2944. // refs/heads/
  2945. else if (upperRef.startsWith('REFS/HEADS/')) {
  2946. const branch = ref.substring('refs/heads/'.length);
  2947. return [`+${ref}:refs/remotes/origin/${branch}`];
  2948. }
  2949. // refs/pull/
  2950. else if (upperRef.startsWith('REFS/PULL/')) {
  2951. const branch = ref.substring('refs/pull/'.length);
  2952. return [`+${ref}:refs/remotes/pull/${branch}`];
  2953. }
  2954. // refs/tags/
  2955. else {
  2956. return [`+${ref}:${ref}`];
  2957. }
  2958. }
  2959. exports.getRefSpec = getRefSpec;
  2960. /***/ }),
  2961. /***/ 248:
  2962. /***/ (function(module, __unusedexports, __webpack_require__) {
  2963. module.exports = octokitRegisterEndpoints;
  2964. const registerEndpoints = __webpack_require__(899);
  2965. function octokitRegisterEndpoints(octokit) {
  2966. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2967. }
  2968. /***/ }),
  2969. /***/ 260:
  2970. /***/ (function(module, __unusedexports, __webpack_require__) {
  2971. // Note: since nyc uses this module to output coverage, any lines
  2972. // that are in the direct sync flow of nyc's outputCoverage are
  2973. // ignored, since we can never get coverage for them.
  2974. var assert = __webpack_require__(357)
  2975. var signals = __webpack_require__(654)
  2976. var EE = __webpack_require__(614)
  2977. /* istanbul ignore if */
  2978. if (typeof EE !== 'function') {
  2979. EE = EE.EventEmitter
  2980. }
  2981. var emitter
  2982. if (process.__signal_exit_emitter__) {
  2983. emitter = process.__signal_exit_emitter__
  2984. } else {
  2985. emitter = process.__signal_exit_emitter__ = new EE()
  2986. emitter.count = 0
  2987. emitter.emitted = {}
  2988. }
  2989. // Because this emitter is a global, we have to check to see if a
  2990. // previous version of this library failed to enable infinite listeners.
  2991. // I know what you're about to say. But literally everything about
  2992. // signal-exit is a compromise with evil. Get used to it.
  2993. if (!emitter.infinite) {
  2994. emitter.setMaxListeners(Infinity)
  2995. emitter.infinite = true
  2996. }
  2997. module.exports = function (cb, opts) {
  2998. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2999. if (loaded === false) {
  3000. load()
  3001. }
  3002. var ev = 'exit'
  3003. if (opts && opts.alwaysLast) {
  3004. ev = 'afterexit'
  3005. }
  3006. var remove = function () {
  3007. emitter.removeListener(ev, cb)
  3008. if (emitter.listeners('exit').length === 0 &&
  3009. emitter.listeners('afterexit').length === 0) {
  3010. unload()
  3011. }
  3012. }
  3013. emitter.on(ev, cb)
  3014. return remove
  3015. }
  3016. module.exports.unload = unload
  3017. function unload () {
  3018. if (!loaded) {
  3019. return
  3020. }
  3021. loaded = false
  3022. signals.forEach(function (sig) {
  3023. try {
  3024. process.removeListener(sig, sigListeners[sig])
  3025. } catch (er) {}
  3026. })
  3027. process.emit = originalProcessEmit
  3028. process.reallyExit = originalProcessReallyExit
  3029. emitter.count -= 1
  3030. }
  3031. function emit (event, code, signal) {
  3032. if (emitter.emitted[event]) {
  3033. return
  3034. }
  3035. emitter.emitted[event] = true
  3036. emitter.emit(event, code, signal)
  3037. }
  3038. // { <signal>: <listener fn>, ... }
  3039. var sigListeners = {}
  3040. signals.forEach(function (sig) {
  3041. sigListeners[sig] = function listener () {
  3042. // If there are no other listeners, an exit is coming!
  3043. // Simplest way: remove us and then re-send the signal.
  3044. // We know that this will kill the process, so we can
  3045. // safely emit now.
  3046. var listeners = process.listeners(sig)
  3047. if (listeners.length === emitter.count) {
  3048. unload()
  3049. emit('exit', null, sig)
  3050. /* istanbul ignore next */
  3051. emit('afterexit', null, sig)
  3052. /* istanbul ignore next */
  3053. process.kill(process.pid, sig)
  3054. }
  3055. }
  3056. })
  3057. module.exports.signals = function () {
  3058. return signals
  3059. }
  3060. module.exports.load = load
  3061. var loaded = false
  3062. function load () {
  3063. if (loaded) {
  3064. return
  3065. }
  3066. loaded = true
  3067. // This is the number of onSignalExit's that are in play.
  3068. // It's important so that we can count the correct number of
  3069. // listeners on signals, and don't wait for the other one to
  3070. // handle it instead of us.
  3071. emitter.count += 1
  3072. signals = signals.filter(function (sig) {
  3073. try {
  3074. process.on(sig, sigListeners[sig])
  3075. return true
  3076. } catch (er) {
  3077. return false
  3078. }
  3079. })
  3080. process.emit = processEmit
  3081. process.reallyExit = processReallyExit
  3082. }
  3083. var originalProcessReallyExit = process.reallyExit
  3084. function processReallyExit (code) {
  3085. process.exitCode = code || 0
  3086. emit('exit', process.exitCode, null)
  3087. /* istanbul ignore next */
  3088. emit('afterexit', process.exitCode, null)
  3089. /* istanbul ignore next */
  3090. originalProcessReallyExit.call(process, process.exitCode)
  3091. }
  3092. var originalProcessEmit = process.emit
  3093. function processEmit (ev, arg) {
  3094. if (ev === 'exit') {
  3095. if (arg !== undefined) {
  3096. process.exitCode = arg
  3097. }
  3098. var ret = originalProcessEmit.apply(this, arguments)
  3099. emit('exit', process.exitCode, null)
  3100. /* istanbul ignore next */
  3101. emit('afterexit', process.exitCode, null)
  3102. return ret
  3103. } else {
  3104. return originalProcessEmit.apply(this, arguments)
  3105. }
  3106. }
  3107. /***/ }),
  3108. /***/ 262:
  3109. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3110. "use strict";
  3111. Object.defineProperty(exports, "__esModule", { value: true });
  3112. const fs_1 = __webpack_require__(747);
  3113. const os_1 = __webpack_require__(87);
  3114. class Context {
  3115. /**
  3116. * Hydrate the context from the environment
  3117. */
  3118. constructor() {
  3119. this.payload = {};
  3120. if (process.env.GITHUB_EVENT_PATH) {
  3121. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3122. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3123. }
  3124. else {
  3125. const path = process.env.GITHUB_EVENT_PATH;
  3126. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3127. }
  3128. }
  3129. this.eventName = process.env.GITHUB_EVENT_NAME;
  3130. this.sha = process.env.GITHUB_SHA;
  3131. this.ref = process.env.GITHUB_REF;
  3132. this.workflow = process.env.GITHUB_WORKFLOW;
  3133. this.action = process.env.GITHUB_ACTION;
  3134. this.actor = process.env.GITHUB_ACTOR;
  3135. }
  3136. get issue() {
  3137. const payload = this.payload;
  3138. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3139. }
  3140. get repo() {
  3141. if (process.env.GITHUB_REPOSITORY) {
  3142. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3143. return { owner, repo };
  3144. }
  3145. if (this.payload.repository) {
  3146. return {
  3147. owner: this.payload.repository.owner.login,
  3148. repo: this.payload.repository.name
  3149. };
  3150. }
  3151. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3152. }
  3153. }
  3154. exports.Context = Context;
  3155. //# sourceMappingURL=context.js.map
  3156. /***/ }),
  3157. /***/ 265:
  3158. /***/ (function(module, __unusedexports, __webpack_require__) {
  3159. module.exports = getPage
  3160. const deprecate = __webpack_require__(370)
  3161. const getPageLinks = __webpack_require__(577)
  3162. const HttpError = __webpack_require__(297)
  3163. function getPage (octokit, link, which, headers) {
  3164. 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.`)
  3165. const url = getPageLinks(link)[which]
  3166. if (!url) {
  3167. const urlError = new HttpError(`No ${which} page found`, 404)
  3168. return Promise.reject(urlError)
  3169. }
  3170. const requestOptions = {
  3171. url,
  3172. headers: applyAcceptHeader(link, headers)
  3173. }
  3174. const promise = octokit.request(requestOptions)
  3175. return promise
  3176. }
  3177. function applyAcceptHeader (res, headers) {
  3178. const previous = res.headers && res.headers['x-github-media-type']
  3179. if (!previous || (headers && headers.accept)) {
  3180. return headers
  3181. }
  3182. headers = headers || {}
  3183. headers.accept = 'application/vnd.' + previous
  3184. .replace('; param=', '.')
  3185. .replace('; format=', '+')
  3186. return headers
  3187. }
  3188. /***/ }),
  3189. /***/ 280:
  3190. /***/ (function(module, exports) {
  3191. exports = module.exports = SemVer
  3192. var debug
  3193. /* istanbul ignore next */
  3194. if (typeof process === 'object' &&
  3195. process.env &&
  3196. process.env.NODE_DEBUG &&
  3197. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3198. debug = function () {
  3199. var args = Array.prototype.slice.call(arguments, 0)
  3200. args.unshift('SEMVER')
  3201. console.log.apply(console, args)
  3202. }
  3203. } else {
  3204. debug = function () {}
  3205. }
  3206. // Note: this is the semver.org version of the spec that it implements
  3207. // Not necessarily the package version of this code.
  3208. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3209. var MAX_LENGTH = 256
  3210. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3211. /* istanbul ignore next */ 9007199254740991
  3212. // Max safe segment length for coercion.
  3213. var MAX_SAFE_COMPONENT_LENGTH = 16
  3214. // The actual regexps go on exports.re
  3215. var re = exports.re = []
  3216. var src = exports.src = []
  3217. var R = 0
  3218. // The following Regular Expressions can be used for tokenizing,
  3219. // validating, and parsing SemVer version strings.
  3220. // ## Numeric Identifier
  3221. // A single `0`, or a non-zero digit followed by zero or more digits.
  3222. var NUMERICIDENTIFIER = R++
  3223. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3224. var NUMERICIDENTIFIERLOOSE = R++
  3225. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3226. // ## Non-numeric Identifier
  3227. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3228. // more letters, digits, or hyphens.
  3229. var NONNUMERICIDENTIFIER = R++
  3230. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3231. // ## Main Version
  3232. // Three dot-separated numeric identifiers.
  3233. var MAINVERSION = R++
  3234. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3235. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3236. '(' + src[NUMERICIDENTIFIER] + ')'
  3237. var MAINVERSIONLOOSE = R++
  3238. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3239. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3240. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3241. // ## Pre-release Version Identifier
  3242. // A numeric identifier, or a non-numeric identifier.
  3243. var PRERELEASEIDENTIFIER = R++
  3244. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3245. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3246. var PRERELEASEIDENTIFIERLOOSE = R++
  3247. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3248. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3249. // ## Pre-release Version
  3250. // Hyphen, followed by one or more dot-separated pre-release version
  3251. // identifiers.
  3252. var PRERELEASE = R++
  3253. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3254. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3255. var PRERELEASELOOSE = R++
  3256. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3257. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3258. // ## Build Metadata Identifier
  3259. // Any combination of digits, letters, or hyphens.
  3260. var BUILDIDENTIFIER = R++
  3261. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3262. // ## Build Metadata
  3263. // Plus sign, followed by one or more period-separated build metadata
  3264. // identifiers.
  3265. var BUILD = R++
  3266. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3267. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3268. // ## Full Version String
  3269. // A main version, followed optionally by a pre-release version and
  3270. // build metadata.
  3271. // Note that the only major, minor, patch, and pre-release sections of
  3272. // the version string are capturing groups. The build metadata is not a
  3273. // capturing group, because it should not ever be used in version
  3274. // comparison.
  3275. var FULL = R++
  3276. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3277. src[PRERELEASE] + '?' +
  3278. src[BUILD] + '?'
  3279. src[FULL] = '^' + FULLPLAIN + '$'
  3280. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3281. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3282. // common in the npm registry.
  3283. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3284. src[PRERELEASELOOSE] + '?' +
  3285. src[BUILD] + '?'
  3286. var LOOSE = R++
  3287. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3288. var GTLT = R++
  3289. src[GTLT] = '((?:<|>)?=?)'
  3290. // Something like "2.*" or "1.2.x".
  3291. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3292. // Only the first item is strictly required.
  3293. var XRANGEIDENTIFIERLOOSE = R++
  3294. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3295. var XRANGEIDENTIFIER = R++
  3296. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3297. var XRANGEPLAIN = R++
  3298. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3299. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3300. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3301. '(?:' + src[PRERELEASE] + ')?' +
  3302. src[BUILD] + '?' +
  3303. ')?)?'
  3304. var XRANGEPLAINLOOSE = R++
  3305. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3306. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3307. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3308. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3309. src[BUILD] + '?' +
  3310. ')?)?'
  3311. var XRANGE = R++
  3312. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3313. var XRANGELOOSE = R++
  3314. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3315. // Coercion.
  3316. // Extract anything that could conceivably be a part of a valid semver
  3317. var COERCE = R++
  3318. src[COERCE] = '(?:^|[^\\d])' +
  3319. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3320. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3321. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3322. '(?:$|[^\\d])'
  3323. // Tilde ranges.
  3324. // Meaning is "reasonably at or greater than"
  3325. var LONETILDE = R++
  3326. src[LONETILDE] = '(?:~>?)'
  3327. var TILDETRIM = R++
  3328. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3329. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3330. var tildeTrimReplace = '$1~'
  3331. var TILDE = R++
  3332. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3333. var TILDELOOSE = R++
  3334. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3335. // Caret ranges.
  3336. // Meaning is "at least and backwards compatible with"
  3337. var LONECARET = R++
  3338. src[LONECARET] = '(?:\\^)'
  3339. var CARETTRIM = R++
  3340. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3341. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3342. var caretTrimReplace = '$1^'
  3343. var CARET = R++
  3344. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3345. var CARETLOOSE = R++
  3346. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3347. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3348. var COMPARATORLOOSE = R++
  3349. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3350. var COMPARATOR = R++
  3351. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3352. // An expression to strip any whitespace between the gtlt and the thing
  3353. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3354. var COMPARATORTRIM = R++
  3355. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3356. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3357. // this one has to use the /g flag
  3358. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3359. var comparatorTrimReplace = '$1$2$3'
  3360. // Something like `1.2.3 - 1.2.4`
  3361. // Note that these all use the loose form, because they'll be
  3362. // checked against either the strict or loose comparator form
  3363. // later.
  3364. var HYPHENRANGE = R++
  3365. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3366. '\\s+-\\s+' +
  3367. '(' + src[XRANGEPLAIN] + ')' +
  3368. '\\s*$'
  3369. var HYPHENRANGELOOSE = R++
  3370. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3371. '\\s+-\\s+' +
  3372. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3373. '\\s*$'
  3374. // Star ranges basically just allow anything at all.
  3375. var STAR = R++
  3376. src[STAR] = '(<|>)?=?\\s*\\*'
  3377. // Compile to actual regexp objects.
  3378. // All are flag-free, unless they were created above with a flag.
  3379. for (var i = 0; i < R; i++) {
  3380. debug(i, src[i])
  3381. if (!re[i]) {
  3382. re[i] = new RegExp(src[i])
  3383. }
  3384. }
  3385. exports.parse = parse
  3386. function parse (version, options) {
  3387. if (!options || typeof options !== 'object') {
  3388. options = {
  3389. loose: !!options,
  3390. includePrerelease: false
  3391. }
  3392. }
  3393. if (version instanceof SemVer) {
  3394. return version
  3395. }
  3396. if (typeof version !== 'string') {
  3397. return null
  3398. }
  3399. if (version.length > MAX_LENGTH) {
  3400. return null
  3401. }
  3402. var r = options.loose ? re[LOOSE] : re[FULL]
  3403. if (!r.test(version)) {
  3404. return null
  3405. }
  3406. try {
  3407. return new SemVer(version, options)
  3408. } catch (er) {
  3409. return null
  3410. }
  3411. }
  3412. exports.valid = valid
  3413. function valid (version, options) {
  3414. var v = parse(version, options)
  3415. return v ? v.version : null
  3416. }
  3417. exports.clean = clean
  3418. function clean (version, options) {
  3419. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3420. return s ? s.version : null
  3421. }
  3422. exports.SemVer = SemVer
  3423. function SemVer (version, options) {
  3424. if (!options || typeof options !== 'object') {
  3425. options = {
  3426. loose: !!options,
  3427. includePrerelease: false
  3428. }
  3429. }
  3430. if (version instanceof SemVer) {
  3431. if (version.loose === options.loose) {
  3432. return version
  3433. } else {
  3434. version = version.version
  3435. }
  3436. } else if (typeof version !== 'string') {
  3437. throw new TypeError('Invalid Version: ' + version)
  3438. }
  3439. if (version.length > MAX_LENGTH) {
  3440. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3441. }
  3442. if (!(this instanceof SemVer)) {
  3443. return new SemVer(version, options)
  3444. }
  3445. debug('SemVer', version, options)
  3446. this.options = options
  3447. this.loose = !!options.loose
  3448. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3449. if (!m) {
  3450. throw new TypeError('Invalid Version: ' + version)
  3451. }
  3452. this.raw = version
  3453. // these are actually numbers
  3454. this.major = +m[1]
  3455. this.minor = +m[2]
  3456. this.patch = +m[3]
  3457. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3458. throw new TypeError('Invalid major version')
  3459. }
  3460. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3461. throw new TypeError('Invalid minor version')
  3462. }
  3463. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3464. throw new TypeError('Invalid patch version')
  3465. }
  3466. // numberify any prerelease numeric ids
  3467. if (!m[4]) {
  3468. this.prerelease = []
  3469. } else {
  3470. this.prerelease = m[4].split('.').map(function (id) {
  3471. if (/^[0-9]+$/.test(id)) {
  3472. var num = +id
  3473. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3474. return num
  3475. }
  3476. }
  3477. return id
  3478. })
  3479. }
  3480. this.build = m[5] ? m[5].split('.') : []
  3481. this.format()
  3482. }
  3483. SemVer.prototype.format = function () {
  3484. this.version = this.major + '.' + this.minor + '.' + this.patch
  3485. if (this.prerelease.length) {
  3486. this.version += '-' + this.prerelease.join('.')
  3487. }
  3488. return this.version
  3489. }
  3490. SemVer.prototype.toString = function () {
  3491. return this.version
  3492. }
  3493. SemVer.prototype.compare = function (other) {
  3494. debug('SemVer.compare', this.version, this.options, other)
  3495. if (!(other instanceof SemVer)) {
  3496. other = new SemVer(other, this.options)
  3497. }
  3498. return this.compareMain(other) || this.comparePre(other)
  3499. }
  3500. SemVer.prototype.compareMain = function (other) {
  3501. if (!(other instanceof SemVer)) {
  3502. other = new SemVer(other, this.options)
  3503. }
  3504. return compareIdentifiers(this.major, other.major) ||
  3505. compareIdentifiers(this.minor, other.minor) ||
  3506. compareIdentifiers(this.patch, other.patch)
  3507. }
  3508. SemVer.prototype.comparePre = function (other) {
  3509. if (!(other instanceof SemVer)) {
  3510. other = new SemVer(other, this.options)
  3511. }
  3512. // NOT having a prerelease is > having one
  3513. if (this.prerelease.length && !other.prerelease.length) {
  3514. return -1
  3515. } else if (!this.prerelease.length && other.prerelease.length) {
  3516. return 1
  3517. } else if (!this.prerelease.length && !other.prerelease.length) {
  3518. return 0
  3519. }
  3520. var i = 0
  3521. do {
  3522. var a = this.prerelease[i]
  3523. var b = other.prerelease[i]
  3524. debug('prerelease compare', i, a, b)
  3525. if (a === undefined && b === undefined) {
  3526. return 0
  3527. } else if (b === undefined) {
  3528. return 1
  3529. } else if (a === undefined) {
  3530. return -1
  3531. } else if (a === b) {
  3532. continue
  3533. } else {
  3534. return compareIdentifiers(a, b)
  3535. }
  3536. } while (++i)
  3537. }
  3538. // preminor will bump the version up to the next minor release, and immediately
  3539. // down to pre-release. premajor and prepatch work the same way.
  3540. SemVer.prototype.inc = function (release, identifier) {
  3541. switch (release) {
  3542. case 'premajor':
  3543. this.prerelease.length = 0
  3544. this.patch = 0
  3545. this.minor = 0
  3546. this.major++
  3547. this.inc('pre', identifier)
  3548. break
  3549. case 'preminor':
  3550. this.prerelease.length = 0
  3551. this.patch = 0
  3552. this.minor++
  3553. this.inc('pre', identifier)
  3554. break
  3555. case 'prepatch':
  3556. // If this is already a prerelease, it will bump to the next version
  3557. // drop any prereleases that might already exist, since they are not
  3558. // relevant at this point.
  3559. this.prerelease.length = 0
  3560. this.inc('patch', identifier)
  3561. this.inc('pre', identifier)
  3562. break
  3563. // If the input is a non-prerelease version, this acts the same as
  3564. // prepatch.
  3565. case 'prerelease':
  3566. if (this.prerelease.length === 0) {
  3567. this.inc('patch', identifier)
  3568. }
  3569. this.inc('pre', identifier)
  3570. break
  3571. case 'major':
  3572. // If this is a pre-major version, bump up to the same major version.
  3573. // Otherwise increment major.
  3574. // 1.0.0-5 bumps to 1.0.0
  3575. // 1.1.0 bumps to 2.0.0
  3576. if (this.minor !== 0 ||
  3577. this.patch !== 0 ||
  3578. this.prerelease.length === 0) {
  3579. this.major++
  3580. }
  3581. this.minor = 0
  3582. this.patch = 0
  3583. this.prerelease = []
  3584. break
  3585. case 'minor':
  3586. // If this is a pre-minor version, bump up to the same minor version.
  3587. // Otherwise increment minor.
  3588. // 1.2.0-5 bumps to 1.2.0
  3589. // 1.2.1 bumps to 1.3.0
  3590. if (this.patch !== 0 || this.prerelease.length === 0) {
  3591. this.minor++
  3592. }
  3593. this.patch = 0
  3594. this.prerelease = []
  3595. break
  3596. case 'patch':
  3597. // If this is not a pre-release version, it will increment the patch.
  3598. // If it is a pre-release it will bump up to the same patch version.
  3599. // 1.2.0-5 patches to 1.2.0
  3600. // 1.2.0 patches to 1.2.1
  3601. if (this.prerelease.length === 0) {
  3602. this.patch++
  3603. }
  3604. this.prerelease = []
  3605. break
  3606. // This probably shouldn't be used publicly.
  3607. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3608. case 'pre':
  3609. if (this.prerelease.length === 0) {
  3610. this.prerelease = [0]
  3611. } else {
  3612. var i = this.prerelease.length
  3613. while (--i >= 0) {
  3614. if (typeof this.prerelease[i] === 'number') {
  3615. this.prerelease[i]++
  3616. i = -2
  3617. }
  3618. }
  3619. if (i === -1) {
  3620. // didn't increment anything
  3621. this.prerelease.push(0)
  3622. }
  3623. }
  3624. if (identifier) {
  3625. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3626. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3627. if (this.prerelease[0] === identifier) {
  3628. if (isNaN(this.prerelease[1])) {
  3629. this.prerelease = [identifier, 0]
  3630. }
  3631. } else {
  3632. this.prerelease = [identifier, 0]
  3633. }
  3634. }
  3635. break
  3636. default:
  3637. throw new Error('invalid increment argument: ' + release)
  3638. }
  3639. this.format()
  3640. this.raw = this.version
  3641. return this
  3642. }
  3643. exports.inc = inc
  3644. function inc (version, release, loose, identifier) {
  3645. if (typeof (loose) === 'string') {
  3646. identifier = loose
  3647. loose = undefined
  3648. }
  3649. try {
  3650. return new SemVer(version, loose).inc(release, identifier).version
  3651. } catch (er) {
  3652. return null
  3653. }
  3654. }
  3655. exports.diff = diff
  3656. function diff (version1, version2) {
  3657. if (eq(version1, version2)) {
  3658. return null
  3659. } else {
  3660. var v1 = parse(version1)
  3661. var v2 = parse(version2)
  3662. var prefix = ''
  3663. if (v1.prerelease.length || v2.prerelease.length) {
  3664. prefix = 'pre'
  3665. var defaultResult = 'prerelease'
  3666. }
  3667. for (var key in v1) {
  3668. if (key === 'major' || key === 'minor' || key === 'patch') {
  3669. if (v1[key] !== v2[key]) {
  3670. return prefix + key
  3671. }
  3672. }
  3673. }
  3674. return defaultResult // may be undefined
  3675. }
  3676. }
  3677. exports.compareIdentifiers = compareIdentifiers
  3678. var numeric = /^[0-9]+$/
  3679. function compareIdentifiers (a, b) {
  3680. var anum = numeric.test(a)
  3681. var bnum = numeric.test(b)
  3682. if (anum && bnum) {
  3683. a = +a
  3684. b = +b
  3685. }
  3686. return a === b ? 0
  3687. : (anum && !bnum) ? -1
  3688. : (bnum && !anum) ? 1
  3689. : a < b ? -1
  3690. : 1
  3691. }
  3692. exports.rcompareIdentifiers = rcompareIdentifiers
  3693. function rcompareIdentifiers (a, b) {
  3694. return compareIdentifiers(b, a)
  3695. }
  3696. exports.major = major
  3697. function major (a, loose) {
  3698. return new SemVer(a, loose).major
  3699. }
  3700. exports.minor = minor
  3701. function minor (a, loose) {
  3702. return new SemVer(a, loose).minor
  3703. }
  3704. exports.patch = patch
  3705. function patch (a, loose) {
  3706. return new SemVer(a, loose).patch
  3707. }
  3708. exports.compare = compare
  3709. function compare (a, b, loose) {
  3710. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3711. }
  3712. exports.compareLoose = compareLoose
  3713. function compareLoose (a, b) {
  3714. return compare(a, b, true)
  3715. }
  3716. exports.rcompare = rcompare
  3717. function rcompare (a, b, loose) {
  3718. return compare(b, a, loose)
  3719. }
  3720. exports.sort = sort
  3721. function sort (list, loose) {
  3722. return list.sort(function (a, b) {
  3723. return exports.compare(a, b, loose)
  3724. })
  3725. }
  3726. exports.rsort = rsort
  3727. function rsort (list, loose) {
  3728. return list.sort(function (a, b) {
  3729. return exports.rcompare(a, b, loose)
  3730. })
  3731. }
  3732. exports.gt = gt
  3733. function gt (a, b, loose) {
  3734. return compare(a, b, loose) > 0
  3735. }
  3736. exports.lt = lt
  3737. function lt (a, b, loose) {
  3738. return compare(a, b, loose) < 0
  3739. }
  3740. exports.eq = eq
  3741. function eq (a, b, loose) {
  3742. return compare(a, b, loose) === 0
  3743. }
  3744. exports.neq = neq
  3745. function neq (a, b, loose) {
  3746. return compare(a, b, loose) !== 0
  3747. }
  3748. exports.gte = gte
  3749. function gte (a, b, loose) {
  3750. return compare(a, b, loose) >= 0
  3751. }
  3752. exports.lte = lte
  3753. function lte (a, b, loose) {
  3754. return compare(a, b, loose) <= 0
  3755. }
  3756. exports.cmp = cmp
  3757. function cmp (a, op, b, loose) {
  3758. switch (op) {
  3759. case '===':
  3760. if (typeof a === 'object')
  3761. a = a.version
  3762. if (typeof b === 'object')
  3763. b = b.version
  3764. return a === b
  3765. case '!==':
  3766. if (typeof a === 'object')
  3767. a = a.version
  3768. if (typeof b === 'object')
  3769. b = b.version
  3770. return a !== b
  3771. case '':
  3772. case '=':
  3773. case '==':
  3774. return eq(a, b, loose)
  3775. case '!=':
  3776. return neq(a, b, loose)
  3777. case '>':
  3778. return gt(a, b, loose)
  3779. case '>=':
  3780. return gte(a, b, loose)
  3781. case '<':
  3782. return lt(a, b, loose)
  3783. case '<=':
  3784. return lte(a, b, loose)
  3785. default:
  3786. throw new TypeError('Invalid operator: ' + op)
  3787. }
  3788. }
  3789. exports.Comparator = Comparator
  3790. function Comparator (comp, options) {
  3791. if (!options || typeof options !== 'object') {
  3792. options = {
  3793. loose: !!options,
  3794. includePrerelease: false
  3795. }
  3796. }
  3797. if (comp instanceof Comparator) {
  3798. if (comp.loose === !!options.loose) {
  3799. return comp
  3800. } else {
  3801. comp = comp.value
  3802. }
  3803. }
  3804. if (!(this instanceof Comparator)) {
  3805. return new Comparator(comp, options)
  3806. }
  3807. debug('comparator', comp, options)
  3808. this.options = options
  3809. this.loose = !!options.loose
  3810. this.parse(comp)
  3811. if (this.semver === ANY) {
  3812. this.value = ''
  3813. } else {
  3814. this.value = this.operator + this.semver.version
  3815. }
  3816. debug('comp', this)
  3817. }
  3818. var ANY = {}
  3819. Comparator.prototype.parse = function (comp) {
  3820. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3821. var m = comp.match(r)
  3822. if (!m) {
  3823. throw new TypeError('Invalid comparator: ' + comp)
  3824. }
  3825. this.operator = m[1]
  3826. if (this.operator === '=') {
  3827. this.operator = ''
  3828. }
  3829. // if it literally is just '>' or '' then allow anything.
  3830. if (!m[2]) {
  3831. this.semver = ANY
  3832. } else {
  3833. this.semver = new SemVer(m[2], this.options.loose)
  3834. }
  3835. }
  3836. Comparator.prototype.toString = function () {
  3837. return this.value
  3838. }
  3839. Comparator.prototype.test = function (version) {
  3840. debug('Comparator.test', version, this.options.loose)
  3841. if (this.semver === ANY) {
  3842. return true
  3843. }
  3844. if (typeof version === 'string') {
  3845. version = new SemVer(version, this.options)
  3846. }
  3847. return cmp(version, this.operator, this.semver, this.options)
  3848. }
  3849. Comparator.prototype.intersects = function (comp, options) {
  3850. if (!(comp instanceof Comparator)) {
  3851. throw new TypeError('a Comparator is required')
  3852. }
  3853. if (!options || typeof options !== 'object') {
  3854. options = {
  3855. loose: !!options,
  3856. includePrerelease: false
  3857. }
  3858. }
  3859. var rangeTmp
  3860. if (this.operator === '') {
  3861. rangeTmp = new Range(comp.value, options)
  3862. return satisfies(this.value, rangeTmp, options)
  3863. } else if (comp.operator === '') {
  3864. rangeTmp = new Range(this.value, options)
  3865. return satisfies(comp.semver, rangeTmp, options)
  3866. }
  3867. var sameDirectionIncreasing =
  3868. (this.operator === '>=' || this.operator === '>') &&
  3869. (comp.operator === '>=' || comp.operator === '>')
  3870. var sameDirectionDecreasing =
  3871. (this.operator === '<=' || this.operator === '<') &&
  3872. (comp.operator === '<=' || comp.operator === '<')
  3873. var sameSemVer = this.semver.version === comp.semver.version
  3874. var differentDirectionsInclusive =
  3875. (this.operator === '>=' || this.operator === '<=') &&
  3876. (comp.operator === '>=' || comp.operator === '<=')
  3877. var oppositeDirectionsLessThan =
  3878. cmp(this.semver, '<', comp.semver, options) &&
  3879. ((this.operator === '>=' || this.operator === '>') &&
  3880. (comp.operator === '<=' || comp.operator === '<'))
  3881. var oppositeDirectionsGreaterThan =
  3882. cmp(this.semver, '>', comp.semver, options) &&
  3883. ((this.operator === '<=' || this.operator === '<') &&
  3884. (comp.operator === '>=' || comp.operator === '>'))
  3885. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3886. (sameSemVer && differentDirectionsInclusive) ||
  3887. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3888. }
  3889. exports.Range = Range
  3890. function Range (range, options) {
  3891. if (!options || typeof options !== 'object') {
  3892. options = {
  3893. loose: !!options,
  3894. includePrerelease: false
  3895. }
  3896. }
  3897. if (range instanceof Range) {
  3898. if (range.loose === !!options.loose &&
  3899. range.includePrerelease === !!options.includePrerelease) {
  3900. return range
  3901. } else {
  3902. return new Range(range.raw, options)
  3903. }
  3904. }
  3905. if (range instanceof Comparator) {
  3906. return new Range(range.value, options)
  3907. }
  3908. if (!(this instanceof Range)) {
  3909. return new Range(range, options)
  3910. }
  3911. this.options = options
  3912. this.loose = !!options.loose
  3913. this.includePrerelease = !!options.includePrerelease
  3914. // First, split based on boolean or ||
  3915. this.raw = range
  3916. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3917. return this.parseRange(range.trim())
  3918. }, this).filter(function (c) {
  3919. // throw out any that are not relevant for whatever reason
  3920. return c.length
  3921. })
  3922. if (!this.set.length) {
  3923. throw new TypeError('Invalid SemVer Range: ' + range)
  3924. }
  3925. this.format()
  3926. }
  3927. Range.prototype.format = function () {
  3928. this.range = this.set.map(function (comps) {
  3929. return comps.join(' ').trim()
  3930. }).join('||').trim()
  3931. return this.range
  3932. }
  3933. Range.prototype.toString = function () {
  3934. return this.range
  3935. }
  3936. Range.prototype.parseRange = function (range) {
  3937. var loose = this.options.loose
  3938. range = range.trim()
  3939. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3940. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3941. range = range.replace(hr, hyphenReplace)
  3942. debug('hyphen replace', range)
  3943. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3944. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3945. debug('comparator trim', range, re[COMPARATORTRIM])
  3946. // `~ 1.2.3` => `~1.2.3`
  3947. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3948. // `^ 1.2.3` => `^1.2.3`
  3949. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3950. // normalize spaces
  3951. range = range.split(/\s+/).join(' ')
  3952. // At this point, the range is completely trimmed and
  3953. // ready to be split into comparators.
  3954. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3955. var set = range.split(' ').map(function (comp) {
  3956. return parseComparator(comp, this.options)
  3957. }, this).join(' ').split(/\s+/)
  3958. if (this.options.loose) {
  3959. // in loose mode, throw out any that are not valid comparators
  3960. set = set.filter(function (comp) {
  3961. return !!comp.match(compRe)
  3962. })
  3963. }
  3964. set = set.map(function (comp) {
  3965. return new Comparator(comp, this.options)
  3966. }, this)
  3967. return set
  3968. }
  3969. Range.prototype.intersects = function (range, options) {
  3970. if (!(range instanceof Range)) {
  3971. throw new TypeError('a Range is required')
  3972. }
  3973. return this.set.some(function (thisComparators) {
  3974. return thisComparators.every(function (thisComparator) {
  3975. return range.set.some(function (rangeComparators) {
  3976. return rangeComparators.every(function (rangeComparator) {
  3977. return thisComparator.intersects(rangeComparator, options)
  3978. })
  3979. })
  3980. })
  3981. })
  3982. }
  3983. // Mostly just for testing and legacy API reasons
  3984. exports.toComparators = toComparators
  3985. function toComparators (range, options) {
  3986. return new Range(range, options).set.map(function (comp) {
  3987. return comp.map(function (c) {
  3988. return c.value
  3989. }).join(' ').trim().split(' ')
  3990. })
  3991. }
  3992. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3993. // already replaced the hyphen ranges
  3994. // turn into a set of JUST comparators.
  3995. function parseComparator (comp, options) {
  3996. debug('comp', comp, options)
  3997. comp = replaceCarets(comp, options)
  3998. debug('caret', comp)
  3999. comp = replaceTildes(comp, options)
  4000. debug('tildes', comp)
  4001. comp = replaceXRanges(comp, options)
  4002. debug('xrange', comp)
  4003. comp = replaceStars(comp, options)
  4004. debug('stars', comp)
  4005. return comp
  4006. }
  4007. function isX (id) {
  4008. return !id || id.toLowerCase() === 'x' || id === '*'
  4009. }
  4010. // ~, ~> --> * (any, kinda silly)
  4011. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  4012. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  4013. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  4014. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  4015. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  4016. function replaceTildes (comp, options) {
  4017. return comp.trim().split(/\s+/).map(function (comp) {
  4018. return replaceTilde(comp, options)
  4019. }).join(' ')
  4020. }
  4021. function replaceTilde (comp, options) {
  4022. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  4023. return comp.replace(r, function (_, M, m, p, pr) {
  4024. debug('tilde', comp, _, M, m, p, pr)
  4025. var ret
  4026. if (isX(M)) {
  4027. ret = ''
  4028. } else if (isX(m)) {
  4029. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4030. } else if (isX(p)) {
  4031. // ~1.2 == >=1.2.0 <1.3.0
  4032. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4033. } else if (pr) {
  4034. debug('replaceTilde pr', pr)
  4035. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4036. ' <' + M + '.' + (+m + 1) + '.0'
  4037. } else {
  4038. // ~1.2.3 == >=1.2.3 <1.3.0
  4039. ret = '>=' + M + '.' + m + '.' + p +
  4040. ' <' + M + '.' + (+m + 1) + '.0'
  4041. }
  4042. debug('tilde return', ret)
  4043. return ret
  4044. })
  4045. }
  4046. // ^ --> * (any, kinda silly)
  4047. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4048. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4049. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4050. // ^1.2.3 --> >=1.2.3 <2.0.0
  4051. // ^1.2.0 --> >=1.2.0 <2.0.0
  4052. function replaceCarets (comp, options) {
  4053. return comp.trim().split(/\s+/).map(function (comp) {
  4054. return replaceCaret(comp, options)
  4055. }).join(' ')
  4056. }
  4057. function replaceCaret (comp, options) {
  4058. debug('caret', comp, options)
  4059. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4060. return comp.replace(r, function (_, M, m, p, pr) {
  4061. debug('caret', comp, _, M, m, p, pr)
  4062. var ret
  4063. if (isX(M)) {
  4064. ret = ''
  4065. } else if (isX(m)) {
  4066. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4067. } else if (isX(p)) {
  4068. if (M === '0') {
  4069. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4070. } else {
  4071. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4072. }
  4073. } else if (pr) {
  4074. debug('replaceCaret pr', pr)
  4075. if (M === '0') {
  4076. if (m === '0') {
  4077. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4078. ' <' + M + '.' + m + '.' + (+p + 1)
  4079. } else {
  4080. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4081. ' <' + M + '.' + (+m + 1) + '.0'
  4082. }
  4083. } else {
  4084. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4085. ' <' + (+M + 1) + '.0.0'
  4086. }
  4087. } else {
  4088. debug('no pr')
  4089. if (M === '0') {
  4090. if (m === '0') {
  4091. ret = '>=' + M + '.' + m + '.' + p +
  4092. ' <' + M + '.' + m + '.' + (+p + 1)
  4093. } else {
  4094. ret = '>=' + M + '.' + m + '.' + p +
  4095. ' <' + M + '.' + (+m + 1) + '.0'
  4096. }
  4097. } else {
  4098. ret = '>=' + M + '.' + m + '.' + p +
  4099. ' <' + (+M + 1) + '.0.0'
  4100. }
  4101. }
  4102. debug('caret return', ret)
  4103. return ret
  4104. })
  4105. }
  4106. function replaceXRanges (comp, options) {
  4107. debug('replaceXRanges', comp, options)
  4108. return comp.split(/\s+/).map(function (comp) {
  4109. return replaceXRange(comp, options)
  4110. }).join(' ')
  4111. }
  4112. function replaceXRange (comp, options) {
  4113. comp = comp.trim()
  4114. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4115. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4116. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4117. var xM = isX(M)
  4118. var xm = xM || isX(m)
  4119. var xp = xm || isX(p)
  4120. var anyX = xp
  4121. if (gtlt === '=' && anyX) {
  4122. gtlt = ''
  4123. }
  4124. if (xM) {
  4125. if (gtlt === '>' || gtlt === '<') {
  4126. // nothing is allowed
  4127. ret = '<0.0.0'
  4128. } else {
  4129. // nothing is forbidden
  4130. ret = '*'
  4131. }
  4132. } else if (gtlt && anyX) {
  4133. // we know patch is an x, because we have any x at all.
  4134. // replace X with 0
  4135. if (xm) {
  4136. m = 0
  4137. }
  4138. p = 0
  4139. if (gtlt === '>') {
  4140. // >1 => >=2.0.0
  4141. // >1.2 => >=1.3.0
  4142. // >1.2.3 => >= 1.2.4
  4143. gtlt = '>='
  4144. if (xm) {
  4145. M = +M + 1
  4146. m = 0
  4147. p = 0
  4148. } else {
  4149. m = +m + 1
  4150. p = 0
  4151. }
  4152. } else if (gtlt === '<=') {
  4153. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4154. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4155. gtlt = '<'
  4156. if (xm) {
  4157. M = +M + 1
  4158. } else {
  4159. m = +m + 1
  4160. }
  4161. }
  4162. ret = gtlt + M + '.' + m + '.' + p
  4163. } else if (xm) {
  4164. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4165. } else if (xp) {
  4166. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4167. }
  4168. debug('xRange return', ret)
  4169. return ret
  4170. })
  4171. }
  4172. // Because * is AND-ed with everything else in the comparator,
  4173. // and '' means "any version", just remove the *s entirely.
  4174. function replaceStars (comp, options) {
  4175. debug('replaceStars', comp, options)
  4176. // Looseness is ignored here. star is always as loose as it gets!
  4177. return comp.trim().replace(re[STAR], '')
  4178. }
  4179. // This function is passed to string.replace(re[HYPHENRANGE])
  4180. // M, m, patch, prerelease, build
  4181. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4182. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4183. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4184. function hyphenReplace ($0,
  4185. from, fM, fm, fp, fpr, fb,
  4186. to, tM, tm, tp, tpr, tb) {
  4187. if (isX(fM)) {
  4188. from = ''
  4189. } else if (isX(fm)) {
  4190. from = '>=' + fM + '.0.0'
  4191. } else if (isX(fp)) {
  4192. from = '>=' + fM + '.' + fm + '.0'
  4193. } else {
  4194. from = '>=' + from
  4195. }
  4196. if (isX(tM)) {
  4197. to = ''
  4198. } else if (isX(tm)) {
  4199. to = '<' + (+tM + 1) + '.0.0'
  4200. } else if (isX(tp)) {
  4201. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4202. } else if (tpr) {
  4203. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4204. } else {
  4205. to = '<=' + to
  4206. }
  4207. return (from + ' ' + to).trim()
  4208. }
  4209. // if ANY of the sets match ALL of its comparators, then pass
  4210. Range.prototype.test = function (version) {
  4211. if (!version) {
  4212. return false
  4213. }
  4214. if (typeof version === 'string') {
  4215. version = new SemVer(version, this.options)
  4216. }
  4217. for (var i = 0; i < this.set.length; i++) {
  4218. if (testSet(this.set[i], version, this.options)) {
  4219. return true
  4220. }
  4221. }
  4222. return false
  4223. }
  4224. function testSet (set, version, options) {
  4225. for (var i = 0; i < set.length; i++) {
  4226. if (!set[i].test(version)) {
  4227. return false
  4228. }
  4229. }
  4230. if (version.prerelease.length && !options.includePrerelease) {
  4231. // Find the set of versions that are allowed to have prereleases
  4232. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4233. // That should allow `1.2.3-pr.2` to pass.
  4234. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4235. // even though it's within the range set by the comparators.
  4236. for (i = 0; i < set.length; i++) {
  4237. debug(set[i].semver)
  4238. if (set[i].semver === ANY) {
  4239. continue
  4240. }
  4241. if (set[i].semver.prerelease.length > 0) {
  4242. var allowed = set[i].semver
  4243. if (allowed.major === version.major &&
  4244. allowed.minor === version.minor &&
  4245. allowed.patch === version.patch) {
  4246. return true
  4247. }
  4248. }
  4249. }
  4250. // Version has a -pre, but it's not one of the ones we like.
  4251. return false
  4252. }
  4253. return true
  4254. }
  4255. exports.satisfies = satisfies
  4256. function satisfies (version, range, options) {
  4257. try {
  4258. range = new Range(range, options)
  4259. } catch (er) {
  4260. return false
  4261. }
  4262. return range.test(version)
  4263. }
  4264. exports.maxSatisfying = maxSatisfying
  4265. function maxSatisfying (versions, range, options) {
  4266. var max = null
  4267. var maxSV = null
  4268. try {
  4269. var rangeObj = new Range(range, options)
  4270. } catch (er) {
  4271. return null
  4272. }
  4273. versions.forEach(function (v) {
  4274. if (rangeObj.test(v)) {
  4275. // satisfies(v, range, options)
  4276. if (!max || maxSV.compare(v) === -1) {
  4277. // compare(max, v, true)
  4278. max = v
  4279. maxSV = new SemVer(max, options)
  4280. }
  4281. }
  4282. })
  4283. return max
  4284. }
  4285. exports.minSatisfying = minSatisfying
  4286. function minSatisfying (versions, range, options) {
  4287. var min = null
  4288. var minSV = null
  4289. try {
  4290. var rangeObj = new Range(range, options)
  4291. } catch (er) {
  4292. return null
  4293. }
  4294. versions.forEach(function (v) {
  4295. if (rangeObj.test(v)) {
  4296. // satisfies(v, range, options)
  4297. if (!min || minSV.compare(v) === 1) {
  4298. // compare(min, v, true)
  4299. min = v
  4300. minSV = new SemVer(min, options)
  4301. }
  4302. }
  4303. })
  4304. return min
  4305. }
  4306. exports.minVersion = minVersion
  4307. function minVersion (range, loose) {
  4308. range = new Range(range, loose)
  4309. var minver = new SemVer('0.0.0')
  4310. if (range.test(minver)) {
  4311. return minver
  4312. }
  4313. minver = new SemVer('0.0.0-0')
  4314. if (range.test(minver)) {
  4315. return minver
  4316. }
  4317. minver = null
  4318. for (var i = 0; i < range.set.length; ++i) {
  4319. var comparators = range.set[i]
  4320. comparators.forEach(function (comparator) {
  4321. // Clone to avoid manipulating the comparator's semver object.
  4322. var compver = new SemVer(comparator.semver.version)
  4323. switch (comparator.operator) {
  4324. case '>':
  4325. if (compver.prerelease.length === 0) {
  4326. compver.patch++
  4327. } else {
  4328. compver.prerelease.push(0)
  4329. }
  4330. compver.raw = compver.format()
  4331. /* fallthrough */
  4332. case '':
  4333. case '>=':
  4334. if (!minver || gt(minver, compver)) {
  4335. minver = compver
  4336. }
  4337. break
  4338. case '<':
  4339. case '<=':
  4340. /* Ignore maximum versions */
  4341. break
  4342. /* istanbul ignore next */
  4343. default:
  4344. throw new Error('Unexpected operation: ' + comparator.operator)
  4345. }
  4346. })
  4347. }
  4348. if (minver && range.test(minver)) {
  4349. return minver
  4350. }
  4351. return null
  4352. }
  4353. exports.validRange = validRange
  4354. function validRange (range, options) {
  4355. try {
  4356. // Return '*' instead of '' so that truthiness works.
  4357. // This will throw if it's invalid anyway
  4358. return new Range(range, options).range || '*'
  4359. } catch (er) {
  4360. return null
  4361. }
  4362. }
  4363. // Determine if version is less than all the versions possible in the range
  4364. exports.ltr = ltr
  4365. function ltr (version, range, options) {
  4366. return outside(version, range, '<', options)
  4367. }
  4368. // Determine if version is greater than all the versions possible in the range.
  4369. exports.gtr = gtr
  4370. function gtr (version, range, options) {
  4371. return outside(version, range, '>', options)
  4372. }
  4373. exports.outside = outside
  4374. function outside (version, range, hilo, options) {
  4375. version = new SemVer(version, options)
  4376. range = new Range(range, options)
  4377. var gtfn, ltefn, ltfn, comp, ecomp
  4378. switch (hilo) {
  4379. case '>':
  4380. gtfn = gt
  4381. ltefn = lte
  4382. ltfn = lt
  4383. comp = '>'
  4384. ecomp = '>='
  4385. break
  4386. case '<':
  4387. gtfn = lt
  4388. ltefn = gte
  4389. ltfn = gt
  4390. comp = '<'
  4391. ecomp = '<='
  4392. break
  4393. default:
  4394. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4395. }
  4396. // If it satisifes the range it is not outside
  4397. if (satisfies(version, range, options)) {
  4398. return false
  4399. }
  4400. // From now on, variable terms are as if we're in "gtr" mode.
  4401. // but note that everything is flipped for the "ltr" function.
  4402. for (var i = 0; i < range.set.length; ++i) {
  4403. var comparators = range.set[i]
  4404. var high = null
  4405. var low = null
  4406. comparators.forEach(function (comparator) {
  4407. if (comparator.semver === ANY) {
  4408. comparator = new Comparator('>=0.0.0')
  4409. }
  4410. high = high || comparator
  4411. low = low || comparator
  4412. if (gtfn(comparator.semver, high.semver, options)) {
  4413. high = comparator
  4414. } else if (ltfn(comparator.semver, low.semver, options)) {
  4415. low = comparator
  4416. }
  4417. })
  4418. // If the edge version comparator has a operator then our version
  4419. // isn't outside it
  4420. if (high.operator === comp || high.operator === ecomp) {
  4421. return false
  4422. }
  4423. // If the lowest version comparator has an operator and our version
  4424. // is less than it then it isn't higher than the range
  4425. if ((!low.operator || low.operator === comp) &&
  4426. ltefn(version, low.semver)) {
  4427. return false
  4428. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4429. return false
  4430. }
  4431. }
  4432. return true
  4433. }
  4434. exports.prerelease = prerelease
  4435. function prerelease (version, options) {
  4436. var parsed = parse(version, options)
  4437. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4438. }
  4439. exports.intersects = intersects
  4440. function intersects (r1, r2, options) {
  4441. r1 = new Range(r1, options)
  4442. r2 = new Range(r2, options)
  4443. return r1.intersects(r2)
  4444. }
  4445. exports.coerce = coerce
  4446. function coerce (version) {
  4447. if (version instanceof SemVer) {
  4448. return version
  4449. }
  4450. if (typeof version !== 'string') {
  4451. return null
  4452. }
  4453. var match = version.match(re[COERCE])
  4454. if (match == null) {
  4455. return null
  4456. }
  4457. return parse(match[1] +
  4458. '.' + (match[2] || '0') +
  4459. '.' + (match[3] || '0'))
  4460. }
  4461. /***/ }),
  4462. /***/ 287:
  4463. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4464. "use strict";
  4465. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4466. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4467. return new (P || (P = Promise))(function (resolve, reject) {
  4468. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4469. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4470. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4471. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4472. });
  4473. };
  4474. var __importStar = (this && this.__importStar) || function (mod) {
  4475. if (mod && mod.__esModule) return mod;
  4476. var result = {};
  4477. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4478. result["default"] = mod;
  4479. return result;
  4480. };
  4481. var __importDefault = (this && this.__importDefault) || function (mod) {
  4482. return (mod && mod.__esModule) ? mod : { "default": mod };
  4483. };
  4484. Object.defineProperty(exports, "__esModule", { value: true });
  4485. const assert = __importStar(__webpack_require__(357));
  4486. const core = __importStar(__webpack_require__(470));
  4487. const exec = __importStar(__webpack_require__(986));
  4488. const fs = __importStar(__webpack_require__(747));
  4489. const io = __importStar(__webpack_require__(1));
  4490. const os = __importStar(__webpack_require__(87));
  4491. const path = __importStar(__webpack_require__(622));
  4492. const regexpHelper = __importStar(__webpack_require__(528));
  4493. const stateHelper = __importStar(__webpack_require__(153));
  4494. const urlHelper = __importStar(__webpack_require__(81));
  4495. const v4_1 = __importDefault(__webpack_require__(826));
  4496. const IS_WINDOWS = process.platform === 'win32';
  4497. const SSH_COMMAND_KEY = 'core.sshCommand';
  4498. function createAuthHelper(git, settings) {
  4499. return new GitAuthHelper(git, settings);
  4500. }
  4501. exports.createAuthHelper = createAuthHelper;
  4502. class GitAuthHelper {
  4503. constructor(gitCommandManager, gitSourceSettings) {
  4504. this.sshCommand = '';
  4505. this.sshKeyPath = '';
  4506. this.sshKnownHostsPath = '';
  4507. this.temporaryHomePath = '';
  4508. this.git = gitCommandManager;
  4509. this.settings = gitSourceSettings || {};
  4510. // Token auth header
  4511. const serverUrl = urlHelper.getServerUrl();
  4512. this.tokenConfigKey = `http.${serverUrl.origin}/.extraheader`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4513. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4514. core.setSecret(basicCredential);
  4515. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4516. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4517. // Instead of SSH URL
  4518. this.insteadOfKey = `url.${serverUrl.origin}/.insteadOf`; // "origin" is SCHEME://HOSTNAME[:PORT]
  4519. this.insteadOfValue = `git@${serverUrl.hostname}:`;
  4520. }
  4521. configureAuth() {
  4522. return __awaiter(this, void 0, void 0, function* () {
  4523. // Remove possible previous values
  4524. yield this.removeAuth();
  4525. // Configure new values
  4526. yield this.configureSsh();
  4527. yield this.configureToken();
  4528. });
  4529. }
  4530. configureGlobalAuth() {
  4531. return __awaiter(this, void 0, void 0, function* () {
  4532. // Create a temp home directory
  4533. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4534. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4535. const uniqueId = v4_1.default();
  4536. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4537. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4538. // Copy the global git config
  4539. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4540. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4541. let configExists = false;
  4542. try {
  4543. yield fs.promises.stat(gitConfigPath);
  4544. configExists = true;
  4545. }
  4546. catch (err) {
  4547. if (err.code !== 'ENOENT') {
  4548. throw err;
  4549. }
  4550. }
  4551. if (configExists) {
  4552. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4553. yield io.cp(gitConfigPath, newGitConfigPath);
  4554. }
  4555. else {
  4556. yield fs.promises.writeFile(newGitConfigPath, '');
  4557. }
  4558. try {
  4559. // Override HOME
  4560. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4561. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4562. // Configure the token
  4563. yield this.configureToken(newGitConfigPath, true);
  4564. // Configure HTTPS instead of SSH
  4565. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4566. if (!this.settings.sshKey) {
  4567. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4568. }
  4569. }
  4570. catch (err) {
  4571. // Unset in case somehow written to the real global config
  4572. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4573. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4574. throw err;
  4575. }
  4576. });
  4577. }
  4578. configureSubmoduleAuth() {
  4579. return __awaiter(this, void 0, void 0, function* () {
  4580. // Remove possible previous HTTPS instead of SSH
  4581. yield this.removeGitConfig(this.insteadOfKey, true);
  4582. if (this.settings.persistCredentials) {
  4583. // Configure a placeholder value. This approach avoids the credential being captured
  4584. // by process creation audit events, which are commonly logged. For more information,
  4585. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4586. 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);
  4587. // Replace the placeholder
  4588. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4589. for (const configPath of configPaths) {
  4590. core.debug(`Replacing token placeholder in '${configPath}'`);
  4591. this.replaceTokenPlaceholder(configPath);
  4592. }
  4593. if (this.settings.sshKey) {
  4594. // Configure core.sshCommand
  4595. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4596. }
  4597. else {
  4598. // Configure HTTPS instead of SSH
  4599. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4600. }
  4601. }
  4602. });
  4603. }
  4604. removeAuth() {
  4605. return __awaiter(this, void 0, void 0, function* () {
  4606. yield this.removeSsh();
  4607. yield this.removeToken();
  4608. });
  4609. }
  4610. removeGlobalAuth() {
  4611. return __awaiter(this, void 0, void 0, function* () {
  4612. core.info(`Unsetting HOME override`);
  4613. this.git.removeEnvironmentVariable('HOME');
  4614. yield io.rmRF(this.temporaryHomePath);
  4615. });
  4616. }
  4617. configureSsh() {
  4618. return __awaiter(this, void 0, void 0, function* () {
  4619. if (!this.settings.sshKey) {
  4620. return;
  4621. }
  4622. // Write key
  4623. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4624. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4625. const uniqueId = v4_1.default();
  4626. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4627. stateHelper.setSshKeyPath(this.sshKeyPath);
  4628. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4629. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4630. // Remove inherited permissions on Windows
  4631. if (IS_WINDOWS) {
  4632. const icacls = yield io.which('icacls.exe');
  4633. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4634. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4635. }
  4636. // Write known hosts
  4637. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4638. let userKnownHosts = '';
  4639. try {
  4640. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4641. }
  4642. catch (err) {
  4643. if (err.code !== 'ENOENT') {
  4644. throw err;
  4645. }
  4646. }
  4647. let knownHosts = '';
  4648. if (userKnownHosts) {
  4649. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4650. }
  4651. if (this.settings.sshKnownHosts) {
  4652. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4653. }
  4654. 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`;
  4655. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4656. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4657. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4658. // Configure GIT_SSH_COMMAND
  4659. const sshPath = yield io.which('ssh', true);
  4660. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4661. if (this.settings.sshStrict) {
  4662. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4663. }
  4664. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4665. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4666. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4667. // Configure core.sshCommand
  4668. if (this.settings.persistCredentials) {
  4669. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4670. }
  4671. });
  4672. }
  4673. configureToken(configPath, globalConfig) {
  4674. return __awaiter(this, void 0, void 0, function* () {
  4675. // Validate args
  4676. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4677. // Default config path
  4678. if (!configPath && !globalConfig) {
  4679. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4680. }
  4681. // Configure a placeholder value. This approach avoids the credential being captured
  4682. // by process creation audit events, which are commonly logged. For more information,
  4683. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4684. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4685. // Replace the placeholder
  4686. yield this.replaceTokenPlaceholder(configPath || '');
  4687. });
  4688. }
  4689. replaceTokenPlaceholder(configPath) {
  4690. return __awaiter(this, void 0, void 0, function* () {
  4691. assert.ok(configPath, 'configPath is not defined');
  4692. let content = (yield fs.promises.readFile(configPath)).toString();
  4693. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4694. if (placeholderIndex < 0 ||
  4695. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4696. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4697. }
  4698. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4699. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4700. yield fs.promises.writeFile(configPath, content);
  4701. });
  4702. }
  4703. removeSsh() {
  4704. return __awaiter(this, void 0, void 0, function* () {
  4705. // SSH key
  4706. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4707. if (keyPath) {
  4708. try {
  4709. yield io.rmRF(keyPath);
  4710. }
  4711. catch (err) {
  4712. core.debug(err.message);
  4713. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4714. }
  4715. }
  4716. // SSH known hosts
  4717. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4718. if (knownHostsPath) {
  4719. try {
  4720. yield io.rmRF(knownHostsPath);
  4721. }
  4722. catch (_a) {
  4723. // Intentionally empty
  4724. }
  4725. }
  4726. // SSH command
  4727. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4728. });
  4729. }
  4730. removeToken() {
  4731. return __awaiter(this, void 0, void 0, function* () {
  4732. // HTTP extra header
  4733. yield this.removeGitConfig(this.tokenConfigKey);
  4734. });
  4735. }
  4736. removeGitConfig(configKey, submoduleOnly = false) {
  4737. return __awaiter(this, void 0, void 0, function* () {
  4738. if (!submoduleOnly) {
  4739. if ((yield this.git.configExists(configKey)) &&
  4740. !(yield this.git.tryConfigUnset(configKey))) {
  4741. // Load the config contents
  4742. core.warning(`Failed to remove '${configKey}' from the git config`);
  4743. }
  4744. }
  4745. const pattern = regexpHelper.escape(configKey);
  4746. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4747. });
  4748. }
  4749. }
  4750. /***/ }),
  4751. /***/ 289:
  4752. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4753. "use strict";
  4754. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4755. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4756. return new (P || (P = Promise))(function (resolve, reject) {
  4757. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4758. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4759. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4760. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4761. });
  4762. };
  4763. var __importStar = (this && this.__importStar) || function (mod) {
  4764. if (mod && mod.__esModule) return mod;
  4765. var result = {};
  4766. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4767. result["default"] = mod;
  4768. return result;
  4769. };
  4770. Object.defineProperty(exports, "__esModule", { value: true });
  4771. const core = __importStar(__webpack_require__(470));
  4772. const exec = __importStar(__webpack_require__(986));
  4773. const fshelper = __importStar(__webpack_require__(618));
  4774. const io = __importStar(__webpack_require__(1));
  4775. const path = __importStar(__webpack_require__(622));
  4776. const regexpHelper = __importStar(__webpack_require__(528));
  4777. const retryHelper = __importStar(__webpack_require__(587));
  4778. const git_version_1 = __webpack_require__(559);
  4779. // Auth header not supported before 2.9
  4780. // Wire protocol v2 not supported before 2.18
  4781. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4782. function createCommandManager(workingDirectory, lfs) {
  4783. return __awaiter(this, void 0, void 0, function* () {
  4784. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4785. });
  4786. }
  4787. exports.createCommandManager = createCommandManager;
  4788. class GitCommandManager {
  4789. // Private constructor; use createCommandManager()
  4790. constructor() {
  4791. this.gitEnv = {
  4792. GIT_TERMINAL_PROMPT: '0',
  4793. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4794. };
  4795. this.gitPath = '';
  4796. this.lfs = false;
  4797. this.workingDirectory = '';
  4798. }
  4799. branchDelete(remote, branch) {
  4800. return __awaiter(this, void 0, void 0, function* () {
  4801. const args = ['branch', '--delete', '--force'];
  4802. if (remote) {
  4803. args.push('--remote');
  4804. }
  4805. args.push(branch);
  4806. yield this.execGit(args);
  4807. });
  4808. }
  4809. branchExists(remote, pattern) {
  4810. return __awaiter(this, void 0, void 0, function* () {
  4811. const args = ['branch', '--list'];
  4812. if (remote) {
  4813. args.push('--remote');
  4814. }
  4815. args.push(pattern);
  4816. const output = yield this.execGit(args);
  4817. return !!output.stdout.trim();
  4818. });
  4819. }
  4820. branchList(remote) {
  4821. return __awaiter(this, void 0, void 0, function* () {
  4822. const result = [];
  4823. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4824. // "branch --list" is more difficult when in a detached HEAD state.
  4825. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4826. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4827. const args = ['rev-parse', '--symbolic-full-name'];
  4828. if (remote) {
  4829. args.push('--remotes=origin');
  4830. }
  4831. else {
  4832. args.push('--branches');
  4833. }
  4834. const output = yield this.execGit(args);
  4835. for (let branch of output.stdout.trim().split('\n')) {
  4836. branch = branch.trim();
  4837. if (branch) {
  4838. if (branch.startsWith('refs/heads/')) {
  4839. branch = branch.substr('refs/heads/'.length);
  4840. }
  4841. else if (branch.startsWith('refs/remotes/')) {
  4842. branch = branch.substr('refs/remotes/'.length);
  4843. }
  4844. result.push(branch);
  4845. }
  4846. }
  4847. return result;
  4848. });
  4849. }
  4850. checkout(ref, startPoint) {
  4851. return __awaiter(this, void 0, void 0, function* () {
  4852. const args = ['checkout', '--progress', '--force'];
  4853. if (startPoint) {
  4854. args.push('-B', ref, startPoint);
  4855. }
  4856. else {
  4857. args.push(ref);
  4858. }
  4859. yield this.execGit(args);
  4860. });
  4861. }
  4862. checkoutDetach() {
  4863. return __awaiter(this, void 0, void 0, function* () {
  4864. const args = ['checkout', '--detach'];
  4865. yield this.execGit(args);
  4866. });
  4867. }
  4868. config(configKey, configValue, globalConfig) {
  4869. return __awaiter(this, void 0, void 0, function* () {
  4870. yield this.execGit([
  4871. 'config',
  4872. globalConfig ? '--global' : '--local',
  4873. configKey,
  4874. configValue
  4875. ]);
  4876. });
  4877. }
  4878. configExists(configKey, globalConfig) {
  4879. return __awaiter(this, void 0, void 0, function* () {
  4880. const pattern = regexpHelper.escape(configKey);
  4881. const output = yield this.execGit([
  4882. 'config',
  4883. globalConfig ? '--global' : '--local',
  4884. '--name-only',
  4885. '--get-regexp',
  4886. pattern
  4887. ], true);
  4888. return output.exitCode === 0;
  4889. });
  4890. }
  4891. fetch(fetchDepth, refSpec) {
  4892. return __awaiter(this, void 0, void 0, function* () {
  4893. const args = [
  4894. '-c',
  4895. 'protocol.version=2',
  4896. 'fetch',
  4897. '--no-tags',
  4898. '--prune',
  4899. '--progress',
  4900. '--no-recurse-submodules'
  4901. ];
  4902. if (fetchDepth > 0) {
  4903. args.push(`--depth=${fetchDepth}`);
  4904. }
  4905. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4906. args.push('--unshallow');
  4907. }
  4908. args.push('origin');
  4909. for (const arg of refSpec) {
  4910. args.push(arg);
  4911. }
  4912. const that = this;
  4913. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4914. yield that.execGit(args);
  4915. }));
  4916. });
  4917. }
  4918. getWorkingDirectory() {
  4919. return this.workingDirectory;
  4920. }
  4921. init() {
  4922. return __awaiter(this, void 0, void 0, function* () {
  4923. yield this.execGit(['init', this.workingDirectory]);
  4924. });
  4925. }
  4926. isDetached() {
  4927. return __awaiter(this, void 0, void 0, function* () {
  4928. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  4929. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  4930. return !output.stdout.trim().startsWith('refs/heads/');
  4931. });
  4932. }
  4933. lfsFetch(ref) {
  4934. return __awaiter(this, void 0, void 0, function* () {
  4935. const args = ['lfs', 'fetch', 'origin', ref];
  4936. const that = this;
  4937. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4938. yield that.execGit(args);
  4939. }));
  4940. });
  4941. }
  4942. lfsInstall() {
  4943. return __awaiter(this, void 0, void 0, function* () {
  4944. yield this.execGit(['lfs', 'install', '--local']);
  4945. });
  4946. }
  4947. log1() {
  4948. return __awaiter(this, void 0, void 0, function* () {
  4949. yield this.execGit(['log', '-1']);
  4950. });
  4951. }
  4952. remoteAdd(remoteName, remoteUrl) {
  4953. return __awaiter(this, void 0, void 0, function* () {
  4954. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4955. });
  4956. }
  4957. removeEnvironmentVariable(name) {
  4958. delete this.gitEnv[name];
  4959. }
  4960. setEnvironmentVariable(name, value) {
  4961. this.gitEnv[name] = value;
  4962. }
  4963. submoduleForeach(command, recursive) {
  4964. return __awaiter(this, void 0, void 0, function* () {
  4965. const args = ['submodule', 'foreach'];
  4966. if (recursive) {
  4967. args.push('--recursive');
  4968. }
  4969. args.push(command);
  4970. const output = yield this.execGit(args);
  4971. return output.stdout;
  4972. });
  4973. }
  4974. submoduleSync(recursive) {
  4975. return __awaiter(this, void 0, void 0, function* () {
  4976. const args = ['submodule', 'sync'];
  4977. if (recursive) {
  4978. args.push('--recursive');
  4979. }
  4980. yield this.execGit(args);
  4981. });
  4982. }
  4983. submoduleUpdate(fetchDepth, recursive) {
  4984. return __awaiter(this, void 0, void 0, function* () {
  4985. const args = ['-c', 'protocol.version=2'];
  4986. args.push('submodule', 'update', '--init', '--force');
  4987. if (fetchDepth > 0) {
  4988. args.push(`--depth=${fetchDepth}`);
  4989. }
  4990. if (recursive) {
  4991. args.push('--recursive');
  4992. }
  4993. yield this.execGit(args);
  4994. });
  4995. }
  4996. tagExists(pattern) {
  4997. return __awaiter(this, void 0, void 0, function* () {
  4998. const output = yield this.execGit(['tag', '--list', pattern]);
  4999. return !!output.stdout.trim();
  5000. });
  5001. }
  5002. tryClean() {
  5003. return __awaiter(this, void 0, void 0, function* () {
  5004. const output = yield this.execGit(['clean', '-ffdx'], true);
  5005. return output.exitCode === 0;
  5006. });
  5007. }
  5008. tryConfigUnset(configKey, globalConfig) {
  5009. return __awaiter(this, void 0, void 0, function* () {
  5010. const output = yield this.execGit([
  5011. 'config',
  5012. globalConfig ? '--global' : '--local',
  5013. '--unset-all',
  5014. configKey
  5015. ], true);
  5016. return output.exitCode === 0;
  5017. });
  5018. }
  5019. tryDisableAutomaticGarbageCollection() {
  5020. return __awaiter(this, void 0, void 0, function* () {
  5021. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  5022. return output.exitCode === 0;
  5023. });
  5024. }
  5025. tryGetFetchUrl() {
  5026. return __awaiter(this, void 0, void 0, function* () {
  5027. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  5028. if (output.exitCode !== 0) {
  5029. return '';
  5030. }
  5031. const stdout = output.stdout.trim();
  5032. if (stdout.includes('\n')) {
  5033. return '';
  5034. }
  5035. return stdout;
  5036. });
  5037. }
  5038. tryReset() {
  5039. return __awaiter(this, void 0, void 0, function* () {
  5040. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5041. return output.exitCode === 0;
  5042. });
  5043. }
  5044. static createCommandManager(workingDirectory, lfs) {
  5045. return __awaiter(this, void 0, void 0, function* () {
  5046. const result = new GitCommandManager();
  5047. yield result.initializeCommandManager(workingDirectory, lfs);
  5048. return result;
  5049. });
  5050. }
  5051. execGit(args, allowAllExitCodes = false) {
  5052. return __awaiter(this, void 0, void 0, function* () {
  5053. fshelper.directoryExistsSync(this.workingDirectory, true);
  5054. const result = new GitOutput();
  5055. const env = {};
  5056. for (const key of Object.keys(process.env)) {
  5057. env[key] = process.env[key];
  5058. }
  5059. for (const key of Object.keys(this.gitEnv)) {
  5060. env[key] = this.gitEnv[key];
  5061. }
  5062. const stdout = [];
  5063. const options = {
  5064. cwd: this.workingDirectory,
  5065. env,
  5066. ignoreReturnCode: allowAllExitCodes,
  5067. listeners: {
  5068. stdout: (data) => {
  5069. stdout.push(data.toString());
  5070. }
  5071. }
  5072. };
  5073. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5074. result.stdout = stdout.join('');
  5075. return result;
  5076. });
  5077. }
  5078. initializeCommandManager(workingDirectory, lfs) {
  5079. return __awaiter(this, void 0, void 0, function* () {
  5080. this.workingDirectory = workingDirectory;
  5081. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5082. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5083. this.lfs = lfs;
  5084. if (!this.lfs) {
  5085. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5086. }
  5087. this.gitPath = yield io.which('git', true);
  5088. // Git version
  5089. core.debug('Getting git version');
  5090. let gitVersion = new git_version_1.GitVersion();
  5091. let gitOutput = yield this.execGit(['version']);
  5092. let stdout = gitOutput.stdout.trim();
  5093. if (!stdout.includes('\n')) {
  5094. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5095. if (match) {
  5096. gitVersion = new git_version_1.GitVersion(match[0]);
  5097. }
  5098. }
  5099. if (!gitVersion.isValid()) {
  5100. throw new Error('Unable to determine git version');
  5101. }
  5102. // Minimum git version
  5103. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5104. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5105. }
  5106. if (this.lfs) {
  5107. // Git-lfs version
  5108. core.debug('Getting git-lfs version');
  5109. let gitLfsVersion = new git_version_1.GitVersion();
  5110. const gitLfsPath = yield io.which('git-lfs', true);
  5111. gitOutput = yield this.execGit(['lfs', 'version']);
  5112. stdout = gitOutput.stdout.trim();
  5113. if (!stdout.includes('\n')) {
  5114. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5115. if (match) {
  5116. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5117. }
  5118. }
  5119. if (!gitLfsVersion.isValid()) {
  5120. throw new Error('Unable to determine git-lfs version');
  5121. }
  5122. // Minimum git-lfs version
  5123. // Note:
  5124. // - Auth header not supported before 2.1
  5125. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5126. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5127. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5128. }
  5129. }
  5130. // Set the user agent
  5131. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5132. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5133. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5134. });
  5135. }
  5136. }
  5137. class GitOutput {
  5138. constructor() {
  5139. this.stdout = '';
  5140. this.exitCode = 0;
  5141. }
  5142. }
  5143. /***/ }),
  5144. /***/ 293:
  5145. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5146. "use strict";
  5147. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5148. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5149. return new (P || (P = Promise))(function (resolve, reject) {
  5150. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5151. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5152. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5153. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5154. });
  5155. };
  5156. var __importStar = (this && this.__importStar) || function (mod) {
  5157. if (mod && mod.__esModule) return mod;
  5158. var result = {};
  5159. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5160. result["default"] = mod;
  5161. return result;
  5162. };
  5163. Object.defineProperty(exports, "__esModule", { value: true });
  5164. const core = __importStar(__webpack_require__(470));
  5165. const fsHelper = __importStar(__webpack_require__(618));
  5166. const gitAuthHelper = __importStar(__webpack_require__(287));
  5167. const gitCommandManager = __importStar(__webpack_require__(289));
  5168. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5169. const githubApiHelper = __importStar(__webpack_require__(464));
  5170. const io = __importStar(__webpack_require__(1));
  5171. const path = __importStar(__webpack_require__(622));
  5172. const refHelper = __importStar(__webpack_require__(227));
  5173. const stateHelper = __importStar(__webpack_require__(153));
  5174. const urlHelper = __importStar(__webpack_require__(81));
  5175. function getSource(settings) {
  5176. return __awaiter(this, void 0, void 0, function* () {
  5177. // Repository URL
  5178. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5179. const repositoryUrl = urlHelper.getFetchUrl(settings);
  5180. // Remove conflicting file path
  5181. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5182. yield io.rmRF(settings.repositoryPath);
  5183. }
  5184. // Create directory
  5185. let isExisting = true;
  5186. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5187. isExisting = false;
  5188. yield io.mkdirP(settings.repositoryPath);
  5189. }
  5190. // Git command manager
  5191. const git = yield getGitCommandManager(settings);
  5192. // Prepare existing directory, otherwise recreate
  5193. if (isExisting) {
  5194. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  5195. }
  5196. if (!git) {
  5197. // Downloading using REST API
  5198. core.info(`The repository will be downloaded using the GitHub REST API`);
  5199. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5200. if (settings.submodules) {
  5201. 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.`);
  5202. }
  5203. else if (settings.sshKey) {
  5204. 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.`);
  5205. }
  5206. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5207. return;
  5208. }
  5209. // Save state for POST action
  5210. stateHelper.setRepositoryPath(settings.repositoryPath);
  5211. // Initialize the repository
  5212. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5213. yield git.init();
  5214. yield git.remoteAdd('origin', repositoryUrl);
  5215. }
  5216. // Disable automatic garbage collection
  5217. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5218. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5219. }
  5220. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5221. try {
  5222. // Configure auth
  5223. yield authHelper.configureAuth();
  5224. // LFS install
  5225. if (settings.lfs) {
  5226. yield git.lfsInstall();
  5227. }
  5228. // Fetch
  5229. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5230. yield git.fetch(settings.fetchDepth, refSpec);
  5231. // Checkout info
  5232. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5233. // LFS fetch
  5234. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5235. // Explicit lfs fetch will fetch lfs objects in parallel.
  5236. if (settings.lfs) {
  5237. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5238. }
  5239. // Checkout
  5240. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5241. // Submodules
  5242. if (settings.submodules) {
  5243. try {
  5244. // Temporarily override global config
  5245. yield authHelper.configureGlobalAuth();
  5246. // Checkout submodules
  5247. yield git.submoduleSync(settings.nestedSubmodules);
  5248. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5249. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5250. // Persist credentials
  5251. if (settings.persistCredentials) {
  5252. yield authHelper.configureSubmoduleAuth();
  5253. }
  5254. }
  5255. finally {
  5256. // Remove temporary global config override
  5257. yield authHelper.removeGlobalAuth();
  5258. }
  5259. }
  5260. // Dump some info about the checked out commit
  5261. yield git.log1();
  5262. }
  5263. finally {
  5264. // Remove auth
  5265. if (!settings.persistCredentials) {
  5266. yield authHelper.removeAuth();
  5267. }
  5268. }
  5269. });
  5270. }
  5271. exports.getSource = getSource;
  5272. function cleanup(repositoryPath) {
  5273. return __awaiter(this, void 0, void 0, function* () {
  5274. // Repo exists?
  5275. if (!repositoryPath ||
  5276. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5277. return;
  5278. }
  5279. let git;
  5280. try {
  5281. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5282. }
  5283. catch (_a) {
  5284. return;
  5285. }
  5286. // Remove auth
  5287. const authHelper = gitAuthHelper.createAuthHelper(git);
  5288. yield authHelper.removeAuth();
  5289. });
  5290. }
  5291. exports.cleanup = cleanup;
  5292. function getGitCommandManager(settings) {
  5293. return __awaiter(this, void 0, void 0, function* () {
  5294. core.info(`Working directory is '${settings.repositoryPath}'`);
  5295. try {
  5296. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5297. }
  5298. catch (err) {
  5299. // Git is required for LFS
  5300. if (settings.lfs) {
  5301. throw err;
  5302. }
  5303. // Otherwise fallback to REST API
  5304. return undefined;
  5305. }
  5306. });
  5307. }
  5308. /***/ }),
  5309. /***/ 294:
  5310. /***/ (function(module, __unusedexports, __webpack_require__) {
  5311. module.exports = parseOptions;
  5312. const { Deprecation } = __webpack_require__(692);
  5313. const { getUserAgent } = __webpack_require__(796);
  5314. const once = __webpack_require__(969);
  5315. const pkg = __webpack_require__(215);
  5316. const deprecateOptionsTimeout = once((log, deprecation) =>
  5317. log.warn(deprecation)
  5318. );
  5319. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5320. const deprecateOptionsHeaders = once((log, deprecation) =>
  5321. log.warn(deprecation)
  5322. );
  5323. function parseOptions(options, log, hook) {
  5324. if (options.headers) {
  5325. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5326. newObj[key.toLowerCase()] = options.headers[key];
  5327. return newObj;
  5328. }, {});
  5329. }
  5330. const clientDefaults = {
  5331. headers: options.headers || {},
  5332. request: options.request || {},
  5333. mediaType: {
  5334. previews: [],
  5335. format: ""
  5336. }
  5337. };
  5338. if (options.baseUrl) {
  5339. clientDefaults.baseUrl = options.baseUrl;
  5340. }
  5341. if (options.userAgent) {
  5342. clientDefaults.headers["user-agent"] = options.userAgent;
  5343. }
  5344. if (options.previews) {
  5345. clientDefaults.mediaType.previews = options.previews;
  5346. }
  5347. if (options.timeZone) {
  5348. clientDefaults.headers["time-zone"] = options.timeZone;
  5349. }
  5350. if (options.timeout) {
  5351. deprecateOptionsTimeout(
  5352. log,
  5353. new Deprecation(
  5354. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5355. )
  5356. );
  5357. clientDefaults.request.timeout = options.timeout;
  5358. }
  5359. if (options.agent) {
  5360. deprecateOptionsAgent(
  5361. log,
  5362. new Deprecation(
  5363. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5364. )
  5365. );
  5366. clientDefaults.request.agent = options.agent;
  5367. }
  5368. if (options.headers) {
  5369. deprecateOptionsHeaders(
  5370. log,
  5371. new Deprecation(
  5372. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5373. )
  5374. );
  5375. }
  5376. const userAgentOption = clientDefaults.headers["user-agent"];
  5377. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5378. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5379. .filter(Boolean)
  5380. .join(" ");
  5381. clientDefaults.request.hook = hook.bind(null, "request");
  5382. return clientDefaults;
  5383. }
  5384. /***/ }),
  5385. /***/ 297:
  5386. /***/ (function(module) {
  5387. module.exports = class HttpError extends Error {
  5388. constructor (message, code, headers) {
  5389. super(message)
  5390. // Maintains proper stack trace (only available on V8)
  5391. /* istanbul ignore next */
  5392. if (Error.captureStackTrace) {
  5393. Error.captureStackTrace(this, this.constructor)
  5394. }
  5395. this.name = 'HttpError'
  5396. this.code = code
  5397. this.headers = headers
  5398. }
  5399. }
  5400. /***/ }),
  5401. /***/ 301:
  5402. /***/ (function(module, __unusedexports, __webpack_require__) {
  5403. /**
  5404. * Some “list” response that can be paginated have a different response structure
  5405. *
  5406. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5407. * /installation/repositories also has `repository_selection`), as well as a key with
  5408. * the list of the items which name varies from endpoint to endpoint:
  5409. *
  5410. * - https://developer.github.com/v3/search/#example (key `items`)
  5411. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5412. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5413. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5414. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5415. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5416. *
  5417. * Octokit normalizes these responses so that paginated results are always returned following
  5418. * the same structure. One challenge is that if the list response has only one page, no Link
  5419. * header is provided, so this header alone is not sufficient to check wether a response is
  5420. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5421. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5422. * property because it also exists in the response of Get the combined status for a specific ref.
  5423. */
  5424. module.exports = normalizePaginatedListResponse;
  5425. const { Deprecation } = __webpack_require__(692);
  5426. const once = __webpack_require__(969);
  5427. const deprecateIncompleteResults = once((log, deprecation) =>
  5428. log.warn(deprecation)
  5429. );
  5430. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5431. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5432. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5433. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5434. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5435. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5436. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5437. function normalizePaginatedListResponse(octokit, url, response) {
  5438. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5439. if (
  5440. !REGEX_IS_SEARCH_PATH.test(path) &&
  5441. !REGEX_IS_CHECKS_PATH.test(path) &&
  5442. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5443. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5444. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5445. ) {
  5446. return;
  5447. }
  5448. // keep the additional properties intact to avoid a breaking change,
  5449. // but log a deprecation warning when accessed
  5450. const incompleteResults = response.data.incomplete_results;
  5451. const repositorySelection = response.data.repository_selection;
  5452. const totalCount = response.data.total_count;
  5453. delete response.data.incomplete_results;
  5454. delete response.data.repository_selection;
  5455. delete response.data.total_count;
  5456. const namespaceKey = Object.keys(response.data)[0];
  5457. response.data = response.data[namespaceKey];
  5458. Object.defineProperty(response.data, namespaceKey, {
  5459. get() {
  5460. deprecateNamespace(
  5461. octokit.log,
  5462. new Deprecation(
  5463. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5464. )
  5465. );
  5466. return response.data;
  5467. }
  5468. });
  5469. if (typeof incompleteResults !== "undefined") {
  5470. Object.defineProperty(response.data, "incomplete_results", {
  5471. get() {
  5472. deprecateIncompleteResults(
  5473. octokit.log,
  5474. new Deprecation(
  5475. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5476. )
  5477. );
  5478. return incompleteResults;
  5479. }
  5480. });
  5481. }
  5482. if (typeof repositorySelection !== "undefined") {
  5483. Object.defineProperty(response.data, "repository_selection", {
  5484. get() {
  5485. deprecateTotalCount(
  5486. octokit.log,
  5487. new Deprecation(
  5488. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5489. )
  5490. );
  5491. return repositorySelection;
  5492. }
  5493. });
  5494. }
  5495. Object.defineProperty(response.data, "total_count", {
  5496. get() {
  5497. deprecateTotalCount(
  5498. octokit.log,
  5499. new Deprecation(
  5500. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5501. )
  5502. );
  5503. return totalCount;
  5504. }
  5505. });
  5506. }
  5507. /***/ }),
  5508. /***/ 323:
  5509. /***/ (function(module) {
  5510. "use strict";
  5511. var isStream = module.exports = function (stream) {
  5512. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5513. };
  5514. isStream.writable = function (stream) {
  5515. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5516. };
  5517. isStream.readable = function (stream) {
  5518. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5519. };
  5520. isStream.duplex = function (stream) {
  5521. return isStream.writable(stream) && isStream.readable(stream);
  5522. };
  5523. isStream.transform = function (stream) {
  5524. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5525. };
  5526. /***/ }),
  5527. /***/ 335:
  5528. /***/ (function(module, __unusedexports, __webpack_require__) {
  5529. module.exports = __webpack_require__(179);
  5530. /***/ }),
  5531. /***/ 336:
  5532. /***/ (function(module, __unusedexports, __webpack_require__) {
  5533. module.exports = hasLastPage
  5534. const deprecate = __webpack_require__(370)
  5535. const getPageLinks = __webpack_require__(577)
  5536. function hasLastPage (link) {
  5537. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5538. return getPageLinks(link).last
  5539. }
  5540. /***/ }),
  5541. /***/ 348:
  5542. /***/ (function(module, __unusedexports, __webpack_require__) {
  5543. "use strict";
  5544. module.exports = validate;
  5545. const { RequestError } = __webpack_require__(463);
  5546. const get = __webpack_require__(854);
  5547. const set = __webpack_require__(883);
  5548. function validate(octokit, options) {
  5549. if (!options.request.validate) {
  5550. return;
  5551. }
  5552. const { validate: params } = options.request;
  5553. Object.keys(params).forEach(parameterName => {
  5554. const parameter = get(params, parameterName);
  5555. const expectedType = parameter.type;
  5556. let parentParameterName;
  5557. let parentValue;
  5558. let parentParamIsPresent = true;
  5559. let parentParameterIsArray = false;
  5560. if (/\./.test(parameterName)) {
  5561. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5562. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5563. if (parentParameterIsArray) {
  5564. parentParameterName = parentParameterName.slice(0, -2);
  5565. }
  5566. parentValue = get(options, parentParameterName);
  5567. parentParamIsPresent =
  5568. parentParameterName === "headers" ||
  5569. (typeof parentValue === "object" && parentValue !== null);
  5570. }
  5571. const values = parentParameterIsArray
  5572. ? (get(options, parentParameterName) || []).map(
  5573. value => value[parameterName.split(/\./).pop()]
  5574. )
  5575. : [get(options, parameterName)];
  5576. values.forEach((value, i) => {
  5577. const valueIsPresent = typeof value !== "undefined";
  5578. const valueIsNull = value === null;
  5579. const currentParameterName = parentParameterIsArray
  5580. ? parameterName.replace(/\[\]/, `[${i}]`)
  5581. : parameterName;
  5582. if (!parameter.required && !valueIsPresent) {
  5583. return;
  5584. }
  5585. // if the parent parameter is of type object but allows null
  5586. // then the child parameters can be ignored
  5587. if (!parentParamIsPresent) {
  5588. return;
  5589. }
  5590. if (parameter.allowNull && valueIsNull) {
  5591. return;
  5592. }
  5593. if (!parameter.allowNull && valueIsNull) {
  5594. throw new RequestError(
  5595. `'${currentParameterName}' cannot be null`,
  5596. 400,
  5597. {
  5598. request: options
  5599. }
  5600. );
  5601. }
  5602. if (parameter.required && !valueIsPresent) {
  5603. throw new RequestError(
  5604. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5605. value
  5606. )}`,
  5607. 400,
  5608. {
  5609. request: options
  5610. }
  5611. );
  5612. }
  5613. // parse to integer before checking for enum
  5614. // so that string "1" will match enum with number 1
  5615. if (expectedType === "integer") {
  5616. const unparsedValue = value;
  5617. value = parseInt(value, 10);
  5618. if (isNaN(value)) {
  5619. throw new RequestError(
  5620. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5621. unparsedValue
  5622. )} is NaN`,
  5623. 400,
  5624. {
  5625. request: options
  5626. }
  5627. );
  5628. }
  5629. }
  5630. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5631. throw new RequestError(
  5632. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5633. value
  5634. )}`,
  5635. 400,
  5636. {
  5637. request: options
  5638. }
  5639. );
  5640. }
  5641. if (parameter.validation) {
  5642. const regex = new RegExp(parameter.validation);
  5643. if (!regex.test(value)) {
  5644. throw new RequestError(
  5645. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5646. value
  5647. )}`,
  5648. 400,
  5649. {
  5650. request: options
  5651. }
  5652. );
  5653. }
  5654. }
  5655. if (expectedType === "object" && typeof value === "string") {
  5656. try {
  5657. value = JSON.parse(value);
  5658. } catch (exception) {
  5659. throw new RequestError(
  5660. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5661. value
  5662. )}`,
  5663. 400,
  5664. {
  5665. request: options
  5666. }
  5667. );
  5668. }
  5669. }
  5670. set(options, parameter.mapTo || currentParameterName, value);
  5671. });
  5672. });
  5673. return options;
  5674. }
  5675. /***/ }),
  5676. /***/ 349:
  5677. /***/ (function(module, __unusedexports, __webpack_require__) {
  5678. module.exports = authenticationRequestError;
  5679. const { RequestError } = __webpack_require__(463);
  5680. function authenticationRequestError(state, error, options) {
  5681. /* istanbul ignore next */
  5682. if (!error.headers) throw error;
  5683. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5684. // handle "2FA required" error only
  5685. if (error.status !== 401 || !otpRequired) {
  5686. throw error;
  5687. }
  5688. if (
  5689. error.status === 401 &&
  5690. otpRequired &&
  5691. error.request &&
  5692. error.request.headers["x-github-otp"]
  5693. ) {
  5694. throw new RequestError(
  5695. "Invalid one-time password for two-factor authentication",
  5696. 401,
  5697. {
  5698. headers: error.headers,
  5699. request: options
  5700. }
  5701. );
  5702. }
  5703. if (typeof state.auth.on2fa !== "function") {
  5704. throw new RequestError(
  5705. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5706. 401,
  5707. {
  5708. headers: error.headers,
  5709. request: options
  5710. }
  5711. );
  5712. }
  5713. return Promise.resolve()
  5714. .then(() => {
  5715. return state.auth.on2fa();
  5716. })
  5717. .then(oneTimePassword => {
  5718. const newOptions = Object.assign(options, {
  5719. headers: Object.assign(
  5720. { "x-github-otp": oneTimePassword },
  5721. options.headers
  5722. )
  5723. });
  5724. return state.octokit.request(newOptions);
  5725. });
  5726. }
  5727. /***/ }),
  5728. /***/ 357:
  5729. /***/ (function(module) {
  5730. module.exports = require("assert");
  5731. /***/ }),
  5732. /***/ 363:
  5733. /***/ (function(module) {
  5734. module.exports = register
  5735. function register (state, name, method, options) {
  5736. if (typeof method !== 'function') {
  5737. throw new Error('method for before hook must be a function')
  5738. }
  5739. if (!options) {
  5740. options = {}
  5741. }
  5742. if (Array.isArray(name)) {
  5743. return name.reverse().reduce(function (callback, name) {
  5744. return register.bind(null, state, name, callback, options)
  5745. }, method)()
  5746. }
  5747. return Promise.resolve()
  5748. .then(function () {
  5749. if (!state.registry[name]) {
  5750. return method(options)
  5751. }
  5752. return (state.registry[name]).reduce(function (method, registered) {
  5753. return registered.hook.bind(null, method, options)
  5754. }, method)()
  5755. })
  5756. }
  5757. /***/ }),
  5758. /***/ 368:
  5759. /***/ (function(module) {
  5760. module.exports = function atob(str) {
  5761. return Buffer.from(str, 'base64').toString('binary')
  5762. }
  5763. /***/ }),
  5764. /***/ 370:
  5765. /***/ (function(module) {
  5766. module.exports = deprecate
  5767. const loggedMessages = {}
  5768. function deprecate (message) {
  5769. if (loggedMessages[message]) {
  5770. return
  5771. }
  5772. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5773. loggedMessages[message] = 1
  5774. }
  5775. /***/ }),
  5776. /***/ 372:
  5777. /***/ (function(module) {
  5778. module.exports = octokitDebug;
  5779. function octokitDebug(octokit) {
  5780. octokit.hook.wrap("request", (request, options) => {
  5781. octokit.log.debug("request", options);
  5782. const start = Date.now();
  5783. const requestOptions = octokit.request.endpoint.parse(options);
  5784. const path = requestOptions.url.replace(options.baseUrl, "");
  5785. return request(options)
  5786. .then(response => {
  5787. octokit.log.info(
  5788. `${requestOptions.method} ${path} - ${
  5789. response.status
  5790. } in ${Date.now() - start}ms`
  5791. );
  5792. return response;
  5793. })
  5794. .catch(error => {
  5795. octokit.log.info(
  5796. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5797. start}ms`
  5798. );
  5799. throw error;
  5800. });
  5801. });
  5802. }
  5803. /***/ }),
  5804. /***/ 385:
  5805. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5806. "use strict";
  5807. Object.defineProperty(exports, '__esModule', { value: true });
  5808. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5809. var isPlainObject = _interopDefault(__webpack_require__(696));
  5810. var universalUserAgent = __webpack_require__(796);
  5811. function lowercaseKeys(object) {
  5812. if (!object) {
  5813. return {};
  5814. }
  5815. return Object.keys(object).reduce((newObj, key) => {
  5816. newObj[key.toLowerCase()] = object[key];
  5817. return newObj;
  5818. }, {});
  5819. }
  5820. function mergeDeep(defaults, options) {
  5821. const result = Object.assign({}, defaults);
  5822. Object.keys(options).forEach(key => {
  5823. if (isPlainObject(options[key])) {
  5824. if (!(key in defaults)) Object.assign(result, {
  5825. [key]: options[key]
  5826. });else result[key] = mergeDeep(defaults[key], options[key]);
  5827. } else {
  5828. Object.assign(result, {
  5829. [key]: options[key]
  5830. });
  5831. }
  5832. });
  5833. return result;
  5834. }
  5835. function merge(defaults, route, options) {
  5836. if (typeof route === "string") {
  5837. let [method, url] = route.split(" ");
  5838. options = Object.assign(url ? {
  5839. method,
  5840. url
  5841. } : {
  5842. url: method
  5843. }, options);
  5844. } else {
  5845. options = Object.assign({}, route);
  5846. } // lowercase header names before merging with defaults to avoid duplicates
  5847. options.headers = lowercaseKeys(options.headers);
  5848. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5849. if (defaults && defaults.mediaType.previews.length) {
  5850. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5851. }
  5852. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5853. return mergedOptions;
  5854. }
  5855. function addQueryParameters(url, parameters) {
  5856. const separator = /\?/.test(url) ? "&" : "?";
  5857. const names = Object.keys(parameters);
  5858. if (names.length === 0) {
  5859. return url;
  5860. }
  5861. return url + separator + names.map(name => {
  5862. if (name === "q") {
  5863. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5864. }
  5865. return `${name}=${encodeURIComponent(parameters[name])}`;
  5866. }).join("&");
  5867. }
  5868. const urlVariableRegex = /\{[^}]+\}/g;
  5869. function removeNonChars(variableName) {
  5870. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5871. }
  5872. function extractUrlVariableNames(url) {
  5873. const matches = url.match(urlVariableRegex);
  5874. if (!matches) {
  5875. return [];
  5876. }
  5877. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5878. }
  5879. function omit(object, keysToOmit) {
  5880. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5881. obj[key] = object[key];
  5882. return obj;
  5883. }, {});
  5884. }
  5885. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5886. // TODO: create separate package.
  5887. //
  5888. // Copyright (c) 2012-2014, Bram Stein
  5889. // All rights reserved.
  5890. // Redistribution and use in source and binary forms, with or without
  5891. // modification, are permitted provided that the following conditions
  5892. // are met:
  5893. // 1. Redistributions of source code must retain the above copyright
  5894. // notice, this list of conditions and the following disclaimer.
  5895. // 2. Redistributions in binary form must reproduce the above copyright
  5896. // notice, this list of conditions and the following disclaimer in the
  5897. // documentation and/or other materials provided with the distribution.
  5898. // 3. The name of the author may not be used to endorse or promote products
  5899. // derived from this software without specific prior written permission.
  5900. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5901. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5902. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5903. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5904. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5905. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5906. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5907. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5908. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5909. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5910. /* istanbul ignore file */
  5911. function encodeReserved(str) {
  5912. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5913. if (!/%[0-9A-Fa-f]/.test(part)) {
  5914. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5915. }
  5916. return part;
  5917. }).join("");
  5918. }
  5919. function encodeUnreserved(str) {
  5920. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5921. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5922. });
  5923. }
  5924. function encodeValue(operator, value, key) {
  5925. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5926. if (key) {
  5927. return encodeUnreserved(key) + "=" + value;
  5928. } else {
  5929. return value;
  5930. }
  5931. }
  5932. function isDefined(value) {
  5933. return value !== undefined && value !== null;
  5934. }
  5935. function isKeyOperator(operator) {
  5936. return operator === ";" || operator === "&" || operator === "?";
  5937. }
  5938. function getValues(context, operator, key, modifier) {
  5939. var value = context[key],
  5940. result = [];
  5941. if (isDefined(value) && value !== "") {
  5942. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5943. value = value.toString();
  5944. if (modifier && modifier !== "*") {
  5945. value = value.substring(0, parseInt(modifier, 10));
  5946. }
  5947. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5948. } else {
  5949. if (modifier === "*") {
  5950. if (Array.isArray(value)) {
  5951. value.filter(isDefined).forEach(function (value) {
  5952. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5953. });
  5954. } else {
  5955. Object.keys(value).forEach(function (k) {
  5956. if (isDefined(value[k])) {
  5957. result.push(encodeValue(operator, value[k], k));
  5958. }
  5959. });
  5960. }
  5961. } else {
  5962. const tmp = [];
  5963. if (Array.isArray(value)) {
  5964. value.filter(isDefined).forEach(function (value) {
  5965. tmp.push(encodeValue(operator, value));
  5966. });
  5967. } else {
  5968. Object.keys(value).forEach(function (k) {
  5969. if (isDefined(value[k])) {
  5970. tmp.push(encodeUnreserved(k));
  5971. tmp.push(encodeValue(operator, value[k].toString()));
  5972. }
  5973. });
  5974. }
  5975. if (isKeyOperator(operator)) {
  5976. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5977. } else if (tmp.length !== 0) {
  5978. result.push(tmp.join(","));
  5979. }
  5980. }
  5981. }
  5982. } else {
  5983. if (operator === ";") {
  5984. if (isDefined(value)) {
  5985. result.push(encodeUnreserved(key));
  5986. }
  5987. } else if (value === "" && (operator === "&" || operator === "?")) {
  5988. result.push(encodeUnreserved(key) + "=");
  5989. } else if (value === "") {
  5990. result.push("");
  5991. }
  5992. }
  5993. return result;
  5994. }
  5995. function parseUrl(template) {
  5996. return {
  5997. expand: expand.bind(null, template)
  5998. };
  5999. }
  6000. function expand(template, context) {
  6001. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  6002. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  6003. if (expression) {
  6004. let operator = "";
  6005. const values = [];
  6006. if (operators.indexOf(expression.charAt(0)) !== -1) {
  6007. operator = expression.charAt(0);
  6008. expression = expression.substr(1);
  6009. }
  6010. expression.split(/,/g).forEach(function (variable) {
  6011. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  6012. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  6013. });
  6014. if (operator && operator !== "+") {
  6015. var separator = ",";
  6016. if (operator === "?") {
  6017. separator = "&";
  6018. } else if (operator !== "#") {
  6019. separator = operator;
  6020. }
  6021. return (values.length !== 0 ? operator : "") + values.join(separator);
  6022. } else {
  6023. return values.join(",");
  6024. }
  6025. } else {
  6026. return encodeReserved(literal);
  6027. }
  6028. });
  6029. }
  6030. function parse(options) {
  6031. // https://fetch.spec.whatwg.org/#methods
  6032. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6033. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6034. let headers = Object.assign({}, options.headers);
  6035. let body;
  6036. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6037. const urlVariableNames = extractUrlVariableNames(url);
  6038. url = parseUrl(url).expand(parameters);
  6039. if (!/^http/.test(url)) {
  6040. url = options.baseUrl + url;
  6041. }
  6042. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6043. const remainingParameters = omit(parameters, omittedParameters);
  6044. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6045. if (!isBinaryRequset) {
  6046. if (options.mediaType.format) {
  6047. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6048. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6049. }
  6050. if (options.mediaType.previews.length) {
  6051. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6052. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6053. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6054. return `application/vnd.github.${preview}-preview${format}`;
  6055. }).join(",");
  6056. }
  6057. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6058. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6059. if (["GET", "HEAD"].includes(method)) {
  6060. url = addQueryParameters(url, remainingParameters);
  6061. } else {
  6062. if ("data" in remainingParameters) {
  6063. body = remainingParameters.data;
  6064. } else {
  6065. if (Object.keys(remainingParameters).length) {
  6066. body = remainingParameters;
  6067. } else {
  6068. headers["content-length"] = 0;
  6069. }
  6070. }
  6071. } // default content-type for JSON if body is set
  6072. if (!headers["content-type"] && typeof body !== "undefined") {
  6073. headers["content-type"] = "application/json; charset=utf-8";
  6074. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6075. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6076. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6077. body = "";
  6078. } // Only return body/request keys if present
  6079. return Object.assign({
  6080. method,
  6081. url,
  6082. headers
  6083. }, typeof body !== "undefined" ? {
  6084. body
  6085. } : null, options.request ? {
  6086. request: options.request
  6087. } : null);
  6088. }
  6089. function endpointWithDefaults(defaults, route, options) {
  6090. return parse(merge(defaults, route, options));
  6091. }
  6092. function withDefaults(oldDefaults, newDefaults) {
  6093. const DEFAULTS = merge(oldDefaults, newDefaults);
  6094. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6095. return Object.assign(endpoint, {
  6096. DEFAULTS,
  6097. defaults: withDefaults.bind(null, DEFAULTS),
  6098. merge: merge.bind(null, DEFAULTS),
  6099. parse
  6100. });
  6101. }
  6102. const VERSION = "5.5.1";
  6103. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6104. // So we use RequestParameters and add method as additional required property.
  6105. const DEFAULTS = {
  6106. method: "GET",
  6107. baseUrl: "https://api.github.com",
  6108. headers: {
  6109. accept: "application/vnd.github.v3+json",
  6110. "user-agent": userAgent
  6111. },
  6112. mediaType: {
  6113. format: "",
  6114. previews: []
  6115. }
  6116. };
  6117. const endpoint = withDefaults(null, DEFAULTS);
  6118. exports.endpoint = endpoint;
  6119. //# sourceMappingURL=index.js.map
  6120. /***/ }),
  6121. /***/ 389:
  6122. /***/ (function(module, __unusedexports, __webpack_require__) {
  6123. "use strict";
  6124. const fs = __webpack_require__(747);
  6125. const shebangCommand = __webpack_require__(866);
  6126. function readShebang(command) {
  6127. // Read the first 150 bytes from the file
  6128. const size = 150;
  6129. let buffer;
  6130. if (Buffer.alloc) {
  6131. // Node.js v4.5+ / v5.10+
  6132. buffer = Buffer.alloc(size);
  6133. } else {
  6134. // Old Node.js API
  6135. buffer = new Buffer(size);
  6136. buffer.fill(0); // zero-fill
  6137. }
  6138. let fd;
  6139. try {
  6140. fd = fs.openSync(command, 'r');
  6141. fs.readSync(fd, buffer, 0, size, 0);
  6142. fs.closeSync(fd);
  6143. } catch (e) { /* Empty */ }
  6144. // Attempt to extract shebang (null is returned if not a shebang)
  6145. return shebangCommand(buffer.toString());
  6146. }
  6147. module.exports = readShebang;
  6148. /***/ }),
  6149. /***/ 402:
  6150. /***/ (function(module, __unusedexports, __webpack_require__) {
  6151. module.exports = Octokit;
  6152. const { request } = __webpack_require__(753);
  6153. const Hook = __webpack_require__(523);
  6154. const parseClientOptions = __webpack_require__(294);
  6155. function Octokit(plugins, options) {
  6156. options = options || {};
  6157. const hook = new Hook.Collection();
  6158. const log = Object.assign(
  6159. {
  6160. debug: () => {},
  6161. info: () => {},
  6162. warn: console.warn,
  6163. error: console.error
  6164. },
  6165. options && options.log
  6166. );
  6167. const api = {
  6168. hook,
  6169. log,
  6170. request: request.defaults(parseClientOptions(options, log, hook))
  6171. };
  6172. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6173. return api;
  6174. }
  6175. /***/ }),
  6176. /***/ 413:
  6177. /***/ (function(module) {
  6178. module.exports = require("stream");
  6179. /***/ }),
  6180. /***/ 417:
  6181. /***/ (function(module) {
  6182. module.exports = require("crypto");
  6183. /***/ }),
  6184. /***/ 427:
  6185. /***/ (function(module, __unusedexports, __webpack_require__) {
  6186. "use strict";
  6187. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6188. // In that case, fall back to a deprecated internal.
  6189. const util = __webpack_require__(669);
  6190. let uv;
  6191. if (typeof util.getSystemErrorName === 'function') {
  6192. module.exports = util.getSystemErrorName;
  6193. } else {
  6194. try {
  6195. uv = process.binding('uv');
  6196. if (typeof uv.errname !== 'function') {
  6197. throw new TypeError('uv.errname is not a function');
  6198. }
  6199. } catch (err) {
  6200. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6201. uv = null;
  6202. }
  6203. module.exports = code => errname(uv, code);
  6204. }
  6205. // Used for testing the fallback behavior
  6206. module.exports.__test__ = errname;
  6207. function errname(uv, code) {
  6208. if (uv) {
  6209. return uv.errname(code);
  6210. }
  6211. if (!(code < 0)) {
  6212. throw new Error('err >= 0');
  6213. }
  6214. return `Unknown system error ${code}`;
  6215. }
  6216. /***/ }),
  6217. /***/ 430:
  6218. /***/ (function(module, __unusedexports, __webpack_require__) {
  6219. module.exports = octokitValidate;
  6220. const validate = __webpack_require__(348);
  6221. function octokitValidate(octokit) {
  6222. octokit.hook.before("request", validate.bind(null, octokit));
  6223. }
  6224. /***/ }),
  6225. /***/ 431:
  6226. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6227. "use strict";
  6228. Object.defineProperty(exports, "__esModule", { value: true });
  6229. const os = __webpack_require__(87);
  6230. /**
  6231. * Commands
  6232. *
  6233. * Command Format:
  6234. * ##[name key=value;key=value]message
  6235. *
  6236. * Examples:
  6237. * ##[warning]This is the user warning message
  6238. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6239. */
  6240. function issueCommand(command, properties, message) {
  6241. const cmd = new Command(command, properties, message);
  6242. process.stdout.write(cmd.toString() + os.EOL);
  6243. }
  6244. exports.issueCommand = issueCommand;
  6245. function issue(name, message = '') {
  6246. issueCommand(name, {}, message);
  6247. }
  6248. exports.issue = issue;
  6249. const CMD_STRING = '::';
  6250. class Command {
  6251. constructor(command, properties, message) {
  6252. if (!command) {
  6253. command = 'missing.command';
  6254. }
  6255. this.command = command;
  6256. this.properties = properties;
  6257. this.message = message;
  6258. }
  6259. toString() {
  6260. let cmdStr = CMD_STRING + this.command;
  6261. if (this.properties && Object.keys(this.properties).length > 0) {
  6262. cmdStr += ' ';
  6263. for (const key in this.properties) {
  6264. if (this.properties.hasOwnProperty(key)) {
  6265. const val = this.properties[key];
  6266. if (val) {
  6267. // safely append the val - avoid blowing up when attempting to
  6268. // call .replace() if message is not a string for some reason
  6269. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6270. }
  6271. }
  6272. }
  6273. }
  6274. cmdStr += CMD_STRING;
  6275. // safely append the message - avoid blowing up when attempting to
  6276. // call .replace() if message is not a string for some reason
  6277. const message = `${this.message || ''}`;
  6278. cmdStr += escapeData(message);
  6279. return cmdStr;
  6280. }
  6281. }
  6282. function escapeData(s) {
  6283. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6284. }
  6285. function escape(s) {
  6286. return s
  6287. .replace(/\r/g, '%0D')
  6288. .replace(/\n/g, '%0A')
  6289. .replace(/]/g, '%5D')
  6290. .replace(/;/g, '%3B');
  6291. }
  6292. //# sourceMappingURL=command.js.map
  6293. /***/ }),
  6294. /***/ 438:
  6295. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6296. "use strict";
  6297. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6298. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6299. return new (P || (P = Promise))(function (resolve, reject) {
  6300. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6301. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6302. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6303. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6304. });
  6305. };
  6306. var __importStar = (this && this.__importStar) || function (mod) {
  6307. if (mod && mod.__esModule) return mod;
  6308. var result = {};
  6309. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6310. result["default"] = mod;
  6311. return result;
  6312. };
  6313. Object.defineProperty(exports, "__esModule", { value: true });
  6314. const core = __importStar(__webpack_require__(470));
  6315. const fs = __importStar(__webpack_require__(747));
  6316. const fsHelper = __importStar(__webpack_require__(618));
  6317. const io = __importStar(__webpack_require__(1));
  6318. const path = __importStar(__webpack_require__(622));
  6319. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  6320. return __awaiter(this, void 0, void 0, function* () {
  6321. let remove = false;
  6322. // Check whether using git or REST API
  6323. if (!git) {
  6324. remove = true;
  6325. }
  6326. // Fetch URL does not match
  6327. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6328. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6329. remove = true;
  6330. }
  6331. else {
  6332. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6333. const lockPaths = [
  6334. path.join(repositoryPath, '.git', 'index.lock'),
  6335. path.join(repositoryPath, '.git', 'shallow.lock')
  6336. ];
  6337. for (const lockPath of lockPaths) {
  6338. try {
  6339. yield io.rmRF(lockPath);
  6340. }
  6341. catch (error) {
  6342. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6343. }
  6344. }
  6345. try {
  6346. // Checkout detached HEAD
  6347. if (!(yield git.isDetached())) {
  6348. yield git.checkoutDetach();
  6349. }
  6350. // Remove all refs/heads/*
  6351. let branches = yield git.branchList(false);
  6352. for (const branch of branches) {
  6353. yield git.branchDelete(false, branch);
  6354. }
  6355. // Remove all refs/remotes/origin/* to avoid conflicts
  6356. branches = yield git.branchList(true);
  6357. for (const branch of branches) {
  6358. yield git.branchDelete(true, branch);
  6359. }
  6360. // Clean
  6361. if (clean) {
  6362. if (!(yield git.tryClean())) {
  6363. 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}'.`);
  6364. remove = true;
  6365. }
  6366. else if (!(yield git.tryReset())) {
  6367. remove = true;
  6368. }
  6369. if (remove) {
  6370. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6371. }
  6372. }
  6373. }
  6374. catch (error) {
  6375. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6376. remove = true;
  6377. }
  6378. }
  6379. if (remove) {
  6380. // Delete the contents of the directory. Don't delete the directory itself
  6381. // since it might be the current working directory.
  6382. core.info(`Deleting the contents of '${repositoryPath}'`);
  6383. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6384. yield io.rmRF(path.join(repositoryPath, file));
  6385. }
  6386. }
  6387. });
  6388. }
  6389. exports.prepareExistingDirectory = prepareExistingDirectory;
  6390. /***/ }),
  6391. /***/ 453:
  6392. /***/ (function(module, __unusedexports, __webpack_require__) {
  6393. var once = __webpack_require__(969)
  6394. var eos = __webpack_require__(562)
  6395. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6396. var noop = function () {}
  6397. var ancient = /^v?\.0/.test(process.version)
  6398. var isFn = function (fn) {
  6399. return typeof fn === 'function'
  6400. }
  6401. var isFS = function (stream) {
  6402. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6403. if (!fs) return false // browser
  6404. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6405. }
  6406. var isRequest = function (stream) {
  6407. return stream.setHeader && isFn(stream.abort)
  6408. }
  6409. var destroyer = function (stream, reading, writing, callback) {
  6410. callback = once(callback)
  6411. var closed = false
  6412. stream.on('close', function () {
  6413. closed = true
  6414. })
  6415. eos(stream, {readable: reading, writable: writing}, function (err) {
  6416. if (err) return callback(err)
  6417. closed = true
  6418. callback()
  6419. })
  6420. var destroyed = false
  6421. return function (err) {
  6422. if (closed) return
  6423. if (destroyed) return
  6424. destroyed = true
  6425. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6426. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6427. if (isFn(stream.destroy)) return stream.destroy()
  6428. callback(err || new Error('stream was destroyed'))
  6429. }
  6430. }
  6431. var call = function (fn) {
  6432. fn()
  6433. }
  6434. var pipe = function (from, to) {
  6435. return from.pipe(to)
  6436. }
  6437. var pump = function () {
  6438. var streams = Array.prototype.slice.call(arguments)
  6439. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6440. if (Array.isArray(streams[0])) streams = streams[0]
  6441. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6442. var error
  6443. var destroys = streams.map(function (stream, i) {
  6444. var reading = i < streams.length - 1
  6445. var writing = i > 0
  6446. return destroyer(stream, reading, writing, function (err) {
  6447. if (!error) error = err
  6448. if (err) destroys.forEach(call)
  6449. if (reading) return
  6450. destroys.forEach(call)
  6451. callback(error)
  6452. })
  6453. })
  6454. return streams.reduce(pipe)
  6455. }
  6456. module.exports = pump
  6457. /***/ }),
  6458. /***/ 454:
  6459. /***/ (function(module, exports, __webpack_require__) {
  6460. "use strict";
  6461. Object.defineProperty(exports, '__esModule', { value: true });
  6462. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6463. var Stream = _interopDefault(__webpack_require__(413));
  6464. var http = _interopDefault(__webpack_require__(605));
  6465. var Url = _interopDefault(__webpack_require__(835));
  6466. var https = _interopDefault(__webpack_require__(211));
  6467. var zlib = _interopDefault(__webpack_require__(761));
  6468. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6469. // fix for "Readable" isn't a named export issue
  6470. const Readable = Stream.Readable;
  6471. const BUFFER = Symbol('buffer');
  6472. const TYPE = Symbol('type');
  6473. class Blob {
  6474. constructor() {
  6475. this[TYPE] = '';
  6476. const blobParts = arguments[0];
  6477. const options = arguments[1];
  6478. const buffers = [];
  6479. let size = 0;
  6480. if (blobParts) {
  6481. const a = blobParts;
  6482. const length = Number(a.length);
  6483. for (let i = 0; i < length; i++) {
  6484. const element = a[i];
  6485. let buffer;
  6486. if (element instanceof Buffer) {
  6487. buffer = element;
  6488. } else if (ArrayBuffer.isView(element)) {
  6489. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6490. } else if (element instanceof ArrayBuffer) {
  6491. buffer = Buffer.from(element);
  6492. } else if (element instanceof Blob) {
  6493. buffer = element[BUFFER];
  6494. } else {
  6495. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6496. }
  6497. size += buffer.length;
  6498. buffers.push(buffer);
  6499. }
  6500. }
  6501. this[BUFFER] = Buffer.concat(buffers);
  6502. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6503. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6504. this[TYPE] = type;
  6505. }
  6506. }
  6507. get size() {
  6508. return this[BUFFER].length;
  6509. }
  6510. get type() {
  6511. return this[TYPE];
  6512. }
  6513. text() {
  6514. return Promise.resolve(this[BUFFER].toString());
  6515. }
  6516. arrayBuffer() {
  6517. const buf = this[BUFFER];
  6518. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6519. return Promise.resolve(ab);
  6520. }
  6521. stream() {
  6522. const readable = new Readable();
  6523. readable._read = function () {};
  6524. readable.push(this[BUFFER]);
  6525. readable.push(null);
  6526. return readable;
  6527. }
  6528. toString() {
  6529. return '[object Blob]';
  6530. }
  6531. slice() {
  6532. const size = this.size;
  6533. const start = arguments[0];
  6534. const end = arguments[1];
  6535. let relativeStart, relativeEnd;
  6536. if (start === undefined) {
  6537. relativeStart = 0;
  6538. } else if (start < 0) {
  6539. relativeStart = Math.max(size + start, 0);
  6540. } else {
  6541. relativeStart = Math.min(start, size);
  6542. }
  6543. if (end === undefined) {
  6544. relativeEnd = size;
  6545. } else if (end < 0) {
  6546. relativeEnd = Math.max(size + end, 0);
  6547. } else {
  6548. relativeEnd = Math.min(end, size);
  6549. }
  6550. const span = Math.max(relativeEnd - relativeStart, 0);
  6551. const buffer = this[BUFFER];
  6552. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6553. const blob = new Blob([], { type: arguments[2] });
  6554. blob[BUFFER] = slicedBuffer;
  6555. return blob;
  6556. }
  6557. }
  6558. Object.defineProperties(Blob.prototype, {
  6559. size: { enumerable: true },
  6560. type: { enumerable: true },
  6561. slice: { enumerable: true }
  6562. });
  6563. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6564. value: 'Blob',
  6565. writable: false,
  6566. enumerable: false,
  6567. configurable: true
  6568. });
  6569. /**
  6570. * fetch-error.js
  6571. *
  6572. * FetchError interface for operational errors
  6573. */
  6574. /**
  6575. * Create FetchError instance
  6576. *
  6577. * @param String message Error message for human
  6578. * @param String type Error type for machine
  6579. * @param String systemError For Node.js system error
  6580. * @return FetchError
  6581. */
  6582. function FetchError(message, type, systemError) {
  6583. Error.call(this, message);
  6584. this.message = message;
  6585. this.type = type;
  6586. // when err.type is `system`, err.code contains system error code
  6587. if (systemError) {
  6588. this.code = this.errno = systemError.code;
  6589. }
  6590. // hide custom error implementation details from end-users
  6591. Error.captureStackTrace(this, this.constructor);
  6592. }
  6593. FetchError.prototype = Object.create(Error.prototype);
  6594. FetchError.prototype.constructor = FetchError;
  6595. FetchError.prototype.name = 'FetchError';
  6596. let convert;
  6597. try {
  6598. convert = __webpack_require__(18).convert;
  6599. } catch (e) {}
  6600. const INTERNALS = Symbol('Body internals');
  6601. // fix an issue where "PassThrough" isn't a named export for node <10
  6602. const PassThrough = Stream.PassThrough;
  6603. /**
  6604. * Body mixin
  6605. *
  6606. * Ref: https://fetch.spec.whatwg.org/#body
  6607. *
  6608. * @param Stream body Readable stream
  6609. * @param Object opts Response options
  6610. * @return Void
  6611. */
  6612. function Body(body) {
  6613. var _this = this;
  6614. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6615. _ref$size = _ref.size;
  6616. let size = _ref$size === undefined ? 0 : _ref$size;
  6617. var _ref$timeout = _ref.timeout;
  6618. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6619. if (body == null) {
  6620. // body is undefined or null
  6621. body = null;
  6622. } else if (isURLSearchParams(body)) {
  6623. // body is a URLSearchParams
  6624. body = Buffer.from(body.toString());
  6625. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6626. // body is ArrayBuffer
  6627. body = Buffer.from(body);
  6628. } else if (ArrayBuffer.isView(body)) {
  6629. // body is ArrayBufferView
  6630. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6631. } else if (body instanceof Stream) ; else {
  6632. // none of the above
  6633. // coerce to string then buffer
  6634. body = Buffer.from(String(body));
  6635. }
  6636. this[INTERNALS] = {
  6637. body,
  6638. disturbed: false,
  6639. error: null
  6640. };
  6641. this.size = size;
  6642. this.timeout = timeout;
  6643. if (body instanceof Stream) {
  6644. body.on('error', function (err) {
  6645. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6646. _this[INTERNALS].error = error;
  6647. });
  6648. }
  6649. }
  6650. Body.prototype = {
  6651. get body() {
  6652. return this[INTERNALS].body;
  6653. },
  6654. get bodyUsed() {
  6655. return this[INTERNALS].disturbed;
  6656. },
  6657. /**
  6658. * Decode response as ArrayBuffer
  6659. *
  6660. * @return Promise
  6661. */
  6662. arrayBuffer() {
  6663. return consumeBody.call(this).then(function (buf) {
  6664. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6665. });
  6666. },
  6667. /**
  6668. * Return raw response as Blob
  6669. *
  6670. * @return Promise
  6671. */
  6672. blob() {
  6673. let ct = this.headers && this.headers.get('content-type') || '';
  6674. return consumeBody.call(this).then(function (buf) {
  6675. return Object.assign(
  6676. // Prevent copying
  6677. new Blob([], {
  6678. type: ct.toLowerCase()
  6679. }), {
  6680. [BUFFER]: buf
  6681. });
  6682. });
  6683. },
  6684. /**
  6685. * Decode response as json
  6686. *
  6687. * @return Promise
  6688. */
  6689. json() {
  6690. var _this2 = this;
  6691. return consumeBody.call(this).then(function (buffer) {
  6692. try {
  6693. return JSON.parse(buffer.toString());
  6694. } catch (err) {
  6695. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6696. }
  6697. });
  6698. },
  6699. /**
  6700. * Decode response as text
  6701. *
  6702. * @return Promise
  6703. */
  6704. text() {
  6705. return consumeBody.call(this).then(function (buffer) {
  6706. return buffer.toString();
  6707. });
  6708. },
  6709. /**
  6710. * Decode response as buffer (non-spec api)
  6711. *
  6712. * @return Promise
  6713. */
  6714. buffer() {
  6715. return consumeBody.call(this);
  6716. },
  6717. /**
  6718. * Decode response as text, while automatically detecting the encoding and
  6719. * trying to decode to UTF-8 (non-spec api)
  6720. *
  6721. * @return Promise
  6722. */
  6723. textConverted() {
  6724. var _this3 = this;
  6725. return consumeBody.call(this).then(function (buffer) {
  6726. return convertBody(buffer, _this3.headers);
  6727. });
  6728. }
  6729. };
  6730. // In browsers, all properties are enumerable.
  6731. Object.defineProperties(Body.prototype, {
  6732. body: { enumerable: true },
  6733. bodyUsed: { enumerable: true },
  6734. arrayBuffer: { enumerable: true },
  6735. blob: { enumerable: true },
  6736. json: { enumerable: true },
  6737. text: { enumerable: true }
  6738. });
  6739. Body.mixIn = function (proto) {
  6740. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6741. // istanbul ignore else: future proof
  6742. if (!(name in proto)) {
  6743. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6744. Object.defineProperty(proto, name, desc);
  6745. }
  6746. }
  6747. };
  6748. /**
  6749. * Consume and convert an entire Body to a Buffer.
  6750. *
  6751. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6752. *
  6753. * @return Promise
  6754. */
  6755. function consumeBody() {
  6756. var _this4 = this;
  6757. if (this[INTERNALS].disturbed) {
  6758. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6759. }
  6760. this[INTERNALS].disturbed = true;
  6761. if (this[INTERNALS].error) {
  6762. return Body.Promise.reject(this[INTERNALS].error);
  6763. }
  6764. let body = this.body;
  6765. // body is null
  6766. if (body === null) {
  6767. return Body.Promise.resolve(Buffer.alloc(0));
  6768. }
  6769. // body is blob
  6770. if (isBlob(body)) {
  6771. body = body.stream();
  6772. }
  6773. // body is buffer
  6774. if (Buffer.isBuffer(body)) {
  6775. return Body.Promise.resolve(body);
  6776. }
  6777. // istanbul ignore if: should never happen
  6778. if (!(body instanceof Stream)) {
  6779. return Body.Promise.resolve(Buffer.alloc(0));
  6780. }
  6781. // body is stream
  6782. // get ready to actually consume the body
  6783. let accum = [];
  6784. let accumBytes = 0;
  6785. let abort = false;
  6786. return new Body.Promise(function (resolve, reject) {
  6787. let resTimeout;
  6788. // allow timeout on slow response body
  6789. if (_this4.timeout) {
  6790. resTimeout = setTimeout(function () {
  6791. abort = true;
  6792. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6793. }, _this4.timeout);
  6794. }
  6795. // handle stream errors
  6796. body.on('error', function (err) {
  6797. if (err.name === 'AbortError') {
  6798. // if the request was aborted, reject with this Error
  6799. abort = true;
  6800. reject(err);
  6801. } else {
  6802. // other errors, such as incorrect content-encoding
  6803. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6804. }
  6805. });
  6806. body.on('data', function (chunk) {
  6807. if (abort || chunk === null) {
  6808. return;
  6809. }
  6810. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6811. abort = true;
  6812. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6813. return;
  6814. }
  6815. accumBytes += chunk.length;
  6816. accum.push(chunk);
  6817. });
  6818. body.on('end', function () {
  6819. if (abort) {
  6820. return;
  6821. }
  6822. clearTimeout(resTimeout);
  6823. try {
  6824. resolve(Buffer.concat(accum, accumBytes));
  6825. } catch (err) {
  6826. // handle streams that have accumulated too much data (issue #414)
  6827. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6828. }
  6829. });
  6830. });
  6831. }
  6832. /**
  6833. * Detect buffer encoding and convert to target encoding
  6834. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6835. *
  6836. * @param Buffer buffer Incoming buffer
  6837. * @param String encoding Target encoding
  6838. * @return String
  6839. */
  6840. function convertBody(buffer, headers) {
  6841. if (typeof convert !== 'function') {
  6842. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6843. }
  6844. const ct = headers.get('content-type');
  6845. let charset = 'utf-8';
  6846. let res, str;
  6847. // header
  6848. if (ct) {
  6849. res = /charset=([^;]*)/i.exec(ct);
  6850. }
  6851. // no charset in content type, peek at response body for at most 1024 bytes
  6852. str = buffer.slice(0, 1024).toString();
  6853. // html5
  6854. if (!res && str) {
  6855. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6856. }
  6857. // html4
  6858. if (!res && str) {
  6859. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6860. if (res) {
  6861. res = /charset=(.*)/i.exec(res.pop());
  6862. }
  6863. }
  6864. // xml
  6865. if (!res && str) {
  6866. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6867. }
  6868. // found charset
  6869. if (res) {
  6870. charset = res.pop();
  6871. // prevent decode issues when sites use incorrect encoding
  6872. // ref: https://hsivonen.fi/encoding-menu/
  6873. if (charset === 'gb2312' || charset === 'gbk') {
  6874. charset = 'gb18030';
  6875. }
  6876. }
  6877. // turn raw buffers into a single utf-8 buffer
  6878. return convert(buffer, 'UTF-8', charset).toString();
  6879. }
  6880. /**
  6881. * Detect a URLSearchParams object
  6882. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6883. *
  6884. * @param Object obj Object to detect by type or brand
  6885. * @return String
  6886. */
  6887. function isURLSearchParams(obj) {
  6888. // Duck-typing as a necessary condition.
  6889. 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') {
  6890. return false;
  6891. }
  6892. // Brand-checking and more duck-typing as optional condition.
  6893. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6894. }
  6895. /**
  6896. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6897. * @param {*} obj
  6898. * @return {boolean}
  6899. */
  6900. function isBlob(obj) {
  6901. 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]);
  6902. }
  6903. /**
  6904. * Clone body given Res/Req instance
  6905. *
  6906. * @param Mixed instance Response or Request instance
  6907. * @return Mixed
  6908. */
  6909. function clone(instance) {
  6910. let p1, p2;
  6911. let body = instance.body;
  6912. // don't allow cloning a used body
  6913. if (instance.bodyUsed) {
  6914. throw new Error('cannot clone body after it is used');
  6915. }
  6916. // check that body is a stream and not form-data object
  6917. // note: we can't clone the form-data object without having it as a dependency
  6918. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6919. // tee instance body
  6920. p1 = new PassThrough();
  6921. p2 = new PassThrough();
  6922. body.pipe(p1);
  6923. body.pipe(p2);
  6924. // set instance body to teed body and return the other teed body
  6925. instance[INTERNALS].body = p1;
  6926. body = p2;
  6927. }
  6928. return body;
  6929. }
  6930. /**
  6931. * Performs the operation "extract a `Content-Type` value from |object|" as
  6932. * specified in the specification:
  6933. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6934. *
  6935. * This function assumes that instance.body is present.
  6936. *
  6937. * @param Mixed instance Any options.body input
  6938. */
  6939. function extractContentType(body) {
  6940. if (body === null) {
  6941. // body is null
  6942. return null;
  6943. } else if (typeof body === 'string') {
  6944. // body is string
  6945. return 'text/plain;charset=UTF-8';
  6946. } else if (isURLSearchParams(body)) {
  6947. // body is a URLSearchParams
  6948. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6949. } else if (isBlob(body)) {
  6950. // body is blob
  6951. return body.type || null;
  6952. } else if (Buffer.isBuffer(body)) {
  6953. // body is buffer
  6954. return null;
  6955. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6956. // body is ArrayBuffer
  6957. return null;
  6958. } else if (ArrayBuffer.isView(body)) {
  6959. // body is ArrayBufferView
  6960. return null;
  6961. } else if (typeof body.getBoundary === 'function') {
  6962. // detect form data input from form-data module
  6963. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6964. } else if (body instanceof Stream) {
  6965. // body is stream
  6966. // can't really do much about this
  6967. return null;
  6968. } else {
  6969. // Body constructor defaults other things to string
  6970. return 'text/plain;charset=UTF-8';
  6971. }
  6972. }
  6973. /**
  6974. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6975. * For us, we have to explicitly get it with a function.
  6976. *
  6977. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6978. *
  6979. * @param Body instance Instance of Body
  6980. * @return Number? Number of bytes, or null if not possible
  6981. */
  6982. function getTotalBytes(instance) {
  6983. const body = instance.body;
  6984. if (body === null) {
  6985. // body is null
  6986. return 0;
  6987. } else if (isBlob(body)) {
  6988. return body.size;
  6989. } else if (Buffer.isBuffer(body)) {
  6990. // body is buffer
  6991. return body.length;
  6992. } else if (body && typeof body.getLengthSync === 'function') {
  6993. // detect form data input from form-data module
  6994. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6995. body.hasKnownLength && body.hasKnownLength()) {
  6996. // 2.x
  6997. return body.getLengthSync();
  6998. }
  6999. return null;
  7000. } else {
  7001. // body is stream
  7002. return null;
  7003. }
  7004. }
  7005. /**
  7006. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  7007. *
  7008. * @param Body instance Instance of Body
  7009. * @return Void
  7010. */
  7011. function writeToStream(dest, instance) {
  7012. const body = instance.body;
  7013. if (body === null) {
  7014. // body is null
  7015. dest.end();
  7016. } else if (isBlob(body)) {
  7017. body.stream().pipe(dest);
  7018. } else if (Buffer.isBuffer(body)) {
  7019. // body is buffer
  7020. dest.write(body);
  7021. dest.end();
  7022. } else {
  7023. // body is stream
  7024. body.pipe(dest);
  7025. }
  7026. }
  7027. // expose Promise
  7028. Body.Promise = global.Promise;
  7029. /**
  7030. * headers.js
  7031. *
  7032. * Headers class offers convenient helpers
  7033. */
  7034. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7035. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7036. function validateName(name) {
  7037. name = `${name}`;
  7038. if (invalidTokenRegex.test(name) || name === '') {
  7039. throw new TypeError(`${name} is not a legal HTTP header name`);
  7040. }
  7041. }
  7042. function validateValue(value) {
  7043. value = `${value}`;
  7044. if (invalidHeaderCharRegex.test(value)) {
  7045. throw new TypeError(`${value} is not a legal HTTP header value`);
  7046. }
  7047. }
  7048. /**
  7049. * Find the key in the map object given a header name.
  7050. *
  7051. * Returns undefined if not found.
  7052. *
  7053. * @param String name Header name
  7054. * @return String|Undefined
  7055. */
  7056. function find(map, name) {
  7057. name = name.toLowerCase();
  7058. for (const key in map) {
  7059. if (key.toLowerCase() === name) {
  7060. return key;
  7061. }
  7062. }
  7063. return undefined;
  7064. }
  7065. const MAP = Symbol('map');
  7066. class Headers {
  7067. /**
  7068. * Headers class
  7069. *
  7070. * @param Object headers Response headers
  7071. * @return Void
  7072. */
  7073. constructor() {
  7074. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7075. this[MAP] = Object.create(null);
  7076. if (init instanceof Headers) {
  7077. const rawHeaders = init.raw();
  7078. const headerNames = Object.keys(rawHeaders);
  7079. for (const headerName of headerNames) {
  7080. for (const value of rawHeaders[headerName]) {
  7081. this.append(headerName, value);
  7082. }
  7083. }
  7084. return;
  7085. }
  7086. // We don't worry about converting prop to ByteString here as append()
  7087. // will handle it.
  7088. if (init == null) ; else if (typeof init === 'object') {
  7089. const method = init[Symbol.iterator];
  7090. if (method != null) {
  7091. if (typeof method !== 'function') {
  7092. throw new TypeError('Header pairs must be iterable');
  7093. }
  7094. // sequence<sequence<ByteString>>
  7095. // Note: per spec we have to first exhaust the lists then process them
  7096. const pairs = [];
  7097. for (const pair of init) {
  7098. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7099. throw new TypeError('Each header pair must be iterable');
  7100. }
  7101. pairs.push(Array.from(pair));
  7102. }
  7103. for (const pair of pairs) {
  7104. if (pair.length !== 2) {
  7105. throw new TypeError('Each header pair must be a name/value tuple');
  7106. }
  7107. this.append(pair[0], pair[1]);
  7108. }
  7109. } else {
  7110. // record<ByteString, ByteString>
  7111. for (const key of Object.keys(init)) {
  7112. const value = init[key];
  7113. this.append(key, value);
  7114. }
  7115. }
  7116. } else {
  7117. throw new TypeError('Provided initializer must be an object');
  7118. }
  7119. }
  7120. /**
  7121. * Return combined header value given name
  7122. *
  7123. * @param String name Header name
  7124. * @return Mixed
  7125. */
  7126. get(name) {
  7127. name = `${name}`;
  7128. validateName(name);
  7129. const key = find(this[MAP], name);
  7130. if (key === undefined) {
  7131. return null;
  7132. }
  7133. return this[MAP][key].join(', ');
  7134. }
  7135. /**
  7136. * Iterate over all headers
  7137. *
  7138. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7139. * @param Boolean thisArg `this` context for callback function
  7140. * @return Void
  7141. */
  7142. forEach(callback) {
  7143. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7144. let pairs = getHeaders(this);
  7145. let i = 0;
  7146. while (i < pairs.length) {
  7147. var _pairs$i = pairs[i];
  7148. const name = _pairs$i[0],
  7149. value = _pairs$i[1];
  7150. callback.call(thisArg, value, name, this);
  7151. pairs = getHeaders(this);
  7152. i++;
  7153. }
  7154. }
  7155. /**
  7156. * Overwrite header values given name
  7157. *
  7158. * @param String name Header name
  7159. * @param String value Header value
  7160. * @return Void
  7161. */
  7162. set(name, value) {
  7163. name = `${name}`;
  7164. value = `${value}`;
  7165. validateName(name);
  7166. validateValue(value);
  7167. const key = find(this[MAP], name);
  7168. this[MAP][key !== undefined ? key : name] = [value];
  7169. }
  7170. /**
  7171. * Append a value onto existing header
  7172. *
  7173. * @param String name Header name
  7174. * @param String value Header value
  7175. * @return Void
  7176. */
  7177. append(name, value) {
  7178. name = `${name}`;
  7179. value = `${value}`;
  7180. validateName(name);
  7181. validateValue(value);
  7182. const key = find(this[MAP], name);
  7183. if (key !== undefined) {
  7184. this[MAP][key].push(value);
  7185. } else {
  7186. this[MAP][name] = [value];
  7187. }
  7188. }
  7189. /**
  7190. * Check for header name existence
  7191. *
  7192. * @param String name Header name
  7193. * @return Boolean
  7194. */
  7195. has(name) {
  7196. name = `${name}`;
  7197. validateName(name);
  7198. return find(this[MAP], name) !== undefined;
  7199. }
  7200. /**
  7201. * Delete all header values given name
  7202. *
  7203. * @param String name Header name
  7204. * @return Void
  7205. */
  7206. delete(name) {
  7207. name = `${name}`;
  7208. validateName(name);
  7209. const key = find(this[MAP], name);
  7210. if (key !== undefined) {
  7211. delete this[MAP][key];
  7212. }
  7213. }
  7214. /**
  7215. * Return raw headers (non-spec api)
  7216. *
  7217. * @return Object
  7218. */
  7219. raw() {
  7220. return this[MAP];
  7221. }
  7222. /**
  7223. * Get an iterator on keys.
  7224. *
  7225. * @return Iterator
  7226. */
  7227. keys() {
  7228. return createHeadersIterator(this, 'key');
  7229. }
  7230. /**
  7231. * Get an iterator on values.
  7232. *
  7233. * @return Iterator
  7234. */
  7235. values() {
  7236. return createHeadersIterator(this, 'value');
  7237. }
  7238. /**
  7239. * Get an iterator on entries.
  7240. *
  7241. * This is the default iterator of the Headers object.
  7242. *
  7243. * @return Iterator
  7244. */
  7245. [Symbol.iterator]() {
  7246. return createHeadersIterator(this, 'key+value');
  7247. }
  7248. }
  7249. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7250. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7251. value: 'Headers',
  7252. writable: false,
  7253. enumerable: false,
  7254. configurable: true
  7255. });
  7256. Object.defineProperties(Headers.prototype, {
  7257. get: { enumerable: true },
  7258. forEach: { enumerable: true },
  7259. set: { enumerable: true },
  7260. append: { enumerable: true },
  7261. has: { enumerable: true },
  7262. delete: { enumerable: true },
  7263. keys: { enumerable: true },
  7264. values: { enumerable: true },
  7265. entries: { enumerable: true }
  7266. });
  7267. function getHeaders(headers) {
  7268. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7269. const keys = Object.keys(headers[MAP]).sort();
  7270. return keys.map(kind === 'key' ? function (k) {
  7271. return k.toLowerCase();
  7272. } : kind === 'value' ? function (k) {
  7273. return headers[MAP][k].join(', ');
  7274. } : function (k) {
  7275. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7276. });
  7277. }
  7278. const INTERNAL = Symbol('internal');
  7279. function createHeadersIterator(target, kind) {
  7280. const iterator = Object.create(HeadersIteratorPrototype);
  7281. iterator[INTERNAL] = {
  7282. target,
  7283. kind,
  7284. index: 0
  7285. };
  7286. return iterator;
  7287. }
  7288. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7289. next() {
  7290. // istanbul ignore if
  7291. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7292. throw new TypeError('Value of `this` is not a HeadersIterator');
  7293. }
  7294. var _INTERNAL = this[INTERNAL];
  7295. const target = _INTERNAL.target,
  7296. kind = _INTERNAL.kind,
  7297. index = _INTERNAL.index;
  7298. const values = getHeaders(target, kind);
  7299. const len = values.length;
  7300. if (index >= len) {
  7301. return {
  7302. value: undefined,
  7303. done: true
  7304. };
  7305. }
  7306. this[INTERNAL].index = index + 1;
  7307. return {
  7308. value: values[index],
  7309. done: false
  7310. };
  7311. }
  7312. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7313. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7314. value: 'HeadersIterator',
  7315. writable: false,
  7316. enumerable: false,
  7317. configurable: true
  7318. });
  7319. /**
  7320. * Export the Headers object in a form that Node.js can consume.
  7321. *
  7322. * @param Headers headers
  7323. * @return Object
  7324. */
  7325. function exportNodeCompatibleHeaders(headers) {
  7326. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7327. // http.request() only supports string as Host header. This hack makes
  7328. // specifying custom Host header possible.
  7329. const hostHeaderKey = find(headers[MAP], 'Host');
  7330. if (hostHeaderKey !== undefined) {
  7331. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7332. }
  7333. return obj;
  7334. }
  7335. /**
  7336. * Create a Headers object from an object of headers, ignoring those that do
  7337. * not conform to HTTP grammar productions.
  7338. *
  7339. * @param Object obj Object of headers
  7340. * @return Headers
  7341. */
  7342. function createHeadersLenient(obj) {
  7343. const headers = new Headers();
  7344. for (const name of Object.keys(obj)) {
  7345. if (invalidTokenRegex.test(name)) {
  7346. continue;
  7347. }
  7348. if (Array.isArray(obj[name])) {
  7349. for (const val of obj[name]) {
  7350. if (invalidHeaderCharRegex.test(val)) {
  7351. continue;
  7352. }
  7353. if (headers[MAP][name] === undefined) {
  7354. headers[MAP][name] = [val];
  7355. } else {
  7356. headers[MAP][name].push(val);
  7357. }
  7358. }
  7359. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7360. headers[MAP][name] = [obj[name]];
  7361. }
  7362. }
  7363. return headers;
  7364. }
  7365. const INTERNALS$1 = Symbol('Response internals');
  7366. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7367. const STATUS_CODES = http.STATUS_CODES;
  7368. /**
  7369. * Response class
  7370. *
  7371. * @param Stream body Readable stream
  7372. * @param Object opts Response options
  7373. * @return Void
  7374. */
  7375. class Response {
  7376. constructor() {
  7377. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7378. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7379. Body.call(this, body, opts);
  7380. const status = opts.status || 200;
  7381. const headers = new Headers(opts.headers);
  7382. if (body != null && !headers.has('Content-Type')) {
  7383. const contentType = extractContentType(body);
  7384. if (contentType) {
  7385. headers.append('Content-Type', contentType);
  7386. }
  7387. }
  7388. this[INTERNALS$1] = {
  7389. url: opts.url,
  7390. status,
  7391. statusText: opts.statusText || STATUS_CODES[status],
  7392. headers,
  7393. counter: opts.counter
  7394. };
  7395. }
  7396. get url() {
  7397. return this[INTERNALS$1].url || '';
  7398. }
  7399. get status() {
  7400. return this[INTERNALS$1].status;
  7401. }
  7402. /**
  7403. * Convenience property representing if the request ended normally
  7404. */
  7405. get ok() {
  7406. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7407. }
  7408. get redirected() {
  7409. return this[INTERNALS$1].counter > 0;
  7410. }
  7411. get statusText() {
  7412. return this[INTERNALS$1].statusText;
  7413. }
  7414. get headers() {
  7415. return this[INTERNALS$1].headers;
  7416. }
  7417. /**
  7418. * Clone this response
  7419. *
  7420. * @return Response
  7421. */
  7422. clone() {
  7423. return new Response(clone(this), {
  7424. url: this.url,
  7425. status: this.status,
  7426. statusText: this.statusText,
  7427. headers: this.headers,
  7428. ok: this.ok,
  7429. redirected: this.redirected
  7430. });
  7431. }
  7432. }
  7433. Body.mixIn(Response.prototype);
  7434. Object.defineProperties(Response.prototype, {
  7435. url: { enumerable: true },
  7436. status: { enumerable: true },
  7437. ok: { enumerable: true },
  7438. redirected: { enumerable: true },
  7439. statusText: { enumerable: true },
  7440. headers: { enumerable: true },
  7441. clone: { enumerable: true }
  7442. });
  7443. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7444. value: 'Response',
  7445. writable: false,
  7446. enumerable: false,
  7447. configurable: true
  7448. });
  7449. const INTERNALS$2 = Symbol('Request internals');
  7450. // fix an issue where "format", "parse" aren't a named export for node <10
  7451. const parse_url = Url.parse;
  7452. const format_url = Url.format;
  7453. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7454. /**
  7455. * Check if a value is an instance of Request.
  7456. *
  7457. * @param Mixed input
  7458. * @return Boolean
  7459. */
  7460. function isRequest(input) {
  7461. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7462. }
  7463. function isAbortSignal(signal) {
  7464. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7465. return !!(proto && proto.constructor.name === 'AbortSignal');
  7466. }
  7467. /**
  7468. * Request class
  7469. *
  7470. * @param Mixed input Url or Request instance
  7471. * @param Object init Custom options
  7472. * @return Void
  7473. */
  7474. class Request {
  7475. constructor(input) {
  7476. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7477. let parsedURL;
  7478. // normalize input
  7479. if (!isRequest(input)) {
  7480. if (input && input.href) {
  7481. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7482. // will fall into this branch also (since their `toString()` will return
  7483. // `href` property anyway)
  7484. parsedURL = parse_url(input.href);
  7485. } else {
  7486. // coerce input to a string before attempting to parse
  7487. parsedURL = parse_url(`${input}`);
  7488. }
  7489. input = {};
  7490. } else {
  7491. parsedURL = parse_url(input.url);
  7492. }
  7493. let method = init.method || input.method || 'GET';
  7494. method = method.toUpperCase();
  7495. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7496. throw new TypeError('Request with GET/HEAD method cannot have body');
  7497. }
  7498. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7499. Body.call(this, inputBody, {
  7500. timeout: init.timeout || input.timeout || 0,
  7501. size: init.size || input.size || 0
  7502. });
  7503. const headers = new Headers(init.headers || input.headers || {});
  7504. if (inputBody != null && !headers.has('Content-Type')) {
  7505. const contentType = extractContentType(inputBody);
  7506. if (contentType) {
  7507. headers.append('Content-Type', contentType);
  7508. }
  7509. }
  7510. let signal = isRequest(input) ? input.signal : null;
  7511. if ('signal' in init) signal = init.signal;
  7512. if (signal != null && !isAbortSignal(signal)) {
  7513. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7514. }
  7515. this[INTERNALS$2] = {
  7516. method,
  7517. redirect: init.redirect || input.redirect || 'follow',
  7518. headers,
  7519. parsedURL,
  7520. signal
  7521. };
  7522. // node-fetch-only options
  7523. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7524. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7525. this.counter = init.counter || input.counter || 0;
  7526. this.agent = init.agent || input.agent;
  7527. }
  7528. get method() {
  7529. return this[INTERNALS$2].method;
  7530. }
  7531. get url() {
  7532. return format_url(this[INTERNALS$2].parsedURL);
  7533. }
  7534. get headers() {
  7535. return this[INTERNALS$2].headers;
  7536. }
  7537. get redirect() {
  7538. return this[INTERNALS$2].redirect;
  7539. }
  7540. get signal() {
  7541. return this[INTERNALS$2].signal;
  7542. }
  7543. /**
  7544. * Clone this request
  7545. *
  7546. * @return Request
  7547. */
  7548. clone() {
  7549. return new Request(this);
  7550. }
  7551. }
  7552. Body.mixIn(Request.prototype);
  7553. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7554. value: 'Request',
  7555. writable: false,
  7556. enumerable: false,
  7557. configurable: true
  7558. });
  7559. Object.defineProperties(Request.prototype, {
  7560. method: { enumerable: true },
  7561. url: { enumerable: true },
  7562. headers: { enumerable: true },
  7563. redirect: { enumerable: true },
  7564. clone: { enumerable: true },
  7565. signal: { enumerable: true }
  7566. });
  7567. /**
  7568. * Convert a Request to Node.js http request options.
  7569. *
  7570. * @param Request A Request instance
  7571. * @return Object The options object to be passed to http.request
  7572. */
  7573. function getNodeRequestOptions(request) {
  7574. const parsedURL = request[INTERNALS$2].parsedURL;
  7575. const headers = new Headers(request[INTERNALS$2].headers);
  7576. // fetch step 1.3
  7577. if (!headers.has('Accept')) {
  7578. headers.set('Accept', '*/*');
  7579. }
  7580. // Basic fetch
  7581. if (!parsedURL.protocol || !parsedURL.hostname) {
  7582. throw new TypeError('Only absolute URLs are supported');
  7583. }
  7584. if (!/^https?:$/.test(parsedURL.protocol)) {
  7585. throw new TypeError('Only HTTP(S) protocols are supported');
  7586. }
  7587. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7588. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7589. }
  7590. // HTTP-network-or-cache fetch steps 2.4-2.7
  7591. let contentLengthValue = null;
  7592. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7593. contentLengthValue = '0';
  7594. }
  7595. if (request.body != null) {
  7596. const totalBytes = getTotalBytes(request);
  7597. if (typeof totalBytes === 'number') {
  7598. contentLengthValue = String(totalBytes);
  7599. }
  7600. }
  7601. if (contentLengthValue) {
  7602. headers.set('Content-Length', contentLengthValue);
  7603. }
  7604. // HTTP-network-or-cache fetch step 2.11
  7605. if (!headers.has('User-Agent')) {
  7606. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7607. }
  7608. // HTTP-network-or-cache fetch step 2.15
  7609. if (request.compress && !headers.has('Accept-Encoding')) {
  7610. headers.set('Accept-Encoding', 'gzip,deflate');
  7611. }
  7612. let agent = request.agent;
  7613. if (typeof agent === 'function') {
  7614. agent = agent(parsedURL);
  7615. }
  7616. if (!headers.has('Connection') && !agent) {
  7617. headers.set('Connection', 'close');
  7618. }
  7619. // HTTP-network fetch step 4.2
  7620. // chunked encoding is handled by Node.js
  7621. return Object.assign({}, parsedURL, {
  7622. method: request.method,
  7623. headers: exportNodeCompatibleHeaders(headers),
  7624. agent
  7625. });
  7626. }
  7627. /**
  7628. * abort-error.js
  7629. *
  7630. * AbortError interface for cancelled requests
  7631. */
  7632. /**
  7633. * Create AbortError instance
  7634. *
  7635. * @param String message Error message for human
  7636. * @return AbortError
  7637. */
  7638. function AbortError(message) {
  7639. Error.call(this, message);
  7640. this.type = 'aborted';
  7641. this.message = message;
  7642. // hide custom error implementation details from end-users
  7643. Error.captureStackTrace(this, this.constructor);
  7644. }
  7645. AbortError.prototype = Object.create(Error.prototype);
  7646. AbortError.prototype.constructor = AbortError;
  7647. AbortError.prototype.name = 'AbortError';
  7648. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7649. const PassThrough$1 = Stream.PassThrough;
  7650. const resolve_url = Url.resolve;
  7651. /**
  7652. * Fetch function
  7653. *
  7654. * @param Mixed url Absolute url or Request instance
  7655. * @param Object opts Fetch options
  7656. * @return Promise
  7657. */
  7658. function fetch(url, opts) {
  7659. // allow custom promise
  7660. if (!fetch.Promise) {
  7661. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7662. }
  7663. Body.Promise = fetch.Promise;
  7664. // wrap http.request into fetch
  7665. return new fetch.Promise(function (resolve, reject) {
  7666. // build request object
  7667. const request = new Request(url, opts);
  7668. const options = getNodeRequestOptions(request);
  7669. const send = (options.protocol === 'https:' ? https : http).request;
  7670. const signal = request.signal;
  7671. let response = null;
  7672. const abort = function abort() {
  7673. let error = new AbortError('The user aborted a request.');
  7674. reject(error);
  7675. if (request.body && request.body instanceof Stream.Readable) {
  7676. request.body.destroy(error);
  7677. }
  7678. if (!response || !response.body) return;
  7679. response.body.emit('error', error);
  7680. };
  7681. if (signal && signal.aborted) {
  7682. abort();
  7683. return;
  7684. }
  7685. const abortAndFinalize = function abortAndFinalize() {
  7686. abort();
  7687. finalize();
  7688. };
  7689. // send request
  7690. const req = send(options);
  7691. let reqTimeout;
  7692. if (signal) {
  7693. signal.addEventListener('abort', abortAndFinalize);
  7694. }
  7695. function finalize() {
  7696. req.abort();
  7697. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7698. clearTimeout(reqTimeout);
  7699. }
  7700. if (request.timeout) {
  7701. req.once('socket', function (socket) {
  7702. reqTimeout = setTimeout(function () {
  7703. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7704. finalize();
  7705. }, request.timeout);
  7706. });
  7707. }
  7708. req.on('error', function (err) {
  7709. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7710. finalize();
  7711. });
  7712. req.on('response', function (res) {
  7713. clearTimeout(reqTimeout);
  7714. const headers = createHeadersLenient(res.headers);
  7715. // HTTP fetch step 5
  7716. if (fetch.isRedirect(res.statusCode)) {
  7717. // HTTP fetch step 5.2
  7718. const location = headers.get('Location');
  7719. // HTTP fetch step 5.3
  7720. const locationURL = location === null ? null : resolve_url(request.url, location);
  7721. // HTTP fetch step 5.5
  7722. switch (request.redirect) {
  7723. case 'error':
  7724. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7725. finalize();
  7726. return;
  7727. case 'manual':
  7728. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7729. if (locationURL !== null) {
  7730. // handle corrupted header
  7731. try {
  7732. headers.set('Location', locationURL);
  7733. } catch (err) {
  7734. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7735. reject(err);
  7736. }
  7737. }
  7738. break;
  7739. case 'follow':
  7740. // HTTP-redirect fetch step 2
  7741. if (locationURL === null) {
  7742. break;
  7743. }
  7744. // HTTP-redirect fetch step 5
  7745. if (request.counter >= request.follow) {
  7746. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7747. finalize();
  7748. return;
  7749. }
  7750. // HTTP-redirect fetch step 6 (counter increment)
  7751. // Create a new Request object.
  7752. const requestOpts = {
  7753. headers: new Headers(request.headers),
  7754. follow: request.follow,
  7755. counter: request.counter + 1,
  7756. agent: request.agent,
  7757. compress: request.compress,
  7758. method: request.method,
  7759. body: request.body,
  7760. signal: request.signal,
  7761. timeout: request.timeout
  7762. };
  7763. // HTTP-redirect fetch step 9
  7764. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7765. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7766. finalize();
  7767. return;
  7768. }
  7769. // HTTP-redirect fetch step 11
  7770. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7771. requestOpts.method = 'GET';
  7772. requestOpts.body = undefined;
  7773. requestOpts.headers.delete('content-length');
  7774. }
  7775. // HTTP-redirect fetch step 15
  7776. resolve(fetch(new Request(locationURL, requestOpts)));
  7777. finalize();
  7778. return;
  7779. }
  7780. }
  7781. // prepare response
  7782. res.once('end', function () {
  7783. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7784. });
  7785. let body = res.pipe(new PassThrough$1());
  7786. const response_options = {
  7787. url: request.url,
  7788. status: res.statusCode,
  7789. statusText: res.statusMessage,
  7790. headers: headers,
  7791. size: request.size,
  7792. timeout: request.timeout,
  7793. counter: request.counter
  7794. };
  7795. // HTTP-network fetch step 12.1.1.3
  7796. const codings = headers.get('Content-Encoding');
  7797. // HTTP-network fetch step 12.1.1.4: handle content codings
  7798. // in following scenarios we ignore compression support
  7799. // 1. compression support is disabled
  7800. // 2. HEAD request
  7801. // 3. no Content-Encoding header
  7802. // 4. no content response (204)
  7803. // 5. content not modified response (304)
  7804. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7805. response = new Response(body, response_options);
  7806. resolve(response);
  7807. return;
  7808. }
  7809. // For Node v6+
  7810. // Be less strict when decoding compressed responses, since sometimes
  7811. // servers send slightly invalid responses that are still accepted
  7812. // by common browsers.
  7813. // Always using Z_SYNC_FLUSH is what cURL does.
  7814. const zlibOptions = {
  7815. flush: zlib.Z_SYNC_FLUSH,
  7816. finishFlush: zlib.Z_SYNC_FLUSH
  7817. };
  7818. // for gzip
  7819. if (codings == 'gzip' || codings == 'x-gzip') {
  7820. body = body.pipe(zlib.createGunzip(zlibOptions));
  7821. response = new Response(body, response_options);
  7822. resolve(response);
  7823. return;
  7824. }
  7825. // for deflate
  7826. if (codings == 'deflate' || codings == 'x-deflate') {
  7827. // handle the infamous raw deflate response from old servers
  7828. // a hack for old IIS and Apache servers
  7829. const raw = res.pipe(new PassThrough$1());
  7830. raw.once('data', function (chunk) {
  7831. // see http://stackoverflow.com/questions/37519828
  7832. if ((chunk[0] & 0x0F) === 0x08) {
  7833. body = body.pipe(zlib.createInflate());
  7834. } else {
  7835. body = body.pipe(zlib.createInflateRaw());
  7836. }
  7837. response = new Response(body, response_options);
  7838. resolve(response);
  7839. });
  7840. return;
  7841. }
  7842. // for br
  7843. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7844. body = body.pipe(zlib.createBrotliDecompress());
  7845. response = new Response(body, response_options);
  7846. resolve(response);
  7847. return;
  7848. }
  7849. // otherwise, use response as-is
  7850. response = new Response(body, response_options);
  7851. resolve(response);
  7852. });
  7853. writeToStream(req, request);
  7854. });
  7855. }
  7856. /**
  7857. * Redirect code matching
  7858. *
  7859. * @param Number code Status code
  7860. * @return Boolean
  7861. */
  7862. fetch.isRedirect = function (code) {
  7863. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7864. };
  7865. // expose Promise
  7866. fetch.Promise = global.Promise;
  7867. module.exports = exports = fetch;
  7868. Object.defineProperty(exports, "__esModule", { value: true });
  7869. exports.default = exports;
  7870. exports.Headers = Headers;
  7871. exports.Request = Request;
  7872. exports.Response = Response;
  7873. exports.FetchError = FetchError;
  7874. /***/ }),
  7875. /***/ 462:
  7876. /***/ (function(module) {
  7877. "use strict";
  7878. // See http://www.robvanderwoude.com/escapechars.php
  7879. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7880. function escapeCommand(arg) {
  7881. // Escape meta chars
  7882. arg = arg.replace(metaCharsRegExp, '^$1');
  7883. return arg;
  7884. }
  7885. function escapeArgument(arg, doubleEscapeMetaChars) {
  7886. // Convert to string
  7887. arg = `${arg}`;
  7888. // Algorithm below is based on https://qntm.org/cmd
  7889. // Sequence of backslashes followed by a double quote:
  7890. // double up all the backslashes and escape the double quote
  7891. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7892. // Sequence of backslashes followed by the end of the string
  7893. // (which will become a double quote later):
  7894. // double up all the backslashes
  7895. arg = arg.replace(/(\\*)$/, '$1$1');
  7896. // All other backslashes occur literally
  7897. // Quote the whole thing:
  7898. arg = `"${arg}"`;
  7899. // Escape meta chars
  7900. arg = arg.replace(metaCharsRegExp, '^$1');
  7901. // Double escape meta chars if necessary
  7902. if (doubleEscapeMetaChars) {
  7903. arg = arg.replace(metaCharsRegExp, '^$1');
  7904. }
  7905. return arg;
  7906. }
  7907. module.exports.command = escapeCommand;
  7908. module.exports.argument = escapeArgument;
  7909. /***/ }),
  7910. /***/ 463:
  7911. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7912. "use strict";
  7913. Object.defineProperty(exports, '__esModule', { value: true });
  7914. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7915. var deprecation = __webpack_require__(692);
  7916. var once = _interopDefault(__webpack_require__(969));
  7917. const logOnce = once(deprecation => console.warn(deprecation));
  7918. /**
  7919. * Error with extra properties to help with debugging
  7920. */
  7921. class RequestError extends Error {
  7922. constructor(message, statusCode, options) {
  7923. super(message); // Maintains proper stack trace (only available on V8)
  7924. /* istanbul ignore next */
  7925. if (Error.captureStackTrace) {
  7926. Error.captureStackTrace(this, this.constructor);
  7927. }
  7928. this.name = "HttpError";
  7929. this.status = statusCode;
  7930. Object.defineProperty(this, "code", {
  7931. get() {
  7932. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7933. return statusCode;
  7934. }
  7935. });
  7936. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7937. const requestCopy = Object.assign({}, options.request);
  7938. if (options.request.headers.authorization) {
  7939. requestCopy.headers = Object.assign({}, options.request.headers, {
  7940. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7941. });
  7942. }
  7943. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7944. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7945. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7946. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7947. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7948. this.request = requestCopy;
  7949. }
  7950. }
  7951. exports.RequestError = RequestError;
  7952. //# sourceMappingURL=index.js.map
  7953. /***/ }),
  7954. /***/ 464:
  7955. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7956. "use strict";
  7957. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7958. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7959. return new (P || (P = Promise))(function (resolve, reject) {
  7960. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7961. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7962. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7963. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7964. });
  7965. };
  7966. var __importStar = (this && this.__importStar) || function (mod) {
  7967. if (mod && mod.__esModule) return mod;
  7968. var result = {};
  7969. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7970. result["default"] = mod;
  7971. return result;
  7972. };
  7973. var __importDefault = (this && this.__importDefault) || function (mod) {
  7974. return (mod && mod.__esModule) ? mod : { "default": mod };
  7975. };
  7976. Object.defineProperty(exports, "__esModule", { value: true });
  7977. const assert = __importStar(__webpack_require__(357));
  7978. const core = __importStar(__webpack_require__(470));
  7979. const fs = __importStar(__webpack_require__(747));
  7980. const github = __importStar(__webpack_require__(469));
  7981. const io = __importStar(__webpack_require__(1));
  7982. const path = __importStar(__webpack_require__(622));
  7983. const retryHelper = __importStar(__webpack_require__(587));
  7984. const toolCache = __importStar(__webpack_require__(533));
  7985. const urlHelper = __importStar(__webpack_require__(81));
  7986. const v4_1 = __importDefault(__webpack_require__(826));
  7987. const IS_WINDOWS = process.platform === 'win32';
  7988. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  7989. return __awaiter(this, void 0, void 0, function* () {
  7990. // Download the archive
  7991. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7992. core.info('Downloading the archive');
  7993. return yield downloadArchive(authToken, owner, repo, ref, commit);
  7994. }));
  7995. // Write archive to disk
  7996. core.info('Writing archive to disk');
  7997. const uniqueId = v4_1.default();
  7998. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  7999. yield fs.promises.writeFile(archivePath, archiveData);
  8000. archiveData = Buffer.from(''); // Free memory
  8001. // Extract archive
  8002. core.info('Extracting the archive');
  8003. const extractPath = path.join(repositoryPath, uniqueId);
  8004. yield io.mkdirP(extractPath);
  8005. if (IS_WINDOWS) {
  8006. yield toolCache.extractZip(archivePath, extractPath);
  8007. }
  8008. else {
  8009. yield toolCache.extractTar(archivePath, extractPath);
  8010. }
  8011. io.rmRF(archivePath);
  8012. // Determine the path of the repository content. The archive contains
  8013. // a top-level folder and the repository content is inside.
  8014. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8015. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8016. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8017. core.info(`Resolved version ${archiveVersion}`);
  8018. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8019. // Move the files
  8020. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8021. const sourcePath = path.join(tempRepositoryPath, fileName);
  8022. const targetPath = path.join(repositoryPath, fileName);
  8023. if (IS_WINDOWS) {
  8024. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8025. }
  8026. else {
  8027. yield io.mv(sourcePath, targetPath);
  8028. }
  8029. }
  8030. io.rmRF(extractPath);
  8031. });
  8032. }
  8033. exports.downloadRepository = downloadRepository;
  8034. function downloadArchive(authToken, owner, repo, ref, commit) {
  8035. return __awaiter(this, void 0, void 0, function* () {
  8036. const octokit = new github.GitHub(authToken, { baseUrl: urlHelper.getApiUrl() });
  8037. const params = {
  8038. owner: owner,
  8039. repo: repo,
  8040. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8041. ref: commit || ref
  8042. };
  8043. const response = yield octokit.repos.getArchiveLink(params);
  8044. if (response.status != 200) {
  8045. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8046. }
  8047. return Buffer.from(response.data); // response.data is ArrayBuffer
  8048. });
  8049. }
  8050. /***/ }),
  8051. /***/ 469:
  8052. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8053. "use strict";
  8054. var __importDefault = (this && this.__importDefault) || function (mod) {
  8055. return (mod && mod.__esModule) ? mod : { "default": mod };
  8056. };
  8057. var __importStar = (this && this.__importStar) || function (mod) {
  8058. if (mod && mod.__esModule) return mod;
  8059. var result = {};
  8060. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8061. result["default"] = mod;
  8062. return result;
  8063. };
  8064. Object.defineProperty(exports, "__esModule", { value: true });
  8065. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8066. const graphql_1 = __webpack_require__(898);
  8067. const rest_1 = __importDefault(__webpack_require__(0));
  8068. const Context = __importStar(__webpack_require__(262));
  8069. const httpClient = __importStar(__webpack_require__(539));
  8070. // We need this in order to extend Octokit
  8071. rest_1.default.prototype = new rest_1.default();
  8072. exports.context = new Context.Context();
  8073. class GitHub extends rest_1.default {
  8074. constructor(token, opts) {
  8075. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8076. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8077. }
  8078. /**
  8079. * Disambiguates the constructor overload parameters
  8080. */
  8081. static disambiguate(token, opts) {
  8082. return [
  8083. typeof token === 'string' ? token : '',
  8084. typeof token === 'object' ? token : opts || {}
  8085. ];
  8086. }
  8087. static getOctokitOptions(args) {
  8088. const token = args[0];
  8089. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8090. // Auth
  8091. const auth = GitHub.getAuthString(token, options);
  8092. if (auth) {
  8093. options.auth = auth;
  8094. }
  8095. // Proxy
  8096. const agent = GitHub.getProxyAgent(options);
  8097. if (agent) {
  8098. // Shallow clone - don't mutate the object provided by the caller
  8099. options.request = options.request ? Object.assign({}, options.request) : {};
  8100. // Set the agent
  8101. options.request.agent = agent;
  8102. }
  8103. return options;
  8104. }
  8105. static getGraphQL(args) {
  8106. const defaults = {};
  8107. const token = args[0];
  8108. const options = args[1];
  8109. // Authorization
  8110. const auth = this.getAuthString(token, options);
  8111. if (auth) {
  8112. defaults.headers = {
  8113. authorization: auth
  8114. };
  8115. }
  8116. // Proxy
  8117. const agent = GitHub.getProxyAgent(options);
  8118. if (agent) {
  8119. defaults.request = { agent };
  8120. }
  8121. return graphql_1.graphql.defaults(defaults);
  8122. }
  8123. static getAuthString(token, options) {
  8124. // Validate args
  8125. if (!token && !options.auth) {
  8126. throw new Error('Parameter token or opts.auth is required');
  8127. }
  8128. else if (token && options.auth) {
  8129. throw new Error('Parameters token and opts.auth may not both be specified');
  8130. }
  8131. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8132. }
  8133. static getProxyAgent(options) {
  8134. var _a;
  8135. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8136. const serverUrl = 'https://api.github.com';
  8137. if (httpClient.getProxyUrl(serverUrl)) {
  8138. const hc = new httpClient.HttpClient();
  8139. return hc.getAgent(serverUrl);
  8140. }
  8141. }
  8142. return undefined;
  8143. }
  8144. }
  8145. exports.GitHub = GitHub;
  8146. //# sourceMappingURL=github.js.map
  8147. /***/ }),
  8148. /***/ 470:
  8149. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8150. "use strict";
  8151. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8152. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8153. return new (P || (P = Promise))(function (resolve, reject) {
  8154. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8155. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8156. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8157. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8158. });
  8159. };
  8160. Object.defineProperty(exports, "__esModule", { value: true });
  8161. const command_1 = __webpack_require__(431);
  8162. const os = __webpack_require__(87);
  8163. const path = __webpack_require__(622);
  8164. /**
  8165. * The code to exit an action
  8166. */
  8167. var ExitCode;
  8168. (function (ExitCode) {
  8169. /**
  8170. * A code indicating that the action was successful
  8171. */
  8172. ExitCode[ExitCode["Success"] = 0] = "Success";
  8173. /**
  8174. * A code indicating that the action was a failure
  8175. */
  8176. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8177. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8178. //-----------------------------------------------------------------------
  8179. // Variables
  8180. //-----------------------------------------------------------------------
  8181. /**
  8182. * Sets env variable for this action and future actions in the job
  8183. * @param name the name of the variable to set
  8184. * @param val the value of the variable
  8185. */
  8186. function exportVariable(name, val) {
  8187. process.env[name] = val;
  8188. command_1.issueCommand('set-env', { name }, val);
  8189. }
  8190. exports.exportVariable = exportVariable;
  8191. /**
  8192. * Registers a secret which will get masked from logs
  8193. * @param secret value of the secret
  8194. */
  8195. function setSecret(secret) {
  8196. command_1.issueCommand('add-mask', {}, secret);
  8197. }
  8198. exports.setSecret = setSecret;
  8199. /**
  8200. * Prepends inputPath to the PATH (for this action and future actions)
  8201. * @param inputPath
  8202. */
  8203. function addPath(inputPath) {
  8204. command_1.issueCommand('add-path', {}, inputPath);
  8205. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8206. }
  8207. exports.addPath = addPath;
  8208. /**
  8209. * Gets the value of an input. The value is also trimmed.
  8210. *
  8211. * @param name name of the input to get
  8212. * @param options optional. See InputOptions.
  8213. * @returns string
  8214. */
  8215. function getInput(name, options) {
  8216. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8217. if (options && options.required && !val) {
  8218. throw new Error(`Input required and not supplied: ${name}`);
  8219. }
  8220. return val.trim();
  8221. }
  8222. exports.getInput = getInput;
  8223. /**
  8224. * Sets the value of an output.
  8225. *
  8226. * @param name name of the output to set
  8227. * @param value value to store
  8228. */
  8229. function setOutput(name, value) {
  8230. command_1.issueCommand('set-output', { name }, value);
  8231. }
  8232. exports.setOutput = setOutput;
  8233. //-----------------------------------------------------------------------
  8234. // Results
  8235. //-----------------------------------------------------------------------
  8236. /**
  8237. * Sets the action status to failed.
  8238. * When the action exits it will be with an exit code of 1
  8239. * @param message add error issue message
  8240. */
  8241. function setFailed(message) {
  8242. process.exitCode = ExitCode.Failure;
  8243. error(message);
  8244. }
  8245. exports.setFailed = setFailed;
  8246. //-----------------------------------------------------------------------
  8247. // Logging Commands
  8248. //-----------------------------------------------------------------------
  8249. /**
  8250. * Writes debug message to user log
  8251. * @param message debug message
  8252. */
  8253. function debug(message) {
  8254. command_1.issueCommand('debug', {}, message);
  8255. }
  8256. exports.debug = debug;
  8257. /**
  8258. * Adds an error issue
  8259. * @param message error issue message
  8260. */
  8261. function error(message) {
  8262. command_1.issue('error', message);
  8263. }
  8264. exports.error = error;
  8265. /**
  8266. * Adds an warning issue
  8267. * @param message warning issue message
  8268. */
  8269. function warning(message) {
  8270. command_1.issue('warning', message);
  8271. }
  8272. exports.warning = warning;
  8273. /**
  8274. * Writes info to log with console.log.
  8275. * @param message info message
  8276. */
  8277. function info(message) {
  8278. process.stdout.write(message + os.EOL);
  8279. }
  8280. exports.info = info;
  8281. /**
  8282. * Begin an output group.
  8283. *
  8284. * Output until the next `groupEnd` will be foldable in this group
  8285. *
  8286. * @param name The name of the output group
  8287. */
  8288. function startGroup(name) {
  8289. command_1.issue('group', name);
  8290. }
  8291. exports.startGroup = startGroup;
  8292. /**
  8293. * End an output group.
  8294. */
  8295. function endGroup() {
  8296. command_1.issue('endgroup');
  8297. }
  8298. exports.endGroup = endGroup;
  8299. /**
  8300. * Wrap an asynchronous function call in a group.
  8301. *
  8302. * Returns the same type as the function itself.
  8303. *
  8304. * @param name The name of the group
  8305. * @param fn The function to wrap in the group
  8306. */
  8307. function group(name, fn) {
  8308. return __awaiter(this, void 0, void 0, function* () {
  8309. startGroup(name);
  8310. let result;
  8311. try {
  8312. result = yield fn();
  8313. }
  8314. finally {
  8315. endGroup();
  8316. }
  8317. return result;
  8318. });
  8319. }
  8320. exports.group = group;
  8321. //# sourceMappingURL=core.js.map
  8322. /***/ }),
  8323. /***/ 471:
  8324. /***/ (function(module, __unusedexports, __webpack_require__) {
  8325. module.exports = authenticationBeforeRequest;
  8326. const btoa = __webpack_require__(675);
  8327. const uniq = __webpack_require__(126);
  8328. function authenticationBeforeRequest(state, options) {
  8329. if (!state.auth.type) {
  8330. return;
  8331. }
  8332. if (state.auth.type === "basic") {
  8333. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8334. options.headers.authorization = `Basic ${hash}`;
  8335. return;
  8336. }
  8337. if (state.auth.type === "token") {
  8338. options.headers.authorization = `token ${state.auth.token}`;
  8339. return;
  8340. }
  8341. if (state.auth.type === "app") {
  8342. options.headers.authorization = `Bearer ${state.auth.token}`;
  8343. const acceptHeaders = options.headers.accept
  8344. .split(",")
  8345. .concat("application/vnd.github.machine-man-preview+json");
  8346. options.headers.accept = uniq(acceptHeaders)
  8347. .filter(Boolean)
  8348. .join(",");
  8349. return;
  8350. }
  8351. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8352. if (state.auth.token) {
  8353. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8354. return;
  8355. }
  8356. const key = encodeURIComponent(state.auth.key);
  8357. const secret = encodeURIComponent(state.auth.secret);
  8358. options.url += `client_id=${key}&client_secret=${secret}`;
  8359. }
  8360. /***/ }),
  8361. /***/ 489:
  8362. /***/ (function(module, __unusedexports, __webpack_require__) {
  8363. "use strict";
  8364. const path = __webpack_require__(622);
  8365. const which = __webpack_require__(814);
  8366. const pathKey = __webpack_require__(39)();
  8367. function resolveCommandAttempt(parsed, withoutPathExt) {
  8368. const cwd = process.cwd();
  8369. const hasCustomCwd = parsed.options.cwd != null;
  8370. // If a custom `cwd` was specified, we need to change the process cwd
  8371. // because `which` will do stat calls but does not support a custom cwd
  8372. if (hasCustomCwd) {
  8373. try {
  8374. process.chdir(parsed.options.cwd);
  8375. } catch (err) {
  8376. /* Empty */
  8377. }
  8378. }
  8379. let resolved;
  8380. try {
  8381. resolved = which.sync(parsed.command, {
  8382. path: (parsed.options.env || process.env)[pathKey],
  8383. pathExt: withoutPathExt ? path.delimiter : undefined,
  8384. });
  8385. } catch (e) {
  8386. /* Empty */
  8387. } finally {
  8388. process.chdir(cwd);
  8389. }
  8390. // If we successfully resolved, ensure that an absolute path is returned
  8391. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8392. if (resolved) {
  8393. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8394. }
  8395. return resolved;
  8396. }
  8397. function resolveCommand(parsed) {
  8398. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8399. }
  8400. module.exports = resolveCommand;
  8401. /***/ }),
  8402. /***/ 510:
  8403. /***/ (function(module) {
  8404. module.exports = addHook
  8405. function addHook (state, kind, name, hook) {
  8406. var orig = hook
  8407. if (!state.registry[name]) {
  8408. state.registry[name] = []
  8409. }
  8410. if (kind === 'before') {
  8411. hook = function (method, options) {
  8412. return Promise.resolve()
  8413. .then(orig.bind(null, options))
  8414. .then(method.bind(null, options))
  8415. }
  8416. }
  8417. if (kind === 'after') {
  8418. hook = function (method, options) {
  8419. var result
  8420. return Promise.resolve()
  8421. .then(method.bind(null, options))
  8422. .then(function (result_) {
  8423. result = result_
  8424. return orig(result, options)
  8425. })
  8426. .then(function () {
  8427. return result
  8428. })
  8429. }
  8430. }
  8431. if (kind === 'error') {
  8432. hook = function (method, options) {
  8433. return Promise.resolve()
  8434. .then(method.bind(null, options))
  8435. .catch(function (error) {
  8436. return orig(error, options)
  8437. })
  8438. }
  8439. }
  8440. state.registry[name].push({
  8441. hook: hook,
  8442. orig: orig
  8443. })
  8444. }
  8445. /***/ }),
  8446. /***/ 523:
  8447. /***/ (function(module, __unusedexports, __webpack_require__) {
  8448. var register = __webpack_require__(363)
  8449. var addHook = __webpack_require__(510)
  8450. var removeHook = __webpack_require__(763)
  8451. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8452. var bind = Function.bind
  8453. var bindable = bind.bind(bind)
  8454. function bindApi (hook, state, name) {
  8455. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8456. hook.api = { remove: removeHookRef }
  8457. hook.remove = removeHookRef
  8458. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8459. var args = name ? [state, kind, name] : [state, kind]
  8460. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8461. })
  8462. }
  8463. function HookSingular () {
  8464. var singularHookName = 'h'
  8465. var singularHookState = {
  8466. registry: {}
  8467. }
  8468. var singularHook = register.bind(null, singularHookState, singularHookName)
  8469. bindApi(singularHook, singularHookState, singularHookName)
  8470. return singularHook
  8471. }
  8472. function HookCollection () {
  8473. var state = {
  8474. registry: {}
  8475. }
  8476. var hook = register.bind(null, state)
  8477. bindApi(hook, state)
  8478. return hook
  8479. }
  8480. var collectionHookDeprecationMessageDisplayed = false
  8481. function Hook () {
  8482. if (!collectionHookDeprecationMessageDisplayed) {
  8483. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8484. collectionHookDeprecationMessageDisplayed = true
  8485. }
  8486. return HookCollection()
  8487. }
  8488. Hook.Singular = HookSingular.bind()
  8489. Hook.Collection = HookCollection.bind()
  8490. module.exports = Hook
  8491. // expose constructors as a named property for TypeScript
  8492. module.exports.Hook = Hook
  8493. module.exports.Singular = Hook.Singular
  8494. module.exports.Collection = Hook.Collection
  8495. /***/ }),
  8496. /***/ 528:
  8497. /***/ (function(__unusedmodule, exports) {
  8498. "use strict";
  8499. Object.defineProperty(exports, "__esModule", { value: true });
  8500. function escape(value) {
  8501. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8502. return `\\${x}`;
  8503. });
  8504. }
  8505. exports.escape = escape;
  8506. /***/ }),
  8507. /***/ 529:
  8508. /***/ (function(module, __unusedexports, __webpack_require__) {
  8509. const factory = __webpack_require__(47);
  8510. module.exports = factory();
  8511. /***/ }),
  8512. /***/ 533:
  8513. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8514. "use strict";
  8515. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8516. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8517. return new (P || (P = Promise))(function (resolve, reject) {
  8518. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8519. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8520. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8521. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8522. });
  8523. };
  8524. Object.defineProperty(exports, "__esModule", { value: true });
  8525. const core = __webpack_require__(470);
  8526. const io = __webpack_require__(1);
  8527. const fs = __webpack_require__(747);
  8528. const os = __webpack_require__(87);
  8529. const path = __webpack_require__(622);
  8530. const httpm = __webpack_require__(874);
  8531. const semver = __webpack_require__(656);
  8532. const uuidV4 = __webpack_require__(826);
  8533. const exec_1 = __webpack_require__(986);
  8534. const assert_1 = __webpack_require__(357);
  8535. class HTTPError extends Error {
  8536. constructor(httpStatusCode) {
  8537. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8538. this.httpStatusCode = httpStatusCode;
  8539. Object.setPrototypeOf(this, new.target.prototype);
  8540. }
  8541. }
  8542. exports.HTTPError = HTTPError;
  8543. const IS_WINDOWS = process.platform === 'win32';
  8544. const userAgent = 'actions/tool-cache';
  8545. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8546. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8547. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8548. // If directories not found, place them in common temp locations
  8549. if (!tempDirectory || !cacheRoot) {
  8550. let baseLocation;
  8551. if (IS_WINDOWS) {
  8552. // On windows use the USERPROFILE env variable
  8553. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8554. }
  8555. else {
  8556. if (process.platform === 'darwin') {
  8557. baseLocation = '/Users';
  8558. }
  8559. else {
  8560. baseLocation = '/home';
  8561. }
  8562. }
  8563. if (!tempDirectory) {
  8564. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8565. }
  8566. if (!cacheRoot) {
  8567. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8568. }
  8569. }
  8570. /**
  8571. * Download a tool from an url and stream it into a file
  8572. *
  8573. * @param url url of tool to download
  8574. * @returns path to downloaded tool
  8575. */
  8576. function downloadTool(url) {
  8577. return __awaiter(this, void 0, void 0, function* () {
  8578. // Wrap in a promise so that we can resolve from within stream callbacks
  8579. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8580. try {
  8581. const http = new httpm.HttpClient(userAgent, [], {
  8582. allowRetries: true,
  8583. maxRetries: 3
  8584. });
  8585. const destPath = path.join(tempDirectory, uuidV4());
  8586. yield io.mkdirP(tempDirectory);
  8587. core.debug(`Downloading ${url}`);
  8588. core.debug(`Downloading ${destPath}`);
  8589. if (fs.existsSync(destPath)) {
  8590. throw new Error(`Destination file path ${destPath} already exists`);
  8591. }
  8592. const response = yield http.get(url);
  8593. if (response.message.statusCode !== 200) {
  8594. const err = new HTTPError(response.message.statusCode);
  8595. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8596. throw err;
  8597. }
  8598. const file = fs.createWriteStream(destPath);
  8599. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8600. try {
  8601. const stream = response.message.pipe(file);
  8602. stream.on('close', () => {
  8603. core.debug('download complete');
  8604. resolve(destPath);
  8605. });
  8606. }
  8607. catch (err) {
  8608. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8609. reject(err);
  8610. }
  8611. }));
  8612. file.on('error', err => {
  8613. file.end();
  8614. reject(err);
  8615. });
  8616. }
  8617. catch (err) {
  8618. reject(err);
  8619. }
  8620. }));
  8621. });
  8622. }
  8623. exports.downloadTool = downloadTool;
  8624. /**
  8625. * Extract a .7z file
  8626. *
  8627. * @param file path to the .7z file
  8628. * @param dest destination directory. Optional.
  8629. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8630. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8631. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8632. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8633. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8634. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8635. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8636. * to 7zr.exe can be pass to this function.
  8637. * @returns path to the destination directory
  8638. */
  8639. function extract7z(file, dest, _7zPath) {
  8640. return __awaiter(this, void 0, void 0, function* () {
  8641. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8642. assert_1.ok(file, 'parameter "file" is required');
  8643. dest = dest || (yield _createExtractFolder(dest));
  8644. const originalCwd = process.cwd();
  8645. process.chdir(dest);
  8646. if (_7zPath) {
  8647. try {
  8648. const args = [
  8649. 'x',
  8650. '-bb1',
  8651. '-bd',
  8652. '-sccUTF-8',
  8653. file
  8654. ];
  8655. const options = {
  8656. silent: true
  8657. };
  8658. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8659. }
  8660. finally {
  8661. process.chdir(originalCwd);
  8662. }
  8663. }
  8664. else {
  8665. const escapedScript = path
  8666. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8667. .replace(/'/g, "''")
  8668. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8669. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8670. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8671. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8672. const args = [
  8673. '-NoLogo',
  8674. '-Sta',
  8675. '-NoProfile',
  8676. '-NonInteractive',
  8677. '-ExecutionPolicy',
  8678. 'Unrestricted',
  8679. '-Command',
  8680. command
  8681. ];
  8682. const options = {
  8683. silent: true
  8684. };
  8685. try {
  8686. const powershellPath = yield io.which('powershell', true);
  8687. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8688. }
  8689. finally {
  8690. process.chdir(originalCwd);
  8691. }
  8692. }
  8693. return dest;
  8694. });
  8695. }
  8696. exports.extract7z = extract7z;
  8697. /**
  8698. * Extract a tar
  8699. *
  8700. * @param file path to the tar
  8701. * @param dest destination directory. Optional.
  8702. * @param flags flags for the tar. Optional.
  8703. * @returns path to the destination directory
  8704. */
  8705. function extractTar(file, dest, flags = 'xz') {
  8706. return __awaiter(this, void 0, void 0, function* () {
  8707. if (!file) {
  8708. throw new Error("parameter 'file' is required");
  8709. }
  8710. dest = dest || (yield _createExtractFolder(dest));
  8711. const tarPath = yield io.which('tar', true);
  8712. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8713. return dest;
  8714. });
  8715. }
  8716. exports.extractTar = extractTar;
  8717. /**
  8718. * Extract a zip
  8719. *
  8720. * @param file path to the zip
  8721. * @param dest destination directory. Optional.
  8722. * @returns path to the destination directory
  8723. */
  8724. function extractZip(file, dest) {
  8725. return __awaiter(this, void 0, void 0, function* () {
  8726. if (!file) {
  8727. throw new Error("parameter 'file' is required");
  8728. }
  8729. dest = dest || (yield _createExtractFolder(dest));
  8730. if (IS_WINDOWS) {
  8731. yield extractZipWin(file, dest);
  8732. }
  8733. else {
  8734. yield extractZipNix(file, dest);
  8735. }
  8736. return dest;
  8737. });
  8738. }
  8739. exports.extractZip = extractZip;
  8740. function extractZipWin(file, dest) {
  8741. return __awaiter(this, void 0, void 0, function* () {
  8742. // build the powershell command
  8743. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8744. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8745. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8746. // run powershell
  8747. const powershellPath = yield io.which('powershell');
  8748. const args = [
  8749. '-NoLogo',
  8750. '-Sta',
  8751. '-NoProfile',
  8752. '-NonInteractive',
  8753. '-ExecutionPolicy',
  8754. 'Unrestricted',
  8755. '-Command',
  8756. command
  8757. ];
  8758. yield exec_1.exec(`"${powershellPath}"`, args);
  8759. });
  8760. }
  8761. function extractZipNix(file, dest) {
  8762. return __awaiter(this, void 0, void 0, function* () {
  8763. const unzipPath = yield io.which('unzip');
  8764. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8765. });
  8766. }
  8767. /**
  8768. * Caches a directory and installs it into the tool cacheDir
  8769. *
  8770. * @param sourceDir the directory to cache into tools
  8771. * @param tool tool name
  8772. * @param version version of the tool. semver format
  8773. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8774. */
  8775. function cacheDir(sourceDir, tool, version, arch) {
  8776. return __awaiter(this, void 0, void 0, function* () {
  8777. version = semver.clean(version) || version;
  8778. arch = arch || os.arch();
  8779. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8780. core.debug(`source dir: ${sourceDir}`);
  8781. if (!fs.statSync(sourceDir).isDirectory()) {
  8782. throw new Error('sourceDir is not a directory');
  8783. }
  8784. // Create the tool dir
  8785. const destPath = yield _createToolPath(tool, version, arch);
  8786. // copy each child item. do not move. move can fail on Windows
  8787. // due to anti-virus software having an open handle on a file.
  8788. for (const itemName of fs.readdirSync(sourceDir)) {
  8789. const s = path.join(sourceDir, itemName);
  8790. yield io.cp(s, destPath, { recursive: true });
  8791. }
  8792. // write .complete
  8793. _completeToolPath(tool, version, arch);
  8794. return destPath;
  8795. });
  8796. }
  8797. exports.cacheDir = cacheDir;
  8798. /**
  8799. * Caches a downloaded file (GUID) and installs it
  8800. * into the tool cache with a given targetName
  8801. *
  8802. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8803. * @param targetFile the name of the file name in the tools directory
  8804. * @param tool tool name
  8805. * @param version version of the tool. semver format
  8806. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8807. */
  8808. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8809. return __awaiter(this, void 0, void 0, function* () {
  8810. version = semver.clean(version) || version;
  8811. arch = arch || os.arch();
  8812. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8813. core.debug(`source file: ${sourceFile}`);
  8814. if (!fs.statSync(sourceFile).isFile()) {
  8815. throw new Error('sourceFile is not a file');
  8816. }
  8817. // create the tool dir
  8818. const destFolder = yield _createToolPath(tool, version, arch);
  8819. // copy instead of move. move can fail on Windows due to
  8820. // anti-virus software having an open handle on a file.
  8821. const destPath = path.join(destFolder, targetFile);
  8822. core.debug(`destination file ${destPath}`);
  8823. yield io.cp(sourceFile, destPath);
  8824. // write .complete
  8825. _completeToolPath(tool, version, arch);
  8826. return destFolder;
  8827. });
  8828. }
  8829. exports.cacheFile = cacheFile;
  8830. /**
  8831. * Finds the path to a tool version in the local installed tool cache
  8832. *
  8833. * @param toolName name of the tool
  8834. * @param versionSpec version of the tool
  8835. * @param arch optional arch. defaults to arch of computer
  8836. */
  8837. function find(toolName, versionSpec, arch) {
  8838. if (!toolName) {
  8839. throw new Error('toolName parameter is required');
  8840. }
  8841. if (!versionSpec) {
  8842. throw new Error('versionSpec parameter is required');
  8843. }
  8844. arch = arch || os.arch();
  8845. // attempt to resolve an explicit version
  8846. if (!_isExplicitVersion(versionSpec)) {
  8847. const localVersions = findAllVersions(toolName, arch);
  8848. const match = _evaluateVersions(localVersions, versionSpec);
  8849. versionSpec = match;
  8850. }
  8851. // check for the explicit version in the cache
  8852. let toolPath = '';
  8853. if (versionSpec) {
  8854. versionSpec = semver.clean(versionSpec) || '';
  8855. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8856. core.debug(`checking cache: ${cachePath}`);
  8857. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8858. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8859. toolPath = cachePath;
  8860. }
  8861. else {
  8862. core.debug('not found');
  8863. }
  8864. }
  8865. return toolPath;
  8866. }
  8867. exports.find = find;
  8868. /**
  8869. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8870. *
  8871. * @param toolName name of the tool
  8872. * @param arch optional arch. defaults to arch of computer
  8873. */
  8874. function findAllVersions(toolName, arch) {
  8875. const versions = [];
  8876. arch = arch || os.arch();
  8877. const toolPath = path.join(cacheRoot, toolName);
  8878. if (fs.existsSync(toolPath)) {
  8879. const children = fs.readdirSync(toolPath);
  8880. for (const child of children) {
  8881. if (_isExplicitVersion(child)) {
  8882. const fullPath = path.join(toolPath, child, arch || '');
  8883. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8884. versions.push(child);
  8885. }
  8886. }
  8887. }
  8888. }
  8889. return versions;
  8890. }
  8891. exports.findAllVersions = findAllVersions;
  8892. function _createExtractFolder(dest) {
  8893. return __awaiter(this, void 0, void 0, function* () {
  8894. if (!dest) {
  8895. // create a temp dir
  8896. dest = path.join(tempDirectory, uuidV4());
  8897. }
  8898. yield io.mkdirP(dest);
  8899. return dest;
  8900. });
  8901. }
  8902. function _createToolPath(tool, version, arch) {
  8903. return __awaiter(this, void 0, void 0, function* () {
  8904. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8905. core.debug(`destination ${folderPath}`);
  8906. const markerPath = `${folderPath}.complete`;
  8907. yield io.rmRF(folderPath);
  8908. yield io.rmRF(markerPath);
  8909. yield io.mkdirP(folderPath);
  8910. return folderPath;
  8911. });
  8912. }
  8913. function _completeToolPath(tool, version, arch) {
  8914. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8915. const markerPath = `${folderPath}.complete`;
  8916. fs.writeFileSync(markerPath, '');
  8917. core.debug('finished caching tool');
  8918. }
  8919. function _isExplicitVersion(versionSpec) {
  8920. const c = semver.clean(versionSpec) || '';
  8921. core.debug(`isExplicit: ${c}`);
  8922. const valid = semver.valid(c) != null;
  8923. core.debug(`explicit? ${valid}`);
  8924. return valid;
  8925. }
  8926. function _evaluateVersions(versions, versionSpec) {
  8927. let version = '';
  8928. core.debug(`evaluating ${versions.length} versions`);
  8929. versions = versions.sort((a, b) => {
  8930. if (semver.gt(a, b)) {
  8931. return 1;
  8932. }
  8933. return -1;
  8934. });
  8935. for (let i = versions.length - 1; i >= 0; i--) {
  8936. const potential = versions[i];
  8937. const satisfied = semver.satisfies(potential, versionSpec);
  8938. if (satisfied) {
  8939. version = potential;
  8940. break;
  8941. }
  8942. }
  8943. if (version) {
  8944. core.debug(`matched: ${version}`);
  8945. }
  8946. else {
  8947. core.debug('match not found');
  8948. }
  8949. return version;
  8950. }
  8951. //# sourceMappingURL=tool-cache.js.map
  8952. /***/ }),
  8953. /***/ 536:
  8954. /***/ (function(module, __unusedexports, __webpack_require__) {
  8955. module.exports = hasFirstPage
  8956. const deprecate = __webpack_require__(370)
  8957. const getPageLinks = __webpack_require__(577)
  8958. function hasFirstPage (link) {
  8959. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8960. return getPageLinks(link).first
  8961. }
  8962. /***/ }),
  8963. /***/ 539:
  8964. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8965. "use strict";
  8966. Object.defineProperty(exports, "__esModule", { value: true });
  8967. const url = __webpack_require__(835);
  8968. const http = __webpack_require__(605);
  8969. const https = __webpack_require__(211);
  8970. const pm = __webpack_require__(950);
  8971. let tunnel;
  8972. var HttpCodes;
  8973. (function (HttpCodes) {
  8974. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  8975. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  8976. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  8977. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  8978. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  8979. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  8980. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  8981. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  8982. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  8983. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  8984. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  8985. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  8986. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  8987. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  8988. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  8989. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  8990. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  8991. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  8992. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  8993. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  8994. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  8995. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  8996. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  8997. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  8998. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  8999. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  9000. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  9001. /**
  9002. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  9003. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9004. */
  9005. function getProxyUrl(serverUrl) {
  9006. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  9007. return proxyUrl ? proxyUrl.href : '';
  9008. }
  9009. exports.getProxyUrl = getProxyUrl;
  9010. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  9011. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  9012. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  9013. const ExponentialBackoffCeiling = 10;
  9014. const ExponentialBackoffTimeSlice = 5;
  9015. class HttpClientResponse {
  9016. constructor(message) {
  9017. this.message = message;
  9018. }
  9019. readBody() {
  9020. return new Promise(async (resolve, reject) => {
  9021. let output = Buffer.alloc(0);
  9022. this.message.on('data', (chunk) => {
  9023. output = Buffer.concat([output, chunk]);
  9024. });
  9025. this.message.on('end', () => {
  9026. resolve(output.toString());
  9027. });
  9028. });
  9029. }
  9030. }
  9031. exports.HttpClientResponse = HttpClientResponse;
  9032. function isHttps(requestUrl) {
  9033. let parsedUrl = url.parse(requestUrl);
  9034. return parsedUrl.protocol === 'https:';
  9035. }
  9036. exports.isHttps = isHttps;
  9037. class HttpClient {
  9038. constructor(userAgent, handlers, requestOptions) {
  9039. this._ignoreSslError = false;
  9040. this._allowRedirects = true;
  9041. this._allowRedirectDowngrade = false;
  9042. this._maxRedirects = 50;
  9043. this._allowRetries = false;
  9044. this._maxRetries = 1;
  9045. this._keepAlive = false;
  9046. this._disposed = false;
  9047. this.userAgent = userAgent;
  9048. this.handlers = handlers || [];
  9049. this.requestOptions = requestOptions;
  9050. if (requestOptions) {
  9051. if (requestOptions.ignoreSslError != null) {
  9052. this._ignoreSslError = requestOptions.ignoreSslError;
  9053. }
  9054. this._socketTimeout = requestOptions.socketTimeout;
  9055. if (requestOptions.allowRedirects != null) {
  9056. this._allowRedirects = requestOptions.allowRedirects;
  9057. }
  9058. if (requestOptions.allowRedirectDowngrade != null) {
  9059. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9060. }
  9061. if (requestOptions.maxRedirects != null) {
  9062. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9063. }
  9064. if (requestOptions.keepAlive != null) {
  9065. this._keepAlive = requestOptions.keepAlive;
  9066. }
  9067. if (requestOptions.allowRetries != null) {
  9068. this._allowRetries = requestOptions.allowRetries;
  9069. }
  9070. if (requestOptions.maxRetries != null) {
  9071. this._maxRetries = requestOptions.maxRetries;
  9072. }
  9073. }
  9074. }
  9075. options(requestUrl, additionalHeaders) {
  9076. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9077. }
  9078. get(requestUrl, additionalHeaders) {
  9079. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9080. }
  9081. del(requestUrl, additionalHeaders) {
  9082. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9083. }
  9084. post(requestUrl, data, additionalHeaders) {
  9085. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9086. }
  9087. patch(requestUrl, data, additionalHeaders) {
  9088. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9089. }
  9090. put(requestUrl, data, additionalHeaders) {
  9091. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9092. }
  9093. head(requestUrl, additionalHeaders) {
  9094. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9095. }
  9096. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9097. return this.request(verb, requestUrl, stream, additionalHeaders);
  9098. }
  9099. /**
  9100. * Makes a raw http request.
  9101. * All other methods such as get, post, patch, and request ultimately call this.
  9102. * Prefer get, del, post and patch
  9103. */
  9104. async request(verb, requestUrl, data, headers) {
  9105. if (this._disposed) {
  9106. throw new Error("Client has already been disposed.");
  9107. }
  9108. let parsedUrl = url.parse(requestUrl);
  9109. let info = this._prepareRequest(verb, parsedUrl, headers);
  9110. // Only perform retries on reads since writes may not be idempotent.
  9111. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  9112. let numTries = 0;
  9113. let response;
  9114. while (numTries < maxTries) {
  9115. response = await this.requestRaw(info, data);
  9116. // Check if it's an authentication challenge
  9117. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  9118. let authenticationHandler;
  9119. for (let i = 0; i < this.handlers.length; i++) {
  9120. if (this.handlers[i].canHandleAuthentication(response)) {
  9121. authenticationHandler = this.handlers[i];
  9122. break;
  9123. }
  9124. }
  9125. if (authenticationHandler) {
  9126. return authenticationHandler.handleAuthentication(this, info, data);
  9127. }
  9128. else {
  9129. // We have received an unauthorized response but have no handlers to handle it.
  9130. // Let the response return to the caller.
  9131. return response;
  9132. }
  9133. }
  9134. let redirectsRemaining = this._maxRedirects;
  9135. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  9136. && this._allowRedirects
  9137. && redirectsRemaining > 0) {
  9138. const redirectUrl = response.message.headers["location"];
  9139. if (!redirectUrl) {
  9140. // if there's no location to redirect to, we won't
  9141. break;
  9142. }
  9143. let parsedRedirectUrl = url.parse(redirectUrl);
  9144. if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
  9145. 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.");
  9146. }
  9147. // we need to finish reading the response before reassigning response
  9148. // which will leak the open socket.
  9149. await response.readBody();
  9150. // let's make the request with the new redirectUrl
  9151. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9152. response = await this.requestRaw(info, data);
  9153. redirectsRemaining--;
  9154. }
  9155. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9156. // If not a retry code, return immediately instead of retrying
  9157. return response;
  9158. }
  9159. numTries += 1;
  9160. if (numTries < maxTries) {
  9161. await response.readBody();
  9162. await this._performExponentialBackoff(numTries);
  9163. }
  9164. }
  9165. return response;
  9166. }
  9167. /**
  9168. * Needs to be called if keepAlive is set to true in request options.
  9169. */
  9170. dispose() {
  9171. if (this._agent) {
  9172. this._agent.destroy();
  9173. }
  9174. this._disposed = true;
  9175. }
  9176. /**
  9177. * Raw request.
  9178. * @param info
  9179. * @param data
  9180. */
  9181. requestRaw(info, data) {
  9182. return new Promise((resolve, reject) => {
  9183. let callbackForResult = function (err, res) {
  9184. if (err) {
  9185. reject(err);
  9186. }
  9187. resolve(res);
  9188. };
  9189. this.requestRawWithCallback(info, data, callbackForResult);
  9190. });
  9191. }
  9192. /**
  9193. * Raw request with callback.
  9194. * @param info
  9195. * @param data
  9196. * @param onResult
  9197. */
  9198. requestRawWithCallback(info, data, onResult) {
  9199. let socket;
  9200. if (typeof (data) === 'string') {
  9201. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  9202. }
  9203. let callbackCalled = false;
  9204. let handleResult = (err, res) => {
  9205. if (!callbackCalled) {
  9206. callbackCalled = true;
  9207. onResult(err, res);
  9208. }
  9209. };
  9210. let req = info.httpModule.request(info.options, (msg) => {
  9211. let res = new HttpClientResponse(msg);
  9212. handleResult(null, res);
  9213. });
  9214. req.on('socket', (sock) => {
  9215. socket = sock;
  9216. });
  9217. // If we ever get disconnected, we want the socket to timeout eventually
  9218. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9219. if (socket) {
  9220. socket.end();
  9221. }
  9222. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9223. });
  9224. req.on('error', function (err) {
  9225. // err has statusCode property
  9226. // res should have headers
  9227. handleResult(err, null);
  9228. });
  9229. if (data && typeof (data) === 'string') {
  9230. req.write(data, 'utf8');
  9231. }
  9232. if (data && typeof (data) !== 'string') {
  9233. data.on('close', function () {
  9234. req.end();
  9235. });
  9236. data.pipe(req);
  9237. }
  9238. else {
  9239. req.end();
  9240. }
  9241. }
  9242. /**
  9243. * Gets an http agent. This function is useful when you need an http agent that handles
  9244. * routing through a proxy server - depending upon the url and proxy environment variables.
  9245. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9246. */
  9247. getAgent(serverUrl) {
  9248. let parsedUrl = url.parse(serverUrl);
  9249. return this._getAgent(parsedUrl);
  9250. }
  9251. _prepareRequest(method, requestUrl, headers) {
  9252. const info = {};
  9253. info.parsedUrl = requestUrl;
  9254. const usingSsl = info.parsedUrl.protocol === 'https:';
  9255. info.httpModule = usingSsl ? https : http;
  9256. const defaultPort = usingSsl ? 443 : 80;
  9257. info.options = {};
  9258. info.options.host = info.parsedUrl.hostname;
  9259. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  9260. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9261. info.options.method = method;
  9262. info.options.headers = this._mergeHeaders(headers);
  9263. if (this.userAgent != null) {
  9264. info.options.headers["user-agent"] = this.userAgent;
  9265. }
  9266. info.options.agent = this._getAgent(info.parsedUrl);
  9267. // gives handlers an opportunity to participate
  9268. if (this.handlers) {
  9269. this.handlers.forEach((handler) => {
  9270. handler.prepareRequest(info.options);
  9271. });
  9272. }
  9273. return info;
  9274. }
  9275. _mergeHeaders(headers) {
  9276. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  9277. if (this.requestOptions && this.requestOptions.headers) {
  9278. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9279. }
  9280. return lowercaseKeys(headers || {});
  9281. }
  9282. _getAgent(parsedUrl) {
  9283. let agent;
  9284. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9285. let useProxy = proxyUrl && proxyUrl.hostname;
  9286. if (this._keepAlive && useProxy) {
  9287. agent = this._proxyAgent;
  9288. }
  9289. if (this._keepAlive && !useProxy) {
  9290. agent = this._agent;
  9291. }
  9292. // if agent is already assigned use that agent.
  9293. if (!!agent) {
  9294. return agent;
  9295. }
  9296. const usingSsl = parsedUrl.protocol === 'https:';
  9297. let maxSockets = 100;
  9298. if (!!this.requestOptions) {
  9299. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9300. }
  9301. if (useProxy) {
  9302. // If using proxy, need tunnel
  9303. if (!tunnel) {
  9304. tunnel = __webpack_require__(335);
  9305. }
  9306. const agentOptions = {
  9307. maxSockets: maxSockets,
  9308. keepAlive: this._keepAlive,
  9309. proxy: {
  9310. proxyAuth: proxyUrl.auth,
  9311. host: proxyUrl.hostname,
  9312. port: proxyUrl.port
  9313. },
  9314. };
  9315. let tunnelAgent;
  9316. const overHttps = proxyUrl.protocol === 'https:';
  9317. if (usingSsl) {
  9318. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9319. }
  9320. else {
  9321. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9322. }
  9323. agent = tunnelAgent(agentOptions);
  9324. this._proxyAgent = agent;
  9325. }
  9326. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9327. if (this._keepAlive && !agent) {
  9328. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9329. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9330. this._agent = agent;
  9331. }
  9332. // if not using private agent and tunnel agent isn't setup then use global agent
  9333. if (!agent) {
  9334. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9335. }
  9336. if (usingSsl && this._ignoreSslError) {
  9337. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9338. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9339. // we have to cast it to any and change it directly
  9340. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  9341. }
  9342. return agent;
  9343. }
  9344. _performExponentialBackoff(retryNumber) {
  9345. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9346. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9347. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9348. }
  9349. }
  9350. exports.HttpClient = HttpClient;
  9351. /***/ }),
  9352. /***/ 550:
  9353. /***/ (function(module, __unusedexports, __webpack_require__) {
  9354. module.exports = getNextPage
  9355. const getPage = __webpack_require__(265)
  9356. function getNextPage (octokit, link, headers) {
  9357. return getPage(octokit, link, 'next', headers)
  9358. }
  9359. /***/ }),
  9360. /***/ 558:
  9361. /***/ (function(module, __unusedexports, __webpack_require__) {
  9362. module.exports = hasPreviousPage
  9363. const deprecate = __webpack_require__(370)
  9364. const getPageLinks = __webpack_require__(577)
  9365. function hasPreviousPage (link) {
  9366. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9367. return getPageLinks(link).prev
  9368. }
  9369. /***/ }),
  9370. /***/ 559:
  9371. /***/ (function(__unusedmodule, exports) {
  9372. "use strict";
  9373. Object.defineProperty(exports, "__esModule", { value: true });
  9374. class GitVersion {
  9375. /**
  9376. * Used for comparing the version of git and git-lfs against the minimum required version
  9377. * @param version the version string, e.g. 1.2 or 1.2.3
  9378. */
  9379. constructor(version) {
  9380. this.major = NaN;
  9381. this.minor = NaN;
  9382. this.patch = NaN;
  9383. if (version) {
  9384. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9385. if (match) {
  9386. this.major = Number(match[1]);
  9387. this.minor = Number(match[2]);
  9388. if (match[4]) {
  9389. this.patch = Number(match[4]);
  9390. }
  9391. }
  9392. }
  9393. }
  9394. /**
  9395. * Compares the instance against a minimum required version
  9396. * @param minimum Minimum version
  9397. */
  9398. checkMinimum(minimum) {
  9399. if (!minimum.isValid()) {
  9400. throw new Error('Arg minimum is not a valid version');
  9401. }
  9402. // Major is insufficient
  9403. if (this.major < minimum.major) {
  9404. return false;
  9405. }
  9406. // Major is equal
  9407. if (this.major === minimum.major) {
  9408. // Minor is insufficient
  9409. if (this.minor < minimum.minor) {
  9410. return false;
  9411. }
  9412. // Minor is equal
  9413. if (this.minor === minimum.minor) {
  9414. // Patch is insufficient
  9415. if (this.patch && this.patch < (minimum.patch || 0)) {
  9416. return false;
  9417. }
  9418. }
  9419. }
  9420. return true;
  9421. }
  9422. /**
  9423. * Indicates whether the instance was constructed from a valid version string
  9424. */
  9425. isValid() {
  9426. return !isNaN(this.major);
  9427. }
  9428. /**
  9429. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9430. */
  9431. toString() {
  9432. let result = '';
  9433. if (this.isValid()) {
  9434. result = `${this.major}.${this.minor}`;
  9435. if (!isNaN(this.patch)) {
  9436. result += `.${this.patch}`;
  9437. }
  9438. }
  9439. return result;
  9440. }
  9441. }
  9442. exports.GitVersion = GitVersion;
  9443. /***/ }),
  9444. /***/ 562:
  9445. /***/ (function(module, __unusedexports, __webpack_require__) {
  9446. var once = __webpack_require__(969);
  9447. var noop = function() {};
  9448. var isRequest = function(stream) {
  9449. return stream.setHeader && typeof stream.abort === 'function';
  9450. };
  9451. var isChildProcess = function(stream) {
  9452. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9453. };
  9454. var eos = function(stream, opts, callback) {
  9455. if (typeof opts === 'function') return eos(stream, null, opts);
  9456. if (!opts) opts = {};
  9457. callback = once(callback || noop);
  9458. var ws = stream._writableState;
  9459. var rs = stream._readableState;
  9460. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9461. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9462. var cancelled = false;
  9463. var onlegacyfinish = function() {
  9464. if (!stream.writable) onfinish();
  9465. };
  9466. var onfinish = function() {
  9467. writable = false;
  9468. if (!readable) callback.call(stream);
  9469. };
  9470. var onend = function() {
  9471. readable = false;
  9472. if (!writable) callback.call(stream);
  9473. };
  9474. var onexit = function(exitCode) {
  9475. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9476. };
  9477. var onerror = function(err) {
  9478. callback.call(stream, err);
  9479. };
  9480. var onclose = function() {
  9481. process.nextTick(onclosenexttick);
  9482. };
  9483. var onclosenexttick = function() {
  9484. if (cancelled) return;
  9485. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9486. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9487. };
  9488. var onrequest = function() {
  9489. stream.req.on('finish', onfinish);
  9490. };
  9491. if (isRequest(stream)) {
  9492. stream.on('complete', onfinish);
  9493. stream.on('abort', onclose);
  9494. if (stream.req) onrequest();
  9495. else stream.on('request', onrequest);
  9496. } else if (writable && !ws) { // legacy streams
  9497. stream.on('end', onlegacyfinish);
  9498. stream.on('close', onlegacyfinish);
  9499. }
  9500. if (isChildProcess(stream)) stream.on('exit', onexit);
  9501. stream.on('end', onend);
  9502. stream.on('finish', onfinish);
  9503. if (opts.error !== false) stream.on('error', onerror);
  9504. stream.on('close', onclose);
  9505. return function() {
  9506. cancelled = true;
  9507. stream.removeListener('complete', onfinish);
  9508. stream.removeListener('abort', onclose);
  9509. stream.removeListener('request', onrequest);
  9510. if (stream.req) stream.req.removeListener('finish', onfinish);
  9511. stream.removeListener('end', onlegacyfinish);
  9512. stream.removeListener('close', onlegacyfinish);
  9513. stream.removeListener('finish', onfinish);
  9514. stream.removeListener('exit', onexit);
  9515. stream.removeListener('end', onend);
  9516. stream.removeListener('error', onerror);
  9517. stream.removeListener('close', onclose);
  9518. };
  9519. };
  9520. module.exports = eos;
  9521. /***/ }),
  9522. /***/ 563:
  9523. /***/ (function(module, __unusedexports, __webpack_require__) {
  9524. module.exports = getPreviousPage
  9525. const getPage = __webpack_require__(265)
  9526. function getPreviousPage (octokit, link, headers) {
  9527. return getPage(octokit, link, 'prev', headers)
  9528. }
  9529. /***/ }),
  9530. /***/ 568:
  9531. /***/ (function(module, __unusedexports, __webpack_require__) {
  9532. "use strict";
  9533. const path = __webpack_require__(622);
  9534. const niceTry = __webpack_require__(948);
  9535. const resolveCommand = __webpack_require__(489);
  9536. const escape = __webpack_require__(462);
  9537. const readShebang = __webpack_require__(389);
  9538. const semver = __webpack_require__(280);
  9539. const isWin = process.platform === 'win32';
  9540. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9541. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9542. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9543. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9544. function detectShebang(parsed) {
  9545. parsed.file = resolveCommand(parsed);
  9546. const shebang = parsed.file && readShebang(parsed.file);
  9547. if (shebang) {
  9548. parsed.args.unshift(parsed.file);
  9549. parsed.command = shebang;
  9550. return resolveCommand(parsed);
  9551. }
  9552. return parsed.file;
  9553. }
  9554. function parseNonShell(parsed) {
  9555. if (!isWin) {
  9556. return parsed;
  9557. }
  9558. // Detect & add support for shebangs
  9559. const commandFile = detectShebang(parsed);
  9560. // We don't need a shell if the command filename is an executable
  9561. const needsShell = !isExecutableRegExp.test(commandFile);
  9562. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9563. // Note that `forceShell` is an hidden option used only in tests
  9564. if (parsed.options.forceShell || needsShell) {
  9565. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9566. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9567. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9568. // we need to double escape them
  9569. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9570. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9571. // This is necessary otherwise it will always fail with ENOENT in those cases
  9572. parsed.command = path.normalize(parsed.command);
  9573. // Escape command & arguments
  9574. parsed.command = escape.command(parsed.command);
  9575. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9576. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9577. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9578. parsed.command = process.env.comspec || 'cmd.exe';
  9579. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9580. }
  9581. return parsed;
  9582. }
  9583. function parseShell(parsed) {
  9584. // If node supports the shell option, there's no need to mimic its behavior
  9585. if (supportsShellOption) {
  9586. return parsed;
  9587. }
  9588. // Mimic node shell option
  9589. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9590. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9591. if (isWin) {
  9592. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9593. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9594. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9595. } else {
  9596. if (typeof parsed.options.shell === 'string') {
  9597. parsed.command = parsed.options.shell;
  9598. } else if (process.platform === 'android') {
  9599. parsed.command = '/system/bin/sh';
  9600. } else {
  9601. parsed.command = '/bin/sh';
  9602. }
  9603. parsed.args = ['-c', shellCommand];
  9604. }
  9605. return parsed;
  9606. }
  9607. function parse(command, args, options) {
  9608. // Normalize arguments, similar to nodejs
  9609. if (args && !Array.isArray(args)) {
  9610. options = args;
  9611. args = null;
  9612. }
  9613. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9614. options = Object.assign({}, options); // Clone object to avoid changing the original
  9615. // Build our parsed object
  9616. const parsed = {
  9617. command,
  9618. args,
  9619. options,
  9620. file: undefined,
  9621. original: {
  9622. command,
  9623. args,
  9624. },
  9625. };
  9626. // Delegate further parsing to shell or non-shell
  9627. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9628. }
  9629. module.exports = parse;
  9630. /***/ }),
  9631. /***/ 577:
  9632. /***/ (function(module) {
  9633. module.exports = getPageLinks
  9634. function getPageLinks (link) {
  9635. link = link.link || link.headers.link || ''
  9636. const links = {}
  9637. // link format:
  9638. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9639. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9640. links[type] = uri
  9641. })
  9642. return links
  9643. }
  9644. /***/ }),
  9645. /***/ 586:
  9646. /***/ (function(module, __unusedexports, __webpack_require__) {
  9647. module.exports = octokitRestApiEndpoints;
  9648. const ROUTES = __webpack_require__(705);
  9649. function octokitRestApiEndpoints(octokit) {
  9650. // Aliasing scopes for backward compatibility
  9651. // See https://github.com/octokit/rest.js/pull/1134
  9652. ROUTES.gitdata = ROUTES.git;
  9653. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9654. ROUTES.pullRequests = ROUTES.pulls;
  9655. octokit.registerEndpoints(ROUTES);
  9656. }
  9657. /***/ }),
  9658. /***/ 587:
  9659. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9660. "use strict";
  9661. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9662. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9663. return new (P || (P = Promise))(function (resolve, reject) {
  9664. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9665. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9666. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9667. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9668. });
  9669. };
  9670. var __importStar = (this && this.__importStar) || function (mod) {
  9671. if (mod && mod.__esModule) return mod;
  9672. var result = {};
  9673. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9674. result["default"] = mod;
  9675. return result;
  9676. };
  9677. Object.defineProperty(exports, "__esModule", { value: true });
  9678. const core = __importStar(__webpack_require__(470));
  9679. const defaultMaxAttempts = 3;
  9680. const defaultMinSeconds = 10;
  9681. const defaultMaxSeconds = 20;
  9682. class RetryHelper {
  9683. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9684. this.maxAttempts = maxAttempts;
  9685. this.minSeconds = Math.floor(minSeconds);
  9686. this.maxSeconds = Math.floor(maxSeconds);
  9687. if (this.minSeconds > this.maxSeconds) {
  9688. throw new Error('min seconds should be less than or equal to max seconds');
  9689. }
  9690. }
  9691. execute(action) {
  9692. return __awaiter(this, void 0, void 0, function* () {
  9693. let attempt = 1;
  9694. while (attempt < this.maxAttempts) {
  9695. // Try
  9696. try {
  9697. return yield action();
  9698. }
  9699. catch (err) {
  9700. core.info(err.message);
  9701. }
  9702. // Sleep
  9703. const seconds = this.getSleepAmount();
  9704. core.info(`Waiting ${seconds} seconds before trying again`);
  9705. yield this.sleep(seconds);
  9706. attempt++;
  9707. }
  9708. // Last attempt
  9709. return yield action();
  9710. });
  9711. }
  9712. getSleepAmount() {
  9713. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9714. this.minSeconds);
  9715. }
  9716. sleep(seconds) {
  9717. return __awaiter(this, void 0, void 0, function* () {
  9718. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9719. });
  9720. }
  9721. }
  9722. exports.RetryHelper = RetryHelper;
  9723. function execute(action) {
  9724. return __awaiter(this, void 0, void 0, function* () {
  9725. const retryHelper = new RetryHelper();
  9726. return yield retryHelper.execute(action);
  9727. });
  9728. }
  9729. exports.execute = execute;
  9730. /***/ }),
  9731. /***/ 605:
  9732. /***/ (function(module) {
  9733. module.exports = require("http");
  9734. /***/ }),
  9735. /***/ 614:
  9736. /***/ (function(module) {
  9737. module.exports = require("events");
  9738. /***/ }),
  9739. /***/ 618:
  9740. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9741. "use strict";
  9742. var __importStar = (this && this.__importStar) || function (mod) {
  9743. if (mod && mod.__esModule) return mod;
  9744. var result = {};
  9745. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9746. result["default"] = mod;
  9747. return result;
  9748. };
  9749. Object.defineProperty(exports, "__esModule", { value: true });
  9750. const fs = __importStar(__webpack_require__(747));
  9751. function directoryExistsSync(path, required) {
  9752. if (!path) {
  9753. throw new Error("Arg 'path' must not be empty");
  9754. }
  9755. let stats;
  9756. try {
  9757. stats = fs.statSync(path);
  9758. }
  9759. catch (error) {
  9760. if (error.code === 'ENOENT') {
  9761. if (!required) {
  9762. return false;
  9763. }
  9764. throw new Error(`Directory '${path}' does not exist`);
  9765. }
  9766. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9767. }
  9768. if (stats.isDirectory()) {
  9769. return true;
  9770. }
  9771. else if (!required) {
  9772. return false;
  9773. }
  9774. throw new Error(`Directory '${path}' does not exist`);
  9775. }
  9776. exports.directoryExistsSync = directoryExistsSync;
  9777. function existsSync(path) {
  9778. if (!path) {
  9779. throw new Error("Arg 'path' must not be empty");
  9780. }
  9781. try {
  9782. fs.statSync(path);
  9783. }
  9784. catch (error) {
  9785. if (error.code === 'ENOENT') {
  9786. return false;
  9787. }
  9788. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9789. }
  9790. return true;
  9791. }
  9792. exports.existsSync = existsSync;
  9793. function fileExistsSync(path) {
  9794. if (!path) {
  9795. throw new Error("Arg 'path' must not be empty");
  9796. }
  9797. let stats;
  9798. try {
  9799. stats = fs.statSync(path);
  9800. }
  9801. catch (error) {
  9802. if (error.code === 'ENOENT') {
  9803. return false;
  9804. }
  9805. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9806. }
  9807. if (!stats.isDirectory()) {
  9808. return true;
  9809. }
  9810. return false;
  9811. }
  9812. exports.fileExistsSync = fileExistsSync;
  9813. /***/ }),
  9814. /***/ 621:
  9815. /***/ (function(module, __unusedexports, __webpack_require__) {
  9816. "use strict";
  9817. const path = __webpack_require__(622);
  9818. const pathKey = __webpack_require__(39);
  9819. module.exports = opts => {
  9820. opts = Object.assign({
  9821. cwd: process.cwd(),
  9822. path: process.env[pathKey()]
  9823. }, opts);
  9824. let prev;
  9825. let pth = path.resolve(opts.cwd);
  9826. const ret = [];
  9827. while (prev !== pth) {
  9828. ret.push(path.join(pth, 'node_modules/.bin'));
  9829. prev = pth;
  9830. pth = path.resolve(pth, '..');
  9831. }
  9832. // ensure the running `node` binary is used
  9833. ret.push(path.dirname(process.execPath));
  9834. return ret.concat(opts.path).join(path.delimiter);
  9835. };
  9836. module.exports.env = opts => {
  9837. opts = Object.assign({
  9838. env: process.env
  9839. }, opts);
  9840. const env = Object.assign({}, opts.env);
  9841. const path = pathKey({env});
  9842. opts.path = env[path];
  9843. env[path] = module.exports(opts);
  9844. return env;
  9845. };
  9846. /***/ }),
  9847. /***/ 622:
  9848. /***/ (function(module) {
  9849. module.exports = require("path");
  9850. /***/ }),
  9851. /***/ 631:
  9852. /***/ (function(module) {
  9853. module.exports = require("net");
  9854. /***/ }),
  9855. /***/ 649:
  9856. /***/ (function(module, __unusedexports, __webpack_require__) {
  9857. module.exports = getLastPage
  9858. const getPage = __webpack_require__(265)
  9859. function getLastPage (octokit, link, headers) {
  9860. return getPage(octokit, link, 'last', headers)
  9861. }
  9862. /***/ }),
  9863. /***/ 654:
  9864. /***/ (function(module) {
  9865. // This is not the set of all possible signals.
  9866. //
  9867. // It IS, however, the set of all signals that trigger
  9868. // an exit on either Linux or BSD systems. Linux is a
  9869. // superset of the signal names supported on BSD, and
  9870. // the unknown signals just fail to register, so we can
  9871. // catch that easily enough.
  9872. //
  9873. // Don't bother with SIGKILL. It's uncatchable, which
  9874. // means that we can't fire any callbacks anyway.
  9875. //
  9876. // If a user does happen to register a handler on a non-
  9877. // fatal signal like SIGWINCH or something, and then
  9878. // exit, it'll end up firing `process.emit('exit')`, so
  9879. // the handler will be fired anyway.
  9880. //
  9881. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9882. // artificially, inherently leave the process in a
  9883. // state from which it is not safe to try and enter JS
  9884. // listeners.
  9885. module.exports = [
  9886. 'SIGABRT',
  9887. 'SIGALRM',
  9888. 'SIGHUP',
  9889. 'SIGINT',
  9890. 'SIGTERM'
  9891. ]
  9892. if (process.platform !== 'win32') {
  9893. module.exports.push(
  9894. 'SIGVTALRM',
  9895. 'SIGXCPU',
  9896. 'SIGXFSZ',
  9897. 'SIGUSR2',
  9898. 'SIGTRAP',
  9899. 'SIGSYS',
  9900. 'SIGQUIT',
  9901. 'SIGIOT'
  9902. // should detect profiler and enable/disable accordingly.
  9903. // see #21
  9904. // 'SIGPROF'
  9905. )
  9906. }
  9907. if (process.platform === 'linux') {
  9908. module.exports.push(
  9909. 'SIGIO',
  9910. 'SIGPOLL',
  9911. 'SIGPWR',
  9912. 'SIGSTKFLT',
  9913. 'SIGUNUSED'
  9914. )
  9915. }
  9916. /***/ }),
  9917. /***/ 656:
  9918. /***/ (function(module, exports) {
  9919. exports = module.exports = SemVer
  9920. var debug
  9921. /* istanbul ignore next */
  9922. if (typeof process === 'object' &&
  9923. process.env &&
  9924. process.env.NODE_DEBUG &&
  9925. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9926. debug = function () {
  9927. var args = Array.prototype.slice.call(arguments, 0)
  9928. args.unshift('SEMVER')
  9929. console.log.apply(console, args)
  9930. }
  9931. } else {
  9932. debug = function () {}
  9933. }
  9934. // Note: this is the semver.org version of the spec that it implements
  9935. // Not necessarily the package version of this code.
  9936. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9937. var MAX_LENGTH = 256
  9938. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9939. /* istanbul ignore next */ 9007199254740991
  9940. // Max safe segment length for coercion.
  9941. var MAX_SAFE_COMPONENT_LENGTH = 16
  9942. // The actual regexps go on exports.re
  9943. var re = exports.re = []
  9944. var src = exports.src = []
  9945. var t = exports.tokens = {}
  9946. var R = 0
  9947. function tok (n) {
  9948. t[n] = R++
  9949. }
  9950. // The following Regular Expressions can be used for tokenizing,
  9951. // validating, and parsing SemVer version strings.
  9952. // ## Numeric Identifier
  9953. // A single `0`, or a non-zero digit followed by zero or more digits.
  9954. tok('NUMERICIDENTIFIER')
  9955. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9956. tok('NUMERICIDENTIFIERLOOSE')
  9957. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9958. // ## Non-numeric Identifier
  9959. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9960. // more letters, digits, or hyphens.
  9961. tok('NONNUMERICIDENTIFIER')
  9962. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9963. // ## Main Version
  9964. // Three dot-separated numeric identifiers.
  9965. tok('MAINVERSION')
  9966. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9967. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9968. '(' + src[t.NUMERICIDENTIFIER] + ')'
  9969. tok('MAINVERSIONLOOSE')
  9970. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9971. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9972. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  9973. // ## Pre-release Version Identifier
  9974. // A numeric identifier, or a non-numeric identifier.
  9975. tok('PRERELEASEIDENTIFIER')
  9976. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  9977. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9978. tok('PRERELEASEIDENTIFIERLOOSE')
  9979. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  9980. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9981. // ## Pre-release Version
  9982. // Hyphen, followed by one or more dot-separated pre-release version
  9983. // identifiers.
  9984. tok('PRERELEASE')
  9985. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  9986. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  9987. tok('PRERELEASELOOSE')
  9988. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  9989. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  9990. // ## Build Metadata Identifier
  9991. // Any combination of digits, letters, or hyphens.
  9992. tok('BUILDIDENTIFIER')
  9993. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  9994. // ## Build Metadata
  9995. // Plus sign, followed by one or more period-separated build metadata
  9996. // identifiers.
  9997. tok('BUILD')
  9998. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  9999. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  10000. // ## Full Version String
  10001. // A main version, followed optionally by a pre-release version and
  10002. // build metadata.
  10003. // Note that the only major, minor, patch, and pre-release sections of
  10004. // the version string are capturing groups. The build metadata is not a
  10005. // capturing group, because it should not ever be used in version
  10006. // comparison.
  10007. tok('FULL')
  10008. tok('FULLPLAIN')
  10009. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  10010. src[t.PRERELEASE] + '?' +
  10011. src[t.BUILD] + '?'
  10012. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  10013. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10014. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10015. // common in the npm registry.
  10016. tok('LOOSEPLAIN')
  10017. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10018. src[t.PRERELEASELOOSE] + '?' +
  10019. src[t.BUILD] + '?'
  10020. tok('LOOSE')
  10021. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10022. tok('GTLT')
  10023. src[t.GTLT] = '((?:<|>)?=?)'
  10024. // Something like "2.*" or "1.2.x".
  10025. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10026. // Only the first item is strictly required.
  10027. tok('XRANGEIDENTIFIERLOOSE')
  10028. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10029. tok('XRANGEIDENTIFIER')
  10030. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10031. tok('XRANGEPLAIN')
  10032. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10033. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10034. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10035. '(?:' + src[t.PRERELEASE] + ')?' +
  10036. src[t.BUILD] + '?' +
  10037. ')?)?'
  10038. tok('XRANGEPLAINLOOSE')
  10039. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10040. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10041. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10042. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10043. src[t.BUILD] + '?' +
  10044. ')?)?'
  10045. tok('XRANGE')
  10046. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10047. tok('XRANGELOOSE')
  10048. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10049. // Coercion.
  10050. // Extract anything that could conceivably be a part of a valid semver
  10051. tok('COERCE')
  10052. src[t.COERCE] = '(^|[^\\d])' +
  10053. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10054. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10055. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10056. '(?:$|[^\\d])'
  10057. tok('COERCERTL')
  10058. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10059. // Tilde ranges.
  10060. // Meaning is "reasonably at or greater than"
  10061. tok('LONETILDE')
  10062. src[t.LONETILDE] = '(?:~>?)'
  10063. tok('TILDETRIM')
  10064. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10065. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10066. var tildeTrimReplace = '$1~'
  10067. tok('TILDE')
  10068. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10069. tok('TILDELOOSE')
  10070. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10071. // Caret ranges.
  10072. // Meaning is "at least and backwards compatible with"
  10073. tok('LONECARET')
  10074. src[t.LONECARET] = '(?:\\^)'
  10075. tok('CARETTRIM')
  10076. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10077. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10078. var caretTrimReplace = '$1^'
  10079. tok('CARET')
  10080. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10081. tok('CARETLOOSE')
  10082. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10083. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10084. tok('COMPARATORLOOSE')
  10085. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10086. tok('COMPARATOR')
  10087. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10088. // An expression to strip any whitespace between the gtlt and the thing
  10089. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10090. tok('COMPARATORTRIM')
  10091. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10092. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10093. // this one has to use the /g flag
  10094. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10095. var comparatorTrimReplace = '$1$2$3'
  10096. // Something like `1.2.3 - 1.2.4`
  10097. // Note that these all use the loose form, because they'll be
  10098. // checked against either the strict or loose comparator form
  10099. // later.
  10100. tok('HYPHENRANGE')
  10101. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10102. '\\s+-\\s+' +
  10103. '(' + src[t.XRANGEPLAIN] + ')' +
  10104. '\\s*$'
  10105. tok('HYPHENRANGELOOSE')
  10106. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10107. '\\s+-\\s+' +
  10108. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10109. '\\s*$'
  10110. // Star ranges basically just allow anything at all.
  10111. tok('STAR')
  10112. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10113. // Compile to actual regexp objects.
  10114. // All are flag-free, unless they were created above with a flag.
  10115. for (var i = 0; i < R; i++) {
  10116. debug(i, src[i])
  10117. if (!re[i]) {
  10118. re[i] = new RegExp(src[i])
  10119. }
  10120. }
  10121. exports.parse = parse
  10122. function parse (version, options) {
  10123. if (!options || typeof options !== 'object') {
  10124. options = {
  10125. loose: !!options,
  10126. includePrerelease: false
  10127. }
  10128. }
  10129. if (version instanceof SemVer) {
  10130. return version
  10131. }
  10132. if (typeof version !== 'string') {
  10133. return null
  10134. }
  10135. if (version.length > MAX_LENGTH) {
  10136. return null
  10137. }
  10138. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10139. if (!r.test(version)) {
  10140. return null
  10141. }
  10142. try {
  10143. return new SemVer(version, options)
  10144. } catch (er) {
  10145. return null
  10146. }
  10147. }
  10148. exports.valid = valid
  10149. function valid (version, options) {
  10150. var v = parse(version, options)
  10151. return v ? v.version : null
  10152. }
  10153. exports.clean = clean
  10154. function clean (version, options) {
  10155. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10156. return s ? s.version : null
  10157. }
  10158. exports.SemVer = SemVer
  10159. function SemVer (version, options) {
  10160. if (!options || typeof options !== 'object') {
  10161. options = {
  10162. loose: !!options,
  10163. includePrerelease: false
  10164. }
  10165. }
  10166. if (version instanceof SemVer) {
  10167. if (version.loose === options.loose) {
  10168. return version
  10169. } else {
  10170. version = version.version
  10171. }
  10172. } else if (typeof version !== 'string') {
  10173. throw new TypeError('Invalid Version: ' + version)
  10174. }
  10175. if (version.length > MAX_LENGTH) {
  10176. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10177. }
  10178. if (!(this instanceof SemVer)) {
  10179. return new SemVer(version, options)
  10180. }
  10181. debug('SemVer', version, options)
  10182. this.options = options
  10183. this.loose = !!options.loose
  10184. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10185. if (!m) {
  10186. throw new TypeError('Invalid Version: ' + version)
  10187. }
  10188. this.raw = version
  10189. // these are actually numbers
  10190. this.major = +m[1]
  10191. this.minor = +m[2]
  10192. this.patch = +m[3]
  10193. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10194. throw new TypeError('Invalid major version')
  10195. }
  10196. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10197. throw new TypeError('Invalid minor version')
  10198. }
  10199. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10200. throw new TypeError('Invalid patch version')
  10201. }
  10202. // numberify any prerelease numeric ids
  10203. if (!m[4]) {
  10204. this.prerelease = []
  10205. } else {
  10206. this.prerelease = m[4].split('.').map(function (id) {
  10207. if (/^[0-9]+$/.test(id)) {
  10208. var num = +id
  10209. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10210. return num
  10211. }
  10212. }
  10213. return id
  10214. })
  10215. }
  10216. this.build = m[5] ? m[5].split('.') : []
  10217. this.format()
  10218. }
  10219. SemVer.prototype.format = function () {
  10220. this.version = this.major + '.' + this.minor + '.' + this.patch
  10221. if (this.prerelease.length) {
  10222. this.version += '-' + this.prerelease.join('.')
  10223. }
  10224. return this.version
  10225. }
  10226. SemVer.prototype.toString = function () {
  10227. return this.version
  10228. }
  10229. SemVer.prototype.compare = function (other) {
  10230. debug('SemVer.compare', this.version, this.options, other)
  10231. if (!(other instanceof SemVer)) {
  10232. other = new SemVer(other, this.options)
  10233. }
  10234. return this.compareMain(other) || this.comparePre(other)
  10235. }
  10236. SemVer.prototype.compareMain = function (other) {
  10237. if (!(other instanceof SemVer)) {
  10238. other = new SemVer(other, this.options)
  10239. }
  10240. return compareIdentifiers(this.major, other.major) ||
  10241. compareIdentifiers(this.minor, other.minor) ||
  10242. compareIdentifiers(this.patch, other.patch)
  10243. }
  10244. SemVer.prototype.comparePre = function (other) {
  10245. if (!(other instanceof SemVer)) {
  10246. other = new SemVer(other, this.options)
  10247. }
  10248. // NOT having a prerelease is > having one
  10249. if (this.prerelease.length && !other.prerelease.length) {
  10250. return -1
  10251. } else if (!this.prerelease.length && other.prerelease.length) {
  10252. return 1
  10253. } else if (!this.prerelease.length && !other.prerelease.length) {
  10254. return 0
  10255. }
  10256. var i = 0
  10257. do {
  10258. var a = this.prerelease[i]
  10259. var b = other.prerelease[i]
  10260. debug('prerelease compare', i, a, b)
  10261. if (a === undefined && b === undefined) {
  10262. return 0
  10263. } else if (b === undefined) {
  10264. return 1
  10265. } else if (a === undefined) {
  10266. return -1
  10267. } else if (a === b) {
  10268. continue
  10269. } else {
  10270. return compareIdentifiers(a, b)
  10271. }
  10272. } while (++i)
  10273. }
  10274. SemVer.prototype.compareBuild = function (other) {
  10275. if (!(other instanceof SemVer)) {
  10276. other = new SemVer(other, this.options)
  10277. }
  10278. var i = 0
  10279. do {
  10280. var a = this.build[i]
  10281. var b = other.build[i]
  10282. debug('prerelease compare', i, a, b)
  10283. if (a === undefined && b === undefined) {
  10284. return 0
  10285. } else if (b === undefined) {
  10286. return 1
  10287. } else if (a === undefined) {
  10288. return -1
  10289. } else if (a === b) {
  10290. continue
  10291. } else {
  10292. return compareIdentifiers(a, b)
  10293. }
  10294. } while (++i)
  10295. }
  10296. // preminor will bump the version up to the next minor release, and immediately
  10297. // down to pre-release. premajor and prepatch work the same way.
  10298. SemVer.prototype.inc = function (release, identifier) {
  10299. switch (release) {
  10300. case 'premajor':
  10301. this.prerelease.length = 0
  10302. this.patch = 0
  10303. this.minor = 0
  10304. this.major++
  10305. this.inc('pre', identifier)
  10306. break
  10307. case 'preminor':
  10308. this.prerelease.length = 0
  10309. this.patch = 0
  10310. this.minor++
  10311. this.inc('pre', identifier)
  10312. break
  10313. case 'prepatch':
  10314. // If this is already a prerelease, it will bump to the next version
  10315. // drop any prereleases that might already exist, since they are not
  10316. // relevant at this point.
  10317. this.prerelease.length = 0
  10318. this.inc('patch', identifier)
  10319. this.inc('pre', identifier)
  10320. break
  10321. // If the input is a non-prerelease version, this acts the same as
  10322. // prepatch.
  10323. case 'prerelease':
  10324. if (this.prerelease.length === 0) {
  10325. this.inc('patch', identifier)
  10326. }
  10327. this.inc('pre', identifier)
  10328. break
  10329. case 'major':
  10330. // If this is a pre-major version, bump up to the same major version.
  10331. // Otherwise increment major.
  10332. // 1.0.0-5 bumps to 1.0.0
  10333. // 1.1.0 bumps to 2.0.0
  10334. if (this.minor !== 0 ||
  10335. this.patch !== 0 ||
  10336. this.prerelease.length === 0) {
  10337. this.major++
  10338. }
  10339. this.minor = 0
  10340. this.patch = 0
  10341. this.prerelease = []
  10342. break
  10343. case 'minor':
  10344. // If this is a pre-minor version, bump up to the same minor version.
  10345. // Otherwise increment minor.
  10346. // 1.2.0-5 bumps to 1.2.0
  10347. // 1.2.1 bumps to 1.3.0
  10348. if (this.patch !== 0 || this.prerelease.length === 0) {
  10349. this.minor++
  10350. }
  10351. this.patch = 0
  10352. this.prerelease = []
  10353. break
  10354. case 'patch':
  10355. // If this is not a pre-release version, it will increment the patch.
  10356. // If it is a pre-release it will bump up to the same patch version.
  10357. // 1.2.0-5 patches to 1.2.0
  10358. // 1.2.0 patches to 1.2.1
  10359. if (this.prerelease.length === 0) {
  10360. this.patch++
  10361. }
  10362. this.prerelease = []
  10363. break
  10364. // This probably shouldn't be used publicly.
  10365. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10366. case 'pre':
  10367. if (this.prerelease.length === 0) {
  10368. this.prerelease = [0]
  10369. } else {
  10370. var i = this.prerelease.length
  10371. while (--i >= 0) {
  10372. if (typeof this.prerelease[i] === 'number') {
  10373. this.prerelease[i]++
  10374. i = -2
  10375. }
  10376. }
  10377. if (i === -1) {
  10378. // didn't increment anything
  10379. this.prerelease.push(0)
  10380. }
  10381. }
  10382. if (identifier) {
  10383. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10384. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10385. if (this.prerelease[0] === identifier) {
  10386. if (isNaN(this.prerelease[1])) {
  10387. this.prerelease = [identifier, 0]
  10388. }
  10389. } else {
  10390. this.prerelease = [identifier, 0]
  10391. }
  10392. }
  10393. break
  10394. default:
  10395. throw new Error('invalid increment argument: ' + release)
  10396. }
  10397. this.format()
  10398. this.raw = this.version
  10399. return this
  10400. }
  10401. exports.inc = inc
  10402. function inc (version, release, loose, identifier) {
  10403. if (typeof (loose) === 'string') {
  10404. identifier = loose
  10405. loose = undefined
  10406. }
  10407. try {
  10408. return new SemVer(version, loose).inc(release, identifier).version
  10409. } catch (er) {
  10410. return null
  10411. }
  10412. }
  10413. exports.diff = diff
  10414. function diff (version1, version2) {
  10415. if (eq(version1, version2)) {
  10416. return null
  10417. } else {
  10418. var v1 = parse(version1)
  10419. var v2 = parse(version2)
  10420. var prefix = ''
  10421. if (v1.prerelease.length || v2.prerelease.length) {
  10422. prefix = 'pre'
  10423. var defaultResult = 'prerelease'
  10424. }
  10425. for (var key in v1) {
  10426. if (key === 'major' || key === 'minor' || key === 'patch') {
  10427. if (v1[key] !== v2[key]) {
  10428. return prefix + key
  10429. }
  10430. }
  10431. }
  10432. return defaultResult // may be undefined
  10433. }
  10434. }
  10435. exports.compareIdentifiers = compareIdentifiers
  10436. var numeric = /^[0-9]+$/
  10437. function compareIdentifiers (a, b) {
  10438. var anum = numeric.test(a)
  10439. var bnum = numeric.test(b)
  10440. if (anum && bnum) {
  10441. a = +a
  10442. b = +b
  10443. }
  10444. return a === b ? 0
  10445. : (anum && !bnum) ? -1
  10446. : (bnum && !anum) ? 1
  10447. : a < b ? -1
  10448. : 1
  10449. }
  10450. exports.rcompareIdentifiers = rcompareIdentifiers
  10451. function rcompareIdentifiers (a, b) {
  10452. return compareIdentifiers(b, a)
  10453. }
  10454. exports.major = major
  10455. function major (a, loose) {
  10456. return new SemVer(a, loose).major
  10457. }
  10458. exports.minor = minor
  10459. function minor (a, loose) {
  10460. return new SemVer(a, loose).minor
  10461. }
  10462. exports.patch = patch
  10463. function patch (a, loose) {
  10464. return new SemVer(a, loose).patch
  10465. }
  10466. exports.compare = compare
  10467. function compare (a, b, loose) {
  10468. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10469. }
  10470. exports.compareLoose = compareLoose
  10471. function compareLoose (a, b) {
  10472. return compare(a, b, true)
  10473. }
  10474. exports.compareBuild = compareBuild
  10475. function compareBuild (a, b, loose) {
  10476. var versionA = new SemVer(a, loose)
  10477. var versionB = new SemVer(b, loose)
  10478. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10479. }
  10480. exports.rcompare = rcompare
  10481. function rcompare (a, b, loose) {
  10482. return compare(b, a, loose)
  10483. }
  10484. exports.sort = sort
  10485. function sort (list, loose) {
  10486. return list.sort(function (a, b) {
  10487. return exports.compareBuild(a, b, loose)
  10488. })
  10489. }
  10490. exports.rsort = rsort
  10491. function rsort (list, loose) {
  10492. return list.sort(function (a, b) {
  10493. return exports.compareBuild(b, a, loose)
  10494. })
  10495. }
  10496. exports.gt = gt
  10497. function gt (a, b, loose) {
  10498. return compare(a, b, loose) > 0
  10499. }
  10500. exports.lt = lt
  10501. function lt (a, b, loose) {
  10502. return compare(a, b, loose) < 0
  10503. }
  10504. exports.eq = eq
  10505. function eq (a, b, loose) {
  10506. return compare(a, b, loose) === 0
  10507. }
  10508. exports.neq = neq
  10509. function neq (a, b, loose) {
  10510. return compare(a, b, loose) !== 0
  10511. }
  10512. exports.gte = gte
  10513. function gte (a, b, loose) {
  10514. return compare(a, b, loose) >= 0
  10515. }
  10516. exports.lte = lte
  10517. function lte (a, b, loose) {
  10518. return compare(a, b, loose) <= 0
  10519. }
  10520. exports.cmp = cmp
  10521. function cmp (a, op, b, loose) {
  10522. switch (op) {
  10523. case '===':
  10524. if (typeof a === 'object')
  10525. a = a.version
  10526. if (typeof b === 'object')
  10527. b = b.version
  10528. return a === b
  10529. case '!==':
  10530. if (typeof a === 'object')
  10531. a = a.version
  10532. if (typeof b === 'object')
  10533. b = b.version
  10534. return a !== b
  10535. case '':
  10536. case '=':
  10537. case '==':
  10538. return eq(a, b, loose)
  10539. case '!=':
  10540. return neq(a, b, loose)
  10541. case '>':
  10542. return gt(a, b, loose)
  10543. case '>=':
  10544. return gte(a, b, loose)
  10545. case '<':
  10546. return lt(a, b, loose)
  10547. case '<=':
  10548. return lte(a, b, loose)
  10549. default:
  10550. throw new TypeError('Invalid operator: ' + op)
  10551. }
  10552. }
  10553. exports.Comparator = Comparator
  10554. function Comparator (comp, options) {
  10555. if (!options || typeof options !== 'object') {
  10556. options = {
  10557. loose: !!options,
  10558. includePrerelease: false
  10559. }
  10560. }
  10561. if (comp instanceof Comparator) {
  10562. if (comp.loose === !!options.loose) {
  10563. return comp
  10564. } else {
  10565. comp = comp.value
  10566. }
  10567. }
  10568. if (!(this instanceof Comparator)) {
  10569. return new Comparator(comp, options)
  10570. }
  10571. debug('comparator', comp, options)
  10572. this.options = options
  10573. this.loose = !!options.loose
  10574. this.parse(comp)
  10575. if (this.semver === ANY) {
  10576. this.value = ''
  10577. } else {
  10578. this.value = this.operator + this.semver.version
  10579. }
  10580. debug('comp', this)
  10581. }
  10582. var ANY = {}
  10583. Comparator.prototype.parse = function (comp) {
  10584. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10585. var m = comp.match(r)
  10586. if (!m) {
  10587. throw new TypeError('Invalid comparator: ' + comp)
  10588. }
  10589. this.operator = m[1] !== undefined ? m[1] : ''
  10590. if (this.operator === '=') {
  10591. this.operator = ''
  10592. }
  10593. // if it literally is just '>' or '' then allow anything.
  10594. if (!m[2]) {
  10595. this.semver = ANY
  10596. } else {
  10597. this.semver = new SemVer(m[2], this.options.loose)
  10598. }
  10599. }
  10600. Comparator.prototype.toString = function () {
  10601. return this.value
  10602. }
  10603. Comparator.prototype.test = function (version) {
  10604. debug('Comparator.test', version, this.options.loose)
  10605. if (this.semver === ANY || version === ANY) {
  10606. return true
  10607. }
  10608. if (typeof version === 'string') {
  10609. try {
  10610. version = new SemVer(version, this.options)
  10611. } catch (er) {
  10612. return false
  10613. }
  10614. }
  10615. return cmp(version, this.operator, this.semver, this.options)
  10616. }
  10617. Comparator.prototype.intersects = function (comp, options) {
  10618. if (!(comp instanceof Comparator)) {
  10619. throw new TypeError('a Comparator is required')
  10620. }
  10621. if (!options || typeof options !== 'object') {
  10622. options = {
  10623. loose: !!options,
  10624. includePrerelease: false
  10625. }
  10626. }
  10627. var rangeTmp
  10628. if (this.operator === '') {
  10629. if (this.value === '') {
  10630. return true
  10631. }
  10632. rangeTmp = new Range(comp.value, options)
  10633. return satisfies(this.value, rangeTmp, options)
  10634. } else if (comp.operator === '') {
  10635. if (comp.value === '') {
  10636. return true
  10637. }
  10638. rangeTmp = new Range(this.value, options)
  10639. return satisfies(comp.semver, rangeTmp, options)
  10640. }
  10641. var sameDirectionIncreasing =
  10642. (this.operator === '>=' || this.operator === '>') &&
  10643. (comp.operator === '>=' || comp.operator === '>')
  10644. var sameDirectionDecreasing =
  10645. (this.operator === '<=' || this.operator === '<') &&
  10646. (comp.operator === '<=' || comp.operator === '<')
  10647. var sameSemVer = this.semver.version === comp.semver.version
  10648. var differentDirectionsInclusive =
  10649. (this.operator === '>=' || this.operator === '<=') &&
  10650. (comp.operator === '>=' || comp.operator === '<=')
  10651. var oppositeDirectionsLessThan =
  10652. cmp(this.semver, '<', comp.semver, options) &&
  10653. ((this.operator === '>=' || this.operator === '>') &&
  10654. (comp.operator === '<=' || comp.operator === '<'))
  10655. var oppositeDirectionsGreaterThan =
  10656. cmp(this.semver, '>', comp.semver, options) &&
  10657. ((this.operator === '<=' || this.operator === '<') &&
  10658. (comp.operator === '>=' || comp.operator === '>'))
  10659. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10660. (sameSemVer && differentDirectionsInclusive) ||
  10661. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10662. }
  10663. exports.Range = Range
  10664. function Range (range, options) {
  10665. if (!options || typeof options !== 'object') {
  10666. options = {
  10667. loose: !!options,
  10668. includePrerelease: false
  10669. }
  10670. }
  10671. if (range instanceof Range) {
  10672. if (range.loose === !!options.loose &&
  10673. range.includePrerelease === !!options.includePrerelease) {
  10674. return range
  10675. } else {
  10676. return new Range(range.raw, options)
  10677. }
  10678. }
  10679. if (range instanceof Comparator) {
  10680. return new Range(range.value, options)
  10681. }
  10682. if (!(this instanceof Range)) {
  10683. return new Range(range, options)
  10684. }
  10685. this.options = options
  10686. this.loose = !!options.loose
  10687. this.includePrerelease = !!options.includePrerelease
  10688. // First, split based on boolean or ||
  10689. this.raw = range
  10690. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10691. return this.parseRange(range.trim())
  10692. }, this).filter(function (c) {
  10693. // throw out any that are not relevant for whatever reason
  10694. return c.length
  10695. })
  10696. if (!this.set.length) {
  10697. throw new TypeError('Invalid SemVer Range: ' + range)
  10698. }
  10699. this.format()
  10700. }
  10701. Range.prototype.format = function () {
  10702. this.range = this.set.map(function (comps) {
  10703. return comps.join(' ').trim()
  10704. }).join('||').trim()
  10705. return this.range
  10706. }
  10707. Range.prototype.toString = function () {
  10708. return this.range
  10709. }
  10710. Range.prototype.parseRange = function (range) {
  10711. var loose = this.options.loose
  10712. range = range.trim()
  10713. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10714. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10715. range = range.replace(hr, hyphenReplace)
  10716. debug('hyphen replace', range)
  10717. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10718. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10719. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10720. // `~ 1.2.3` => `~1.2.3`
  10721. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10722. // `^ 1.2.3` => `^1.2.3`
  10723. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10724. // normalize spaces
  10725. range = range.split(/\s+/).join(' ')
  10726. // At this point, the range is completely trimmed and
  10727. // ready to be split into comparators.
  10728. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10729. var set = range.split(' ').map(function (comp) {
  10730. return parseComparator(comp, this.options)
  10731. }, this).join(' ').split(/\s+/)
  10732. if (this.options.loose) {
  10733. // in loose mode, throw out any that are not valid comparators
  10734. set = set.filter(function (comp) {
  10735. return !!comp.match(compRe)
  10736. })
  10737. }
  10738. set = set.map(function (comp) {
  10739. return new Comparator(comp, this.options)
  10740. }, this)
  10741. return set
  10742. }
  10743. Range.prototype.intersects = function (range, options) {
  10744. if (!(range instanceof Range)) {
  10745. throw new TypeError('a Range is required')
  10746. }
  10747. return this.set.some(function (thisComparators) {
  10748. return (
  10749. isSatisfiable(thisComparators, options) &&
  10750. range.set.some(function (rangeComparators) {
  10751. return (
  10752. isSatisfiable(rangeComparators, options) &&
  10753. thisComparators.every(function (thisComparator) {
  10754. return rangeComparators.every(function (rangeComparator) {
  10755. return thisComparator.intersects(rangeComparator, options)
  10756. })
  10757. })
  10758. )
  10759. })
  10760. )
  10761. })
  10762. }
  10763. // take a set of comparators and determine whether there
  10764. // exists a version which can satisfy it
  10765. function isSatisfiable (comparators, options) {
  10766. var result = true
  10767. var remainingComparators = comparators.slice()
  10768. var testComparator = remainingComparators.pop()
  10769. while (result && remainingComparators.length) {
  10770. result = remainingComparators.every(function (otherComparator) {
  10771. return testComparator.intersects(otherComparator, options)
  10772. })
  10773. testComparator = remainingComparators.pop()
  10774. }
  10775. return result
  10776. }
  10777. // Mostly just for testing and legacy API reasons
  10778. exports.toComparators = toComparators
  10779. function toComparators (range, options) {
  10780. return new Range(range, options).set.map(function (comp) {
  10781. return comp.map(function (c) {
  10782. return c.value
  10783. }).join(' ').trim().split(' ')
  10784. })
  10785. }
  10786. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10787. // already replaced the hyphen ranges
  10788. // turn into a set of JUST comparators.
  10789. function parseComparator (comp, options) {
  10790. debug('comp', comp, options)
  10791. comp = replaceCarets(comp, options)
  10792. debug('caret', comp)
  10793. comp = replaceTildes(comp, options)
  10794. debug('tildes', comp)
  10795. comp = replaceXRanges(comp, options)
  10796. debug('xrange', comp)
  10797. comp = replaceStars(comp, options)
  10798. debug('stars', comp)
  10799. return comp
  10800. }
  10801. function isX (id) {
  10802. return !id || id.toLowerCase() === 'x' || id === '*'
  10803. }
  10804. // ~, ~> --> * (any, kinda silly)
  10805. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10806. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10807. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10808. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10809. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10810. function replaceTildes (comp, options) {
  10811. return comp.trim().split(/\s+/).map(function (comp) {
  10812. return replaceTilde(comp, options)
  10813. }).join(' ')
  10814. }
  10815. function replaceTilde (comp, options) {
  10816. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10817. return comp.replace(r, function (_, M, m, p, pr) {
  10818. debug('tilde', comp, _, M, m, p, pr)
  10819. var ret
  10820. if (isX(M)) {
  10821. ret = ''
  10822. } else if (isX(m)) {
  10823. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10824. } else if (isX(p)) {
  10825. // ~1.2 == >=1.2.0 <1.3.0
  10826. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10827. } else if (pr) {
  10828. debug('replaceTilde pr', pr)
  10829. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10830. ' <' + M + '.' + (+m + 1) + '.0'
  10831. } else {
  10832. // ~1.2.3 == >=1.2.3 <1.3.0
  10833. ret = '>=' + M + '.' + m + '.' + p +
  10834. ' <' + M + '.' + (+m + 1) + '.0'
  10835. }
  10836. debug('tilde return', ret)
  10837. return ret
  10838. })
  10839. }
  10840. // ^ --> * (any, kinda silly)
  10841. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10842. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10843. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10844. // ^1.2.3 --> >=1.2.3 <2.0.0
  10845. // ^1.2.0 --> >=1.2.0 <2.0.0
  10846. function replaceCarets (comp, options) {
  10847. return comp.trim().split(/\s+/).map(function (comp) {
  10848. return replaceCaret(comp, options)
  10849. }).join(' ')
  10850. }
  10851. function replaceCaret (comp, options) {
  10852. debug('caret', comp, options)
  10853. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10854. return comp.replace(r, function (_, M, m, p, pr) {
  10855. debug('caret', comp, _, M, m, p, pr)
  10856. var ret
  10857. if (isX(M)) {
  10858. ret = ''
  10859. } else if (isX(m)) {
  10860. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10861. } else if (isX(p)) {
  10862. if (M === '0') {
  10863. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10864. } else {
  10865. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10866. }
  10867. } else if (pr) {
  10868. debug('replaceCaret pr', pr)
  10869. if (M === '0') {
  10870. if (m === '0') {
  10871. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10872. ' <' + M + '.' + m + '.' + (+p + 1)
  10873. } else {
  10874. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10875. ' <' + M + '.' + (+m + 1) + '.0'
  10876. }
  10877. } else {
  10878. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10879. ' <' + (+M + 1) + '.0.0'
  10880. }
  10881. } else {
  10882. debug('no pr')
  10883. if (M === '0') {
  10884. if (m === '0') {
  10885. ret = '>=' + M + '.' + m + '.' + p +
  10886. ' <' + M + '.' + m + '.' + (+p + 1)
  10887. } else {
  10888. ret = '>=' + M + '.' + m + '.' + p +
  10889. ' <' + M + '.' + (+m + 1) + '.0'
  10890. }
  10891. } else {
  10892. ret = '>=' + M + '.' + m + '.' + p +
  10893. ' <' + (+M + 1) + '.0.0'
  10894. }
  10895. }
  10896. debug('caret return', ret)
  10897. return ret
  10898. })
  10899. }
  10900. function replaceXRanges (comp, options) {
  10901. debug('replaceXRanges', comp, options)
  10902. return comp.split(/\s+/).map(function (comp) {
  10903. return replaceXRange(comp, options)
  10904. }).join(' ')
  10905. }
  10906. function replaceXRange (comp, options) {
  10907. comp = comp.trim()
  10908. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10909. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10910. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10911. var xM = isX(M)
  10912. var xm = xM || isX(m)
  10913. var xp = xm || isX(p)
  10914. var anyX = xp
  10915. if (gtlt === '=' && anyX) {
  10916. gtlt = ''
  10917. }
  10918. // if we're including prereleases in the match, then we need
  10919. // to fix this to -0, the lowest possible prerelease value
  10920. pr = options.includePrerelease ? '-0' : ''
  10921. if (xM) {
  10922. if (gtlt === '>' || gtlt === '<') {
  10923. // nothing is allowed
  10924. ret = '<0.0.0-0'
  10925. } else {
  10926. // nothing is forbidden
  10927. ret = '*'
  10928. }
  10929. } else if (gtlt && anyX) {
  10930. // we know patch is an x, because we have any x at all.
  10931. // replace X with 0
  10932. if (xm) {
  10933. m = 0
  10934. }
  10935. p = 0
  10936. if (gtlt === '>') {
  10937. // >1 => >=2.0.0
  10938. // >1.2 => >=1.3.0
  10939. // >1.2.3 => >= 1.2.4
  10940. gtlt = '>='
  10941. if (xm) {
  10942. M = +M + 1
  10943. m = 0
  10944. p = 0
  10945. } else {
  10946. m = +m + 1
  10947. p = 0
  10948. }
  10949. } else if (gtlt === '<=') {
  10950. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10951. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10952. gtlt = '<'
  10953. if (xm) {
  10954. M = +M + 1
  10955. } else {
  10956. m = +m + 1
  10957. }
  10958. }
  10959. ret = gtlt + M + '.' + m + '.' + p + pr
  10960. } else if (xm) {
  10961. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10962. } else if (xp) {
  10963. ret = '>=' + M + '.' + m + '.0' + pr +
  10964. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10965. }
  10966. debug('xRange return', ret)
  10967. return ret
  10968. })
  10969. }
  10970. // Because * is AND-ed with everything else in the comparator,
  10971. // and '' means "any version", just remove the *s entirely.
  10972. function replaceStars (comp, options) {
  10973. debug('replaceStars', comp, options)
  10974. // Looseness is ignored here. star is always as loose as it gets!
  10975. return comp.trim().replace(re[t.STAR], '')
  10976. }
  10977. // This function is passed to string.replace(re[t.HYPHENRANGE])
  10978. // M, m, patch, prerelease, build
  10979. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  10980. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  10981. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  10982. function hyphenReplace ($0,
  10983. from, fM, fm, fp, fpr, fb,
  10984. to, tM, tm, tp, tpr, tb) {
  10985. if (isX(fM)) {
  10986. from = ''
  10987. } else if (isX(fm)) {
  10988. from = '>=' + fM + '.0.0'
  10989. } else if (isX(fp)) {
  10990. from = '>=' + fM + '.' + fm + '.0'
  10991. } else {
  10992. from = '>=' + from
  10993. }
  10994. if (isX(tM)) {
  10995. to = ''
  10996. } else if (isX(tm)) {
  10997. to = '<' + (+tM + 1) + '.0.0'
  10998. } else if (isX(tp)) {
  10999. to = '<' + tM + '.' + (+tm + 1) + '.0'
  11000. } else if (tpr) {
  11001. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  11002. } else {
  11003. to = '<=' + to
  11004. }
  11005. return (from + ' ' + to).trim()
  11006. }
  11007. // if ANY of the sets match ALL of its comparators, then pass
  11008. Range.prototype.test = function (version) {
  11009. if (!version) {
  11010. return false
  11011. }
  11012. if (typeof version === 'string') {
  11013. try {
  11014. version = new SemVer(version, this.options)
  11015. } catch (er) {
  11016. return false
  11017. }
  11018. }
  11019. for (var i = 0; i < this.set.length; i++) {
  11020. if (testSet(this.set[i], version, this.options)) {
  11021. return true
  11022. }
  11023. }
  11024. return false
  11025. }
  11026. function testSet (set, version, options) {
  11027. for (var i = 0; i < set.length; i++) {
  11028. if (!set[i].test(version)) {
  11029. return false
  11030. }
  11031. }
  11032. if (version.prerelease.length && !options.includePrerelease) {
  11033. // Find the set of versions that are allowed to have prereleases
  11034. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11035. // That should allow `1.2.3-pr.2` to pass.
  11036. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11037. // even though it's within the range set by the comparators.
  11038. for (i = 0; i < set.length; i++) {
  11039. debug(set[i].semver)
  11040. if (set[i].semver === ANY) {
  11041. continue
  11042. }
  11043. if (set[i].semver.prerelease.length > 0) {
  11044. var allowed = set[i].semver
  11045. if (allowed.major === version.major &&
  11046. allowed.minor === version.minor &&
  11047. allowed.patch === version.patch) {
  11048. return true
  11049. }
  11050. }
  11051. }
  11052. // Version has a -pre, but it's not one of the ones we like.
  11053. return false
  11054. }
  11055. return true
  11056. }
  11057. exports.satisfies = satisfies
  11058. function satisfies (version, range, options) {
  11059. try {
  11060. range = new Range(range, options)
  11061. } catch (er) {
  11062. return false
  11063. }
  11064. return range.test(version)
  11065. }
  11066. exports.maxSatisfying = maxSatisfying
  11067. function maxSatisfying (versions, range, options) {
  11068. var max = null
  11069. var maxSV = null
  11070. try {
  11071. var rangeObj = new Range(range, options)
  11072. } catch (er) {
  11073. return null
  11074. }
  11075. versions.forEach(function (v) {
  11076. if (rangeObj.test(v)) {
  11077. // satisfies(v, range, options)
  11078. if (!max || maxSV.compare(v) === -1) {
  11079. // compare(max, v, true)
  11080. max = v
  11081. maxSV = new SemVer(max, options)
  11082. }
  11083. }
  11084. })
  11085. return max
  11086. }
  11087. exports.minSatisfying = minSatisfying
  11088. function minSatisfying (versions, range, options) {
  11089. var min = null
  11090. var minSV = null
  11091. try {
  11092. var rangeObj = new Range(range, options)
  11093. } catch (er) {
  11094. return null
  11095. }
  11096. versions.forEach(function (v) {
  11097. if (rangeObj.test(v)) {
  11098. // satisfies(v, range, options)
  11099. if (!min || minSV.compare(v) === 1) {
  11100. // compare(min, v, true)
  11101. min = v
  11102. minSV = new SemVer(min, options)
  11103. }
  11104. }
  11105. })
  11106. return min
  11107. }
  11108. exports.minVersion = minVersion
  11109. function minVersion (range, loose) {
  11110. range = new Range(range, loose)
  11111. var minver = new SemVer('0.0.0')
  11112. if (range.test(minver)) {
  11113. return minver
  11114. }
  11115. minver = new SemVer('0.0.0-0')
  11116. if (range.test(minver)) {
  11117. return minver
  11118. }
  11119. minver = null
  11120. for (var i = 0; i < range.set.length; ++i) {
  11121. var comparators = range.set[i]
  11122. comparators.forEach(function (comparator) {
  11123. // Clone to avoid manipulating the comparator's semver object.
  11124. var compver = new SemVer(comparator.semver.version)
  11125. switch (comparator.operator) {
  11126. case '>':
  11127. if (compver.prerelease.length === 0) {
  11128. compver.patch++
  11129. } else {
  11130. compver.prerelease.push(0)
  11131. }
  11132. compver.raw = compver.format()
  11133. /* fallthrough */
  11134. case '':
  11135. case '>=':
  11136. if (!minver || gt(minver, compver)) {
  11137. minver = compver
  11138. }
  11139. break
  11140. case '<':
  11141. case '<=':
  11142. /* Ignore maximum versions */
  11143. break
  11144. /* istanbul ignore next */
  11145. default:
  11146. throw new Error('Unexpected operation: ' + comparator.operator)
  11147. }
  11148. })
  11149. }
  11150. if (minver && range.test(minver)) {
  11151. return minver
  11152. }
  11153. return null
  11154. }
  11155. exports.validRange = validRange
  11156. function validRange (range, options) {
  11157. try {
  11158. // Return '*' instead of '' so that truthiness works.
  11159. // This will throw if it's invalid anyway
  11160. return new Range(range, options).range || '*'
  11161. } catch (er) {
  11162. return null
  11163. }
  11164. }
  11165. // Determine if version is less than all the versions possible in the range
  11166. exports.ltr = ltr
  11167. function ltr (version, range, options) {
  11168. return outside(version, range, '<', options)
  11169. }
  11170. // Determine if version is greater than all the versions possible in the range.
  11171. exports.gtr = gtr
  11172. function gtr (version, range, options) {
  11173. return outside(version, range, '>', options)
  11174. }
  11175. exports.outside = outside
  11176. function outside (version, range, hilo, options) {
  11177. version = new SemVer(version, options)
  11178. range = new Range(range, options)
  11179. var gtfn, ltefn, ltfn, comp, ecomp
  11180. switch (hilo) {
  11181. case '>':
  11182. gtfn = gt
  11183. ltefn = lte
  11184. ltfn = lt
  11185. comp = '>'
  11186. ecomp = '>='
  11187. break
  11188. case '<':
  11189. gtfn = lt
  11190. ltefn = gte
  11191. ltfn = gt
  11192. comp = '<'
  11193. ecomp = '<='
  11194. break
  11195. default:
  11196. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11197. }
  11198. // If it satisifes the range it is not outside
  11199. if (satisfies(version, range, options)) {
  11200. return false
  11201. }
  11202. // From now on, variable terms are as if we're in "gtr" mode.
  11203. // but note that everything is flipped for the "ltr" function.
  11204. for (var i = 0; i < range.set.length; ++i) {
  11205. var comparators = range.set[i]
  11206. var high = null
  11207. var low = null
  11208. comparators.forEach(function (comparator) {
  11209. if (comparator.semver === ANY) {
  11210. comparator = new Comparator('>=0.0.0')
  11211. }
  11212. high = high || comparator
  11213. low = low || comparator
  11214. if (gtfn(comparator.semver, high.semver, options)) {
  11215. high = comparator
  11216. } else if (ltfn(comparator.semver, low.semver, options)) {
  11217. low = comparator
  11218. }
  11219. })
  11220. // If the edge version comparator has a operator then our version
  11221. // isn't outside it
  11222. if (high.operator === comp || high.operator === ecomp) {
  11223. return false
  11224. }
  11225. // If the lowest version comparator has an operator and our version
  11226. // is less than it then it isn't higher than the range
  11227. if ((!low.operator || low.operator === comp) &&
  11228. ltefn(version, low.semver)) {
  11229. return false
  11230. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11231. return false
  11232. }
  11233. }
  11234. return true
  11235. }
  11236. exports.prerelease = prerelease
  11237. function prerelease (version, options) {
  11238. var parsed = parse(version, options)
  11239. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11240. }
  11241. exports.intersects = intersects
  11242. function intersects (r1, r2, options) {
  11243. r1 = new Range(r1, options)
  11244. r2 = new Range(r2, options)
  11245. return r1.intersects(r2)
  11246. }
  11247. exports.coerce = coerce
  11248. function coerce (version, options) {
  11249. if (version instanceof SemVer) {
  11250. return version
  11251. }
  11252. if (typeof version === 'number') {
  11253. version = String(version)
  11254. }
  11255. if (typeof version !== 'string') {
  11256. return null
  11257. }
  11258. options = options || {}
  11259. var match = null
  11260. if (!options.rtl) {
  11261. match = version.match(re[t.COERCE])
  11262. } else {
  11263. // Find the right-most coercible string that does not share
  11264. // a terminus with a more left-ward coercible string.
  11265. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11266. //
  11267. // Walk through the string checking with a /g regexp
  11268. // Manually set the index so as to pick up overlapping matches.
  11269. // Stop when we get a match that ends at the string end, since no
  11270. // coercible string can be more right-ward without the same terminus.
  11271. var next
  11272. while ((next = re[t.COERCERTL].exec(version)) &&
  11273. (!match || match.index + match[0].length !== version.length)
  11274. ) {
  11275. if (!match ||
  11276. next.index + next[0].length !== match.index + match[0].length) {
  11277. match = next
  11278. }
  11279. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11280. }
  11281. // leave it in a clean state
  11282. re[t.COERCERTL].lastIndex = -1
  11283. }
  11284. if (match === null) {
  11285. return null
  11286. }
  11287. return parse(match[2] +
  11288. '.' + (match[3] || '0') +
  11289. '.' + (match[4] || '0'), options)
  11290. }
  11291. /***/ }),
  11292. /***/ 669:
  11293. /***/ (function(module) {
  11294. module.exports = require("util");
  11295. /***/ }),
  11296. /***/ 672:
  11297. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11298. "use strict";
  11299. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11300. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11301. return new (P || (P = Promise))(function (resolve, reject) {
  11302. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11303. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11304. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11305. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11306. });
  11307. };
  11308. var _a;
  11309. Object.defineProperty(exports, "__esModule", { value: true });
  11310. const assert_1 = __webpack_require__(357);
  11311. const fs = __webpack_require__(747);
  11312. const path = __webpack_require__(622);
  11313. _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;
  11314. exports.IS_WINDOWS = process.platform === 'win32';
  11315. function exists(fsPath) {
  11316. return __awaiter(this, void 0, void 0, function* () {
  11317. try {
  11318. yield exports.stat(fsPath);
  11319. }
  11320. catch (err) {
  11321. if (err.code === 'ENOENT') {
  11322. return false;
  11323. }
  11324. throw err;
  11325. }
  11326. return true;
  11327. });
  11328. }
  11329. exports.exists = exists;
  11330. function isDirectory(fsPath, useStat = false) {
  11331. return __awaiter(this, void 0, void 0, function* () {
  11332. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11333. return stats.isDirectory();
  11334. });
  11335. }
  11336. exports.isDirectory = isDirectory;
  11337. /**
  11338. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11339. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11340. */
  11341. function isRooted(p) {
  11342. p = normalizeSeparators(p);
  11343. if (!p) {
  11344. throw new Error('isRooted() parameter "p" cannot be empty');
  11345. }
  11346. if (exports.IS_WINDOWS) {
  11347. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11348. ); // e.g. C: or C:\hello
  11349. }
  11350. return p.startsWith('/');
  11351. }
  11352. exports.isRooted = isRooted;
  11353. /**
  11354. * Recursively create a directory at `fsPath`.
  11355. *
  11356. * This implementation is optimistic, meaning it attempts to create the full
  11357. * path first, and backs up the path stack from there.
  11358. *
  11359. * @param fsPath The path to create
  11360. * @param maxDepth The maximum recursion depth
  11361. * @param depth The current recursion depth
  11362. */
  11363. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11364. return __awaiter(this, void 0, void 0, function* () {
  11365. assert_1.ok(fsPath, 'a path argument must be provided');
  11366. fsPath = path.resolve(fsPath);
  11367. if (depth >= maxDepth)
  11368. return exports.mkdir(fsPath);
  11369. try {
  11370. yield exports.mkdir(fsPath);
  11371. return;
  11372. }
  11373. catch (err) {
  11374. switch (err.code) {
  11375. case 'ENOENT': {
  11376. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11377. yield exports.mkdir(fsPath);
  11378. return;
  11379. }
  11380. default: {
  11381. let stats;
  11382. try {
  11383. stats = yield exports.stat(fsPath);
  11384. }
  11385. catch (err2) {
  11386. throw err;
  11387. }
  11388. if (!stats.isDirectory())
  11389. throw err;
  11390. }
  11391. }
  11392. }
  11393. });
  11394. }
  11395. exports.mkdirP = mkdirP;
  11396. /**
  11397. * Best effort attempt to determine whether a file exists and is executable.
  11398. * @param filePath file path to check
  11399. * @param extensions additional file extensions to try
  11400. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11401. */
  11402. function tryGetExecutablePath(filePath, extensions) {
  11403. return __awaiter(this, void 0, void 0, function* () {
  11404. let stats = undefined;
  11405. try {
  11406. // test file exists
  11407. stats = yield exports.stat(filePath);
  11408. }
  11409. catch (err) {
  11410. if (err.code !== 'ENOENT') {
  11411. // eslint-disable-next-line no-console
  11412. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11413. }
  11414. }
  11415. if (stats && stats.isFile()) {
  11416. if (exports.IS_WINDOWS) {
  11417. // on Windows, test for valid extension
  11418. const upperExt = path.extname(filePath).toUpperCase();
  11419. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11420. return filePath;
  11421. }
  11422. }
  11423. else {
  11424. if (isUnixExecutable(stats)) {
  11425. return filePath;
  11426. }
  11427. }
  11428. }
  11429. // try each extension
  11430. const originalFilePath = filePath;
  11431. for (const extension of extensions) {
  11432. filePath = originalFilePath + extension;
  11433. stats = undefined;
  11434. try {
  11435. stats = yield exports.stat(filePath);
  11436. }
  11437. catch (err) {
  11438. if (err.code !== 'ENOENT') {
  11439. // eslint-disable-next-line no-console
  11440. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11441. }
  11442. }
  11443. if (stats && stats.isFile()) {
  11444. if (exports.IS_WINDOWS) {
  11445. // preserve the case of the actual file (since an extension was appended)
  11446. try {
  11447. const directory = path.dirname(filePath);
  11448. const upperName = path.basename(filePath).toUpperCase();
  11449. for (const actualName of yield exports.readdir(directory)) {
  11450. if (upperName === actualName.toUpperCase()) {
  11451. filePath = path.join(directory, actualName);
  11452. break;
  11453. }
  11454. }
  11455. }
  11456. catch (err) {
  11457. // eslint-disable-next-line no-console
  11458. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11459. }
  11460. return filePath;
  11461. }
  11462. else {
  11463. if (isUnixExecutable(stats)) {
  11464. return filePath;
  11465. }
  11466. }
  11467. }
  11468. }
  11469. return '';
  11470. });
  11471. }
  11472. exports.tryGetExecutablePath = tryGetExecutablePath;
  11473. function normalizeSeparators(p) {
  11474. p = p || '';
  11475. if (exports.IS_WINDOWS) {
  11476. // convert slashes on Windows
  11477. p = p.replace(/\//g, '\\');
  11478. // remove redundant slashes
  11479. return p.replace(/\\\\+/g, '\\');
  11480. }
  11481. // remove redundant slashes
  11482. return p.replace(/\/\/+/g, '/');
  11483. }
  11484. // on Mac/Linux, test the execute bit
  11485. // R W X R W X R W X
  11486. // 256 128 64 32 16 8 4 2 1
  11487. function isUnixExecutable(stats) {
  11488. return ((stats.mode & 1) > 0 ||
  11489. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11490. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11491. }
  11492. //# sourceMappingURL=io-util.js.map
  11493. /***/ }),
  11494. /***/ 674:
  11495. /***/ (function(module, __unusedexports, __webpack_require__) {
  11496. module.exports = authenticate;
  11497. const { Deprecation } = __webpack_require__(692);
  11498. const once = __webpack_require__(969);
  11499. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11500. function authenticate(state, options) {
  11501. deprecateAuthenticate(
  11502. state.octokit.log,
  11503. new Deprecation(
  11504. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11505. )
  11506. );
  11507. if (!options) {
  11508. state.auth = false;
  11509. return;
  11510. }
  11511. switch (options.type) {
  11512. case "basic":
  11513. if (!options.username || !options.password) {
  11514. throw new Error(
  11515. "Basic authentication requires both a username and password to be set"
  11516. );
  11517. }
  11518. break;
  11519. case "oauth":
  11520. if (!options.token && !(options.key && options.secret)) {
  11521. throw new Error(
  11522. "OAuth2 authentication requires a token or key & secret to be set"
  11523. );
  11524. }
  11525. break;
  11526. case "token":
  11527. case "app":
  11528. if (!options.token) {
  11529. throw new Error("Token authentication requires a token to be set");
  11530. }
  11531. break;
  11532. default:
  11533. throw new Error(
  11534. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11535. );
  11536. }
  11537. state.auth = options;
  11538. }
  11539. /***/ }),
  11540. /***/ 675:
  11541. /***/ (function(module) {
  11542. module.exports = function btoa(str) {
  11543. return new Buffer(str).toString('base64')
  11544. }
  11545. /***/ }),
  11546. /***/ 692:
  11547. /***/ (function(__unusedmodule, exports) {
  11548. "use strict";
  11549. Object.defineProperty(exports, '__esModule', { value: true });
  11550. class Deprecation extends Error {
  11551. constructor(message) {
  11552. super(message); // Maintains proper stack trace (only available on V8)
  11553. /* istanbul ignore next */
  11554. if (Error.captureStackTrace) {
  11555. Error.captureStackTrace(this, this.constructor);
  11556. }
  11557. this.name = 'Deprecation';
  11558. }
  11559. }
  11560. exports.Deprecation = Deprecation;
  11561. /***/ }),
  11562. /***/ 696:
  11563. /***/ (function(module) {
  11564. "use strict";
  11565. /*!
  11566. * isobject <https://github.com/jonschlinkert/isobject>
  11567. *
  11568. * Copyright (c) 2014-2017, Jon Schlinkert.
  11569. * Released under the MIT License.
  11570. */
  11571. function isObject(val) {
  11572. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11573. }
  11574. /*!
  11575. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11576. *
  11577. * Copyright (c) 2014-2017, Jon Schlinkert.
  11578. * Released under the MIT License.
  11579. */
  11580. function isObjectObject(o) {
  11581. return isObject(o) === true
  11582. && Object.prototype.toString.call(o) === '[object Object]';
  11583. }
  11584. function isPlainObject(o) {
  11585. var ctor,prot;
  11586. if (isObjectObject(o) === false) return false;
  11587. // If has modified constructor
  11588. ctor = o.constructor;
  11589. if (typeof ctor !== 'function') return false;
  11590. // If has modified prototype
  11591. prot = ctor.prototype;
  11592. if (isObjectObject(prot) === false) return false;
  11593. // If constructor does not have an Object-specific method
  11594. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11595. return false;
  11596. }
  11597. // Most likely a plain Object
  11598. return true;
  11599. }
  11600. module.exports = isPlainObject;
  11601. /***/ }),
  11602. /***/ 697:
  11603. /***/ (function(module) {
  11604. "use strict";
  11605. module.exports = (promise, onFinally) => {
  11606. onFinally = onFinally || (() => {});
  11607. return promise.then(
  11608. val => new Promise(resolve => {
  11609. resolve(onFinally());
  11610. }).then(() => val),
  11611. err => new Promise(resolve => {
  11612. resolve(onFinally());
  11613. }).then(() => {
  11614. throw err;
  11615. })
  11616. );
  11617. };
  11618. /***/ }),
  11619. /***/ 705:
  11620. /***/ (function(module) {
  11621. 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"}}};
  11622. /***/ }),
  11623. /***/ 722:
  11624. /***/ (function(module) {
  11625. /**
  11626. * Convert array of 16 byte values to UUID string format of the form:
  11627. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11628. */
  11629. var byteToHex = [];
  11630. for (var i = 0; i < 256; ++i) {
  11631. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11632. }
  11633. function bytesToUuid(buf, offset) {
  11634. var i = offset || 0;
  11635. var bth = byteToHex;
  11636. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11637. return ([bth[buf[i++]], bth[buf[i++]],
  11638. bth[buf[i++]], bth[buf[i++]], '-',
  11639. bth[buf[i++]], bth[buf[i++]], '-',
  11640. bth[buf[i++]], bth[buf[i++]], '-',
  11641. bth[buf[i++]], bth[buf[i++]], '-',
  11642. bth[buf[i++]], bth[buf[i++]],
  11643. bth[buf[i++]], bth[buf[i++]],
  11644. bth[buf[i++]], bth[buf[i++]]]).join('');
  11645. }
  11646. module.exports = bytesToUuid;
  11647. /***/ }),
  11648. /***/ 742:
  11649. /***/ (function(module, __unusedexports, __webpack_require__) {
  11650. var fs = __webpack_require__(747)
  11651. var core
  11652. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11653. core = __webpack_require__(818)
  11654. } else {
  11655. core = __webpack_require__(197)
  11656. }
  11657. module.exports = isexe
  11658. isexe.sync = sync
  11659. function isexe (path, options, cb) {
  11660. if (typeof options === 'function') {
  11661. cb = options
  11662. options = {}
  11663. }
  11664. if (!cb) {
  11665. if (typeof Promise !== 'function') {
  11666. throw new TypeError('callback not provided')
  11667. }
  11668. return new Promise(function (resolve, reject) {
  11669. isexe(path, options || {}, function (er, is) {
  11670. if (er) {
  11671. reject(er)
  11672. } else {
  11673. resolve(is)
  11674. }
  11675. })
  11676. })
  11677. }
  11678. core(path, options || {}, function (er, is) {
  11679. // ignore EACCES because that just means we aren't allowed to run it
  11680. if (er) {
  11681. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11682. er = null
  11683. is = false
  11684. }
  11685. }
  11686. cb(er, is)
  11687. })
  11688. }
  11689. function sync (path, options) {
  11690. // my kingdom for a filtered catch
  11691. try {
  11692. return core.sync(path, options || {})
  11693. } catch (er) {
  11694. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11695. return false
  11696. } else {
  11697. throw er
  11698. }
  11699. }
  11700. }
  11701. /***/ }),
  11702. /***/ 747:
  11703. /***/ (function(module) {
  11704. module.exports = require("fs");
  11705. /***/ }),
  11706. /***/ 753:
  11707. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11708. "use strict";
  11709. Object.defineProperty(exports, '__esModule', { value: true });
  11710. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11711. var endpoint = __webpack_require__(385);
  11712. var universalUserAgent = __webpack_require__(796);
  11713. var isPlainObject = _interopDefault(__webpack_require__(696));
  11714. var nodeFetch = _interopDefault(__webpack_require__(454));
  11715. var requestError = __webpack_require__(463);
  11716. const VERSION = "5.3.1";
  11717. function getBufferResponse(response) {
  11718. return response.arrayBuffer();
  11719. }
  11720. function fetchWrapper(requestOptions) {
  11721. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11722. requestOptions.body = JSON.stringify(requestOptions.body);
  11723. }
  11724. let headers = {};
  11725. let status;
  11726. let url;
  11727. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11728. return fetch(requestOptions.url, Object.assign({
  11729. method: requestOptions.method,
  11730. body: requestOptions.body,
  11731. headers: requestOptions.headers,
  11732. redirect: requestOptions.redirect
  11733. }, requestOptions.request)).then(response => {
  11734. url = response.url;
  11735. status = response.status;
  11736. for (const keyAndValue of response.headers) {
  11737. headers[keyAndValue[0]] = keyAndValue[1];
  11738. }
  11739. if (status === 204 || status === 205) {
  11740. return;
  11741. } // GitHub API returns 200 for HEAD requsets
  11742. if (requestOptions.method === "HEAD") {
  11743. if (status < 400) {
  11744. return;
  11745. }
  11746. throw new requestError.RequestError(response.statusText, status, {
  11747. headers,
  11748. request: requestOptions
  11749. });
  11750. }
  11751. if (status === 304) {
  11752. throw new requestError.RequestError("Not modified", status, {
  11753. headers,
  11754. request: requestOptions
  11755. });
  11756. }
  11757. if (status >= 400) {
  11758. return response.text().then(message => {
  11759. const error = new requestError.RequestError(message, status, {
  11760. headers,
  11761. request: requestOptions
  11762. });
  11763. try {
  11764. let responseBody = JSON.parse(error.message);
  11765. Object.assign(error, responseBody);
  11766. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11767. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11768. } catch (e) {// ignore, see octokit/rest.js#684
  11769. }
  11770. throw error;
  11771. });
  11772. }
  11773. const contentType = response.headers.get("content-type");
  11774. if (/application\/json/.test(contentType)) {
  11775. return response.json();
  11776. }
  11777. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11778. return response.text();
  11779. }
  11780. return getBufferResponse(response);
  11781. }).then(data => {
  11782. return {
  11783. status,
  11784. url,
  11785. headers,
  11786. data
  11787. };
  11788. }).catch(error => {
  11789. if (error instanceof requestError.RequestError) {
  11790. throw error;
  11791. }
  11792. throw new requestError.RequestError(error.message, 500, {
  11793. headers,
  11794. request: requestOptions
  11795. });
  11796. });
  11797. }
  11798. function withDefaults(oldEndpoint, newDefaults) {
  11799. const endpoint = oldEndpoint.defaults(newDefaults);
  11800. const newApi = function (route, parameters) {
  11801. const endpointOptions = endpoint.merge(route, parameters);
  11802. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11803. return fetchWrapper(endpoint.parse(endpointOptions));
  11804. }
  11805. const request = (route, parameters) => {
  11806. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11807. };
  11808. Object.assign(request, {
  11809. endpoint,
  11810. defaults: withDefaults.bind(null, endpoint)
  11811. });
  11812. return endpointOptions.request.hook(request, endpointOptions);
  11813. };
  11814. return Object.assign(newApi, {
  11815. endpoint,
  11816. defaults: withDefaults.bind(null, endpoint)
  11817. });
  11818. }
  11819. const request = withDefaults(endpoint.endpoint, {
  11820. headers: {
  11821. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11822. }
  11823. });
  11824. exports.request = request;
  11825. //# sourceMappingURL=index.js.map
  11826. /***/ }),
  11827. /***/ 761:
  11828. /***/ (function(module) {
  11829. module.exports = require("zlib");
  11830. /***/ }),
  11831. /***/ 763:
  11832. /***/ (function(module) {
  11833. module.exports = removeHook
  11834. function removeHook (state, name, method) {
  11835. if (!state.registry[name]) {
  11836. return
  11837. }
  11838. var index = state.registry[name]
  11839. .map(function (registered) { return registered.orig })
  11840. .indexOf(method)
  11841. if (index === -1) {
  11842. return
  11843. }
  11844. state.registry[name].splice(index, 1)
  11845. }
  11846. /***/ }),
  11847. /***/ 768:
  11848. /***/ (function(module) {
  11849. "use strict";
  11850. module.exports = function (x) {
  11851. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11852. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11853. if (x[x.length - 1] === lf) {
  11854. x = x.slice(0, x.length - 1);
  11855. }
  11856. if (x[x.length - 1] === cr) {
  11857. x = x.slice(0, x.length - 1);
  11858. }
  11859. return x;
  11860. };
  11861. /***/ }),
  11862. /***/ 777:
  11863. /***/ (function(module, __unusedexports, __webpack_require__) {
  11864. module.exports = getFirstPage
  11865. const getPage = __webpack_require__(265)
  11866. function getFirstPage (octokit, link, headers) {
  11867. return getPage(octokit, link, 'first', headers)
  11868. }
  11869. /***/ }),
  11870. /***/ 796:
  11871. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11872. "use strict";
  11873. Object.defineProperty(exports, '__esModule', { value: true });
  11874. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11875. var osName = _interopDefault(__webpack_require__(2));
  11876. function getUserAgent() {
  11877. try {
  11878. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  11879. } catch (error) {
  11880. if (/wmic os get Caption/.test(error.message)) {
  11881. return "Windows <version undetectable>";
  11882. }
  11883. throw error;
  11884. }
  11885. }
  11886. exports.getUserAgent = getUserAgent;
  11887. //# sourceMappingURL=index.js.map
  11888. /***/ }),
  11889. /***/ 807:
  11890. /***/ (function(module, __unusedexports, __webpack_require__) {
  11891. module.exports = paginate;
  11892. const iterator = __webpack_require__(8);
  11893. function paginate(octokit, route, options, mapFn) {
  11894. if (typeof options === "function") {
  11895. mapFn = options;
  11896. options = undefined;
  11897. }
  11898. options = octokit.request.endpoint.merge(route, options);
  11899. return gather(
  11900. octokit,
  11901. [],
  11902. iterator(octokit, options)[Symbol.asyncIterator](),
  11903. mapFn
  11904. );
  11905. }
  11906. function gather(octokit, results, iterator, mapFn) {
  11907. return iterator.next().then(result => {
  11908. if (result.done) {
  11909. return results;
  11910. }
  11911. let earlyExit = false;
  11912. function done() {
  11913. earlyExit = true;
  11914. }
  11915. results = results.concat(
  11916. mapFn ? mapFn(result.value, done) : result.value.data
  11917. );
  11918. if (earlyExit) {
  11919. return results;
  11920. }
  11921. return gather(octokit, results, iterator, mapFn);
  11922. });
  11923. }
  11924. /***/ }),
  11925. /***/ 813:
  11926. /***/ (function(__unusedmodule, exports) {
  11927. "use strict";
  11928. Object.defineProperty(exports, '__esModule', { value: true });
  11929. async function auth(token) {
  11930. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  11931. return {
  11932. type: "token",
  11933. token: token,
  11934. tokenType
  11935. };
  11936. }
  11937. /**
  11938. * Prefix token for usage in the Authorization header
  11939. *
  11940. * @param token OAuth token or JSON Web Token
  11941. */
  11942. function withAuthorizationPrefix(token) {
  11943. if (token.split(/\./).length === 3) {
  11944. return `bearer ${token}`;
  11945. }
  11946. return `token ${token}`;
  11947. }
  11948. async function hook(token, request, route, parameters) {
  11949. const endpoint = request.endpoint.merge(route, parameters);
  11950. endpoint.headers.authorization = withAuthorizationPrefix(token);
  11951. return request(endpoint);
  11952. }
  11953. const createTokenAuth = function createTokenAuth(token) {
  11954. if (!token) {
  11955. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  11956. }
  11957. if (typeof token !== "string") {
  11958. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  11959. }
  11960. token = token.replace(/^(token|bearer) +/i, "");
  11961. return Object.assign(auth.bind(null, token), {
  11962. hook: hook.bind(null, token)
  11963. });
  11964. };
  11965. exports.createTokenAuth = createTokenAuth;
  11966. //# sourceMappingURL=index.js.map
  11967. /***/ }),
  11968. /***/ 814:
  11969. /***/ (function(module, __unusedexports, __webpack_require__) {
  11970. module.exports = which
  11971. which.sync = whichSync
  11972. var isWindows = process.platform === 'win32' ||
  11973. process.env.OSTYPE === 'cygwin' ||
  11974. process.env.OSTYPE === 'msys'
  11975. var path = __webpack_require__(622)
  11976. var COLON = isWindows ? ';' : ':'
  11977. var isexe = __webpack_require__(742)
  11978. function getNotFoundError (cmd) {
  11979. var er = new Error('not found: ' + cmd)
  11980. er.code = 'ENOENT'
  11981. return er
  11982. }
  11983. function getPathInfo (cmd, opt) {
  11984. var colon = opt.colon || COLON
  11985. var pathEnv = opt.path || process.env.PATH || ''
  11986. var pathExt = ['']
  11987. pathEnv = pathEnv.split(colon)
  11988. var pathExtExe = ''
  11989. if (isWindows) {
  11990. pathEnv.unshift(process.cwd())
  11991. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  11992. pathExt = pathExtExe.split(colon)
  11993. // Always test the cmd itself first. isexe will check to make sure
  11994. // it's found in the pathExt set.
  11995. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  11996. pathExt.unshift('')
  11997. }
  11998. // If it has a slash, then we don't bother searching the pathenv.
  11999. // just check the file itself, and that's it.
  12000. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  12001. pathEnv = ['']
  12002. return {
  12003. env: pathEnv,
  12004. ext: pathExt,
  12005. extExe: pathExtExe
  12006. }
  12007. }
  12008. function which (cmd, opt, cb) {
  12009. if (typeof opt === 'function') {
  12010. cb = opt
  12011. opt = {}
  12012. }
  12013. var info = getPathInfo(cmd, opt)
  12014. var pathEnv = info.env
  12015. var pathExt = info.ext
  12016. var pathExtExe = info.extExe
  12017. var found = []
  12018. ;(function F (i, l) {
  12019. if (i === l) {
  12020. if (opt.all && found.length)
  12021. return cb(null, found)
  12022. else
  12023. return cb(getNotFoundError(cmd))
  12024. }
  12025. var pathPart = pathEnv[i]
  12026. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12027. pathPart = pathPart.slice(1, -1)
  12028. var p = path.join(pathPart, cmd)
  12029. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12030. p = cmd.slice(0, 2) + p
  12031. }
  12032. ;(function E (ii, ll) {
  12033. if (ii === ll) return F(i + 1, l)
  12034. var ext = pathExt[ii]
  12035. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12036. if (!er && is) {
  12037. if (opt.all)
  12038. found.push(p + ext)
  12039. else
  12040. return cb(null, p + ext)
  12041. }
  12042. return E(ii + 1, ll)
  12043. })
  12044. })(0, pathExt.length)
  12045. })(0, pathEnv.length)
  12046. }
  12047. function whichSync (cmd, opt) {
  12048. opt = opt || {}
  12049. var info = getPathInfo(cmd, opt)
  12050. var pathEnv = info.env
  12051. var pathExt = info.ext
  12052. var pathExtExe = info.extExe
  12053. var found = []
  12054. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12055. var pathPart = pathEnv[i]
  12056. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12057. pathPart = pathPart.slice(1, -1)
  12058. var p = path.join(pathPart, cmd)
  12059. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12060. p = cmd.slice(0, 2) + p
  12061. }
  12062. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12063. var cur = p + pathExt[j]
  12064. var is
  12065. try {
  12066. is = isexe.sync(cur, { pathExt: pathExtExe })
  12067. if (is) {
  12068. if (opt.all)
  12069. found.push(cur)
  12070. else
  12071. return cur
  12072. }
  12073. } catch (ex) {}
  12074. }
  12075. }
  12076. if (opt.all && found.length)
  12077. return found
  12078. if (opt.nothrow)
  12079. return null
  12080. throw getNotFoundError(cmd)
  12081. }
  12082. /***/ }),
  12083. /***/ 816:
  12084. /***/ (function(module) {
  12085. "use strict";
  12086. module.exports = /^#!.*/;
  12087. /***/ }),
  12088. /***/ 818:
  12089. /***/ (function(module, __unusedexports, __webpack_require__) {
  12090. module.exports = isexe
  12091. isexe.sync = sync
  12092. var fs = __webpack_require__(747)
  12093. function checkPathExt (path, options) {
  12094. var pathext = options.pathExt !== undefined ?
  12095. options.pathExt : process.env.PATHEXT
  12096. if (!pathext) {
  12097. return true
  12098. }
  12099. pathext = pathext.split(';')
  12100. if (pathext.indexOf('') !== -1) {
  12101. return true
  12102. }
  12103. for (var i = 0; i < pathext.length; i++) {
  12104. var p = pathext[i].toLowerCase()
  12105. if (p && path.substr(-p.length).toLowerCase() === p) {
  12106. return true
  12107. }
  12108. }
  12109. return false
  12110. }
  12111. function checkStat (stat, path, options) {
  12112. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12113. return false
  12114. }
  12115. return checkPathExt(path, options)
  12116. }
  12117. function isexe (path, options, cb) {
  12118. fs.stat(path, function (er, stat) {
  12119. cb(er, er ? false : checkStat(stat, path, options))
  12120. })
  12121. }
  12122. function sync (path, options) {
  12123. return checkStat(fs.statSync(path), path, options)
  12124. }
  12125. /***/ }),
  12126. /***/ 821:
  12127. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12128. "use strict";
  12129. var __importStar = (this && this.__importStar) || function (mod) {
  12130. if (mod && mod.__esModule) return mod;
  12131. var result = {};
  12132. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12133. result["default"] = mod;
  12134. return result;
  12135. };
  12136. Object.defineProperty(exports, "__esModule", { value: true });
  12137. const core = __importStar(__webpack_require__(470));
  12138. const fsHelper = __importStar(__webpack_require__(618));
  12139. const github = __importStar(__webpack_require__(469));
  12140. const path = __importStar(__webpack_require__(622));
  12141. function getInputs() {
  12142. const result = {};
  12143. // GitHub workspace
  12144. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12145. if (!githubWorkspacePath) {
  12146. throw new Error('GITHUB_WORKSPACE not defined');
  12147. }
  12148. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12149. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12150. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12151. // Qualified repository
  12152. const qualifiedRepository = core.getInput('repository') ||
  12153. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12154. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12155. const splitRepository = qualifiedRepository.split('/');
  12156. if (splitRepository.length !== 2 ||
  12157. !splitRepository[0] ||
  12158. !splitRepository[1]) {
  12159. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12160. }
  12161. result.repositoryOwner = splitRepository[0];
  12162. result.repositoryName = splitRepository[1];
  12163. // Repository path
  12164. result.repositoryPath = core.getInput('path') || '.';
  12165. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12166. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12167. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12168. }
  12169. // Workflow repository?
  12170. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12171. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12172. // Source branch, source version
  12173. result.ref = core.getInput('ref');
  12174. if (!result.ref) {
  12175. if (isWorkflowRepository) {
  12176. result.ref = github.context.ref;
  12177. result.commit = github.context.sha;
  12178. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12179. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12180. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12181. result.ref = `refs/heads/${result.ref}`;
  12182. }
  12183. }
  12184. if (!result.ref && !result.commit) {
  12185. result.ref = 'refs/heads/master';
  12186. }
  12187. }
  12188. // SHA?
  12189. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12190. result.commit = result.ref;
  12191. result.ref = '';
  12192. }
  12193. core.debug(`ref = '${result.ref}'`);
  12194. core.debug(`commit = '${result.commit}'`);
  12195. // Clean
  12196. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12197. core.debug(`clean = ${result.clean}`);
  12198. // Fetch depth
  12199. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12200. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12201. result.fetchDepth = 0;
  12202. }
  12203. core.debug(`fetch depth = ${result.fetchDepth}`);
  12204. // LFS
  12205. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12206. core.debug(`lfs = ${result.lfs}`);
  12207. // Submodules
  12208. result.submodules = false;
  12209. result.nestedSubmodules = false;
  12210. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12211. if (submodulesString == 'RECURSIVE') {
  12212. result.submodules = true;
  12213. result.nestedSubmodules = true;
  12214. }
  12215. else if (submodulesString == 'TRUE') {
  12216. result.submodules = true;
  12217. }
  12218. core.debug(`submodules = ${result.submodules}`);
  12219. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12220. // Auth token
  12221. result.authToken = core.getInput('token');
  12222. // SSH
  12223. result.sshKey = core.getInput('ssh-key');
  12224. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12225. result.sshStrict =
  12226. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12227. // Persist credentials
  12228. result.persistCredentials =
  12229. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12230. return result;
  12231. }
  12232. exports.getInputs = getInputs;
  12233. /***/ }),
  12234. /***/ 826:
  12235. /***/ (function(module, __unusedexports, __webpack_require__) {
  12236. var rng = __webpack_require__(139);
  12237. var bytesToUuid = __webpack_require__(722);
  12238. function v4(options, buf, offset) {
  12239. var i = buf && offset || 0;
  12240. if (typeof(options) == 'string') {
  12241. buf = options === 'binary' ? new Array(16) : null;
  12242. options = null;
  12243. }
  12244. options = options || {};
  12245. var rnds = options.random || (options.rng || rng)();
  12246. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12247. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12248. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12249. // Copy bytes to buffer, if provided
  12250. if (buf) {
  12251. for (var ii = 0; ii < 16; ++ii) {
  12252. buf[i + ii] = rnds[ii];
  12253. }
  12254. }
  12255. return buf || bytesToUuid(rnds);
  12256. }
  12257. module.exports = v4;
  12258. /***/ }),
  12259. /***/ 835:
  12260. /***/ (function(module) {
  12261. module.exports = require("url");
  12262. /***/ }),
  12263. /***/ 850:
  12264. /***/ (function(module, __unusedexports, __webpack_require__) {
  12265. module.exports = paginationMethodsPlugin
  12266. function paginationMethodsPlugin (octokit) {
  12267. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  12268. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  12269. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  12270. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  12271. octokit.hasFirstPage = __webpack_require__(536)
  12272. octokit.hasLastPage = __webpack_require__(336)
  12273. octokit.hasNextPage = __webpack_require__(929)
  12274. octokit.hasPreviousPage = __webpack_require__(558)
  12275. }
  12276. /***/ }),
  12277. /***/ 854:
  12278. /***/ (function(module) {
  12279. /**
  12280. * lodash (Custom Build) <https://lodash.com/>
  12281. * Build: `lodash modularize exports="npm" -o ./`
  12282. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12283. * Released under MIT license <https://lodash.com/license>
  12284. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12285. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12286. */
  12287. /** Used as the `TypeError` message for "Functions" methods. */
  12288. var FUNC_ERROR_TEXT = 'Expected a function';
  12289. /** Used to stand-in for `undefined` hash values. */
  12290. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12291. /** Used as references for various `Number` constants. */
  12292. var INFINITY = 1 / 0;
  12293. /** `Object#toString` result references. */
  12294. var funcTag = '[object Function]',
  12295. genTag = '[object GeneratorFunction]',
  12296. symbolTag = '[object Symbol]';
  12297. /** Used to match property names within property paths. */
  12298. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12299. reIsPlainProp = /^\w*$/,
  12300. reLeadingDot = /^\./,
  12301. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12302. /**
  12303. * Used to match `RegExp`
  12304. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12305. */
  12306. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12307. /** Used to match backslashes in property paths. */
  12308. var reEscapeChar = /\\(\\)?/g;
  12309. /** Used to detect host constructors (Safari). */
  12310. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12311. /** Detect free variable `global` from Node.js. */
  12312. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12313. /** Detect free variable `self`. */
  12314. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12315. /** Used as a reference to the global object. */
  12316. var root = freeGlobal || freeSelf || Function('return this')();
  12317. /**
  12318. * Gets the value at `key` of `object`.
  12319. *
  12320. * @private
  12321. * @param {Object} [object] The object to query.
  12322. * @param {string} key The key of the property to get.
  12323. * @returns {*} Returns the property value.
  12324. */
  12325. function getValue(object, key) {
  12326. return object == null ? undefined : object[key];
  12327. }
  12328. /**
  12329. * Checks if `value` is a host object in IE < 9.
  12330. *
  12331. * @private
  12332. * @param {*} value The value to check.
  12333. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12334. */
  12335. function isHostObject(value) {
  12336. // Many host objects are `Object` objects that can coerce to strings
  12337. // despite having improperly defined `toString` methods.
  12338. var result = false;
  12339. if (value != null && typeof value.toString != 'function') {
  12340. try {
  12341. result = !!(value + '');
  12342. } catch (e) {}
  12343. }
  12344. return result;
  12345. }
  12346. /** Used for built-in method references. */
  12347. var arrayProto = Array.prototype,
  12348. funcProto = Function.prototype,
  12349. objectProto = Object.prototype;
  12350. /** Used to detect overreaching core-js shims. */
  12351. var coreJsData = root['__core-js_shared__'];
  12352. /** Used to detect methods masquerading as native. */
  12353. var maskSrcKey = (function() {
  12354. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12355. return uid ? ('Symbol(src)_1.' + uid) : '';
  12356. }());
  12357. /** Used to resolve the decompiled source of functions. */
  12358. var funcToString = funcProto.toString;
  12359. /** Used to check objects for own properties. */
  12360. var hasOwnProperty = objectProto.hasOwnProperty;
  12361. /**
  12362. * Used to resolve the
  12363. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12364. * of values.
  12365. */
  12366. var objectToString = objectProto.toString;
  12367. /** Used to detect if a method is native. */
  12368. var reIsNative = RegExp('^' +
  12369. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12370. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12371. );
  12372. /** Built-in value references. */
  12373. var Symbol = root.Symbol,
  12374. splice = arrayProto.splice;
  12375. /* Built-in method references that are verified to be native. */
  12376. var Map = getNative(root, 'Map'),
  12377. nativeCreate = getNative(Object, 'create');
  12378. /** Used to convert symbols to primitives and strings. */
  12379. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12380. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12381. /**
  12382. * Creates a hash object.
  12383. *
  12384. * @private
  12385. * @constructor
  12386. * @param {Array} [entries] The key-value pairs to cache.
  12387. */
  12388. function Hash(entries) {
  12389. var index = -1,
  12390. length = entries ? entries.length : 0;
  12391. this.clear();
  12392. while (++index < length) {
  12393. var entry = entries[index];
  12394. this.set(entry[0], entry[1]);
  12395. }
  12396. }
  12397. /**
  12398. * Removes all key-value entries from the hash.
  12399. *
  12400. * @private
  12401. * @name clear
  12402. * @memberOf Hash
  12403. */
  12404. function hashClear() {
  12405. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12406. }
  12407. /**
  12408. * Removes `key` and its value from the hash.
  12409. *
  12410. * @private
  12411. * @name delete
  12412. * @memberOf Hash
  12413. * @param {Object} hash The hash to modify.
  12414. * @param {string} key The key of the value to remove.
  12415. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12416. */
  12417. function hashDelete(key) {
  12418. return this.has(key) && delete this.__data__[key];
  12419. }
  12420. /**
  12421. * Gets the hash value for `key`.
  12422. *
  12423. * @private
  12424. * @name get
  12425. * @memberOf Hash
  12426. * @param {string} key The key of the value to get.
  12427. * @returns {*} Returns the entry value.
  12428. */
  12429. function hashGet(key) {
  12430. var data = this.__data__;
  12431. if (nativeCreate) {
  12432. var result = data[key];
  12433. return result === HASH_UNDEFINED ? undefined : result;
  12434. }
  12435. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12436. }
  12437. /**
  12438. * Checks if a hash value for `key` exists.
  12439. *
  12440. * @private
  12441. * @name has
  12442. * @memberOf Hash
  12443. * @param {string} key The key of the entry to check.
  12444. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12445. */
  12446. function hashHas(key) {
  12447. var data = this.__data__;
  12448. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12449. }
  12450. /**
  12451. * Sets the hash `key` to `value`.
  12452. *
  12453. * @private
  12454. * @name set
  12455. * @memberOf Hash
  12456. * @param {string} key The key of the value to set.
  12457. * @param {*} value The value to set.
  12458. * @returns {Object} Returns the hash instance.
  12459. */
  12460. function hashSet(key, value) {
  12461. var data = this.__data__;
  12462. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12463. return this;
  12464. }
  12465. // Add methods to `Hash`.
  12466. Hash.prototype.clear = hashClear;
  12467. Hash.prototype['delete'] = hashDelete;
  12468. Hash.prototype.get = hashGet;
  12469. Hash.prototype.has = hashHas;
  12470. Hash.prototype.set = hashSet;
  12471. /**
  12472. * Creates an list cache object.
  12473. *
  12474. * @private
  12475. * @constructor
  12476. * @param {Array} [entries] The key-value pairs to cache.
  12477. */
  12478. function ListCache(entries) {
  12479. var index = -1,
  12480. length = entries ? entries.length : 0;
  12481. this.clear();
  12482. while (++index < length) {
  12483. var entry = entries[index];
  12484. this.set(entry[0], entry[1]);
  12485. }
  12486. }
  12487. /**
  12488. * Removes all key-value entries from the list cache.
  12489. *
  12490. * @private
  12491. * @name clear
  12492. * @memberOf ListCache
  12493. */
  12494. function listCacheClear() {
  12495. this.__data__ = [];
  12496. }
  12497. /**
  12498. * Removes `key` and its value from the list cache.
  12499. *
  12500. * @private
  12501. * @name delete
  12502. * @memberOf ListCache
  12503. * @param {string} key The key of the value to remove.
  12504. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12505. */
  12506. function listCacheDelete(key) {
  12507. var data = this.__data__,
  12508. index = assocIndexOf(data, key);
  12509. if (index < 0) {
  12510. return false;
  12511. }
  12512. var lastIndex = data.length - 1;
  12513. if (index == lastIndex) {
  12514. data.pop();
  12515. } else {
  12516. splice.call(data, index, 1);
  12517. }
  12518. return true;
  12519. }
  12520. /**
  12521. * Gets the list cache value for `key`.
  12522. *
  12523. * @private
  12524. * @name get
  12525. * @memberOf ListCache
  12526. * @param {string} key The key of the value to get.
  12527. * @returns {*} Returns the entry value.
  12528. */
  12529. function listCacheGet(key) {
  12530. var data = this.__data__,
  12531. index = assocIndexOf(data, key);
  12532. return index < 0 ? undefined : data[index][1];
  12533. }
  12534. /**
  12535. * Checks if a list cache value for `key` exists.
  12536. *
  12537. * @private
  12538. * @name has
  12539. * @memberOf ListCache
  12540. * @param {string} key The key of the entry to check.
  12541. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12542. */
  12543. function listCacheHas(key) {
  12544. return assocIndexOf(this.__data__, key) > -1;
  12545. }
  12546. /**
  12547. * Sets the list cache `key` to `value`.
  12548. *
  12549. * @private
  12550. * @name set
  12551. * @memberOf ListCache
  12552. * @param {string} key The key of the value to set.
  12553. * @param {*} value The value to set.
  12554. * @returns {Object} Returns the list cache instance.
  12555. */
  12556. function listCacheSet(key, value) {
  12557. var data = this.__data__,
  12558. index = assocIndexOf(data, key);
  12559. if (index < 0) {
  12560. data.push([key, value]);
  12561. } else {
  12562. data[index][1] = value;
  12563. }
  12564. return this;
  12565. }
  12566. // Add methods to `ListCache`.
  12567. ListCache.prototype.clear = listCacheClear;
  12568. ListCache.prototype['delete'] = listCacheDelete;
  12569. ListCache.prototype.get = listCacheGet;
  12570. ListCache.prototype.has = listCacheHas;
  12571. ListCache.prototype.set = listCacheSet;
  12572. /**
  12573. * Creates a map cache object to store key-value pairs.
  12574. *
  12575. * @private
  12576. * @constructor
  12577. * @param {Array} [entries] The key-value pairs to cache.
  12578. */
  12579. function MapCache(entries) {
  12580. var index = -1,
  12581. length = entries ? entries.length : 0;
  12582. this.clear();
  12583. while (++index < length) {
  12584. var entry = entries[index];
  12585. this.set(entry[0], entry[1]);
  12586. }
  12587. }
  12588. /**
  12589. * Removes all key-value entries from the map.
  12590. *
  12591. * @private
  12592. * @name clear
  12593. * @memberOf MapCache
  12594. */
  12595. function mapCacheClear() {
  12596. this.__data__ = {
  12597. 'hash': new Hash,
  12598. 'map': new (Map || ListCache),
  12599. 'string': new Hash
  12600. };
  12601. }
  12602. /**
  12603. * Removes `key` and its value from the map.
  12604. *
  12605. * @private
  12606. * @name delete
  12607. * @memberOf MapCache
  12608. * @param {string} key The key of the value to remove.
  12609. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12610. */
  12611. function mapCacheDelete(key) {
  12612. return getMapData(this, key)['delete'](key);
  12613. }
  12614. /**
  12615. * Gets the map value for `key`.
  12616. *
  12617. * @private
  12618. * @name get
  12619. * @memberOf MapCache
  12620. * @param {string} key The key of the value to get.
  12621. * @returns {*} Returns the entry value.
  12622. */
  12623. function mapCacheGet(key) {
  12624. return getMapData(this, key).get(key);
  12625. }
  12626. /**
  12627. * Checks if a map value for `key` exists.
  12628. *
  12629. * @private
  12630. * @name has
  12631. * @memberOf MapCache
  12632. * @param {string} key The key of the entry to check.
  12633. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12634. */
  12635. function mapCacheHas(key) {
  12636. return getMapData(this, key).has(key);
  12637. }
  12638. /**
  12639. * Sets the map `key` to `value`.
  12640. *
  12641. * @private
  12642. * @name set
  12643. * @memberOf MapCache
  12644. * @param {string} key The key of the value to set.
  12645. * @param {*} value The value to set.
  12646. * @returns {Object} Returns the map cache instance.
  12647. */
  12648. function mapCacheSet(key, value) {
  12649. getMapData(this, key).set(key, value);
  12650. return this;
  12651. }
  12652. // Add methods to `MapCache`.
  12653. MapCache.prototype.clear = mapCacheClear;
  12654. MapCache.prototype['delete'] = mapCacheDelete;
  12655. MapCache.prototype.get = mapCacheGet;
  12656. MapCache.prototype.has = mapCacheHas;
  12657. MapCache.prototype.set = mapCacheSet;
  12658. /**
  12659. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12660. *
  12661. * @private
  12662. * @param {Array} array The array to inspect.
  12663. * @param {*} key The key to search for.
  12664. * @returns {number} Returns the index of the matched value, else `-1`.
  12665. */
  12666. function assocIndexOf(array, key) {
  12667. var length = array.length;
  12668. while (length--) {
  12669. if (eq(array[length][0], key)) {
  12670. return length;
  12671. }
  12672. }
  12673. return -1;
  12674. }
  12675. /**
  12676. * The base implementation of `_.get` without support for default values.
  12677. *
  12678. * @private
  12679. * @param {Object} object The object to query.
  12680. * @param {Array|string} path The path of the property to get.
  12681. * @returns {*} Returns the resolved value.
  12682. */
  12683. function baseGet(object, path) {
  12684. path = isKey(path, object) ? [path] : castPath(path);
  12685. var index = 0,
  12686. length = path.length;
  12687. while (object != null && index < length) {
  12688. object = object[toKey(path[index++])];
  12689. }
  12690. return (index && index == length) ? object : undefined;
  12691. }
  12692. /**
  12693. * The base implementation of `_.isNative` without bad shim checks.
  12694. *
  12695. * @private
  12696. * @param {*} value The value to check.
  12697. * @returns {boolean} Returns `true` if `value` is a native function,
  12698. * else `false`.
  12699. */
  12700. function baseIsNative(value) {
  12701. if (!isObject(value) || isMasked(value)) {
  12702. return false;
  12703. }
  12704. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12705. return pattern.test(toSource(value));
  12706. }
  12707. /**
  12708. * The base implementation of `_.toString` which doesn't convert nullish
  12709. * values to empty strings.
  12710. *
  12711. * @private
  12712. * @param {*} value The value to process.
  12713. * @returns {string} Returns the string.
  12714. */
  12715. function baseToString(value) {
  12716. // Exit early for strings to avoid a performance hit in some environments.
  12717. if (typeof value == 'string') {
  12718. return value;
  12719. }
  12720. if (isSymbol(value)) {
  12721. return symbolToString ? symbolToString.call(value) : '';
  12722. }
  12723. var result = (value + '');
  12724. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12725. }
  12726. /**
  12727. * Casts `value` to a path array if it's not one.
  12728. *
  12729. * @private
  12730. * @param {*} value The value to inspect.
  12731. * @returns {Array} Returns the cast property path array.
  12732. */
  12733. function castPath(value) {
  12734. return isArray(value) ? value : stringToPath(value);
  12735. }
  12736. /**
  12737. * Gets the data for `map`.
  12738. *
  12739. * @private
  12740. * @param {Object} map The map to query.
  12741. * @param {string} key The reference key.
  12742. * @returns {*} Returns the map data.
  12743. */
  12744. function getMapData(map, key) {
  12745. var data = map.__data__;
  12746. return isKeyable(key)
  12747. ? data[typeof key == 'string' ? 'string' : 'hash']
  12748. : data.map;
  12749. }
  12750. /**
  12751. * Gets the native function at `key` of `object`.
  12752. *
  12753. * @private
  12754. * @param {Object} object The object to query.
  12755. * @param {string} key The key of the method to get.
  12756. * @returns {*} Returns the function if it's native, else `undefined`.
  12757. */
  12758. function getNative(object, key) {
  12759. var value = getValue(object, key);
  12760. return baseIsNative(value) ? value : undefined;
  12761. }
  12762. /**
  12763. * Checks if `value` is a property name and not a property path.
  12764. *
  12765. * @private
  12766. * @param {*} value The value to check.
  12767. * @param {Object} [object] The object to query keys on.
  12768. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12769. */
  12770. function isKey(value, object) {
  12771. if (isArray(value)) {
  12772. return false;
  12773. }
  12774. var type = typeof value;
  12775. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12776. value == null || isSymbol(value)) {
  12777. return true;
  12778. }
  12779. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12780. (object != null && value in Object(object));
  12781. }
  12782. /**
  12783. * Checks if `value` is suitable for use as unique object key.
  12784. *
  12785. * @private
  12786. * @param {*} value The value to check.
  12787. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12788. */
  12789. function isKeyable(value) {
  12790. var type = typeof value;
  12791. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12792. ? (value !== '__proto__')
  12793. : (value === null);
  12794. }
  12795. /**
  12796. * Checks if `func` has its source masked.
  12797. *
  12798. * @private
  12799. * @param {Function} func The function to check.
  12800. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12801. */
  12802. function isMasked(func) {
  12803. return !!maskSrcKey && (maskSrcKey in func);
  12804. }
  12805. /**
  12806. * Converts `string` to a property path array.
  12807. *
  12808. * @private
  12809. * @param {string} string The string to convert.
  12810. * @returns {Array} Returns the property path array.
  12811. */
  12812. var stringToPath = memoize(function(string) {
  12813. string = toString(string);
  12814. var result = [];
  12815. if (reLeadingDot.test(string)) {
  12816. result.push('');
  12817. }
  12818. string.replace(rePropName, function(match, number, quote, string) {
  12819. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  12820. });
  12821. return result;
  12822. });
  12823. /**
  12824. * Converts `value` to a string key if it's not a string or symbol.
  12825. *
  12826. * @private
  12827. * @param {*} value The value to inspect.
  12828. * @returns {string|symbol} Returns the key.
  12829. */
  12830. function toKey(value) {
  12831. if (typeof value == 'string' || isSymbol(value)) {
  12832. return value;
  12833. }
  12834. var result = (value + '');
  12835. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12836. }
  12837. /**
  12838. * Converts `func` to its source code.
  12839. *
  12840. * @private
  12841. * @param {Function} func The function to process.
  12842. * @returns {string} Returns the source code.
  12843. */
  12844. function toSource(func) {
  12845. if (func != null) {
  12846. try {
  12847. return funcToString.call(func);
  12848. } catch (e) {}
  12849. try {
  12850. return (func + '');
  12851. } catch (e) {}
  12852. }
  12853. return '';
  12854. }
  12855. /**
  12856. * Creates a function that memoizes the result of `func`. If `resolver` is
  12857. * provided, it determines the cache key for storing the result based on the
  12858. * arguments provided to the memoized function. By default, the first argument
  12859. * provided to the memoized function is used as the map cache key. The `func`
  12860. * is invoked with the `this` binding of the memoized function.
  12861. *
  12862. * **Note:** The cache is exposed as the `cache` property on the memoized
  12863. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  12864. * constructor with one whose instances implement the
  12865. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  12866. * method interface of `delete`, `get`, `has`, and `set`.
  12867. *
  12868. * @static
  12869. * @memberOf _
  12870. * @since 0.1.0
  12871. * @category Function
  12872. * @param {Function} func The function to have its output memoized.
  12873. * @param {Function} [resolver] The function to resolve the cache key.
  12874. * @returns {Function} Returns the new memoized function.
  12875. * @example
  12876. *
  12877. * var object = { 'a': 1, 'b': 2 };
  12878. * var other = { 'c': 3, 'd': 4 };
  12879. *
  12880. * var values = _.memoize(_.values);
  12881. * values(object);
  12882. * // => [1, 2]
  12883. *
  12884. * values(other);
  12885. * // => [3, 4]
  12886. *
  12887. * object.a = 2;
  12888. * values(object);
  12889. * // => [1, 2]
  12890. *
  12891. * // Modify the result cache.
  12892. * values.cache.set(object, ['a', 'b']);
  12893. * values(object);
  12894. * // => ['a', 'b']
  12895. *
  12896. * // Replace `_.memoize.Cache`.
  12897. * _.memoize.Cache = WeakMap;
  12898. */
  12899. function memoize(func, resolver) {
  12900. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  12901. throw new TypeError(FUNC_ERROR_TEXT);
  12902. }
  12903. var memoized = function() {
  12904. var args = arguments,
  12905. key = resolver ? resolver.apply(this, args) : args[0],
  12906. cache = memoized.cache;
  12907. if (cache.has(key)) {
  12908. return cache.get(key);
  12909. }
  12910. var result = func.apply(this, args);
  12911. memoized.cache = cache.set(key, result);
  12912. return result;
  12913. };
  12914. memoized.cache = new (memoize.Cache || MapCache);
  12915. return memoized;
  12916. }
  12917. // Assign cache to `_.memoize`.
  12918. memoize.Cache = MapCache;
  12919. /**
  12920. * Performs a
  12921. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12922. * comparison between two values to determine if they are equivalent.
  12923. *
  12924. * @static
  12925. * @memberOf _
  12926. * @since 4.0.0
  12927. * @category Lang
  12928. * @param {*} value The value to compare.
  12929. * @param {*} other The other value to compare.
  12930. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12931. * @example
  12932. *
  12933. * var object = { 'a': 1 };
  12934. * var other = { 'a': 1 };
  12935. *
  12936. * _.eq(object, object);
  12937. * // => true
  12938. *
  12939. * _.eq(object, other);
  12940. * // => false
  12941. *
  12942. * _.eq('a', 'a');
  12943. * // => true
  12944. *
  12945. * _.eq('a', Object('a'));
  12946. * // => false
  12947. *
  12948. * _.eq(NaN, NaN);
  12949. * // => true
  12950. */
  12951. function eq(value, other) {
  12952. return value === other || (value !== value && other !== other);
  12953. }
  12954. /**
  12955. * Checks if `value` is classified as an `Array` object.
  12956. *
  12957. * @static
  12958. * @memberOf _
  12959. * @since 0.1.0
  12960. * @category Lang
  12961. * @param {*} value The value to check.
  12962. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12963. * @example
  12964. *
  12965. * _.isArray([1, 2, 3]);
  12966. * // => true
  12967. *
  12968. * _.isArray(document.body.children);
  12969. * // => false
  12970. *
  12971. * _.isArray('abc');
  12972. * // => false
  12973. *
  12974. * _.isArray(_.noop);
  12975. * // => false
  12976. */
  12977. var isArray = Array.isArray;
  12978. /**
  12979. * Checks if `value` is classified as a `Function` object.
  12980. *
  12981. * @static
  12982. * @memberOf _
  12983. * @since 0.1.0
  12984. * @category Lang
  12985. * @param {*} value The value to check.
  12986. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12987. * @example
  12988. *
  12989. * _.isFunction(_);
  12990. * // => true
  12991. *
  12992. * _.isFunction(/abc/);
  12993. * // => false
  12994. */
  12995. function isFunction(value) {
  12996. // The use of `Object#toString` avoids issues with the `typeof` operator
  12997. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  12998. var tag = isObject(value) ? objectToString.call(value) : '';
  12999. return tag == funcTag || tag == genTag;
  13000. }
  13001. /**
  13002. * Checks if `value` is the
  13003. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  13004. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  13005. *
  13006. * @static
  13007. * @memberOf _
  13008. * @since 0.1.0
  13009. * @category Lang
  13010. * @param {*} value The value to check.
  13011. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  13012. * @example
  13013. *
  13014. * _.isObject({});
  13015. * // => true
  13016. *
  13017. * _.isObject([1, 2, 3]);
  13018. * // => true
  13019. *
  13020. * _.isObject(_.noop);
  13021. * // => true
  13022. *
  13023. * _.isObject(null);
  13024. * // => false
  13025. */
  13026. function isObject(value) {
  13027. var type = typeof value;
  13028. return !!value && (type == 'object' || type == 'function');
  13029. }
  13030. /**
  13031. * Checks if `value` is object-like. A value is object-like if it's not `null`
  13032. * and has a `typeof` result of "object".
  13033. *
  13034. * @static
  13035. * @memberOf _
  13036. * @since 4.0.0
  13037. * @category Lang
  13038. * @param {*} value The value to check.
  13039. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  13040. * @example
  13041. *
  13042. * _.isObjectLike({});
  13043. * // => true
  13044. *
  13045. * _.isObjectLike([1, 2, 3]);
  13046. * // => true
  13047. *
  13048. * _.isObjectLike(_.noop);
  13049. * // => false
  13050. *
  13051. * _.isObjectLike(null);
  13052. * // => false
  13053. */
  13054. function isObjectLike(value) {
  13055. return !!value && typeof value == 'object';
  13056. }
  13057. /**
  13058. * Checks if `value` is classified as a `Symbol` primitive or object.
  13059. *
  13060. * @static
  13061. * @memberOf _
  13062. * @since 4.0.0
  13063. * @category Lang
  13064. * @param {*} value The value to check.
  13065. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13066. * @example
  13067. *
  13068. * _.isSymbol(Symbol.iterator);
  13069. * // => true
  13070. *
  13071. * _.isSymbol('abc');
  13072. * // => false
  13073. */
  13074. function isSymbol(value) {
  13075. return typeof value == 'symbol' ||
  13076. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13077. }
  13078. /**
  13079. * Converts `value` to a string. An empty string is returned for `null`
  13080. * and `undefined` values. The sign of `-0` is preserved.
  13081. *
  13082. * @static
  13083. * @memberOf _
  13084. * @since 4.0.0
  13085. * @category Lang
  13086. * @param {*} value The value to process.
  13087. * @returns {string} Returns the string.
  13088. * @example
  13089. *
  13090. * _.toString(null);
  13091. * // => ''
  13092. *
  13093. * _.toString(-0);
  13094. * // => '-0'
  13095. *
  13096. * _.toString([1, 2, 3]);
  13097. * // => '1,2,3'
  13098. */
  13099. function toString(value) {
  13100. return value == null ? '' : baseToString(value);
  13101. }
  13102. /**
  13103. * Gets the value at `path` of `object`. If the resolved value is
  13104. * `undefined`, the `defaultValue` is returned in its place.
  13105. *
  13106. * @static
  13107. * @memberOf _
  13108. * @since 3.7.0
  13109. * @category Object
  13110. * @param {Object} object The object to query.
  13111. * @param {Array|string} path The path of the property to get.
  13112. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13113. * @returns {*} Returns the resolved value.
  13114. * @example
  13115. *
  13116. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13117. *
  13118. * _.get(object, 'a[0].b.c');
  13119. * // => 3
  13120. *
  13121. * _.get(object, ['a', '0', 'b', 'c']);
  13122. * // => 3
  13123. *
  13124. * _.get(object, 'a.b.c', 'default');
  13125. * // => 'default'
  13126. */
  13127. function get(object, path, defaultValue) {
  13128. var result = object == null ? undefined : baseGet(object, path);
  13129. return result === undefined ? defaultValue : result;
  13130. }
  13131. module.exports = get;
  13132. /***/ }),
  13133. /***/ 855:
  13134. /***/ (function(module, __unusedexports, __webpack_require__) {
  13135. module.exports = registerPlugin;
  13136. const factory = __webpack_require__(47);
  13137. function registerPlugin(plugins, pluginFunction) {
  13138. return factory(
  13139. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  13140. );
  13141. }
  13142. /***/ }),
  13143. /***/ 856:
  13144. /***/ (function(module, __unusedexports, __webpack_require__) {
  13145. module.exports = __webpack_require__(141);
  13146. /***/ }),
  13147. /***/ 863:
  13148. /***/ (function(module, __unusedexports, __webpack_require__) {
  13149. module.exports = authenticationBeforeRequest;
  13150. const btoa = __webpack_require__(675);
  13151. const withAuthorizationPrefix = __webpack_require__(143);
  13152. function authenticationBeforeRequest(state, options) {
  13153. if (typeof state.auth === "string") {
  13154. options.headers.authorization = withAuthorizationPrefix(state.auth);
  13155. return;
  13156. }
  13157. if (state.auth.username) {
  13158. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  13159. options.headers.authorization = `Basic ${hash}`;
  13160. if (state.otp) {
  13161. options.headers["x-github-otp"] = state.otp;
  13162. }
  13163. return;
  13164. }
  13165. if (state.auth.clientId) {
  13166. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  13167. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  13168. // URL though: `/applications/:client_id/tokens/:access_token`.
  13169. //
  13170. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  13171. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  13172. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  13173. //
  13174. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  13175. // as well as "/applications/123/tokens/token456"
  13176. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  13177. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  13178. options.headers.authorization = `Basic ${hash}`;
  13179. return;
  13180. }
  13181. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  13182. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  13183. return;
  13184. }
  13185. return Promise.resolve()
  13186. .then(() => {
  13187. return state.auth();
  13188. })
  13189. .then(authorization => {
  13190. options.headers.authorization = withAuthorizationPrefix(authorization);
  13191. });
  13192. }
  13193. /***/ }),
  13194. /***/ 866:
  13195. /***/ (function(module, __unusedexports, __webpack_require__) {
  13196. "use strict";
  13197. var shebangRegex = __webpack_require__(816);
  13198. module.exports = function (str) {
  13199. var match = str.match(shebangRegex);
  13200. if (!match) {
  13201. return null;
  13202. }
  13203. var arr = match[0].replace(/#! ?/, '').split(' ');
  13204. var bin = arr[0].split('/').pop();
  13205. var arg = arr[1];
  13206. return (bin === 'env' ?
  13207. arg :
  13208. bin + (arg ? ' ' + arg : '')
  13209. );
  13210. };
  13211. /***/ }),
  13212. /***/ 874:
  13213. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13214. "use strict";
  13215. // Copyright (c) Microsoft. All rights reserved.
  13216. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  13217. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13218. return new (P || (P = Promise))(function (resolve, reject) {
  13219. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13220. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13221. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  13222. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13223. });
  13224. };
  13225. Object.defineProperty(exports, "__esModule", { value: true });
  13226. const url = __webpack_require__(835);
  13227. const http = __webpack_require__(605);
  13228. const https = __webpack_require__(211);
  13229. let fs;
  13230. let tunnel;
  13231. var HttpCodes;
  13232. (function (HttpCodes) {
  13233. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  13234. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  13235. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  13236. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  13237. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  13238. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  13239. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  13240. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  13241. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  13242. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  13243. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  13244. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  13245. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  13246. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  13247. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  13248. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  13249. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  13250. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  13251. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  13252. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  13253. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  13254. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  13255. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  13256. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  13257. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  13258. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  13259. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  13260. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  13261. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  13262. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  13263. const ExponentialBackoffCeiling = 10;
  13264. const ExponentialBackoffTimeSlice = 5;
  13265. class HttpClientResponse {
  13266. constructor(message) {
  13267. this.message = message;
  13268. }
  13269. readBody() {
  13270. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  13271. let output = '';
  13272. this.message.on('data', (chunk) => {
  13273. output += chunk;
  13274. });
  13275. this.message.on('end', () => {
  13276. resolve(output);
  13277. });
  13278. }));
  13279. }
  13280. }
  13281. exports.HttpClientResponse = HttpClientResponse;
  13282. function isHttps(requestUrl) {
  13283. let parsedUrl = url.parse(requestUrl);
  13284. return parsedUrl.protocol === 'https:';
  13285. }
  13286. exports.isHttps = isHttps;
  13287. var EnvironmentVariables;
  13288. (function (EnvironmentVariables) {
  13289. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  13290. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  13291. })(EnvironmentVariables || (EnvironmentVariables = {}));
  13292. class HttpClient {
  13293. constructor(userAgent, handlers, requestOptions) {
  13294. this._ignoreSslError = false;
  13295. this._allowRedirects = true;
  13296. this._maxRedirects = 50;
  13297. this._allowRetries = false;
  13298. this._maxRetries = 1;
  13299. this._keepAlive = false;
  13300. this._disposed = false;
  13301. this.userAgent = userAgent;
  13302. this.handlers = handlers || [];
  13303. this.requestOptions = requestOptions;
  13304. if (requestOptions) {
  13305. if (requestOptions.ignoreSslError != null) {
  13306. this._ignoreSslError = requestOptions.ignoreSslError;
  13307. }
  13308. this._socketTimeout = requestOptions.socketTimeout;
  13309. this._httpProxy = requestOptions.proxy;
  13310. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  13311. this._httpProxyBypassHosts = [];
  13312. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  13313. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  13314. });
  13315. }
  13316. this._certConfig = requestOptions.cert;
  13317. if (this._certConfig) {
  13318. // If using cert, need fs
  13319. fs = __webpack_require__(747);
  13320. // cache the cert content into memory, so we don't have to read it from disk every time
  13321. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  13322. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  13323. }
  13324. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  13325. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  13326. }
  13327. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  13328. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  13329. }
  13330. }
  13331. if (requestOptions.allowRedirects != null) {
  13332. this._allowRedirects = requestOptions.allowRedirects;
  13333. }
  13334. if (requestOptions.maxRedirects != null) {
  13335. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  13336. }
  13337. if (requestOptions.keepAlive != null) {
  13338. this._keepAlive = requestOptions.keepAlive;
  13339. }
  13340. if (requestOptions.allowRetries != null) {
  13341. this._allowRetries = requestOptions.allowRetries;
  13342. }
  13343. if (requestOptions.maxRetries != null) {
  13344. this._maxRetries = requestOptions.maxRetries;
  13345. }
  13346. }
  13347. }
  13348. options(requestUrl, additionalHeaders) {
  13349. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  13350. }
  13351. get(requestUrl, additionalHeaders) {
  13352. return this.request('GET', requestUrl, null, additionalHeaders || {});
  13353. }
  13354. del(requestUrl, additionalHeaders) {
  13355. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  13356. }
  13357. post(requestUrl, data, additionalHeaders) {
  13358. return this.request('POST', requestUrl, data, additionalHeaders || {});
  13359. }
  13360. patch(requestUrl, data, additionalHeaders) {
  13361. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  13362. }
  13363. put(requestUrl, data, additionalHeaders) {
  13364. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  13365. }
  13366. head(requestUrl, additionalHeaders) {
  13367. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  13368. }
  13369. sendStream(verb, requestUrl, stream, additionalHeaders) {
  13370. return this.request(verb, requestUrl, stream, additionalHeaders);
  13371. }
  13372. /**
  13373. * Makes a raw http request.
  13374. * All other methods such as get, post, patch, and request ultimately call this.
  13375. * Prefer get, del, post and patch
  13376. */
  13377. request(verb, requestUrl, data, headers) {
  13378. return __awaiter(this, void 0, void 0, function* () {
  13379. if (this._disposed) {
  13380. throw new Error("Client has already been disposed.");
  13381. }
  13382. let info = this._prepareRequest(verb, requestUrl, headers);
  13383. // Only perform retries on reads since writes may not be idempotent.
  13384. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  13385. let numTries = 0;
  13386. let response;
  13387. while (numTries < maxTries) {
  13388. response = yield this.requestRaw(info, data);
  13389. // Check if it's an authentication challenge
  13390. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  13391. let authenticationHandler;
  13392. for (let i = 0; i < this.handlers.length; i++) {
  13393. if (this.handlers[i].canHandleAuthentication(response)) {
  13394. authenticationHandler = this.handlers[i];
  13395. break;
  13396. }
  13397. }
  13398. if (authenticationHandler) {
  13399. return authenticationHandler.handleAuthentication(this, info, data);
  13400. }
  13401. else {
  13402. // We have received an unauthorized response but have no handlers to handle it.
  13403. // Let the response return to the caller.
  13404. return response;
  13405. }
  13406. }
  13407. let redirectsRemaining = this._maxRedirects;
  13408. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  13409. && this._allowRedirects
  13410. && redirectsRemaining > 0) {
  13411. const redirectUrl = response.message.headers["location"];
  13412. if (!redirectUrl) {
  13413. // if there's no location to redirect to, we won't
  13414. break;
  13415. }
  13416. // we need to finish reading the response before reassigning response
  13417. // which will leak the open socket.
  13418. yield response.readBody();
  13419. // let's make the request with the new redirectUrl
  13420. info = this._prepareRequest(verb, redirectUrl, headers);
  13421. response = yield this.requestRaw(info, data);
  13422. redirectsRemaining--;
  13423. }
  13424. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  13425. // If not a retry code, return immediately instead of retrying
  13426. return response;
  13427. }
  13428. numTries += 1;
  13429. if (numTries < maxTries) {
  13430. yield response.readBody();
  13431. yield this._performExponentialBackoff(numTries);
  13432. }
  13433. }
  13434. return response;
  13435. });
  13436. }
  13437. /**
  13438. * Needs to be called if keepAlive is set to true in request options.
  13439. */
  13440. dispose() {
  13441. if (this._agent) {
  13442. this._agent.destroy();
  13443. }
  13444. this._disposed = true;
  13445. }
  13446. /**
  13447. * Raw request.
  13448. * @param info
  13449. * @param data
  13450. */
  13451. requestRaw(info, data) {
  13452. return new Promise((resolve, reject) => {
  13453. let callbackForResult = function (err, res) {
  13454. if (err) {
  13455. reject(err);
  13456. }
  13457. resolve(res);
  13458. };
  13459. this.requestRawWithCallback(info, data, callbackForResult);
  13460. });
  13461. }
  13462. /**
  13463. * Raw request with callback.
  13464. * @param info
  13465. * @param data
  13466. * @param onResult
  13467. */
  13468. requestRawWithCallback(info, data, onResult) {
  13469. let socket;
  13470. let isDataString = typeof (data) === 'string';
  13471. if (typeof (data) === 'string') {
  13472. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13473. }
  13474. let callbackCalled = false;
  13475. let handleResult = (err, res) => {
  13476. if (!callbackCalled) {
  13477. callbackCalled = true;
  13478. onResult(err, res);
  13479. }
  13480. };
  13481. let req = info.httpModule.request(info.options, (msg) => {
  13482. let res = new HttpClientResponse(msg);
  13483. handleResult(null, res);
  13484. });
  13485. req.on('socket', (sock) => {
  13486. socket = sock;
  13487. });
  13488. // If we ever get disconnected, we want the socket to timeout eventually
  13489. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13490. if (socket) {
  13491. socket.end();
  13492. }
  13493. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13494. });
  13495. req.on('error', function (err) {
  13496. // err has statusCode property
  13497. // res should have headers
  13498. handleResult(err, null);
  13499. });
  13500. if (data && typeof (data) === 'string') {
  13501. req.write(data, 'utf8');
  13502. }
  13503. if (data && typeof (data) !== 'string') {
  13504. data.on('close', function () {
  13505. req.end();
  13506. });
  13507. data.pipe(req);
  13508. }
  13509. else {
  13510. req.end();
  13511. }
  13512. }
  13513. _prepareRequest(method, requestUrl, headers) {
  13514. const info = {};
  13515. info.parsedUrl = url.parse(requestUrl);
  13516. const usingSsl = info.parsedUrl.protocol === 'https:';
  13517. info.httpModule = usingSsl ? https : http;
  13518. const defaultPort = usingSsl ? 443 : 80;
  13519. info.options = {};
  13520. info.options.host = info.parsedUrl.hostname;
  13521. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13522. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13523. info.options.method = method;
  13524. info.options.headers = this._mergeHeaders(headers);
  13525. info.options.headers["user-agent"] = this.userAgent;
  13526. info.options.agent = this._getAgent(requestUrl);
  13527. // gives handlers an opportunity to participate
  13528. if (this.handlers && !this._isPresigned(requestUrl)) {
  13529. this.handlers.forEach((handler) => {
  13530. handler.prepareRequest(info.options);
  13531. });
  13532. }
  13533. return info;
  13534. }
  13535. _isPresigned(requestUrl) {
  13536. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13537. const patterns = this.requestOptions.presignedUrlPatterns;
  13538. for (let i = 0; i < patterns.length; i++) {
  13539. if (requestUrl.match(patterns[i])) {
  13540. return true;
  13541. }
  13542. }
  13543. }
  13544. return false;
  13545. }
  13546. _mergeHeaders(headers) {
  13547. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13548. if (this.requestOptions && this.requestOptions.headers) {
  13549. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13550. }
  13551. return lowercaseKeys(headers || {});
  13552. }
  13553. _getAgent(requestUrl) {
  13554. let agent;
  13555. let proxy = this._getProxy(requestUrl);
  13556. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13557. if (this._keepAlive && useProxy) {
  13558. agent = this._proxyAgent;
  13559. }
  13560. if (this._keepAlive && !useProxy) {
  13561. agent = this._agent;
  13562. }
  13563. // if agent is already assigned use that agent.
  13564. if (!!agent) {
  13565. return agent;
  13566. }
  13567. let parsedUrl = url.parse(requestUrl);
  13568. const usingSsl = parsedUrl.protocol === 'https:';
  13569. let maxSockets = 100;
  13570. if (!!this.requestOptions) {
  13571. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13572. }
  13573. if (useProxy) {
  13574. // If using proxy, need tunnel
  13575. if (!tunnel) {
  13576. tunnel = __webpack_require__(856);
  13577. }
  13578. const agentOptions = {
  13579. maxSockets: maxSockets,
  13580. keepAlive: this._keepAlive,
  13581. proxy: {
  13582. proxyAuth: proxy.proxyAuth,
  13583. host: proxy.proxyUrl.hostname,
  13584. port: proxy.proxyUrl.port
  13585. },
  13586. };
  13587. let tunnelAgent;
  13588. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13589. if (usingSsl) {
  13590. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13591. }
  13592. else {
  13593. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13594. }
  13595. agent = tunnelAgent(agentOptions);
  13596. this._proxyAgent = agent;
  13597. }
  13598. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13599. if (this._keepAlive && !agent) {
  13600. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13601. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13602. this._agent = agent;
  13603. }
  13604. // if not using private agent and tunnel agent isn't setup then use global agent
  13605. if (!agent) {
  13606. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13607. }
  13608. if (usingSsl && this._ignoreSslError) {
  13609. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13610. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13611. // we have to cast it to any and change it directly
  13612. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13613. }
  13614. if (usingSsl && this._certConfig) {
  13615. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13616. }
  13617. return agent;
  13618. }
  13619. _getProxy(requestUrl) {
  13620. const parsedUrl = url.parse(requestUrl);
  13621. let usingSsl = parsedUrl.protocol === 'https:';
  13622. let proxyConfig = this._httpProxy;
  13623. // fallback to http_proxy and https_proxy env
  13624. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13625. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13626. if (!proxyConfig) {
  13627. if (https_proxy && usingSsl) {
  13628. proxyConfig = {
  13629. proxyUrl: https_proxy
  13630. };
  13631. }
  13632. else if (http_proxy) {
  13633. proxyConfig = {
  13634. proxyUrl: http_proxy
  13635. };
  13636. }
  13637. }
  13638. let proxyUrl;
  13639. let proxyAuth;
  13640. if (proxyConfig) {
  13641. if (proxyConfig.proxyUrl.length > 0) {
  13642. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13643. }
  13644. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13645. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13646. }
  13647. }
  13648. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13649. }
  13650. _isBypassProxy(requestUrl) {
  13651. if (!this._httpProxyBypassHosts) {
  13652. return false;
  13653. }
  13654. let bypass = false;
  13655. this._httpProxyBypassHosts.forEach(bypassHost => {
  13656. if (bypassHost.test(requestUrl)) {
  13657. bypass = true;
  13658. }
  13659. });
  13660. return bypass;
  13661. }
  13662. _performExponentialBackoff(retryNumber) {
  13663. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13664. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13665. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13666. }
  13667. }
  13668. exports.HttpClient = HttpClient;
  13669. /***/ }),
  13670. /***/ 881:
  13671. /***/ (function(module) {
  13672. "use strict";
  13673. const isWin = process.platform === 'win32';
  13674. function notFoundError(original, syscall) {
  13675. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13676. code: 'ENOENT',
  13677. errno: 'ENOENT',
  13678. syscall: `${syscall} ${original.command}`,
  13679. path: original.command,
  13680. spawnargs: original.args,
  13681. });
  13682. }
  13683. function hookChildProcess(cp, parsed) {
  13684. if (!isWin) {
  13685. return;
  13686. }
  13687. const originalEmit = cp.emit;
  13688. cp.emit = function (name, arg1) {
  13689. // If emitting "exit" event and exit code is 1, we need to check if
  13690. // the command exists and emit an "error" instead
  13691. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13692. if (name === 'exit') {
  13693. const err = verifyENOENT(arg1, parsed, 'spawn');
  13694. if (err) {
  13695. return originalEmit.call(cp, 'error', err);
  13696. }
  13697. }
  13698. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13699. };
  13700. }
  13701. function verifyENOENT(status, parsed) {
  13702. if (isWin && status === 1 && !parsed.file) {
  13703. return notFoundError(parsed.original, 'spawn');
  13704. }
  13705. return null;
  13706. }
  13707. function verifyENOENTSync(status, parsed) {
  13708. if (isWin && status === 1 && !parsed.file) {
  13709. return notFoundError(parsed.original, 'spawnSync');
  13710. }
  13711. return null;
  13712. }
  13713. module.exports = {
  13714. hookChildProcess,
  13715. verifyENOENT,
  13716. verifyENOENTSync,
  13717. notFoundError,
  13718. };
  13719. /***/ }),
  13720. /***/ 883:
  13721. /***/ (function(module) {
  13722. /**
  13723. * lodash (Custom Build) <https://lodash.com/>
  13724. * Build: `lodash modularize exports="npm" -o ./`
  13725. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13726. * Released under MIT license <https://lodash.com/license>
  13727. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13728. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13729. */
  13730. /** Used as the `TypeError` message for "Functions" methods. */
  13731. var FUNC_ERROR_TEXT = 'Expected a function';
  13732. /** Used to stand-in for `undefined` hash values. */
  13733. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13734. /** Used as references for various `Number` constants. */
  13735. var INFINITY = 1 / 0,
  13736. MAX_SAFE_INTEGER = 9007199254740991;
  13737. /** `Object#toString` result references. */
  13738. var funcTag = '[object Function]',
  13739. genTag = '[object GeneratorFunction]',
  13740. symbolTag = '[object Symbol]';
  13741. /** Used to match property names within property paths. */
  13742. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13743. reIsPlainProp = /^\w*$/,
  13744. reLeadingDot = /^\./,
  13745. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13746. /**
  13747. * Used to match `RegExp`
  13748. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13749. */
  13750. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13751. /** Used to match backslashes in property paths. */
  13752. var reEscapeChar = /\\(\\)?/g;
  13753. /** Used to detect host constructors (Safari). */
  13754. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13755. /** Used to detect unsigned integer values. */
  13756. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13757. /** Detect free variable `global` from Node.js. */
  13758. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13759. /** Detect free variable `self`. */
  13760. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13761. /** Used as a reference to the global object. */
  13762. var root = freeGlobal || freeSelf || Function('return this')();
  13763. /**
  13764. * Gets the value at `key` of `object`.
  13765. *
  13766. * @private
  13767. * @param {Object} [object] The object to query.
  13768. * @param {string} key The key of the property to get.
  13769. * @returns {*} Returns the property value.
  13770. */
  13771. function getValue(object, key) {
  13772. return object == null ? undefined : object[key];
  13773. }
  13774. /**
  13775. * Checks if `value` is a host object in IE < 9.
  13776. *
  13777. * @private
  13778. * @param {*} value The value to check.
  13779. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13780. */
  13781. function isHostObject(value) {
  13782. // Many host objects are `Object` objects that can coerce to strings
  13783. // despite having improperly defined `toString` methods.
  13784. var result = false;
  13785. if (value != null && typeof value.toString != 'function') {
  13786. try {
  13787. result = !!(value + '');
  13788. } catch (e) {}
  13789. }
  13790. return result;
  13791. }
  13792. /** Used for built-in method references. */
  13793. var arrayProto = Array.prototype,
  13794. funcProto = Function.prototype,
  13795. objectProto = Object.prototype;
  13796. /** Used to detect overreaching core-js shims. */
  13797. var coreJsData = root['__core-js_shared__'];
  13798. /** Used to detect methods masquerading as native. */
  13799. var maskSrcKey = (function() {
  13800. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  13801. return uid ? ('Symbol(src)_1.' + uid) : '';
  13802. }());
  13803. /** Used to resolve the decompiled source of functions. */
  13804. var funcToString = funcProto.toString;
  13805. /** Used to check objects for own properties. */
  13806. var hasOwnProperty = objectProto.hasOwnProperty;
  13807. /**
  13808. * Used to resolve the
  13809. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  13810. * of values.
  13811. */
  13812. var objectToString = objectProto.toString;
  13813. /** Used to detect if a method is native. */
  13814. var reIsNative = RegExp('^' +
  13815. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  13816. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  13817. );
  13818. /** Built-in value references. */
  13819. var Symbol = root.Symbol,
  13820. splice = arrayProto.splice;
  13821. /* Built-in method references that are verified to be native. */
  13822. var Map = getNative(root, 'Map'),
  13823. nativeCreate = getNative(Object, 'create');
  13824. /** Used to convert symbols to primitives and strings. */
  13825. var symbolProto = Symbol ? Symbol.prototype : undefined,
  13826. symbolToString = symbolProto ? symbolProto.toString : undefined;
  13827. /**
  13828. * Creates a hash object.
  13829. *
  13830. * @private
  13831. * @constructor
  13832. * @param {Array} [entries] The key-value pairs to cache.
  13833. */
  13834. function Hash(entries) {
  13835. var index = -1,
  13836. length = entries ? entries.length : 0;
  13837. this.clear();
  13838. while (++index < length) {
  13839. var entry = entries[index];
  13840. this.set(entry[0], entry[1]);
  13841. }
  13842. }
  13843. /**
  13844. * Removes all key-value entries from the hash.
  13845. *
  13846. * @private
  13847. * @name clear
  13848. * @memberOf Hash
  13849. */
  13850. function hashClear() {
  13851. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  13852. }
  13853. /**
  13854. * Removes `key` and its value from the hash.
  13855. *
  13856. * @private
  13857. * @name delete
  13858. * @memberOf Hash
  13859. * @param {Object} hash The hash to modify.
  13860. * @param {string} key The key of the value to remove.
  13861. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13862. */
  13863. function hashDelete(key) {
  13864. return this.has(key) && delete this.__data__[key];
  13865. }
  13866. /**
  13867. * Gets the hash value for `key`.
  13868. *
  13869. * @private
  13870. * @name get
  13871. * @memberOf Hash
  13872. * @param {string} key The key of the value to get.
  13873. * @returns {*} Returns the entry value.
  13874. */
  13875. function hashGet(key) {
  13876. var data = this.__data__;
  13877. if (nativeCreate) {
  13878. var result = data[key];
  13879. return result === HASH_UNDEFINED ? undefined : result;
  13880. }
  13881. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  13882. }
  13883. /**
  13884. * Checks if a hash value for `key` exists.
  13885. *
  13886. * @private
  13887. * @name has
  13888. * @memberOf Hash
  13889. * @param {string} key The key of the entry to check.
  13890. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13891. */
  13892. function hashHas(key) {
  13893. var data = this.__data__;
  13894. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  13895. }
  13896. /**
  13897. * Sets the hash `key` to `value`.
  13898. *
  13899. * @private
  13900. * @name set
  13901. * @memberOf Hash
  13902. * @param {string} key The key of the value to set.
  13903. * @param {*} value The value to set.
  13904. * @returns {Object} Returns the hash instance.
  13905. */
  13906. function hashSet(key, value) {
  13907. var data = this.__data__;
  13908. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  13909. return this;
  13910. }
  13911. // Add methods to `Hash`.
  13912. Hash.prototype.clear = hashClear;
  13913. Hash.prototype['delete'] = hashDelete;
  13914. Hash.prototype.get = hashGet;
  13915. Hash.prototype.has = hashHas;
  13916. Hash.prototype.set = hashSet;
  13917. /**
  13918. * Creates an list cache object.
  13919. *
  13920. * @private
  13921. * @constructor
  13922. * @param {Array} [entries] The key-value pairs to cache.
  13923. */
  13924. function ListCache(entries) {
  13925. var index = -1,
  13926. length = entries ? entries.length : 0;
  13927. this.clear();
  13928. while (++index < length) {
  13929. var entry = entries[index];
  13930. this.set(entry[0], entry[1]);
  13931. }
  13932. }
  13933. /**
  13934. * Removes all key-value entries from the list cache.
  13935. *
  13936. * @private
  13937. * @name clear
  13938. * @memberOf ListCache
  13939. */
  13940. function listCacheClear() {
  13941. this.__data__ = [];
  13942. }
  13943. /**
  13944. * Removes `key` and its value from the list cache.
  13945. *
  13946. * @private
  13947. * @name delete
  13948. * @memberOf ListCache
  13949. * @param {string} key The key of the value to remove.
  13950. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13951. */
  13952. function listCacheDelete(key) {
  13953. var data = this.__data__,
  13954. index = assocIndexOf(data, key);
  13955. if (index < 0) {
  13956. return false;
  13957. }
  13958. var lastIndex = data.length - 1;
  13959. if (index == lastIndex) {
  13960. data.pop();
  13961. } else {
  13962. splice.call(data, index, 1);
  13963. }
  13964. return true;
  13965. }
  13966. /**
  13967. * Gets the list cache value for `key`.
  13968. *
  13969. * @private
  13970. * @name get
  13971. * @memberOf ListCache
  13972. * @param {string} key The key of the value to get.
  13973. * @returns {*} Returns the entry value.
  13974. */
  13975. function listCacheGet(key) {
  13976. var data = this.__data__,
  13977. index = assocIndexOf(data, key);
  13978. return index < 0 ? undefined : data[index][1];
  13979. }
  13980. /**
  13981. * Checks if a list cache value for `key` exists.
  13982. *
  13983. * @private
  13984. * @name has
  13985. * @memberOf ListCache
  13986. * @param {string} key The key of the entry to check.
  13987. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13988. */
  13989. function listCacheHas(key) {
  13990. return assocIndexOf(this.__data__, key) > -1;
  13991. }
  13992. /**
  13993. * Sets the list cache `key` to `value`.
  13994. *
  13995. * @private
  13996. * @name set
  13997. * @memberOf ListCache
  13998. * @param {string} key The key of the value to set.
  13999. * @param {*} value The value to set.
  14000. * @returns {Object} Returns the list cache instance.
  14001. */
  14002. function listCacheSet(key, value) {
  14003. var data = this.__data__,
  14004. index = assocIndexOf(data, key);
  14005. if (index < 0) {
  14006. data.push([key, value]);
  14007. } else {
  14008. data[index][1] = value;
  14009. }
  14010. return this;
  14011. }
  14012. // Add methods to `ListCache`.
  14013. ListCache.prototype.clear = listCacheClear;
  14014. ListCache.prototype['delete'] = listCacheDelete;
  14015. ListCache.prototype.get = listCacheGet;
  14016. ListCache.prototype.has = listCacheHas;
  14017. ListCache.prototype.set = listCacheSet;
  14018. /**
  14019. * Creates a map cache object to store key-value pairs.
  14020. *
  14021. * @private
  14022. * @constructor
  14023. * @param {Array} [entries] The key-value pairs to cache.
  14024. */
  14025. function MapCache(entries) {
  14026. var index = -1,
  14027. length = entries ? entries.length : 0;
  14028. this.clear();
  14029. while (++index < length) {
  14030. var entry = entries[index];
  14031. this.set(entry[0], entry[1]);
  14032. }
  14033. }
  14034. /**
  14035. * Removes all key-value entries from the map.
  14036. *
  14037. * @private
  14038. * @name clear
  14039. * @memberOf MapCache
  14040. */
  14041. function mapCacheClear() {
  14042. this.__data__ = {
  14043. 'hash': new Hash,
  14044. 'map': new (Map || ListCache),
  14045. 'string': new Hash
  14046. };
  14047. }
  14048. /**
  14049. * Removes `key` and its value from the map.
  14050. *
  14051. * @private
  14052. * @name delete
  14053. * @memberOf MapCache
  14054. * @param {string} key The key of the value to remove.
  14055. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  14056. */
  14057. function mapCacheDelete(key) {
  14058. return getMapData(this, key)['delete'](key);
  14059. }
  14060. /**
  14061. * Gets the map value for `key`.
  14062. *
  14063. * @private
  14064. * @name get
  14065. * @memberOf MapCache
  14066. * @param {string} key The key of the value to get.
  14067. * @returns {*} Returns the entry value.
  14068. */
  14069. function mapCacheGet(key) {
  14070. return getMapData(this, key).get(key);
  14071. }
  14072. /**
  14073. * Checks if a map value for `key` exists.
  14074. *
  14075. * @private
  14076. * @name has
  14077. * @memberOf MapCache
  14078. * @param {string} key The key of the entry to check.
  14079. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14080. */
  14081. function mapCacheHas(key) {
  14082. return getMapData(this, key).has(key);
  14083. }
  14084. /**
  14085. * Sets the map `key` to `value`.
  14086. *
  14087. * @private
  14088. * @name set
  14089. * @memberOf MapCache
  14090. * @param {string} key The key of the value to set.
  14091. * @param {*} value The value to set.
  14092. * @returns {Object} Returns the map cache instance.
  14093. */
  14094. function mapCacheSet(key, value) {
  14095. getMapData(this, key).set(key, value);
  14096. return this;
  14097. }
  14098. // Add methods to `MapCache`.
  14099. MapCache.prototype.clear = mapCacheClear;
  14100. MapCache.prototype['delete'] = mapCacheDelete;
  14101. MapCache.prototype.get = mapCacheGet;
  14102. MapCache.prototype.has = mapCacheHas;
  14103. MapCache.prototype.set = mapCacheSet;
  14104. /**
  14105. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  14106. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14107. * for equality comparisons.
  14108. *
  14109. * @private
  14110. * @param {Object} object The object to modify.
  14111. * @param {string} key The key of the property to assign.
  14112. * @param {*} value The value to assign.
  14113. */
  14114. function assignValue(object, key, value) {
  14115. var objValue = object[key];
  14116. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  14117. (value === undefined && !(key in object))) {
  14118. object[key] = value;
  14119. }
  14120. }
  14121. /**
  14122. * Gets the index at which the `key` is found in `array` of key-value pairs.
  14123. *
  14124. * @private
  14125. * @param {Array} array The array to inspect.
  14126. * @param {*} key The key to search for.
  14127. * @returns {number} Returns the index of the matched value, else `-1`.
  14128. */
  14129. function assocIndexOf(array, key) {
  14130. var length = array.length;
  14131. while (length--) {
  14132. if (eq(array[length][0], key)) {
  14133. return length;
  14134. }
  14135. }
  14136. return -1;
  14137. }
  14138. /**
  14139. * The base implementation of `_.isNative` without bad shim checks.
  14140. *
  14141. * @private
  14142. * @param {*} value The value to check.
  14143. * @returns {boolean} Returns `true` if `value` is a native function,
  14144. * else `false`.
  14145. */
  14146. function baseIsNative(value) {
  14147. if (!isObject(value) || isMasked(value)) {
  14148. return false;
  14149. }
  14150. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  14151. return pattern.test(toSource(value));
  14152. }
  14153. /**
  14154. * The base implementation of `_.set`.
  14155. *
  14156. * @private
  14157. * @param {Object} object The object to modify.
  14158. * @param {Array|string} path The path of the property to set.
  14159. * @param {*} value The value to set.
  14160. * @param {Function} [customizer] The function to customize path creation.
  14161. * @returns {Object} Returns `object`.
  14162. */
  14163. function baseSet(object, path, value, customizer) {
  14164. if (!isObject(object)) {
  14165. return object;
  14166. }
  14167. path = isKey(path, object) ? [path] : castPath(path);
  14168. var index = -1,
  14169. length = path.length,
  14170. lastIndex = length - 1,
  14171. nested = object;
  14172. while (nested != null && ++index < length) {
  14173. var key = toKey(path[index]),
  14174. newValue = value;
  14175. if (index != lastIndex) {
  14176. var objValue = nested[key];
  14177. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  14178. if (newValue === undefined) {
  14179. newValue = isObject(objValue)
  14180. ? objValue
  14181. : (isIndex(path[index + 1]) ? [] : {});
  14182. }
  14183. }
  14184. assignValue(nested, key, newValue);
  14185. nested = nested[key];
  14186. }
  14187. return object;
  14188. }
  14189. /**
  14190. * The base implementation of `_.toString` which doesn't convert nullish
  14191. * values to empty strings.
  14192. *
  14193. * @private
  14194. * @param {*} value The value to process.
  14195. * @returns {string} Returns the string.
  14196. */
  14197. function baseToString(value) {
  14198. // Exit early for strings to avoid a performance hit in some environments.
  14199. if (typeof value == 'string') {
  14200. return value;
  14201. }
  14202. if (isSymbol(value)) {
  14203. return symbolToString ? symbolToString.call(value) : '';
  14204. }
  14205. var result = (value + '');
  14206. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14207. }
  14208. /**
  14209. * Casts `value` to a path array if it's not one.
  14210. *
  14211. * @private
  14212. * @param {*} value The value to inspect.
  14213. * @returns {Array} Returns the cast property path array.
  14214. */
  14215. function castPath(value) {
  14216. return isArray(value) ? value : stringToPath(value);
  14217. }
  14218. /**
  14219. * Gets the data for `map`.
  14220. *
  14221. * @private
  14222. * @param {Object} map The map to query.
  14223. * @param {string} key The reference key.
  14224. * @returns {*} Returns the map data.
  14225. */
  14226. function getMapData(map, key) {
  14227. var data = map.__data__;
  14228. return isKeyable(key)
  14229. ? data[typeof key == 'string' ? 'string' : 'hash']
  14230. : data.map;
  14231. }
  14232. /**
  14233. * Gets the native function at `key` of `object`.
  14234. *
  14235. * @private
  14236. * @param {Object} object The object to query.
  14237. * @param {string} key The key of the method to get.
  14238. * @returns {*} Returns the function if it's native, else `undefined`.
  14239. */
  14240. function getNative(object, key) {
  14241. var value = getValue(object, key);
  14242. return baseIsNative(value) ? value : undefined;
  14243. }
  14244. /**
  14245. * Checks if `value` is a valid array-like index.
  14246. *
  14247. * @private
  14248. * @param {*} value The value to check.
  14249. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  14250. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  14251. */
  14252. function isIndex(value, length) {
  14253. length = length == null ? MAX_SAFE_INTEGER : length;
  14254. return !!length &&
  14255. (typeof value == 'number' || reIsUint.test(value)) &&
  14256. (value > -1 && value % 1 == 0 && value < length);
  14257. }
  14258. /**
  14259. * Checks if `value` is a property name and not a property path.
  14260. *
  14261. * @private
  14262. * @param {*} value The value to check.
  14263. * @param {Object} [object] The object to query keys on.
  14264. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  14265. */
  14266. function isKey(value, object) {
  14267. if (isArray(value)) {
  14268. return false;
  14269. }
  14270. var type = typeof value;
  14271. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  14272. value == null || isSymbol(value)) {
  14273. return true;
  14274. }
  14275. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  14276. (object != null && value in Object(object));
  14277. }
  14278. /**
  14279. * Checks if `value` is suitable for use as unique object key.
  14280. *
  14281. * @private
  14282. * @param {*} value The value to check.
  14283. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  14284. */
  14285. function isKeyable(value) {
  14286. var type = typeof value;
  14287. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  14288. ? (value !== '__proto__')
  14289. : (value === null);
  14290. }
  14291. /**
  14292. * Checks if `func` has its source masked.
  14293. *
  14294. * @private
  14295. * @param {Function} func The function to check.
  14296. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  14297. */
  14298. function isMasked(func) {
  14299. return !!maskSrcKey && (maskSrcKey in func);
  14300. }
  14301. /**
  14302. * Converts `string` to a property path array.
  14303. *
  14304. * @private
  14305. * @param {string} string The string to convert.
  14306. * @returns {Array} Returns the property path array.
  14307. */
  14308. var stringToPath = memoize(function(string) {
  14309. string = toString(string);
  14310. var result = [];
  14311. if (reLeadingDot.test(string)) {
  14312. result.push('');
  14313. }
  14314. string.replace(rePropName, function(match, number, quote, string) {
  14315. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  14316. });
  14317. return result;
  14318. });
  14319. /**
  14320. * Converts `value` to a string key if it's not a string or symbol.
  14321. *
  14322. * @private
  14323. * @param {*} value The value to inspect.
  14324. * @returns {string|symbol} Returns the key.
  14325. */
  14326. function toKey(value) {
  14327. if (typeof value == 'string' || isSymbol(value)) {
  14328. return value;
  14329. }
  14330. var result = (value + '');
  14331. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14332. }
  14333. /**
  14334. * Converts `func` to its source code.
  14335. *
  14336. * @private
  14337. * @param {Function} func The function to process.
  14338. * @returns {string} Returns the source code.
  14339. */
  14340. function toSource(func) {
  14341. if (func != null) {
  14342. try {
  14343. return funcToString.call(func);
  14344. } catch (e) {}
  14345. try {
  14346. return (func + '');
  14347. } catch (e) {}
  14348. }
  14349. return '';
  14350. }
  14351. /**
  14352. * Creates a function that memoizes the result of `func`. If `resolver` is
  14353. * provided, it determines the cache key for storing the result based on the
  14354. * arguments provided to the memoized function. By default, the first argument
  14355. * provided to the memoized function is used as the map cache key. The `func`
  14356. * is invoked with the `this` binding of the memoized function.
  14357. *
  14358. * **Note:** The cache is exposed as the `cache` property on the memoized
  14359. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  14360. * constructor with one whose instances implement the
  14361. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  14362. * method interface of `delete`, `get`, `has`, and `set`.
  14363. *
  14364. * @static
  14365. * @memberOf _
  14366. * @since 0.1.0
  14367. * @category Function
  14368. * @param {Function} func The function to have its output memoized.
  14369. * @param {Function} [resolver] The function to resolve the cache key.
  14370. * @returns {Function} Returns the new memoized function.
  14371. * @example
  14372. *
  14373. * var object = { 'a': 1, 'b': 2 };
  14374. * var other = { 'c': 3, 'd': 4 };
  14375. *
  14376. * var values = _.memoize(_.values);
  14377. * values(object);
  14378. * // => [1, 2]
  14379. *
  14380. * values(other);
  14381. * // => [3, 4]
  14382. *
  14383. * object.a = 2;
  14384. * values(object);
  14385. * // => [1, 2]
  14386. *
  14387. * // Modify the result cache.
  14388. * values.cache.set(object, ['a', 'b']);
  14389. * values(object);
  14390. * // => ['a', 'b']
  14391. *
  14392. * // Replace `_.memoize.Cache`.
  14393. * _.memoize.Cache = WeakMap;
  14394. */
  14395. function memoize(func, resolver) {
  14396. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  14397. throw new TypeError(FUNC_ERROR_TEXT);
  14398. }
  14399. var memoized = function() {
  14400. var args = arguments,
  14401. key = resolver ? resolver.apply(this, args) : args[0],
  14402. cache = memoized.cache;
  14403. if (cache.has(key)) {
  14404. return cache.get(key);
  14405. }
  14406. var result = func.apply(this, args);
  14407. memoized.cache = cache.set(key, result);
  14408. return result;
  14409. };
  14410. memoized.cache = new (memoize.Cache || MapCache);
  14411. return memoized;
  14412. }
  14413. // Assign cache to `_.memoize`.
  14414. memoize.Cache = MapCache;
  14415. /**
  14416. * Performs a
  14417. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14418. * comparison between two values to determine if they are equivalent.
  14419. *
  14420. * @static
  14421. * @memberOf _
  14422. * @since 4.0.0
  14423. * @category Lang
  14424. * @param {*} value The value to compare.
  14425. * @param {*} other The other value to compare.
  14426. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  14427. * @example
  14428. *
  14429. * var object = { 'a': 1 };
  14430. * var other = { 'a': 1 };
  14431. *
  14432. * _.eq(object, object);
  14433. * // => true
  14434. *
  14435. * _.eq(object, other);
  14436. * // => false
  14437. *
  14438. * _.eq('a', 'a');
  14439. * // => true
  14440. *
  14441. * _.eq('a', Object('a'));
  14442. * // => false
  14443. *
  14444. * _.eq(NaN, NaN);
  14445. * // => true
  14446. */
  14447. function eq(value, other) {
  14448. return value === other || (value !== value && other !== other);
  14449. }
  14450. /**
  14451. * Checks if `value` is classified as an `Array` object.
  14452. *
  14453. * @static
  14454. * @memberOf _
  14455. * @since 0.1.0
  14456. * @category Lang
  14457. * @param {*} value The value to check.
  14458. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14459. * @example
  14460. *
  14461. * _.isArray([1, 2, 3]);
  14462. * // => true
  14463. *
  14464. * _.isArray(document.body.children);
  14465. * // => false
  14466. *
  14467. * _.isArray('abc');
  14468. * // => false
  14469. *
  14470. * _.isArray(_.noop);
  14471. * // => false
  14472. */
  14473. var isArray = Array.isArray;
  14474. /**
  14475. * Checks if `value` is classified as a `Function` object.
  14476. *
  14477. * @static
  14478. * @memberOf _
  14479. * @since 0.1.0
  14480. * @category Lang
  14481. * @param {*} value The value to check.
  14482. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14483. * @example
  14484. *
  14485. * _.isFunction(_);
  14486. * // => true
  14487. *
  14488. * _.isFunction(/abc/);
  14489. * // => false
  14490. */
  14491. function isFunction(value) {
  14492. // The use of `Object#toString` avoids issues with the `typeof` operator
  14493. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14494. var tag = isObject(value) ? objectToString.call(value) : '';
  14495. return tag == funcTag || tag == genTag;
  14496. }
  14497. /**
  14498. * Checks if `value` is the
  14499. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14500. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14501. *
  14502. * @static
  14503. * @memberOf _
  14504. * @since 0.1.0
  14505. * @category Lang
  14506. * @param {*} value The value to check.
  14507. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14508. * @example
  14509. *
  14510. * _.isObject({});
  14511. * // => true
  14512. *
  14513. * _.isObject([1, 2, 3]);
  14514. * // => true
  14515. *
  14516. * _.isObject(_.noop);
  14517. * // => true
  14518. *
  14519. * _.isObject(null);
  14520. * // => false
  14521. */
  14522. function isObject(value) {
  14523. var type = typeof value;
  14524. return !!value && (type == 'object' || type == 'function');
  14525. }
  14526. /**
  14527. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14528. * and has a `typeof` result of "object".
  14529. *
  14530. * @static
  14531. * @memberOf _
  14532. * @since 4.0.0
  14533. * @category Lang
  14534. * @param {*} value The value to check.
  14535. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14536. * @example
  14537. *
  14538. * _.isObjectLike({});
  14539. * // => true
  14540. *
  14541. * _.isObjectLike([1, 2, 3]);
  14542. * // => true
  14543. *
  14544. * _.isObjectLike(_.noop);
  14545. * // => false
  14546. *
  14547. * _.isObjectLike(null);
  14548. * // => false
  14549. */
  14550. function isObjectLike(value) {
  14551. return !!value && typeof value == 'object';
  14552. }
  14553. /**
  14554. * Checks if `value` is classified as a `Symbol` primitive or object.
  14555. *
  14556. * @static
  14557. * @memberOf _
  14558. * @since 4.0.0
  14559. * @category Lang
  14560. * @param {*} value The value to check.
  14561. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14562. * @example
  14563. *
  14564. * _.isSymbol(Symbol.iterator);
  14565. * // => true
  14566. *
  14567. * _.isSymbol('abc');
  14568. * // => false
  14569. */
  14570. function isSymbol(value) {
  14571. return typeof value == 'symbol' ||
  14572. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14573. }
  14574. /**
  14575. * Converts `value` to a string. An empty string is returned for `null`
  14576. * and `undefined` values. The sign of `-0` is preserved.
  14577. *
  14578. * @static
  14579. * @memberOf _
  14580. * @since 4.0.0
  14581. * @category Lang
  14582. * @param {*} value The value to process.
  14583. * @returns {string} Returns the string.
  14584. * @example
  14585. *
  14586. * _.toString(null);
  14587. * // => ''
  14588. *
  14589. * _.toString(-0);
  14590. * // => '-0'
  14591. *
  14592. * _.toString([1, 2, 3]);
  14593. * // => '1,2,3'
  14594. */
  14595. function toString(value) {
  14596. return value == null ? '' : baseToString(value);
  14597. }
  14598. /**
  14599. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14600. * it's created. Arrays are created for missing index properties while objects
  14601. * are created for all other missing properties. Use `_.setWith` to customize
  14602. * `path` creation.
  14603. *
  14604. * **Note:** This method mutates `object`.
  14605. *
  14606. * @static
  14607. * @memberOf _
  14608. * @since 3.7.0
  14609. * @category Object
  14610. * @param {Object} object The object to modify.
  14611. * @param {Array|string} path The path of the property to set.
  14612. * @param {*} value The value to set.
  14613. * @returns {Object} Returns `object`.
  14614. * @example
  14615. *
  14616. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14617. *
  14618. * _.set(object, 'a[0].b.c', 4);
  14619. * console.log(object.a[0].b.c);
  14620. * // => 4
  14621. *
  14622. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14623. * console.log(object.x[0].y.z);
  14624. * // => 5
  14625. */
  14626. function set(object, path, value) {
  14627. return object == null ? object : baseSet(object, path, value);
  14628. }
  14629. module.exports = set;
  14630. /***/ }),
  14631. /***/ 898:
  14632. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14633. "use strict";
  14634. Object.defineProperty(exports, '__esModule', { value: true });
  14635. var request = __webpack_require__(753);
  14636. var universalUserAgent = __webpack_require__(796);
  14637. const VERSION = "4.3.1";
  14638. class GraphqlError extends Error {
  14639. constructor(request, response) {
  14640. const message = response.data.errors[0].message;
  14641. super(message);
  14642. Object.assign(this, response.data);
  14643. this.name = "GraphqlError";
  14644. this.request = request; // Maintains proper stack trace (only available on V8)
  14645. /* istanbul ignore next */
  14646. if (Error.captureStackTrace) {
  14647. Error.captureStackTrace(this, this.constructor);
  14648. }
  14649. }
  14650. }
  14651. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14652. function graphql(request, query, options) {
  14653. options = typeof query === "string" ? options = Object.assign({
  14654. query
  14655. }, options) : options = query;
  14656. const requestOptions = Object.keys(options).reduce((result, key) => {
  14657. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14658. result[key] = options[key];
  14659. return result;
  14660. }
  14661. if (!result.variables) {
  14662. result.variables = {};
  14663. }
  14664. result.variables[key] = options[key];
  14665. return result;
  14666. }, {});
  14667. return request(requestOptions).then(response => {
  14668. if (response.data.errors) {
  14669. throw new GraphqlError(requestOptions, {
  14670. data: response.data
  14671. });
  14672. }
  14673. return response.data.data;
  14674. });
  14675. }
  14676. function withDefaults(request$1, newDefaults) {
  14677. const newRequest = request$1.defaults(newDefaults);
  14678. const newApi = (query, options) => {
  14679. return graphql(newRequest, query, options);
  14680. };
  14681. return Object.assign(newApi, {
  14682. defaults: withDefaults.bind(null, newRequest),
  14683. endpoint: request.request.endpoint
  14684. });
  14685. }
  14686. const graphql$1 = withDefaults(request.request, {
  14687. headers: {
  14688. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14689. },
  14690. method: "POST",
  14691. url: "/graphql"
  14692. });
  14693. function withCustomRequest(customRequest) {
  14694. return withDefaults(customRequest, {
  14695. method: "POST",
  14696. url: "/graphql"
  14697. });
  14698. }
  14699. exports.graphql = graphql$1;
  14700. exports.withCustomRequest = withCustomRequest;
  14701. //# sourceMappingURL=index.js.map
  14702. /***/ }),
  14703. /***/ 899:
  14704. /***/ (function(module, __unusedexports, __webpack_require__) {
  14705. module.exports = registerEndpoints;
  14706. const { Deprecation } = __webpack_require__(692);
  14707. function registerEndpoints(octokit, routes) {
  14708. Object.keys(routes).forEach(namespaceName => {
  14709. if (!octokit[namespaceName]) {
  14710. octokit[namespaceName] = {};
  14711. }
  14712. Object.keys(routes[namespaceName]).forEach(apiName => {
  14713. const apiOptions = routes[namespaceName][apiName];
  14714. const endpointDefaults = ["method", "url", "headers"].reduce(
  14715. (map, key) => {
  14716. if (typeof apiOptions[key] !== "undefined") {
  14717. map[key] = apiOptions[key];
  14718. }
  14719. return map;
  14720. },
  14721. {}
  14722. );
  14723. endpointDefaults.request = {
  14724. validate: apiOptions.params
  14725. };
  14726. let request = octokit.request.defaults(endpointDefaults);
  14727. // patch request & endpoint methods to support deprecated parameters.
  14728. // Not the most elegant solution, but we don’t want to move deprecation
  14729. // logic into octokit/endpoint.js as it’s out of scope
  14730. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14731. key => apiOptions.params[key].deprecated
  14732. );
  14733. if (hasDeprecatedParam) {
  14734. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14735. request = patch(
  14736. octokit.request.defaults(endpointDefaults),
  14737. `.${namespaceName}.${apiName}()`
  14738. );
  14739. request.endpoint = patch(
  14740. request.endpoint,
  14741. `.${namespaceName}.${apiName}.endpoint()`
  14742. );
  14743. request.endpoint.merge = patch(
  14744. request.endpoint.merge,
  14745. `.${namespaceName}.${apiName}.endpoint.merge()`
  14746. );
  14747. }
  14748. if (apiOptions.deprecated) {
  14749. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14750. octokit.log.warn(
  14751. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14752. );
  14753. octokit[namespaceName][apiName] = request;
  14754. return request.apply(null, arguments);
  14755. };
  14756. return;
  14757. }
  14758. octokit[namespaceName][apiName] = request;
  14759. });
  14760. });
  14761. }
  14762. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14763. const patchedMethod = options => {
  14764. options = Object.assign({}, options);
  14765. Object.keys(options).forEach(key => {
  14766. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14767. const aliasKey = apiOptions.params[key].alias;
  14768. octokit.log.warn(
  14769. new Deprecation(
  14770. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14771. )
  14772. );
  14773. if (!(aliasKey in options)) {
  14774. options[aliasKey] = options[key];
  14775. }
  14776. delete options[key];
  14777. }
  14778. });
  14779. return method(options);
  14780. };
  14781. Object.keys(method).forEach(key => {
  14782. patchedMethod[key] = method[key];
  14783. });
  14784. return patchedMethod;
  14785. }
  14786. /***/ }),
  14787. /***/ 929:
  14788. /***/ (function(module, __unusedexports, __webpack_require__) {
  14789. module.exports = hasNextPage
  14790. const deprecate = __webpack_require__(370)
  14791. const getPageLinks = __webpack_require__(577)
  14792. function hasNextPage (link) {
  14793. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  14794. return getPageLinks(link).next
  14795. }
  14796. /***/ }),
  14797. /***/ 948:
  14798. /***/ (function(module) {
  14799. "use strict";
  14800. /**
  14801. * Tries to execute a function and discards any error that occurs.
  14802. * @param {Function} fn - Function that might or might not throw an error.
  14803. * @returns {?*} Return-value of the function when no error occurred.
  14804. */
  14805. module.exports = function(fn) {
  14806. try { return fn() } catch (e) {}
  14807. }
  14808. /***/ }),
  14809. /***/ 950:
  14810. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14811. "use strict";
  14812. Object.defineProperty(exports, "__esModule", { value: true });
  14813. const url = __webpack_require__(835);
  14814. function getProxyUrl(reqUrl) {
  14815. let usingSsl = reqUrl.protocol === 'https:';
  14816. let proxyUrl;
  14817. if (checkBypass(reqUrl)) {
  14818. return proxyUrl;
  14819. }
  14820. let proxyVar;
  14821. if (usingSsl) {
  14822. proxyVar = process.env["https_proxy"] ||
  14823. process.env["HTTPS_PROXY"];
  14824. }
  14825. else {
  14826. proxyVar = process.env["http_proxy"] ||
  14827. process.env["HTTP_PROXY"];
  14828. }
  14829. if (proxyVar) {
  14830. proxyUrl = url.parse(proxyVar);
  14831. }
  14832. return proxyUrl;
  14833. }
  14834. exports.getProxyUrl = getProxyUrl;
  14835. function checkBypass(reqUrl) {
  14836. if (!reqUrl.hostname) {
  14837. return false;
  14838. }
  14839. let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
  14840. if (!noProxy) {
  14841. return false;
  14842. }
  14843. // Determine the request port
  14844. let reqPort;
  14845. if (reqUrl.port) {
  14846. reqPort = Number(reqUrl.port);
  14847. }
  14848. else if (reqUrl.protocol === 'http:') {
  14849. reqPort = 80;
  14850. }
  14851. else if (reqUrl.protocol === 'https:') {
  14852. reqPort = 443;
  14853. }
  14854. // Format the request hostname and hostname with port
  14855. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  14856. if (typeof reqPort === 'number') {
  14857. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  14858. }
  14859. // Compare request host against noproxy
  14860. for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
  14861. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  14862. return true;
  14863. }
  14864. }
  14865. return false;
  14866. }
  14867. exports.checkBypass = checkBypass;
  14868. /***/ }),
  14869. /***/ 954:
  14870. /***/ (function(module) {
  14871. module.exports = validateAuth;
  14872. function validateAuth(auth) {
  14873. if (typeof auth === "string") {
  14874. return;
  14875. }
  14876. if (typeof auth === "function") {
  14877. return;
  14878. }
  14879. if (auth.username && auth.password) {
  14880. return;
  14881. }
  14882. if (auth.clientId && auth.clientSecret) {
  14883. return;
  14884. }
  14885. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  14886. }
  14887. /***/ }),
  14888. /***/ 955:
  14889. /***/ (function(module, __unusedexports, __webpack_require__) {
  14890. "use strict";
  14891. const path = __webpack_require__(622);
  14892. const childProcess = __webpack_require__(129);
  14893. const crossSpawn = __webpack_require__(20);
  14894. const stripEof = __webpack_require__(768);
  14895. const npmRunPath = __webpack_require__(621);
  14896. const isStream = __webpack_require__(323);
  14897. const _getStream = __webpack_require__(145);
  14898. const pFinally = __webpack_require__(697);
  14899. const onExit = __webpack_require__(260);
  14900. const errname = __webpack_require__(427);
  14901. const stdio = __webpack_require__(168);
  14902. const TEN_MEGABYTES = 1000 * 1000 * 10;
  14903. function handleArgs(cmd, args, opts) {
  14904. let parsed;
  14905. opts = Object.assign({
  14906. extendEnv: true,
  14907. env: {}
  14908. }, opts);
  14909. if (opts.extendEnv) {
  14910. opts.env = Object.assign({}, process.env, opts.env);
  14911. }
  14912. if (opts.__winShell === true) {
  14913. delete opts.__winShell;
  14914. parsed = {
  14915. command: cmd,
  14916. args,
  14917. options: opts,
  14918. file: cmd,
  14919. original: {
  14920. cmd,
  14921. args
  14922. }
  14923. };
  14924. } else {
  14925. parsed = crossSpawn._parse(cmd, args, opts);
  14926. }
  14927. opts = Object.assign({
  14928. maxBuffer: TEN_MEGABYTES,
  14929. buffer: true,
  14930. stripEof: true,
  14931. preferLocal: true,
  14932. localDir: parsed.options.cwd || process.cwd(),
  14933. encoding: 'utf8',
  14934. reject: true,
  14935. cleanup: true
  14936. }, parsed.options);
  14937. opts.stdio = stdio(opts);
  14938. if (opts.preferLocal) {
  14939. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  14940. }
  14941. if (opts.detached) {
  14942. // #115
  14943. opts.cleanup = false;
  14944. }
  14945. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  14946. // #116
  14947. parsed.args.unshift('/q');
  14948. }
  14949. return {
  14950. cmd: parsed.command,
  14951. args: parsed.args,
  14952. opts,
  14953. parsed
  14954. };
  14955. }
  14956. function handleInput(spawned, input) {
  14957. if (input === null || input === undefined) {
  14958. return;
  14959. }
  14960. if (isStream(input)) {
  14961. input.pipe(spawned.stdin);
  14962. } else {
  14963. spawned.stdin.end(input);
  14964. }
  14965. }
  14966. function handleOutput(opts, val) {
  14967. if (val && opts.stripEof) {
  14968. val = stripEof(val);
  14969. }
  14970. return val;
  14971. }
  14972. function handleShell(fn, cmd, opts) {
  14973. let file = '/bin/sh';
  14974. let args = ['-c', cmd];
  14975. opts = Object.assign({}, opts);
  14976. if (process.platform === 'win32') {
  14977. opts.__winShell = true;
  14978. file = process.env.comspec || 'cmd.exe';
  14979. args = ['/s', '/c', `"${cmd}"`];
  14980. opts.windowsVerbatimArguments = true;
  14981. }
  14982. if (opts.shell) {
  14983. file = opts.shell;
  14984. delete opts.shell;
  14985. }
  14986. return fn(file, args, opts);
  14987. }
  14988. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  14989. if (!process[stream]) {
  14990. return null;
  14991. }
  14992. let ret;
  14993. if (!buffer) {
  14994. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  14995. ret = new Promise((resolve, reject) => {
  14996. process[stream]
  14997. .once('end', resolve)
  14998. .once('error', reject);
  14999. });
  15000. } else if (encoding) {
  15001. ret = _getStream(process[stream], {
  15002. encoding,
  15003. maxBuffer
  15004. });
  15005. } else {
  15006. ret = _getStream.buffer(process[stream], {maxBuffer});
  15007. }
  15008. return ret.catch(err => {
  15009. err.stream = stream;
  15010. err.message = `${stream} ${err.message}`;
  15011. throw err;
  15012. });
  15013. }
  15014. function makeError(result, options) {
  15015. const {stdout, stderr} = result;
  15016. let err = result.error;
  15017. const {code, signal} = result;
  15018. const {parsed, joinedCmd} = options;
  15019. const timedOut = options.timedOut || false;
  15020. if (!err) {
  15021. let output = '';
  15022. if (Array.isArray(parsed.opts.stdio)) {
  15023. if (parsed.opts.stdio[2] !== 'inherit') {
  15024. output += output.length > 0 ? stderr : `\n${stderr}`;
  15025. }
  15026. if (parsed.opts.stdio[1] !== 'inherit') {
  15027. output += `\n${stdout}`;
  15028. }
  15029. } else if (parsed.opts.stdio !== 'inherit') {
  15030. output = `\n${stderr}${stdout}`;
  15031. }
  15032. err = new Error(`Command failed: ${joinedCmd}${output}`);
  15033. err.code = code < 0 ? errname(code) : code;
  15034. }
  15035. err.stdout = stdout;
  15036. err.stderr = stderr;
  15037. err.failed = true;
  15038. err.signal = signal || null;
  15039. err.cmd = joinedCmd;
  15040. err.timedOut = timedOut;
  15041. return err;
  15042. }
  15043. function joinCmd(cmd, args) {
  15044. let joinedCmd = cmd;
  15045. if (Array.isArray(args) && args.length > 0) {
  15046. joinedCmd += ' ' + args.join(' ');
  15047. }
  15048. return joinedCmd;
  15049. }
  15050. module.exports = (cmd, args, opts) => {
  15051. const parsed = handleArgs(cmd, args, opts);
  15052. const {encoding, buffer, maxBuffer} = parsed.opts;
  15053. const joinedCmd = joinCmd(cmd, args);
  15054. let spawned;
  15055. try {
  15056. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  15057. } catch (err) {
  15058. return Promise.reject(err);
  15059. }
  15060. let removeExitHandler;
  15061. if (parsed.opts.cleanup) {
  15062. removeExitHandler = onExit(() => {
  15063. spawned.kill();
  15064. });
  15065. }
  15066. let timeoutId = null;
  15067. let timedOut = false;
  15068. const cleanup = () => {
  15069. if (timeoutId) {
  15070. clearTimeout(timeoutId);
  15071. timeoutId = null;
  15072. }
  15073. if (removeExitHandler) {
  15074. removeExitHandler();
  15075. }
  15076. };
  15077. if (parsed.opts.timeout > 0) {
  15078. timeoutId = setTimeout(() => {
  15079. timeoutId = null;
  15080. timedOut = true;
  15081. spawned.kill(parsed.opts.killSignal);
  15082. }, parsed.opts.timeout);
  15083. }
  15084. const processDone = new Promise(resolve => {
  15085. spawned.on('exit', (code, signal) => {
  15086. cleanup();
  15087. resolve({code, signal});
  15088. });
  15089. spawned.on('error', err => {
  15090. cleanup();
  15091. resolve({error: err});
  15092. });
  15093. if (spawned.stdin) {
  15094. spawned.stdin.on('error', err => {
  15095. cleanup();
  15096. resolve({error: err});
  15097. });
  15098. }
  15099. });
  15100. function destroy() {
  15101. if (spawned.stdout) {
  15102. spawned.stdout.destroy();
  15103. }
  15104. if (spawned.stderr) {
  15105. spawned.stderr.destroy();
  15106. }
  15107. }
  15108. const handlePromise = () => pFinally(Promise.all([
  15109. processDone,
  15110. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  15111. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  15112. ]).then(arr => {
  15113. const result = arr[0];
  15114. result.stdout = arr[1];
  15115. result.stderr = arr[2];
  15116. if (result.error || result.code !== 0 || result.signal !== null) {
  15117. const err = makeError(result, {
  15118. joinedCmd,
  15119. parsed,
  15120. timedOut
  15121. });
  15122. // TODO: missing some timeout logic for killed
  15123. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  15124. // err.killed = spawned.killed || killed;
  15125. err.killed = err.killed || spawned.killed;
  15126. if (!parsed.opts.reject) {
  15127. return err;
  15128. }
  15129. throw err;
  15130. }
  15131. return {
  15132. stdout: handleOutput(parsed.opts, result.stdout),
  15133. stderr: handleOutput(parsed.opts, result.stderr),
  15134. code: 0,
  15135. failed: false,
  15136. killed: false,
  15137. signal: null,
  15138. cmd: joinedCmd,
  15139. timedOut: false
  15140. };
  15141. }), destroy);
  15142. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  15143. handleInput(spawned, parsed.opts.input);
  15144. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  15145. spawned.catch = onrejected => handlePromise().catch(onrejected);
  15146. return spawned;
  15147. };
  15148. // TODO: set `stderr: 'ignore'` when that option is implemented
  15149. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  15150. // TODO: set `stdout: 'ignore'` when that option is implemented
  15151. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  15152. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  15153. module.exports.sync = (cmd, args, opts) => {
  15154. const parsed = handleArgs(cmd, args, opts);
  15155. const joinedCmd = joinCmd(cmd, args);
  15156. if (isStream(parsed.opts.input)) {
  15157. throw new TypeError('The `input` option cannot be a stream in sync mode');
  15158. }
  15159. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  15160. result.code = result.status;
  15161. if (result.error || result.status !== 0 || result.signal !== null) {
  15162. const err = makeError(result, {
  15163. joinedCmd,
  15164. parsed
  15165. });
  15166. if (!parsed.opts.reject) {
  15167. return err;
  15168. }
  15169. throw err;
  15170. }
  15171. return {
  15172. stdout: handleOutput(parsed.opts, result.stdout),
  15173. stderr: handleOutput(parsed.opts, result.stderr),
  15174. code: 0,
  15175. failed: false,
  15176. signal: null,
  15177. cmd: joinedCmd,
  15178. timedOut: false
  15179. };
  15180. };
  15181. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  15182. /***/ }),
  15183. /***/ 966:
  15184. /***/ (function(module, __unusedexports, __webpack_require__) {
  15185. "use strict";
  15186. const {PassThrough} = __webpack_require__(413);
  15187. module.exports = options => {
  15188. options = Object.assign({}, options);
  15189. const {array} = options;
  15190. let {encoding} = options;
  15191. const buffer = encoding === 'buffer';
  15192. let objectMode = false;
  15193. if (array) {
  15194. objectMode = !(encoding || buffer);
  15195. } else {
  15196. encoding = encoding || 'utf8';
  15197. }
  15198. if (buffer) {
  15199. encoding = null;
  15200. }
  15201. let len = 0;
  15202. const ret = [];
  15203. const stream = new PassThrough({objectMode});
  15204. if (encoding) {
  15205. stream.setEncoding(encoding);
  15206. }
  15207. stream.on('data', chunk => {
  15208. ret.push(chunk);
  15209. if (objectMode) {
  15210. len = ret.length;
  15211. } else {
  15212. len += chunk.length;
  15213. }
  15214. });
  15215. stream.getBufferedValue = () => {
  15216. if (array) {
  15217. return ret;
  15218. }
  15219. return buffer ? Buffer.concat(ret, len) : ret.join('');
  15220. };
  15221. stream.getBufferedLength = () => len;
  15222. return stream;
  15223. };
  15224. /***/ }),
  15225. /***/ 969:
  15226. /***/ (function(module, __unusedexports, __webpack_require__) {
  15227. var wrappy = __webpack_require__(11)
  15228. module.exports = wrappy(once)
  15229. module.exports.strict = wrappy(onceStrict)
  15230. once.proto = once(function () {
  15231. Object.defineProperty(Function.prototype, 'once', {
  15232. value: function () {
  15233. return once(this)
  15234. },
  15235. configurable: true
  15236. })
  15237. Object.defineProperty(Function.prototype, 'onceStrict', {
  15238. value: function () {
  15239. return onceStrict(this)
  15240. },
  15241. configurable: true
  15242. })
  15243. })
  15244. function once (fn) {
  15245. var f = function () {
  15246. if (f.called) return f.value
  15247. f.called = true
  15248. return f.value = fn.apply(this, arguments)
  15249. }
  15250. f.called = false
  15251. return f
  15252. }
  15253. function onceStrict (fn) {
  15254. var f = function () {
  15255. if (f.called)
  15256. throw new Error(f.onceError)
  15257. f.called = true
  15258. return f.value = fn.apply(this, arguments)
  15259. }
  15260. var name = fn.name || 'Function wrapped with `once`'
  15261. f.onceError = name + " shouldn't be called more than once"
  15262. f.called = false
  15263. return f
  15264. }
  15265. /***/ }),
  15266. /***/ 986:
  15267. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  15268. "use strict";
  15269. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  15270. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  15271. return new (P || (P = Promise))(function (resolve, reject) {
  15272. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  15273. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  15274. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  15275. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15276. });
  15277. };
  15278. Object.defineProperty(exports, "__esModule", { value: true });
  15279. const tr = __webpack_require__(9);
  15280. /**
  15281. * Exec a command.
  15282. * Output will be streamed to the live console.
  15283. * Returns promise with return code
  15284. *
  15285. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  15286. * @param args optional arguments for tool. Escaping is handled by the lib.
  15287. * @param options optional exec options. See ExecOptions
  15288. * @returns Promise<number> exit code
  15289. */
  15290. function exec(commandLine, args, options) {
  15291. return __awaiter(this, void 0, void 0, function* () {
  15292. const commandArgs = tr.argStringToArray(commandLine);
  15293. if (commandArgs.length === 0) {
  15294. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  15295. }
  15296. // Path to tool to execute should be first arg
  15297. const toolPath = commandArgs[0];
  15298. args = commandArgs.slice(1).concat(args || []);
  15299. const runner = new tr.ToolRunner(toolPath, args, options);
  15300. return runner.exec();
  15301. });
  15302. }
  15303. exports.exec = exec;
  15304. //# sourceMappingURL=exec.js.map
  15305. /***/ }),
  15306. /***/ 991:
  15307. /***/ (function(module, __unusedexports, __webpack_require__) {
  15308. module.exports = authenticationRequestError;
  15309. const { RequestError } = __webpack_require__(463);
  15310. function authenticationRequestError(state, error, options) {
  15311. if (!error.headers) throw error;
  15312. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  15313. // handle "2FA required" error only
  15314. if (error.status !== 401 || !otpRequired) {
  15315. throw error;
  15316. }
  15317. if (
  15318. error.status === 401 &&
  15319. otpRequired &&
  15320. error.request &&
  15321. error.request.headers["x-github-otp"]
  15322. ) {
  15323. if (state.otp) {
  15324. delete state.otp; // no longer valid, request again
  15325. } else {
  15326. throw new RequestError(
  15327. "Invalid one-time password for two-factor authentication",
  15328. 401,
  15329. {
  15330. headers: error.headers,
  15331. request: options
  15332. }
  15333. );
  15334. }
  15335. }
  15336. if (typeof state.auth.on2fa !== "function") {
  15337. throw new RequestError(
  15338. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  15339. 401,
  15340. {
  15341. headers: error.headers,
  15342. request: options
  15343. }
  15344. );
  15345. }
  15346. return Promise.resolve()
  15347. .then(() => {
  15348. return state.auth.on2fa();
  15349. })
  15350. .then(oneTimePassword => {
  15351. const newOptions = Object.assign(options, {
  15352. headers: Object.assign(options.headers, {
  15353. "x-github-otp": oneTimePassword
  15354. })
  15355. });
  15356. return state.octokit.request(newOptions).then(response => {
  15357. // If OTP still valid, then persist it for following requests
  15358. state.otp = oneTimePassword;
  15359. return response;
  15360. });
  15361. });
  15362. }
  15363. /***/ })
  15364. /******/ });