index.js 676 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506175071750817509175101751117512175131751417515175161751717518175191752017521175221752317524175251752617527175281752917530175311753217533175341753517536175371753817539175401754117542175431754417545175461754717548175491755017551175521755317554175551755617557175581755917560175611756217563175641756517566175671756817569175701757117572175731757417575175761757717578175791758017581175821758317584175851758617587175881758917590175911759217593175941759517596175971759817599176001760117602176031760417605176061760717608176091761017611176121761317614176151761617617176181761917620176211762217623176241762517626176271762817629176301763117632176331763417635176361763717638176391764017641176421764317644176451764617647176481764917650176511765217653176541765517656176571765817659176601766117662176631766417665
  1. module.exports =
  2. /******/ (function(modules, runtime) { // webpackBootstrap
  3. /******/ "use strict";
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ __webpack_require__.ab = __dirname + "/";
  33. /******/
  34. /******/ // the startup function
  35. /******/ function startup() {
  36. /******/ // Load entry module and return exports
  37. /******/ return __webpack_require__(198);
  38. /******/ };
  39. /******/
  40. /******/ // run startup
  41. /******/ return startup();
  42. /******/ })
  43. /************************************************************************/
  44. /******/ ({
  45. /***/ 0:
  46. /***/ (function(module, __unusedexports, __webpack_require__) {
  47. const Octokit = __webpack_require__(529);
  48. const CORE_PLUGINS = [
  49. __webpack_require__(190),
  50. __webpack_require__(19), // deprecated: remove in v17
  51. __webpack_require__(372),
  52. __webpack_require__(148),
  53. __webpack_require__(248),
  54. __webpack_require__(586),
  55. __webpack_require__(430),
  56. __webpack_require__(850) // deprecated: remove in v17
  57. ];
  58. module.exports = Octokit.plugin(CORE_PLUGINS);
  59. /***/ }),
  60. /***/ 1:
  61. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  62. "use strict";
  63. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  64. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  65. return new (P || (P = Promise))(function (resolve, reject) {
  66. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  67. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  68. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  69. step((generator = generator.apply(thisArg, _arguments || [])).next());
  70. });
  71. };
  72. Object.defineProperty(exports, "__esModule", { value: true });
  73. const childProcess = __webpack_require__(129);
  74. const path = __webpack_require__(622);
  75. const util_1 = __webpack_require__(669);
  76. const ioUtil = __webpack_require__(672);
  77. const exec = util_1.promisify(childProcess.exec);
  78. /**
  79. * Copies a file or folder.
  80. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  81. *
  82. * @param source source path
  83. * @param dest destination path
  84. * @param options optional. See CopyOptions.
  85. */
  86. function cp(source, dest, options = {}) {
  87. return __awaiter(this, void 0, void 0, function* () {
  88. const { force, recursive } = readCopyOptions(options);
  89. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  90. // Dest is an existing file, but not forcing
  91. if (destStat && destStat.isFile() && !force) {
  92. return;
  93. }
  94. // If dest is an existing directory, should copy inside.
  95. const newDest = destStat && destStat.isDirectory()
  96. ? path.join(dest, path.basename(source))
  97. : dest;
  98. if (!(yield ioUtil.exists(source))) {
  99. throw new Error(`no such file or directory: ${source}`);
  100. }
  101. const sourceStat = yield ioUtil.stat(source);
  102. if (sourceStat.isDirectory()) {
  103. if (!recursive) {
  104. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  105. }
  106. else {
  107. yield cpDirRecursive(source, newDest, 0, force);
  108. }
  109. }
  110. else {
  111. if (path.relative(source, newDest) === '') {
  112. // a file cannot be copied to itself
  113. throw new Error(`'${newDest}' and '${source}' are the same file`);
  114. }
  115. yield copyFile(source, newDest, force);
  116. }
  117. });
  118. }
  119. exports.cp = cp;
  120. /**
  121. * Moves a path.
  122. *
  123. * @param source source path
  124. * @param dest destination path
  125. * @param options optional. See MoveOptions.
  126. */
  127. function mv(source, dest, options = {}) {
  128. return __awaiter(this, void 0, void 0, function* () {
  129. if (yield ioUtil.exists(dest)) {
  130. let destExists = true;
  131. if (yield ioUtil.isDirectory(dest)) {
  132. // If dest is directory copy src into dest
  133. dest = path.join(dest, path.basename(source));
  134. destExists = yield ioUtil.exists(dest);
  135. }
  136. if (destExists) {
  137. if (options.force == null || options.force) {
  138. yield rmRF(dest);
  139. }
  140. else {
  141. throw new Error('Destination already exists');
  142. }
  143. }
  144. }
  145. yield mkdirP(path.dirname(dest));
  146. yield ioUtil.rename(source, dest);
  147. });
  148. }
  149. exports.mv = mv;
  150. /**
  151. * Remove a path recursively with force
  152. *
  153. * @param inputPath path to remove
  154. */
  155. function rmRF(inputPath) {
  156. return __awaiter(this, void 0, void 0, function* () {
  157. if (ioUtil.IS_WINDOWS) {
  158. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  159. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  160. try {
  161. if (yield ioUtil.isDirectory(inputPath, true)) {
  162. yield exec(`rd /s /q "${inputPath}"`);
  163. }
  164. else {
  165. yield exec(`del /f /a "${inputPath}"`);
  166. }
  167. }
  168. catch (err) {
  169. // if you try to delete a file that doesn't exist, desired result is achieved
  170. // other errors are valid
  171. if (err.code !== 'ENOENT')
  172. throw err;
  173. }
  174. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  175. try {
  176. yield ioUtil.unlink(inputPath);
  177. }
  178. catch (err) {
  179. // if you try to delete a file that doesn't exist, desired result is achieved
  180. // other errors are valid
  181. if (err.code !== 'ENOENT')
  182. throw err;
  183. }
  184. }
  185. else {
  186. let isDir = false;
  187. try {
  188. isDir = yield ioUtil.isDirectory(inputPath);
  189. }
  190. catch (err) {
  191. // if you try to delete a file that doesn't exist, desired result is achieved
  192. // other errors are valid
  193. if (err.code !== 'ENOENT')
  194. throw err;
  195. return;
  196. }
  197. if (isDir) {
  198. yield exec(`rm -rf "${inputPath}"`);
  199. }
  200. else {
  201. yield ioUtil.unlink(inputPath);
  202. }
  203. }
  204. });
  205. }
  206. exports.rmRF = rmRF;
  207. /**
  208. * Make a directory. Creates the full path with folders in between
  209. * Will throw if it fails
  210. *
  211. * @param fsPath path to create
  212. * @returns Promise<void>
  213. */
  214. function mkdirP(fsPath) {
  215. return __awaiter(this, void 0, void 0, function* () {
  216. yield ioUtil.mkdirP(fsPath);
  217. });
  218. }
  219. exports.mkdirP = mkdirP;
  220. /**
  221. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  222. * If you check and the tool does not exist, it will throw.
  223. *
  224. * @param tool name of the tool
  225. * @param check whether to check if tool exists
  226. * @returns Promise<string> path to tool
  227. */
  228. function which(tool, check) {
  229. return __awaiter(this, void 0, void 0, function* () {
  230. if (!tool) {
  231. throw new Error("parameter 'tool' is required");
  232. }
  233. // recursive when check=true
  234. if (check) {
  235. const result = yield which(tool, false);
  236. if (!result) {
  237. if (ioUtil.IS_WINDOWS) {
  238. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
  239. }
  240. else {
  241. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
  242. }
  243. }
  244. }
  245. try {
  246. // build the list of extensions to try
  247. const extensions = [];
  248. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  249. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  250. if (extension) {
  251. extensions.push(extension);
  252. }
  253. }
  254. }
  255. // if it's rooted, return it if exists. otherwise return empty.
  256. if (ioUtil.isRooted(tool)) {
  257. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  258. if (filePath) {
  259. return filePath;
  260. }
  261. return '';
  262. }
  263. // if any path separators, return empty
  264. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  265. return '';
  266. }
  267. // build the list of directories
  268. //
  269. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  270. // it feels like we should not do this. Checking the current directory seems like more of a use
  271. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  272. // across platforms.
  273. const directories = [];
  274. if (process.env.PATH) {
  275. for (const p of process.env.PATH.split(path.delimiter)) {
  276. if (p) {
  277. directories.push(p);
  278. }
  279. }
  280. }
  281. // return the first match
  282. for (const directory of directories) {
  283. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  284. if (filePath) {
  285. return filePath;
  286. }
  287. }
  288. return '';
  289. }
  290. catch (err) {
  291. throw new Error(`which failed with message ${err.message}`);
  292. }
  293. });
  294. }
  295. exports.which = which;
  296. function readCopyOptions(options) {
  297. const force = options.force == null ? true : options.force;
  298. const recursive = Boolean(options.recursive);
  299. return { force, recursive };
  300. }
  301. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  302. return __awaiter(this, void 0, void 0, function* () {
  303. // Ensure there is not a run away recursive copy
  304. if (currentDepth >= 255)
  305. return;
  306. currentDepth++;
  307. yield mkdirP(destDir);
  308. const files = yield ioUtil.readdir(sourceDir);
  309. for (const fileName of files) {
  310. const srcFile = `${sourceDir}/${fileName}`;
  311. const destFile = `${destDir}/${fileName}`;
  312. const srcFileStat = yield ioUtil.lstat(srcFile);
  313. if (srcFileStat.isDirectory()) {
  314. // Recurse
  315. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  316. }
  317. else {
  318. yield copyFile(srcFile, destFile, force);
  319. }
  320. }
  321. // Change the mode for the newly created directory
  322. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  323. });
  324. }
  325. // Buffered file copy
  326. function copyFile(srcFile, destFile, force) {
  327. return __awaiter(this, void 0, void 0, function* () {
  328. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  329. // unlink/re-link it
  330. try {
  331. yield ioUtil.lstat(destFile);
  332. yield ioUtil.unlink(destFile);
  333. }
  334. catch (e) {
  335. // Try to override file permission
  336. if (e.code === 'EPERM') {
  337. yield ioUtil.chmod(destFile, '0666');
  338. yield ioUtil.unlink(destFile);
  339. }
  340. // other errors = it doesn't exist, no work to do
  341. }
  342. // Copy over symlink
  343. const symlinkFull = yield ioUtil.readlink(srcFile);
  344. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  345. }
  346. else if (!(yield ioUtil.exists(destFile)) || force) {
  347. yield ioUtil.copyFile(srcFile, destFile);
  348. }
  349. });
  350. }
  351. //# sourceMappingURL=io.js.map
  352. /***/ }),
  353. /***/ 2:
  354. /***/ (function(module, __unusedexports, __webpack_require__) {
  355. "use strict";
  356. const os = __webpack_require__(87);
  357. const macosRelease = __webpack_require__(118);
  358. const winRelease = __webpack_require__(49);
  359. const osName = (platform, release) => {
  360. if (!platform && release) {
  361. throw new Error('You can\'t specify a `release` without specifying `platform`');
  362. }
  363. platform = platform || os.platform();
  364. let id;
  365. if (platform === 'darwin') {
  366. if (!release && os.platform() === 'darwin') {
  367. release = os.release();
  368. }
  369. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  370. id = release ? macosRelease(release).name : '';
  371. return prefix + (id ? ' ' + id : '');
  372. }
  373. if (platform === 'linux') {
  374. if (!release && os.platform() === 'linux') {
  375. release = os.release();
  376. }
  377. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  378. return 'Linux' + (id ? ' ' + id : '');
  379. }
  380. if (platform === 'win32') {
  381. if (!release && os.platform() === 'win32') {
  382. release = os.release();
  383. }
  384. id = release ? winRelease(release) : '';
  385. return 'Windows' + (id ? ' ' + id : '');
  386. }
  387. return platform;
  388. };
  389. module.exports = osName;
  390. /***/ }),
  391. /***/ 8:
  392. /***/ (function(module, __unusedexports, __webpack_require__) {
  393. module.exports = iterator;
  394. const normalizePaginatedListResponse = __webpack_require__(301);
  395. function iterator(octokit, options) {
  396. const headers = options.headers;
  397. let url = octokit.request.endpoint(options).url;
  398. return {
  399. [Symbol.asyncIterator]: () => ({
  400. next() {
  401. if (!url) {
  402. return Promise.resolve({ done: true });
  403. }
  404. return octokit
  405. .request({ url, headers })
  406. .then(response => {
  407. normalizePaginatedListResponse(octokit, url, response);
  408. // `response.headers.link` format:
  409. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  410. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  411. url = ((response.headers.link || "").match(
  412. /<([^>]+)>;\s*rel="next"/
  413. ) || [])[1];
  414. return { value: response };
  415. });
  416. }
  417. })
  418. };
  419. }
  420. /***/ }),
  421. /***/ 9:
  422. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  423. "use strict";
  424. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  425. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  426. return new (P || (P = Promise))(function (resolve, reject) {
  427. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  428. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  429. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  430. step((generator = generator.apply(thisArg, _arguments || [])).next());
  431. });
  432. };
  433. Object.defineProperty(exports, "__esModule", { value: true });
  434. const os = __webpack_require__(87);
  435. const events = __webpack_require__(614);
  436. const child = __webpack_require__(129);
  437. /* eslint-disable @typescript-eslint/unbound-method */
  438. const IS_WINDOWS = process.platform === 'win32';
  439. /*
  440. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  441. */
  442. class ToolRunner extends events.EventEmitter {
  443. constructor(toolPath, args, options) {
  444. super();
  445. if (!toolPath) {
  446. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  447. }
  448. this.toolPath = toolPath;
  449. this.args = args || [];
  450. this.options = options || {};
  451. }
  452. _debug(message) {
  453. if (this.options.listeners && this.options.listeners.debug) {
  454. this.options.listeners.debug(message);
  455. }
  456. }
  457. _getCommandString(options, noPrefix) {
  458. const toolPath = this._getSpawnFileName();
  459. const args = this._getSpawnArgs(options);
  460. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  461. if (IS_WINDOWS) {
  462. // Windows + cmd file
  463. if (this._isCmdFile()) {
  464. cmd += toolPath;
  465. for (const a of args) {
  466. cmd += ` ${a}`;
  467. }
  468. }
  469. // Windows + verbatim
  470. else if (options.windowsVerbatimArguments) {
  471. cmd += `"${toolPath}"`;
  472. for (const a of args) {
  473. cmd += ` ${a}`;
  474. }
  475. }
  476. // Windows (regular)
  477. else {
  478. cmd += this._windowsQuoteCmdArg(toolPath);
  479. for (const a of args) {
  480. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  481. }
  482. }
  483. }
  484. else {
  485. // OSX/Linux - this can likely be improved with some form of quoting.
  486. // creating processes on Unix is fundamentally different than Windows.
  487. // on Unix, execvp() takes an arg array.
  488. cmd += toolPath;
  489. for (const a of args) {
  490. cmd += ` ${a}`;
  491. }
  492. }
  493. return cmd;
  494. }
  495. _processLineBuffer(data, strBuffer, onLine) {
  496. try {
  497. let s = strBuffer + data.toString();
  498. let n = s.indexOf(os.EOL);
  499. while (n > -1) {
  500. const line = s.substring(0, n);
  501. onLine(line);
  502. // the rest of the string ...
  503. s = s.substring(n + os.EOL.length);
  504. n = s.indexOf(os.EOL);
  505. }
  506. strBuffer = s;
  507. }
  508. catch (err) {
  509. // streaming lines to console is best effort. Don't fail a build.
  510. this._debug(`error processing line. Failed with error ${err}`);
  511. }
  512. }
  513. _getSpawnFileName() {
  514. if (IS_WINDOWS) {
  515. if (this._isCmdFile()) {
  516. return process.env['COMSPEC'] || 'cmd.exe';
  517. }
  518. }
  519. return this.toolPath;
  520. }
  521. _getSpawnArgs(options) {
  522. if (IS_WINDOWS) {
  523. if (this._isCmdFile()) {
  524. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  525. for (const a of this.args) {
  526. argline += ' ';
  527. argline += options.windowsVerbatimArguments
  528. ? a
  529. : this._windowsQuoteCmdArg(a);
  530. }
  531. argline += '"';
  532. return [argline];
  533. }
  534. }
  535. return this.args;
  536. }
  537. _endsWith(str, end) {
  538. return str.endsWith(end);
  539. }
  540. _isCmdFile() {
  541. const upperToolPath = this.toolPath.toUpperCase();
  542. return (this._endsWith(upperToolPath, '.CMD') ||
  543. this._endsWith(upperToolPath, '.BAT'));
  544. }
  545. _windowsQuoteCmdArg(arg) {
  546. // for .exe, apply the normal quoting rules that libuv applies
  547. if (!this._isCmdFile()) {
  548. return this._uvQuoteCmdArg(arg);
  549. }
  550. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  551. // the libuv rules are generic and are not designed specifically for cmd.exe
  552. // command line parser.
  553. //
  554. // for a detailed description of the cmd.exe command line parser, refer to
  555. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  556. // need quotes for empty arg
  557. if (!arg) {
  558. return '""';
  559. }
  560. // determine whether the arg needs to be quoted
  561. const cmdSpecialChars = [
  562. ' ',
  563. '\t',
  564. '&',
  565. '(',
  566. ')',
  567. '[',
  568. ']',
  569. '{',
  570. '}',
  571. '^',
  572. '=',
  573. ';',
  574. '!',
  575. "'",
  576. '+',
  577. ',',
  578. '`',
  579. '~',
  580. '|',
  581. '<',
  582. '>',
  583. '"'
  584. ];
  585. let needsQuotes = false;
  586. for (const char of arg) {
  587. if (cmdSpecialChars.some(x => x === char)) {
  588. needsQuotes = true;
  589. break;
  590. }
  591. }
  592. // short-circuit if quotes not needed
  593. if (!needsQuotes) {
  594. return arg;
  595. }
  596. // the following quoting rules are very similar to the rules that by libuv applies.
  597. //
  598. // 1) wrap the string in quotes
  599. //
  600. // 2) double-up quotes - i.e. " => ""
  601. //
  602. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  603. // doesn't work well with a cmd.exe command line.
  604. //
  605. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  606. // for example, the command line:
  607. // foo.exe "myarg:""my val"""
  608. // is parsed by a .NET console app into an arg array:
  609. // [ "myarg:\"my val\"" ]
  610. // which is the same end result when applying libuv quoting rules. although the actual
  611. // command line from libuv quoting rules would look like:
  612. // foo.exe "myarg:\"my val\""
  613. //
  614. // 3) double-up slashes that precede a quote,
  615. // e.g. hello \world => "hello \world"
  616. // hello\"world => "hello\\""world"
  617. // hello\\"world => "hello\\\\""world"
  618. // hello world\ => "hello world\\"
  619. //
  620. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  621. // the reasons for including this as a .cmd quoting rule are:
  622. //
  623. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  624. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  625. //
  626. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  627. // haven't heard any complaints about that aspect.
  628. //
  629. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  630. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  631. // by using %%.
  632. //
  633. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  634. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  635. //
  636. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  637. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  638. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  639. // to an external program.
  640. //
  641. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  642. // % can be escaped within a .cmd file.
  643. let reverse = '"';
  644. let quoteHit = true;
  645. for (let i = arg.length; i > 0; i--) {
  646. // walk the string in reverse
  647. reverse += arg[i - 1];
  648. if (quoteHit && arg[i - 1] === '\\') {
  649. reverse += '\\'; // double the slash
  650. }
  651. else if (arg[i - 1] === '"') {
  652. quoteHit = true;
  653. reverse += '"'; // double the quote
  654. }
  655. else {
  656. quoteHit = false;
  657. }
  658. }
  659. reverse += '"';
  660. return reverse
  661. .split('')
  662. .reverse()
  663. .join('');
  664. }
  665. _uvQuoteCmdArg(arg) {
  666. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  667. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  668. // is used.
  669. //
  670. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  671. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  672. // pasting copyright notice from Node within this function:
  673. //
  674. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  675. //
  676. // Permission is hereby granted, free of charge, to any person obtaining a copy
  677. // of this software and associated documentation files (the "Software"), to
  678. // deal in the Software without restriction, including without limitation the
  679. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  680. // sell copies of the Software, and to permit persons to whom the Software is
  681. // furnished to do so, subject to the following conditions:
  682. //
  683. // The above copyright notice and this permission notice shall be included in
  684. // all copies or substantial portions of the Software.
  685. //
  686. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  687. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  688. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  689. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  690. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  691. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  692. // IN THE SOFTWARE.
  693. if (!arg) {
  694. // Need double quotation for empty argument
  695. return '""';
  696. }
  697. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  698. // No quotation needed
  699. return arg;
  700. }
  701. if (!arg.includes('"') && !arg.includes('\\')) {
  702. // No embedded double quotes or backslashes, so I can just wrap
  703. // quote marks around the whole thing.
  704. return `"${arg}"`;
  705. }
  706. // Expected input/output:
  707. // input : hello"world
  708. // output: "hello\"world"
  709. // input : hello""world
  710. // output: "hello\"\"world"
  711. // input : hello\world
  712. // output: hello\world
  713. // input : hello\\world
  714. // output: hello\\world
  715. // input : hello\"world
  716. // output: "hello\\\"world"
  717. // input : hello\\"world
  718. // output: "hello\\\\\"world"
  719. // input : hello world\
  720. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  721. // but it appears the comment is wrong, it should be "hello world\\"
  722. let reverse = '"';
  723. let quoteHit = true;
  724. for (let i = arg.length; i > 0; i--) {
  725. // walk the string in reverse
  726. reverse += arg[i - 1];
  727. if (quoteHit && arg[i - 1] === '\\') {
  728. reverse += '\\';
  729. }
  730. else if (arg[i - 1] === '"') {
  731. quoteHit = true;
  732. reverse += '\\';
  733. }
  734. else {
  735. quoteHit = false;
  736. }
  737. }
  738. reverse += '"';
  739. return reverse
  740. .split('')
  741. .reverse()
  742. .join('');
  743. }
  744. _cloneExecOptions(options) {
  745. options = options || {};
  746. const result = {
  747. cwd: options.cwd || process.cwd(),
  748. env: options.env || process.env,
  749. silent: options.silent || false,
  750. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  751. failOnStdErr: options.failOnStdErr || false,
  752. ignoreReturnCode: options.ignoreReturnCode || false,
  753. delay: options.delay || 10000
  754. };
  755. result.outStream = options.outStream || process.stdout;
  756. result.errStream = options.errStream || process.stderr;
  757. return result;
  758. }
  759. _getSpawnOptions(options, toolPath) {
  760. options = options || {};
  761. const result = {};
  762. result.cwd = options.cwd;
  763. result.env = options.env;
  764. result['windowsVerbatimArguments'] =
  765. options.windowsVerbatimArguments || this._isCmdFile();
  766. if (options.windowsVerbatimArguments) {
  767. result.argv0 = `"${toolPath}"`;
  768. }
  769. return result;
  770. }
  771. /**
  772. * Exec a tool.
  773. * Output will be streamed to the live console.
  774. * Returns promise with return code
  775. *
  776. * @param tool path to tool to exec
  777. * @param options optional exec options. See ExecOptions
  778. * @returns number
  779. */
  780. exec() {
  781. return __awaiter(this, void 0, void 0, function* () {
  782. return new Promise((resolve, reject) => {
  783. this._debug(`exec tool: ${this.toolPath}`);
  784. this._debug('arguments:');
  785. for (const arg of this.args) {
  786. this._debug(` ${arg}`);
  787. }
  788. const optionsNonNull = this._cloneExecOptions(this.options);
  789. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  790. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  791. }
  792. const state = new ExecState(optionsNonNull, this.toolPath);
  793. state.on('debug', (message) => {
  794. this._debug(message);
  795. });
  796. const fileName = this._getSpawnFileName();
  797. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  798. const stdbuffer = '';
  799. if (cp.stdout) {
  800. cp.stdout.on('data', (data) => {
  801. if (this.options.listeners && this.options.listeners.stdout) {
  802. this.options.listeners.stdout(data);
  803. }
  804. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  805. optionsNonNull.outStream.write(data);
  806. }
  807. this._processLineBuffer(data, stdbuffer, (line) => {
  808. if (this.options.listeners && this.options.listeners.stdline) {
  809. this.options.listeners.stdline(line);
  810. }
  811. });
  812. });
  813. }
  814. const errbuffer = '';
  815. if (cp.stderr) {
  816. cp.stderr.on('data', (data) => {
  817. state.processStderr = true;
  818. if (this.options.listeners && this.options.listeners.stderr) {
  819. this.options.listeners.stderr(data);
  820. }
  821. if (!optionsNonNull.silent &&
  822. optionsNonNull.errStream &&
  823. optionsNonNull.outStream) {
  824. const s = optionsNonNull.failOnStdErr
  825. ? optionsNonNull.errStream
  826. : optionsNonNull.outStream;
  827. s.write(data);
  828. }
  829. this._processLineBuffer(data, errbuffer, (line) => {
  830. if (this.options.listeners && this.options.listeners.errline) {
  831. this.options.listeners.errline(line);
  832. }
  833. });
  834. });
  835. }
  836. cp.on('error', (err) => {
  837. state.processError = err.message;
  838. state.processExited = true;
  839. state.processClosed = true;
  840. state.CheckComplete();
  841. });
  842. cp.on('exit', (code) => {
  843. state.processExitCode = code;
  844. state.processExited = true;
  845. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  846. state.CheckComplete();
  847. });
  848. cp.on('close', (code) => {
  849. state.processExitCode = code;
  850. state.processExited = true;
  851. state.processClosed = true;
  852. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  853. state.CheckComplete();
  854. });
  855. state.on('done', (error, exitCode) => {
  856. if (stdbuffer.length > 0) {
  857. this.emit('stdline', stdbuffer);
  858. }
  859. if (errbuffer.length > 0) {
  860. this.emit('errline', errbuffer);
  861. }
  862. cp.removeAllListeners();
  863. if (error) {
  864. reject(error);
  865. }
  866. else {
  867. resolve(exitCode);
  868. }
  869. });
  870. });
  871. });
  872. }
  873. }
  874. exports.ToolRunner = ToolRunner;
  875. /**
  876. * Convert an arg string to an array of args. Handles escaping
  877. *
  878. * @param argString string of arguments
  879. * @returns string[] array of arguments
  880. */
  881. function argStringToArray(argString) {
  882. const args = [];
  883. let inQuotes = false;
  884. let escaped = false;
  885. let arg = '';
  886. function append(c) {
  887. // we only escape double quotes.
  888. if (escaped && c !== '"') {
  889. arg += '\\';
  890. }
  891. arg += c;
  892. escaped = false;
  893. }
  894. for (let i = 0; i < argString.length; i++) {
  895. const c = argString.charAt(i);
  896. if (c === '"') {
  897. if (!escaped) {
  898. inQuotes = !inQuotes;
  899. }
  900. else {
  901. append(c);
  902. }
  903. continue;
  904. }
  905. if (c === '\\' && escaped) {
  906. append(c);
  907. continue;
  908. }
  909. if (c === '\\' && inQuotes) {
  910. escaped = true;
  911. continue;
  912. }
  913. if (c === ' ' && !inQuotes) {
  914. if (arg.length > 0) {
  915. args.push(arg);
  916. arg = '';
  917. }
  918. continue;
  919. }
  920. append(c);
  921. }
  922. if (arg.length > 0) {
  923. args.push(arg.trim());
  924. }
  925. return args;
  926. }
  927. exports.argStringToArray = argStringToArray;
  928. class ExecState extends events.EventEmitter {
  929. constructor(options, toolPath) {
  930. super();
  931. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  932. this.processError = '';
  933. this.processExitCode = 0;
  934. this.processExited = false; // tracks whether the process has exited
  935. this.processStderr = false; // tracks whether stderr was written to
  936. this.delay = 10000; // 10 seconds
  937. this.done = false;
  938. this.timeout = null;
  939. if (!toolPath) {
  940. throw new Error('toolPath must not be empty');
  941. }
  942. this.options = options;
  943. this.toolPath = toolPath;
  944. if (options.delay) {
  945. this.delay = options.delay;
  946. }
  947. }
  948. CheckComplete() {
  949. if (this.done) {
  950. return;
  951. }
  952. if (this.processClosed) {
  953. this._setResult();
  954. }
  955. else if (this.processExited) {
  956. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  957. }
  958. }
  959. _debug(message) {
  960. this.emit('debug', message);
  961. }
  962. _setResult() {
  963. // determine whether there is an error
  964. let error;
  965. if (this.processExited) {
  966. if (this.processError) {
  967. error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
  968. }
  969. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  970. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  971. }
  972. else if (this.processStderr && this.options.failOnStdErr) {
  973. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  974. }
  975. }
  976. // clear the timeout
  977. if (this.timeout) {
  978. clearTimeout(this.timeout);
  979. this.timeout = null;
  980. }
  981. this.done = true;
  982. this.emit('done', error, this.processExitCode);
  983. }
  984. static HandleTimeout(state) {
  985. if (state.done) {
  986. return;
  987. }
  988. if (!state.processClosed && state.processExited) {
  989. const message = `The STDIO streams did not close within ${state.delay /
  990. 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
  991. state._debug(message);
  992. }
  993. state._setResult();
  994. }
  995. }
  996. //# sourceMappingURL=toolrunner.js.map
  997. /***/ }),
  998. /***/ 11:
  999. /***/ (function(module) {
  1000. // Returns a wrapper function that returns a wrapped callback
  1001. // The wrapper function should do some stuff, and return a
  1002. // presumably different callback function.
  1003. // This makes sure that own properties are retained, so that
  1004. // decorations and such are not lost along the way.
  1005. module.exports = wrappy
  1006. function wrappy (fn, cb) {
  1007. if (fn && cb) return wrappy(fn)(cb)
  1008. if (typeof fn !== 'function')
  1009. throw new TypeError('need wrapper function')
  1010. Object.keys(fn).forEach(function (k) {
  1011. wrapper[k] = fn[k]
  1012. })
  1013. return wrapper
  1014. function wrapper() {
  1015. var args = new Array(arguments.length)
  1016. for (var i = 0; i < args.length; i++) {
  1017. args[i] = arguments[i]
  1018. }
  1019. var ret = fn.apply(this, args)
  1020. var cb = args[args.length-1]
  1021. if (typeof ret === 'function' && ret !== cb) {
  1022. Object.keys(cb).forEach(function (k) {
  1023. ret[k] = cb[k]
  1024. })
  1025. }
  1026. return ret
  1027. }
  1028. }
  1029. /***/ }),
  1030. /***/ 16:
  1031. /***/ (function(module) {
  1032. module.exports = require("tls");
  1033. /***/ }),
  1034. /***/ 18:
  1035. /***/ (function() {
  1036. eval("require")("encoding");
  1037. /***/ }),
  1038. /***/ 19:
  1039. /***/ (function(module, __unusedexports, __webpack_require__) {
  1040. module.exports = authenticationPlugin;
  1041. const { Deprecation } = __webpack_require__(692);
  1042. const once = __webpack_require__(969);
  1043. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1044. const authenticate = __webpack_require__(674);
  1045. const beforeRequest = __webpack_require__(471);
  1046. const requestError = __webpack_require__(349);
  1047. function authenticationPlugin(octokit, options) {
  1048. if (options.auth) {
  1049. octokit.authenticate = () => {
  1050. deprecateAuthenticate(
  1051. octokit.log,
  1052. new Deprecation(
  1053. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1054. )
  1055. );
  1056. };
  1057. return;
  1058. }
  1059. const state = {
  1060. octokit,
  1061. auth: false
  1062. };
  1063. octokit.authenticate = authenticate.bind(null, state);
  1064. octokit.hook.before("request", beforeRequest.bind(null, state));
  1065. octokit.hook.error("request", requestError.bind(null, state));
  1066. }
  1067. /***/ }),
  1068. /***/ 20:
  1069. /***/ (function(module, __unusedexports, __webpack_require__) {
  1070. "use strict";
  1071. const cp = __webpack_require__(129);
  1072. const parse = __webpack_require__(568);
  1073. const enoent = __webpack_require__(881);
  1074. function spawn(command, args, options) {
  1075. // Parse the arguments
  1076. const parsed = parse(command, args, options);
  1077. // Spawn the child process
  1078. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1079. // Hook into child process "exit" event to emit an error if the command
  1080. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1081. enoent.hookChildProcess(spawned, parsed);
  1082. return spawned;
  1083. }
  1084. function spawnSync(command, args, options) {
  1085. // Parse the arguments
  1086. const parsed = parse(command, args, options);
  1087. // Spawn the child process
  1088. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1089. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1090. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1091. return result;
  1092. }
  1093. module.exports = spawn;
  1094. module.exports.spawn = spawn;
  1095. module.exports.sync = spawnSync;
  1096. module.exports._parse = parse;
  1097. module.exports._enoent = enoent;
  1098. /***/ }),
  1099. /***/ 39:
  1100. /***/ (function(module) {
  1101. "use strict";
  1102. module.exports = opts => {
  1103. opts = opts || {};
  1104. const env = opts.env || process.env;
  1105. const platform = opts.platform || process.platform;
  1106. if (platform !== 'win32') {
  1107. return 'PATH';
  1108. }
  1109. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1110. };
  1111. /***/ }),
  1112. /***/ 47:
  1113. /***/ (function(module, __unusedexports, __webpack_require__) {
  1114. module.exports = factory;
  1115. const Octokit = __webpack_require__(402);
  1116. const registerPlugin = __webpack_require__(855);
  1117. function factory(plugins) {
  1118. const Api = Octokit.bind(null, plugins || []);
  1119. Api.plugin = registerPlugin.bind(null, plugins || []);
  1120. return Api;
  1121. }
  1122. /***/ }),
  1123. /***/ 49:
  1124. /***/ (function(module, __unusedexports, __webpack_require__) {
  1125. "use strict";
  1126. const os = __webpack_require__(87);
  1127. const execa = __webpack_require__(955);
  1128. // Reference: https://www.gaijin.at/en/lstwinver.php
  1129. const names = new Map([
  1130. ['10.0', '10'],
  1131. ['6.3', '8.1'],
  1132. ['6.2', '8'],
  1133. ['6.1', '7'],
  1134. ['6.0', 'Vista'],
  1135. ['5.2', 'Server 2003'],
  1136. ['5.1', 'XP'],
  1137. ['5.0', '2000'],
  1138. ['4.9', 'ME'],
  1139. ['4.1', '98'],
  1140. ['4.0', '95']
  1141. ]);
  1142. const windowsRelease = release => {
  1143. const version = /\d+\.\d/.exec(release || os.release());
  1144. if (release && !version) {
  1145. throw new Error('`release` argument doesn\'t match `n.n`');
  1146. }
  1147. const ver = (version || [])[0];
  1148. // Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
  1149. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1150. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1151. // If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
  1152. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1153. const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1154. const year = (stdout.match(/2008|2012|2016/) || [])[0];
  1155. if (year) {
  1156. return `Server ${year}`;
  1157. }
  1158. }
  1159. return names.get(ver);
  1160. };
  1161. module.exports = windowsRelease;
  1162. /***/ }),
  1163. /***/ 87:
  1164. /***/ (function(module) {
  1165. module.exports = require("os");
  1166. /***/ }),
  1167. /***/ 118:
  1168. /***/ (function(module, __unusedexports, __webpack_require__) {
  1169. "use strict";
  1170. const os = __webpack_require__(87);
  1171. const nameMap = new Map([
  1172. [19, 'Catalina'],
  1173. [18, 'Mojave'],
  1174. [17, 'High Sierra'],
  1175. [16, 'Sierra'],
  1176. [15, 'El Capitan'],
  1177. [14, 'Yosemite'],
  1178. [13, 'Mavericks'],
  1179. [12, 'Mountain Lion'],
  1180. [11, 'Lion'],
  1181. [10, 'Snow Leopard'],
  1182. [9, 'Leopard'],
  1183. [8, 'Tiger'],
  1184. [7, 'Panther'],
  1185. [6, 'Jaguar'],
  1186. [5, 'Puma']
  1187. ]);
  1188. const macosRelease = release => {
  1189. release = Number((release || os.release()).split('.')[0]);
  1190. return {
  1191. name: nameMap.get(release),
  1192. version: '10.' + (release - 4)
  1193. };
  1194. };
  1195. module.exports = macosRelease;
  1196. // TODO: remove this in the next major version
  1197. module.exports.default = macosRelease;
  1198. /***/ }),
  1199. /***/ 126:
  1200. /***/ (function(module) {
  1201. /**
  1202. * lodash (Custom Build) <https://lodash.com/>
  1203. * Build: `lodash modularize exports="npm" -o ./`
  1204. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1205. * Released under MIT license <https://lodash.com/license>
  1206. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1207. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1208. */
  1209. /** Used as the size to enable large array optimizations. */
  1210. var LARGE_ARRAY_SIZE = 200;
  1211. /** Used to stand-in for `undefined` hash values. */
  1212. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1213. /** Used as references for various `Number` constants. */
  1214. var INFINITY = 1 / 0;
  1215. /** `Object#toString` result references. */
  1216. var funcTag = '[object Function]',
  1217. genTag = '[object GeneratorFunction]';
  1218. /**
  1219. * Used to match `RegExp`
  1220. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1221. */
  1222. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1223. /** Used to detect host constructors (Safari). */
  1224. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1225. /** Detect free variable `global` from Node.js. */
  1226. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1227. /** Detect free variable `self`. */
  1228. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1229. /** Used as a reference to the global object. */
  1230. var root = freeGlobal || freeSelf || Function('return this')();
  1231. /**
  1232. * A specialized version of `_.includes` for arrays without support for
  1233. * specifying an index to search from.
  1234. *
  1235. * @private
  1236. * @param {Array} [array] The array to inspect.
  1237. * @param {*} target The value to search for.
  1238. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1239. */
  1240. function arrayIncludes(array, value) {
  1241. var length = array ? array.length : 0;
  1242. return !!length && baseIndexOf(array, value, 0) > -1;
  1243. }
  1244. /**
  1245. * This function is like `arrayIncludes` except that it accepts a comparator.
  1246. *
  1247. * @private
  1248. * @param {Array} [array] The array to inspect.
  1249. * @param {*} target The value to search for.
  1250. * @param {Function} comparator The comparator invoked per element.
  1251. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1252. */
  1253. function arrayIncludesWith(array, value, comparator) {
  1254. var index = -1,
  1255. length = array ? array.length : 0;
  1256. while (++index < length) {
  1257. if (comparator(value, array[index])) {
  1258. return true;
  1259. }
  1260. }
  1261. return false;
  1262. }
  1263. /**
  1264. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1265. * support for iteratee shorthands.
  1266. *
  1267. * @private
  1268. * @param {Array} array The array to inspect.
  1269. * @param {Function} predicate The function invoked per iteration.
  1270. * @param {number} fromIndex The index to search from.
  1271. * @param {boolean} [fromRight] Specify iterating from right to left.
  1272. * @returns {number} Returns the index of the matched value, else `-1`.
  1273. */
  1274. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1275. var length = array.length,
  1276. index = fromIndex + (fromRight ? 1 : -1);
  1277. while ((fromRight ? index-- : ++index < length)) {
  1278. if (predicate(array[index], index, array)) {
  1279. return index;
  1280. }
  1281. }
  1282. return -1;
  1283. }
  1284. /**
  1285. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1286. *
  1287. * @private
  1288. * @param {Array} array The array to inspect.
  1289. * @param {*} value The value to search for.
  1290. * @param {number} fromIndex The index to search from.
  1291. * @returns {number} Returns the index of the matched value, else `-1`.
  1292. */
  1293. function baseIndexOf(array, value, fromIndex) {
  1294. if (value !== value) {
  1295. return baseFindIndex(array, baseIsNaN, fromIndex);
  1296. }
  1297. var index = fromIndex - 1,
  1298. length = array.length;
  1299. while (++index < length) {
  1300. if (array[index] === value) {
  1301. return index;
  1302. }
  1303. }
  1304. return -1;
  1305. }
  1306. /**
  1307. * The base implementation of `_.isNaN` without support for number objects.
  1308. *
  1309. * @private
  1310. * @param {*} value The value to check.
  1311. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1312. */
  1313. function baseIsNaN(value) {
  1314. return value !== value;
  1315. }
  1316. /**
  1317. * Checks if a cache value for `key` exists.
  1318. *
  1319. * @private
  1320. * @param {Object} cache The cache to query.
  1321. * @param {string} key The key of the entry to check.
  1322. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1323. */
  1324. function cacheHas(cache, key) {
  1325. return cache.has(key);
  1326. }
  1327. /**
  1328. * Gets the value at `key` of `object`.
  1329. *
  1330. * @private
  1331. * @param {Object} [object] The object to query.
  1332. * @param {string} key The key of the property to get.
  1333. * @returns {*} Returns the property value.
  1334. */
  1335. function getValue(object, key) {
  1336. return object == null ? undefined : object[key];
  1337. }
  1338. /**
  1339. * Checks if `value` is a host object in IE < 9.
  1340. *
  1341. * @private
  1342. * @param {*} value The value to check.
  1343. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1344. */
  1345. function isHostObject(value) {
  1346. // Many host objects are `Object` objects that can coerce to strings
  1347. // despite having improperly defined `toString` methods.
  1348. var result = false;
  1349. if (value != null && typeof value.toString != 'function') {
  1350. try {
  1351. result = !!(value + '');
  1352. } catch (e) {}
  1353. }
  1354. return result;
  1355. }
  1356. /**
  1357. * Converts `set` to an array of its values.
  1358. *
  1359. * @private
  1360. * @param {Object} set The set to convert.
  1361. * @returns {Array} Returns the values.
  1362. */
  1363. function setToArray(set) {
  1364. var index = -1,
  1365. result = Array(set.size);
  1366. set.forEach(function(value) {
  1367. result[++index] = value;
  1368. });
  1369. return result;
  1370. }
  1371. /** Used for built-in method references. */
  1372. var arrayProto = Array.prototype,
  1373. funcProto = Function.prototype,
  1374. objectProto = Object.prototype;
  1375. /** Used to detect overreaching core-js shims. */
  1376. var coreJsData = root['__core-js_shared__'];
  1377. /** Used to detect methods masquerading as native. */
  1378. var maskSrcKey = (function() {
  1379. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1380. return uid ? ('Symbol(src)_1.' + uid) : '';
  1381. }());
  1382. /** Used to resolve the decompiled source of functions. */
  1383. var funcToString = funcProto.toString;
  1384. /** Used to check objects for own properties. */
  1385. var hasOwnProperty = objectProto.hasOwnProperty;
  1386. /**
  1387. * Used to resolve the
  1388. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1389. * of values.
  1390. */
  1391. var objectToString = objectProto.toString;
  1392. /** Used to detect if a method is native. */
  1393. var reIsNative = RegExp('^' +
  1394. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1395. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1396. );
  1397. /** Built-in value references. */
  1398. var splice = arrayProto.splice;
  1399. /* Built-in method references that are verified to be native. */
  1400. var Map = getNative(root, 'Map'),
  1401. Set = getNative(root, 'Set'),
  1402. nativeCreate = getNative(Object, 'create');
  1403. /**
  1404. * Creates a hash object.
  1405. *
  1406. * @private
  1407. * @constructor
  1408. * @param {Array} [entries] The key-value pairs to cache.
  1409. */
  1410. function Hash(entries) {
  1411. var index = -1,
  1412. length = entries ? entries.length : 0;
  1413. this.clear();
  1414. while (++index < length) {
  1415. var entry = entries[index];
  1416. this.set(entry[0], entry[1]);
  1417. }
  1418. }
  1419. /**
  1420. * Removes all key-value entries from the hash.
  1421. *
  1422. * @private
  1423. * @name clear
  1424. * @memberOf Hash
  1425. */
  1426. function hashClear() {
  1427. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1428. }
  1429. /**
  1430. * Removes `key` and its value from the hash.
  1431. *
  1432. * @private
  1433. * @name delete
  1434. * @memberOf Hash
  1435. * @param {Object} hash The hash to modify.
  1436. * @param {string} key The key of the value to remove.
  1437. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1438. */
  1439. function hashDelete(key) {
  1440. return this.has(key) && delete this.__data__[key];
  1441. }
  1442. /**
  1443. * Gets the hash value for `key`.
  1444. *
  1445. * @private
  1446. * @name get
  1447. * @memberOf Hash
  1448. * @param {string} key The key of the value to get.
  1449. * @returns {*} Returns the entry value.
  1450. */
  1451. function hashGet(key) {
  1452. var data = this.__data__;
  1453. if (nativeCreate) {
  1454. var result = data[key];
  1455. return result === HASH_UNDEFINED ? undefined : result;
  1456. }
  1457. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1458. }
  1459. /**
  1460. * Checks if a hash value for `key` exists.
  1461. *
  1462. * @private
  1463. * @name has
  1464. * @memberOf Hash
  1465. * @param {string} key The key of the entry to check.
  1466. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1467. */
  1468. function hashHas(key) {
  1469. var data = this.__data__;
  1470. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1471. }
  1472. /**
  1473. * Sets the hash `key` to `value`.
  1474. *
  1475. * @private
  1476. * @name set
  1477. * @memberOf Hash
  1478. * @param {string} key The key of the value to set.
  1479. * @param {*} value The value to set.
  1480. * @returns {Object} Returns the hash instance.
  1481. */
  1482. function hashSet(key, value) {
  1483. var data = this.__data__;
  1484. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1485. return this;
  1486. }
  1487. // Add methods to `Hash`.
  1488. Hash.prototype.clear = hashClear;
  1489. Hash.prototype['delete'] = hashDelete;
  1490. Hash.prototype.get = hashGet;
  1491. Hash.prototype.has = hashHas;
  1492. Hash.prototype.set = hashSet;
  1493. /**
  1494. * Creates an list cache object.
  1495. *
  1496. * @private
  1497. * @constructor
  1498. * @param {Array} [entries] The key-value pairs to cache.
  1499. */
  1500. function ListCache(entries) {
  1501. var index = -1,
  1502. length = entries ? entries.length : 0;
  1503. this.clear();
  1504. while (++index < length) {
  1505. var entry = entries[index];
  1506. this.set(entry[0], entry[1]);
  1507. }
  1508. }
  1509. /**
  1510. * Removes all key-value entries from the list cache.
  1511. *
  1512. * @private
  1513. * @name clear
  1514. * @memberOf ListCache
  1515. */
  1516. function listCacheClear() {
  1517. this.__data__ = [];
  1518. }
  1519. /**
  1520. * Removes `key` and its value from the list cache.
  1521. *
  1522. * @private
  1523. * @name delete
  1524. * @memberOf ListCache
  1525. * @param {string} key The key of the value to remove.
  1526. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1527. */
  1528. function listCacheDelete(key) {
  1529. var data = this.__data__,
  1530. index = assocIndexOf(data, key);
  1531. if (index < 0) {
  1532. return false;
  1533. }
  1534. var lastIndex = data.length - 1;
  1535. if (index == lastIndex) {
  1536. data.pop();
  1537. } else {
  1538. splice.call(data, index, 1);
  1539. }
  1540. return true;
  1541. }
  1542. /**
  1543. * Gets the list cache value for `key`.
  1544. *
  1545. * @private
  1546. * @name get
  1547. * @memberOf ListCache
  1548. * @param {string} key The key of the value to get.
  1549. * @returns {*} Returns the entry value.
  1550. */
  1551. function listCacheGet(key) {
  1552. var data = this.__data__,
  1553. index = assocIndexOf(data, key);
  1554. return index < 0 ? undefined : data[index][1];
  1555. }
  1556. /**
  1557. * Checks if a list cache value for `key` exists.
  1558. *
  1559. * @private
  1560. * @name has
  1561. * @memberOf ListCache
  1562. * @param {string} key The key of the entry to check.
  1563. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1564. */
  1565. function listCacheHas(key) {
  1566. return assocIndexOf(this.__data__, key) > -1;
  1567. }
  1568. /**
  1569. * Sets the list cache `key` to `value`.
  1570. *
  1571. * @private
  1572. * @name set
  1573. * @memberOf ListCache
  1574. * @param {string} key The key of the value to set.
  1575. * @param {*} value The value to set.
  1576. * @returns {Object} Returns the list cache instance.
  1577. */
  1578. function listCacheSet(key, value) {
  1579. var data = this.__data__,
  1580. index = assocIndexOf(data, key);
  1581. if (index < 0) {
  1582. data.push([key, value]);
  1583. } else {
  1584. data[index][1] = value;
  1585. }
  1586. return this;
  1587. }
  1588. // Add methods to `ListCache`.
  1589. ListCache.prototype.clear = listCacheClear;
  1590. ListCache.prototype['delete'] = listCacheDelete;
  1591. ListCache.prototype.get = listCacheGet;
  1592. ListCache.prototype.has = listCacheHas;
  1593. ListCache.prototype.set = listCacheSet;
  1594. /**
  1595. * Creates a map cache object to store key-value pairs.
  1596. *
  1597. * @private
  1598. * @constructor
  1599. * @param {Array} [entries] The key-value pairs to cache.
  1600. */
  1601. function MapCache(entries) {
  1602. var index = -1,
  1603. length = entries ? entries.length : 0;
  1604. this.clear();
  1605. while (++index < length) {
  1606. var entry = entries[index];
  1607. this.set(entry[0], entry[1]);
  1608. }
  1609. }
  1610. /**
  1611. * Removes all key-value entries from the map.
  1612. *
  1613. * @private
  1614. * @name clear
  1615. * @memberOf MapCache
  1616. */
  1617. function mapCacheClear() {
  1618. this.__data__ = {
  1619. 'hash': new Hash,
  1620. 'map': new (Map || ListCache),
  1621. 'string': new Hash
  1622. };
  1623. }
  1624. /**
  1625. * Removes `key` and its value from the map.
  1626. *
  1627. * @private
  1628. * @name delete
  1629. * @memberOf MapCache
  1630. * @param {string} key The key of the value to remove.
  1631. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1632. */
  1633. function mapCacheDelete(key) {
  1634. return getMapData(this, key)['delete'](key);
  1635. }
  1636. /**
  1637. * Gets the map value for `key`.
  1638. *
  1639. * @private
  1640. * @name get
  1641. * @memberOf MapCache
  1642. * @param {string} key The key of the value to get.
  1643. * @returns {*} Returns the entry value.
  1644. */
  1645. function mapCacheGet(key) {
  1646. return getMapData(this, key).get(key);
  1647. }
  1648. /**
  1649. * Checks if a map value for `key` exists.
  1650. *
  1651. * @private
  1652. * @name has
  1653. * @memberOf MapCache
  1654. * @param {string} key The key of the entry to check.
  1655. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1656. */
  1657. function mapCacheHas(key) {
  1658. return getMapData(this, key).has(key);
  1659. }
  1660. /**
  1661. * Sets the map `key` to `value`.
  1662. *
  1663. * @private
  1664. * @name set
  1665. * @memberOf MapCache
  1666. * @param {string} key The key of the value to set.
  1667. * @param {*} value The value to set.
  1668. * @returns {Object} Returns the map cache instance.
  1669. */
  1670. function mapCacheSet(key, value) {
  1671. getMapData(this, key).set(key, value);
  1672. return this;
  1673. }
  1674. // Add methods to `MapCache`.
  1675. MapCache.prototype.clear = mapCacheClear;
  1676. MapCache.prototype['delete'] = mapCacheDelete;
  1677. MapCache.prototype.get = mapCacheGet;
  1678. MapCache.prototype.has = mapCacheHas;
  1679. MapCache.prototype.set = mapCacheSet;
  1680. /**
  1681. *
  1682. * Creates an array cache object to store unique values.
  1683. *
  1684. * @private
  1685. * @constructor
  1686. * @param {Array} [values] The values to cache.
  1687. */
  1688. function SetCache(values) {
  1689. var index = -1,
  1690. length = values ? values.length : 0;
  1691. this.__data__ = new MapCache;
  1692. while (++index < length) {
  1693. this.add(values[index]);
  1694. }
  1695. }
  1696. /**
  1697. * Adds `value` to the array cache.
  1698. *
  1699. * @private
  1700. * @name add
  1701. * @memberOf SetCache
  1702. * @alias push
  1703. * @param {*} value The value to cache.
  1704. * @returns {Object} Returns the cache instance.
  1705. */
  1706. function setCacheAdd(value) {
  1707. this.__data__.set(value, HASH_UNDEFINED);
  1708. return this;
  1709. }
  1710. /**
  1711. * Checks if `value` is in the array cache.
  1712. *
  1713. * @private
  1714. * @name has
  1715. * @memberOf SetCache
  1716. * @param {*} value The value to search for.
  1717. * @returns {number} Returns `true` if `value` is found, else `false`.
  1718. */
  1719. function setCacheHas(value) {
  1720. return this.__data__.has(value);
  1721. }
  1722. // Add methods to `SetCache`.
  1723. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1724. SetCache.prototype.has = setCacheHas;
  1725. /**
  1726. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1727. *
  1728. * @private
  1729. * @param {Array} array The array to inspect.
  1730. * @param {*} key The key to search for.
  1731. * @returns {number} Returns the index of the matched value, else `-1`.
  1732. */
  1733. function assocIndexOf(array, key) {
  1734. var length = array.length;
  1735. while (length--) {
  1736. if (eq(array[length][0], key)) {
  1737. return length;
  1738. }
  1739. }
  1740. return -1;
  1741. }
  1742. /**
  1743. * The base implementation of `_.isNative` without bad shim checks.
  1744. *
  1745. * @private
  1746. * @param {*} value The value to check.
  1747. * @returns {boolean} Returns `true` if `value` is a native function,
  1748. * else `false`.
  1749. */
  1750. function baseIsNative(value) {
  1751. if (!isObject(value) || isMasked(value)) {
  1752. return false;
  1753. }
  1754. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1755. return pattern.test(toSource(value));
  1756. }
  1757. /**
  1758. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1759. *
  1760. * @private
  1761. * @param {Array} array The array to inspect.
  1762. * @param {Function} [iteratee] The iteratee invoked per element.
  1763. * @param {Function} [comparator] The comparator invoked per element.
  1764. * @returns {Array} Returns the new duplicate free array.
  1765. */
  1766. function baseUniq(array, iteratee, comparator) {
  1767. var index = -1,
  1768. includes = arrayIncludes,
  1769. length = array.length,
  1770. isCommon = true,
  1771. result = [],
  1772. seen = result;
  1773. if (comparator) {
  1774. isCommon = false;
  1775. includes = arrayIncludesWith;
  1776. }
  1777. else if (length >= LARGE_ARRAY_SIZE) {
  1778. var set = iteratee ? null : createSet(array);
  1779. if (set) {
  1780. return setToArray(set);
  1781. }
  1782. isCommon = false;
  1783. includes = cacheHas;
  1784. seen = new SetCache;
  1785. }
  1786. else {
  1787. seen = iteratee ? [] : result;
  1788. }
  1789. outer:
  1790. while (++index < length) {
  1791. var value = array[index],
  1792. computed = iteratee ? iteratee(value) : value;
  1793. value = (comparator || value !== 0) ? value : 0;
  1794. if (isCommon && computed === computed) {
  1795. var seenIndex = seen.length;
  1796. while (seenIndex--) {
  1797. if (seen[seenIndex] === computed) {
  1798. continue outer;
  1799. }
  1800. }
  1801. if (iteratee) {
  1802. seen.push(computed);
  1803. }
  1804. result.push(value);
  1805. }
  1806. else if (!includes(seen, computed, comparator)) {
  1807. if (seen !== result) {
  1808. seen.push(computed);
  1809. }
  1810. result.push(value);
  1811. }
  1812. }
  1813. return result;
  1814. }
  1815. /**
  1816. * Creates a set object of `values`.
  1817. *
  1818. * @private
  1819. * @param {Array} values The values to add to the set.
  1820. * @returns {Object} Returns the new set.
  1821. */
  1822. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1823. return new Set(values);
  1824. };
  1825. /**
  1826. * Gets the data for `map`.
  1827. *
  1828. * @private
  1829. * @param {Object} map The map to query.
  1830. * @param {string} key The reference key.
  1831. * @returns {*} Returns the map data.
  1832. */
  1833. function getMapData(map, key) {
  1834. var data = map.__data__;
  1835. return isKeyable(key)
  1836. ? data[typeof key == 'string' ? 'string' : 'hash']
  1837. : data.map;
  1838. }
  1839. /**
  1840. * Gets the native function at `key` of `object`.
  1841. *
  1842. * @private
  1843. * @param {Object} object The object to query.
  1844. * @param {string} key The key of the method to get.
  1845. * @returns {*} Returns the function if it's native, else `undefined`.
  1846. */
  1847. function getNative(object, key) {
  1848. var value = getValue(object, key);
  1849. return baseIsNative(value) ? value : undefined;
  1850. }
  1851. /**
  1852. * Checks if `value` is suitable for use as unique object key.
  1853. *
  1854. * @private
  1855. * @param {*} value The value to check.
  1856. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1857. */
  1858. function isKeyable(value) {
  1859. var type = typeof value;
  1860. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1861. ? (value !== '__proto__')
  1862. : (value === null);
  1863. }
  1864. /**
  1865. * Checks if `func` has its source masked.
  1866. *
  1867. * @private
  1868. * @param {Function} func The function to check.
  1869. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1870. */
  1871. function isMasked(func) {
  1872. return !!maskSrcKey && (maskSrcKey in func);
  1873. }
  1874. /**
  1875. * Converts `func` to its source code.
  1876. *
  1877. * @private
  1878. * @param {Function} func The function to process.
  1879. * @returns {string} Returns the source code.
  1880. */
  1881. function toSource(func) {
  1882. if (func != null) {
  1883. try {
  1884. return funcToString.call(func);
  1885. } catch (e) {}
  1886. try {
  1887. return (func + '');
  1888. } catch (e) {}
  1889. }
  1890. return '';
  1891. }
  1892. /**
  1893. * Creates a duplicate-free version of an array, using
  1894. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1895. * for equality comparisons, in which only the first occurrence of each
  1896. * element is kept.
  1897. *
  1898. * @static
  1899. * @memberOf _
  1900. * @since 0.1.0
  1901. * @category Array
  1902. * @param {Array} array The array to inspect.
  1903. * @returns {Array} Returns the new duplicate free array.
  1904. * @example
  1905. *
  1906. * _.uniq([2, 1, 2]);
  1907. * // => [2, 1]
  1908. */
  1909. function uniq(array) {
  1910. return (array && array.length)
  1911. ? baseUniq(array)
  1912. : [];
  1913. }
  1914. /**
  1915. * Performs a
  1916. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1917. * comparison between two values to determine if they are equivalent.
  1918. *
  1919. * @static
  1920. * @memberOf _
  1921. * @since 4.0.0
  1922. * @category Lang
  1923. * @param {*} value The value to compare.
  1924. * @param {*} other The other value to compare.
  1925. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1926. * @example
  1927. *
  1928. * var object = { 'a': 1 };
  1929. * var other = { 'a': 1 };
  1930. *
  1931. * _.eq(object, object);
  1932. * // => true
  1933. *
  1934. * _.eq(object, other);
  1935. * // => false
  1936. *
  1937. * _.eq('a', 'a');
  1938. * // => true
  1939. *
  1940. * _.eq('a', Object('a'));
  1941. * // => false
  1942. *
  1943. * _.eq(NaN, NaN);
  1944. * // => true
  1945. */
  1946. function eq(value, other) {
  1947. return value === other || (value !== value && other !== other);
  1948. }
  1949. /**
  1950. * Checks if `value` is classified as a `Function` object.
  1951. *
  1952. * @static
  1953. * @memberOf _
  1954. * @since 0.1.0
  1955. * @category Lang
  1956. * @param {*} value The value to check.
  1957. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1958. * @example
  1959. *
  1960. * _.isFunction(_);
  1961. * // => true
  1962. *
  1963. * _.isFunction(/abc/);
  1964. * // => false
  1965. */
  1966. function isFunction(value) {
  1967. // The use of `Object#toString` avoids issues with the `typeof` operator
  1968. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  1969. var tag = isObject(value) ? objectToString.call(value) : '';
  1970. return tag == funcTag || tag == genTag;
  1971. }
  1972. /**
  1973. * Checks if `value` is the
  1974. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1975. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1976. *
  1977. * @static
  1978. * @memberOf _
  1979. * @since 0.1.0
  1980. * @category Lang
  1981. * @param {*} value The value to check.
  1982. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1983. * @example
  1984. *
  1985. * _.isObject({});
  1986. * // => true
  1987. *
  1988. * _.isObject([1, 2, 3]);
  1989. * // => true
  1990. *
  1991. * _.isObject(_.noop);
  1992. * // => true
  1993. *
  1994. * _.isObject(null);
  1995. * // => false
  1996. */
  1997. function isObject(value) {
  1998. var type = typeof value;
  1999. return !!value && (type == 'object' || type == 'function');
  2000. }
  2001. /**
  2002. * This method returns `undefined`.
  2003. *
  2004. * @static
  2005. * @memberOf _
  2006. * @since 2.3.0
  2007. * @category Util
  2008. * @example
  2009. *
  2010. * _.times(2, _.noop);
  2011. * // => [undefined, undefined]
  2012. */
  2013. function noop() {
  2014. // No operation performed.
  2015. }
  2016. module.exports = uniq;
  2017. /***/ }),
  2018. /***/ 129:
  2019. /***/ (function(module) {
  2020. module.exports = require("child_process");
  2021. /***/ }),
  2022. /***/ 139:
  2023. /***/ (function(module, __unusedexports, __webpack_require__) {
  2024. // Unique ID creation requires a high quality random # generator. In node.js
  2025. // this is pretty straight-forward - we use the crypto API.
  2026. var crypto = __webpack_require__(417);
  2027. module.exports = function nodeRNG() {
  2028. return crypto.randomBytes(16);
  2029. };
  2030. /***/ }),
  2031. /***/ 141:
  2032. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2033. "use strict";
  2034. var net = __webpack_require__(631);
  2035. var tls = __webpack_require__(16);
  2036. var http = __webpack_require__(605);
  2037. var https = __webpack_require__(211);
  2038. var events = __webpack_require__(614);
  2039. var assert = __webpack_require__(357);
  2040. var util = __webpack_require__(669);
  2041. exports.httpOverHttp = httpOverHttp;
  2042. exports.httpsOverHttp = httpsOverHttp;
  2043. exports.httpOverHttps = httpOverHttps;
  2044. exports.httpsOverHttps = httpsOverHttps;
  2045. function httpOverHttp(options) {
  2046. var agent = new TunnelingAgent(options);
  2047. agent.request = http.request;
  2048. return agent;
  2049. }
  2050. function httpsOverHttp(options) {
  2051. var agent = new TunnelingAgent(options);
  2052. agent.request = http.request;
  2053. agent.createSocket = createSecureSocket;
  2054. return agent;
  2055. }
  2056. function httpOverHttps(options) {
  2057. var agent = new TunnelingAgent(options);
  2058. agent.request = https.request;
  2059. return agent;
  2060. }
  2061. function httpsOverHttps(options) {
  2062. var agent = new TunnelingAgent(options);
  2063. agent.request = https.request;
  2064. agent.createSocket = createSecureSocket;
  2065. return agent;
  2066. }
  2067. function TunnelingAgent(options) {
  2068. var self = this;
  2069. self.options = options || {};
  2070. self.proxyOptions = self.options.proxy || {};
  2071. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2072. self.requests = [];
  2073. self.sockets = [];
  2074. self.on('free', function onFree(socket, host, port, localAddress) {
  2075. var options = toOptions(host, port, localAddress);
  2076. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2077. var pending = self.requests[i];
  2078. if (pending.host === options.host && pending.port === options.port) {
  2079. // Detect the request to connect same origin server,
  2080. // reuse the connection.
  2081. self.requests.splice(i, 1);
  2082. pending.request.onSocket(socket);
  2083. return;
  2084. }
  2085. }
  2086. socket.destroy();
  2087. self.removeSocket(socket);
  2088. });
  2089. }
  2090. util.inherits(TunnelingAgent, events.EventEmitter);
  2091. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2092. var self = this;
  2093. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2094. if (self.sockets.length >= this.maxSockets) {
  2095. // We are over limit so we'll add it to the queue.
  2096. self.requests.push(options);
  2097. return;
  2098. }
  2099. // If we are under maxSockets create a new one.
  2100. self.createSocket(options, function(socket) {
  2101. socket.on('free', onFree);
  2102. socket.on('close', onCloseOrRemove);
  2103. socket.on('agentRemove', onCloseOrRemove);
  2104. req.onSocket(socket);
  2105. function onFree() {
  2106. self.emit('free', socket, options);
  2107. }
  2108. function onCloseOrRemove(err) {
  2109. self.removeSocket(socket);
  2110. socket.removeListener('free', onFree);
  2111. socket.removeListener('close', onCloseOrRemove);
  2112. socket.removeListener('agentRemove', onCloseOrRemove);
  2113. }
  2114. });
  2115. };
  2116. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2117. var self = this;
  2118. var placeholder = {};
  2119. self.sockets.push(placeholder);
  2120. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2121. method: 'CONNECT',
  2122. path: options.host + ':' + options.port,
  2123. agent: false
  2124. });
  2125. if (connectOptions.proxyAuth) {
  2126. connectOptions.headers = connectOptions.headers || {};
  2127. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2128. new Buffer(connectOptions.proxyAuth).toString('base64');
  2129. }
  2130. debug('making CONNECT request');
  2131. var connectReq = self.request(connectOptions);
  2132. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2133. connectReq.once('response', onResponse); // for v0.6
  2134. connectReq.once('upgrade', onUpgrade); // for v0.6
  2135. connectReq.once('connect', onConnect); // for v0.7 or later
  2136. connectReq.once('error', onError);
  2137. connectReq.end();
  2138. function onResponse(res) {
  2139. // Very hacky. This is necessary to avoid http-parser leaks.
  2140. res.upgrade = true;
  2141. }
  2142. function onUpgrade(res, socket, head) {
  2143. // Hacky.
  2144. process.nextTick(function() {
  2145. onConnect(res, socket, head);
  2146. });
  2147. }
  2148. function onConnect(res, socket, head) {
  2149. connectReq.removeAllListeners();
  2150. socket.removeAllListeners();
  2151. if (res.statusCode === 200) {
  2152. assert.equal(head.length, 0);
  2153. debug('tunneling connection has established');
  2154. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2155. cb(socket);
  2156. } else {
  2157. debug('tunneling socket could not be established, statusCode=%d',
  2158. res.statusCode);
  2159. var error = new Error('tunneling socket could not be established, ' +
  2160. 'statusCode=' + res.statusCode);
  2161. error.code = 'ECONNRESET';
  2162. options.request.emit('error', error);
  2163. self.removeSocket(placeholder);
  2164. }
  2165. }
  2166. function onError(cause) {
  2167. connectReq.removeAllListeners();
  2168. debug('tunneling socket could not be established, cause=%s\n',
  2169. cause.message, cause.stack);
  2170. var error = new Error('tunneling socket could not be established, ' +
  2171. 'cause=' + cause.message);
  2172. error.code = 'ECONNRESET';
  2173. options.request.emit('error', error);
  2174. self.removeSocket(placeholder);
  2175. }
  2176. };
  2177. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2178. var pos = this.sockets.indexOf(socket)
  2179. if (pos === -1) {
  2180. return;
  2181. }
  2182. this.sockets.splice(pos, 1);
  2183. var pending = this.requests.shift();
  2184. if (pending) {
  2185. // If we have pending requests and a socket gets closed a new one
  2186. // needs to be created to take over in the pool for the one that closed.
  2187. this.createSocket(pending, function(socket) {
  2188. pending.request.onSocket(socket);
  2189. });
  2190. }
  2191. };
  2192. function createSecureSocket(options, cb) {
  2193. var self = this;
  2194. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2195. var hostHeader = options.request.getHeader('host');
  2196. var tlsOptions = mergeOptions({}, self.options, {
  2197. socket: socket,
  2198. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2199. });
  2200. // 0 is dummy port for v0.6
  2201. var secureSocket = tls.connect(0, tlsOptions);
  2202. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2203. cb(secureSocket);
  2204. });
  2205. }
  2206. function toOptions(host, port, localAddress) {
  2207. if (typeof host === 'string') { // since v0.10
  2208. return {
  2209. host: host,
  2210. port: port,
  2211. localAddress: localAddress
  2212. };
  2213. }
  2214. return host; // for v0.11 or later
  2215. }
  2216. function mergeOptions(target) {
  2217. for (var i = 1, len = arguments.length; i < len; ++i) {
  2218. var overrides = arguments[i];
  2219. if (typeof overrides === 'object') {
  2220. var keys = Object.keys(overrides);
  2221. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2222. var k = keys[j];
  2223. if (overrides[k] !== undefined) {
  2224. target[k] = overrides[k];
  2225. }
  2226. }
  2227. }
  2228. }
  2229. return target;
  2230. }
  2231. var debug;
  2232. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2233. debug = function() {
  2234. var args = Array.prototype.slice.call(arguments);
  2235. if (typeof args[0] === 'string') {
  2236. args[0] = 'TUNNEL: ' + args[0];
  2237. } else {
  2238. args.unshift('TUNNEL:');
  2239. }
  2240. console.error.apply(console, args);
  2241. }
  2242. } else {
  2243. debug = function() {};
  2244. }
  2245. exports.debug = debug; // for test
  2246. /***/ }),
  2247. /***/ 143:
  2248. /***/ (function(module, __unusedexports, __webpack_require__) {
  2249. module.exports = withAuthorizationPrefix;
  2250. const atob = __webpack_require__(368);
  2251. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2252. function withAuthorizationPrefix(authorization) {
  2253. if (/^(basic|bearer|token) /i.test(authorization)) {
  2254. return authorization;
  2255. }
  2256. try {
  2257. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2258. return `basic ${authorization}`;
  2259. }
  2260. } catch (error) {}
  2261. if (authorization.split(/\./).length === 3) {
  2262. return `bearer ${authorization}`;
  2263. }
  2264. return `token ${authorization}`;
  2265. }
  2266. /***/ }),
  2267. /***/ 145:
  2268. /***/ (function(module, __unusedexports, __webpack_require__) {
  2269. "use strict";
  2270. const pump = __webpack_require__(453);
  2271. const bufferStream = __webpack_require__(966);
  2272. class MaxBufferError extends Error {
  2273. constructor() {
  2274. super('maxBuffer exceeded');
  2275. this.name = 'MaxBufferError';
  2276. }
  2277. }
  2278. function getStream(inputStream, options) {
  2279. if (!inputStream) {
  2280. return Promise.reject(new Error('Expected a stream'));
  2281. }
  2282. options = Object.assign({maxBuffer: Infinity}, options);
  2283. const {maxBuffer} = options;
  2284. let stream;
  2285. return new Promise((resolve, reject) => {
  2286. const rejectPromise = error => {
  2287. if (error) { // A null check
  2288. error.bufferedData = stream.getBufferedValue();
  2289. }
  2290. reject(error);
  2291. };
  2292. stream = pump(inputStream, bufferStream(options), error => {
  2293. if (error) {
  2294. rejectPromise(error);
  2295. return;
  2296. }
  2297. resolve();
  2298. });
  2299. stream.on('data', () => {
  2300. if (stream.getBufferedLength() > maxBuffer) {
  2301. rejectPromise(new MaxBufferError());
  2302. }
  2303. });
  2304. }).then(() => stream.getBufferedValue());
  2305. }
  2306. module.exports = getStream;
  2307. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2308. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2309. module.exports.MaxBufferError = MaxBufferError;
  2310. /***/ }),
  2311. /***/ 148:
  2312. /***/ (function(module, __unusedexports, __webpack_require__) {
  2313. module.exports = paginatePlugin;
  2314. const iterator = __webpack_require__(8);
  2315. const paginate = __webpack_require__(807);
  2316. function paginatePlugin(octokit) {
  2317. octokit.paginate = paginate.bind(null, octokit);
  2318. octokit.paginate.iterator = iterator.bind(null, octokit);
  2319. }
  2320. /***/ }),
  2321. /***/ 153:
  2322. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2323. "use strict";
  2324. var __importStar = (this && this.__importStar) || function (mod) {
  2325. if (mod && mod.__esModule) return mod;
  2326. var result = {};
  2327. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2328. result["default"] = mod;
  2329. return result;
  2330. };
  2331. Object.defineProperty(exports, "__esModule", { value: true });
  2332. const coreCommand = __importStar(__webpack_require__(431));
  2333. /**
  2334. * Indicates whether the POST action is running
  2335. */
  2336. exports.IsPost = !!process.env['STATE_isPost'];
  2337. /**
  2338. * The repository path for the POST action. The value is empty during the MAIN action.
  2339. */
  2340. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2341. /**
  2342. * The SSH key path for the POST action. The value is empty during the MAIN action.
  2343. */
  2344. exports.SshKeyPath = process.env['STATE_sshKeyPath'] || '';
  2345. /**
  2346. * The SSH known hosts path for the POST action. The value is empty during the MAIN action.
  2347. */
  2348. exports.SshKnownHostsPath = process.env['STATE_sshKnownHostsPath'] || '';
  2349. /**
  2350. * Save the repository path so the POST action can retrieve the value.
  2351. */
  2352. function setRepositoryPath(repositoryPath) {
  2353. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2354. }
  2355. exports.setRepositoryPath = setRepositoryPath;
  2356. /**
  2357. * Save the SSH key path so the POST action can retrieve the value.
  2358. */
  2359. function setSshKeyPath(sshKeyPath) {
  2360. coreCommand.issueCommand('save-state', { name: 'sshKeyPath' }, sshKeyPath);
  2361. }
  2362. exports.setSshKeyPath = setSshKeyPath;
  2363. /**
  2364. * Save the SSH known hosts path so the POST action can retrieve the value.
  2365. */
  2366. function setSshKnownHostsPath(sshKnownHostsPath) {
  2367. coreCommand.issueCommand('save-state', { name: 'sshKnownHostsPath' }, sshKnownHostsPath);
  2368. }
  2369. exports.setSshKnownHostsPath = setSshKnownHostsPath;
  2370. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2371. // This is necessary since we don't have a separate entry point.
  2372. if (!exports.IsPost) {
  2373. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2374. }
  2375. /***/ }),
  2376. /***/ 168:
  2377. /***/ (function(module) {
  2378. "use strict";
  2379. const alias = ['stdin', 'stdout', 'stderr'];
  2380. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2381. module.exports = opts => {
  2382. if (!opts) {
  2383. return null;
  2384. }
  2385. if (opts.stdio && hasAlias(opts)) {
  2386. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2387. }
  2388. if (typeof opts.stdio === 'string') {
  2389. return opts.stdio;
  2390. }
  2391. const stdio = opts.stdio || [];
  2392. if (!Array.isArray(stdio)) {
  2393. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2394. }
  2395. const result = [];
  2396. const len = Math.max(stdio.length, alias.length);
  2397. for (let i = 0; i < len; i++) {
  2398. let value = null;
  2399. if (stdio[i] !== undefined) {
  2400. value = stdio[i];
  2401. } else if (opts[alias[i]] !== undefined) {
  2402. value = opts[alias[i]];
  2403. }
  2404. result[i] = value;
  2405. }
  2406. return result;
  2407. };
  2408. /***/ }),
  2409. /***/ 179:
  2410. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2411. "use strict";
  2412. var net = __webpack_require__(631);
  2413. var tls = __webpack_require__(16);
  2414. var http = __webpack_require__(605);
  2415. var https = __webpack_require__(211);
  2416. var events = __webpack_require__(614);
  2417. var assert = __webpack_require__(357);
  2418. var util = __webpack_require__(669);
  2419. exports.httpOverHttp = httpOverHttp;
  2420. exports.httpsOverHttp = httpsOverHttp;
  2421. exports.httpOverHttps = httpOverHttps;
  2422. exports.httpsOverHttps = httpsOverHttps;
  2423. function httpOverHttp(options) {
  2424. var agent = new TunnelingAgent(options);
  2425. agent.request = http.request;
  2426. return agent;
  2427. }
  2428. function httpsOverHttp(options) {
  2429. var agent = new TunnelingAgent(options);
  2430. agent.request = http.request;
  2431. agent.createSocket = createSecureSocket;
  2432. agent.defaultPort = 443;
  2433. return agent;
  2434. }
  2435. function httpOverHttps(options) {
  2436. var agent = new TunnelingAgent(options);
  2437. agent.request = https.request;
  2438. return agent;
  2439. }
  2440. function httpsOverHttps(options) {
  2441. var agent = new TunnelingAgent(options);
  2442. agent.request = https.request;
  2443. agent.createSocket = createSecureSocket;
  2444. agent.defaultPort = 443;
  2445. return agent;
  2446. }
  2447. function TunnelingAgent(options) {
  2448. var self = this;
  2449. self.options = options || {};
  2450. self.proxyOptions = self.options.proxy || {};
  2451. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2452. self.requests = [];
  2453. self.sockets = [];
  2454. self.on('free', function onFree(socket, host, port, localAddress) {
  2455. var options = toOptions(host, port, localAddress);
  2456. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2457. var pending = self.requests[i];
  2458. if (pending.host === options.host && pending.port === options.port) {
  2459. // Detect the request to connect same origin server,
  2460. // reuse the connection.
  2461. self.requests.splice(i, 1);
  2462. pending.request.onSocket(socket);
  2463. return;
  2464. }
  2465. }
  2466. socket.destroy();
  2467. self.removeSocket(socket);
  2468. });
  2469. }
  2470. util.inherits(TunnelingAgent, events.EventEmitter);
  2471. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2472. var self = this;
  2473. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2474. if (self.sockets.length >= this.maxSockets) {
  2475. // We are over limit so we'll add it to the queue.
  2476. self.requests.push(options);
  2477. return;
  2478. }
  2479. // If we are under maxSockets create a new one.
  2480. self.createSocket(options, function(socket) {
  2481. socket.on('free', onFree);
  2482. socket.on('close', onCloseOrRemove);
  2483. socket.on('agentRemove', onCloseOrRemove);
  2484. req.onSocket(socket);
  2485. function onFree() {
  2486. self.emit('free', socket, options);
  2487. }
  2488. function onCloseOrRemove(err) {
  2489. self.removeSocket(socket);
  2490. socket.removeListener('free', onFree);
  2491. socket.removeListener('close', onCloseOrRemove);
  2492. socket.removeListener('agentRemove', onCloseOrRemove);
  2493. }
  2494. });
  2495. };
  2496. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2497. var self = this;
  2498. var placeholder = {};
  2499. self.sockets.push(placeholder);
  2500. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2501. method: 'CONNECT',
  2502. path: options.host + ':' + options.port,
  2503. agent: false,
  2504. headers: {
  2505. host: options.host + ':' + options.port
  2506. }
  2507. });
  2508. if (options.localAddress) {
  2509. connectOptions.localAddress = options.localAddress;
  2510. }
  2511. if (connectOptions.proxyAuth) {
  2512. connectOptions.headers = connectOptions.headers || {};
  2513. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2514. new Buffer(connectOptions.proxyAuth).toString('base64');
  2515. }
  2516. debug('making CONNECT request');
  2517. var connectReq = self.request(connectOptions);
  2518. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2519. connectReq.once('response', onResponse); // for v0.6
  2520. connectReq.once('upgrade', onUpgrade); // for v0.6
  2521. connectReq.once('connect', onConnect); // for v0.7 or later
  2522. connectReq.once('error', onError);
  2523. connectReq.end();
  2524. function onResponse(res) {
  2525. // Very hacky. This is necessary to avoid http-parser leaks.
  2526. res.upgrade = true;
  2527. }
  2528. function onUpgrade(res, socket, head) {
  2529. // Hacky.
  2530. process.nextTick(function() {
  2531. onConnect(res, socket, head);
  2532. });
  2533. }
  2534. function onConnect(res, socket, head) {
  2535. connectReq.removeAllListeners();
  2536. socket.removeAllListeners();
  2537. if (res.statusCode !== 200) {
  2538. debug('tunneling socket could not be established, statusCode=%d',
  2539. res.statusCode);
  2540. socket.destroy();
  2541. var error = new Error('tunneling socket could not be established, ' +
  2542. 'statusCode=' + res.statusCode);
  2543. error.code = 'ECONNRESET';
  2544. options.request.emit('error', error);
  2545. self.removeSocket(placeholder);
  2546. return;
  2547. }
  2548. if (head.length > 0) {
  2549. debug('got illegal response body from proxy');
  2550. socket.destroy();
  2551. var error = new Error('got illegal response body from proxy');
  2552. error.code = 'ECONNRESET';
  2553. options.request.emit('error', error);
  2554. self.removeSocket(placeholder);
  2555. return;
  2556. }
  2557. debug('tunneling connection has established');
  2558. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2559. return cb(socket);
  2560. }
  2561. function onError(cause) {
  2562. connectReq.removeAllListeners();
  2563. debug('tunneling socket could not be established, cause=%s\n',
  2564. cause.message, cause.stack);
  2565. var error = new Error('tunneling socket could not be established, ' +
  2566. 'cause=' + cause.message);
  2567. error.code = 'ECONNRESET';
  2568. options.request.emit('error', error);
  2569. self.removeSocket(placeholder);
  2570. }
  2571. };
  2572. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2573. var pos = this.sockets.indexOf(socket)
  2574. if (pos === -1) {
  2575. return;
  2576. }
  2577. this.sockets.splice(pos, 1);
  2578. var pending = this.requests.shift();
  2579. if (pending) {
  2580. // If we have pending requests and a socket gets closed a new one
  2581. // needs to be created to take over in the pool for the one that closed.
  2582. this.createSocket(pending, function(socket) {
  2583. pending.request.onSocket(socket);
  2584. });
  2585. }
  2586. };
  2587. function createSecureSocket(options, cb) {
  2588. var self = this;
  2589. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2590. var hostHeader = options.request.getHeader('host');
  2591. var tlsOptions = mergeOptions({}, self.options, {
  2592. socket: socket,
  2593. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2594. });
  2595. // 0 is dummy port for v0.6
  2596. var secureSocket = tls.connect(0, tlsOptions);
  2597. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2598. cb(secureSocket);
  2599. });
  2600. }
  2601. function toOptions(host, port, localAddress) {
  2602. if (typeof host === 'string') { // since v0.10
  2603. return {
  2604. host: host,
  2605. port: port,
  2606. localAddress: localAddress
  2607. };
  2608. }
  2609. return host; // for v0.11 or later
  2610. }
  2611. function mergeOptions(target) {
  2612. for (var i = 1, len = arguments.length; i < len; ++i) {
  2613. var overrides = arguments[i];
  2614. if (typeof overrides === 'object') {
  2615. var keys = Object.keys(overrides);
  2616. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2617. var k = keys[j];
  2618. if (overrides[k] !== undefined) {
  2619. target[k] = overrides[k];
  2620. }
  2621. }
  2622. }
  2623. }
  2624. return target;
  2625. }
  2626. var debug;
  2627. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2628. debug = function() {
  2629. var args = Array.prototype.slice.call(arguments);
  2630. if (typeof args[0] === 'string') {
  2631. args[0] = 'TUNNEL: ' + args[0];
  2632. } else {
  2633. args.unshift('TUNNEL:');
  2634. }
  2635. console.error.apply(console, args);
  2636. }
  2637. } else {
  2638. debug = function() {};
  2639. }
  2640. exports.debug = debug; // for test
  2641. /***/ }),
  2642. /***/ 190:
  2643. /***/ (function(module, __unusedexports, __webpack_require__) {
  2644. module.exports = authenticationPlugin;
  2645. const { createTokenAuth } = __webpack_require__(813);
  2646. const { Deprecation } = __webpack_require__(692);
  2647. const once = __webpack_require__(969);
  2648. const beforeRequest = __webpack_require__(863);
  2649. const requestError = __webpack_require__(991);
  2650. const validate = __webpack_require__(954);
  2651. const withAuthorizationPrefix = __webpack_require__(143);
  2652. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2653. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2654. function authenticationPlugin(octokit, options) {
  2655. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2656. if (options.authStrategy) {
  2657. const auth = options.authStrategy(options.auth);
  2658. octokit.hook.wrap("request", auth.hook);
  2659. octokit.auth = auth;
  2660. return;
  2661. }
  2662. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2663. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2664. if (!options.auth) {
  2665. octokit.auth = () =>
  2666. Promise.resolve({
  2667. type: "unauthenticated"
  2668. });
  2669. return;
  2670. }
  2671. const isBasicAuthString =
  2672. typeof options.auth === "string" &&
  2673. /^basic/.test(withAuthorizationPrefix(options.auth));
  2674. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2675. if (typeof options.auth === "string" && !isBasicAuthString) {
  2676. const auth = createTokenAuth(options.auth);
  2677. octokit.hook.wrap("request", auth.hook);
  2678. octokit.auth = auth;
  2679. return;
  2680. }
  2681. // Otherwise log a deprecation message
  2682. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2683. ? [
  2684. deprecateAuthBasic,
  2685. 'Setting the "new Octokit({ auth })" option to a Basic Auth string is deprecated. Use https://github.com/octokit/auth-basic.js instead. See (https://octokit.github.io/rest.js/#authentication)'
  2686. ]
  2687. : [
  2688. deprecateAuthObject,
  2689. 'Setting the "new Octokit({ auth })" option to an object without also setting the "authStrategy" option is deprecated and will be removed in v17. See (https://octokit.github.io/rest.js/#authentication)'
  2690. ];
  2691. deprecationMethod(
  2692. octokit.log,
  2693. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2694. );
  2695. octokit.auth = () =>
  2696. Promise.resolve({
  2697. type: "deprecated",
  2698. message: deprecationMessapge
  2699. });
  2700. validate(options.auth);
  2701. const state = {
  2702. octokit,
  2703. auth: options.auth
  2704. };
  2705. octokit.hook.before("request", beforeRequest.bind(null, state));
  2706. octokit.hook.error("request", requestError.bind(null, state));
  2707. }
  2708. /***/ }),
  2709. /***/ 197:
  2710. /***/ (function(module, __unusedexports, __webpack_require__) {
  2711. module.exports = isexe
  2712. isexe.sync = sync
  2713. var fs = __webpack_require__(747)
  2714. function isexe (path, options, cb) {
  2715. fs.stat(path, function (er, stat) {
  2716. cb(er, er ? false : checkStat(stat, options))
  2717. })
  2718. }
  2719. function sync (path, options) {
  2720. return checkStat(fs.statSync(path), options)
  2721. }
  2722. function checkStat (stat, options) {
  2723. return stat.isFile() && checkMode(stat, options)
  2724. }
  2725. function checkMode (stat, options) {
  2726. var mod = stat.mode
  2727. var uid = stat.uid
  2728. var gid = stat.gid
  2729. var myUid = options.uid !== undefined ?
  2730. options.uid : process.getuid && process.getuid()
  2731. var myGid = options.gid !== undefined ?
  2732. options.gid : process.getgid && process.getgid()
  2733. var u = parseInt('100', 8)
  2734. var g = parseInt('010', 8)
  2735. var o = parseInt('001', 8)
  2736. var ug = u | g
  2737. var ret = (mod & o) ||
  2738. (mod & g) && gid === myGid ||
  2739. (mod & u) && uid === myUid ||
  2740. (mod & ug) && myUid === 0
  2741. return ret
  2742. }
  2743. /***/ }),
  2744. /***/ 198:
  2745. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2746. "use strict";
  2747. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2748. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2749. return new (P || (P = Promise))(function (resolve, reject) {
  2750. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2751. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2752. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2753. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2754. });
  2755. };
  2756. var __importStar = (this && this.__importStar) || function (mod) {
  2757. if (mod && mod.__esModule) return mod;
  2758. var result = {};
  2759. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2760. result["default"] = mod;
  2761. return result;
  2762. };
  2763. Object.defineProperty(exports, "__esModule", { value: true });
  2764. const core = __importStar(__webpack_require__(470));
  2765. const coreCommand = __importStar(__webpack_require__(431));
  2766. const gitSourceProvider = __importStar(__webpack_require__(293));
  2767. const inputHelper = __importStar(__webpack_require__(821));
  2768. const path = __importStar(__webpack_require__(622));
  2769. const stateHelper = __importStar(__webpack_require__(153));
  2770. function run() {
  2771. return __awaiter(this, void 0, void 0, function* () {
  2772. try {
  2773. const sourceSettings = inputHelper.getInputs();
  2774. try {
  2775. // Register problem matcher
  2776. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2777. // Get sources
  2778. yield gitSourceProvider.getSource(sourceSettings);
  2779. }
  2780. finally {
  2781. // Unregister problem matcher
  2782. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2783. }
  2784. }
  2785. catch (error) {
  2786. core.setFailed(error.message);
  2787. }
  2788. });
  2789. }
  2790. function cleanup() {
  2791. return __awaiter(this, void 0, void 0, function* () {
  2792. try {
  2793. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2794. }
  2795. catch (error) {
  2796. core.warning(error.message);
  2797. }
  2798. });
  2799. }
  2800. // Main
  2801. if (!stateHelper.IsPost) {
  2802. run();
  2803. }
  2804. // Post
  2805. else {
  2806. cleanup();
  2807. }
  2808. /***/ }),
  2809. /***/ 211:
  2810. /***/ (function(module) {
  2811. module.exports = require("https");
  2812. /***/ }),
  2813. /***/ 215:
  2814. /***/ (function(module) {
  2815. module.exports = {"name":"@octokit/rest","version":"16.38.1","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^3.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^16.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:code":"node scripts/update-endpoints/code","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.38.1.tgz","_integrity":"sha512-zyNFx+/Bd1EXt7LQjfrc6H4wryBQ/oDuZeZhGMBSFr1eMPFDmpEweFQR3R25zjKwBQpDY7L5GQO6A3XSaOfV1w==","_from":"@octokit/rest@16.38.1"};
  2816. /***/ }),
  2817. /***/ 227:
  2818. /***/ (function(__unusedmodule, exports) {
  2819. "use strict";
  2820. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2821. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2822. return new (P || (P = Promise))(function (resolve, reject) {
  2823. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2824. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2825. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2826. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2827. });
  2828. };
  2829. Object.defineProperty(exports, "__esModule", { value: true });
  2830. function getCheckoutInfo(git, ref, commit) {
  2831. return __awaiter(this, void 0, void 0, function* () {
  2832. if (!git) {
  2833. throw new Error('Arg git cannot be empty');
  2834. }
  2835. if (!ref && !commit) {
  2836. throw new Error('Args ref and commit cannot both be empty');
  2837. }
  2838. const result = {};
  2839. const upperRef = (ref || '').toUpperCase();
  2840. // SHA only
  2841. if (!ref) {
  2842. result.ref = commit;
  2843. }
  2844. // refs/heads/
  2845. else if (upperRef.startsWith('REFS/HEADS/')) {
  2846. const branch = ref.substring('refs/heads/'.length);
  2847. result.ref = branch;
  2848. result.startPoint = `refs/remotes/origin/${branch}`;
  2849. }
  2850. // refs/pull/
  2851. else if (upperRef.startsWith('REFS/PULL/')) {
  2852. const branch = ref.substring('refs/pull/'.length);
  2853. result.ref = `refs/remotes/pull/${branch}`;
  2854. }
  2855. // refs/tags/
  2856. else if (upperRef.startsWith('REFS/')) {
  2857. result.ref = ref;
  2858. }
  2859. // Unqualified ref, check for a matching branch or tag
  2860. else {
  2861. if (yield git.branchExists(true, `origin/${ref}`)) {
  2862. result.ref = ref;
  2863. result.startPoint = `refs/remotes/origin/${ref}`;
  2864. }
  2865. else if (yield git.tagExists(`${ref}`)) {
  2866. result.ref = `refs/tags/${ref}`;
  2867. }
  2868. else {
  2869. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2870. }
  2871. }
  2872. return result;
  2873. });
  2874. }
  2875. exports.getCheckoutInfo = getCheckoutInfo;
  2876. function getRefSpec(ref, commit) {
  2877. if (!ref && !commit) {
  2878. throw new Error('Args ref and commit cannot both be empty');
  2879. }
  2880. const upperRef = (ref || '').toUpperCase();
  2881. // SHA
  2882. if (commit) {
  2883. // refs/heads
  2884. if (upperRef.startsWith('REFS/HEADS/')) {
  2885. const branch = ref.substring('refs/heads/'.length);
  2886. return [`+${commit}:refs/remotes/origin/${branch}`];
  2887. }
  2888. // refs/pull/
  2889. else if (upperRef.startsWith('REFS/PULL/')) {
  2890. const branch = ref.substring('refs/pull/'.length);
  2891. return [`+${commit}:refs/remotes/pull/${branch}`];
  2892. }
  2893. // refs/tags/
  2894. else if (upperRef.startsWith('REFS/TAGS/')) {
  2895. return [`+${commit}:${ref}`];
  2896. }
  2897. // Otherwise no destination ref
  2898. else {
  2899. return [commit];
  2900. }
  2901. }
  2902. // Unqualified ref, check for a matching branch or tag
  2903. else if (!upperRef.startsWith('REFS/')) {
  2904. return [
  2905. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2906. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2907. ];
  2908. }
  2909. // refs/heads/
  2910. else if (upperRef.startsWith('REFS/HEADS/')) {
  2911. const branch = ref.substring('refs/heads/'.length);
  2912. return [`+${ref}:refs/remotes/origin/${branch}`];
  2913. }
  2914. // refs/pull/
  2915. else if (upperRef.startsWith('REFS/PULL/')) {
  2916. const branch = ref.substring('refs/pull/'.length);
  2917. return [`+${ref}:refs/remotes/pull/${branch}`];
  2918. }
  2919. // refs/tags/
  2920. else {
  2921. return [`+${ref}:${ref}`];
  2922. }
  2923. }
  2924. exports.getRefSpec = getRefSpec;
  2925. /***/ }),
  2926. /***/ 248:
  2927. /***/ (function(module, __unusedexports, __webpack_require__) {
  2928. module.exports = octokitRegisterEndpoints;
  2929. const registerEndpoints = __webpack_require__(899);
  2930. function octokitRegisterEndpoints(octokit) {
  2931. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2932. }
  2933. /***/ }),
  2934. /***/ 260:
  2935. /***/ (function(module, __unusedexports, __webpack_require__) {
  2936. // Note: since nyc uses this module to output coverage, any lines
  2937. // that are in the direct sync flow of nyc's outputCoverage are
  2938. // ignored, since we can never get coverage for them.
  2939. var assert = __webpack_require__(357)
  2940. var signals = __webpack_require__(654)
  2941. var EE = __webpack_require__(614)
  2942. /* istanbul ignore if */
  2943. if (typeof EE !== 'function') {
  2944. EE = EE.EventEmitter
  2945. }
  2946. var emitter
  2947. if (process.__signal_exit_emitter__) {
  2948. emitter = process.__signal_exit_emitter__
  2949. } else {
  2950. emitter = process.__signal_exit_emitter__ = new EE()
  2951. emitter.count = 0
  2952. emitter.emitted = {}
  2953. }
  2954. // Because this emitter is a global, we have to check to see if a
  2955. // previous version of this library failed to enable infinite listeners.
  2956. // I know what you're about to say. But literally everything about
  2957. // signal-exit is a compromise with evil. Get used to it.
  2958. if (!emitter.infinite) {
  2959. emitter.setMaxListeners(Infinity)
  2960. emitter.infinite = true
  2961. }
  2962. module.exports = function (cb, opts) {
  2963. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2964. if (loaded === false) {
  2965. load()
  2966. }
  2967. var ev = 'exit'
  2968. if (opts && opts.alwaysLast) {
  2969. ev = 'afterexit'
  2970. }
  2971. var remove = function () {
  2972. emitter.removeListener(ev, cb)
  2973. if (emitter.listeners('exit').length === 0 &&
  2974. emitter.listeners('afterexit').length === 0) {
  2975. unload()
  2976. }
  2977. }
  2978. emitter.on(ev, cb)
  2979. return remove
  2980. }
  2981. module.exports.unload = unload
  2982. function unload () {
  2983. if (!loaded) {
  2984. return
  2985. }
  2986. loaded = false
  2987. signals.forEach(function (sig) {
  2988. try {
  2989. process.removeListener(sig, sigListeners[sig])
  2990. } catch (er) {}
  2991. })
  2992. process.emit = originalProcessEmit
  2993. process.reallyExit = originalProcessReallyExit
  2994. emitter.count -= 1
  2995. }
  2996. function emit (event, code, signal) {
  2997. if (emitter.emitted[event]) {
  2998. return
  2999. }
  3000. emitter.emitted[event] = true
  3001. emitter.emit(event, code, signal)
  3002. }
  3003. // { <signal>: <listener fn>, ... }
  3004. var sigListeners = {}
  3005. signals.forEach(function (sig) {
  3006. sigListeners[sig] = function listener () {
  3007. // If there are no other listeners, an exit is coming!
  3008. // Simplest way: remove us and then re-send the signal.
  3009. // We know that this will kill the process, so we can
  3010. // safely emit now.
  3011. var listeners = process.listeners(sig)
  3012. if (listeners.length === emitter.count) {
  3013. unload()
  3014. emit('exit', null, sig)
  3015. /* istanbul ignore next */
  3016. emit('afterexit', null, sig)
  3017. /* istanbul ignore next */
  3018. process.kill(process.pid, sig)
  3019. }
  3020. }
  3021. })
  3022. module.exports.signals = function () {
  3023. return signals
  3024. }
  3025. module.exports.load = load
  3026. var loaded = false
  3027. function load () {
  3028. if (loaded) {
  3029. return
  3030. }
  3031. loaded = true
  3032. // This is the number of onSignalExit's that are in play.
  3033. // It's important so that we can count the correct number of
  3034. // listeners on signals, and don't wait for the other one to
  3035. // handle it instead of us.
  3036. emitter.count += 1
  3037. signals = signals.filter(function (sig) {
  3038. try {
  3039. process.on(sig, sigListeners[sig])
  3040. return true
  3041. } catch (er) {
  3042. return false
  3043. }
  3044. })
  3045. process.emit = processEmit
  3046. process.reallyExit = processReallyExit
  3047. }
  3048. var originalProcessReallyExit = process.reallyExit
  3049. function processReallyExit (code) {
  3050. process.exitCode = code || 0
  3051. emit('exit', process.exitCode, null)
  3052. /* istanbul ignore next */
  3053. emit('afterexit', process.exitCode, null)
  3054. /* istanbul ignore next */
  3055. originalProcessReallyExit.call(process, process.exitCode)
  3056. }
  3057. var originalProcessEmit = process.emit
  3058. function processEmit (ev, arg) {
  3059. if (ev === 'exit') {
  3060. if (arg !== undefined) {
  3061. process.exitCode = arg
  3062. }
  3063. var ret = originalProcessEmit.apply(this, arguments)
  3064. emit('exit', process.exitCode, null)
  3065. /* istanbul ignore next */
  3066. emit('afterexit', process.exitCode, null)
  3067. return ret
  3068. } else {
  3069. return originalProcessEmit.apply(this, arguments)
  3070. }
  3071. }
  3072. /***/ }),
  3073. /***/ 262:
  3074. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3075. "use strict";
  3076. Object.defineProperty(exports, "__esModule", { value: true });
  3077. const fs_1 = __webpack_require__(747);
  3078. const os_1 = __webpack_require__(87);
  3079. class Context {
  3080. /**
  3081. * Hydrate the context from the environment
  3082. */
  3083. constructor() {
  3084. this.payload = {};
  3085. if (process.env.GITHUB_EVENT_PATH) {
  3086. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3087. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3088. }
  3089. else {
  3090. const path = process.env.GITHUB_EVENT_PATH;
  3091. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3092. }
  3093. }
  3094. this.eventName = process.env.GITHUB_EVENT_NAME;
  3095. this.sha = process.env.GITHUB_SHA;
  3096. this.ref = process.env.GITHUB_REF;
  3097. this.workflow = process.env.GITHUB_WORKFLOW;
  3098. this.action = process.env.GITHUB_ACTION;
  3099. this.actor = process.env.GITHUB_ACTOR;
  3100. }
  3101. get issue() {
  3102. const payload = this.payload;
  3103. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3104. }
  3105. get repo() {
  3106. if (process.env.GITHUB_REPOSITORY) {
  3107. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3108. return { owner, repo };
  3109. }
  3110. if (this.payload.repository) {
  3111. return {
  3112. owner: this.payload.repository.owner.login,
  3113. repo: this.payload.repository.name
  3114. };
  3115. }
  3116. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3117. }
  3118. }
  3119. exports.Context = Context;
  3120. //# sourceMappingURL=context.js.map
  3121. /***/ }),
  3122. /***/ 265:
  3123. /***/ (function(module, __unusedexports, __webpack_require__) {
  3124. module.exports = getPage
  3125. const deprecate = __webpack_require__(370)
  3126. const getPageLinks = __webpack_require__(577)
  3127. const HttpError = __webpack_require__(297)
  3128. function getPage (octokit, link, which, headers) {
  3129. deprecate(`octokit.get${which.charAt(0).toUpperCase() + which.slice(1)}Page() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  3130. const url = getPageLinks(link)[which]
  3131. if (!url) {
  3132. const urlError = new HttpError(`No ${which} page found`, 404)
  3133. return Promise.reject(urlError)
  3134. }
  3135. const requestOptions = {
  3136. url,
  3137. headers: applyAcceptHeader(link, headers)
  3138. }
  3139. const promise = octokit.request(requestOptions)
  3140. return promise
  3141. }
  3142. function applyAcceptHeader (res, headers) {
  3143. const previous = res.headers && res.headers['x-github-media-type']
  3144. if (!previous || (headers && headers.accept)) {
  3145. return headers
  3146. }
  3147. headers = headers || {}
  3148. headers.accept = 'application/vnd.' + previous
  3149. .replace('; param=', '.')
  3150. .replace('; format=', '+')
  3151. return headers
  3152. }
  3153. /***/ }),
  3154. /***/ 280:
  3155. /***/ (function(module, exports) {
  3156. exports = module.exports = SemVer
  3157. var debug
  3158. /* istanbul ignore next */
  3159. if (typeof process === 'object' &&
  3160. process.env &&
  3161. process.env.NODE_DEBUG &&
  3162. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3163. debug = function () {
  3164. var args = Array.prototype.slice.call(arguments, 0)
  3165. args.unshift('SEMVER')
  3166. console.log.apply(console, args)
  3167. }
  3168. } else {
  3169. debug = function () {}
  3170. }
  3171. // Note: this is the semver.org version of the spec that it implements
  3172. // Not necessarily the package version of this code.
  3173. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3174. var MAX_LENGTH = 256
  3175. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3176. /* istanbul ignore next */ 9007199254740991
  3177. // Max safe segment length for coercion.
  3178. var MAX_SAFE_COMPONENT_LENGTH = 16
  3179. // The actual regexps go on exports.re
  3180. var re = exports.re = []
  3181. var src = exports.src = []
  3182. var R = 0
  3183. // The following Regular Expressions can be used for tokenizing,
  3184. // validating, and parsing SemVer version strings.
  3185. // ## Numeric Identifier
  3186. // A single `0`, or a non-zero digit followed by zero or more digits.
  3187. var NUMERICIDENTIFIER = R++
  3188. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3189. var NUMERICIDENTIFIERLOOSE = R++
  3190. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3191. // ## Non-numeric Identifier
  3192. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3193. // more letters, digits, or hyphens.
  3194. var NONNUMERICIDENTIFIER = R++
  3195. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3196. // ## Main Version
  3197. // Three dot-separated numeric identifiers.
  3198. var MAINVERSION = R++
  3199. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3200. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3201. '(' + src[NUMERICIDENTIFIER] + ')'
  3202. var MAINVERSIONLOOSE = R++
  3203. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3204. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3205. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3206. // ## Pre-release Version Identifier
  3207. // A numeric identifier, or a non-numeric identifier.
  3208. var PRERELEASEIDENTIFIER = R++
  3209. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3210. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3211. var PRERELEASEIDENTIFIERLOOSE = R++
  3212. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3213. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3214. // ## Pre-release Version
  3215. // Hyphen, followed by one or more dot-separated pre-release version
  3216. // identifiers.
  3217. var PRERELEASE = R++
  3218. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3219. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3220. var PRERELEASELOOSE = R++
  3221. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3222. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3223. // ## Build Metadata Identifier
  3224. // Any combination of digits, letters, or hyphens.
  3225. var BUILDIDENTIFIER = R++
  3226. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3227. // ## Build Metadata
  3228. // Plus sign, followed by one or more period-separated build metadata
  3229. // identifiers.
  3230. var BUILD = R++
  3231. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3232. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3233. // ## Full Version String
  3234. // A main version, followed optionally by a pre-release version and
  3235. // build metadata.
  3236. // Note that the only major, minor, patch, and pre-release sections of
  3237. // the version string are capturing groups. The build metadata is not a
  3238. // capturing group, because it should not ever be used in version
  3239. // comparison.
  3240. var FULL = R++
  3241. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3242. src[PRERELEASE] + '?' +
  3243. src[BUILD] + '?'
  3244. src[FULL] = '^' + FULLPLAIN + '$'
  3245. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3246. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3247. // common in the npm registry.
  3248. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3249. src[PRERELEASELOOSE] + '?' +
  3250. src[BUILD] + '?'
  3251. var LOOSE = R++
  3252. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3253. var GTLT = R++
  3254. src[GTLT] = '((?:<|>)?=?)'
  3255. // Something like "2.*" or "1.2.x".
  3256. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3257. // Only the first item is strictly required.
  3258. var XRANGEIDENTIFIERLOOSE = R++
  3259. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3260. var XRANGEIDENTIFIER = R++
  3261. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3262. var XRANGEPLAIN = R++
  3263. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3264. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3265. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3266. '(?:' + src[PRERELEASE] + ')?' +
  3267. src[BUILD] + '?' +
  3268. ')?)?'
  3269. var XRANGEPLAINLOOSE = R++
  3270. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3271. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3272. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3273. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3274. src[BUILD] + '?' +
  3275. ')?)?'
  3276. var XRANGE = R++
  3277. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3278. var XRANGELOOSE = R++
  3279. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3280. // Coercion.
  3281. // Extract anything that could conceivably be a part of a valid semver
  3282. var COERCE = R++
  3283. src[COERCE] = '(?:^|[^\\d])' +
  3284. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3285. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3286. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3287. '(?:$|[^\\d])'
  3288. // Tilde ranges.
  3289. // Meaning is "reasonably at or greater than"
  3290. var LONETILDE = R++
  3291. src[LONETILDE] = '(?:~>?)'
  3292. var TILDETRIM = R++
  3293. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3294. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3295. var tildeTrimReplace = '$1~'
  3296. var TILDE = R++
  3297. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3298. var TILDELOOSE = R++
  3299. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3300. // Caret ranges.
  3301. // Meaning is "at least and backwards compatible with"
  3302. var LONECARET = R++
  3303. src[LONECARET] = '(?:\\^)'
  3304. var CARETTRIM = R++
  3305. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3306. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3307. var caretTrimReplace = '$1^'
  3308. var CARET = R++
  3309. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3310. var CARETLOOSE = R++
  3311. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3312. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3313. var COMPARATORLOOSE = R++
  3314. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3315. var COMPARATOR = R++
  3316. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3317. // An expression to strip any whitespace between the gtlt and the thing
  3318. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3319. var COMPARATORTRIM = R++
  3320. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3321. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3322. // this one has to use the /g flag
  3323. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3324. var comparatorTrimReplace = '$1$2$3'
  3325. // Something like `1.2.3 - 1.2.4`
  3326. // Note that these all use the loose form, because they'll be
  3327. // checked against either the strict or loose comparator form
  3328. // later.
  3329. var HYPHENRANGE = R++
  3330. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3331. '\\s+-\\s+' +
  3332. '(' + src[XRANGEPLAIN] + ')' +
  3333. '\\s*$'
  3334. var HYPHENRANGELOOSE = R++
  3335. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3336. '\\s+-\\s+' +
  3337. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3338. '\\s*$'
  3339. // Star ranges basically just allow anything at all.
  3340. var STAR = R++
  3341. src[STAR] = '(<|>)?=?\\s*\\*'
  3342. // Compile to actual regexp objects.
  3343. // All are flag-free, unless they were created above with a flag.
  3344. for (var i = 0; i < R; i++) {
  3345. debug(i, src[i])
  3346. if (!re[i]) {
  3347. re[i] = new RegExp(src[i])
  3348. }
  3349. }
  3350. exports.parse = parse
  3351. function parse (version, options) {
  3352. if (!options || typeof options !== 'object') {
  3353. options = {
  3354. loose: !!options,
  3355. includePrerelease: false
  3356. }
  3357. }
  3358. if (version instanceof SemVer) {
  3359. return version
  3360. }
  3361. if (typeof version !== 'string') {
  3362. return null
  3363. }
  3364. if (version.length > MAX_LENGTH) {
  3365. return null
  3366. }
  3367. var r = options.loose ? re[LOOSE] : re[FULL]
  3368. if (!r.test(version)) {
  3369. return null
  3370. }
  3371. try {
  3372. return new SemVer(version, options)
  3373. } catch (er) {
  3374. return null
  3375. }
  3376. }
  3377. exports.valid = valid
  3378. function valid (version, options) {
  3379. var v = parse(version, options)
  3380. return v ? v.version : null
  3381. }
  3382. exports.clean = clean
  3383. function clean (version, options) {
  3384. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3385. return s ? s.version : null
  3386. }
  3387. exports.SemVer = SemVer
  3388. function SemVer (version, options) {
  3389. if (!options || typeof options !== 'object') {
  3390. options = {
  3391. loose: !!options,
  3392. includePrerelease: false
  3393. }
  3394. }
  3395. if (version instanceof SemVer) {
  3396. if (version.loose === options.loose) {
  3397. return version
  3398. } else {
  3399. version = version.version
  3400. }
  3401. } else if (typeof version !== 'string') {
  3402. throw new TypeError('Invalid Version: ' + version)
  3403. }
  3404. if (version.length > MAX_LENGTH) {
  3405. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3406. }
  3407. if (!(this instanceof SemVer)) {
  3408. return new SemVer(version, options)
  3409. }
  3410. debug('SemVer', version, options)
  3411. this.options = options
  3412. this.loose = !!options.loose
  3413. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3414. if (!m) {
  3415. throw new TypeError('Invalid Version: ' + version)
  3416. }
  3417. this.raw = version
  3418. // these are actually numbers
  3419. this.major = +m[1]
  3420. this.minor = +m[2]
  3421. this.patch = +m[3]
  3422. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3423. throw new TypeError('Invalid major version')
  3424. }
  3425. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3426. throw new TypeError('Invalid minor version')
  3427. }
  3428. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3429. throw new TypeError('Invalid patch version')
  3430. }
  3431. // numberify any prerelease numeric ids
  3432. if (!m[4]) {
  3433. this.prerelease = []
  3434. } else {
  3435. this.prerelease = m[4].split('.').map(function (id) {
  3436. if (/^[0-9]+$/.test(id)) {
  3437. var num = +id
  3438. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3439. return num
  3440. }
  3441. }
  3442. return id
  3443. })
  3444. }
  3445. this.build = m[5] ? m[5].split('.') : []
  3446. this.format()
  3447. }
  3448. SemVer.prototype.format = function () {
  3449. this.version = this.major + '.' + this.minor + '.' + this.patch
  3450. if (this.prerelease.length) {
  3451. this.version += '-' + this.prerelease.join('.')
  3452. }
  3453. return this.version
  3454. }
  3455. SemVer.prototype.toString = function () {
  3456. return this.version
  3457. }
  3458. SemVer.prototype.compare = function (other) {
  3459. debug('SemVer.compare', this.version, this.options, other)
  3460. if (!(other instanceof SemVer)) {
  3461. other = new SemVer(other, this.options)
  3462. }
  3463. return this.compareMain(other) || this.comparePre(other)
  3464. }
  3465. SemVer.prototype.compareMain = function (other) {
  3466. if (!(other instanceof SemVer)) {
  3467. other = new SemVer(other, this.options)
  3468. }
  3469. return compareIdentifiers(this.major, other.major) ||
  3470. compareIdentifiers(this.minor, other.minor) ||
  3471. compareIdentifiers(this.patch, other.patch)
  3472. }
  3473. SemVer.prototype.comparePre = function (other) {
  3474. if (!(other instanceof SemVer)) {
  3475. other = new SemVer(other, this.options)
  3476. }
  3477. // NOT having a prerelease is > having one
  3478. if (this.prerelease.length && !other.prerelease.length) {
  3479. return -1
  3480. } else if (!this.prerelease.length && other.prerelease.length) {
  3481. return 1
  3482. } else if (!this.prerelease.length && !other.prerelease.length) {
  3483. return 0
  3484. }
  3485. var i = 0
  3486. do {
  3487. var a = this.prerelease[i]
  3488. var b = other.prerelease[i]
  3489. debug('prerelease compare', i, a, b)
  3490. if (a === undefined && b === undefined) {
  3491. return 0
  3492. } else if (b === undefined) {
  3493. return 1
  3494. } else if (a === undefined) {
  3495. return -1
  3496. } else if (a === b) {
  3497. continue
  3498. } else {
  3499. return compareIdentifiers(a, b)
  3500. }
  3501. } while (++i)
  3502. }
  3503. // preminor will bump the version up to the next minor release, and immediately
  3504. // down to pre-release. premajor and prepatch work the same way.
  3505. SemVer.prototype.inc = function (release, identifier) {
  3506. switch (release) {
  3507. case 'premajor':
  3508. this.prerelease.length = 0
  3509. this.patch = 0
  3510. this.minor = 0
  3511. this.major++
  3512. this.inc('pre', identifier)
  3513. break
  3514. case 'preminor':
  3515. this.prerelease.length = 0
  3516. this.patch = 0
  3517. this.minor++
  3518. this.inc('pre', identifier)
  3519. break
  3520. case 'prepatch':
  3521. // If this is already a prerelease, it will bump to the next version
  3522. // drop any prereleases that might already exist, since they are not
  3523. // relevant at this point.
  3524. this.prerelease.length = 0
  3525. this.inc('patch', identifier)
  3526. this.inc('pre', identifier)
  3527. break
  3528. // If the input is a non-prerelease version, this acts the same as
  3529. // prepatch.
  3530. case 'prerelease':
  3531. if (this.prerelease.length === 0) {
  3532. this.inc('patch', identifier)
  3533. }
  3534. this.inc('pre', identifier)
  3535. break
  3536. case 'major':
  3537. // If this is a pre-major version, bump up to the same major version.
  3538. // Otherwise increment major.
  3539. // 1.0.0-5 bumps to 1.0.0
  3540. // 1.1.0 bumps to 2.0.0
  3541. if (this.minor !== 0 ||
  3542. this.patch !== 0 ||
  3543. this.prerelease.length === 0) {
  3544. this.major++
  3545. }
  3546. this.minor = 0
  3547. this.patch = 0
  3548. this.prerelease = []
  3549. break
  3550. case 'minor':
  3551. // If this is a pre-minor version, bump up to the same minor version.
  3552. // Otherwise increment minor.
  3553. // 1.2.0-5 bumps to 1.2.0
  3554. // 1.2.1 bumps to 1.3.0
  3555. if (this.patch !== 0 || this.prerelease.length === 0) {
  3556. this.minor++
  3557. }
  3558. this.patch = 0
  3559. this.prerelease = []
  3560. break
  3561. case 'patch':
  3562. // If this is not a pre-release version, it will increment the patch.
  3563. // If it is a pre-release it will bump up to the same patch version.
  3564. // 1.2.0-5 patches to 1.2.0
  3565. // 1.2.0 patches to 1.2.1
  3566. if (this.prerelease.length === 0) {
  3567. this.patch++
  3568. }
  3569. this.prerelease = []
  3570. break
  3571. // This probably shouldn't be used publicly.
  3572. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3573. case 'pre':
  3574. if (this.prerelease.length === 0) {
  3575. this.prerelease = [0]
  3576. } else {
  3577. var i = this.prerelease.length
  3578. while (--i >= 0) {
  3579. if (typeof this.prerelease[i] === 'number') {
  3580. this.prerelease[i]++
  3581. i = -2
  3582. }
  3583. }
  3584. if (i === -1) {
  3585. // didn't increment anything
  3586. this.prerelease.push(0)
  3587. }
  3588. }
  3589. if (identifier) {
  3590. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3591. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3592. if (this.prerelease[0] === identifier) {
  3593. if (isNaN(this.prerelease[1])) {
  3594. this.prerelease = [identifier, 0]
  3595. }
  3596. } else {
  3597. this.prerelease = [identifier, 0]
  3598. }
  3599. }
  3600. break
  3601. default:
  3602. throw new Error('invalid increment argument: ' + release)
  3603. }
  3604. this.format()
  3605. this.raw = this.version
  3606. return this
  3607. }
  3608. exports.inc = inc
  3609. function inc (version, release, loose, identifier) {
  3610. if (typeof (loose) === 'string') {
  3611. identifier = loose
  3612. loose = undefined
  3613. }
  3614. try {
  3615. return new SemVer(version, loose).inc(release, identifier).version
  3616. } catch (er) {
  3617. return null
  3618. }
  3619. }
  3620. exports.diff = diff
  3621. function diff (version1, version2) {
  3622. if (eq(version1, version2)) {
  3623. return null
  3624. } else {
  3625. var v1 = parse(version1)
  3626. var v2 = parse(version2)
  3627. var prefix = ''
  3628. if (v1.prerelease.length || v2.prerelease.length) {
  3629. prefix = 'pre'
  3630. var defaultResult = 'prerelease'
  3631. }
  3632. for (var key in v1) {
  3633. if (key === 'major' || key === 'minor' || key === 'patch') {
  3634. if (v1[key] !== v2[key]) {
  3635. return prefix + key
  3636. }
  3637. }
  3638. }
  3639. return defaultResult // may be undefined
  3640. }
  3641. }
  3642. exports.compareIdentifiers = compareIdentifiers
  3643. var numeric = /^[0-9]+$/
  3644. function compareIdentifiers (a, b) {
  3645. var anum = numeric.test(a)
  3646. var bnum = numeric.test(b)
  3647. if (anum && bnum) {
  3648. a = +a
  3649. b = +b
  3650. }
  3651. return a === b ? 0
  3652. : (anum && !bnum) ? -1
  3653. : (bnum && !anum) ? 1
  3654. : a < b ? -1
  3655. : 1
  3656. }
  3657. exports.rcompareIdentifiers = rcompareIdentifiers
  3658. function rcompareIdentifiers (a, b) {
  3659. return compareIdentifiers(b, a)
  3660. }
  3661. exports.major = major
  3662. function major (a, loose) {
  3663. return new SemVer(a, loose).major
  3664. }
  3665. exports.minor = minor
  3666. function minor (a, loose) {
  3667. return new SemVer(a, loose).minor
  3668. }
  3669. exports.patch = patch
  3670. function patch (a, loose) {
  3671. return new SemVer(a, loose).patch
  3672. }
  3673. exports.compare = compare
  3674. function compare (a, b, loose) {
  3675. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3676. }
  3677. exports.compareLoose = compareLoose
  3678. function compareLoose (a, b) {
  3679. return compare(a, b, true)
  3680. }
  3681. exports.rcompare = rcompare
  3682. function rcompare (a, b, loose) {
  3683. return compare(b, a, loose)
  3684. }
  3685. exports.sort = sort
  3686. function sort (list, loose) {
  3687. return list.sort(function (a, b) {
  3688. return exports.compare(a, b, loose)
  3689. })
  3690. }
  3691. exports.rsort = rsort
  3692. function rsort (list, loose) {
  3693. return list.sort(function (a, b) {
  3694. return exports.rcompare(a, b, loose)
  3695. })
  3696. }
  3697. exports.gt = gt
  3698. function gt (a, b, loose) {
  3699. return compare(a, b, loose) > 0
  3700. }
  3701. exports.lt = lt
  3702. function lt (a, b, loose) {
  3703. return compare(a, b, loose) < 0
  3704. }
  3705. exports.eq = eq
  3706. function eq (a, b, loose) {
  3707. return compare(a, b, loose) === 0
  3708. }
  3709. exports.neq = neq
  3710. function neq (a, b, loose) {
  3711. return compare(a, b, loose) !== 0
  3712. }
  3713. exports.gte = gte
  3714. function gte (a, b, loose) {
  3715. return compare(a, b, loose) >= 0
  3716. }
  3717. exports.lte = lte
  3718. function lte (a, b, loose) {
  3719. return compare(a, b, loose) <= 0
  3720. }
  3721. exports.cmp = cmp
  3722. function cmp (a, op, b, loose) {
  3723. switch (op) {
  3724. case '===':
  3725. if (typeof a === 'object')
  3726. a = a.version
  3727. if (typeof b === 'object')
  3728. b = b.version
  3729. return a === b
  3730. case '!==':
  3731. if (typeof a === 'object')
  3732. a = a.version
  3733. if (typeof b === 'object')
  3734. b = b.version
  3735. return a !== b
  3736. case '':
  3737. case '=':
  3738. case '==':
  3739. return eq(a, b, loose)
  3740. case '!=':
  3741. return neq(a, b, loose)
  3742. case '>':
  3743. return gt(a, b, loose)
  3744. case '>=':
  3745. return gte(a, b, loose)
  3746. case '<':
  3747. return lt(a, b, loose)
  3748. case '<=':
  3749. return lte(a, b, loose)
  3750. default:
  3751. throw new TypeError('Invalid operator: ' + op)
  3752. }
  3753. }
  3754. exports.Comparator = Comparator
  3755. function Comparator (comp, options) {
  3756. if (!options || typeof options !== 'object') {
  3757. options = {
  3758. loose: !!options,
  3759. includePrerelease: false
  3760. }
  3761. }
  3762. if (comp instanceof Comparator) {
  3763. if (comp.loose === !!options.loose) {
  3764. return comp
  3765. } else {
  3766. comp = comp.value
  3767. }
  3768. }
  3769. if (!(this instanceof Comparator)) {
  3770. return new Comparator(comp, options)
  3771. }
  3772. debug('comparator', comp, options)
  3773. this.options = options
  3774. this.loose = !!options.loose
  3775. this.parse(comp)
  3776. if (this.semver === ANY) {
  3777. this.value = ''
  3778. } else {
  3779. this.value = this.operator + this.semver.version
  3780. }
  3781. debug('comp', this)
  3782. }
  3783. var ANY = {}
  3784. Comparator.prototype.parse = function (comp) {
  3785. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3786. var m = comp.match(r)
  3787. if (!m) {
  3788. throw new TypeError('Invalid comparator: ' + comp)
  3789. }
  3790. this.operator = m[1]
  3791. if (this.operator === '=') {
  3792. this.operator = ''
  3793. }
  3794. // if it literally is just '>' or '' then allow anything.
  3795. if (!m[2]) {
  3796. this.semver = ANY
  3797. } else {
  3798. this.semver = new SemVer(m[2], this.options.loose)
  3799. }
  3800. }
  3801. Comparator.prototype.toString = function () {
  3802. return this.value
  3803. }
  3804. Comparator.prototype.test = function (version) {
  3805. debug('Comparator.test', version, this.options.loose)
  3806. if (this.semver === ANY) {
  3807. return true
  3808. }
  3809. if (typeof version === 'string') {
  3810. version = new SemVer(version, this.options)
  3811. }
  3812. return cmp(version, this.operator, this.semver, this.options)
  3813. }
  3814. Comparator.prototype.intersects = function (comp, options) {
  3815. if (!(comp instanceof Comparator)) {
  3816. throw new TypeError('a Comparator is required')
  3817. }
  3818. if (!options || typeof options !== 'object') {
  3819. options = {
  3820. loose: !!options,
  3821. includePrerelease: false
  3822. }
  3823. }
  3824. var rangeTmp
  3825. if (this.operator === '') {
  3826. rangeTmp = new Range(comp.value, options)
  3827. return satisfies(this.value, rangeTmp, options)
  3828. } else if (comp.operator === '') {
  3829. rangeTmp = new Range(this.value, options)
  3830. return satisfies(comp.semver, rangeTmp, options)
  3831. }
  3832. var sameDirectionIncreasing =
  3833. (this.operator === '>=' || this.operator === '>') &&
  3834. (comp.operator === '>=' || comp.operator === '>')
  3835. var sameDirectionDecreasing =
  3836. (this.operator === '<=' || this.operator === '<') &&
  3837. (comp.operator === '<=' || comp.operator === '<')
  3838. var sameSemVer = this.semver.version === comp.semver.version
  3839. var differentDirectionsInclusive =
  3840. (this.operator === '>=' || this.operator === '<=') &&
  3841. (comp.operator === '>=' || comp.operator === '<=')
  3842. var oppositeDirectionsLessThan =
  3843. cmp(this.semver, '<', comp.semver, options) &&
  3844. ((this.operator === '>=' || this.operator === '>') &&
  3845. (comp.operator === '<=' || comp.operator === '<'))
  3846. var oppositeDirectionsGreaterThan =
  3847. cmp(this.semver, '>', comp.semver, options) &&
  3848. ((this.operator === '<=' || this.operator === '<') &&
  3849. (comp.operator === '>=' || comp.operator === '>'))
  3850. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3851. (sameSemVer && differentDirectionsInclusive) ||
  3852. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3853. }
  3854. exports.Range = Range
  3855. function Range (range, options) {
  3856. if (!options || typeof options !== 'object') {
  3857. options = {
  3858. loose: !!options,
  3859. includePrerelease: false
  3860. }
  3861. }
  3862. if (range instanceof Range) {
  3863. if (range.loose === !!options.loose &&
  3864. range.includePrerelease === !!options.includePrerelease) {
  3865. return range
  3866. } else {
  3867. return new Range(range.raw, options)
  3868. }
  3869. }
  3870. if (range instanceof Comparator) {
  3871. return new Range(range.value, options)
  3872. }
  3873. if (!(this instanceof Range)) {
  3874. return new Range(range, options)
  3875. }
  3876. this.options = options
  3877. this.loose = !!options.loose
  3878. this.includePrerelease = !!options.includePrerelease
  3879. // First, split based on boolean or ||
  3880. this.raw = range
  3881. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3882. return this.parseRange(range.trim())
  3883. }, this).filter(function (c) {
  3884. // throw out any that are not relevant for whatever reason
  3885. return c.length
  3886. })
  3887. if (!this.set.length) {
  3888. throw new TypeError('Invalid SemVer Range: ' + range)
  3889. }
  3890. this.format()
  3891. }
  3892. Range.prototype.format = function () {
  3893. this.range = this.set.map(function (comps) {
  3894. return comps.join(' ').trim()
  3895. }).join('||').trim()
  3896. return this.range
  3897. }
  3898. Range.prototype.toString = function () {
  3899. return this.range
  3900. }
  3901. Range.prototype.parseRange = function (range) {
  3902. var loose = this.options.loose
  3903. range = range.trim()
  3904. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3905. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3906. range = range.replace(hr, hyphenReplace)
  3907. debug('hyphen replace', range)
  3908. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3909. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3910. debug('comparator trim', range, re[COMPARATORTRIM])
  3911. // `~ 1.2.3` => `~1.2.3`
  3912. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3913. // `^ 1.2.3` => `^1.2.3`
  3914. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3915. // normalize spaces
  3916. range = range.split(/\s+/).join(' ')
  3917. // At this point, the range is completely trimmed and
  3918. // ready to be split into comparators.
  3919. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3920. var set = range.split(' ').map(function (comp) {
  3921. return parseComparator(comp, this.options)
  3922. }, this).join(' ').split(/\s+/)
  3923. if (this.options.loose) {
  3924. // in loose mode, throw out any that are not valid comparators
  3925. set = set.filter(function (comp) {
  3926. return !!comp.match(compRe)
  3927. })
  3928. }
  3929. set = set.map(function (comp) {
  3930. return new Comparator(comp, this.options)
  3931. }, this)
  3932. return set
  3933. }
  3934. Range.prototype.intersects = function (range, options) {
  3935. if (!(range instanceof Range)) {
  3936. throw new TypeError('a Range is required')
  3937. }
  3938. return this.set.some(function (thisComparators) {
  3939. return thisComparators.every(function (thisComparator) {
  3940. return range.set.some(function (rangeComparators) {
  3941. return rangeComparators.every(function (rangeComparator) {
  3942. return thisComparator.intersects(rangeComparator, options)
  3943. })
  3944. })
  3945. })
  3946. })
  3947. }
  3948. // Mostly just for testing and legacy API reasons
  3949. exports.toComparators = toComparators
  3950. function toComparators (range, options) {
  3951. return new Range(range, options).set.map(function (comp) {
  3952. return comp.map(function (c) {
  3953. return c.value
  3954. }).join(' ').trim().split(' ')
  3955. })
  3956. }
  3957. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3958. // already replaced the hyphen ranges
  3959. // turn into a set of JUST comparators.
  3960. function parseComparator (comp, options) {
  3961. debug('comp', comp, options)
  3962. comp = replaceCarets(comp, options)
  3963. debug('caret', comp)
  3964. comp = replaceTildes(comp, options)
  3965. debug('tildes', comp)
  3966. comp = replaceXRanges(comp, options)
  3967. debug('xrange', comp)
  3968. comp = replaceStars(comp, options)
  3969. debug('stars', comp)
  3970. return comp
  3971. }
  3972. function isX (id) {
  3973. return !id || id.toLowerCase() === 'x' || id === '*'
  3974. }
  3975. // ~, ~> --> * (any, kinda silly)
  3976. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3977. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3978. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3979. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3980. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3981. function replaceTildes (comp, options) {
  3982. return comp.trim().split(/\s+/).map(function (comp) {
  3983. return replaceTilde(comp, options)
  3984. }).join(' ')
  3985. }
  3986. function replaceTilde (comp, options) {
  3987. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3988. return comp.replace(r, function (_, M, m, p, pr) {
  3989. debug('tilde', comp, _, M, m, p, pr)
  3990. var ret
  3991. if (isX(M)) {
  3992. ret = ''
  3993. } else if (isX(m)) {
  3994. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3995. } else if (isX(p)) {
  3996. // ~1.2 == >=1.2.0 <1.3.0
  3997. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3998. } else if (pr) {
  3999. debug('replaceTilde pr', pr)
  4000. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4001. ' <' + M + '.' + (+m + 1) + '.0'
  4002. } else {
  4003. // ~1.2.3 == >=1.2.3 <1.3.0
  4004. ret = '>=' + M + '.' + m + '.' + p +
  4005. ' <' + M + '.' + (+m + 1) + '.0'
  4006. }
  4007. debug('tilde return', ret)
  4008. return ret
  4009. })
  4010. }
  4011. // ^ --> * (any, kinda silly)
  4012. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  4013. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  4014. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  4015. // ^1.2.3 --> >=1.2.3 <2.0.0
  4016. // ^1.2.0 --> >=1.2.0 <2.0.0
  4017. function replaceCarets (comp, options) {
  4018. return comp.trim().split(/\s+/).map(function (comp) {
  4019. return replaceCaret(comp, options)
  4020. }).join(' ')
  4021. }
  4022. function replaceCaret (comp, options) {
  4023. debug('caret', comp, options)
  4024. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4025. return comp.replace(r, function (_, M, m, p, pr) {
  4026. debug('caret', comp, _, M, m, p, pr)
  4027. var ret
  4028. if (isX(M)) {
  4029. ret = ''
  4030. } else if (isX(m)) {
  4031. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4032. } else if (isX(p)) {
  4033. if (M === '0') {
  4034. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4035. } else {
  4036. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4037. }
  4038. } else if (pr) {
  4039. debug('replaceCaret pr', pr)
  4040. if (M === '0') {
  4041. if (m === '0') {
  4042. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4043. ' <' + M + '.' + m + '.' + (+p + 1)
  4044. } else {
  4045. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4046. ' <' + M + '.' + (+m + 1) + '.0'
  4047. }
  4048. } else {
  4049. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4050. ' <' + (+M + 1) + '.0.0'
  4051. }
  4052. } else {
  4053. debug('no pr')
  4054. if (M === '0') {
  4055. if (m === '0') {
  4056. ret = '>=' + M + '.' + m + '.' + p +
  4057. ' <' + M + '.' + m + '.' + (+p + 1)
  4058. } else {
  4059. ret = '>=' + M + '.' + m + '.' + p +
  4060. ' <' + M + '.' + (+m + 1) + '.0'
  4061. }
  4062. } else {
  4063. ret = '>=' + M + '.' + m + '.' + p +
  4064. ' <' + (+M + 1) + '.0.0'
  4065. }
  4066. }
  4067. debug('caret return', ret)
  4068. return ret
  4069. })
  4070. }
  4071. function replaceXRanges (comp, options) {
  4072. debug('replaceXRanges', comp, options)
  4073. return comp.split(/\s+/).map(function (comp) {
  4074. return replaceXRange(comp, options)
  4075. }).join(' ')
  4076. }
  4077. function replaceXRange (comp, options) {
  4078. comp = comp.trim()
  4079. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4080. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4081. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4082. var xM = isX(M)
  4083. var xm = xM || isX(m)
  4084. var xp = xm || isX(p)
  4085. var anyX = xp
  4086. if (gtlt === '=' && anyX) {
  4087. gtlt = ''
  4088. }
  4089. if (xM) {
  4090. if (gtlt === '>' || gtlt === '<') {
  4091. // nothing is allowed
  4092. ret = '<0.0.0'
  4093. } else {
  4094. // nothing is forbidden
  4095. ret = '*'
  4096. }
  4097. } else if (gtlt && anyX) {
  4098. // we know patch is an x, because we have any x at all.
  4099. // replace X with 0
  4100. if (xm) {
  4101. m = 0
  4102. }
  4103. p = 0
  4104. if (gtlt === '>') {
  4105. // >1 => >=2.0.0
  4106. // >1.2 => >=1.3.0
  4107. // >1.2.3 => >= 1.2.4
  4108. gtlt = '>='
  4109. if (xm) {
  4110. M = +M + 1
  4111. m = 0
  4112. p = 0
  4113. } else {
  4114. m = +m + 1
  4115. p = 0
  4116. }
  4117. } else if (gtlt === '<=') {
  4118. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4119. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4120. gtlt = '<'
  4121. if (xm) {
  4122. M = +M + 1
  4123. } else {
  4124. m = +m + 1
  4125. }
  4126. }
  4127. ret = gtlt + M + '.' + m + '.' + p
  4128. } else if (xm) {
  4129. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4130. } else if (xp) {
  4131. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4132. }
  4133. debug('xRange return', ret)
  4134. return ret
  4135. })
  4136. }
  4137. // Because * is AND-ed with everything else in the comparator,
  4138. // and '' means "any version", just remove the *s entirely.
  4139. function replaceStars (comp, options) {
  4140. debug('replaceStars', comp, options)
  4141. // Looseness is ignored here. star is always as loose as it gets!
  4142. return comp.trim().replace(re[STAR], '')
  4143. }
  4144. // This function is passed to string.replace(re[HYPHENRANGE])
  4145. // M, m, patch, prerelease, build
  4146. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4147. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4148. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4149. function hyphenReplace ($0,
  4150. from, fM, fm, fp, fpr, fb,
  4151. to, tM, tm, tp, tpr, tb) {
  4152. if (isX(fM)) {
  4153. from = ''
  4154. } else if (isX(fm)) {
  4155. from = '>=' + fM + '.0.0'
  4156. } else if (isX(fp)) {
  4157. from = '>=' + fM + '.' + fm + '.0'
  4158. } else {
  4159. from = '>=' + from
  4160. }
  4161. if (isX(tM)) {
  4162. to = ''
  4163. } else if (isX(tm)) {
  4164. to = '<' + (+tM + 1) + '.0.0'
  4165. } else if (isX(tp)) {
  4166. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4167. } else if (tpr) {
  4168. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4169. } else {
  4170. to = '<=' + to
  4171. }
  4172. return (from + ' ' + to).trim()
  4173. }
  4174. // if ANY of the sets match ALL of its comparators, then pass
  4175. Range.prototype.test = function (version) {
  4176. if (!version) {
  4177. return false
  4178. }
  4179. if (typeof version === 'string') {
  4180. version = new SemVer(version, this.options)
  4181. }
  4182. for (var i = 0; i < this.set.length; i++) {
  4183. if (testSet(this.set[i], version, this.options)) {
  4184. return true
  4185. }
  4186. }
  4187. return false
  4188. }
  4189. function testSet (set, version, options) {
  4190. for (var i = 0; i < set.length; i++) {
  4191. if (!set[i].test(version)) {
  4192. return false
  4193. }
  4194. }
  4195. if (version.prerelease.length && !options.includePrerelease) {
  4196. // Find the set of versions that are allowed to have prereleases
  4197. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4198. // That should allow `1.2.3-pr.2` to pass.
  4199. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4200. // even though it's within the range set by the comparators.
  4201. for (i = 0; i < set.length; i++) {
  4202. debug(set[i].semver)
  4203. if (set[i].semver === ANY) {
  4204. continue
  4205. }
  4206. if (set[i].semver.prerelease.length > 0) {
  4207. var allowed = set[i].semver
  4208. if (allowed.major === version.major &&
  4209. allowed.minor === version.minor &&
  4210. allowed.patch === version.patch) {
  4211. return true
  4212. }
  4213. }
  4214. }
  4215. // Version has a -pre, but it's not one of the ones we like.
  4216. return false
  4217. }
  4218. return true
  4219. }
  4220. exports.satisfies = satisfies
  4221. function satisfies (version, range, options) {
  4222. try {
  4223. range = new Range(range, options)
  4224. } catch (er) {
  4225. return false
  4226. }
  4227. return range.test(version)
  4228. }
  4229. exports.maxSatisfying = maxSatisfying
  4230. function maxSatisfying (versions, range, options) {
  4231. var max = null
  4232. var maxSV = null
  4233. try {
  4234. var rangeObj = new Range(range, options)
  4235. } catch (er) {
  4236. return null
  4237. }
  4238. versions.forEach(function (v) {
  4239. if (rangeObj.test(v)) {
  4240. // satisfies(v, range, options)
  4241. if (!max || maxSV.compare(v) === -1) {
  4242. // compare(max, v, true)
  4243. max = v
  4244. maxSV = new SemVer(max, options)
  4245. }
  4246. }
  4247. })
  4248. return max
  4249. }
  4250. exports.minSatisfying = minSatisfying
  4251. function minSatisfying (versions, range, options) {
  4252. var min = null
  4253. var minSV = null
  4254. try {
  4255. var rangeObj = new Range(range, options)
  4256. } catch (er) {
  4257. return null
  4258. }
  4259. versions.forEach(function (v) {
  4260. if (rangeObj.test(v)) {
  4261. // satisfies(v, range, options)
  4262. if (!min || minSV.compare(v) === 1) {
  4263. // compare(min, v, true)
  4264. min = v
  4265. minSV = new SemVer(min, options)
  4266. }
  4267. }
  4268. })
  4269. return min
  4270. }
  4271. exports.minVersion = minVersion
  4272. function minVersion (range, loose) {
  4273. range = new Range(range, loose)
  4274. var minver = new SemVer('0.0.0')
  4275. if (range.test(minver)) {
  4276. return minver
  4277. }
  4278. minver = new SemVer('0.0.0-0')
  4279. if (range.test(minver)) {
  4280. return minver
  4281. }
  4282. minver = null
  4283. for (var i = 0; i < range.set.length; ++i) {
  4284. var comparators = range.set[i]
  4285. comparators.forEach(function (comparator) {
  4286. // Clone to avoid manipulating the comparator's semver object.
  4287. var compver = new SemVer(comparator.semver.version)
  4288. switch (comparator.operator) {
  4289. case '>':
  4290. if (compver.prerelease.length === 0) {
  4291. compver.patch++
  4292. } else {
  4293. compver.prerelease.push(0)
  4294. }
  4295. compver.raw = compver.format()
  4296. /* fallthrough */
  4297. case '':
  4298. case '>=':
  4299. if (!minver || gt(minver, compver)) {
  4300. minver = compver
  4301. }
  4302. break
  4303. case '<':
  4304. case '<=':
  4305. /* Ignore maximum versions */
  4306. break
  4307. /* istanbul ignore next */
  4308. default:
  4309. throw new Error('Unexpected operation: ' + comparator.operator)
  4310. }
  4311. })
  4312. }
  4313. if (minver && range.test(minver)) {
  4314. return minver
  4315. }
  4316. return null
  4317. }
  4318. exports.validRange = validRange
  4319. function validRange (range, options) {
  4320. try {
  4321. // Return '*' instead of '' so that truthiness works.
  4322. // This will throw if it's invalid anyway
  4323. return new Range(range, options).range || '*'
  4324. } catch (er) {
  4325. return null
  4326. }
  4327. }
  4328. // Determine if version is less than all the versions possible in the range
  4329. exports.ltr = ltr
  4330. function ltr (version, range, options) {
  4331. return outside(version, range, '<', options)
  4332. }
  4333. // Determine if version is greater than all the versions possible in the range.
  4334. exports.gtr = gtr
  4335. function gtr (version, range, options) {
  4336. return outside(version, range, '>', options)
  4337. }
  4338. exports.outside = outside
  4339. function outside (version, range, hilo, options) {
  4340. version = new SemVer(version, options)
  4341. range = new Range(range, options)
  4342. var gtfn, ltefn, ltfn, comp, ecomp
  4343. switch (hilo) {
  4344. case '>':
  4345. gtfn = gt
  4346. ltefn = lte
  4347. ltfn = lt
  4348. comp = '>'
  4349. ecomp = '>='
  4350. break
  4351. case '<':
  4352. gtfn = lt
  4353. ltefn = gte
  4354. ltfn = gt
  4355. comp = '<'
  4356. ecomp = '<='
  4357. break
  4358. default:
  4359. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4360. }
  4361. // If it satisifes the range it is not outside
  4362. if (satisfies(version, range, options)) {
  4363. return false
  4364. }
  4365. // From now on, variable terms are as if we're in "gtr" mode.
  4366. // but note that everything is flipped for the "ltr" function.
  4367. for (var i = 0; i < range.set.length; ++i) {
  4368. var comparators = range.set[i]
  4369. var high = null
  4370. var low = null
  4371. comparators.forEach(function (comparator) {
  4372. if (comparator.semver === ANY) {
  4373. comparator = new Comparator('>=0.0.0')
  4374. }
  4375. high = high || comparator
  4376. low = low || comparator
  4377. if (gtfn(comparator.semver, high.semver, options)) {
  4378. high = comparator
  4379. } else if (ltfn(comparator.semver, low.semver, options)) {
  4380. low = comparator
  4381. }
  4382. })
  4383. // If the edge version comparator has a operator then our version
  4384. // isn't outside it
  4385. if (high.operator === comp || high.operator === ecomp) {
  4386. return false
  4387. }
  4388. // If the lowest version comparator has an operator and our version
  4389. // is less than it then it isn't higher than the range
  4390. if ((!low.operator || low.operator === comp) &&
  4391. ltefn(version, low.semver)) {
  4392. return false
  4393. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4394. return false
  4395. }
  4396. }
  4397. return true
  4398. }
  4399. exports.prerelease = prerelease
  4400. function prerelease (version, options) {
  4401. var parsed = parse(version, options)
  4402. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4403. }
  4404. exports.intersects = intersects
  4405. function intersects (r1, r2, options) {
  4406. r1 = new Range(r1, options)
  4407. r2 = new Range(r2, options)
  4408. return r1.intersects(r2)
  4409. }
  4410. exports.coerce = coerce
  4411. function coerce (version) {
  4412. if (version instanceof SemVer) {
  4413. return version
  4414. }
  4415. if (typeof version !== 'string') {
  4416. return null
  4417. }
  4418. var match = version.match(re[COERCE])
  4419. if (match == null) {
  4420. return null
  4421. }
  4422. return parse(match[1] +
  4423. '.' + (match[2] || '0') +
  4424. '.' + (match[3] || '0'))
  4425. }
  4426. /***/ }),
  4427. /***/ 287:
  4428. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4429. "use strict";
  4430. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4431. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4432. return new (P || (P = Promise))(function (resolve, reject) {
  4433. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4434. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4435. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4436. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4437. });
  4438. };
  4439. var __importStar = (this && this.__importStar) || function (mod) {
  4440. if (mod && mod.__esModule) return mod;
  4441. var result = {};
  4442. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4443. result["default"] = mod;
  4444. return result;
  4445. };
  4446. var __importDefault = (this && this.__importDefault) || function (mod) {
  4447. return (mod && mod.__esModule) ? mod : { "default": mod };
  4448. };
  4449. Object.defineProperty(exports, "__esModule", { value: true });
  4450. const assert = __importStar(__webpack_require__(357));
  4451. const core = __importStar(__webpack_require__(470));
  4452. const exec = __importStar(__webpack_require__(986));
  4453. const fs = __importStar(__webpack_require__(747));
  4454. const io = __importStar(__webpack_require__(1));
  4455. const os = __importStar(__webpack_require__(87));
  4456. const path = __importStar(__webpack_require__(622));
  4457. const regexpHelper = __importStar(__webpack_require__(528));
  4458. const stateHelper = __importStar(__webpack_require__(153));
  4459. const v4_1 = __importDefault(__webpack_require__(826));
  4460. const IS_WINDOWS = process.platform === 'win32';
  4461. const HOSTNAME = 'github.com';
  4462. const SSH_COMMAND_KEY = 'core.sshCommand';
  4463. function createAuthHelper(git, settings) {
  4464. return new GitAuthHelper(git, settings);
  4465. }
  4466. exports.createAuthHelper = createAuthHelper;
  4467. class GitAuthHelper {
  4468. constructor(gitCommandManager, gitSourceSettings) {
  4469. this.tokenConfigKey = `http.https://${HOSTNAME}/.extraheader`;
  4470. this.insteadOfKey = `url.https://${HOSTNAME}/.insteadOf`;
  4471. this.insteadOfValue = `git@${HOSTNAME}:`;
  4472. this.sshCommand = '';
  4473. this.sshKeyPath = '';
  4474. this.sshKnownHostsPath = '';
  4475. this.temporaryHomePath = '';
  4476. this.git = gitCommandManager;
  4477. this.settings = gitSourceSettings || {};
  4478. // Token auth header
  4479. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4480. core.setSecret(basicCredential);
  4481. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4482. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4483. }
  4484. configureAuth() {
  4485. return __awaiter(this, void 0, void 0, function* () {
  4486. // Remove possible previous values
  4487. yield this.removeAuth();
  4488. // Configure new values
  4489. yield this.configureSsh();
  4490. yield this.configureToken();
  4491. });
  4492. }
  4493. configureGlobalAuth() {
  4494. return __awaiter(this, void 0, void 0, function* () {
  4495. // Create a temp home directory
  4496. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4497. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4498. const uniqueId = v4_1.default();
  4499. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4500. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4501. // Copy the global git config
  4502. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4503. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4504. let configExists = false;
  4505. try {
  4506. yield fs.promises.stat(gitConfigPath);
  4507. configExists = true;
  4508. }
  4509. catch (err) {
  4510. if (err.code !== 'ENOENT') {
  4511. throw err;
  4512. }
  4513. }
  4514. if (configExists) {
  4515. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4516. yield io.cp(gitConfigPath, newGitConfigPath);
  4517. }
  4518. else {
  4519. yield fs.promises.writeFile(newGitConfigPath, '');
  4520. }
  4521. try {
  4522. // Override HOME
  4523. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4524. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4525. // Configure the token
  4526. yield this.configureToken(newGitConfigPath, true);
  4527. // Configure HTTPS instead of SSH
  4528. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4529. if (!this.settings.sshKey) {
  4530. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4531. }
  4532. }
  4533. catch (err) {
  4534. // Unset in case somehow written to the real global config
  4535. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4536. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4537. throw err;
  4538. }
  4539. });
  4540. }
  4541. configureSubmoduleAuth() {
  4542. return __awaiter(this, void 0, void 0, function* () {
  4543. // Remove possible previous HTTPS instead of SSH
  4544. yield this.removeGitConfig(this.insteadOfKey, true);
  4545. if (this.settings.persistCredentials) {
  4546. // Configure a placeholder value. This approach avoids the credential being captured
  4547. // by process creation audit events, which are commonly logged. For more information,
  4548. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4549. const output = yield this.git.submoduleForeach(`git config --local '${this.tokenConfigKey}' '${this.tokenPlaceholderConfigValue}' && git config --local --show-origin --name-only --get-regexp remote.origin.url`, this.settings.nestedSubmodules);
  4550. // Replace the placeholder
  4551. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4552. for (const configPath of configPaths) {
  4553. core.debug(`Replacing token placeholder in '${configPath}'`);
  4554. this.replaceTokenPlaceholder(configPath);
  4555. }
  4556. if (this.settings.sshKey) {
  4557. // Configure core.sshCommand
  4558. yield this.git.submoduleForeach(`git config --local '${SSH_COMMAND_KEY}' '${this.sshCommand}'`, this.settings.nestedSubmodules);
  4559. }
  4560. else {
  4561. // Configure HTTPS instead of SSH
  4562. yield this.git.submoduleForeach(`git config --local '${this.insteadOfKey}' '${this.insteadOfValue}'`, this.settings.nestedSubmodules);
  4563. }
  4564. }
  4565. });
  4566. }
  4567. removeAuth() {
  4568. return __awaiter(this, void 0, void 0, function* () {
  4569. yield this.removeSsh();
  4570. yield this.removeToken();
  4571. });
  4572. }
  4573. removeGlobalAuth() {
  4574. return __awaiter(this, void 0, void 0, function* () {
  4575. core.info(`Unsetting HOME override`);
  4576. this.git.removeEnvironmentVariable('HOME');
  4577. yield io.rmRF(this.temporaryHomePath);
  4578. });
  4579. }
  4580. configureSsh() {
  4581. return __awaiter(this, void 0, void 0, function* () {
  4582. if (!this.settings.sshKey) {
  4583. return;
  4584. }
  4585. // Write key
  4586. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4587. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4588. const uniqueId = v4_1.default();
  4589. this.sshKeyPath = path.join(runnerTemp, uniqueId);
  4590. stateHelper.setSshKeyPath(this.sshKeyPath);
  4591. yield fs.promises.mkdir(runnerTemp, { recursive: true });
  4592. yield fs.promises.writeFile(this.sshKeyPath, this.settings.sshKey.trim() + '\n', { mode: 0o600 });
  4593. // Remove inherited permissions on Windows
  4594. if (IS_WINDOWS) {
  4595. const icacls = yield io.which('icacls.exe');
  4596. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /grant:r "${process.env['USERDOMAIN']}\\${process.env['USERNAME']}:F"`);
  4597. yield exec.exec(`"${icacls}" "${this.sshKeyPath}" /inheritance:r`);
  4598. }
  4599. // Write known hosts
  4600. const userKnownHostsPath = path.join(os.homedir(), '.ssh', 'known_hosts');
  4601. let userKnownHosts = '';
  4602. try {
  4603. userKnownHosts = (yield fs.promises.readFile(userKnownHostsPath)).toString();
  4604. }
  4605. catch (err) {
  4606. if (err.code !== 'ENOENT') {
  4607. throw err;
  4608. }
  4609. }
  4610. let knownHosts = '';
  4611. if (userKnownHosts) {
  4612. knownHosts += `# Begin from ${userKnownHostsPath}\n${userKnownHosts}\n# End from ${userKnownHostsPath}\n`;
  4613. }
  4614. if (this.settings.sshKnownHosts) {
  4615. knownHosts += `# Begin from input known hosts\n${this.settings.sshKnownHosts}\n# end from input known hosts\n`;
  4616. }
  4617. knownHosts += `# Begin implicitly added github.com\ngithub.com ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAq2A7hRGmdnm9tUDbO9IDSwBK6TbQa+PXYPCPy6rbTrTtw7PHkccKrpp0yVhp5HdEIcKr6pLlVDBfOLX9QUsyCOV0wzfjIJNlGEYsdlLJizHhbn2mUjvSAHQqZETYP81eFzLQNnPHt4EVVUh7VfDESU84KezmD5QlWpXLmvU31/yMf+Se8xhHTvKSCZIFImWwoG6mbUoWf9nzpIoaSjB+weqqUUmpaaasXVal72J+UX2B+2RPW3RcT0eOzQgqlJL3RKrTJvdsjE3JEAvGq3lGHSZXy28G3skua2SmVi/w4yCE6gbODqnTWlg7+wC604ydGXA8VJiS5ap43JXiUFFAaQ==\n# End implicitly added github.com\n`;
  4618. this.sshKnownHostsPath = path.join(runnerTemp, `${uniqueId}_known_hosts`);
  4619. stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
  4620. yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
  4621. // Configure GIT_SSH_COMMAND
  4622. const sshPath = yield io.which('ssh', true);
  4623. this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
  4624. if (this.settings.sshStrict) {
  4625. this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
  4626. }
  4627. this.sshCommand += ` -o "UserKnownHostsFile=$RUNNER_TEMP/${path.basename(this.sshKnownHostsPath)}"`;
  4628. core.info(`Temporarily overriding GIT_SSH_COMMAND=${this.sshCommand}`);
  4629. this.git.setEnvironmentVariable('GIT_SSH_COMMAND', this.sshCommand);
  4630. // Configure core.sshCommand
  4631. if (this.settings.persistCredentials) {
  4632. yield this.git.config(SSH_COMMAND_KEY, this.sshCommand);
  4633. }
  4634. });
  4635. }
  4636. configureToken(configPath, globalConfig) {
  4637. return __awaiter(this, void 0, void 0, function* () {
  4638. // Validate args
  4639. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4640. // Default config path
  4641. if (!configPath && !globalConfig) {
  4642. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4643. }
  4644. // Configure a placeholder value. This approach avoids the credential being captured
  4645. // by process creation audit events, which are commonly logged. For more information,
  4646. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4647. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4648. // Replace the placeholder
  4649. yield this.replaceTokenPlaceholder(configPath || '');
  4650. });
  4651. }
  4652. replaceTokenPlaceholder(configPath) {
  4653. return __awaiter(this, void 0, void 0, function* () {
  4654. assert.ok(configPath, 'configPath is not defined');
  4655. let content = (yield fs.promises.readFile(configPath)).toString();
  4656. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4657. if (placeholderIndex < 0 ||
  4658. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4659. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4660. }
  4661. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4662. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4663. yield fs.promises.writeFile(configPath, content);
  4664. });
  4665. }
  4666. removeSsh() {
  4667. return __awaiter(this, void 0, void 0, function* () {
  4668. // SSH key
  4669. const keyPath = this.sshKeyPath || stateHelper.SshKeyPath;
  4670. if (keyPath) {
  4671. try {
  4672. yield io.rmRF(keyPath);
  4673. }
  4674. catch (err) {
  4675. core.debug(err.message);
  4676. core.warning(`Failed to remove SSH key '${keyPath}'`);
  4677. }
  4678. }
  4679. // SSH known hosts
  4680. const knownHostsPath = this.sshKnownHostsPath || stateHelper.SshKnownHostsPath;
  4681. if (knownHostsPath) {
  4682. try {
  4683. yield io.rmRF(knownHostsPath);
  4684. }
  4685. catch (_a) {
  4686. // Intentionally empty
  4687. }
  4688. }
  4689. // SSH command
  4690. yield this.removeGitConfig(SSH_COMMAND_KEY);
  4691. });
  4692. }
  4693. removeToken() {
  4694. return __awaiter(this, void 0, void 0, function* () {
  4695. // HTTP extra header
  4696. yield this.removeGitConfig(this.tokenConfigKey);
  4697. });
  4698. }
  4699. removeGitConfig(configKey, submoduleOnly = false) {
  4700. return __awaiter(this, void 0, void 0, function* () {
  4701. if (!submoduleOnly) {
  4702. if ((yield this.git.configExists(configKey)) &&
  4703. !(yield this.git.tryConfigUnset(configKey))) {
  4704. // Load the config contents
  4705. core.warning(`Failed to remove '${configKey}' from the git config`);
  4706. }
  4707. }
  4708. const pattern = regexpHelper.escape(configKey);
  4709. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
  4710. });
  4711. }
  4712. }
  4713. /***/ }),
  4714. /***/ 289:
  4715. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4716. "use strict";
  4717. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4718. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4719. return new (P || (P = Promise))(function (resolve, reject) {
  4720. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4721. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4722. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4723. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4724. });
  4725. };
  4726. var __importStar = (this && this.__importStar) || function (mod) {
  4727. if (mod && mod.__esModule) return mod;
  4728. var result = {};
  4729. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4730. result["default"] = mod;
  4731. return result;
  4732. };
  4733. Object.defineProperty(exports, "__esModule", { value: true });
  4734. const core = __importStar(__webpack_require__(470));
  4735. const exec = __importStar(__webpack_require__(986));
  4736. const fshelper = __importStar(__webpack_require__(618));
  4737. const io = __importStar(__webpack_require__(1));
  4738. const path = __importStar(__webpack_require__(622));
  4739. const regexpHelper = __importStar(__webpack_require__(528));
  4740. const retryHelper = __importStar(__webpack_require__(587));
  4741. const git_version_1 = __webpack_require__(559);
  4742. // Auth header not supported before 2.9
  4743. // Wire protocol v2 not supported before 2.18
  4744. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4745. function createCommandManager(workingDirectory, lfs) {
  4746. return __awaiter(this, void 0, void 0, function* () {
  4747. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4748. });
  4749. }
  4750. exports.createCommandManager = createCommandManager;
  4751. class GitCommandManager {
  4752. // Private constructor; use createCommandManager()
  4753. constructor() {
  4754. this.gitEnv = {
  4755. GIT_TERMINAL_PROMPT: '0',
  4756. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4757. };
  4758. this.gitPath = '';
  4759. this.lfs = false;
  4760. this.workingDirectory = '';
  4761. }
  4762. branchDelete(remote, branch) {
  4763. return __awaiter(this, void 0, void 0, function* () {
  4764. const args = ['branch', '--delete', '--force'];
  4765. if (remote) {
  4766. args.push('--remote');
  4767. }
  4768. args.push(branch);
  4769. yield this.execGit(args);
  4770. });
  4771. }
  4772. branchExists(remote, pattern) {
  4773. return __awaiter(this, void 0, void 0, function* () {
  4774. const args = ['branch', '--list'];
  4775. if (remote) {
  4776. args.push('--remote');
  4777. }
  4778. args.push(pattern);
  4779. const output = yield this.execGit(args);
  4780. return !!output.stdout.trim();
  4781. });
  4782. }
  4783. branchList(remote) {
  4784. return __awaiter(this, void 0, void 0, function* () {
  4785. const result = [];
  4786. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4787. // "branch --list" is more difficult when in a detached HEAD state.
  4788. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4789. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4790. const args = ['rev-parse', '--symbolic-full-name'];
  4791. if (remote) {
  4792. args.push('--remotes=origin');
  4793. }
  4794. else {
  4795. args.push('--branches');
  4796. }
  4797. const output = yield this.execGit(args);
  4798. for (let branch of output.stdout.trim().split('\n')) {
  4799. branch = branch.trim();
  4800. if (branch) {
  4801. if (branch.startsWith('refs/heads/')) {
  4802. branch = branch.substr('refs/heads/'.length);
  4803. }
  4804. else if (branch.startsWith('refs/remotes/')) {
  4805. branch = branch.substr('refs/remotes/'.length);
  4806. }
  4807. result.push(branch);
  4808. }
  4809. }
  4810. return result;
  4811. });
  4812. }
  4813. checkout(ref, startPoint) {
  4814. return __awaiter(this, void 0, void 0, function* () {
  4815. const args = ['checkout', '--progress', '--force'];
  4816. if (startPoint) {
  4817. args.push('-B', ref, startPoint);
  4818. }
  4819. else {
  4820. args.push(ref);
  4821. }
  4822. yield this.execGit(args);
  4823. });
  4824. }
  4825. checkoutDetach() {
  4826. return __awaiter(this, void 0, void 0, function* () {
  4827. const args = ['checkout', '--detach'];
  4828. yield this.execGit(args);
  4829. });
  4830. }
  4831. config(configKey, configValue, globalConfig) {
  4832. return __awaiter(this, void 0, void 0, function* () {
  4833. yield this.execGit([
  4834. 'config',
  4835. globalConfig ? '--global' : '--local',
  4836. configKey,
  4837. configValue
  4838. ]);
  4839. });
  4840. }
  4841. configExists(configKey, globalConfig) {
  4842. return __awaiter(this, void 0, void 0, function* () {
  4843. const pattern = regexpHelper.escape(configKey);
  4844. const output = yield this.execGit([
  4845. 'config',
  4846. globalConfig ? '--global' : '--local',
  4847. '--name-only',
  4848. '--get-regexp',
  4849. pattern
  4850. ], true);
  4851. return output.exitCode === 0;
  4852. });
  4853. }
  4854. fetch(fetchDepth, refSpec) {
  4855. return __awaiter(this, void 0, void 0, function* () {
  4856. const args = [
  4857. '-c',
  4858. 'protocol.version=2',
  4859. 'fetch',
  4860. '--no-tags',
  4861. '--prune',
  4862. '--progress',
  4863. '--no-recurse-submodules'
  4864. ];
  4865. if (fetchDepth > 0) {
  4866. args.push(`--depth=${fetchDepth}`);
  4867. }
  4868. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4869. args.push('--unshallow');
  4870. }
  4871. args.push('origin');
  4872. for (const arg of refSpec) {
  4873. args.push(arg);
  4874. }
  4875. const that = this;
  4876. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4877. yield that.execGit(args);
  4878. }));
  4879. });
  4880. }
  4881. getWorkingDirectory() {
  4882. return this.workingDirectory;
  4883. }
  4884. init() {
  4885. return __awaiter(this, void 0, void 0, function* () {
  4886. yield this.execGit(['init', this.workingDirectory]);
  4887. });
  4888. }
  4889. isDetached() {
  4890. return __awaiter(this, void 0, void 0, function* () {
  4891. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  4892. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  4893. return !output.stdout.trim().startsWith('refs/heads/');
  4894. });
  4895. }
  4896. lfsFetch(ref) {
  4897. return __awaiter(this, void 0, void 0, function* () {
  4898. const args = ['lfs', 'fetch', 'origin', ref];
  4899. const that = this;
  4900. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4901. yield that.execGit(args);
  4902. }));
  4903. });
  4904. }
  4905. lfsInstall() {
  4906. return __awaiter(this, void 0, void 0, function* () {
  4907. yield this.execGit(['lfs', 'install', '--local']);
  4908. });
  4909. }
  4910. log1() {
  4911. return __awaiter(this, void 0, void 0, function* () {
  4912. yield this.execGit(['log', '-1']);
  4913. });
  4914. }
  4915. remoteAdd(remoteName, remoteUrl) {
  4916. return __awaiter(this, void 0, void 0, function* () {
  4917. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4918. });
  4919. }
  4920. removeEnvironmentVariable(name) {
  4921. delete this.gitEnv[name];
  4922. }
  4923. setEnvironmentVariable(name, value) {
  4924. this.gitEnv[name] = value;
  4925. }
  4926. setRemoteUrl(value) {
  4927. return __awaiter(this, void 0, void 0, function* () {
  4928. yield this.config('git.remote.url', value);
  4929. });
  4930. }
  4931. submoduleForeach(command, recursive) {
  4932. return __awaiter(this, void 0, void 0, function* () {
  4933. const args = ['submodule', 'foreach'];
  4934. if (recursive) {
  4935. args.push('--recursive');
  4936. }
  4937. args.push(command);
  4938. const output = yield this.execGit(args);
  4939. return output.stdout;
  4940. });
  4941. }
  4942. submoduleSync(recursive) {
  4943. return __awaiter(this, void 0, void 0, function* () {
  4944. const args = ['submodule', 'sync'];
  4945. if (recursive) {
  4946. args.push('--recursive');
  4947. }
  4948. yield this.execGit(args);
  4949. });
  4950. }
  4951. submoduleUpdate(fetchDepth, recursive) {
  4952. return __awaiter(this, void 0, void 0, function* () {
  4953. const args = ['-c', 'protocol.version=2'];
  4954. args.push('submodule', 'update', '--init', '--force');
  4955. if (fetchDepth > 0) {
  4956. args.push(`--depth=${fetchDepth}`);
  4957. }
  4958. if (recursive) {
  4959. args.push('--recursive');
  4960. }
  4961. yield this.execGit(args);
  4962. });
  4963. }
  4964. tagExists(pattern) {
  4965. return __awaiter(this, void 0, void 0, function* () {
  4966. const output = yield this.execGit(['tag', '--list', pattern]);
  4967. return !!output.stdout.trim();
  4968. });
  4969. }
  4970. tryClean() {
  4971. return __awaiter(this, void 0, void 0, function* () {
  4972. const output = yield this.execGit(['clean', '-ffdx'], true);
  4973. return output.exitCode === 0;
  4974. });
  4975. }
  4976. tryConfigUnset(configKey, globalConfig) {
  4977. return __awaiter(this, void 0, void 0, function* () {
  4978. const output = yield this.execGit([
  4979. 'config',
  4980. globalConfig ? '--global' : '--local',
  4981. '--unset-all',
  4982. configKey
  4983. ], true);
  4984. return output.exitCode === 0;
  4985. });
  4986. }
  4987. tryDisableAutomaticGarbageCollection() {
  4988. return __awaiter(this, void 0, void 0, function* () {
  4989. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  4990. return output.exitCode === 0;
  4991. });
  4992. }
  4993. tryGetRemoteUrl() {
  4994. return __awaiter(this, void 0, void 0, function* () {
  4995. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  4996. if (output.exitCode !== 0) {
  4997. return '';
  4998. }
  4999. const stdout = output.stdout.trim();
  5000. if (stdout.includes('\n')) {
  5001. return '';
  5002. }
  5003. return stdout;
  5004. });
  5005. }
  5006. tryReset() {
  5007. return __awaiter(this, void 0, void 0, function* () {
  5008. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  5009. return output.exitCode === 0;
  5010. });
  5011. }
  5012. static createCommandManager(workingDirectory, lfs) {
  5013. return __awaiter(this, void 0, void 0, function* () {
  5014. const result = new GitCommandManager();
  5015. yield result.initializeCommandManager(workingDirectory, lfs);
  5016. return result;
  5017. });
  5018. }
  5019. execGit(args, allowAllExitCodes = false) {
  5020. return __awaiter(this, void 0, void 0, function* () {
  5021. fshelper.directoryExistsSync(this.workingDirectory, true);
  5022. const result = new GitOutput();
  5023. const env = {};
  5024. for (const key of Object.keys(process.env)) {
  5025. env[key] = process.env[key];
  5026. }
  5027. for (const key of Object.keys(this.gitEnv)) {
  5028. env[key] = this.gitEnv[key];
  5029. }
  5030. const stdout = [];
  5031. const options = {
  5032. cwd: this.workingDirectory,
  5033. env,
  5034. ignoreReturnCode: allowAllExitCodes,
  5035. listeners: {
  5036. stdout: (data) => {
  5037. stdout.push(data.toString());
  5038. }
  5039. }
  5040. };
  5041. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  5042. result.stdout = stdout.join('');
  5043. return result;
  5044. });
  5045. }
  5046. initializeCommandManager(workingDirectory, lfs) {
  5047. return __awaiter(this, void 0, void 0, function* () {
  5048. this.workingDirectory = workingDirectory;
  5049. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  5050. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  5051. this.lfs = lfs;
  5052. if (!this.lfs) {
  5053. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  5054. }
  5055. this.gitPath = yield io.which('git', true);
  5056. // Git version
  5057. core.debug('Getting git version');
  5058. let gitVersion = new git_version_1.GitVersion();
  5059. let gitOutput = yield this.execGit(['version']);
  5060. let stdout = gitOutput.stdout.trim();
  5061. if (!stdout.includes('\n')) {
  5062. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5063. if (match) {
  5064. gitVersion = new git_version_1.GitVersion(match[0]);
  5065. }
  5066. }
  5067. if (!gitVersion.isValid()) {
  5068. throw new Error('Unable to determine git version');
  5069. }
  5070. // Minimum git version
  5071. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  5072. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  5073. }
  5074. if (this.lfs) {
  5075. // Git-lfs version
  5076. core.debug('Getting git-lfs version');
  5077. let gitLfsVersion = new git_version_1.GitVersion();
  5078. const gitLfsPath = yield io.which('git-lfs', true);
  5079. gitOutput = yield this.execGit(['lfs', 'version']);
  5080. stdout = gitOutput.stdout.trim();
  5081. if (!stdout.includes('\n')) {
  5082. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  5083. if (match) {
  5084. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  5085. }
  5086. }
  5087. if (!gitLfsVersion.isValid()) {
  5088. throw new Error('Unable to determine git-lfs version');
  5089. }
  5090. // Minimum git-lfs version
  5091. // Note:
  5092. // - Auth header not supported before 2.1
  5093. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  5094. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  5095. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  5096. }
  5097. }
  5098. // Set the user agent
  5099. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  5100. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  5101. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  5102. });
  5103. }
  5104. }
  5105. class GitOutput {
  5106. constructor() {
  5107. this.stdout = '';
  5108. this.exitCode = 0;
  5109. }
  5110. }
  5111. /***/ }),
  5112. /***/ 293:
  5113. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5114. "use strict";
  5115. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5116. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5117. return new (P || (P = Promise))(function (resolve, reject) {
  5118. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5119. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5120. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5121. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5122. });
  5123. };
  5124. var __importStar = (this && this.__importStar) || function (mod) {
  5125. if (mod && mod.__esModule) return mod;
  5126. var result = {};
  5127. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5128. result["default"] = mod;
  5129. return result;
  5130. };
  5131. Object.defineProperty(exports, "__esModule", { value: true });
  5132. const core = __importStar(__webpack_require__(470));
  5133. const fsHelper = __importStar(__webpack_require__(618));
  5134. const gitAuthHelper = __importStar(__webpack_require__(287));
  5135. const gitCommandManager = __importStar(__webpack_require__(289));
  5136. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5137. const githubApiHelper = __importStar(__webpack_require__(464));
  5138. const io = __importStar(__webpack_require__(1));
  5139. const path = __importStar(__webpack_require__(622));
  5140. const refHelper = __importStar(__webpack_require__(227));
  5141. const stateHelper = __importStar(__webpack_require__(153));
  5142. const hostname = 'github.com';
  5143. function getSource(settings) {
  5144. return __awaiter(this, void 0, void 0, function* () {
  5145. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5146. // Remote URL
  5147. const httpsUrl = `https://${hostname}/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  5148. const sshUrl = `git@${hostname}:${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}.git`;
  5149. // Always fetch the workflow repository using the token, not the SSH key
  5150. const initialRemoteUrl = !settings.sshKey || settings.isWorkflowRepository ? httpsUrl : sshUrl;
  5151. // Remove conflicting file path
  5152. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5153. yield io.rmRF(settings.repositoryPath);
  5154. }
  5155. // Create directory
  5156. let isExisting = true;
  5157. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5158. isExisting = false;
  5159. yield io.mkdirP(settings.repositoryPath);
  5160. }
  5161. // Git command manager
  5162. const git = yield getGitCommandManager(settings);
  5163. // Prepare existing directory, otherwise recreate
  5164. if (isExisting) {
  5165. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, initialRemoteUrl, [httpsUrl, sshUrl], settings.clean);
  5166. }
  5167. if (!git) {
  5168. // Downloading using REST API
  5169. core.info(`The repository will be downloaded using the GitHub REST API`);
  5170. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5171. if (settings.submodules) {
  5172. 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.`);
  5173. }
  5174. else if (settings.sshKey) {
  5175. 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.`);
  5176. }
  5177. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5178. return;
  5179. }
  5180. // Save state for POST action
  5181. stateHelper.setRepositoryPath(settings.repositoryPath);
  5182. // Initialize the repository
  5183. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5184. yield git.init();
  5185. yield git.remoteAdd('origin', initialRemoteUrl);
  5186. }
  5187. // Disable automatic garbage collection
  5188. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5189. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5190. }
  5191. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5192. try {
  5193. // Configure auth
  5194. yield authHelper.configureAuth();
  5195. // LFS install
  5196. if (settings.lfs) {
  5197. yield git.lfsInstall();
  5198. }
  5199. // Fetch
  5200. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5201. yield git.fetch(settings.fetchDepth, refSpec);
  5202. // Checkout info
  5203. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5204. // LFS fetch
  5205. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5206. // Explicit lfs fetch will fetch lfs objects in parallel.
  5207. if (settings.lfs) {
  5208. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5209. }
  5210. // Fix URL when using SSH
  5211. if (settings.sshKey && initialRemoteUrl != sshUrl) {
  5212. yield git.setRemoteUrl(sshUrl);
  5213. }
  5214. // Checkout
  5215. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5216. // Submodules
  5217. if (settings.submodules) {
  5218. try {
  5219. // Temporarily override global config
  5220. yield authHelper.configureGlobalAuth();
  5221. // Checkout submodules
  5222. yield git.submoduleSync(settings.nestedSubmodules);
  5223. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5224. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5225. // Persist credentials
  5226. if (settings.persistCredentials) {
  5227. yield authHelper.configureSubmoduleAuth();
  5228. }
  5229. }
  5230. finally {
  5231. // Remove temporary global config override
  5232. yield authHelper.removeGlobalAuth();
  5233. }
  5234. }
  5235. // Dump some info about the checked out commit
  5236. yield git.log1();
  5237. }
  5238. finally {
  5239. // Remove auth
  5240. if (!settings.persistCredentials) {
  5241. yield authHelper.removeAuth();
  5242. }
  5243. }
  5244. });
  5245. }
  5246. exports.getSource = getSource;
  5247. function cleanup(repositoryPath) {
  5248. return __awaiter(this, void 0, void 0, function* () {
  5249. // Repo exists?
  5250. if (!repositoryPath ||
  5251. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5252. return;
  5253. }
  5254. let git;
  5255. try {
  5256. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5257. }
  5258. catch (_a) {
  5259. return;
  5260. }
  5261. // Remove auth
  5262. const authHelper = gitAuthHelper.createAuthHelper(git);
  5263. yield authHelper.removeAuth();
  5264. });
  5265. }
  5266. exports.cleanup = cleanup;
  5267. function getGitCommandManager(settings) {
  5268. return __awaiter(this, void 0, void 0, function* () {
  5269. core.info(`Working directory is '${settings.repositoryPath}'`);
  5270. try {
  5271. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5272. }
  5273. catch (err) {
  5274. // Git is required for LFS
  5275. if (settings.lfs) {
  5276. throw err;
  5277. }
  5278. // Otherwise fallback to REST API
  5279. return undefined;
  5280. }
  5281. });
  5282. }
  5283. /***/ }),
  5284. /***/ 294:
  5285. /***/ (function(module, __unusedexports, __webpack_require__) {
  5286. module.exports = parseOptions;
  5287. const { Deprecation } = __webpack_require__(692);
  5288. const { getUserAgent } = __webpack_require__(796);
  5289. const once = __webpack_require__(969);
  5290. const pkg = __webpack_require__(215);
  5291. const deprecateOptionsTimeout = once((log, deprecation) =>
  5292. log.warn(deprecation)
  5293. );
  5294. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5295. const deprecateOptionsHeaders = once((log, deprecation) =>
  5296. log.warn(deprecation)
  5297. );
  5298. function parseOptions(options, log, hook) {
  5299. if (options.headers) {
  5300. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5301. newObj[key.toLowerCase()] = options.headers[key];
  5302. return newObj;
  5303. }, {});
  5304. }
  5305. const clientDefaults = {
  5306. headers: options.headers || {},
  5307. request: options.request || {},
  5308. mediaType: {
  5309. previews: [],
  5310. format: ""
  5311. }
  5312. };
  5313. if (options.baseUrl) {
  5314. clientDefaults.baseUrl = options.baseUrl;
  5315. }
  5316. if (options.userAgent) {
  5317. clientDefaults.headers["user-agent"] = options.userAgent;
  5318. }
  5319. if (options.previews) {
  5320. clientDefaults.mediaType.previews = options.previews;
  5321. }
  5322. if (options.timeZone) {
  5323. clientDefaults.headers["time-zone"] = options.timeZone;
  5324. }
  5325. if (options.timeout) {
  5326. deprecateOptionsTimeout(
  5327. log,
  5328. new Deprecation(
  5329. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5330. )
  5331. );
  5332. clientDefaults.request.timeout = options.timeout;
  5333. }
  5334. if (options.agent) {
  5335. deprecateOptionsAgent(
  5336. log,
  5337. new Deprecation(
  5338. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5339. )
  5340. );
  5341. clientDefaults.request.agent = options.agent;
  5342. }
  5343. if (options.headers) {
  5344. deprecateOptionsHeaders(
  5345. log,
  5346. new Deprecation(
  5347. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5348. )
  5349. );
  5350. }
  5351. const userAgentOption = clientDefaults.headers["user-agent"];
  5352. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5353. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5354. .filter(Boolean)
  5355. .join(" ");
  5356. clientDefaults.request.hook = hook.bind(null, "request");
  5357. return clientDefaults;
  5358. }
  5359. /***/ }),
  5360. /***/ 297:
  5361. /***/ (function(module) {
  5362. module.exports = class HttpError extends Error {
  5363. constructor (message, code, headers) {
  5364. super(message)
  5365. // Maintains proper stack trace (only available on V8)
  5366. /* istanbul ignore next */
  5367. if (Error.captureStackTrace) {
  5368. Error.captureStackTrace(this, this.constructor)
  5369. }
  5370. this.name = 'HttpError'
  5371. this.code = code
  5372. this.headers = headers
  5373. }
  5374. }
  5375. /***/ }),
  5376. /***/ 301:
  5377. /***/ (function(module, __unusedexports, __webpack_require__) {
  5378. /**
  5379. * Some “list” response that can be paginated have a different response structure
  5380. *
  5381. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5382. * /installation/repositories also has `repository_selection`), as well as a key with
  5383. * the list of the items which name varies from endpoint to endpoint:
  5384. *
  5385. * - https://developer.github.com/v3/search/#example (key `items`)
  5386. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5387. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5388. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5389. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5390. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5391. *
  5392. * Octokit normalizes these responses so that paginated results are always returned following
  5393. * the same structure. One challenge is that if the list response has only one page, no Link
  5394. * header is provided, so this header alone is not sufficient to check wether a response is
  5395. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5396. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5397. * property because it also exists in the response of Get the combined status for a specific ref.
  5398. */
  5399. module.exports = normalizePaginatedListResponse;
  5400. const { Deprecation } = __webpack_require__(692);
  5401. const once = __webpack_require__(969);
  5402. const deprecateIncompleteResults = once((log, deprecation) =>
  5403. log.warn(deprecation)
  5404. );
  5405. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5406. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5407. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5408. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5409. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5410. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5411. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5412. function normalizePaginatedListResponse(octokit, url, response) {
  5413. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5414. if (
  5415. !REGEX_IS_SEARCH_PATH.test(path) &&
  5416. !REGEX_IS_CHECKS_PATH.test(path) &&
  5417. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5418. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5419. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5420. ) {
  5421. return;
  5422. }
  5423. // keep the additional properties intact to avoid a breaking change,
  5424. // but log a deprecation warning when accessed
  5425. const incompleteResults = response.data.incomplete_results;
  5426. const repositorySelection = response.data.repository_selection;
  5427. const totalCount = response.data.total_count;
  5428. delete response.data.incomplete_results;
  5429. delete response.data.repository_selection;
  5430. delete response.data.total_count;
  5431. const namespaceKey = Object.keys(response.data)[0];
  5432. response.data = response.data[namespaceKey];
  5433. Object.defineProperty(response.data, namespaceKey, {
  5434. get() {
  5435. deprecateNamespace(
  5436. octokit.log,
  5437. new Deprecation(
  5438. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5439. )
  5440. );
  5441. return response.data;
  5442. }
  5443. });
  5444. if (typeof incompleteResults !== "undefined") {
  5445. Object.defineProperty(response.data, "incomplete_results", {
  5446. get() {
  5447. deprecateIncompleteResults(
  5448. octokit.log,
  5449. new Deprecation(
  5450. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5451. )
  5452. );
  5453. return incompleteResults;
  5454. }
  5455. });
  5456. }
  5457. if (typeof repositorySelection !== "undefined") {
  5458. Object.defineProperty(response.data, "repository_selection", {
  5459. get() {
  5460. deprecateTotalCount(
  5461. octokit.log,
  5462. new Deprecation(
  5463. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5464. )
  5465. );
  5466. return repositorySelection;
  5467. }
  5468. });
  5469. }
  5470. Object.defineProperty(response.data, "total_count", {
  5471. get() {
  5472. deprecateTotalCount(
  5473. octokit.log,
  5474. new Deprecation(
  5475. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5476. )
  5477. );
  5478. return totalCount;
  5479. }
  5480. });
  5481. }
  5482. /***/ }),
  5483. /***/ 323:
  5484. /***/ (function(module) {
  5485. "use strict";
  5486. var isStream = module.exports = function (stream) {
  5487. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5488. };
  5489. isStream.writable = function (stream) {
  5490. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5491. };
  5492. isStream.readable = function (stream) {
  5493. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5494. };
  5495. isStream.duplex = function (stream) {
  5496. return isStream.writable(stream) && isStream.readable(stream);
  5497. };
  5498. isStream.transform = function (stream) {
  5499. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5500. };
  5501. /***/ }),
  5502. /***/ 335:
  5503. /***/ (function(module, __unusedexports, __webpack_require__) {
  5504. module.exports = __webpack_require__(179);
  5505. /***/ }),
  5506. /***/ 336:
  5507. /***/ (function(module, __unusedexports, __webpack_require__) {
  5508. module.exports = hasLastPage
  5509. const deprecate = __webpack_require__(370)
  5510. const getPageLinks = __webpack_require__(577)
  5511. function hasLastPage (link) {
  5512. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5513. return getPageLinks(link).last
  5514. }
  5515. /***/ }),
  5516. /***/ 348:
  5517. /***/ (function(module, __unusedexports, __webpack_require__) {
  5518. "use strict";
  5519. module.exports = validate;
  5520. const { RequestError } = __webpack_require__(463);
  5521. const get = __webpack_require__(854);
  5522. const set = __webpack_require__(883);
  5523. function validate(octokit, options) {
  5524. if (!options.request.validate) {
  5525. return;
  5526. }
  5527. const { validate: params } = options.request;
  5528. Object.keys(params).forEach(parameterName => {
  5529. const parameter = get(params, parameterName);
  5530. const expectedType = parameter.type;
  5531. let parentParameterName;
  5532. let parentValue;
  5533. let parentParamIsPresent = true;
  5534. let parentParameterIsArray = false;
  5535. if (/\./.test(parameterName)) {
  5536. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5537. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5538. if (parentParameterIsArray) {
  5539. parentParameterName = parentParameterName.slice(0, -2);
  5540. }
  5541. parentValue = get(options, parentParameterName);
  5542. parentParamIsPresent =
  5543. parentParameterName === "headers" ||
  5544. (typeof parentValue === "object" && parentValue !== null);
  5545. }
  5546. const values = parentParameterIsArray
  5547. ? (get(options, parentParameterName) || []).map(
  5548. value => value[parameterName.split(/\./).pop()]
  5549. )
  5550. : [get(options, parameterName)];
  5551. values.forEach((value, i) => {
  5552. const valueIsPresent = typeof value !== "undefined";
  5553. const valueIsNull = value === null;
  5554. const currentParameterName = parentParameterIsArray
  5555. ? parameterName.replace(/\[\]/, `[${i}]`)
  5556. : parameterName;
  5557. if (!parameter.required && !valueIsPresent) {
  5558. return;
  5559. }
  5560. // if the parent parameter is of type object but allows null
  5561. // then the child parameters can be ignored
  5562. if (!parentParamIsPresent) {
  5563. return;
  5564. }
  5565. if (parameter.allowNull && valueIsNull) {
  5566. return;
  5567. }
  5568. if (!parameter.allowNull && valueIsNull) {
  5569. throw new RequestError(
  5570. `'${currentParameterName}' cannot be null`,
  5571. 400,
  5572. {
  5573. request: options
  5574. }
  5575. );
  5576. }
  5577. if (parameter.required && !valueIsPresent) {
  5578. throw new RequestError(
  5579. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5580. value
  5581. )}`,
  5582. 400,
  5583. {
  5584. request: options
  5585. }
  5586. );
  5587. }
  5588. // parse to integer before checking for enum
  5589. // so that string "1" will match enum with number 1
  5590. if (expectedType === "integer") {
  5591. const unparsedValue = value;
  5592. value = parseInt(value, 10);
  5593. if (isNaN(value)) {
  5594. throw new RequestError(
  5595. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5596. unparsedValue
  5597. )} is NaN`,
  5598. 400,
  5599. {
  5600. request: options
  5601. }
  5602. );
  5603. }
  5604. }
  5605. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5606. throw new RequestError(
  5607. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5608. value
  5609. )}`,
  5610. 400,
  5611. {
  5612. request: options
  5613. }
  5614. );
  5615. }
  5616. if (parameter.validation) {
  5617. const regex = new RegExp(parameter.validation);
  5618. if (!regex.test(value)) {
  5619. throw new RequestError(
  5620. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5621. value
  5622. )}`,
  5623. 400,
  5624. {
  5625. request: options
  5626. }
  5627. );
  5628. }
  5629. }
  5630. if (expectedType === "object" && typeof value === "string") {
  5631. try {
  5632. value = JSON.parse(value);
  5633. } catch (exception) {
  5634. throw new RequestError(
  5635. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5636. value
  5637. )}`,
  5638. 400,
  5639. {
  5640. request: options
  5641. }
  5642. );
  5643. }
  5644. }
  5645. set(options, parameter.mapTo || currentParameterName, value);
  5646. });
  5647. });
  5648. return options;
  5649. }
  5650. /***/ }),
  5651. /***/ 349:
  5652. /***/ (function(module, __unusedexports, __webpack_require__) {
  5653. module.exports = authenticationRequestError;
  5654. const { RequestError } = __webpack_require__(463);
  5655. function authenticationRequestError(state, error, options) {
  5656. /* istanbul ignore next */
  5657. if (!error.headers) throw error;
  5658. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5659. // handle "2FA required" error only
  5660. if (error.status !== 401 || !otpRequired) {
  5661. throw error;
  5662. }
  5663. if (
  5664. error.status === 401 &&
  5665. otpRequired &&
  5666. error.request &&
  5667. error.request.headers["x-github-otp"]
  5668. ) {
  5669. throw new RequestError(
  5670. "Invalid one-time password for two-factor authentication",
  5671. 401,
  5672. {
  5673. headers: error.headers,
  5674. request: options
  5675. }
  5676. );
  5677. }
  5678. if (typeof state.auth.on2fa !== "function") {
  5679. throw new RequestError(
  5680. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5681. 401,
  5682. {
  5683. headers: error.headers,
  5684. request: options
  5685. }
  5686. );
  5687. }
  5688. return Promise.resolve()
  5689. .then(() => {
  5690. return state.auth.on2fa();
  5691. })
  5692. .then(oneTimePassword => {
  5693. const newOptions = Object.assign(options, {
  5694. headers: Object.assign(
  5695. { "x-github-otp": oneTimePassword },
  5696. options.headers
  5697. )
  5698. });
  5699. return state.octokit.request(newOptions);
  5700. });
  5701. }
  5702. /***/ }),
  5703. /***/ 357:
  5704. /***/ (function(module) {
  5705. module.exports = require("assert");
  5706. /***/ }),
  5707. /***/ 363:
  5708. /***/ (function(module) {
  5709. module.exports = register
  5710. function register (state, name, method, options) {
  5711. if (typeof method !== 'function') {
  5712. throw new Error('method for before hook must be a function')
  5713. }
  5714. if (!options) {
  5715. options = {}
  5716. }
  5717. if (Array.isArray(name)) {
  5718. return name.reverse().reduce(function (callback, name) {
  5719. return register.bind(null, state, name, callback, options)
  5720. }, method)()
  5721. }
  5722. return Promise.resolve()
  5723. .then(function () {
  5724. if (!state.registry[name]) {
  5725. return method(options)
  5726. }
  5727. return (state.registry[name]).reduce(function (method, registered) {
  5728. return registered.hook.bind(null, method, options)
  5729. }, method)()
  5730. })
  5731. }
  5732. /***/ }),
  5733. /***/ 368:
  5734. /***/ (function(module) {
  5735. module.exports = function atob(str) {
  5736. return Buffer.from(str, 'base64').toString('binary')
  5737. }
  5738. /***/ }),
  5739. /***/ 370:
  5740. /***/ (function(module) {
  5741. module.exports = deprecate
  5742. const loggedMessages = {}
  5743. function deprecate (message) {
  5744. if (loggedMessages[message]) {
  5745. return
  5746. }
  5747. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5748. loggedMessages[message] = 1
  5749. }
  5750. /***/ }),
  5751. /***/ 372:
  5752. /***/ (function(module) {
  5753. module.exports = octokitDebug;
  5754. function octokitDebug(octokit) {
  5755. octokit.hook.wrap("request", (request, options) => {
  5756. octokit.log.debug("request", options);
  5757. const start = Date.now();
  5758. const requestOptions = octokit.request.endpoint.parse(options);
  5759. const path = requestOptions.url.replace(options.baseUrl, "");
  5760. return request(options)
  5761. .then(response => {
  5762. octokit.log.info(
  5763. `${requestOptions.method} ${path} - ${
  5764. response.status
  5765. } in ${Date.now() - start}ms`
  5766. );
  5767. return response;
  5768. })
  5769. .catch(error => {
  5770. octokit.log.info(
  5771. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5772. start}ms`
  5773. );
  5774. throw error;
  5775. });
  5776. });
  5777. }
  5778. /***/ }),
  5779. /***/ 385:
  5780. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5781. "use strict";
  5782. Object.defineProperty(exports, '__esModule', { value: true });
  5783. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5784. var isPlainObject = _interopDefault(__webpack_require__(696));
  5785. var universalUserAgent = __webpack_require__(796);
  5786. function lowercaseKeys(object) {
  5787. if (!object) {
  5788. return {};
  5789. }
  5790. return Object.keys(object).reduce((newObj, key) => {
  5791. newObj[key.toLowerCase()] = object[key];
  5792. return newObj;
  5793. }, {});
  5794. }
  5795. function mergeDeep(defaults, options) {
  5796. const result = Object.assign({}, defaults);
  5797. Object.keys(options).forEach(key => {
  5798. if (isPlainObject(options[key])) {
  5799. if (!(key in defaults)) Object.assign(result, {
  5800. [key]: options[key]
  5801. });else result[key] = mergeDeep(defaults[key], options[key]);
  5802. } else {
  5803. Object.assign(result, {
  5804. [key]: options[key]
  5805. });
  5806. }
  5807. });
  5808. return result;
  5809. }
  5810. function merge(defaults, route, options) {
  5811. if (typeof route === "string") {
  5812. let [method, url] = route.split(" ");
  5813. options = Object.assign(url ? {
  5814. method,
  5815. url
  5816. } : {
  5817. url: method
  5818. }, options);
  5819. } else {
  5820. options = Object.assign({}, route);
  5821. } // lowercase header names before merging with defaults to avoid duplicates
  5822. options.headers = lowercaseKeys(options.headers);
  5823. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5824. if (defaults && defaults.mediaType.previews.length) {
  5825. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5826. }
  5827. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5828. return mergedOptions;
  5829. }
  5830. function addQueryParameters(url, parameters) {
  5831. const separator = /\?/.test(url) ? "&" : "?";
  5832. const names = Object.keys(parameters);
  5833. if (names.length === 0) {
  5834. return url;
  5835. }
  5836. return url + separator + names.map(name => {
  5837. if (name === "q") {
  5838. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5839. }
  5840. return `${name}=${encodeURIComponent(parameters[name])}`;
  5841. }).join("&");
  5842. }
  5843. const urlVariableRegex = /\{[^}]+\}/g;
  5844. function removeNonChars(variableName) {
  5845. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5846. }
  5847. function extractUrlVariableNames(url) {
  5848. const matches = url.match(urlVariableRegex);
  5849. if (!matches) {
  5850. return [];
  5851. }
  5852. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5853. }
  5854. function omit(object, keysToOmit) {
  5855. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5856. obj[key] = object[key];
  5857. return obj;
  5858. }, {});
  5859. }
  5860. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5861. // TODO: create separate package.
  5862. //
  5863. // Copyright (c) 2012-2014, Bram Stein
  5864. // All rights reserved.
  5865. // Redistribution and use in source and binary forms, with or without
  5866. // modification, are permitted provided that the following conditions
  5867. // are met:
  5868. // 1. Redistributions of source code must retain the above copyright
  5869. // notice, this list of conditions and the following disclaimer.
  5870. // 2. Redistributions in binary form must reproduce the above copyright
  5871. // notice, this list of conditions and the following disclaimer in the
  5872. // documentation and/or other materials provided with the distribution.
  5873. // 3. The name of the author may not be used to endorse or promote products
  5874. // derived from this software without specific prior written permission.
  5875. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5876. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5877. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5878. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5879. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5880. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5881. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5882. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5883. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5884. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5885. /* istanbul ignore file */
  5886. function encodeReserved(str) {
  5887. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5888. if (!/%[0-9A-Fa-f]/.test(part)) {
  5889. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5890. }
  5891. return part;
  5892. }).join("");
  5893. }
  5894. function encodeUnreserved(str) {
  5895. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5896. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5897. });
  5898. }
  5899. function encodeValue(operator, value, key) {
  5900. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5901. if (key) {
  5902. return encodeUnreserved(key) + "=" + value;
  5903. } else {
  5904. return value;
  5905. }
  5906. }
  5907. function isDefined(value) {
  5908. return value !== undefined && value !== null;
  5909. }
  5910. function isKeyOperator(operator) {
  5911. return operator === ";" || operator === "&" || operator === "?";
  5912. }
  5913. function getValues(context, operator, key, modifier) {
  5914. var value = context[key],
  5915. result = [];
  5916. if (isDefined(value) && value !== "") {
  5917. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5918. value = value.toString();
  5919. if (modifier && modifier !== "*") {
  5920. value = value.substring(0, parseInt(modifier, 10));
  5921. }
  5922. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5923. } else {
  5924. if (modifier === "*") {
  5925. if (Array.isArray(value)) {
  5926. value.filter(isDefined).forEach(function (value) {
  5927. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5928. });
  5929. } else {
  5930. Object.keys(value).forEach(function (k) {
  5931. if (isDefined(value[k])) {
  5932. result.push(encodeValue(operator, value[k], k));
  5933. }
  5934. });
  5935. }
  5936. } else {
  5937. const tmp = [];
  5938. if (Array.isArray(value)) {
  5939. value.filter(isDefined).forEach(function (value) {
  5940. tmp.push(encodeValue(operator, value));
  5941. });
  5942. } else {
  5943. Object.keys(value).forEach(function (k) {
  5944. if (isDefined(value[k])) {
  5945. tmp.push(encodeUnreserved(k));
  5946. tmp.push(encodeValue(operator, value[k].toString()));
  5947. }
  5948. });
  5949. }
  5950. if (isKeyOperator(operator)) {
  5951. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5952. } else if (tmp.length !== 0) {
  5953. result.push(tmp.join(","));
  5954. }
  5955. }
  5956. }
  5957. } else {
  5958. if (operator === ";") {
  5959. if (isDefined(value)) {
  5960. result.push(encodeUnreserved(key));
  5961. }
  5962. } else if (value === "" && (operator === "&" || operator === "?")) {
  5963. result.push(encodeUnreserved(key) + "=");
  5964. } else if (value === "") {
  5965. result.push("");
  5966. }
  5967. }
  5968. return result;
  5969. }
  5970. function parseUrl(template) {
  5971. return {
  5972. expand: expand.bind(null, template)
  5973. };
  5974. }
  5975. function expand(template, context) {
  5976. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5977. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5978. if (expression) {
  5979. let operator = "";
  5980. const values = [];
  5981. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5982. operator = expression.charAt(0);
  5983. expression = expression.substr(1);
  5984. }
  5985. expression.split(/,/g).forEach(function (variable) {
  5986. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5987. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5988. });
  5989. if (operator && operator !== "+") {
  5990. var separator = ",";
  5991. if (operator === "?") {
  5992. separator = "&";
  5993. } else if (operator !== "#") {
  5994. separator = operator;
  5995. }
  5996. return (values.length !== 0 ? operator : "") + values.join(separator);
  5997. } else {
  5998. return values.join(",");
  5999. }
  6000. } else {
  6001. return encodeReserved(literal);
  6002. }
  6003. });
  6004. }
  6005. function parse(options) {
  6006. // https://fetch.spec.whatwg.org/#methods
  6007. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  6008. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  6009. let headers = Object.assign({}, options.headers);
  6010. let body;
  6011. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  6012. const urlVariableNames = extractUrlVariableNames(url);
  6013. url = parseUrl(url).expand(parameters);
  6014. if (!/^http/.test(url)) {
  6015. url = options.baseUrl + url;
  6016. }
  6017. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  6018. const remainingParameters = omit(parameters, omittedParameters);
  6019. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  6020. if (!isBinaryRequset) {
  6021. if (options.mediaType.format) {
  6022. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  6023. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  6024. }
  6025. if (options.mediaType.previews.length) {
  6026. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  6027. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  6028. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  6029. return `application/vnd.github.${preview}-preview${format}`;
  6030. }).join(",");
  6031. }
  6032. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  6033. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  6034. if (["GET", "HEAD"].includes(method)) {
  6035. url = addQueryParameters(url, remainingParameters);
  6036. } else {
  6037. if ("data" in remainingParameters) {
  6038. body = remainingParameters.data;
  6039. } else {
  6040. if (Object.keys(remainingParameters).length) {
  6041. body = remainingParameters;
  6042. } else {
  6043. headers["content-length"] = 0;
  6044. }
  6045. }
  6046. } // default content-type for JSON if body is set
  6047. if (!headers["content-type"] && typeof body !== "undefined") {
  6048. headers["content-type"] = "application/json; charset=utf-8";
  6049. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  6050. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  6051. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  6052. body = "";
  6053. } // Only return body/request keys if present
  6054. return Object.assign({
  6055. method,
  6056. url,
  6057. headers
  6058. }, typeof body !== "undefined" ? {
  6059. body
  6060. } : null, options.request ? {
  6061. request: options.request
  6062. } : null);
  6063. }
  6064. function endpointWithDefaults(defaults, route, options) {
  6065. return parse(merge(defaults, route, options));
  6066. }
  6067. function withDefaults(oldDefaults, newDefaults) {
  6068. const DEFAULTS = merge(oldDefaults, newDefaults);
  6069. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  6070. return Object.assign(endpoint, {
  6071. DEFAULTS,
  6072. defaults: withDefaults.bind(null, DEFAULTS),
  6073. merge: merge.bind(null, DEFAULTS),
  6074. parse
  6075. });
  6076. }
  6077. const VERSION = "5.5.1";
  6078. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  6079. // So we use RequestParameters and add method as additional required property.
  6080. const DEFAULTS = {
  6081. method: "GET",
  6082. baseUrl: "https://api.github.com",
  6083. headers: {
  6084. accept: "application/vnd.github.v3+json",
  6085. "user-agent": userAgent
  6086. },
  6087. mediaType: {
  6088. format: "",
  6089. previews: []
  6090. }
  6091. };
  6092. const endpoint = withDefaults(null, DEFAULTS);
  6093. exports.endpoint = endpoint;
  6094. //# sourceMappingURL=index.js.map
  6095. /***/ }),
  6096. /***/ 389:
  6097. /***/ (function(module, __unusedexports, __webpack_require__) {
  6098. "use strict";
  6099. const fs = __webpack_require__(747);
  6100. const shebangCommand = __webpack_require__(866);
  6101. function readShebang(command) {
  6102. // Read the first 150 bytes from the file
  6103. const size = 150;
  6104. let buffer;
  6105. if (Buffer.alloc) {
  6106. // Node.js v4.5+ / v5.10+
  6107. buffer = Buffer.alloc(size);
  6108. } else {
  6109. // Old Node.js API
  6110. buffer = new Buffer(size);
  6111. buffer.fill(0); // zero-fill
  6112. }
  6113. let fd;
  6114. try {
  6115. fd = fs.openSync(command, 'r');
  6116. fs.readSync(fd, buffer, 0, size, 0);
  6117. fs.closeSync(fd);
  6118. } catch (e) { /* Empty */ }
  6119. // Attempt to extract shebang (null is returned if not a shebang)
  6120. return shebangCommand(buffer.toString());
  6121. }
  6122. module.exports = readShebang;
  6123. /***/ }),
  6124. /***/ 402:
  6125. /***/ (function(module, __unusedexports, __webpack_require__) {
  6126. module.exports = Octokit;
  6127. const { request } = __webpack_require__(753);
  6128. const Hook = __webpack_require__(523);
  6129. const parseClientOptions = __webpack_require__(294);
  6130. function Octokit(plugins, options) {
  6131. options = options || {};
  6132. const hook = new Hook.Collection();
  6133. const log = Object.assign(
  6134. {
  6135. debug: () => {},
  6136. info: () => {},
  6137. warn: console.warn,
  6138. error: console.error
  6139. },
  6140. options && options.log
  6141. );
  6142. const api = {
  6143. hook,
  6144. log,
  6145. request: request.defaults(parseClientOptions(options, log, hook))
  6146. };
  6147. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6148. return api;
  6149. }
  6150. /***/ }),
  6151. /***/ 413:
  6152. /***/ (function(module) {
  6153. module.exports = require("stream");
  6154. /***/ }),
  6155. /***/ 417:
  6156. /***/ (function(module) {
  6157. module.exports = require("crypto");
  6158. /***/ }),
  6159. /***/ 427:
  6160. /***/ (function(module, __unusedexports, __webpack_require__) {
  6161. "use strict";
  6162. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6163. // In that case, fall back to a deprecated internal.
  6164. const util = __webpack_require__(669);
  6165. let uv;
  6166. if (typeof util.getSystemErrorName === 'function') {
  6167. module.exports = util.getSystemErrorName;
  6168. } else {
  6169. try {
  6170. uv = process.binding('uv');
  6171. if (typeof uv.errname !== 'function') {
  6172. throw new TypeError('uv.errname is not a function');
  6173. }
  6174. } catch (err) {
  6175. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6176. uv = null;
  6177. }
  6178. module.exports = code => errname(uv, code);
  6179. }
  6180. // Used for testing the fallback behavior
  6181. module.exports.__test__ = errname;
  6182. function errname(uv, code) {
  6183. if (uv) {
  6184. return uv.errname(code);
  6185. }
  6186. if (!(code < 0)) {
  6187. throw new Error('err >= 0');
  6188. }
  6189. return `Unknown system error ${code}`;
  6190. }
  6191. /***/ }),
  6192. /***/ 430:
  6193. /***/ (function(module, __unusedexports, __webpack_require__) {
  6194. module.exports = octokitValidate;
  6195. const validate = __webpack_require__(348);
  6196. function octokitValidate(octokit) {
  6197. octokit.hook.before("request", validate.bind(null, octokit));
  6198. }
  6199. /***/ }),
  6200. /***/ 431:
  6201. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6202. "use strict";
  6203. Object.defineProperty(exports, "__esModule", { value: true });
  6204. const os = __webpack_require__(87);
  6205. /**
  6206. * Commands
  6207. *
  6208. * Command Format:
  6209. * ##[name key=value;key=value]message
  6210. *
  6211. * Examples:
  6212. * ##[warning]This is the user warning message
  6213. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6214. */
  6215. function issueCommand(command, properties, message) {
  6216. const cmd = new Command(command, properties, message);
  6217. process.stdout.write(cmd.toString() + os.EOL);
  6218. }
  6219. exports.issueCommand = issueCommand;
  6220. function issue(name, message = '') {
  6221. issueCommand(name, {}, message);
  6222. }
  6223. exports.issue = issue;
  6224. const CMD_STRING = '::';
  6225. class Command {
  6226. constructor(command, properties, message) {
  6227. if (!command) {
  6228. command = 'missing.command';
  6229. }
  6230. this.command = command;
  6231. this.properties = properties;
  6232. this.message = message;
  6233. }
  6234. toString() {
  6235. let cmdStr = CMD_STRING + this.command;
  6236. if (this.properties && Object.keys(this.properties).length > 0) {
  6237. cmdStr += ' ';
  6238. for (const key in this.properties) {
  6239. if (this.properties.hasOwnProperty(key)) {
  6240. const val = this.properties[key];
  6241. if (val) {
  6242. // safely append the val - avoid blowing up when attempting to
  6243. // call .replace() if message is not a string for some reason
  6244. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6245. }
  6246. }
  6247. }
  6248. }
  6249. cmdStr += CMD_STRING;
  6250. // safely append the message - avoid blowing up when attempting to
  6251. // call .replace() if message is not a string for some reason
  6252. const message = `${this.message || ''}`;
  6253. cmdStr += escapeData(message);
  6254. return cmdStr;
  6255. }
  6256. }
  6257. function escapeData(s) {
  6258. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6259. }
  6260. function escape(s) {
  6261. return s
  6262. .replace(/\r/g, '%0D')
  6263. .replace(/\n/g, '%0A')
  6264. .replace(/]/g, '%5D')
  6265. .replace(/;/g, '%3B');
  6266. }
  6267. //# sourceMappingURL=command.js.map
  6268. /***/ }),
  6269. /***/ 438:
  6270. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6271. "use strict";
  6272. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6273. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6274. return new (P || (P = Promise))(function (resolve, reject) {
  6275. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6276. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6277. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6278. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6279. });
  6280. };
  6281. var __importStar = (this && this.__importStar) || function (mod) {
  6282. if (mod && mod.__esModule) return mod;
  6283. var result = {};
  6284. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6285. result["default"] = mod;
  6286. return result;
  6287. };
  6288. Object.defineProperty(exports, "__esModule", { value: true });
  6289. const assert = __importStar(__webpack_require__(357));
  6290. const core = __importStar(__webpack_require__(470));
  6291. const fs = __importStar(__webpack_require__(747));
  6292. const fsHelper = __importStar(__webpack_require__(618));
  6293. const io = __importStar(__webpack_require__(1));
  6294. const path = __importStar(__webpack_require__(622));
  6295. function prepareExistingDirectory(git, repositoryPath, initialRemoteUrl, allowedRemoteUrls, clean) {
  6296. return __awaiter(this, void 0, void 0, function* () {
  6297. assert.ok(repositoryPath, 'Expected repositoryPath to be defined');
  6298. assert.ok(allowedRemoteUrls, 'Expected allowedRemoteUrls to be defined');
  6299. assert.ok(allowedRemoteUrls.length, 'Expected allowedRemoteUrls to have at least one value');
  6300. assert.ok(initialRemoteUrl, 'Expected initialRemoteUrl to be defined');
  6301. // Indicates whether to delete the directory contents
  6302. let remove = false;
  6303. // The remote URL
  6304. let remoteUrl;
  6305. // Check whether using git or REST API
  6306. if (!git) {
  6307. remove = true;
  6308. }
  6309. // Fetch URL does not match
  6310. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6311. allowedRemoteUrls.indexOf((remoteUrl = yield git.tryGetRemoteUrl())) < 0) {
  6312. remove = true;
  6313. }
  6314. else {
  6315. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6316. const lockPaths = [
  6317. path.join(repositoryPath, '.git', 'index.lock'),
  6318. path.join(repositoryPath, '.git', 'shallow.lock')
  6319. ];
  6320. for (const lockPath of lockPaths) {
  6321. try {
  6322. yield io.rmRF(lockPath);
  6323. }
  6324. catch (error) {
  6325. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6326. }
  6327. }
  6328. try {
  6329. // Checkout detached HEAD
  6330. if (!(yield git.isDetached())) {
  6331. yield git.checkoutDetach();
  6332. }
  6333. // Remove all refs/heads/*
  6334. let branches = yield git.branchList(false);
  6335. for (const branch of branches) {
  6336. yield git.branchDelete(false, branch);
  6337. }
  6338. // Remove all refs/remotes/origin/* to avoid conflicts
  6339. branches = yield git.branchList(true);
  6340. for (const branch of branches) {
  6341. yield git.branchDelete(true, branch);
  6342. }
  6343. // Clean
  6344. if (clean) {
  6345. if (!(yield git.tryClean())) {
  6346. 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}'.`);
  6347. remove = true;
  6348. }
  6349. else if (!(yield git.tryReset())) {
  6350. remove = true;
  6351. }
  6352. if (remove) {
  6353. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6354. }
  6355. }
  6356. // Always fetch the workflow repository using HTTPS
  6357. if (remoteUrl !== initialRemoteUrl) {
  6358. yield git.setRemoteUrl(initialRemoteUrl);
  6359. }
  6360. }
  6361. catch (error) {
  6362. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6363. remove = true;
  6364. }
  6365. }
  6366. if (remove) {
  6367. // Delete the contents of the directory. Don't delete the directory itself
  6368. // since it might be the current working directory.
  6369. core.info(`Deleting the contents of '${repositoryPath}'`);
  6370. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6371. yield io.rmRF(path.join(repositoryPath, file));
  6372. }
  6373. }
  6374. });
  6375. }
  6376. exports.prepareExistingDirectory = prepareExistingDirectory;
  6377. /***/ }),
  6378. /***/ 453:
  6379. /***/ (function(module, __unusedexports, __webpack_require__) {
  6380. var once = __webpack_require__(969)
  6381. var eos = __webpack_require__(562)
  6382. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6383. var noop = function () {}
  6384. var ancient = /^v?\.0/.test(process.version)
  6385. var isFn = function (fn) {
  6386. return typeof fn === 'function'
  6387. }
  6388. var isFS = function (stream) {
  6389. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6390. if (!fs) return false // browser
  6391. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6392. }
  6393. var isRequest = function (stream) {
  6394. return stream.setHeader && isFn(stream.abort)
  6395. }
  6396. var destroyer = function (stream, reading, writing, callback) {
  6397. callback = once(callback)
  6398. var closed = false
  6399. stream.on('close', function () {
  6400. closed = true
  6401. })
  6402. eos(stream, {readable: reading, writable: writing}, function (err) {
  6403. if (err) return callback(err)
  6404. closed = true
  6405. callback()
  6406. })
  6407. var destroyed = false
  6408. return function (err) {
  6409. if (closed) return
  6410. if (destroyed) return
  6411. destroyed = true
  6412. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6413. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6414. if (isFn(stream.destroy)) return stream.destroy()
  6415. callback(err || new Error('stream was destroyed'))
  6416. }
  6417. }
  6418. var call = function (fn) {
  6419. fn()
  6420. }
  6421. var pipe = function (from, to) {
  6422. return from.pipe(to)
  6423. }
  6424. var pump = function () {
  6425. var streams = Array.prototype.slice.call(arguments)
  6426. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6427. if (Array.isArray(streams[0])) streams = streams[0]
  6428. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6429. var error
  6430. var destroys = streams.map(function (stream, i) {
  6431. var reading = i < streams.length - 1
  6432. var writing = i > 0
  6433. return destroyer(stream, reading, writing, function (err) {
  6434. if (!error) error = err
  6435. if (err) destroys.forEach(call)
  6436. if (reading) return
  6437. destroys.forEach(call)
  6438. callback(error)
  6439. })
  6440. })
  6441. return streams.reduce(pipe)
  6442. }
  6443. module.exports = pump
  6444. /***/ }),
  6445. /***/ 454:
  6446. /***/ (function(module, exports, __webpack_require__) {
  6447. "use strict";
  6448. Object.defineProperty(exports, '__esModule', { value: true });
  6449. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6450. var Stream = _interopDefault(__webpack_require__(413));
  6451. var http = _interopDefault(__webpack_require__(605));
  6452. var Url = _interopDefault(__webpack_require__(835));
  6453. var https = _interopDefault(__webpack_require__(211));
  6454. var zlib = _interopDefault(__webpack_require__(761));
  6455. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6456. // fix for "Readable" isn't a named export issue
  6457. const Readable = Stream.Readable;
  6458. const BUFFER = Symbol('buffer');
  6459. const TYPE = Symbol('type');
  6460. class Blob {
  6461. constructor() {
  6462. this[TYPE] = '';
  6463. const blobParts = arguments[0];
  6464. const options = arguments[1];
  6465. const buffers = [];
  6466. let size = 0;
  6467. if (blobParts) {
  6468. const a = blobParts;
  6469. const length = Number(a.length);
  6470. for (let i = 0; i < length; i++) {
  6471. const element = a[i];
  6472. let buffer;
  6473. if (element instanceof Buffer) {
  6474. buffer = element;
  6475. } else if (ArrayBuffer.isView(element)) {
  6476. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6477. } else if (element instanceof ArrayBuffer) {
  6478. buffer = Buffer.from(element);
  6479. } else if (element instanceof Blob) {
  6480. buffer = element[BUFFER];
  6481. } else {
  6482. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6483. }
  6484. size += buffer.length;
  6485. buffers.push(buffer);
  6486. }
  6487. }
  6488. this[BUFFER] = Buffer.concat(buffers);
  6489. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6490. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6491. this[TYPE] = type;
  6492. }
  6493. }
  6494. get size() {
  6495. return this[BUFFER].length;
  6496. }
  6497. get type() {
  6498. return this[TYPE];
  6499. }
  6500. text() {
  6501. return Promise.resolve(this[BUFFER].toString());
  6502. }
  6503. arrayBuffer() {
  6504. const buf = this[BUFFER];
  6505. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6506. return Promise.resolve(ab);
  6507. }
  6508. stream() {
  6509. const readable = new Readable();
  6510. readable._read = function () {};
  6511. readable.push(this[BUFFER]);
  6512. readable.push(null);
  6513. return readable;
  6514. }
  6515. toString() {
  6516. return '[object Blob]';
  6517. }
  6518. slice() {
  6519. const size = this.size;
  6520. const start = arguments[0];
  6521. const end = arguments[1];
  6522. let relativeStart, relativeEnd;
  6523. if (start === undefined) {
  6524. relativeStart = 0;
  6525. } else if (start < 0) {
  6526. relativeStart = Math.max(size + start, 0);
  6527. } else {
  6528. relativeStart = Math.min(start, size);
  6529. }
  6530. if (end === undefined) {
  6531. relativeEnd = size;
  6532. } else if (end < 0) {
  6533. relativeEnd = Math.max(size + end, 0);
  6534. } else {
  6535. relativeEnd = Math.min(end, size);
  6536. }
  6537. const span = Math.max(relativeEnd - relativeStart, 0);
  6538. const buffer = this[BUFFER];
  6539. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6540. const blob = new Blob([], { type: arguments[2] });
  6541. blob[BUFFER] = slicedBuffer;
  6542. return blob;
  6543. }
  6544. }
  6545. Object.defineProperties(Blob.prototype, {
  6546. size: { enumerable: true },
  6547. type: { enumerable: true },
  6548. slice: { enumerable: true }
  6549. });
  6550. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6551. value: 'Blob',
  6552. writable: false,
  6553. enumerable: false,
  6554. configurable: true
  6555. });
  6556. /**
  6557. * fetch-error.js
  6558. *
  6559. * FetchError interface for operational errors
  6560. */
  6561. /**
  6562. * Create FetchError instance
  6563. *
  6564. * @param String message Error message for human
  6565. * @param String type Error type for machine
  6566. * @param String systemError For Node.js system error
  6567. * @return FetchError
  6568. */
  6569. function FetchError(message, type, systemError) {
  6570. Error.call(this, message);
  6571. this.message = message;
  6572. this.type = type;
  6573. // when err.type is `system`, err.code contains system error code
  6574. if (systemError) {
  6575. this.code = this.errno = systemError.code;
  6576. }
  6577. // hide custom error implementation details from end-users
  6578. Error.captureStackTrace(this, this.constructor);
  6579. }
  6580. FetchError.prototype = Object.create(Error.prototype);
  6581. FetchError.prototype.constructor = FetchError;
  6582. FetchError.prototype.name = 'FetchError';
  6583. let convert;
  6584. try {
  6585. convert = __webpack_require__(18).convert;
  6586. } catch (e) {}
  6587. const INTERNALS = Symbol('Body internals');
  6588. // fix an issue where "PassThrough" isn't a named export for node <10
  6589. const PassThrough = Stream.PassThrough;
  6590. /**
  6591. * Body mixin
  6592. *
  6593. * Ref: https://fetch.spec.whatwg.org/#body
  6594. *
  6595. * @param Stream body Readable stream
  6596. * @param Object opts Response options
  6597. * @return Void
  6598. */
  6599. function Body(body) {
  6600. var _this = this;
  6601. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6602. _ref$size = _ref.size;
  6603. let size = _ref$size === undefined ? 0 : _ref$size;
  6604. var _ref$timeout = _ref.timeout;
  6605. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6606. if (body == null) {
  6607. // body is undefined or null
  6608. body = null;
  6609. } else if (isURLSearchParams(body)) {
  6610. // body is a URLSearchParams
  6611. body = Buffer.from(body.toString());
  6612. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6613. // body is ArrayBuffer
  6614. body = Buffer.from(body);
  6615. } else if (ArrayBuffer.isView(body)) {
  6616. // body is ArrayBufferView
  6617. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6618. } else if (body instanceof Stream) ; else {
  6619. // none of the above
  6620. // coerce to string then buffer
  6621. body = Buffer.from(String(body));
  6622. }
  6623. this[INTERNALS] = {
  6624. body,
  6625. disturbed: false,
  6626. error: null
  6627. };
  6628. this.size = size;
  6629. this.timeout = timeout;
  6630. if (body instanceof Stream) {
  6631. body.on('error', function (err) {
  6632. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6633. _this[INTERNALS].error = error;
  6634. });
  6635. }
  6636. }
  6637. Body.prototype = {
  6638. get body() {
  6639. return this[INTERNALS].body;
  6640. },
  6641. get bodyUsed() {
  6642. return this[INTERNALS].disturbed;
  6643. },
  6644. /**
  6645. * Decode response as ArrayBuffer
  6646. *
  6647. * @return Promise
  6648. */
  6649. arrayBuffer() {
  6650. return consumeBody.call(this).then(function (buf) {
  6651. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6652. });
  6653. },
  6654. /**
  6655. * Return raw response as Blob
  6656. *
  6657. * @return Promise
  6658. */
  6659. blob() {
  6660. let ct = this.headers && this.headers.get('content-type') || '';
  6661. return consumeBody.call(this).then(function (buf) {
  6662. return Object.assign(
  6663. // Prevent copying
  6664. new Blob([], {
  6665. type: ct.toLowerCase()
  6666. }), {
  6667. [BUFFER]: buf
  6668. });
  6669. });
  6670. },
  6671. /**
  6672. * Decode response as json
  6673. *
  6674. * @return Promise
  6675. */
  6676. json() {
  6677. var _this2 = this;
  6678. return consumeBody.call(this).then(function (buffer) {
  6679. try {
  6680. return JSON.parse(buffer.toString());
  6681. } catch (err) {
  6682. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6683. }
  6684. });
  6685. },
  6686. /**
  6687. * Decode response as text
  6688. *
  6689. * @return Promise
  6690. */
  6691. text() {
  6692. return consumeBody.call(this).then(function (buffer) {
  6693. return buffer.toString();
  6694. });
  6695. },
  6696. /**
  6697. * Decode response as buffer (non-spec api)
  6698. *
  6699. * @return Promise
  6700. */
  6701. buffer() {
  6702. return consumeBody.call(this);
  6703. },
  6704. /**
  6705. * Decode response as text, while automatically detecting the encoding and
  6706. * trying to decode to UTF-8 (non-spec api)
  6707. *
  6708. * @return Promise
  6709. */
  6710. textConverted() {
  6711. var _this3 = this;
  6712. return consumeBody.call(this).then(function (buffer) {
  6713. return convertBody(buffer, _this3.headers);
  6714. });
  6715. }
  6716. };
  6717. // In browsers, all properties are enumerable.
  6718. Object.defineProperties(Body.prototype, {
  6719. body: { enumerable: true },
  6720. bodyUsed: { enumerable: true },
  6721. arrayBuffer: { enumerable: true },
  6722. blob: { enumerable: true },
  6723. json: { enumerable: true },
  6724. text: { enumerable: true }
  6725. });
  6726. Body.mixIn = function (proto) {
  6727. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6728. // istanbul ignore else: future proof
  6729. if (!(name in proto)) {
  6730. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6731. Object.defineProperty(proto, name, desc);
  6732. }
  6733. }
  6734. };
  6735. /**
  6736. * Consume and convert an entire Body to a Buffer.
  6737. *
  6738. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6739. *
  6740. * @return Promise
  6741. */
  6742. function consumeBody() {
  6743. var _this4 = this;
  6744. if (this[INTERNALS].disturbed) {
  6745. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6746. }
  6747. this[INTERNALS].disturbed = true;
  6748. if (this[INTERNALS].error) {
  6749. return Body.Promise.reject(this[INTERNALS].error);
  6750. }
  6751. let body = this.body;
  6752. // body is null
  6753. if (body === null) {
  6754. return Body.Promise.resolve(Buffer.alloc(0));
  6755. }
  6756. // body is blob
  6757. if (isBlob(body)) {
  6758. body = body.stream();
  6759. }
  6760. // body is buffer
  6761. if (Buffer.isBuffer(body)) {
  6762. return Body.Promise.resolve(body);
  6763. }
  6764. // istanbul ignore if: should never happen
  6765. if (!(body instanceof Stream)) {
  6766. return Body.Promise.resolve(Buffer.alloc(0));
  6767. }
  6768. // body is stream
  6769. // get ready to actually consume the body
  6770. let accum = [];
  6771. let accumBytes = 0;
  6772. let abort = false;
  6773. return new Body.Promise(function (resolve, reject) {
  6774. let resTimeout;
  6775. // allow timeout on slow response body
  6776. if (_this4.timeout) {
  6777. resTimeout = setTimeout(function () {
  6778. abort = true;
  6779. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6780. }, _this4.timeout);
  6781. }
  6782. // handle stream errors
  6783. body.on('error', function (err) {
  6784. if (err.name === 'AbortError') {
  6785. // if the request was aborted, reject with this Error
  6786. abort = true;
  6787. reject(err);
  6788. } else {
  6789. // other errors, such as incorrect content-encoding
  6790. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6791. }
  6792. });
  6793. body.on('data', function (chunk) {
  6794. if (abort || chunk === null) {
  6795. return;
  6796. }
  6797. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6798. abort = true;
  6799. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6800. return;
  6801. }
  6802. accumBytes += chunk.length;
  6803. accum.push(chunk);
  6804. });
  6805. body.on('end', function () {
  6806. if (abort) {
  6807. return;
  6808. }
  6809. clearTimeout(resTimeout);
  6810. try {
  6811. resolve(Buffer.concat(accum, accumBytes));
  6812. } catch (err) {
  6813. // handle streams that have accumulated too much data (issue #414)
  6814. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6815. }
  6816. });
  6817. });
  6818. }
  6819. /**
  6820. * Detect buffer encoding and convert to target encoding
  6821. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6822. *
  6823. * @param Buffer buffer Incoming buffer
  6824. * @param String encoding Target encoding
  6825. * @return String
  6826. */
  6827. function convertBody(buffer, headers) {
  6828. if (typeof convert !== 'function') {
  6829. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6830. }
  6831. const ct = headers.get('content-type');
  6832. let charset = 'utf-8';
  6833. let res, str;
  6834. // header
  6835. if (ct) {
  6836. res = /charset=([^;]*)/i.exec(ct);
  6837. }
  6838. // no charset in content type, peek at response body for at most 1024 bytes
  6839. str = buffer.slice(0, 1024).toString();
  6840. // html5
  6841. if (!res && str) {
  6842. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6843. }
  6844. // html4
  6845. if (!res && str) {
  6846. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6847. if (res) {
  6848. res = /charset=(.*)/i.exec(res.pop());
  6849. }
  6850. }
  6851. // xml
  6852. if (!res && str) {
  6853. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6854. }
  6855. // found charset
  6856. if (res) {
  6857. charset = res.pop();
  6858. // prevent decode issues when sites use incorrect encoding
  6859. // ref: https://hsivonen.fi/encoding-menu/
  6860. if (charset === 'gb2312' || charset === 'gbk') {
  6861. charset = 'gb18030';
  6862. }
  6863. }
  6864. // turn raw buffers into a single utf-8 buffer
  6865. return convert(buffer, 'UTF-8', charset).toString();
  6866. }
  6867. /**
  6868. * Detect a URLSearchParams object
  6869. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6870. *
  6871. * @param Object obj Object to detect by type or brand
  6872. * @return String
  6873. */
  6874. function isURLSearchParams(obj) {
  6875. // Duck-typing as a necessary condition.
  6876. 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') {
  6877. return false;
  6878. }
  6879. // Brand-checking and more duck-typing as optional condition.
  6880. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6881. }
  6882. /**
  6883. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6884. * @param {*} obj
  6885. * @return {boolean}
  6886. */
  6887. function isBlob(obj) {
  6888. 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]);
  6889. }
  6890. /**
  6891. * Clone body given Res/Req instance
  6892. *
  6893. * @param Mixed instance Response or Request instance
  6894. * @return Mixed
  6895. */
  6896. function clone(instance) {
  6897. let p1, p2;
  6898. let body = instance.body;
  6899. // don't allow cloning a used body
  6900. if (instance.bodyUsed) {
  6901. throw new Error('cannot clone body after it is used');
  6902. }
  6903. // check that body is a stream and not form-data object
  6904. // note: we can't clone the form-data object without having it as a dependency
  6905. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6906. // tee instance body
  6907. p1 = new PassThrough();
  6908. p2 = new PassThrough();
  6909. body.pipe(p1);
  6910. body.pipe(p2);
  6911. // set instance body to teed body and return the other teed body
  6912. instance[INTERNALS].body = p1;
  6913. body = p2;
  6914. }
  6915. return body;
  6916. }
  6917. /**
  6918. * Performs the operation "extract a `Content-Type` value from |object|" as
  6919. * specified in the specification:
  6920. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6921. *
  6922. * This function assumes that instance.body is present.
  6923. *
  6924. * @param Mixed instance Any options.body input
  6925. */
  6926. function extractContentType(body) {
  6927. if (body === null) {
  6928. // body is null
  6929. return null;
  6930. } else if (typeof body === 'string') {
  6931. // body is string
  6932. return 'text/plain;charset=UTF-8';
  6933. } else if (isURLSearchParams(body)) {
  6934. // body is a URLSearchParams
  6935. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6936. } else if (isBlob(body)) {
  6937. // body is blob
  6938. return body.type || null;
  6939. } else if (Buffer.isBuffer(body)) {
  6940. // body is buffer
  6941. return null;
  6942. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6943. // body is ArrayBuffer
  6944. return null;
  6945. } else if (ArrayBuffer.isView(body)) {
  6946. // body is ArrayBufferView
  6947. return null;
  6948. } else if (typeof body.getBoundary === 'function') {
  6949. // detect form data input from form-data module
  6950. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6951. } else if (body instanceof Stream) {
  6952. // body is stream
  6953. // can't really do much about this
  6954. return null;
  6955. } else {
  6956. // Body constructor defaults other things to string
  6957. return 'text/plain;charset=UTF-8';
  6958. }
  6959. }
  6960. /**
  6961. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6962. * For us, we have to explicitly get it with a function.
  6963. *
  6964. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6965. *
  6966. * @param Body instance Instance of Body
  6967. * @return Number? Number of bytes, or null if not possible
  6968. */
  6969. function getTotalBytes(instance) {
  6970. const body = instance.body;
  6971. if (body === null) {
  6972. // body is null
  6973. return 0;
  6974. } else if (isBlob(body)) {
  6975. return body.size;
  6976. } else if (Buffer.isBuffer(body)) {
  6977. // body is buffer
  6978. return body.length;
  6979. } else if (body && typeof body.getLengthSync === 'function') {
  6980. // detect form data input from form-data module
  6981. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6982. body.hasKnownLength && body.hasKnownLength()) {
  6983. // 2.x
  6984. return body.getLengthSync();
  6985. }
  6986. return null;
  6987. } else {
  6988. // body is stream
  6989. return null;
  6990. }
  6991. }
  6992. /**
  6993. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6994. *
  6995. * @param Body instance Instance of Body
  6996. * @return Void
  6997. */
  6998. function writeToStream(dest, instance) {
  6999. const body = instance.body;
  7000. if (body === null) {
  7001. // body is null
  7002. dest.end();
  7003. } else if (isBlob(body)) {
  7004. body.stream().pipe(dest);
  7005. } else if (Buffer.isBuffer(body)) {
  7006. // body is buffer
  7007. dest.write(body);
  7008. dest.end();
  7009. } else {
  7010. // body is stream
  7011. body.pipe(dest);
  7012. }
  7013. }
  7014. // expose Promise
  7015. Body.Promise = global.Promise;
  7016. /**
  7017. * headers.js
  7018. *
  7019. * Headers class offers convenient helpers
  7020. */
  7021. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  7022. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  7023. function validateName(name) {
  7024. name = `${name}`;
  7025. if (invalidTokenRegex.test(name) || name === '') {
  7026. throw new TypeError(`${name} is not a legal HTTP header name`);
  7027. }
  7028. }
  7029. function validateValue(value) {
  7030. value = `${value}`;
  7031. if (invalidHeaderCharRegex.test(value)) {
  7032. throw new TypeError(`${value} is not a legal HTTP header value`);
  7033. }
  7034. }
  7035. /**
  7036. * Find the key in the map object given a header name.
  7037. *
  7038. * Returns undefined if not found.
  7039. *
  7040. * @param String name Header name
  7041. * @return String|Undefined
  7042. */
  7043. function find(map, name) {
  7044. name = name.toLowerCase();
  7045. for (const key in map) {
  7046. if (key.toLowerCase() === name) {
  7047. return key;
  7048. }
  7049. }
  7050. return undefined;
  7051. }
  7052. const MAP = Symbol('map');
  7053. class Headers {
  7054. /**
  7055. * Headers class
  7056. *
  7057. * @param Object headers Response headers
  7058. * @return Void
  7059. */
  7060. constructor() {
  7061. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  7062. this[MAP] = Object.create(null);
  7063. if (init instanceof Headers) {
  7064. const rawHeaders = init.raw();
  7065. const headerNames = Object.keys(rawHeaders);
  7066. for (const headerName of headerNames) {
  7067. for (const value of rawHeaders[headerName]) {
  7068. this.append(headerName, value);
  7069. }
  7070. }
  7071. return;
  7072. }
  7073. // We don't worry about converting prop to ByteString here as append()
  7074. // will handle it.
  7075. if (init == null) ; else if (typeof init === 'object') {
  7076. const method = init[Symbol.iterator];
  7077. if (method != null) {
  7078. if (typeof method !== 'function') {
  7079. throw new TypeError('Header pairs must be iterable');
  7080. }
  7081. // sequence<sequence<ByteString>>
  7082. // Note: per spec we have to first exhaust the lists then process them
  7083. const pairs = [];
  7084. for (const pair of init) {
  7085. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  7086. throw new TypeError('Each header pair must be iterable');
  7087. }
  7088. pairs.push(Array.from(pair));
  7089. }
  7090. for (const pair of pairs) {
  7091. if (pair.length !== 2) {
  7092. throw new TypeError('Each header pair must be a name/value tuple');
  7093. }
  7094. this.append(pair[0], pair[1]);
  7095. }
  7096. } else {
  7097. // record<ByteString, ByteString>
  7098. for (const key of Object.keys(init)) {
  7099. const value = init[key];
  7100. this.append(key, value);
  7101. }
  7102. }
  7103. } else {
  7104. throw new TypeError('Provided initializer must be an object');
  7105. }
  7106. }
  7107. /**
  7108. * Return combined header value given name
  7109. *
  7110. * @param String name Header name
  7111. * @return Mixed
  7112. */
  7113. get(name) {
  7114. name = `${name}`;
  7115. validateName(name);
  7116. const key = find(this[MAP], name);
  7117. if (key === undefined) {
  7118. return null;
  7119. }
  7120. return this[MAP][key].join(', ');
  7121. }
  7122. /**
  7123. * Iterate over all headers
  7124. *
  7125. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  7126. * @param Boolean thisArg `this` context for callback function
  7127. * @return Void
  7128. */
  7129. forEach(callback) {
  7130. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  7131. let pairs = getHeaders(this);
  7132. let i = 0;
  7133. while (i < pairs.length) {
  7134. var _pairs$i = pairs[i];
  7135. const name = _pairs$i[0],
  7136. value = _pairs$i[1];
  7137. callback.call(thisArg, value, name, this);
  7138. pairs = getHeaders(this);
  7139. i++;
  7140. }
  7141. }
  7142. /**
  7143. * Overwrite header values given name
  7144. *
  7145. * @param String name Header name
  7146. * @param String value Header value
  7147. * @return Void
  7148. */
  7149. set(name, value) {
  7150. name = `${name}`;
  7151. value = `${value}`;
  7152. validateName(name);
  7153. validateValue(value);
  7154. const key = find(this[MAP], name);
  7155. this[MAP][key !== undefined ? key : name] = [value];
  7156. }
  7157. /**
  7158. * Append a value onto existing header
  7159. *
  7160. * @param String name Header name
  7161. * @param String value Header value
  7162. * @return Void
  7163. */
  7164. append(name, value) {
  7165. name = `${name}`;
  7166. value = `${value}`;
  7167. validateName(name);
  7168. validateValue(value);
  7169. const key = find(this[MAP], name);
  7170. if (key !== undefined) {
  7171. this[MAP][key].push(value);
  7172. } else {
  7173. this[MAP][name] = [value];
  7174. }
  7175. }
  7176. /**
  7177. * Check for header name existence
  7178. *
  7179. * @param String name Header name
  7180. * @return Boolean
  7181. */
  7182. has(name) {
  7183. name = `${name}`;
  7184. validateName(name);
  7185. return find(this[MAP], name) !== undefined;
  7186. }
  7187. /**
  7188. * Delete all header values given name
  7189. *
  7190. * @param String name Header name
  7191. * @return Void
  7192. */
  7193. delete(name) {
  7194. name = `${name}`;
  7195. validateName(name);
  7196. const key = find(this[MAP], name);
  7197. if (key !== undefined) {
  7198. delete this[MAP][key];
  7199. }
  7200. }
  7201. /**
  7202. * Return raw headers (non-spec api)
  7203. *
  7204. * @return Object
  7205. */
  7206. raw() {
  7207. return this[MAP];
  7208. }
  7209. /**
  7210. * Get an iterator on keys.
  7211. *
  7212. * @return Iterator
  7213. */
  7214. keys() {
  7215. return createHeadersIterator(this, 'key');
  7216. }
  7217. /**
  7218. * Get an iterator on values.
  7219. *
  7220. * @return Iterator
  7221. */
  7222. values() {
  7223. return createHeadersIterator(this, 'value');
  7224. }
  7225. /**
  7226. * Get an iterator on entries.
  7227. *
  7228. * This is the default iterator of the Headers object.
  7229. *
  7230. * @return Iterator
  7231. */
  7232. [Symbol.iterator]() {
  7233. return createHeadersIterator(this, 'key+value');
  7234. }
  7235. }
  7236. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7237. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7238. value: 'Headers',
  7239. writable: false,
  7240. enumerable: false,
  7241. configurable: true
  7242. });
  7243. Object.defineProperties(Headers.prototype, {
  7244. get: { enumerable: true },
  7245. forEach: { enumerable: true },
  7246. set: { enumerable: true },
  7247. append: { enumerable: true },
  7248. has: { enumerable: true },
  7249. delete: { enumerable: true },
  7250. keys: { enumerable: true },
  7251. values: { enumerable: true },
  7252. entries: { enumerable: true }
  7253. });
  7254. function getHeaders(headers) {
  7255. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7256. const keys = Object.keys(headers[MAP]).sort();
  7257. return keys.map(kind === 'key' ? function (k) {
  7258. return k.toLowerCase();
  7259. } : kind === 'value' ? function (k) {
  7260. return headers[MAP][k].join(', ');
  7261. } : function (k) {
  7262. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7263. });
  7264. }
  7265. const INTERNAL = Symbol('internal');
  7266. function createHeadersIterator(target, kind) {
  7267. const iterator = Object.create(HeadersIteratorPrototype);
  7268. iterator[INTERNAL] = {
  7269. target,
  7270. kind,
  7271. index: 0
  7272. };
  7273. return iterator;
  7274. }
  7275. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7276. next() {
  7277. // istanbul ignore if
  7278. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7279. throw new TypeError('Value of `this` is not a HeadersIterator');
  7280. }
  7281. var _INTERNAL = this[INTERNAL];
  7282. const target = _INTERNAL.target,
  7283. kind = _INTERNAL.kind,
  7284. index = _INTERNAL.index;
  7285. const values = getHeaders(target, kind);
  7286. const len = values.length;
  7287. if (index >= len) {
  7288. return {
  7289. value: undefined,
  7290. done: true
  7291. };
  7292. }
  7293. this[INTERNAL].index = index + 1;
  7294. return {
  7295. value: values[index],
  7296. done: false
  7297. };
  7298. }
  7299. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7300. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7301. value: 'HeadersIterator',
  7302. writable: false,
  7303. enumerable: false,
  7304. configurable: true
  7305. });
  7306. /**
  7307. * Export the Headers object in a form that Node.js can consume.
  7308. *
  7309. * @param Headers headers
  7310. * @return Object
  7311. */
  7312. function exportNodeCompatibleHeaders(headers) {
  7313. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7314. // http.request() only supports string as Host header. This hack makes
  7315. // specifying custom Host header possible.
  7316. const hostHeaderKey = find(headers[MAP], 'Host');
  7317. if (hostHeaderKey !== undefined) {
  7318. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7319. }
  7320. return obj;
  7321. }
  7322. /**
  7323. * Create a Headers object from an object of headers, ignoring those that do
  7324. * not conform to HTTP grammar productions.
  7325. *
  7326. * @param Object obj Object of headers
  7327. * @return Headers
  7328. */
  7329. function createHeadersLenient(obj) {
  7330. const headers = new Headers();
  7331. for (const name of Object.keys(obj)) {
  7332. if (invalidTokenRegex.test(name)) {
  7333. continue;
  7334. }
  7335. if (Array.isArray(obj[name])) {
  7336. for (const val of obj[name]) {
  7337. if (invalidHeaderCharRegex.test(val)) {
  7338. continue;
  7339. }
  7340. if (headers[MAP][name] === undefined) {
  7341. headers[MAP][name] = [val];
  7342. } else {
  7343. headers[MAP][name].push(val);
  7344. }
  7345. }
  7346. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7347. headers[MAP][name] = [obj[name]];
  7348. }
  7349. }
  7350. return headers;
  7351. }
  7352. const INTERNALS$1 = Symbol('Response internals');
  7353. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7354. const STATUS_CODES = http.STATUS_CODES;
  7355. /**
  7356. * Response class
  7357. *
  7358. * @param Stream body Readable stream
  7359. * @param Object opts Response options
  7360. * @return Void
  7361. */
  7362. class Response {
  7363. constructor() {
  7364. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7365. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7366. Body.call(this, body, opts);
  7367. const status = opts.status || 200;
  7368. const headers = new Headers(opts.headers);
  7369. if (body != null && !headers.has('Content-Type')) {
  7370. const contentType = extractContentType(body);
  7371. if (contentType) {
  7372. headers.append('Content-Type', contentType);
  7373. }
  7374. }
  7375. this[INTERNALS$1] = {
  7376. url: opts.url,
  7377. status,
  7378. statusText: opts.statusText || STATUS_CODES[status],
  7379. headers,
  7380. counter: opts.counter
  7381. };
  7382. }
  7383. get url() {
  7384. return this[INTERNALS$1].url || '';
  7385. }
  7386. get status() {
  7387. return this[INTERNALS$1].status;
  7388. }
  7389. /**
  7390. * Convenience property representing if the request ended normally
  7391. */
  7392. get ok() {
  7393. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7394. }
  7395. get redirected() {
  7396. return this[INTERNALS$1].counter > 0;
  7397. }
  7398. get statusText() {
  7399. return this[INTERNALS$1].statusText;
  7400. }
  7401. get headers() {
  7402. return this[INTERNALS$1].headers;
  7403. }
  7404. /**
  7405. * Clone this response
  7406. *
  7407. * @return Response
  7408. */
  7409. clone() {
  7410. return new Response(clone(this), {
  7411. url: this.url,
  7412. status: this.status,
  7413. statusText: this.statusText,
  7414. headers: this.headers,
  7415. ok: this.ok,
  7416. redirected: this.redirected
  7417. });
  7418. }
  7419. }
  7420. Body.mixIn(Response.prototype);
  7421. Object.defineProperties(Response.prototype, {
  7422. url: { enumerable: true },
  7423. status: { enumerable: true },
  7424. ok: { enumerable: true },
  7425. redirected: { enumerable: true },
  7426. statusText: { enumerable: true },
  7427. headers: { enumerable: true },
  7428. clone: { enumerable: true }
  7429. });
  7430. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7431. value: 'Response',
  7432. writable: false,
  7433. enumerable: false,
  7434. configurable: true
  7435. });
  7436. const INTERNALS$2 = Symbol('Request internals');
  7437. // fix an issue where "format", "parse" aren't a named export for node <10
  7438. const parse_url = Url.parse;
  7439. const format_url = Url.format;
  7440. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7441. /**
  7442. * Check if a value is an instance of Request.
  7443. *
  7444. * @param Mixed input
  7445. * @return Boolean
  7446. */
  7447. function isRequest(input) {
  7448. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7449. }
  7450. function isAbortSignal(signal) {
  7451. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7452. return !!(proto && proto.constructor.name === 'AbortSignal');
  7453. }
  7454. /**
  7455. * Request class
  7456. *
  7457. * @param Mixed input Url or Request instance
  7458. * @param Object init Custom options
  7459. * @return Void
  7460. */
  7461. class Request {
  7462. constructor(input) {
  7463. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7464. let parsedURL;
  7465. // normalize input
  7466. if (!isRequest(input)) {
  7467. if (input && input.href) {
  7468. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7469. // will fall into this branch also (since their `toString()` will return
  7470. // `href` property anyway)
  7471. parsedURL = parse_url(input.href);
  7472. } else {
  7473. // coerce input to a string before attempting to parse
  7474. parsedURL = parse_url(`${input}`);
  7475. }
  7476. input = {};
  7477. } else {
  7478. parsedURL = parse_url(input.url);
  7479. }
  7480. let method = init.method || input.method || 'GET';
  7481. method = method.toUpperCase();
  7482. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7483. throw new TypeError('Request with GET/HEAD method cannot have body');
  7484. }
  7485. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7486. Body.call(this, inputBody, {
  7487. timeout: init.timeout || input.timeout || 0,
  7488. size: init.size || input.size || 0
  7489. });
  7490. const headers = new Headers(init.headers || input.headers || {});
  7491. if (inputBody != null && !headers.has('Content-Type')) {
  7492. const contentType = extractContentType(inputBody);
  7493. if (contentType) {
  7494. headers.append('Content-Type', contentType);
  7495. }
  7496. }
  7497. let signal = isRequest(input) ? input.signal : null;
  7498. if ('signal' in init) signal = init.signal;
  7499. if (signal != null && !isAbortSignal(signal)) {
  7500. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7501. }
  7502. this[INTERNALS$2] = {
  7503. method,
  7504. redirect: init.redirect || input.redirect || 'follow',
  7505. headers,
  7506. parsedURL,
  7507. signal
  7508. };
  7509. // node-fetch-only options
  7510. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7511. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7512. this.counter = init.counter || input.counter || 0;
  7513. this.agent = init.agent || input.agent;
  7514. }
  7515. get method() {
  7516. return this[INTERNALS$2].method;
  7517. }
  7518. get url() {
  7519. return format_url(this[INTERNALS$2].parsedURL);
  7520. }
  7521. get headers() {
  7522. return this[INTERNALS$2].headers;
  7523. }
  7524. get redirect() {
  7525. return this[INTERNALS$2].redirect;
  7526. }
  7527. get signal() {
  7528. return this[INTERNALS$2].signal;
  7529. }
  7530. /**
  7531. * Clone this request
  7532. *
  7533. * @return Request
  7534. */
  7535. clone() {
  7536. return new Request(this);
  7537. }
  7538. }
  7539. Body.mixIn(Request.prototype);
  7540. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7541. value: 'Request',
  7542. writable: false,
  7543. enumerable: false,
  7544. configurable: true
  7545. });
  7546. Object.defineProperties(Request.prototype, {
  7547. method: { enumerable: true },
  7548. url: { enumerable: true },
  7549. headers: { enumerable: true },
  7550. redirect: { enumerable: true },
  7551. clone: { enumerable: true },
  7552. signal: { enumerable: true }
  7553. });
  7554. /**
  7555. * Convert a Request to Node.js http request options.
  7556. *
  7557. * @param Request A Request instance
  7558. * @return Object The options object to be passed to http.request
  7559. */
  7560. function getNodeRequestOptions(request) {
  7561. const parsedURL = request[INTERNALS$2].parsedURL;
  7562. const headers = new Headers(request[INTERNALS$2].headers);
  7563. // fetch step 1.3
  7564. if (!headers.has('Accept')) {
  7565. headers.set('Accept', '*/*');
  7566. }
  7567. // Basic fetch
  7568. if (!parsedURL.protocol || !parsedURL.hostname) {
  7569. throw new TypeError('Only absolute URLs are supported');
  7570. }
  7571. if (!/^https?:$/.test(parsedURL.protocol)) {
  7572. throw new TypeError('Only HTTP(S) protocols are supported');
  7573. }
  7574. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7575. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7576. }
  7577. // HTTP-network-or-cache fetch steps 2.4-2.7
  7578. let contentLengthValue = null;
  7579. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7580. contentLengthValue = '0';
  7581. }
  7582. if (request.body != null) {
  7583. const totalBytes = getTotalBytes(request);
  7584. if (typeof totalBytes === 'number') {
  7585. contentLengthValue = String(totalBytes);
  7586. }
  7587. }
  7588. if (contentLengthValue) {
  7589. headers.set('Content-Length', contentLengthValue);
  7590. }
  7591. // HTTP-network-or-cache fetch step 2.11
  7592. if (!headers.has('User-Agent')) {
  7593. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7594. }
  7595. // HTTP-network-or-cache fetch step 2.15
  7596. if (request.compress && !headers.has('Accept-Encoding')) {
  7597. headers.set('Accept-Encoding', 'gzip,deflate');
  7598. }
  7599. let agent = request.agent;
  7600. if (typeof agent === 'function') {
  7601. agent = agent(parsedURL);
  7602. }
  7603. if (!headers.has('Connection') && !agent) {
  7604. headers.set('Connection', 'close');
  7605. }
  7606. // HTTP-network fetch step 4.2
  7607. // chunked encoding is handled by Node.js
  7608. return Object.assign({}, parsedURL, {
  7609. method: request.method,
  7610. headers: exportNodeCompatibleHeaders(headers),
  7611. agent
  7612. });
  7613. }
  7614. /**
  7615. * abort-error.js
  7616. *
  7617. * AbortError interface for cancelled requests
  7618. */
  7619. /**
  7620. * Create AbortError instance
  7621. *
  7622. * @param String message Error message for human
  7623. * @return AbortError
  7624. */
  7625. function AbortError(message) {
  7626. Error.call(this, message);
  7627. this.type = 'aborted';
  7628. this.message = message;
  7629. // hide custom error implementation details from end-users
  7630. Error.captureStackTrace(this, this.constructor);
  7631. }
  7632. AbortError.prototype = Object.create(Error.prototype);
  7633. AbortError.prototype.constructor = AbortError;
  7634. AbortError.prototype.name = 'AbortError';
  7635. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7636. const PassThrough$1 = Stream.PassThrough;
  7637. const resolve_url = Url.resolve;
  7638. /**
  7639. * Fetch function
  7640. *
  7641. * @param Mixed url Absolute url or Request instance
  7642. * @param Object opts Fetch options
  7643. * @return Promise
  7644. */
  7645. function fetch(url, opts) {
  7646. // allow custom promise
  7647. if (!fetch.Promise) {
  7648. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7649. }
  7650. Body.Promise = fetch.Promise;
  7651. // wrap http.request into fetch
  7652. return new fetch.Promise(function (resolve, reject) {
  7653. // build request object
  7654. const request = new Request(url, opts);
  7655. const options = getNodeRequestOptions(request);
  7656. const send = (options.protocol === 'https:' ? https : http).request;
  7657. const signal = request.signal;
  7658. let response = null;
  7659. const abort = function abort() {
  7660. let error = new AbortError('The user aborted a request.');
  7661. reject(error);
  7662. if (request.body && request.body instanceof Stream.Readable) {
  7663. request.body.destroy(error);
  7664. }
  7665. if (!response || !response.body) return;
  7666. response.body.emit('error', error);
  7667. };
  7668. if (signal && signal.aborted) {
  7669. abort();
  7670. return;
  7671. }
  7672. const abortAndFinalize = function abortAndFinalize() {
  7673. abort();
  7674. finalize();
  7675. };
  7676. // send request
  7677. const req = send(options);
  7678. let reqTimeout;
  7679. if (signal) {
  7680. signal.addEventListener('abort', abortAndFinalize);
  7681. }
  7682. function finalize() {
  7683. req.abort();
  7684. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7685. clearTimeout(reqTimeout);
  7686. }
  7687. if (request.timeout) {
  7688. req.once('socket', function (socket) {
  7689. reqTimeout = setTimeout(function () {
  7690. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7691. finalize();
  7692. }, request.timeout);
  7693. });
  7694. }
  7695. req.on('error', function (err) {
  7696. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7697. finalize();
  7698. });
  7699. req.on('response', function (res) {
  7700. clearTimeout(reqTimeout);
  7701. const headers = createHeadersLenient(res.headers);
  7702. // HTTP fetch step 5
  7703. if (fetch.isRedirect(res.statusCode)) {
  7704. // HTTP fetch step 5.2
  7705. const location = headers.get('Location');
  7706. // HTTP fetch step 5.3
  7707. const locationURL = location === null ? null : resolve_url(request.url, location);
  7708. // HTTP fetch step 5.5
  7709. switch (request.redirect) {
  7710. case 'error':
  7711. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7712. finalize();
  7713. return;
  7714. case 'manual':
  7715. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7716. if (locationURL !== null) {
  7717. // handle corrupted header
  7718. try {
  7719. headers.set('Location', locationURL);
  7720. } catch (err) {
  7721. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7722. reject(err);
  7723. }
  7724. }
  7725. break;
  7726. case 'follow':
  7727. // HTTP-redirect fetch step 2
  7728. if (locationURL === null) {
  7729. break;
  7730. }
  7731. // HTTP-redirect fetch step 5
  7732. if (request.counter >= request.follow) {
  7733. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7734. finalize();
  7735. return;
  7736. }
  7737. // HTTP-redirect fetch step 6 (counter increment)
  7738. // Create a new Request object.
  7739. const requestOpts = {
  7740. headers: new Headers(request.headers),
  7741. follow: request.follow,
  7742. counter: request.counter + 1,
  7743. agent: request.agent,
  7744. compress: request.compress,
  7745. method: request.method,
  7746. body: request.body,
  7747. signal: request.signal,
  7748. timeout: request.timeout
  7749. };
  7750. // HTTP-redirect fetch step 9
  7751. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7752. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7753. finalize();
  7754. return;
  7755. }
  7756. // HTTP-redirect fetch step 11
  7757. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7758. requestOpts.method = 'GET';
  7759. requestOpts.body = undefined;
  7760. requestOpts.headers.delete('content-length');
  7761. }
  7762. // HTTP-redirect fetch step 15
  7763. resolve(fetch(new Request(locationURL, requestOpts)));
  7764. finalize();
  7765. return;
  7766. }
  7767. }
  7768. // prepare response
  7769. res.once('end', function () {
  7770. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7771. });
  7772. let body = res.pipe(new PassThrough$1());
  7773. const response_options = {
  7774. url: request.url,
  7775. status: res.statusCode,
  7776. statusText: res.statusMessage,
  7777. headers: headers,
  7778. size: request.size,
  7779. timeout: request.timeout,
  7780. counter: request.counter
  7781. };
  7782. // HTTP-network fetch step 12.1.1.3
  7783. const codings = headers.get('Content-Encoding');
  7784. // HTTP-network fetch step 12.1.1.4: handle content codings
  7785. // in following scenarios we ignore compression support
  7786. // 1. compression support is disabled
  7787. // 2. HEAD request
  7788. // 3. no Content-Encoding header
  7789. // 4. no content response (204)
  7790. // 5. content not modified response (304)
  7791. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7792. response = new Response(body, response_options);
  7793. resolve(response);
  7794. return;
  7795. }
  7796. // For Node v6+
  7797. // Be less strict when decoding compressed responses, since sometimes
  7798. // servers send slightly invalid responses that are still accepted
  7799. // by common browsers.
  7800. // Always using Z_SYNC_FLUSH is what cURL does.
  7801. const zlibOptions = {
  7802. flush: zlib.Z_SYNC_FLUSH,
  7803. finishFlush: zlib.Z_SYNC_FLUSH
  7804. };
  7805. // for gzip
  7806. if (codings == 'gzip' || codings == 'x-gzip') {
  7807. body = body.pipe(zlib.createGunzip(zlibOptions));
  7808. response = new Response(body, response_options);
  7809. resolve(response);
  7810. return;
  7811. }
  7812. // for deflate
  7813. if (codings == 'deflate' || codings == 'x-deflate') {
  7814. // handle the infamous raw deflate response from old servers
  7815. // a hack for old IIS and Apache servers
  7816. const raw = res.pipe(new PassThrough$1());
  7817. raw.once('data', function (chunk) {
  7818. // see http://stackoverflow.com/questions/37519828
  7819. if ((chunk[0] & 0x0F) === 0x08) {
  7820. body = body.pipe(zlib.createInflate());
  7821. } else {
  7822. body = body.pipe(zlib.createInflateRaw());
  7823. }
  7824. response = new Response(body, response_options);
  7825. resolve(response);
  7826. });
  7827. return;
  7828. }
  7829. // for br
  7830. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7831. body = body.pipe(zlib.createBrotliDecompress());
  7832. response = new Response(body, response_options);
  7833. resolve(response);
  7834. return;
  7835. }
  7836. // otherwise, use response as-is
  7837. response = new Response(body, response_options);
  7838. resolve(response);
  7839. });
  7840. writeToStream(req, request);
  7841. });
  7842. }
  7843. /**
  7844. * Redirect code matching
  7845. *
  7846. * @param Number code Status code
  7847. * @return Boolean
  7848. */
  7849. fetch.isRedirect = function (code) {
  7850. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7851. };
  7852. // expose Promise
  7853. fetch.Promise = global.Promise;
  7854. module.exports = exports = fetch;
  7855. Object.defineProperty(exports, "__esModule", { value: true });
  7856. exports.default = exports;
  7857. exports.Headers = Headers;
  7858. exports.Request = Request;
  7859. exports.Response = Response;
  7860. exports.FetchError = FetchError;
  7861. /***/ }),
  7862. /***/ 462:
  7863. /***/ (function(module) {
  7864. "use strict";
  7865. // See http://www.robvanderwoude.com/escapechars.php
  7866. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7867. function escapeCommand(arg) {
  7868. // Escape meta chars
  7869. arg = arg.replace(metaCharsRegExp, '^$1');
  7870. return arg;
  7871. }
  7872. function escapeArgument(arg, doubleEscapeMetaChars) {
  7873. // Convert to string
  7874. arg = `${arg}`;
  7875. // Algorithm below is based on https://qntm.org/cmd
  7876. // Sequence of backslashes followed by a double quote:
  7877. // double up all the backslashes and escape the double quote
  7878. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7879. // Sequence of backslashes followed by the end of the string
  7880. // (which will become a double quote later):
  7881. // double up all the backslashes
  7882. arg = arg.replace(/(\\*)$/, '$1$1');
  7883. // All other backslashes occur literally
  7884. // Quote the whole thing:
  7885. arg = `"${arg}"`;
  7886. // Escape meta chars
  7887. arg = arg.replace(metaCharsRegExp, '^$1');
  7888. // Double escape meta chars if necessary
  7889. if (doubleEscapeMetaChars) {
  7890. arg = arg.replace(metaCharsRegExp, '^$1');
  7891. }
  7892. return arg;
  7893. }
  7894. module.exports.command = escapeCommand;
  7895. module.exports.argument = escapeArgument;
  7896. /***/ }),
  7897. /***/ 463:
  7898. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7899. "use strict";
  7900. Object.defineProperty(exports, '__esModule', { value: true });
  7901. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7902. var deprecation = __webpack_require__(692);
  7903. var once = _interopDefault(__webpack_require__(969));
  7904. const logOnce = once(deprecation => console.warn(deprecation));
  7905. /**
  7906. * Error with extra properties to help with debugging
  7907. */
  7908. class RequestError extends Error {
  7909. constructor(message, statusCode, options) {
  7910. super(message); // Maintains proper stack trace (only available on V8)
  7911. /* istanbul ignore next */
  7912. if (Error.captureStackTrace) {
  7913. Error.captureStackTrace(this, this.constructor);
  7914. }
  7915. this.name = "HttpError";
  7916. this.status = statusCode;
  7917. Object.defineProperty(this, "code", {
  7918. get() {
  7919. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7920. return statusCode;
  7921. }
  7922. });
  7923. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7924. const requestCopy = Object.assign({}, options.request);
  7925. if (options.request.headers.authorization) {
  7926. requestCopy.headers = Object.assign({}, options.request.headers, {
  7927. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7928. });
  7929. }
  7930. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7931. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7932. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7933. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7934. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7935. this.request = requestCopy;
  7936. }
  7937. }
  7938. exports.RequestError = RequestError;
  7939. //# sourceMappingURL=index.js.map
  7940. /***/ }),
  7941. /***/ 464:
  7942. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7943. "use strict";
  7944. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7945. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7946. return new (P || (P = Promise))(function (resolve, reject) {
  7947. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7948. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7949. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7950. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7951. });
  7952. };
  7953. var __importStar = (this && this.__importStar) || function (mod) {
  7954. if (mod && mod.__esModule) return mod;
  7955. var result = {};
  7956. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7957. result["default"] = mod;
  7958. return result;
  7959. };
  7960. var __importDefault = (this && this.__importDefault) || function (mod) {
  7961. return (mod && mod.__esModule) ? mod : { "default": mod };
  7962. };
  7963. Object.defineProperty(exports, "__esModule", { value: true });
  7964. const assert = __importStar(__webpack_require__(357));
  7965. const core = __importStar(__webpack_require__(470));
  7966. const fs = __importStar(__webpack_require__(747));
  7967. const github = __importStar(__webpack_require__(469));
  7968. const io = __importStar(__webpack_require__(1));
  7969. const path = __importStar(__webpack_require__(622));
  7970. const retryHelper = __importStar(__webpack_require__(587));
  7971. const toolCache = __importStar(__webpack_require__(533));
  7972. const v4_1 = __importDefault(__webpack_require__(826));
  7973. const IS_WINDOWS = process.platform === 'win32';
  7974. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  7975. return __awaiter(this, void 0, void 0, function* () {
  7976. // Download the archive
  7977. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7978. core.info('Downloading the archive');
  7979. return yield downloadArchive(authToken, owner, repo, ref, commit);
  7980. }));
  7981. // Write archive to disk
  7982. core.info('Writing archive to disk');
  7983. const uniqueId = v4_1.default();
  7984. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  7985. yield fs.promises.writeFile(archivePath, archiveData);
  7986. archiveData = Buffer.from(''); // Free memory
  7987. // Extract archive
  7988. core.info('Extracting the archive');
  7989. const extractPath = path.join(repositoryPath, uniqueId);
  7990. yield io.mkdirP(extractPath);
  7991. if (IS_WINDOWS) {
  7992. yield toolCache.extractZip(archivePath, extractPath);
  7993. }
  7994. else {
  7995. yield toolCache.extractTar(archivePath, extractPath);
  7996. }
  7997. io.rmRF(archivePath);
  7998. // Determine the path of the repository content. The archive contains
  7999. // a top-level folder and the repository content is inside.
  8000. const archiveFileNames = yield fs.promises.readdir(extractPath);
  8001. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  8002. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  8003. core.info(`Resolved version ${archiveVersion}`);
  8004. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  8005. // Move the files
  8006. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  8007. const sourcePath = path.join(tempRepositoryPath, fileName);
  8008. const targetPath = path.join(repositoryPath, fileName);
  8009. if (IS_WINDOWS) {
  8010. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  8011. }
  8012. else {
  8013. yield io.mv(sourcePath, targetPath);
  8014. }
  8015. }
  8016. io.rmRF(extractPath);
  8017. });
  8018. }
  8019. exports.downloadRepository = downloadRepository;
  8020. function downloadArchive(authToken, owner, repo, ref, commit) {
  8021. return __awaiter(this, void 0, void 0, function* () {
  8022. const octokit = new github.GitHub(authToken);
  8023. const params = {
  8024. owner: owner,
  8025. repo: repo,
  8026. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  8027. ref: commit || ref
  8028. };
  8029. const response = yield octokit.repos.getArchiveLink(params);
  8030. if (response.status != 200) {
  8031. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  8032. }
  8033. return Buffer.from(response.data); // response.data is ArrayBuffer
  8034. });
  8035. }
  8036. /***/ }),
  8037. /***/ 469:
  8038. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8039. "use strict";
  8040. var __importDefault = (this && this.__importDefault) || function (mod) {
  8041. return (mod && mod.__esModule) ? mod : { "default": mod };
  8042. };
  8043. var __importStar = (this && this.__importStar) || function (mod) {
  8044. if (mod && mod.__esModule) return mod;
  8045. var result = {};
  8046. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8047. result["default"] = mod;
  8048. return result;
  8049. };
  8050. Object.defineProperty(exports, "__esModule", { value: true });
  8051. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  8052. const graphql_1 = __webpack_require__(898);
  8053. const rest_1 = __importDefault(__webpack_require__(0));
  8054. const Context = __importStar(__webpack_require__(262));
  8055. const httpClient = __importStar(__webpack_require__(539));
  8056. // We need this in order to extend Octokit
  8057. rest_1.default.prototype = new rest_1.default();
  8058. exports.context = new Context.Context();
  8059. class GitHub extends rest_1.default {
  8060. constructor(token, opts) {
  8061. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  8062. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  8063. }
  8064. /**
  8065. * Disambiguates the constructor overload parameters
  8066. */
  8067. static disambiguate(token, opts) {
  8068. return [
  8069. typeof token === 'string' ? token : '',
  8070. typeof token === 'object' ? token : opts || {}
  8071. ];
  8072. }
  8073. static getOctokitOptions(args) {
  8074. const token = args[0];
  8075. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  8076. // Auth
  8077. const auth = GitHub.getAuthString(token, options);
  8078. if (auth) {
  8079. options.auth = auth;
  8080. }
  8081. // Proxy
  8082. const agent = GitHub.getProxyAgent(options);
  8083. if (agent) {
  8084. // Shallow clone - don't mutate the object provided by the caller
  8085. options.request = options.request ? Object.assign({}, options.request) : {};
  8086. // Set the agent
  8087. options.request.agent = agent;
  8088. }
  8089. return options;
  8090. }
  8091. static getGraphQL(args) {
  8092. const defaults = {};
  8093. const token = args[0];
  8094. const options = args[1];
  8095. // Authorization
  8096. const auth = this.getAuthString(token, options);
  8097. if (auth) {
  8098. defaults.headers = {
  8099. authorization: auth
  8100. };
  8101. }
  8102. // Proxy
  8103. const agent = GitHub.getProxyAgent(options);
  8104. if (agent) {
  8105. defaults.request = { agent };
  8106. }
  8107. return graphql_1.graphql.defaults(defaults);
  8108. }
  8109. static getAuthString(token, options) {
  8110. // Validate args
  8111. if (!token && !options.auth) {
  8112. throw new Error('Parameter token or opts.auth is required');
  8113. }
  8114. else if (token && options.auth) {
  8115. throw new Error('Parameters token and opts.auth may not both be specified');
  8116. }
  8117. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  8118. }
  8119. static getProxyAgent(options) {
  8120. var _a;
  8121. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  8122. const serverUrl = 'https://api.github.com';
  8123. if (httpClient.getProxyUrl(serverUrl)) {
  8124. const hc = new httpClient.HttpClient();
  8125. return hc.getAgent(serverUrl);
  8126. }
  8127. }
  8128. return undefined;
  8129. }
  8130. }
  8131. exports.GitHub = GitHub;
  8132. //# sourceMappingURL=github.js.map
  8133. /***/ }),
  8134. /***/ 470:
  8135. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8136. "use strict";
  8137. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8138. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8139. return new (P || (P = Promise))(function (resolve, reject) {
  8140. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8141. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8142. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8143. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8144. });
  8145. };
  8146. Object.defineProperty(exports, "__esModule", { value: true });
  8147. const command_1 = __webpack_require__(431);
  8148. const os = __webpack_require__(87);
  8149. const path = __webpack_require__(622);
  8150. /**
  8151. * The code to exit an action
  8152. */
  8153. var ExitCode;
  8154. (function (ExitCode) {
  8155. /**
  8156. * A code indicating that the action was successful
  8157. */
  8158. ExitCode[ExitCode["Success"] = 0] = "Success";
  8159. /**
  8160. * A code indicating that the action was a failure
  8161. */
  8162. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8163. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8164. //-----------------------------------------------------------------------
  8165. // Variables
  8166. //-----------------------------------------------------------------------
  8167. /**
  8168. * Sets env variable for this action and future actions in the job
  8169. * @param name the name of the variable to set
  8170. * @param val the value of the variable
  8171. */
  8172. function exportVariable(name, val) {
  8173. process.env[name] = val;
  8174. command_1.issueCommand('set-env', { name }, val);
  8175. }
  8176. exports.exportVariable = exportVariable;
  8177. /**
  8178. * Registers a secret which will get masked from logs
  8179. * @param secret value of the secret
  8180. */
  8181. function setSecret(secret) {
  8182. command_1.issueCommand('add-mask', {}, secret);
  8183. }
  8184. exports.setSecret = setSecret;
  8185. /**
  8186. * Prepends inputPath to the PATH (for this action and future actions)
  8187. * @param inputPath
  8188. */
  8189. function addPath(inputPath) {
  8190. command_1.issueCommand('add-path', {}, inputPath);
  8191. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8192. }
  8193. exports.addPath = addPath;
  8194. /**
  8195. * Gets the value of an input. The value is also trimmed.
  8196. *
  8197. * @param name name of the input to get
  8198. * @param options optional. See InputOptions.
  8199. * @returns string
  8200. */
  8201. function getInput(name, options) {
  8202. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8203. if (options && options.required && !val) {
  8204. throw new Error(`Input required and not supplied: ${name}`);
  8205. }
  8206. return val.trim();
  8207. }
  8208. exports.getInput = getInput;
  8209. /**
  8210. * Sets the value of an output.
  8211. *
  8212. * @param name name of the output to set
  8213. * @param value value to store
  8214. */
  8215. function setOutput(name, value) {
  8216. command_1.issueCommand('set-output', { name }, value);
  8217. }
  8218. exports.setOutput = setOutput;
  8219. //-----------------------------------------------------------------------
  8220. // Results
  8221. //-----------------------------------------------------------------------
  8222. /**
  8223. * Sets the action status to failed.
  8224. * When the action exits it will be with an exit code of 1
  8225. * @param message add error issue message
  8226. */
  8227. function setFailed(message) {
  8228. process.exitCode = ExitCode.Failure;
  8229. error(message);
  8230. }
  8231. exports.setFailed = setFailed;
  8232. //-----------------------------------------------------------------------
  8233. // Logging Commands
  8234. //-----------------------------------------------------------------------
  8235. /**
  8236. * Writes debug message to user log
  8237. * @param message debug message
  8238. */
  8239. function debug(message) {
  8240. command_1.issueCommand('debug', {}, message);
  8241. }
  8242. exports.debug = debug;
  8243. /**
  8244. * Adds an error issue
  8245. * @param message error issue message
  8246. */
  8247. function error(message) {
  8248. command_1.issue('error', message);
  8249. }
  8250. exports.error = error;
  8251. /**
  8252. * Adds an warning issue
  8253. * @param message warning issue message
  8254. */
  8255. function warning(message) {
  8256. command_1.issue('warning', message);
  8257. }
  8258. exports.warning = warning;
  8259. /**
  8260. * Writes info to log with console.log.
  8261. * @param message info message
  8262. */
  8263. function info(message) {
  8264. process.stdout.write(message + os.EOL);
  8265. }
  8266. exports.info = info;
  8267. /**
  8268. * Begin an output group.
  8269. *
  8270. * Output until the next `groupEnd` will be foldable in this group
  8271. *
  8272. * @param name The name of the output group
  8273. */
  8274. function startGroup(name) {
  8275. command_1.issue('group', name);
  8276. }
  8277. exports.startGroup = startGroup;
  8278. /**
  8279. * End an output group.
  8280. */
  8281. function endGroup() {
  8282. command_1.issue('endgroup');
  8283. }
  8284. exports.endGroup = endGroup;
  8285. /**
  8286. * Wrap an asynchronous function call in a group.
  8287. *
  8288. * Returns the same type as the function itself.
  8289. *
  8290. * @param name The name of the group
  8291. * @param fn The function to wrap in the group
  8292. */
  8293. function group(name, fn) {
  8294. return __awaiter(this, void 0, void 0, function* () {
  8295. startGroup(name);
  8296. let result;
  8297. try {
  8298. result = yield fn();
  8299. }
  8300. finally {
  8301. endGroup();
  8302. }
  8303. return result;
  8304. });
  8305. }
  8306. exports.group = group;
  8307. //# sourceMappingURL=core.js.map
  8308. /***/ }),
  8309. /***/ 471:
  8310. /***/ (function(module, __unusedexports, __webpack_require__) {
  8311. module.exports = authenticationBeforeRequest;
  8312. const btoa = __webpack_require__(675);
  8313. const uniq = __webpack_require__(126);
  8314. function authenticationBeforeRequest(state, options) {
  8315. if (!state.auth.type) {
  8316. return;
  8317. }
  8318. if (state.auth.type === "basic") {
  8319. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8320. options.headers.authorization = `Basic ${hash}`;
  8321. return;
  8322. }
  8323. if (state.auth.type === "token") {
  8324. options.headers.authorization = `token ${state.auth.token}`;
  8325. return;
  8326. }
  8327. if (state.auth.type === "app") {
  8328. options.headers.authorization = `Bearer ${state.auth.token}`;
  8329. const acceptHeaders = options.headers.accept
  8330. .split(",")
  8331. .concat("application/vnd.github.machine-man-preview+json");
  8332. options.headers.accept = uniq(acceptHeaders)
  8333. .filter(Boolean)
  8334. .join(",");
  8335. return;
  8336. }
  8337. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8338. if (state.auth.token) {
  8339. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8340. return;
  8341. }
  8342. const key = encodeURIComponent(state.auth.key);
  8343. const secret = encodeURIComponent(state.auth.secret);
  8344. options.url += `client_id=${key}&client_secret=${secret}`;
  8345. }
  8346. /***/ }),
  8347. /***/ 489:
  8348. /***/ (function(module, __unusedexports, __webpack_require__) {
  8349. "use strict";
  8350. const path = __webpack_require__(622);
  8351. const which = __webpack_require__(814);
  8352. const pathKey = __webpack_require__(39)();
  8353. function resolveCommandAttempt(parsed, withoutPathExt) {
  8354. const cwd = process.cwd();
  8355. const hasCustomCwd = parsed.options.cwd != null;
  8356. // If a custom `cwd` was specified, we need to change the process cwd
  8357. // because `which` will do stat calls but does not support a custom cwd
  8358. if (hasCustomCwd) {
  8359. try {
  8360. process.chdir(parsed.options.cwd);
  8361. } catch (err) {
  8362. /* Empty */
  8363. }
  8364. }
  8365. let resolved;
  8366. try {
  8367. resolved = which.sync(parsed.command, {
  8368. path: (parsed.options.env || process.env)[pathKey],
  8369. pathExt: withoutPathExt ? path.delimiter : undefined,
  8370. });
  8371. } catch (e) {
  8372. /* Empty */
  8373. } finally {
  8374. process.chdir(cwd);
  8375. }
  8376. // If we successfully resolved, ensure that an absolute path is returned
  8377. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8378. if (resolved) {
  8379. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8380. }
  8381. return resolved;
  8382. }
  8383. function resolveCommand(parsed) {
  8384. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8385. }
  8386. module.exports = resolveCommand;
  8387. /***/ }),
  8388. /***/ 510:
  8389. /***/ (function(module) {
  8390. module.exports = addHook
  8391. function addHook (state, kind, name, hook) {
  8392. var orig = hook
  8393. if (!state.registry[name]) {
  8394. state.registry[name] = []
  8395. }
  8396. if (kind === 'before') {
  8397. hook = function (method, options) {
  8398. return Promise.resolve()
  8399. .then(orig.bind(null, options))
  8400. .then(method.bind(null, options))
  8401. }
  8402. }
  8403. if (kind === 'after') {
  8404. hook = function (method, options) {
  8405. var result
  8406. return Promise.resolve()
  8407. .then(method.bind(null, options))
  8408. .then(function (result_) {
  8409. result = result_
  8410. return orig(result, options)
  8411. })
  8412. .then(function () {
  8413. return result
  8414. })
  8415. }
  8416. }
  8417. if (kind === 'error') {
  8418. hook = function (method, options) {
  8419. return Promise.resolve()
  8420. .then(method.bind(null, options))
  8421. .catch(function (error) {
  8422. return orig(error, options)
  8423. })
  8424. }
  8425. }
  8426. state.registry[name].push({
  8427. hook: hook,
  8428. orig: orig
  8429. })
  8430. }
  8431. /***/ }),
  8432. /***/ 523:
  8433. /***/ (function(module, __unusedexports, __webpack_require__) {
  8434. var register = __webpack_require__(363)
  8435. var addHook = __webpack_require__(510)
  8436. var removeHook = __webpack_require__(763)
  8437. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8438. var bind = Function.bind
  8439. var bindable = bind.bind(bind)
  8440. function bindApi (hook, state, name) {
  8441. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8442. hook.api = { remove: removeHookRef }
  8443. hook.remove = removeHookRef
  8444. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8445. var args = name ? [state, kind, name] : [state, kind]
  8446. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8447. })
  8448. }
  8449. function HookSingular () {
  8450. var singularHookName = 'h'
  8451. var singularHookState = {
  8452. registry: {}
  8453. }
  8454. var singularHook = register.bind(null, singularHookState, singularHookName)
  8455. bindApi(singularHook, singularHookState, singularHookName)
  8456. return singularHook
  8457. }
  8458. function HookCollection () {
  8459. var state = {
  8460. registry: {}
  8461. }
  8462. var hook = register.bind(null, state)
  8463. bindApi(hook, state)
  8464. return hook
  8465. }
  8466. var collectionHookDeprecationMessageDisplayed = false
  8467. function Hook () {
  8468. if (!collectionHookDeprecationMessageDisplayed) {
  8469. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8470. collectionHookDeprecationMessageDisplayed = true
  8471. }
  8472. return HookCollection()
  8473. }
  8474. Hook.Singular = HookSingular.bind()
  8475. Hook.Collection = HookCollection.bind()
  8476. module.exports = Hook
  8477. // expose constructors as a named property for TypeScript
  8478. module.exports.Hook = Hook
  8479. module.exports.Singular = Hook.Singular
  8480. module.exports.Collection = Hook.Collection
  8481. /***/ }),
  8482. /***/ 528:
  8483. /***/ (function(__unusedmodule, exports) {
  8484. "use strict";
  8485. Object.defineProperty(exports, "__esModule", { value: true });
  8486. function escape(value) {
  8487. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8488. return `\\${x}`;
  8489. });
  8490. }
  8491. exports.escape = escape;
  8492. /***/ }),
  8493. /***/ 529:
  8494. /***/ (function(module, __unusedexports, __webpack_require__) {
  8495. const factory = __webpack_require__(47);
  8496. module.exports = factory();
  8497. /***/ }),
  8498. /***/ 533:
  8499. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8500. "use strict";
  8501. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8502. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8503. return new (P || (P = Promise))(function (resolve, reject) {
  8504. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8505. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8506. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8507. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8508. });
  8509. };
  8510. Object.defineProperty(exports, "__esModule", { value: true });
  8511. const core = __webpack_require__(470);
  8512. const io = __webpack_require__(1);
  8513. const fs = __webpack_require__(747);
  8514. const os = __webpack_require__(87);
  8515. const path = __webpack_require__(622);
  8516. const httpm = __webpack_require__(874);
  8517. const semver = __webpack_require__(656);
  8518. const uuidV4 = __webpack_require__(826);
  8519. const exec_1 = __webpack_require__(986);
  8520. const assert_1 = __webpack_require__(357);
  8521. class HTTPError extends Error {
  8522. constructor(httpStatusCode) {
  8523. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8524. this.httpStatusCode = httpStatusCode;
  8525. Object.setPrototypeOf(this, new.target.prototype);
  8526. }
  8527. }
  8528. exports.HTTPError = HTTPError;
  8529. const IS_WINDOWS = process.platform === 'win32';
  8530. const userAgent = 'actions/tool-cache';
  8531. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8532. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8533. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8534. // If directories not found, place them in common temp locations
  8535. if (!tempDirectory || !cacheRoot) {
  8536. let baseLocation;
  8537. if (IS_WINDOWS) {
  8538. // On windows use the USERPROFILE env variable
  8539. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8540. }
  8541. else {
  8542. if (process.platform === 'darwin') {
  8543. baseLocation = '/Users';
  8544. }
  8545. else {
  8546. baseLocation = '/home';
  8547. }
  8548. }
  8549. if (!tempDirectory) {
  8550. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8551. }
  8552. if (!cacheRoot) {
  8553. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8554. }
  8555. }
  8556. /**
  8557. * Download a tool from an url and stream it into a file
  8558. *
  8559. * @param url url of tool to download
  8560. * @returns path to downloaded tool
  8561. */
  8562. function downloadTool(url) {
  8563. return __awaiter(this, void 0, void 0, function* () {
  8564. // Wrap in a promise so that we can resolve from within stream callbacks
  8565. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8566. try {
  8567. const http = new httpm.HttpClient(userAgent, [], {
  8568. allowRetries: true,
  8569. maxRetries: 3
  8570. });
  8571. const destPath = path.join(tempDirectory, uuidV4());
  8572. yield io.mkdirP(tempDirectory);
  8573. core.debug(`Downloading ${url}`);
  8574. core.debug(`Downloading ${destPath}`);
  8575. if (fs.existsSync(destPath)) {
  8576. throw new Error(`Destination file path ${destPath} already exists`);
  8577. }
  8578. const response = yield http.get(url);
  8579. if (response.message.statusCode !== 200) {
  8580. const err = new HTTPError(response.message.statusCode);
  8581. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8582. throw err;
  8583. }
  8584. const file = fs.createWriteStream(destPath);
  8585. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8586. try {
  8587. const stream = response.message.pipe(file);
  8588. stream.on('close', () => {
  8589. core.debug('download complete');
  8590. resolve(destPath);
  8591. });
  8592. }
  8593. catch (err) {
  8594. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8595. reject(err);
  8596. }
  8597. }));
  8598. file.on('error', err => {
  8599. file.end();
  8600. reject(err);
  8601. });
  8602. }
  8603. catch (err) {
  8604. reject(err);
  8605. }
  8606. }));
  8607. });
  8608. }
  8609. exports.downloadTool = downloadTool;
  8610. /**
  8611. * Extract a .7z file
  8612. *
  8613. * @param file path to the .7z file
  8614. * @param dest destination directory. Optional.
  8615. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8616. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8617. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8618. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8619. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8620. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8621. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8622. * to 7zr.exe can be pass to this function.
  8623. * @returns path to the destination directory
  8624. */
  8625. function extract7z(file, dest, _7zPath) {
  8626. return __awaiter(this, void 0, void 0, function* () {
  8627. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8628. assert_1.ok(file, 'parameter "file" is required');
  8629. dest = dest || (yield _createExtractFolder(dest));
  8630. const originalCwd = process.cwd();
  8631. process.chdir(dest);
  8632. if (_7zPath) {
  8633. try {
  8634. const args = [
  8635. 'x',
  8636. '-bb1',
  8637. '-bd',
  8638. '-sccUTF-8',
  8639. file
  8640. ];
  8641. const options = {
  8642. silent: true
  8643. };
  8644. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8645. }
  8646. finally {
  8647. process.chdir(originalCwd);
  8648. }
  8649. }
  8650. else {
  8651. const escapedScript = path
  8652. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8653. .replace(/'/g, "''")
  8654. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8655. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8656. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8657. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8658. const args = [
  8659. '-NoLogo',
  8660. '-Sta',
  8661. '-NoProfile',
  8662. '-NonInteractive',
  8663. '-ExecutionPolicy',
  8664. 'Unrestricted',
  8665. '-Command',
  8666. command
  8667. ];
  8668. const options = {
  8669. silent: true
  8670. };
  8671. try {
  8672. const powershellPath = yield io.which('powershell', true);
  8673. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8674. }
  8675. finally {
  8676. process.chdir(originalCwd);
  8677. }
  8678. }
  8679. return dest;
  8680. });
  8681. }
  8682. exports.extract7z = extract7z;
  8683. /**
  8684. * Extract a tar
  8685. *
  8686. * @param file path to the tar
  8687. * @param dest destination directory. Optional.
  8688. * @param flags flags for the tar. Optional.
  8689. * @returns path to the destination directory
  8690. */
  8691. function extractTar(file, dest, flags = 'xz') {
  8692. return __awaiter(this, void 0, void 0, function* () {
  8693. if (!file) {
  8694. throw new Error("parameter 'file' is required");
  8695. }
  8696. dest = dest || (yield _createExtractFolder(dest));
  8697. const tarPath = yield io.which('tar', true);
  8698. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8699. return dest;
  8700. });
  8701. }
  8702. exports.extractTar = extractTar;
  8703. /**
  8704. * Extract a zip
  8705. *
  8706. * @param file path to the zip
  8707. * @param dest destination directory. Optional.
  8708. * @returns path to the destination directory
  8709. */
  8710. function extractZip(file, dest) {
  8711. return __awaiter(this, void 0, void 0, function* () {
  8712. if (!file) {
  8713. throw new Error("parameter 'file' is required");
  8714. }
  8715. dest = dest || (yield _createExtractFolder(dest));
  8716. if (IS_WINDOWS) {
  8717. yield extractZipWin(file, dest);
  8718. }
  8719. else {
  8720. yield extractZipNix(file, dest);
  8721. }
  8722. return dest;
  8723. });
  8724. }
  8725. exports.extractZip = extractZip;
  8726. function extractZipWin(file, dest) {
  8727. return __awaiter(this, void 0, void 0, function* () {
  8728. // build the powershell command
  8729. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8730. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8731. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8732. // run powershell
  8733. const powershellPath = yield io.which('powershell');
  8734. const args = [
  8735. '-NoLogo',
  8736. '-Sta',
  8737. '-NoProfile',
  8738. '-NonInteractive',
  8739. '-ExecutionPolicy',
  8740. 'Unrestricted',
  8741. '-Command',
  8742. command
  8743. ];
  8744. yield exec_1.exec(`"${powershellPath}"`, args);
  8745. });
  8746. }
  8747. function extractZipNix(file, dest) {
  8748. return __awaiter(this, void 0, void 0, function* () {
  8749. const unzipPath = yield io.which('unzip');
  8750. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8751. });
  8752. }
  8753. /**
  8754. * Caches a directory and installs it into the tool cacheDir
  8755. *
  8756. * @param sourceDir the directory to cache into tools
  8757. * @param tool tool name
  8758. * @param version version of the tool. semver format
  8759. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8760. */
  8761. function cacheDir(sourceDir, tool, version, arch) {
  8762. return __awaiter(this, void 0, void 0, function* () {
  8763. version = semver.clean(version) || version;
  8764. arch = arch || os.arch();
  8765. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8766. core.debug(`source dir: ${sourceDir}`);
  8767. if (!fs.statSync(sourceDir).isDirectory()) {
  8768. throw new Error('sourceDir is not a directory');
  8769. }
  8770. // Create the tool dir
  8771. const destPath = yield _createToolPath(tool, version, arch);
  8772. // copy each child item. do not move. move can fail on Windows
  8773. // due to anti-virus software having an open handle on a file.
  8774. for (const itemName of fs.readdirSync(sourceDir)) {
  8775. const s = path.join(sourceDir, itemName);
  8776. yield io.cp(s, destPath, { recursive: true });
  8777. }
  8778. // write .complete
  8779. _completeToolPath(tool, version, arch);
  8780. return destPath;
  8781. });
  8782. }
  8783. exports.cacheDir = cacheDir;
  8784. /**
  8785. * Caches a downloaded file (GUID) and installs it
  8786. * into the tool cache with a given targetName
  8787. *
  8788. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8789. * @param targetFile the name of the file name in the tools directory
  8790. * @param tool tool name
  8791. * @param version version of the tool. semver format
  8792. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8793. */
  8794. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8795. return __awaiter(this, void 0, void 0, function* () {
  8796. version = semver.clean(version) || version;
  8797. arch = arch || os.arch();
  8798. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8799. core.debug(`source file: ${sourceFile}`);
  8800. if (!fs.statSync(sourceFile).isFile()) {
  8801. throw new Error('sourceFile is not a file');
  8802. }
  8803. // create the tool dir
  8804. const destFolder = yield _createToolPath(tool, version, arch);
  8805. // copy instead of move. move can fail on Windows due to
  8806. // anti-virus software having an open handle on a file.
  8807. const destPath = path.join(destFolder, targetFile);
  8808. core.debug(`destination file ${destPath}`);
  8809. yield io.cp(sourceFile, destPath);
  8810. // write .complete
  8811. _completeToolPath(tool, version, arch);
  8812. return destFolder;
  8813. });
  8814. }
  8815. exports.cacheFile = cacheFile;
  8816. /**
  8817. * Finds the path to a tool version in the local installed tool cache
  8818. *
  8819. * @param toolName name of the tool
  8820. * @param versionSpec version of the tool
  8821. * @param arch optional arch. defaults to arch of computer
  8822. */
  8823. function find(toolName, versionSpec, arch) {
  8824. if (!toolName) {
  8825. throw new Error('toolName parameter is required');
  8826. }
  8827. if (!versionSpec) {
  8828. throw new Error('versionSpec parameter is required');
  8829. }
  8830. arch = arch || os.arch();
  8831. // attempt to resolve an explicit version
  8832. if (!_isExplicitVersion(versionSpec)) {
  8833. const localVersions = findAllVersions(toolName, arch);
  8834. const match = _evaluateVersions(localVersions, versionSpec);
  8835. versionSpec = match;
  8836. }
  8837. // check for the explicit version in the cache
  8838. let toolPath = '';
  8839. if (versionSpec) {
  8840. versionSpec = semver.clean(versionSpec) || '';
  8841. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8842. core.debug(`checking cache: ${cachePath}`);
  8843. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8844. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8845. toolPath = cachePath;
  8846. }
  8847. else {
  8848. core.debug('not found');
  8849. }
  8850. }
  8851. return toolPath;
  8852. }
  8853. exports.find = find;
  8854. /**
  8855. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8856. *
  8857. * @param toolName name of the tool
  8858. * @param arch optional arch. defaults to arch of computer
  8859. */
  8860. function findAllVersions(toolName, arch) {
  8861. const versions = [];
  8862. arch = arch || os.arch();
  8863. const toolPath = path.join(cacheRoot, toolName);
  8864. if (fs.existsSync(toolPath)) {
  8865. const children = fs.readdirSync(toolPath);
  8866. for (const child of children) {
  8867. if (_isExplicitVersion(child)) {
  8868. const fullPath = path.join(toolPath, child, arch || '');
  8869. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8870. versions.push(child);
  8871. }
  8872. }
  8873. }
  8874. }
  8875. return versions;
  8876. }
  8877. exports.findAllVersions = findAllVersions;
  8878. function _createExtractFolder(dest) {
  8879. return __awaiter(this, void 0, void 0, function* () {
  8880. if (!dest) {
  8881. // create a temp dir
  8882. dest = path.join(tempDirectory, uuidV4());
  8883. }
  8884. yield io.mkdirP(dest);
  8885. return dest;
  8886. });
  8887. }
  8888. function _createToolPath(tool, version, arch) {
  8889. return __awaiter(this, void 0, void 0, function* () {
  8890. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8891. core.debug(`destination ${folderPath}`);
  8892. const markerPath = `${folderPath}.complete`;
  8893. yield io.rmRF(folderPath);
  8894. yield io.rmRF(markerPath);
  8895. yield io.mkdirP(folderPath);
  8896. return folderPath;
  8897. });
  8898. }
  8899. function _completeToolPath(tool, version, arch) {
  8900. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8901. const markerPath = `${folderPath}.complete`;
  8902. fs.writeFileSync(markerPath, '');
  8903. core.debug('finished caching tool');
  8904. }
  8905. function _isExplicitVersion(versionSpec) {
  8906. const c = semver.clean(versionSpec) || '';
  8907. core.debug(`isExplicit: ${c}`);
  8908. const valid = semver.valid(c) != null;
  8909. core.debug(`explicit? ${valid}`);
  8910. return valid;
  8911. }
  8912. function _evaluateVersions(versions, versionSpec) {
  8913. let version = '';
  8914. core.debug(`evaluating ${versions.length} versions`);
  8915. versions = versions.sort((a, b) => {
  8916. if (semver.gt(a, b)) {
  8917. return 1;
  8918. }
  8919. return -1;
  8920. });
  8921. for (let i = versions.length - 1; i >= 0; i--) {
  8922. const potential = versions[i];
  8923. const satisfied = semver.satisfies(potential, versionSpec);
  8924. if (satisfied) {
  8925. version = potential;
  8926. break;
  8927. }
  8928. }
  8929. if (version) {
  8930. core.debug(`matched: ${version}`);
  8931. }
  8932. else {
  8933. core.debug('match not found');
  8934. }
  8935. return version;
  8936. }
  8937. //# sourceMappingURL=tool-cache.js.map
  8938. /***/ }),
  8939. /***/ 536:
  8940. /***/ (function(module, __unusedexports, __webpack_require__) {
  8941. module.exports = hasFirstPage
  8942. const deprecate = __webpack_require__(370)
  8943. const getPageLinks = __webpack_require__(577)
  8944. function hasFirstPage (link) {
  8945. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8946. return getPageLinks(link).first
  8947. }
  8948. /***/ }),
  8949. /***/ 539:
  8950. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8951. "use strict";
  8952. Object.defineProperty(exports, "__esModule", { value: true });
  8953. const url = __webpack_require__(835);
  8954. const http = __webpack_require__(605);
  8955. const https = __webpack_require__(211);
  8956. const pm = __webpack_require__(950);
  8957. let tunnel;
  8958. var HttpCodes;
  8959. (function (HttpCodes) {
  8960. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  8961. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  8962. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  8963. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  8964. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  8965. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  8966. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  8967. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  8968. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  8969. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  8970. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  8971. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  8972. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  8973. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  8974. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  8975. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  8976. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  8977. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  8978. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  8979. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  8980. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  8981. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  8982. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  8983. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  8984. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  8985. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  8986. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  8987. /**
  8988. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  8989. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  8990. */
  8991. function getProxyUrl(serverUrl) {
  8992. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  8993. return proxyUrl ? proxyUrl.href : '';
  8994. }
  8995. exports.getProxyUrl = getProxyUrl;
  8996. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  8997. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  8998. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  8999. const ExponentialBackoffCeiling = 10;
  9000. const ExponentialBackoffTimeSlice = 5;
  9001. class HttpClientResponse {
  9002. constructor(message) {
  9003. this.message = message;
  9004. }
  9005. readBody() {
  9006. return new Promise(async (resolve, reject) => {
  9007. let output = Buffer.alloc(0);
  9008. this.message.on('data', (chunk) => {
  9009. output = Buffer.concat([output, chunk]);
  9010. });
  9011. this.message.on('end', () => {
  9012. resolve(output.toString());
  9013. });
  9014. });
  9015. }
  9016. }
  9017. exports.HttpClientResponse = HttpClientResponse;
  9018. function isHttps(requestUrl) {
  9019. let parsedUrl = url.parse(requestUrl);
  9020. return parsedUrl.protocol === 'https:';
  9021. }
  9022. exports.isHttps = isHttps;
  9023. class HttpClient {
  9024. constructor(userAgent, handlers, requestOptions) {
  9025. this._ignoreSslError = false;
  9026. this._allowRedirects = true;
  9027. this._allowRedirectDowngrade = false;
  9028. this._maxRedirects = 50;
  9029. this._allowRetries = false;
  9030. this._maxRetries = 1;
  9031. this._keepAlive = false;
  9032. this._disposed = false;
  9033. this.userAgent = userAgent;
  9034. this.handlers = handlers || [];
  9035. this.requestOptions = requestOptions;
  9036. if (requestOptions) {
  9037. if (requestOptions.ignoreSslError != null) {
  9038. this._ignoreSslError = requestOptions.ignoreSslError;
  9039. }
  9040. this._socketTimeout = requestOptions.socketTimeout;
  9041. if (requestOptions.allowRedirects != null) {
  9042. this._allowRedirects = requestOptions.allowRedirects;
  9043. }
  9044. if (requestOptions.allowRedirectDowngrade != null) {
  9045. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  9046. }
  9047. if (requestOptions.maxRedirects != null) {
  9048. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  9049. }
  9050. if (requestOptions.keepAlive != null) {
  9051. this._keepAlive = requestOptions.keepAlive;
  9052. }
  9053. if (requestOptions.allowRetries != null) {
  9054. this._allowRetries = requestOptions.allowRetries;
  9055. }
  9056. if (requestOptions.maxRetries != null) {
  9057. this._maxRetries = requestOptions.maxRetries;
  9058. }
  9059. }
  9060. }
  9061. options(requestUrl, additionalHeaders) {
  9062. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  9063. }
  9064. get(requestUrl, additionalHeaders) {
  9065. return this.request('GET', requestUrl, null, additionalHeaders || {});
  9066. }
  9067. del(requestUrl, additionalHeaders) {
  9068. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  9069. }
  9070. post(requestUrl, data, additionalHeaders) {
  9071. return this.request('POST', requestUrl, data, additionalHeaders || {});
  9072. }
  9073. patch(requestUrl, data, additionalHeaders) {
  9074. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  9075. }
  9076. put(requestUrl, data, additionalHeaders) {
  9077. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  9078. }
  9079. head(requestUrl, additionalHeaders) {
  9080. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  9081. }
  9082. sendStream(verb, requestUrl, stream, additionalHeaders) {
  9083. return this.request(verb, requestUrl, stream, additionalHeaders);
  9084. }
  9085. /**
  9086. * Makes a raw http request.
  9087. * All other methods such as get, post, patch, and request ultimately call this.
  9088. * Prefer get, del, post and patch
  9089. */
  9090. async request(verb, requestUrl, data, headers) {
  9091. if (this._disposed) {
  9092. throw new Error("Client has already been disposed.");
  9093. }
  9094. let parsedUrl = url.parse(requestUrl);
  9095. let info = this._prepareRequest(verb, parsedUrl, headers);
  9096. // Only perform retries on reads since writes may not be idempotent.
  9097. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  9098. let numTries = 0;
  9099. let response;
  9100. while (numTries < maxTries) {
  9101. response = await this.requestRaw(info, data);
  9102. // Check if it's an authentication challenge
  9103. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  9104. let authenticationHandler;
  9105. for (let i = 0; i < this.handlers.length; i++) {
  9106. if (this.handlers[i].canHandleAuthentication(response)) {
  9107. authenticationHandler = this.handlers[i];
  9108. break;
  9109. }
  9110. }
  9111. if (authenticationHandler) {
  9112. return authenticationHandler.handleAuthentication(this, info, data);
  9113. }
  9114. else {
  9115. // We have received an unauthorized response but have no handlers to handle it.
  9116. // Let the response return to the caller.
  9117. return response;
  9118. }
  9119. }
  9120. let redirectsRemaining = this._maxRedirects;
  9121. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  9122. && this._allowRedirects
  9123. && redirectsRemaining > 0) {
  9124. const redirectUrl = response.message.headers["location"];
  9125. if (!redirectUrl) {
  9126. // if there's no location to redirect to, we won't
  9127. break;
  9128. }
  9129. let parsedRedirectUrl = url.parse(redirectUrl);
  9130. if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
  9131. 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.");
  9132. }
  9133. // we need to finish reading the response before reassigning response
  9134. // which will leak the open socket.
  9135. await response.readBody();
  9136. // let's make the request with the new redirectUrl
  9137. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  9138. response = await this.requestRaw(info, data);
  9139. redirectsRemaining--;
  9140. }
  9141. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  9142. // If not a retry code, return immediately instead of retrying
  9143. return response;
  9144. }
  9145. numTries += 1;
  9146. if (numTries < maxTries) {
  9147. await response.readBody();
  9148. await this._performExponentialBackoff(numTries);
  9149. }
  9150. }
  9151. return response;
  9152. }
  9153. /**
  9154. * Needs to be called if keepAlive is set to true in request options.
  9155. */
  9156. dispose() {
  9157. if (this._agent) {
  9158. this._agent.destroy();
  9159. }
  9160. this._disposed = true;
  9161. }
  9162. /**
  9163. * Raw request.
  9164. * @param info
  9165. * @param data
  9166. */
  9167. requestRaw(info, data) {
  9168. return new Promise((resolve, reject) => {
  9169. let callbackForResult = function (err, res) {
  9170. if (err) {
  9171. reject(err);
  9172. }
  9173. resolve(res);
  9174. };
  9175. this.requestRawWithCallback(info, data, callbackForResult);
  9176. });
  9177. }
  9178. /**
  9179. * Raw request with callback.
  9180. * @param info
  9181. * @param data
  9182. * @param onResult
  9183. */
  9184. requestRawWithCallback(info, data, onResult) {
  9185. let socket;
  9186. if (typeof (data) === 'string') {
  9187. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  9188. }
  9189. let callbackCalled = false;
  9190. let handleResult = (err, res) => {
  9191. if (!callbackCalled) {
  9192. callbackCalled = true;
  9193. onResult(err, res);
  9194. }
  9195. };
  9196. let req = info.httpModule.request(info.options, (msg) => {
  9197. let res = new HttpClientResponse(msg);
  9198. handleResult(null, res);
  9199. });
  9200. req.on('socket', (sock) => {
  9201. socket = sock;
  9202. });
  9203. // If we ever get disconnected, we want the socket to timeout eventually
  9204. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9205. if (socket) {
  9206. socket.end();
  9207. }
  9208. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9209. });
  9210. req.on('error', function (err) {
  9211. // err has statusCode property
  9212. // res should have headers
  9213. handleResult(err, null);
  9214. });
  9215. if (data && typeof (data) === 'string') {
  9216. req.write(data, 'utf8');
  9217. }
  9218. if (data && typeof (data) !== 'string') {
  9219. data.on('close', function () {
  9220. req.end();
  9221. });
  9222. data.pipe(req);
  9223. }
  9224. else {
  9225. req.end();
  9226. }
  9227. }
  9228. /**
  9229. * Gets an http agent. This function is useful when you need an http agent that handles
  9230. * routing through a proxy server - depending upon the url and proxy environment variables.
  9231. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9232. */
  9233. getAgent(serverUrl) {
  9234. let parsedUrl = url.parse(serverUrl);
  9235. return this._getAgent(parsedUrl);
  9236. }
  9237. _prepareRequest(method, requestUrl, headers) {
  9238. const info = {};
  9239. info.parsedUrl = requestUrl;
  9240. const usingSsl = info.parsedUrl.protocol === 'https:';
  9241. info.httpModule = usingSsl ? https : http;
  9242. const defaultPort = usingSsl ? 443 : 80;
  9243. info.options = {};
  9244. info.options.host = info.parsedUrl.hostname;
  9245. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  9246. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9247. info.options.method = method;
  9248. info.options.headers = this._mergeHeaders(headers);
  9249. if (this.userAgent != null) {
  9250. info.options.headers["user-agent"] = this.userAgent;
  9251. }
  9252. info.options.agent = this._getAgent(info.parsedUrl);
  9253. // gives handlers an opportunity to participate
  9254. if (this.handlers) {
  9255. this.handlers.forEach((handler) => {
  9256. handler.prepareRequest(info.options);
  9257. });
  9258. }
  9259. return info;
  9260. }
  9261. _mergeHeaders(headers) {
  9262. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  9263. if (this.requestOptions && this.requestOptions.headers) {
  9264. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9265. }
  9266. return lowercaseKeys(headers || {});
  9267. }
  9268. _getAgent(parsedUrl) {
  9269. let agent;
  9270. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9271. let useProxy = proxyUrl && proxyUrl.hostname;
  9272. if (this._keepAlive && useProxy) {
  9273. agent = this._proxyAgent;
  9274. }
  9275. if (this._keepAlive && !useProxy) {
  9276. agent = this._agent;
  9277. }
  9278. // if agent is already assigned use that agent.
  9279. if (!!agent) {
  9280. return agent;
  9281. }
  9282. const usingSsl = parsedUrl.protocol === 'https:';
  9283. let maxSockets = 100;
  9284. if (!!this.requestOptions) {
  9285. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9286. }
  9287. if (useProxy) {
  9288. // If using proxy, need tunnel
  9289. if (!tunnel) {
  9290. tunnel = __webpack_require__(335);
  9291. }
  9292. const agentOptions = {
  9293. maxSockets: maxSockets,
  9294. keepAlive: this._keepAlive,
  9295. proxy: {
  9296. proxyAuth: proxyUrl.auth,
  9297. host: proxyUrl.hostname,
  9298. port: proxyUrl.port
  9299. },
  9300. };
  9301. let tunnelAgent;
  9302. const overHttps = proxyUrl.protocol === 'https:';
  9303. if (usingSsl) {
  9304. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9305. }
  9306. else {
  9307. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9308. }
  9309. agent = tunnelAgent(agentOptions);
  9310. this._proxyAgent = agent;
  9311. }
  9312. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9313. if (this._keepAlive && !agent) {
  9314. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9315. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9316. this._agent = agent;
  9317. }
  9318. // if not using private agent and tunnel agent isn't setup then use global agent
  9319. if (!agent) {
  9320. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9321. }
  9322. if (usingSsl && this._ignoreSslError) {
  9323. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9324. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9325. // we have to cast it to any and change it directly
  9326. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  9327. }
  9328. return agent;
  9329. }
  9330. _performExponentialBackoff(retryNumber) {
  9331. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9332. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9333. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9334. }
  9335. }
  9336. exports.HttpClient = HttpClient;
  9337. /***/ }),
  9338. /***/ 550:
  9339. /***/ (function(module, __unusedexports, __webpack_require__) {
  9340. module.exports = getNextPage
  9341. const getPage = __webpack_require__(265)
  9342. function getNextPage (octokit, link, headers) {
  9343. return getPage(octokit, link, 'next', headers)
  9344. }
  9345. /***/ }),
  9346. /***/ 558:
  9347. /***/ (function(module, __unusedexports, __webpack_require__) {
  9348. module.exports = hasPreviousPage
  9349. const deprecate = __webpack_require__(370)
  9350. const getPageLinks = __webpack_require__(577)
  9351. function hasPreviousPage (link) {
  9352. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9353. return getPageLinks(link).prev
  9354. }
  9355. /***/ }),
  9356. /***/ 559:
  9357. /***/ (function(__unusedmodule, exports) {
  9358. "use strict";
  9359. Object.defineProperty(exports, "__esModule", { value: true });
  9360. class GitVersion {
  9361. /**
  9362. * Used for comparing the version of git and git-lfs against the minimum required version
  9363. * @param version the version string, e.g. 1.2 or 1.2.3
  9364. */
  9365. constructor(version) {
  9366. this.major = NaN;
  9367. this.minor = NaN;
  9368. this.patch = NaN;
  9369. if (version) {
  9370. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9371. if (match) {
  9372. this.major = Number(match[1]);
  9373. this.minor = Number(match[2]);
  9374. if (match[4]) {
  9375. this.patch = Number(match[4]);
  9376. }
  9377. }
  9378. }
  9379. }
  9380. /**
  9381. * Compares the instance against a minimum required version
  9382. * @param minimum Minimum version
  9383. */
  9384. checkMinimum(minimum) {
  9385. if (!minimum.isValid()) {
  9386. throw new Error('Arg minimum is not a valid version');
  9387. }
  9388. // Major is insufficient
  9389. if (this.major < minimum.major) {
  9390. return false;
  9391. }
  9392. // Major is equal
  9393. if (this.major === minimum.major) {
  9394. // Minor is insufficient
  9395. if (this.minor < minimum.minor) {
  9396. return false;
  9397. }
  9398. // Minor is equal
  9399. if (this.minor === minimum.minor) {
  9400. // Patch is insufficient
  9401. if (this.patch && this.patch < (minimum.patch || 0)) {
  9402. return false;
  9403. }
  9404. }
  9405. }
  9406. return true;
  9407. }
  9408. /**
  9409. * Indicates whether the instance was constructed from a valid version string
  9410. */
  9411. isValid() {
  9412. return !isNaN(this.major);
  9413. }
  9414. /**
  9415. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9416. */
  9417. toString() {
  9418. let result = '';
  9419. if (this.isValid()) {
  9420. result = `${this.major}.${this.minor}`;
  9421. if (!isNaN(this.patch)) {
  9422. result += `.${this.patch}`;
  9423. }
  9424. }
  9425. return result;
  9426. }
  9427. }
  9428. exports.GitVersion = GitVersion;
  9429. /***/ }),
  9430. /***/ 562:
  9431. /***/ (function(module, __unusedexports, __webpack_require__) {
  9432. var once = __webpack_require__(969);
  9433. var noop = function() {};
  9434. var isRequest = function(stream) {
  9435. return stream.setHeader && typeof stream.abort === 'function';
  9436. };
  9437. var isChildProcess = function(stream) {
  9438. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9439. };
  9440. var eos = function(stream, opts, callback) {
  9441. if (typeof opts === 'function') return eos(stream, null, opts);
  9442. if (!opts) opts = {};
  9443. callback = once(callback || noop);
  9444. var ws = stream._writableState;
  9445. var rs = stream._readableState;
  9446. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9447. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9448. var cancelled = false;
  9449. var onlegacyfinish = function() {
  9450. if (!stream.writable) onfinish();
  9451. };
  9452. var onfinish = function() {
  9453. writable = false;
  9454. if (!readable) callback.call(stream);
  9455. };
  9456. var onend = function() {
  9457. readable = false;
  9458. if (!writable) callback.call(stream);
  9459. };
  9460. var onexit = function(exitCode) {
  9461. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9462. };
  9463. var onerror = function(err) {
  9464. callback.call(stream, err);
  9465. };
  9466. var onclose = function() {
  9467. process.nextTick(onclosenexttick);
  9468. };
  9469. var onclosenexttick = function() {
  9470. if (cancelled) return;
  9471. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9472. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9473. };
  9474. var onrequest = function() {
  9475. stream.req.on('finish', onfinish);
  9476. };
  9477. if (isRequest(stream)) {
  9478. stream.on('complete', onfinish);
  9479. stream.on('abort', onclose);
  9480. if (stream.req) onrequest();
  9481. else stream.on('request', onrequest);
  9482. } else if (writable && !ws) { // legacy streams
  9483. stream.on('end', onlegacyfinish);
  9484. stream.on('close', onlegacyfinish);
  9485. }
  9486. if (isChildProcess(stream)) stream.on('exit', onexit);
  9487. stream.on('end', onend);
  9488. stream.on('finish', onfinish);
  9489. if (opts.error !== false) stream.on('error', onerror);
  9490. stream.on('close', onclose);
  9491. return function() {
  9492. cancelled = true;
  9493. stream.removeListener('complete', onfinish);
  9494. stream.removeListener('abort', onclose);
  9495. stream.removeListener('request', onrequest);
  9496. if (stream.req) stream.req.removeListener('finish', onfinish);
  9497. stream.removeListener('end', onlegacyfinish);
  9498. stream.removeListener('close', onlegacyfinish);
  9499. stream.removeListener('finish', onfinish);
  9500. stream.removeListener('exit', onexit);
  9501. stream.removeListener('end', onend);
  9502. stream.removeListener('error', onerror);
  9503. stream.removeListener('close', onclose);
  9504. };
  9505. };
  9506. module.exports = eos;
  9507. /***/ }),
  9508. /***/ 563:
  9509. /***/ (function(module, __unusedexports, __webpack_require__) {
  9510. module.exports = getPreviousPage
  9511. const getPage = __webpack_require__(265)
  9512. function getPreviousPage (octokit, link, headers) {
  9513. return getPage(octokit, link, 'prev', headers)
  9514. }
  9515. /***/ }),
  9516. /***/ 568:
  9517. /***/ (function(module, __unusedexports, __webpack_require__) {
  9518. "use strict";
  9519. const path = __webpack_require__(622);
  9520. const niceTry = __webpack_require__(948);
  9521. const resolveCommand = __webpack_require__(489);
  9522. const escape = __webpack_require__(462);
  9523. const readShebang = __webpack_require__(389);
  9524. const semver = __webpack_require__(280);
  9525. const isWin = process.platform === 'win32';
  9526. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9527. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9528. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9529. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9530. function detectShebang(parsed) {
  9531. parsed.file = resolveCommand(parsed);
  9532. const shebang = parsed.file && readShebang(parsed.file);
  9533. if (shebang) {
  9534. parsed.args.unshift(parsed.file);
  9535. parsed.command = shebang;
  9536. return resolveCommand(parsed);
  9537. }
  9538. return parsed.file;
  9539. }
  9540. function parseNonShell(parsed) {
  9541. if (!isWin) {
  9542. return parsed;
  9543. }
  9544. // Detect & add support for shebangs
  9545. const commandFile = detectShebang(parsed);
  9546. // We don't need a shell if the command filename is an executable
  9547. const needsShell = !isExecutableRegExp.test(commandFile);
  9548. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9549. // Note that `forceShell` is an hidden option used only in tests
  9550. if (parsed.options.forceShell || needsShell) {
  9551. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9552. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9553. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9554. // we need to double escape them
  9555. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9556. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9557. // This is necessary otherwise it will always fail with ENOENT in those cases
  9558. parsed.command = path.normalize(parsed.command);
  9559. // Escape command & arguments
  9560. parsed.command = escape.command(parsed.command);
  9561. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9562. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9563. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9564. parsed.command = process.env.comspec || 'cmd.exe';
  9565. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9566. }
  9567. return parsed;
  9568. }
  9569. function parseShell(parsed) {
  9570. // If node supports the shell option, there's no need to mimic its behavior
  9571. if (supportsShellOption) {
  9572. return parsed;
  9573. }
  9574. // Mimic node shell option
  9575. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9576. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9577. if (isWin) {
  9578. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9579. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9580. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9581. } else {
  9582. if (typeof parsed.options.shell === 'string') {
  9583. parsed.command = parsed.options.shell;
  9584. } else if (process.platform === 'android') {
  9585. parsed.command = '/system/bin/sh';
  9586. } else {
  9587. parsed.command = '/bin/sh';
  9588. }
  9589. parsed.args = ['-c', shellCommand];
  9590. }
  9591. return parsed;
  9592. }
  9593. function parse(command, args, options) {
  9594. // Normalize arguments, similar to nodejs
  9595. if (args && !Array.isArray(args)) {
  9596. options = args;
  9597. args = null;
  9598. }
  9599. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9600. options = Object.assign({}, options); // Clone object to avoid changing the original
  9601. // Build our parsed object
  9602. const parsed = {
  9603. command,
  9604. args,
  9605. options,
  9606. file: undefined,
  9607. original: {
  9608. command,
  9609. args,
  9610. },
  9611. };
  9612. // Delegate further parsing to shell or non-shell
  9613. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9614. }
  9615. module.exports = parse;
  9616. /***/ }),
  9617. /***/ 577:
  9618. /***/ (function(module) {
  9619. module.exports = getPageLinks
  9620. function getPageLinks (link) {
  9621. link = link.link || link.headers.link || ''
  9622. const links = {}
  9623. // link format:
  9624. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9625. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9626. links[type] = uri
  9627. })
  9628. return links
  9629. }
  9630. /***/ }),
  9631. /***/ 586:
  9632. /***/ (function(module, __unusedexports, __webpack_require__) {
  9633. module.exports = octokitRestApiEndpoints;
  9634. const ROUTES = __webpack_require__(705);
  9635. function octokitRestApiEndpoints(octokit) {
  9636. // Aliasing scopes for backward compatibility
  9637. // See https://github.com/octokit/rest.js/pull/1134
  9638. ROUTES.gitdata = ROUTES.git;
  9639. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9640. ROUTES.pullRequests = ROUTES.pulls;
  9641. octokit.registerEndpoints(ROUTES);
  9642. }
  9643. /***/ }),
  9644. /***/ 587:
  9645. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9646. "use strict";
  9647. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9648. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9649. return new (P || (P = Promise))(function (resolve, reject) {
  9650. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9651. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9652. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9653. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9654. });
  9655. };
  9656. var __importStar = (this && this.__importStar) || function (mod) {
  9657. if (mod && mod.__esModule) return mod;
  9658. var result = {};
  9659. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9660. result["default"] = mod;
  9661. return result;
  9662. };
  9663. Object.defineProperty(exports, "__esModule", { value: true });
  9664. const core = __importStar(__webpack_require__(470));
  9665. const defaultMaxAttempts = 3;
  9666. const defaultMinSeconds = 10;
  9667. const defaultMaxSeconds = 20;
  9668. class RetryHelper {
  9669. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9670. this.maxAttempts = maxAttempts;
  9671. this.minSeconds = Math.floor(minSeconds);
  9672. this.maxSeconds = Math.floor(maxSeconds);
  9673. if (this.minSeconds > this.maxSeconds) {
  9674. throw new Error('min seconds should be less than or equal to max seconds');
  9675. }
  9676. }
  9677. execute(action) {
  9678. return __awaiter(this, void 0, void 0, function* () {
  9679. let attempt = 1;
  9680. while (attempt < this.maxAttempts) {
  9681. // Try
  9682. try {
  9683. return yield action();
  9684. }
  9685. catch (err) {
  9686. core.info(err.message);
  9687. }
  9688. // Sleep
  9689. const seconds = this.getSleepAmount();
  9690. core.info(`Waiting ${seconds} seconds before trying again`);
  9691. yield this.sleep(seconds);
  9692. attempt++;
  9693. }
  9694. // Last attempt
  9695. return yield action();
  9696. });
  9697. }
  9698. getSleepAmount() {
  9699. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9700. this.minSeconds);
  9701. }
  9702. sleep(seconds) {
  9703. return __awaiter(this, void 0, void 0, function* () {
  9704. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9705. });
  9706. }
  9707. }
  9708. exports.RetryHelper = RetryHelper;
  9709. function execute(action) {
  9710. return __awaiter(this, void 0, void 0, function* () {
  9711. const retryHelper = new RetryHelper();
  9712. return yield retryHelper.execute(action);
  9713. });
  9714. }
  9715. exports.execute = execute;
  9716. /***/ }),
  9717. /***/ 605:
  9718. /***/ (function(module) {
  9719. module.exports = require("http");
  9720. /***/ }),
  9721. /***/ 614:
  9722. /***/ (function(module) {
  9723. module.exports = require("events");
  9724. /***/ }),
  9725. /***/ 618:
  9726. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9727. "use strict";
  9728. var __importStar = (this && this.__importStar) || function (mod) {
  9729. if (mod && mod.__esModule) return mod;
  9730. var result = {};
  9731. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9732. result["default"] = mod;
  9733. return result;
  9734. };
  9735. Object.defineProperty(exports, "__esModule", { value: true });
  9736. const fs = __importStar(__webpack_require__(747));
  9737. function directoryExistsSync(path, required) {
  9738. if (!path) {
  9739. throw new Error("Arg 'path' must not be empty");
  9740. }
  9741. let stats;
  9742. try {
  9743. stats = fs.statSync(path);
  9744. }
  9745. catch (error) {
  9746. if (error.code === 'ENOENT') {
  9747. if (!required) {
  9748. return false;
  9749. }
  9750. throw new Error(`Directory '${path}' does not exist`);
  9751. }
  9752. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9753. }
  9754. if (stats.isDirectory()) {
  9755. return true;
  9756. }
  9757. else if (!required) {
  9758. return false;
  9759. }
  9760. throw new Error(`Directory '${path}' does not exist`);
  9761. }
  9762. exports.directoryExistsSync = directoryExistsSync;
  9763. function existsSync(path) {
  9764. if (!path) {
  9765. throw new Error("Arg 'path' must not be empty");
  9766. }
  9767. try {
  9768. fs.statSync(path);
  9769. }
  9770. catch (error) {
  9771. if (error.code === 'ENOENT') {
  9772. return false;
  9773. }
  9774. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9775. }
  9776. return true;
  9777. }
  9778. exports.existsSync = existsSync;
  9779. function fileExistsSync(path) {
  9780. if (!path) {
  9781. throw new Error("Arg 'path' must not be empty");
  9782. }
  9783. let stats;
  9784. try {
  9785. stats = fs.statSync(path);
  9786. }
  9787. catch (error) {
  9788. if (error.code === 'ENOENT') {
  9789. return false;
  9790. }
  9791. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9792. }
  9793. if (!stats.isDirectory()) {
  9794. return true;
  9795. }
  9796. return false;
  9797. }
  9798. exports.fileExistsSync = fileExistsSync;
  9799. /***/ }),
  9800. /***/ 621:
  9801. /***/ (function(module, __unusedexports, __webpack_require__) {
  9802. "use strict";
  9803. const path = __webpack_require__(622);
  9804. const pathKey = __webpack_require__(39);
  9805. module.exports = opts => {
  9806. opts = Object.assign({
  9807. cwd: process.cwd(),
  9808. path: process.env[pathKey()]
  9809. }, opts);
  9810. let prev;
  9811. let pth = path.resolve(opts.cwd);
  9812. const ret = [];
  9813. while (prev !== pth) {
  9814. ret.push(path.join(pth, 'node_modules/.bin'));
  9815. prev = pth;
  9816. pth = path.resolve(pth, '..');
  9817. }
  9818. // ensure the running `node` binary is used
  9819. ret.push(path.dirname(process.execPath));
  9820. return ret.concat(opts.path).join(path.delimiter);
  9821. };
  9822. module.exports.env = opts => {
  9823. opts = Object.assign({
  9824. env: process.env
  9825. }, opts);
  9826. const env = Object.assign({}, opts.env);
  9827. const path = pathKey({env});
  9828. opts.path = env[path];
  9829. env[path] = module.exports(opts);
  9830. return env;
  9831. };
  9832. /***/ }),
  9833. /***/ 622:
  9834. /***/ (function(module) {
  9835. module.exports = require("path");
  9836. /***/ }),
  9837. /***/ 631:
  9838. /***/ (function(module) {
  9839. module.exports = require("net");
  9840. /***/ }),
  9841. /***/ 649:
  9842. /***/ (function(module, __unusedexports, __webpack_require__) {
  9843. module.exports = getLastPage
  9844. const getPage = __webpack_require__(265)
  9845. function getLastPage (octokit, link, headers) {
  9846. return getPage(octokit, link, 'last', headers)
  9847. }
  9848. /***/ }),
  9849. /***/ 654:
  9850. /***/ (function(module) {
  9851. // This is not the set of all possible signals.
  9852. //
  9853. // It IS, however, the set of all signals that trigger
  9854. // an exit on either Linux or BSD systems. Linux is a
  9855. // superset of the signal names supported on BSD, and
  9856. // the unknown signals just fail to register, so we can
  9857. // catch that easily enough.
  9858. //
  9859. // Don't bother with SIGKILL. It's uncatchable, which
  9860. // means that we can't fire any callbacks anyway.
  9861. //
  9862. // If a user does happen to register a handler on a non-
  9863. // fatal signal like SIGWINCH or something, and then
  9864. // exit, it'll end up firing `process.emit('exit')`, so
  9865. // the handler will be fired anyway.
  9866. //
  9867. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9868. // artificially, inherently leave the process in a
  9869. // state from which it is not safe to try and enter JS
  9870. // listeners.
  9871. module.exports = [
  9872. 'SIGABRT',
  9873. 'SIGALRM',
  9874. 'SIGHUP',
  9875. 'SIGINT',
  9876. 'SIGTERM'
  9877. ]
  9878. if (process.platform !== 'win32') {
  9879. module.exports.push(
  9880. 'SIGVTALRM',
  9881. 'SIGXCPU',
  9882. 'SIGXFSZ',
  9883. 'SIGUSR2',
  9884. 'SIGTRAP',
  9885. 'SIGSYS',
  9886. 'SIGQUIT',
  9887. 'SIGIOT'
  9888. // should detect profiler and enable/disable accordingly.
  9889. // see #21
  9890. // 'SIGPROF'
  9891. )
  9892. }
  9893. if (process.platform === 'linux') {
  9894. module.exports.push(
  9895. 'SIGIO',
  9896. 'SIGPOLL',
  9897. 'SIGPWR',
  9898. 'SIGSTKFLT',
  9899. 'SIGUNUSED'
  9900. )
  9901. }
  9902. /***/ }),
  9903. /***/ 656:
  9904. /***/ (function(module, exports) {
  9905. exports = module.exports = SemVer
  9906. var debug
  9907. /* istanbul ignore next */
  9908. if (typeof process === 'object' &&
  9909. process.env &&
  9910. process.env.NODE_DEBUG &&
  9911. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9912. debug = function () {
  9913. var args = Array.prototype.slice.call(arguments, 0)
  9914. args.unshift('SEMVER')
  9915. console.log.apply(console, args)
  9916. }
  9917. } else {
  9918. debug = function () {}
  9919. }
  9920. // Note: this is the semver.org version of the spec that it implements
  9921. // Not necessarily the package version of this code.
  9922. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9923. var MAX_LENGTH = 256
  9924. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9925. /* istanbul ignore next */ 9007199254740991
  9926. // Max safe segment length for coercion.
  9927. var MAX_SAFE_COMPONENT_LENGTH = 16
  9928. // The actual regexps go on exports.re
  9929. var re = exports.re = []
  9930. var src = exports.src = []
  9931. var t = exports.tokens = {}
  9932. var R = 0
  9933. function tok (n) {
  9934. t[n] = R++
  9935. }
  9936. // The following Regular Expressions can be used for tokenizing,
  9937. // validating, and parsing SemVer version strings.
  9938. // ## Numeric Identifier
  9939. // A single `0`, or a non-zero digit followed by zero or more digits.
  9940. tok('NUMERICIDENTIFIER')
  9941. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9942. tok('NUMERICIDENTIFIERLOOSE')
  9943. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9944. // ## Non-numeric Identifier
  9945. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9946. // more letters, digits, or hyphens.
  9947. tok('NONNUMERICIDENTIFIER')
  9948. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9949. // ## Main Version
  9950. // Three dot-separated numeric identifiers.
  9951. tok('MAINVERSION')
  9952. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9953. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9954. '(' + src[t.NUMERICIDENTIFIER] + ')'
  9955. tok('MAINVERSIONLOOSE')
  9956. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9957. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9958. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  9959. // ## Pre-release Version Identifier
  9960. // A numeric identifier, or a non-numeric identifier.
  9961. tok('PRERELEASEIDENTIFIER')
  9962. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  9963. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9964. tok('PRERELEASEIDENTIFIERLOOSE')
  9965. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  9966. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9967. // ## Pre-release Version
  9968. // Hyphen, followed by one or more dot-separated pre-release version
  9969. // identifiers.
  9970. tok('PRERELEASE')
  9971. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  9972. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  9973. tok('PRERELEASELOOSE')
  9974. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  9975. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  9976. // ## Build Metadata Identifier
  9977. // Any combination of digits, letters, or hyphens.
  9978. tok('BUILDIDENTIFIER')
  9979. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  9980. // ## Build Metadata
  9981. // Plus sign, followed by one or more period-separated build metadata
  9982. // identifiers.
  9983. tok('BUILD')
  9984. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  9985. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  9986. // ## Full Version String
  9987. // A main version, followed optionally by a pre-release version and
  9988. // build metadata.
  9989. // Note that the only major, minor, patch, and pre-release sections of
  9990. // the version string are capturing groups. The build metadata is not a
  9991. // capturing group, because it should not ever be used in version
  9992. // comparison.
  9993. tok('FULL')
  9994. tok('FULLPLAIN')
  9995. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  9996. src[t.PRERELEASE] + '?' +
  9997. src[t.BUILD] + '?'
  9998. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  9999. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  10000. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  10001. // common in the npm registry.
  10002. tok('LOOSEPLAIN')
  10003. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  10004. src[t.PRERELEASELOOSE] + '?' +
  10005. src[t.BUILD] + '?'
  10006. tok('LOOSE')
  10007. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  10008. tok('GTLT')
  10009. src[t.GTLT] = '((?:<|>)?=?)'
  10010. // Something like "2.*" or "1.2.x".
  10011. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  10012. // Only the first item is strictly required.
  10013. tok('XRANGEIDENTIFIERLOOSE')
  10014. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  10015. tok('XRANGEIDENTIFIER')
  10016. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  10017. tok('XRANGEPLAIN')
  10018. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  10019. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10020. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  10021. '(?:' + src[t.PRERELEASE] + ')?' +
  10022. src[t.BUILD] + '?' +
  10023. ')?)?'
  10024. tok('XRANGEPLAINLOOSE')
  10025. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10026. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10027. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  10028. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  10029. src[t.BUILD] + '?' +
  10030. ')?)?'
  10031. tok('XRANGE')
  10032. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  10033. tok('XRANGELOOSE')
  10034. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  10035. // Coercion.
  10036. // Extract anything that could conceivably be a part of a valid semver
  10037. tok('COERCE')
  10038. src[t.COERCE] = '(^|[^\\d])' +
  10039. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  10040. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10041. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  10042. '(?:$|[^\\d])'
  10043. tok('COERCERTL')
  10044. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  10045. // Tilde ranges.
  10046. // Meaning is "reasonably at or greater than"
  10047. tok('LONETILDE')
  10048. src[t.LONETILDE] = '(?:~>?)'
  10049. tok('TILDETRIM')
  10050. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  10051. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  10052. var tildeTrimReplace = '$1~'
  10053. tok('TILDE')
  10054. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  10055. tok('TILDELOOSE')
  10056. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  10057. // Caret ranges.
  10058. // Meaning is "at least and backwards compatible with"
  10059. tok('LONECARET')
  10060. src[t.LONECARET] = '(?:\\^)'
  10061. tok('CARETTRIM')
  10062. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  10063. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  10064. var caretTrimReplace = '$1^'
  10065. tok('CARET')
  10066. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  10067. tok('CARETLOOSE')
  10068. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  10069. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  10070. tok('COMPARATORLOOSE')
  10071. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  10072. tok('COMPARATOR')
  10073. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  10074. // An expression to strip any whitespace between the gtlt and the thing
  10075. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  10076. tok('COMPARATORTRIM')
  10077. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  10078. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  10079. // this one has to use the /g flag
  10080. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  10081. var comparatorTrimReplace = '$1$2$3'
  10082. // Something like `1.2.3 - 1.2.4`
  10083. // Note that these all use the loose form, because they'll be
  10084. // checked against either the strict or loose comparator form
  10085. // later.
  10086. tok('HYPHENRANGE')
  10087. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  10088. '\\s+-\\s+' +
  10089. '(' + src[t.XRANGEPLAIN] + ')' +
  10090. '\\s*$'
  10091. tok('HYPHENRANGELOOSE')
  10092. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10093. '\\s+-\\s+' +
  10094. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  10095. '\\s*$'
  10096. // Star ranges basically just allow anything at all.
  10097. tok('STAR')
  10098. src[t.STAR] = '(<|>)?=?\\s*\\*'
  10099. // Compile to actual regexp objects.
  10100. // All are flag-free, unless they were created above with a flag.
  10101. for (var i = 0; i < R; i++) {
  10102. debug(i, src[i])
  10103. if (!re[i]) {
  10104. re[i] = new RegExp(src[i])
  10105. }
  10106. }
  10107. exports.parse = parse
  10108. function parse (version, options) {
  10109. if (!options || typeof options !== 'object') {
  10110. options = {
  10111. loose: !!options,
  10112. includePrerelease: false
  10113. }
  10114. }
  10115. if (version instanceof SemVer) {
  10116. return version
  10117. }
  10118. if (typeof version !== 'string') {
  10119. return null
  10120. }
  10121. if (version.length > MAX_LENGTH) {
  10122. return null
  10123. }
  10124. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  10125. if (!r.test(version)) {
  10126. return null
  10127. }
  10128. try {
  10129. return new SemVer(version, options)
  10130. } catch (er) {
  10131. return null
  10132. }
  10133. }
  10134. exports.valid = valid
  10135. function valid (version, options) {
  10136. var v = parse(version, options)
  10137. return v ? v.version : null
  10138. }
  10139. exports.clean = clean
  10140. function clean (version, options) {
  10141. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  10142. return s ? s.version : null
  10143. }
  10144. exports.SemVer = SemVer
  10145. function SemVer (version, options) {
  10146. if (!options || typeof options !== 'object') {
  10147. options = {
  10148. loose: !!options,
  10149. includePrerelease: false
  10150. }
  10151. }
  10152. if (version instanceof SemVer) {
  10153. if (version.loose === options.loose) {
  10154. return version
  10155. } else {
  10156. version = version.version
  10157. }
  10158. } else if (typeof version !== 'string') {
  10159. throw new TypeError('Invalid Version: ' + version)
  10160. }
  10161. if (version.length > MAX_LENGTH) {
  10162. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10163. }
  10164. if (!(this instanceof SemVer)) {
  10165. return new SemVer(version, options)
  10166. }
  10167. debug('SemVer', version, options)
  10168. this.options = options
  10169. this.loose = !!options.loose
  10170. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10171. if (!m) {
  10172. throw new TypeError('Invalid Version: ' + version)
  10173. }
  10174. this.raw = version
  10175. // these are actually numbers
  10176. this.major = +m[1]
  10177. this.minor = +m[2]
  10178. this.patch = +m[3]
  10179. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10180. throw new TypeError('Invalid major version')
  10181. }
  10182. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10183. throw new TypeError('Invalid minor version')
  10184. }
  10185. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10186. throw new TypeError('Invalid patch version')
  10187. }
  10188. // numberify any prerelease numeric ids
  10189. if (!m[4]) {
  10190. this.prerelease = []
  10191. } else {
  10192. this.prerelease = m[4].split('.').map(function (id) {
  10193. if (/^[0-9]+$/.test(id)) {
  10194. var num = +id
  10195. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10196. return num
  10197. }
  10198. }
  10199. return id
  10200. })
  10201. }
  10202. this.build = m[5] ? m[5].split('.') : []
  10203. this.format()
  10204. }
  10205. SemVer.prototype.format = function () {
  10206. this.version = this.major + '.' + this.minor + '.' + this.patch
  10207. if (this.prerelease.length) {
  10208. this.version += '-' + this.prerelease.join('.')
  10209. }
  10210. return this.version
  10211. }
  10212. SemVer.prototype.toString = function () {
  10213. return this.version
  10214. }
  10215. SemVer.prototype.compare = function (other) {
  10216. debug('SemVer.compare', this.version, this.options, other)
  10217. if (!(other instanceof SemVer)) {
  10218. other = new SemVer(other, this.options)
  10219. }
  10220. return this.compareMain(other) || this.comparePre(other)
  10221. }
  10222. SemVer.prototype.compareMain = function (other) {
  10223. if (!(other instanceof SemVer)) {
  10224. other = new SemVer(other, this.options)
  10225. }
  10226. return compareIdentifiers(this.major, other.major) ||
  10227. compareIdentifiers(this.minor, other.minor) ||
  10228. compareIdentifiers(this.patch, other.patch)
  10229. }
  10230. SemVer.prototype.comparePre = function (other) {
  10231. if (!(other instanceof SemVer)) {
  10232. other = new SemVer(other, this.options)
  10233. }
  10234. // NOT having a prerelease is > having one
  10235. if (this.prerelease.length && !other.prerelease.length) {
  10236. return -1
  10237. } else if (!this.prerelease.length && other.prerelease.length) {
  10238. return 1
  10239. } else if (!this.prerelease.length && !other.prerelease.length) {
  10240. return 0
  10241. }
  10242. var i = 0
  10243. do {
  10244. var a = this.prerelease[i]
  10245. var b = other.prerelease[i]
  10246. debug('prerelease compare', i, a, b)
  10247. if (a === undefined && b === undefined) {
  10248. return 0
  10249. } else if (b === undefined) {
  10250. return 1
  10251. } else if (a === undefined) {
  10252. return -1
  10253. } else if (a === b) {
  10254. continue
  10255. } else {
  10256. return compareIdentifiers(a, b)
  10257. }
  10258. } while (++i)
  10259. }
  10260. SemVer.prototype.compareBuild = function (other) {
  10261. if (!(other instanceof SemVer)) {
  10262. other = new SemVer(other, this.options)
  10263. }
  10264. var i = 0
  10265. do {
  10266. var a = this.build[i]
  10267. var b = other.build[i]
  10268. debug('prerelease compare', i, a, b)
  10269. if (a === undefined && b === undefined) {
  10270. return 0
  10271. } else if (b === undefined) {
  10272. return 1
  10273. } else if (a === undefined) {
  10274. return -1
  10275. } else if (a === b) {
  10276. continue
  10277. } else {
  10278. return compareIdentifiers(a, b)
  10279. }
  10280. } while (++i)
  10281. }
  10282. // preminor will bump the version up to the next minor release, and immediately
  10283. // down to pre-release. premajor and prepatch work the same way.
  10284. SemVer.prototype.inc = function (release, identifier) {
  10285. switch (release) {
  10286. case 'premajor':
  10287. this.prerelease.length = 0
  10288. this.patch = 0
  10289. this.minor = 0
  10290. this.major++
  10291. this.inc('pre', identifier)
  10292. break
  10293. case 'preminor':
  10294. this.prerelease.length = 0
  10295. this.patch = 0
  10296. this.minor++
  10297. this.inc('pre', identifier)
  10298. break
  10299. case 'prepatch':
  10300. // If this is already a prerelease, it will bump to the next version
  10301. // drop any prereleases that might already exist, since they are not
  10302. // relevant at this point.
  10303. this.prerelease.length = 0
  10304. this.inc('patch', identifier)
  10305. this.inc('pre', identifier)
  10306. break
  10307. // If the input is a non-prerelease version, this acts the same as
  10308. // prepatch.
  10309. case 'prerelease':
  10310. if (this.prerelease.length === 0) {
  10311. this.inc('patch', identifier)
  10312. }
  10313. this.inc('pre', identifier)
  10314. break
  10315. case 'major':
  10316. // If this is a pre-major version, bump up to the same major version.
  10317. // Otherwise increment major.
  10318. // 1.0.0-5 bumps to 1.0.0
  10319. // 1.1.0 bumps to 2.0.0
  10320. if (this.minor !== 0 ||
  10321. this.patch !== 0 ||
  10322. this.prerelease.length === 0) {
  10323. this.major++
  10324. }
  10325. this.minor = 0
  10326. this.patch = 0
  10327. this.prerelease = []
  10328. break
  10329. case 'minor':
  10330. // If this is a pre-minor version, bump up to the same minor version.
  10331. // Otherwise increment minor.
  10332. // 1.2.0-5 bumps to 1.2.0
  10333. // 1.2.1 bumps to 1.3.0
  10334. if (this.patch !== 0 || this.prerelease.length === 0) {
  10335. this.minor++
  10336. }
  10337. this.patch = 0
  10338. this.prerelease = []
  10339. break
  10340. case 'patch':
  10341. // If this is not a pre-release version, it will increment the patch.
  10342. // If it is a pre-release it will bump up to the same patch version.
  10343. // 1.2.0-5 patches to 1.2.0
  10344. // 1.2.0 patches to 1.2.1
  10345. if (this.prerelease.length === 0) {
  10346. this.patch++
  10347. }
  10348. this.prerelease = []
  10349. break
  10350. // This probably shouldn't be used publicly.
  10351. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10352. case 'pre':
  10353. if (this.prerelease.length === 0) {
  10354. this.prerelease = [0]
  10355. } else {
  10356. var i = this.prerelease.length
  10357. while (--i >= 0) {
  10358. if (typeof this.prerelease[i] === 'number') {
  10359. this.prerelease[i]++
  10360. i = -2
  10361. }
  10362. }
  10363. if (i === -1) {
  10364. // didn't increment anything
  10365. this.prerelease.push(0)
  10366. }
  10367. }
  10368. if (identifier) {
  10369. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10370. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10371. if (this.prerelease[0] === identifier) {
  10372. if (isNaN(this.prerelease[1])) {
  10373. this.prerelease = [identifier, 0]
  10374. }
  10375. } else {
  10376. this.prerelease = [identifier, 0]
  10377. }
  10378. }
  10379. break
  10380. default:
  10381. throw new Error('invalid increment argument: ' + release)
  10382. }
  10383. this.format()
  10384. this.raw = this.version
  10385. return this
  10386. }
  10387. exports.inc = inc
  10388. function inc (version, release, loose, identifier) {
  10389. if (typeof (loose) === 'string') {
  10390. identifier = loose
  10391. loose = undefined
  10392. }
  10393. try {
  10394. return new SemVer(version, loose).inc(release, identifier).version
  10395. } catch (er) {
  10396. return null
  10397. }
  10398. }
  10399. exports.diff = diff
  10400. function diff (version1, version2) {
  10401. if (eq(version1, version2)) {
  10402. return null
  10403. } else {
  10404. var v1 = parse(version1)
  10405. var v2 = parse(version2)
  10406. var prefix = ''
  10407. if (v1.prerelease.length || v2.prerelease.length) {
  10408. prefix = 'pre'
  10409. var defaultResult = 'prerelease'
  10410. }
  10411. for (var key in v1) {
  10412. if (key === 'major' || key === 'minor' || key === 'patch') {
  10413. if (v1[key] !== v2[key]) {
  10414. return prefix + key
  10415. }
  10416. }
  10417. }
  10418. return defaultResult // may be undefined
  10419. }
  10420. }
  10421. exports.compareIdentifiers = compareIdentifiers
  10422. var numeric = /^[0-9]+$/
  10423. function compareIdentifiers (a, b) {
  10424. var anum = numeric.test(a)
  10425. var bnum = numeric.test(b)
  10426. if (anum && bnum) {
  10427. a = +a
  10428. b = +b
  10429. }
  10430. return a === b ? 0
  10431. : (anum && !bnum) ? -1
  10432. : (bnum && !anum) ? 1
  10433. : a < b ? -1
  10434. : 1
  10435. }
  10436. exports.rcompareIdentifiers = rcompareIdentifiers
  10437. function rcompareIdentifiers (a, b) {
  10438. return compareIdentifiers(b, a)
  10439. }
  10440. exports.major = major
  10441. function major (a, loose) {
  10442. return new SemVer(a, loose).major
  10443. }
  10444. exports.minor = minor
  10445. function minor (a, loose) {
  10446. return new SemVer(a, loose).minor
  10447. }
  10448. exports.patch = patch
  10449. function patch (a, loose) {
  10450. return new SemVer(a, loose).patch
  10451. }
  10452. exports.compare = compare
  10453. function compare (a, b, loose) {
  10454. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10455. }
  10456. exports.compareLoose = compareLoose
  10457. function compareLoose (a, b) {
  10458. return compare(a, b, true)
  10459. }
  10460. exports.compareBuild = compareBuild
  10461. function compareBuild (a, b, loose) {
  10462. var versionA = new SemVer(a, loose)
  10463. var versionB = new SemVer(b, loose)
  10464. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10465. }
  10466. exports.rcompare = rcompare
  10467. function rcompare (a, b, loose) {
  10468. return compare(b, a, loose)
  10469. }
  10470. exports.sort = sort
  10471. function sort (list, loose) {
  10472. return list.sort(function (a, b) {
  10473. return exports.compareBuild(a, b, loose)
  10474. })
  10475. }
  10476. exports.rsort = rsort
  10477. function rsort (list, loose) {
  10478. return list.sort(function (a, b) {
  10479. return exports.compareBuild(b, a, loose)
  10480. })
  10481. }
  10482. exports.gt = gt
  10483. function gt (a, b, loose) {
  10484. return compare(a, b, loose) > 0
  10485. }
  10486. exports.lt = lt
  10487. function lt (a, b, loose) {
  10488. return compare(a, b, loose) < 0
  10489. }
  10490. exports.eq = eq
  10491. function eq (a, b, loose) {
  10492. return compare(a, b, loose) === 0
  10493. }
  10494. exports.neq = neq
  10495. function neq (a, b, loose) {
  10496. return compare(a, b, loose) !== 0
  10497. }
  10498. exports.gte = gte
  10499. function gte (a, b, loose) {
  10500. return compare(a, b, loose) >= 0
  10501. }
  10502. exports.lte = lte
  10503. function lte (a, b, loose) {
  10504. return compare(a, b, loose) <= 0
  10505. }
  10506. exports.cmp = cmp
  10507. function cmp (a, op, b, loose) {
  10508. switch (op) {
  10509. case '===':
  10510. if (typeof a === 'object')
  10511. a = a.version
  10512. if (typeof b === 'object')
  10513. b = b.version
  10514. return a === b
  10515. case '!==':
  10516. if (typeof a === 'object')
  10517. a = a.version
  10518. if (typeof b === 'object')
  10519. b = b.version
  10520. return a !== b
  10521. case '':
  10522. case '=':
  10523. case '==':
  10524. return eq(a, b, loose)
  10525. case '!=':
  10526. return neq(a, b, loose)
  10527. case '>':
  10528. return gt(a, b, loose)
  10529. case '>=':
  10530. return gte(a, b, loose)
  10531. case '<':
  10532. return lt(a, b, loose)
  10533. case '<=':
  10534. return lte(a, b, loose)
  10535. default:
  10536. throw new TypeError('Invalid operator: ' + op)
  10537. }
  10538. }
  10539. exports.Comparator = Comparator
  10540. function Comparator (comp, options) {
  10541. if (!options || typeof options !== 'object') {
  10542. options = {
  10543. loose: !!options,
  10544. includePrerelease: false
  10545. }
  10546. }
  10547. if (comp instanceof Comparator) {
  10548. if (comp.loose === !!options.loose) {
  10549. return comp
  10550. } else {
  10551. comp = comp.value
  10552. }
  10553. }
  10554. if (!(this instanceof Comparator)) {
  10555. return new Comparator(comp, options)
  10556. }
  10557. debug('comparator', comp, options)
  10558. this.options = options
  10559. this.loose = !!options.loose
  10560. this.parse(comp)
  10561. if (this.semver === ANY) {
  10562. this.value = ''
  10563. } else {
  10564. this.value = this.operator + this.semver.version
  10565. }
  10566. debug('comp', this)
  10567. }
  10568. var ANY = {}
  10569. Comparator.prototype.parse = function (comp) {
  10570. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10571. var m = comp.match(r)
  10572. if (!m) {
  10573. throw new TypeError('Invalid comparator: ' + comp)
  10574. }
  10575. this.operator = m[1] !== undefined ? m[1] : ''
  10576. if (this.operator === '=') {
  10577. this.operator = ''
  10578. }
  10579. // if it literally is just '>' or '' then allow anything.
  10580. if (!m[2]) {
  10581. this.semver = ANY
  10582. } else {
  10583. this.semver = new SemVer(m[2], this.options.loose)
  10584. }
  10585. }
  10586. Comparator.prototype.toString = function () {
  10587. return this.value
  10588. }
  10589. Comparator.prototype.test = function (version) {
  10590. debug('Comparator.test', version, this.options.loose)
  10591. if (this.semver === ANY || version === ANY) {
  10592. return true
  10593. }
  10594. if (typeof version === 'string') {
  10595. try {
  10596. version = new SemVer(version, this.options)
  10597. } catch (er) {
  10598. return false
  10599. }
  10600. }
  10601. return cmp(version, this.operator, this.semver, this.options)
  10602. }
  10603. Comparator.prototype.intersects = function (comp, options) {
  10604. if (!(comp instanceof Comparator)) {
  10605. throw new TypeError('a Comparator is required')
  10606. }
  10607. if (!options || typeof options !== 'object') {
  10608. options = {
  10609. loose: !!options,
  10610. includePrerelease: false
  10611. }
  10612. }
  10613. var rangeTmp
  10614. if (this.operator === '') {
  10615. if (this.value === '') {
  10616. return true
  10617. }
  10618. rangeTmp = new Range(comp.value, options)
  10619. return satisfies(this.value, rangeTmp, options)
  10620. } else if (comp.operator === '') {
  10621. if (comp.value === '') {
  10622. return true
  10623. }
  10624. rangeTmp = new Range(this.value, options)
  10625. return satisfies(comp.semver, rangeTmp, options)
  10626. }
  10627. var sameDirectionIncreasing =
  10628. (this.operator === '>=' || this.operator === '>') &&
  10629. (comp.operator === '>=' || comp.operator === '>')
  10630. var sameDirectionDecreasing =
  10631. (this.operator === '<=' || this.operator === '<') &&
  10632. (comp.operator === '<=' || comp.operator === '<')
  10633. var sameSemVer = this.semver.version === comp.semver.version
  10634. var differentDirectionsInclusive =
  10635. (this.operator === '>=' || this.operator === '<=') &&
  10636. (comp.operator === '>=' || comp.operator === '<=')
  10637. var oppositeDirectionsLessThan =
  10638. cmp(this.semver, '<', comp.semver, options) &&
  10639. ((this.operator === '>=' || this.operator === '>') &&
  10640. (comp.operator === '<=' || comp.operator === '<'))
  10641. var oppositeDirectionsGreaterThan =
  10642. cmp(this.semver, '>', comp.semver, options) &&
  10643. ((this.operator === '<=' || this.operator === '<') &&
  10644. (comp.operator === '>=' || comp.operator === '>'))
  10645. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10646. (sameSemVer && differentDirectionsInclusive) ||
  10647. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10648. }
  10649. exports.Range = Range
  10650. function Range (range, options) {
  10651. if (!options || typeof options !== 'object') {
  10652. options = {
  10653. loose: !!options,
  10654. includePrerelease: false
  10655. }
  10656. }
  10657. if (range instanceof Range) {
  10658. if (range.loose === !!options.loose &&
  10659. range.includePrerelease === !!options.includePrerelease) {
  10660. return range
  10661. } else {
  10662. return new Range(range.raw, options)
  10663. }
  10664. }
  10665. if (range instanceof Comparator) {
  10666. return new Range(range.value, options)
  10667. }
  10668. if (!(this instanceof Range)) {
  10669. return new Range(range, options)
  10670. }
  10671. this.options = options
  10672. this.loose = !!options.loose
  10673. this.includePrerelease = !!options.includePrerelease
  10674. // First, split based on boolean or ||
  10675. this.raw = range
  10676. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10677. return this.parseRange(range.trim())
  10678. }, this).filter(function (c) {
  10679. // throw out any that are not relevant for whatever reason
  10680. return c.length
  10681. })
  10682. if (!this.set.length) {
  10683. throw new TypeError('Invalid SemVer Range: ' + range)
  10684. }
  10685. this.format()
  10686. }
  10687. Range.prototype.format = function () {
  10688. this.range = this.set.map(function (comps) {
  10689. return comps.join(' ').trim()
  10690. }).join('||').trim()
  10691. return this.range
  10692. }
  10693. Range.prototype.toString = function () {
  10694. return this.range
  10695. }
  10696. Range.prototype.parseRange = function (range) {
  10697. var loose = this.options.loose
  10698. range = range.trim()
  10699. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10700. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10701. range = range.replace(hr, hyphenReplace)
  10702. debug('hyphen replace', range)
  10703. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10704. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10705. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10706. // `~ 1.2.3` => `~1.2.3`
  10707. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10708. // `^ 1.2.3` => `^1.2.3`
  10709. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10710. // normalize spaces
  10711. range = range.split(/\s+/).join(' ')
  10712. // At this point, the range is completely trimmed and
  10713. // ready to be split into comparators.
  10714. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10715. var set = range.split(' ').map(function (comp) {
  10716. return parseComparator(comp, this.options)
  10717. }, this).join(' ').split(/\s+/)
  10718. if (this.options.loose) {
  10719. // in loose mode, throw out any that are not valid comparators
  10720. set = set.filter(function (comp) {
  10721. return !!comp.match(compRe)
  10722. })
  10723. }
  10724. set = set.map(function (comp) {
  10725. return new Comparator(comp, this.options)
  10726. }, this)
  10727. return set
  10728. }
  10729. Range.prototype.intersects = function (range, options) {
  10730. if (!(range instanceof Range)) {
  10731. throw new TypeError('a Range is required')
  10732. }
  10733. return this.set.some(function (thisComparators) {
  10734. return (
  10735. isSatisfiable(thisComparators, options) &&
  10736. range.set.some(function (rangeComparators) {
  10737. return (
  10738. isSatisfiable(rangeComparators, options) &&
  10739. thisComparators.every(function (thisComparator) {
  10740. return rangeComparators.every(function (rangeComparator) {
  10741. return thisComparator.intersects(rangeComparator, options)
  10742. })
  10743. })
  10744. )
  10745. })
  10746. )
  10747. })
  10748. }
  10749. // take a set of comparators and determine whether there
  10750. // exists a version which can satisfy it
  10751. function isSatisfiable (comparators, options) {
  10752. var result = true
  10753. var remainingComparators = comparators.slice()
  10754. var testComparator = remainingComparators.pop()
  10755. while (result && remainingComparators.length) {
  10756. result = remainingComparators.every(function (otherComparator) {
  10757. return testComparator.intersects(otherComparator, options)
  10758. })
  10759. testComparator = remainingComparators.pop()
  10760. }
  10761. return result
  10762. }
  10763. // Mostly just for testing and legacy API reasons
  10764. exports.toComparators = toComparators
  10765. function toComparators (range, options) {
  10766. return new Range(range, options).set.map(function (comp) {
  10767. return comp.map(function (c) {
  10768. return c.value
  10769. }).join(' ').trim().split(' ')
  10770. })
  10771. }
  10772. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10773. // already replaced the hyphen ranges
  10774. // turn into a set of JUST comparators.
  10775. function parseComparator (comp, options) {
  10776. debug('comp', comp, options)
  10777. comp = replaceCarets(comp, options)
  10778. debug('caret', comp)
  10779. comp = replaceTildes(comp, options)
  10780. debug('tildes', comp)
  10781. comp = replaceXRanges(comp, options)
  10782. debug('xrange', comp)
  10783. comp = replaceStars(comp, options)
  10784. debug('stars', comp)
  10785. return comp
  10786. }
  10787. function isX (id) {
  10788. return !id || id.toLowerCase() === 'x' || id === '*'
  10789. }
  10790. // ~, ~> --> * (any, kinda silly)
  10791. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10792. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10793. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10794. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10795. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10796. function replaceTildes (comp, options) {
  10797. return comp.trim().split(/\s+/).map(function (comp) {
  10798. return replaceTilde(comp, options)
  10799. }).join(' ')
  10800. }
  10801. function replaceTilde (comp, options) {
  10802. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10803. return comp.replace(r, function (_, M, m, p, pr) {
  10804. debug('tilde', comp, _, M, m, p, pr)
  10805. var ret
  10806. if (isX(M)) {
  10807. ret = ''
  10808. } else if (isX(m)) {
  10809. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10810. } else if (isX(p)) {
  10811. // ~1.2 == >=1.2.0 <1.3.0
  10812. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10813. } else if (pr) {
  10814. debug('replaceTilde pr', pr)
  10815. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10816. ' <' + M + '.' + (+m + 1) + '.0'
  10817. } else {
  10818. // ~1.2.3 == >=1.2.3 <1.3.0
  10819. ret = '>=' + M + '.' + m + '.' + p +
  10820. ' <' + M + '.' + (+m + 1) + '.0'
  10821. }
  10822. debug('tilde return', ret)
  10823. return ret
  10824. })
  10825. }
  10826. // ^ --> * (any, kinda silly)
  10827. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10828. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10829. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10830. // ^1.2.3 --> >=1.2.3 <2.0.0
  10831. // ^1.2.0 --> >=1.2.0 <2.0.0
  10832. function replaceCarets (comp, options) {
  10833. return comp.trim().split(/\s+/).map(function (comp) {
  10834. return replaceCaret(comp, options)
  10835. }).join(' ')
  10836. }
  10837. function replaceCaret (comp, options) {
  10838. debug('caret', comp, options)
  10839. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10840. return comp.replace(r, function (_, M, m, p, pr) {
  10841. debug('caret', comp, _, M, m, p, pr)
  10842. var ret
  10843. if (isX(M)) {
  10844. ret = ''
  10845. } else if (isX(m)) {
  10846. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10847. } else if (isX(p)) {
  10848. if (M === '0') {
  10849. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10850. } else {
  10851. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10852. }
  10853. } else if (pr) {
  10854. debug('replaceCaret pr', pr)
  10855. if (M === '0') {
  10856. if (m === '0') {
  10857. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10858. ' <' + M + '.' + m + '.' + (+p + 1)
  10859. } else {
  10860. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10861. ' <' + M + '.' + (+m + 1) + '.0'
  10862. }
  10863. } else {
  10864. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10865. ' <' + (+M + 1) + '.0.0'
  10866. }
  10867. } else {
  10868. debug('no pr')
  10869. if (M === '0') {
  10870. if (m === '0') {
  10871. ret = '>=' + M + '.' + m + '.' + p +
  10872. ' <' + M + '.' + m + '.' + (+p + 1)
  10873. } else {
  10874. ret = '>=' + M + '.' + m + '.' + p +
  10875. ' <' + M + '.' + (+m + 1) + '.0'
  10876. }
  10877. } else {
  10878. ret = '>=' + M + '.' + m + '.' + p +
  10879. ' <' + (+M + 1) + '.0.0'
  10880. }
  10881. }
  10882. debug('caret return', ret)
  10883. return ret
  10884. })
  10885. }
  10886. function replaceXRanges (comp, options) {
  10887. debug('replaceXRanges', comp, options)
  10888. return comp.split(/\s+/).map(function (comp) {
  10889. return replaceXRange(comp, options)
  10890. }).join(' ')
  10891. }
  10892. function replaceXRange (comp, options) {
  10893. comp = comp.trim()
  10894. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10895. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10896. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10897. var xM = isX(M)
  10898. var xm = xM || isX(m)
  10899. var xp = xm || isX(p)
  10900. var anyX = xp
  10901. if (gtlt === '=' && anyX) {
  10902. gtlt = ''
  10903. }
  10904. // if we're including prereleases in the match, then we need
  10905. // to fix this to -0, the lowest possible prerelease value
  10906. pr = options.includePrerelease ? '-0' : ''
  10907. if (xM) {
  10908. if (gtlt === '>' || gtlt === '<') {
  10909. // nothing is allowed
  10910. ret = '<0.0.0-0'
  10911. } else {
  10912. // nothing is forbidden
  10913. ret = '*'
  10914. }
  10915. } else if (gtlt && anyX) {
  10916. // we know patch is an x, because we have any x at all.
  10917. // replace X with 0
  10918. if (xm) {
  10919. m = 0
  10920. }
  10921. p = 0
  10922. if (gtlt === '>') {
  10923. // >1 => >=2.0.0
  10924. // >1.2 => >=1.3.0
  10925. // >1.2.3 => >= 1.2.4
  10926. gtlt = '>='
  10927. if (xm) {
  10928. M = +M + 1
  10929. m = 0
  10930. p = 0
  10931. } else {
  10932. m = +m + 1
  10933. p = 0
  10934. }
  10935. } else if (gtlt === '<=') {
  10936. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10937. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10938. gtlt = '<'
  10939. if (xm) {
  10940. M = +M + 1
  10941. } else {
  10942. m = +m + 1
  10943. }
  10944. }
  10945. ret = gtlt + M + '.' + m + '.' + p + pr
  10946. } else if (xm) {
  10947. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10948. } else if (xp) {
  10949. ret = '>=' + M + '.' + m + '.0' + pr +
  10950. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10951. }
  10952. debug('xRange return', ret)
  10953. return ret
  10954. })
  10955. }
  10956. // Because * is AND-ed with everything else in the comparator,
  10957. // and '' means "any version", just remove the *s entirely.
  10958. function replaceStars (comp, options) {
  10959. debug('replaceStars', comp, options)
  10960. // Looseness is ignored here. star is always as loose as it gets!
  10961. return comp.trim().replace(re[t.STAR], '')
  10962. }
  10963. // This function is passed to string.replace(re[t.HYPHENRANGE])
  10964. // M, m, patch, prerelease, build
  10965. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  10966. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  10967. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  10968. function hyphenReplace ($0,
  10969. from, fM, fm, fp, fpr, fb,
  10970. to, tM, tm, tp, tpr, tb) {
  10971. if (isX(fM)) {
  10972. from = ''
  10973. } else if (isX(fm)) {
  10974. from = '>=' + fM + '.0.0'
  10975. } else if (isX(fp)) {
  10976. from = '>=' + fM + '.' + fm + '.0'
  10977. } else {
  10978. from = '>=' + from
  10979. }
  10980. if (isX(tM)) {
  10981. to = ''
  10982. } else if (isX(tm)) {
  10983. to = '<' + (+tM + 1) + '.0.0'
  10984. } else if (isX(tp)) {
  10985. to = '<' + tM + '.' + (+tm + 1) + '.0'
  10986. } else if (tpr) {
  10987. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  10988. } else {
  10989. to = '<=' + to
  10990. }
  10991. return (from + ' ' + to).trim()
  10992. }
  10993. // if ANY of the sets match ALL of its comparators, then pass
  10994. Range.prototype.test = function (version) {
  10995. if (!version) {
  10996. return false
  10997. }
  10998. if (typeof version === 'string') {
  10999. try {
  11000. version = new SemVer(version, this.options)
  11001. } catch (er) {
  11002. return false
  11003. }
  11004. }
  11005. for (var i = 0; i < this.set.length; i++) {
  11006. if (testSet(this.set[i], version, this.options)) {
  11007. return true
  11008. }
  11009. }
  11010. return false
  11011. }
  11012. function testSet (set, version, options) {
  11013. for (var i = 0; i < set.length; i++) {
  11014. if (!set[i].test(version)) {
  11015. return false
  11016. }
  11017. }
  11018. if (version.prerelease.length && !options.includePrerelease) {
  11019. // Find the set of versions that are allowed to have prereleases
  11020. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  11021. // That should allow `1.2.3-pr.2` to pass.
  11022. // However, `1.2.4-alpha.notready` should NOT be allowed,
  11023. // even though it's within the range set by the comparators.
  11024. for (i = 0; i < set.length; i++) {
  11025. debug(set[i].semver)
  11026. if (set[i].semver === ANY) {
  11027. continue
  11028. }
  11029. if (set[i].semver.prerelease.length > 0) {
  11030. var allowed = set[i].semver
  11031. if (allowed.major === version.major &&
  11032. allowed.minor === version.minor &&
  11033. allowed.patch === version.patch) {
  11034. return true
  11035. }
  11036. }
  11037. }
  11038. // Version has a -pre, but it's not one of the ones we like.
  11039. return false
  11040. }
  11041. return true
  11042. }
  11043. exports.satisfies = satisfies
  11044. function satisfies (version, range, options) {
  11045. try {
  11046. range = new Range(range, options)
  11047. } catch (er) {
  11048. return false
  11049. }
  11050. return range.test(version)
  11051. }
  11052. exports.maxSatisfying = maxSatisfying
  11053. function maxSatisfying (versions, range, options) {
  11054. var max = null
  11055. var maxSV = null
  11056. try {
  11057. var rangeObj = new Range(range, options)
  11058. } catch (er) {
  11059. return null
  11060. }
  11061. versions.forEach(function (v) {
  11062. if (rangeObj.test(v)) {
  11063. // satisfies(v, range, options)
  11064. if (!max || maxSV.compare(v) === -1) {
  11065. // compare(max, v, true)
  11066. max = v
  11067. maxSV = new SemVer(max, options)
  11068. }
  11069. }
  11070. })
  11071. return max
  11072. }
  11073. exports.minSatisfying = minSatisfying
  11074. function minSatisfying (versions, range, options) {
  11075. var min = null
  11076. var minSV = null
  11077. try {
  11078. var rangeObj = new Range(range, options)
  11079. } catch (er) {
  11080. return null
  11081. }
  11082. versions.forEach(function (v) {
  11083. if (rangeObj.test(v)) {
  11084. // satisfies(v, range, options)
  11085. if (!min || minSV.compare(v) === 1) {
  11086. // compare(min, v, true)
  11087. min = v
  11088. minSV = new SemVer(min, options)
  11089. }
  11090. }
  11091. })
  11092. return min
  11093. }
  11094. exports.minVersion = minVersion
  11095. function minVersion (range, loose) {
  11096. range = new Range(range, loose)
  11097. var minver = new SemVer('0.0.0')
  11098. if (range.test(minver)) {
  11099. return minver
  11100. }
  11101. minver = new SemVer('0.0.0-0')
  11102. if (range.test(minver)) {
  11103. return minver
  11104. }
  11105. minver = null
  11106. for (var i = 0; i < range.set.length; ++i) {
  11107. var comparators = range.set[i]
  11108. comparators.forEach(function (comparator) {
  11109. // Clone to avoid manipulating the comparator's semver object.
  11110. var compver = new SemVer(comparator.semver.version)
  11111. switch (comparator.operator) {
  11112. case '>':
  11113. if (compver.prerelease.length === 0) {
  11114. compver.patch++
  11115. } else {
  11116. compver.prerelease.push(0)
  11117. }
  11118. compver.raw = compver.format()
  11119. /* fallthrough */
  11120. case '':
  11121. case '>=':
  11122. if (!minver || gt(minver, compver)) {
  11123. minver = compver
  11124. }
  11125. break
  11126. case '<':
  11127. case '<=':
  11128. /* Ignore maximum versions */
  11129. break
  11130. /* istanbul ignore next */
  11131. default:
  11132. throw new Error('Unexpected operation: ' + comparator.operator)
  11133. }
  11134. })
  11135. }
  11136. if (minver && range.test(minver)) {
  11137. return minver
  11138. }
  11139. return null
  11140. }
  11141. exports.validRange = validRange
  11142. function validRange (range, options) {
  11143. try {
  11144. // Return '*' instead of '' so that truthiness works.
  11145. // This will throw if it's invalid anyway
  11146. return new Range(range, options).range || '*'
  11147. } catch (er) {
  11148. return null
  11149. }
  11150. }
  11151. // Determine if version is less than all the versions possible in the range
  11152. exports.ltr = ltr
  11153. function ltr (version, range, options) {
  11154. return outside(version, range, '<', options)
  11155. }
  11156. // Determine if version is greater than all the versions possible in the range.
  11157. exports.gtr = gtr
  11158. function gtr (version, range, options) {
  11159. return outside(version, range, '>', options)
  11160. }
  11161. exports.outside = outside
  11162. function outside (version, range, hilo, options) {
  11163. version = new SemVer(version, options)
  11164. range = new Range(range, options)
  11165. var gtfn, ltefn, ltfn, comp, ecomp
  11166. switch (hilo) {
  11167. case '>':
  11168. gtfn = gt
  11169. ltefn = lte
  11170. ltfn = lt
  11171. comp = '>'
  11172. ecomp = '>='
  11173. break
  11174. case '<':
  11175. gtfn = lt
  11176. ltefn = gte
  11177. ltfn = gt
  11178. comp = '<'
  11179. ecomp = '<='
  11180. break
  11181. default:
  11182. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11183. }
  11184. // If it satisifes the range it is not outside
  11185. if (satisfies(version, range, options)) {
  11186. return false
  11187. }
  11188. // From now on, variable terms are as if we're in "gtr" mode.
  11189. // but note that everything is flipped for the "ltr" function.
  11190. for (var i = 0; i < range.set.length; ++i) {
  11191. var comparators = range.set[i]
  11192. var high = null
  11193. var low = null
  11194. comparators.forEach(function (comparator) {
  11195. if (comparator.semver === ANY) {
  11196. comparator = new Comparator('>=0.0.0')
  11197. }
  11198. high = high || comparator
  11199. low = low || comparator
  11200. if (gtfn(comparator.semver, high.semver, options)) {
  11201. high = comparator
  11202. } else if (ltfn(comparator.semver, low.semver, options)) {
  11203. low = comparator
  11204. }
  11205. })
  11206. // If the edge version comparator has a operator then our version
  11207. // isn't outside it
  11208. if (high.operator === comp || high.operator === ecomp) {
  11209. return false
  11210. }
  11211. // If the lowest version comparator has an operator and our version
  11212. // is less than it then it isn't higher than the range
  11213. if ((!low.operator || low.operator === comp) &&
  11214. ltefn(version, low.semver)) {
  11215. return false
  11216. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11217. return false
  11218. }
  11219. }
  11220. return true
  11221. }
  11222. exports.prerelease = prerelease
  11223. function prerelease (version, options) {
  11224. var parsed = parse(version, options)
  11225. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11226. }
  11227. exports.intersects = intersects
  11228. function intersects (r1, r2, options) {
  11229. r1 = new Range(r1, options)
  11230. r2 = new Range(r2, options)
  11231. return r1.intersects(r2)
  11232. }
  11233. exports.coerce = coerce
  11234. function coerce (version, options) {
  11235. if (version instanceof SemVer) {
  11236. return version
  11237. }
  11238. if (typeof version === 'number') {
  11239. version = String(version)
  11240. }
  11241. if (typeof version !== 'string') {
  11242. return null
  11243. }
  11244. options = options || {}
  11245. var match = null
  11246. if (!options.rtl) {
  11247. match = version.match(re[t.COERCE])
  11248. } else {
  11249. // Find the right-most coercible string that does not share
  11250. // a terminus with a more left-ward coercible string.
  11251. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11252. //
  11253. // Walk through the string checking with a /g regexp
  11254. // Manually set the index so as to pick up overlapping matches.
  11255. // Stop when we get a match that ends at the string end, since no
  11256. // coercible string can be more right-ward without the same terminus.
  11257. var next
  11258. while ((next = re[t.COERCERTL].exec(version)) &&
  11259. (!match || match.index + match[0].length !== version.length)
  11260. ) {
  11261. if (!match ||
  11262. next.index + next[0].length !== match.index + match[0].length) {
  11263. match = next
  11264. }
  11265. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11266. }
  11267. // leave it in a clean state
  11268. re[t.COERCERTL].lastIndex = -1
  11269. }
  11270. if (match === null) {
  11271. return null
  11272. }
  11273. return parse(match[2] +
  11274. '.' + (match[3] || '0') +
  11275. '.' + (match[4] || '0'), options)
  11276. }
  11277. /***/ }),
  11278. /***/ 669:
  11279. /***/ (function(module) {
  11280. module.exports = require("util");
  11281. /***/ }),
  11282. /***/ 672:
  11283. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11284. "use strict";
  11285. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11286. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11287. return new (P || (P = Promise))(function (resolve, reject) {
  11288. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11289. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11290. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11291. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11292. });
  11293. };
  11294. var _a;
  11295. Object.defineProperty(exports, "__esModule", { value: true });
  11296. const assert_1 = __webpack_require__(357);
  11297. const fs = __webpack_require__(747);
  11298. const path = __webpack_require__(622);
  11299. _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;
  11300. exports.IS_WINDOWS = process.platform === 'win32';
  11301. function exists(fsPath) {
  11302. return __awaiter(this, void 0, void 0, function* () {
  11303. try {
  11304. yield exports.stat(fsPath);
  11305. }
  11306. catch (err) {
  11307. if (err.code === 'ENOENT') {
  11308. return false;
  11309. }
  11310. throw err;
  11311. }
  11312. return true;
  11313. });
  11314. }
  11315. exports.exists = exists;
  11316. function isDirectory(fsPath, useStat = false) {
  11317. return __awaiter(this, void 0, void 0, function* () {
  11318. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11319. return stats.isDirectory();
  11320. });
  11321. }
  11322. exports.isDirectory = isDirectory;
  11323. /**
  11324. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11325. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11326. */
  11327. function isRooted(p) {
  11328. p = normalizeSeparators(p);
  11329. if (!p) {
  11330. throw new Error('isRooted() parameter "p" cannot be empty');
  11331. }
  11332. if (exports.IS_WINDOWS) {
  11333. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11334. ); // e.g. C: or C:\hello
  11335. }
  11336. return p.startsWith('/');
  11337. }
  11338. exports.isRooted = isRooted;
  11339. /**
  11340. * Recursively create a directory at `fsPath`.
  11341. *
  11342. * This implementation is optimistic, meaning it attempts to create the full
  11343. * path first, and backs up the path stack from there.
  11344. *
  11345. * @param fsPath The path to create
  11346. * @param maxDepth The maximum recursion depth
  11347. * @param depth The current recursion depth
  11348. */
  11349. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11350. return __awaiter(this, void 0, void 0, function* () {
  11351. assert_1.ok(fsPath, 'a path argument must be provided');
  11352. fsPath = path.resolve(fsPath);
  11353. if (depth >= maxDepth)
  11354. return exports.mkdir(fsPath);
  11355. try {
  11356. yield exports.mkdir(fsPath);
  11357. return;
  11358. }
  11359. catch (err) {
  11360. switch (err.code) {
  11361. case 'ENOENT': {
  11362. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11363. yield exports.mkdir(fsPath);
  11364. return;
  11365. }
  11366. default: {
  11367. let stats;
  11368. try {
  11369. stats = yield exports.stat(fsPath);
  11370. }
  11371. catch (err2) {
  11372. throw err;
  11373. }
  11374. if (!stats.isDirectory())
  11375. throw err;
  11376. }
  11377. }
  11378. }
  11379. });
  11380. }
  11381. exports.mkdirP = mkdirP;
  11382. /**
  11383. * Best effort attempt to determine whether a file exists and is executable.
  11384. * @param filePath file path to check
  11385. * @param extensions additional file extensions to try
  11386. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11387. */
  11388. function tryGetExecutablePath(filePath, extensions) {
  11389. return __awaiter(this, void 0, void 0, function* () {
  11390. let stats = undefined;
  11391. try {
  11392. // test file exists
  11393. stats = yield exports.stat(filePath);
  11394. }
  11395. catch (err) {
  11396. if (err.code !== 'ENOENT') {
  11397. // eslint-disable-next-line no-console
  11398. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11399. }
  11400. }
  11401. if (stats && stats.isFile()) {
  11402. if (exports.IS_WINDOWS) {
  11403. // on Windows, test for valid extension
  11404. const upperExt = path.extname(filePath).toUpperCase();
  11405. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11406. return filePath;
  11407. }
  11408. }
  11409. else {
  11410. if (isUnixExecutable(stats)) {
  11411. return filePath;
  11412. }
  11413. }
  11414. }
  11415. // try each extension
  11416. const originalFilePath = filePath;
  11417. for (const extension of extensions) {
  11418. filePath = originalFilePath + extension;
  11419. stats = undefined;
  11420. try {
  11421. stats = yield exports.stat(filePath);
  11422. }
  11423. catch (err) {
  11424. if (err.code !== 'ENOENT') {
  11425. // eslint-disable-next-line no-console
  11426. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11427. }
  11428. }
  11429. if (stats && stats.isFile()) {
  11430. if (exports.IS_WINDOWS) {
  11431. // preserve the case of the actual file (since an extension was appended)
  11432. try {
  11433. const directory = path.dirname(filePath);
  11434. const upperName = path.basename(filePath).toUpperCase();
  11435. for (const actualName of yield exports.readdir(directory)) {
  11436. if (upperName === actualName.toUpperCase()) {
  11437. filePath = path.join(directory, actualName);
  11438. break;
  11439. }
  11440. }
  11441. }
  11442. catch (err) {
  11443. // eslint-disable-next-line no-console
  11444. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11445. }
  11446. return filePath;
  11447. }
  11448. else {
  11449. if (isUnixExecutable(stats)) {
  11450. return filePath;
  11451. }
  11452. }
  11453. }
  11454. }
  11455. return '';
  11456. });
  11457. }
  11458. exports.tryGetExecutablePath = tryGetExecutablePath;
  11459. function normalizeSeparators(p) {
  11460. p = p || '';
  11461. if (exports.IS_WINDOWS) {
  11462. // convert slashes on Windows
  11463. p = p.replace(/\//g, '\\');
  11464. // remove redundant slashes
  11465. return p.replace(/\\\\+/g, '\\');
  11466. }
  11467. // remove redundant slashes
  11468. return p.replace(/\/\/+/g, '/');
  11469. }
  11470. // on Mac/Linux, test the execute bit
  11471. // R W X R W X R W X
  11472. // 256 128 64 32 16 8 4 2 1
  11473. function isUnixExecutable(stats) {
  11474. return ((stats.mode & 1) > 0 ||
  11475. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11476. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11477. }
  11478. //# sourceMappingURL=io-util.js.map
  11479. /***/ }),
  11480. /***/ 674:
  11481. /***/ (function(module, __unusedexports, __webpack_require__) {
  11482. module.exports = authenticate;
  11483. const { Deprecation } = __webpack_require__(692);
  11484. const once = __webpack_require__(969);
  11485. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11486. function authenticate(state, options) {
  11487. deprecateAuthenticate(
  11488. state.octokit.log,
  11489. new Deprecation(
  11490. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11491. )
  11492. );
  11493. if (!options) {
  11494. state.auth = false;
  11495. return;
  11496. }
  11497. switch (options.type) {
  11498. case "basic":
  11499. if (!options.username || !options.password) {
  11500. throw new Error(
  11501. "Basic authentication requires both a username and password to be set"
  11502. );
  11503. }
  11504. break;
  11505. case "oauth":
  11506. if (!options.token && !(options.key && options.secret)) {
  11507. throw new Error(
  11508. "OAuth2 authentication requires a token or key & secret to be set"
  11509. );
  11510. }
  11511. break;
  11512. case "token":
  11513. case "app":
  11514. if (!options.token) {
  11515. throw new Error("Token authentication requires a token to be set");
  11516. }
  11517. break;
  11518. default:
  11519. throw new Error(
  11520. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11521. );
  11522. }
  11523. state.auth = options;
  11524. }
  11525. /***/ }),
  11526. /***/ 675:
  11527. /***/ (function(module) {
  11528. module.exports = function btoa(str) {
  11529. return new Buffer(str).toString('base64')
  11530. }
  11531. /***/ }),
  11532. /***/ 692:
  11533. /***/ (function(__unusedmodule, exports) {
  11534. "use strict";
  11535. Object.defineProperty(exports, '__esModule', { value: true });
  11536. class Deprecation extends Error {
  11537. constructor(message) {
  11538. super(message); // Maintains proper stack trace (only available on V8)
  11539. /* istanbul ignore next */
  11540. if (Error.captureStackTrace) {
  11541. Error.captureStackTrace(this, this.constructor);
  11542. }
  11543. this.name = 'Deprecation';
  11544. }
  11545. }
  11546. exports.Deprecation = Deprecation;
  11547. /***/ }),
  11548. /***/ 696:
  11549. /***/ (function(module) {
  11550. "use strict";
  11551. /*!
  11552. * isobject <https://github.com/jonschlinkert/isobject>
  11553. *
  11554. * Copyright (c) 2014-2017, Jon Schlinkert.
  11555. * Released under the MIT License.
  11556. */
  11557. function isObject(val) {
  11558. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11559. }
  11560. /*!
  11561. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11562. *
  11563. * Copyright (c) 2014-2017, Jon Schlinkert.
  11564. * Released under the MIT License.
  11565. */
  11566. function isObjectObject(o) {
  11567. return isObject(o) === true
  11568. && Object.prototype.toString.call(o) === '[object Object]';
  11569. }
  11570. function isPlainObject(o) {
  11571. var ctor,prot;
  11572. if (isObjectObject(o) === false) return false;
  11573. // If has modified constructor
  11574. ctor = o.constructor;
  11575. if (typeof ctor !== 'function') return false;
  11576. // If has modified prototype
  11577. prot = ctor.prototype;
  11578. if (isObjectObject(prot) === false) return false;
  11579. // If constructor does not have an Object-specific method
  11580. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11581. return false;
  11582. }
  11583. // Most likely a plain Object
  11584. return true;
  11585. }
  11586. module.exports = isPlainObject;
  11587. /***/ }),
  11588. /***/ 697:
  11589. /***/ (function(module) {
  11590. "use strict";
  11591. module.exports = (promise, onFinally) => {
  11592. onFinally = onFinally || (() => {});
  11593. return promise.then(
  11594. val => new Promise(resolve => {
  11595. resolve(onFinally());
  11596. }).then(() => val),
  11597. err => new Promise(resolve => {
  11598. resolve(onFinally());
  11599. }).then(() => {
  11600. throw err;
  11601. })
  11602. );
  11603. };
  11604. /***/ }),
  11605. /***/ 705:
  11606. /***/ (function(module) {
  11607. 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"}}};
  11608. /***/ }),
  11609. /***/ 722:
  11610. /***/ (function(module) {
  11611. /**
  11612. * Convert array of 16 byte values to UUID string format of the form:
  11613. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11614. */
  11615. var byteToHex = [];
  11616. for (var i = 0; i < 256; ++i) {
  11617. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11618. }
  11619. function bytesToUuid(buf, offset) {
  11620. var i = offset || 0;
  11621. var bth = byteToHex;
  11622. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11623. return ([bth[buf[i++]], bth[buf[i++]],
  11624. bth[buf[i++]], bth[buf[i++]], '-',
  11625. bth[buf[i++]], bth[buf[i++]], '-',
  11626. bth[buf[i++]], bth[buf[i++]], '-',
  11627. bth[buf[i++]], bth[buf[i++]], '-',
  11628. bth[buf[i++]], bth[buf[i++]],
  11629. bth[buf[i++]], bth[buf[i++]],
  11630. bth[buf[i++]], bth[buf[i++]]]).join('');
  11631. }
  11632. module.exports = bytesToUuid;
  11633. /***/ }),
  11634. /***/ 742:
  11635. /***/ (function(module, __unusedexports, __webpack_require__) {
  11636. var fs = __webpack_require__(747)
  11637. var core
  11638. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11639. core = __webpack_require__(818)
  11640. } else {
  11641. core = __webpack_require__(197)
  11642. }
  11643. module.exports = isexe
  11644. isexe.sync = sync
  11645. function isexe (path, options, cb) {
  11646. if (typeof options === 'function') {
  11647. cb = options
  11648. options = {}
  11649. }
  11650. if (!cb) {
  11651. if (typeof Promise !== 'function') {
  11652. throw new TypeError('callback not provided')
  11653. }
  11654. return new Promise(function (resolve, reject) {
  11655. isexe(path, options || {}, function (er, is) {
  11656. if (er) {
  11657. reject(er)
  11658. } else {
  11659. resolve(is)
  11660. }
  11661. })
  11662. })
  11663. }
  11664. core(path, options || {}, function (er, is) {
  11665. // ignore EACCES because that just means we aren't allowed to run it
  11666. if (er) {
  11667. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11668. er = null
  11669. is = false
  11670. }
  11671. }
  11672. cb(er, is)
  11673. })
  11674. }
  11675. function sync (path, options) {
  11676. // my kingdom for a filtered catch
  11677. try {
  11678. return core.sync(path, options || {})
  11679. } catch (er) {
  11680. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11681. return false
  11682. } else {
  11683. throw er
  11684. }
  11685. }
  11686. }
  11687. /***/ }),
  11688. /***/ 747:
  11689. /***/ (function(module) {
  11690. module.exports = require("fs");
  11691. /***/ }),
  11692. /***/ 753:
  11693. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11694. "use strict";
  11695. Object.defineProperty(exports, '__esModule', { value: true });
  11696. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11697. var endpoint = __webpack_require__(385);
  11698. var universalUserAgent = __webpack_require__(796);
  11699. var isPlainObject = _interopDefault(__webpack_require__(696));
  11700. var nodeFetch = _interopDefault(__webpack_require__(454));
  11701. var requestError = __webpack_require__(463);
  11702. const VERSION = "5.3.1";
  11703. function getBufferResponse(response) {
  11704. return response.arrayBuffer();
  11705. }
  11706. function fetchWrapper(requestOptions) {
  11707. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11708. requestOptions.body = JSON.stringify(requestOptions.body);
  11709. }
  11710. let headers = {};
  11711. let status;
  11712. let url;
  11713. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11714. return fetch(requestOptions.url, Object.assign({
  11715. method: requestOptions.method,
  11716. body: requestOptions.body,
  11717. headers: requestOptions.headers,
  11718. redirect: requestOptions.redirect
  11719. }, requestOptions.request)).then(response => {
  11720. url = response.url;
  11721. status = response.status;
  11722. for (const keyAndValue of response.headers) {
  11723. headers[keyAndValue[0]] = keyAndValue[1];
  11724. }
  11725. if (status === 204 || status === 205) {
  11726. return;
  11727. } // GitHub API returns 200 for HEAD requsets
  11728. if (requestOptions.method === "HEAD") {
  11729. if (status < 400) {
  11730. return;
  11731. }
  11732. throw new requestError.RequestError(response.statusText, status, {
  11733. headers,
  11734. request: requestOptions
  11735. });
  11736. }
  11737. if (status === 304) {
  11738. throw new requestError.RequestError("Not modified", status, {
  11739. headers,
  11740. request: requestOptions
  11741. });
  11742. }
  11743. if (status >= 400) {
  11744. return response.text().then(message => {
  11745. const error = new requestError.RequestError(message, status, {
  11746. headers,
  11747. request: requestOptions
  11748. });
  11749. try {
  11750. let responseBody = JSON.parse(error.message);
  11751. Object.assign(error, responseBody);
  11752. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11753. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11754. } catch (e) {// ignore, see octokit/rest.js#684
  11755. }
  11756. throw error;
  11757. });
  11758. }
  11759. const contentType = response.headers.get("content-type");
  11760. if (/application\/json/.test(contentType)) {
  11761. return response.json();
  11762. }
  11763. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11764. return response.text();
  11765. }
  11766. return getBufferResponse(response);
  11767. }).then(data => {
  11768. return {
  11769. status,
  11770. url,
  11771. headers,
  11772. data
  11773. };
  11774. }).catch(error => {
  11775. if (error instanceof requestError.RequestError) {
  11776. throw error;
  11777. }
  11778. throw new requestError.RequestError(error.message, 500, {
  11779. headers,
  11780. request: requestOptions
  11781. });
  11782. });
  11783. }
  11784. function withDefaults(oldEndpoint, newDefaults) {
  11785. const endpoint = oldEndpoint.defaults(newDefaults);
  11786. const newApi = function (route, parameters) {
  11787. const endpointOptions = endpoint.merge(route, parameters);
  11788. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11789. return fetchWrapper(endpoint.parse(endpointOptions));
  11790. }
  11791. const request = (route, parameters) => {
  11792. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11793. };
  11794. Object.assign(request, {
  11795. endpoint,
  11796. defaults: withDefaults.bind(null, endpoint)
  11797. });
  11798. return endpointOptions.request.hook(request, endpointOptions);
  11799. };
  11800. return Object.assign(newApi, {
  11801. endpoint,
  11802. defaults: withDefaults.bind(null, endpoint)
  11803. });
  11804. }
  11805. const request = withDefaults(endpoint.endpoint, {
  11806. headers: {
  11807. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11808. }
  11809. });
  11810. exports.request = request;
  11811. //# sourceMappingURL=index.js.map
  11812. /***/ }),
  11813. /***/ 761:
  11814. /***/ (function(module) {
  11815. module.exports = require("zlib");
  11816. /***/ }),
  11817. /***/ 763:
  11818. /***/ (function(module) {
  11819. module.exports = removeHook
  11820. function removeHook (state, name, method) {
  11821. if (!state.registry[name]) {
  11822. return
  11823. }
  11824. var index = state.registry[name]
  11825. .map(function (registered) { return registered.orig })
  11826. .indexOf(method)
  11827. if (index === -1) {
  11828. return
  11829. }
  11830. state.registry[name].splice(index, 1)
  11831. }
  11832. /***/ }),
  11833. /***/ 768:
  11834. /***/ (function(module) {
  11835. "use strict";
  11836. module.exports = function (x) {
  11837. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11838. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11839. if (x[x.length - 1] === lf) {
  11840. x = x.slice(0, x.length - 1);
  11841. }
  11842. if (x[x.length - 1] === cr) {
  11843. x = x.slice(0, x.length - 1);
  11844. }
  11845. return x;
  11846. };
  11847. /***/ }),
  11848. /***/ 777:
  11849. /***/ (function(module, __unusedexports, __webpack_require__) {
  11850. module.exports = getFirstPage
  11851. const getPage = __webpack_require__(265)
  11852. function getFirstPage (octokit, link, headers) {
  11853. return getPage(octokit, link, 'first', headers)
  11854. }
  11855. /***/ }),
  11856. /***/ 796:
  11857. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11858. "use strict";
  11859. Object.defineProperty(exports, '__esModule', { value: true });
  11860. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11861. var osName = _interopDefault(__webpack_require__(2));
  11862. function getUserAgent() {
  11863. try {
  11864. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  11865. } catch (error) {
  11866. if (/wmic os get Caption/.test(error.message)) {
  11867. return "Windows <version undetectable>";
  11868. }
  11869. throw error;
  11870. }
  11871. }
  11872. exports.getUserAgent = getUserAgent;
  11873. //# sourceMappingURL=index.js.map
  11874. /***/ }),
  11875. /***/ 807:
  11876. /***/ (function(module, __unusedexports, __webpack_require__) {
  11877. module.exports = paginate;
  11878. const iterator = __webpack_require__(8);
  11879. function paginate(octokit, route, options, mapFn) {
  11880. if (typeof options === "function") {
  11881. mapFn = options;
  11882. options = undefined;
  11883. }
  11884. options = octokit.request.endpoint.merge(route, options);
  11885. return gather(
  11886. octokit,
  11887. [],
  11888. iterator(octokit, options)[Symbol.asyncIterator](),
  11889. mapFn
  11890. );
  11891. }
  11892. function gather(octokit, results, iterator, mapFn) {
  11893. return iterator.next().then(result => {
  11894. if (result.done) {
  11895. return results;
  11896. }
  11897. let earlyExit = false;
  11898. function done() {
  11899. earlyExit = true;
  11900. }
  11901. results = results.concat(
  11902. mapFn ? mapFn(result.value, done) : result.value.data
  11903. );
  11904. if (earlyExit) {
  11905. return results;
  11906. }
  11907. return gather(octokit, results, iterator, mapFn);
  11908. });
  11909. }
  11910. /***/ }),
  11911. /***/ 813:
  11912. /***/ (function(__unusedmodule, exports) {
  11913. "use strict";
  11914. Object.defineProperty(exports, '__esModule', { value: true });
  11915. async function auth(token) {
  11916. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  11917. return {
  11918. type: "token",
  11919. token: token,
  11920. tokenType
  11921. };
  11922. }
  11923. /**
  11924. * Prefix token for usage in the Authorization header
  11925. *
  11926. * @param token OAuth token or JSON Web Token
  11927. */
  11928. function withAuthorizationPrefix(token) {
  11929. if (token.split(/\./).length === 3) {
  11930. return `bearer ${token}`;
  11931. }
  11932. return `token ${token}`;
  11933. }
  11934. async function hook(token, request, route, parameters) {
  11935. const endpoint = request.endpoint.merge(route, parameters);
  11936. endpoint.headers.authorization = withAuthorizationPrefix(token);
  11937. return request(endpoint);
  11938. }
  11939. const createTokenAuth = function createTokenAuth(token) {
  11940. if (!token) {
  11941. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  11942. }
  11943. if (typeof token !== "string") {
  11944. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  11945. }
  11946. token = token.replace(/^(token|bearer) +/i, "");
  11947. return Object.assign(auth.bind(null, token), {
  11948. hook: hook.bind(null, token)
  11949. });
  11950. };
  11951. exports.createTokenAuth = createTokenAuth;
  11952. //# sourceMappingURL=index.js.map
  11953. /***/ }),
  11954. /***/ 814:
  11955. /***/ (function(module, __unusedexports, __webpack_require__) {
  11956. module.exports = which
  11957. which.sync = whichSync
  11958. var isWindows = process.platform === 'win32' ||
  11959. process.env.OSTYPE === 'cygwin' ||
  11960. process.env.OSTYPE === 'msys'
  11961. var path = __webpack_require__(622)
  11962. var COLON = isWindows ? ';' : ':'
  11963. var isexe = __webpack_require__(742)
  11964. function getNotFoundError (cmd) {
  11965. var er = new Error('not found: ' + cmd)
  11966. er.code = 'ENOENT'
  11967. return er
  11968. }
  11969. function getPathInfo (cmd, opt) {
  11970. var colon = opt.colon || COLON
  11971. var pathEnv = opt.path || process.env.PATH || ''
  11972. var pathExt = ['']
  11973. pathEnv = pathEnv.split(colon)
  11974. var pathExtExe = ''
  11975. if (isWindows) {
  11976. pathEnv.unshift(process.cwd())
  11977. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  11978. pathExt = pathExtExe.split(colon)
  11979. // Always test the cmd itself first. isexe will check to make sure
  11980. // it's found in the pathExt set.
  11981. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  11982. pathExt.unshift('')
  11983. }
  11984. // If it has a slash, then we don't bother searching the pathenv.
  11985. // just check the file itself, and that's it.
  11986. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  11987. pathEnv = ['']
  11988. return {
  11989. env: pathEnv,
  11990. ext: pathExt,
  11991. extExe: pathExtExe
  11992. }
  11993. }
  11994. function which (cmd, opt, cb) {
  11995. if (typeof opt === 'function') {
  11996. cb = opt
  11997. opt = {}
  11998. }
  11999. var info = getPathInfo(cmd, opt)
  12000. var pathEnv = info.env
  12001. var pathExt = info.ext
  12002. var pathExtExe = info.extExe
  12003. var found = []
  12004. ;(function F (i, l) {
  12005. if (i === l) {
  12006. if (opt.all && found.length)
  12007. return cb(null, found)
  12008. else
  12009. return cb(getNotFoundError(cmd))
  12010. }
  12011. var pathPart = pathEnv[i]
  12012. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12013. pathPart = pathPart.slice(1, -1)
  12014. var p = path.join(pathPart, cmd)
  12015. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  12016. p = cmd.slice(0, 2) + p
  12017. }
  12018. ;(function E (ii, ll) {
  12019. if (ii === ll) return F(i + 1, l)
  12020. var ext = pathExt[ii]
  12021. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  12022. if (!er && is) {
  12023. if (opt.all)
  12024. found.push(p + ext)
  12025. else
  12026. return cb(null, p + ext)
  12027. }
  12028. return E(ii + 1, ll)
  12029. })
  12030. })(0, pathExt.length)
  12031. })(0, pathEnv.length)
  12032. }
  12033. function whichSync (cmd, opt) {
  12034. opt = opt || {}
  12035. var info = getPathInfo(cmd, opt)
  12036. var pathEnv = info.env
  12037. var pathExt = info.ext
  12038. var pathExtExe = info.extExe
  12039. var found = []
  12040. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  12041. var pathPart = pathEnv[i]
  12042. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  12043. pathPart = pathPart.slice(1, -1)
  12044. var p = path.join(pathPart, cmd)
  12045. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  12046. p = cmd.slice(0, 2) + p
  12047. }
  12048. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  12049. var cur = p + pathExt[j]
  12050. var is
  12051. try {
  12052. is = isexe.sync(cur, { pathExt: pathExtExe })
  12053. if (is) {
  12054. if (opt.all)
  12055. found.push(cur)
  12056. else
  12057. return cur
  12058. }
  12059. } catch (ex) {}
  12060. }
  12061. }
  12062. if (opt.all && found.length)
  12063. return found
  12064. if (opt.nothrow)
  12065. return null
  12066. throw getNotFoundError(cmd)
  12067. }
  12068. /***/ }),
  12069. /***/ 816:
  12070. /***/ (function(module) {
  12071. "use strict";
  12072. module.exports = /^#!.*/;
  12073. /***/ }),
  12074. /***/ 818:
  12075. /***/ (function(module, __unusedexports, __webpack_require__) {
  12076. module.exports = isexe
  12077. isexe.sync = sync
  12078. var fs = __webpack_require__(747)
  12079. function checkPathExt (path, options) {
  12080. var pathext = options.pathExt !== undefined ?
  12081. options.pathExt : process.env.PATHEXT
  12082. if (!pathext) {
  12083. return true
  12084. }
  12085. pathext = pathext.split(';')
  12086. if (pathext.indexOf('') !== -1) {
  12087. return true
  12088. }
  12089. for (var i = 0; i < pathext.length; i++) {
  12090. var p = pathext[i].toLowerCase()
  12091. if (p && path.substr(-p.length).toLowerCase() === p) {
  12092. return true
  12093. }
  12094. }
  12095. return false
  12096. }
  12097. function checkStat (stat, path, options) {
  12098. if (!stat.isSymbolicLink() && !stat.isFile()) {
  12099. return false
  12100. }
  12101. return checkPathExt(path, options)
  12102. }
  12103. function isexe (path, options, cb) {
  12104. fs.stat(path, function (er, stat) {
  12105. cb(er, er ? false : checkStat(stat, path, options))
  12106. })
  12107. }
  12108. function sync (path, options) {
  12109. return checkStat(fs.statSync(path), path, options)
  12110. }
  12111. /***/ }),
  12112. /***/ 821:
  12113. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12114. "use strict";
  12115. var __importStar = (this && this.__importStar) || function (mod) {
  12116. if (mod && mod.__esModule) return mod;
  12117. var result = {};
  12118. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  12119. result["default"] = mod;
  12120. return result;
  12121. };
  12122. Object.defineProperty(exports, "__esModule", { value: true });
  12123. const core = __importStar(__webpack_require__(470));
  12124. const fsHelper = __importStar(__webpack_require__(618));
  12125. const github = __importStar(__webpack_require__(469));
  12126. const path = __importStar(__webpack_require__(622));
  12127. const hostname = 'github.com';
  12128. function getInputs() {
  12129. const result = {};
  12130. // GitHub workspace
  12131. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  12132. if (!githubWorkspacePath) {
  12133. throw new Error('GITHUB_WORKSPACE not defined');
  12134. }
  12135. githubWorkspacePath = path.resolve(githubWorkspacePath);
  12136. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  12137. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  12138. // Qualified repository
  12139. const qualifiedRepository = core.getInput('repository') ||
  12140. `${github.context.repo.owner}/${github.context.repo.repo}`;
  12141. core.debug(`qualified repository = '${qualifiedRepository}'`);
  12142. const splitRepository = qualifiedRepository.split('/');
  12143. if (splitRepository.length !== 2 ||
  12144. !splitRepository[0] ||
  12145. !splitRepository[1]) {
  12146. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  12147. }
  12148. result.repositoryOwner = splitRepository[0];
  12149. result.repositoryName = splitRepository[1];
  12150. // Repository path
  12151. result.repositoryPath = core.getInput('path') || '.';
  12152. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12153. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12154. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12155. }
  12156. // Workflow repository?
  12157. result.isWorkflowRepository =
  12158. qualifiedRepository.toUpperCase() ===
  12159. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12160. // Source branch, source version
  12161. result.ref = core.getInput('ref');
  12162. if (!result.ref) {
  12163. if (result.isWorkflowRepository) {
  12164. result.ref = github.context.ref;
  12165. result.commit = github.context.sha;
  12166. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12167. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12168. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12169. result.ref = `refs/heads/${result.ref}`;
  12170. }
  12171. }
  12172. if (!result.ref && !result.commit) {
  12173. result.ref = 'refs/heads/master';
  12174. }
  12175. }
  12176. // SHA?
  12177. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12178. result.commit = result.ref;
  12179. result.ref = '';
  12180. }
  12181. core.debug(`ref = '${result.ref}'`);
  12182. core.debug(`commit = '${result.commit}'`);
  12183. // Clean
  12184. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12185. core.debug(`clean = ${result.clean}`);
  12186. // Fetch depth
  12187. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12188. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12189. result.fetchDepth = 0;
  12190. }
  12191. core.debug(`fetch depth = ${result.fetchDepth}`);
  12192. // LFS
  12193. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12194. core.debug(`lfs = ${result.lfs}`);
  12195. // Submodules
  12196. result.submodules = false;
  12197. result.nestedSubmodules = false;
  12198. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12199. if (submodulesString == 'RECURSIVE') {
  12200. result.submodules = true;
  12201. result.nestedSubmodules = true;
  12202. }
  12203. else if (submodulesString == 'TRUE') {
  12204. result.submodules = true;
  12205. }
  12206. core.debug(`submodules = ${result.submodules}`);
  12207. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12208. // Auth token
  12209. result.authToken = core.getInput('token');
  12210. // SSH
  12211. result.sshKey = core.getInput('ssh-key');
  12212. result.sshKnownHosts = core.getInput('ssh-known-hosts');
  12213. result.sshStrict =
  12214. (core.getInput('ssh-strict') || 'true').toUpperCase() === 'TRUE';
  12215. // Persist credentials
  12216. result.persistCredentials =
  12217. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12218. return result;
  12219. }
  12220. exports.getInputs = getInputs;
  12221. /***/ }),
  12222. /***/ 826:
  12223. /***/ (function(module, __unusedexports, __webpack_require__) {
  12224. var rng = __webpack_require__(139);
  12225. var bytesToUuid = __webpack_require__(722);
  12226. function v4(options, buf, offset) {
  12227. var i = buf && offset || 0;
  12228. if (typeof(options) == 'string') {
  12229. buf = options === 'binary' ? new Array(16) : null;
  12230. options = null;
  12231. }
  12232. options = options || {};
  12233. var rnds = options.random || (options.rng || rng)();
  12234. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12235. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12236. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12237. // Copy bytes to buffer, if provided
  12238. if (buf) {
  12239. for (var ii = 0; ii < 16; ++ii) {
  12240. buf[i + ii] = rnds[ii];
  12241. }
  12242. }
  12243. return buf || bytesToUuid(rnds);
  12244. }
  12245. module.exports = v4;
  12246. /***/ }),
  12247. /***/ 835:
  12248. /***/ (function(module) {
  12249. module.exports = require("url");
  12250. /***/ }),
  12251. /***/ 850:
  12252. /***/ (function(module, __unusedexports, __webpack_require__) {
  12253. module.exports = paginationMethodsPlugin
  12254. function paginationMethodsPlugin (octokit) {
  12255. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  12256. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  12257. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  12258. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  12259. octokit.hasFirstPage = __webpack_require__(536)
  12260. octokit.hasLastPage = __webpack_require__(336)
  12261. octokit.hasNextPage = __webpack_require__(929)
  12262. octokit.hasPreviousPage = __webpack_require__(558)
  12263. }
  12264. /***/ }),
  12265. /***/ 854:
  12266. /***/ (function(module) {
  12267. /**
  12268. * lodash (Custom Build) <https://lodash.com/>
  12269. * Build: `lodash modularize exports="npm" -o ./`
  12270. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12271. * Released under MIT license <https://lodash.com/license>
  12272. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12273. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12274. */
  12275. /** Used as the `TypeError` message for "Functions" methods. */
  12276. var FUNC_ERROR_TEXT = 'Expected a function';
  12277. /** Used to stand-in for `undefined` hash values. */
  12278. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12279. /** Used as references for various `Number` constants. */
  12280. var INFINITY = 1 / 0;
  12281. /** `Object#toString` result references. */
  12282. var funcTag = '[object Function]',
  12283. genTag = '[object GeneratorFunction]',
  12284. symbolTag = '[object Symbol]';
  12285. /** Used to match property names within property paths. */
  12286. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12287. reIsPlainProp = /^\w*$/,
  12288. reLeadingDot = /^\./,
  12289. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12290. /**
  12291. * Used to match `RegExp`
  12292. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12293. */
  12294. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12295. /** Used to match backslashes in property paths. */
  12296. var reEscapeChar = /\\(\\)?/g;
  12297. /** Used to detect host constructors (Safari). */
  12298. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12299. /** Detect free variable `global` from Node.js. */
  12300. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12301. /** Detect free variable `self`. */
  12302. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12303. /** Used as a reference to the global object. */
  12304. var root = freeGlobal || freeSelf || Function('return this')();
  12305. /**
  12306. * Gets the value at `key` of `object`.
  12307. *
  12308. * @private
  12309. * @param {Object} [object] The object to query.
  12310. * @param {string} key The key of the property to get.
  12311. * @returns {*} Returns the property value.
  12312. */
  12313. function getValue(object, key) {
  12314. return object == null ? undefined : object[key];
  12315. }
  12316. /**
  12317. * Checks if `value` is a host object in IE < 9.
  12318. *
  12319. * @private
  12320. * @param {*} value The value to check.
  12321. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12322. */
  12323. function isHostObject(value) {
  12324. // Many host objects are `Object` objects that can coerce to strings
  12325. // despite having improperly defined `toString` methods.
  12326. var result = false;
  12327. if (value != null && typeof value.toString != 'function') {
  12328. try {
  12329. result = !!(value + '');
  12330. } catch (e) {}
  12331. }
  12332. return result;
  12333. }
  12334. /** Used for built-in method references. */
  12335. var arrayProto = Array.prototype,
  12336. funcProto = Function.prototype,
  12337. objectProto = Object.prototype;
  12338. /** Used to detect overreaching core-js shims. */
  12339. var coreJsData = root['__core-js_shared__'];
  12340. /** Used to detect methods masquerading as native. */
  12341. var maskSrcKey = (function() {
  12342. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12343. return uid ? ('Symbol(src)_1.' + uid) : '';
  12344. }());
  12345. /** Used to resolve the decompiled source of functions. */
  12346. var funcToString = funcProto.toString;
  12347. /** Used to check objects for own properties. */
  12348. var hasOwnProperty = objectProto.hasOwnProperty;
  12349. /**
  12350. * Used to resolve the
  12351. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12352. * of values.
  12353. */
  12354. var objectToString = objectProto.toString;
  12355. /** Used to detect if a method is native. */
  12356. var reIsNative = RegExp('^' +
  12357. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12358. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12359. );
  12360. /** Built-in value references. */
  12361. var Symbol = root.Symbol,
  12362. splice = arrayProto.splice;
  12363. /* Built-in method references that are verified to be native. */
  12364. var Map = getNative(root, 'Map'),
  12365. nativeCreate = getNative(Object, 'create');
  12366. /** Used to convert symbols to primitives and strings. */
  12367. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12368. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12369. /**
  12370. * Creates a hash object.
  12371. *
  12372. * @private
  12373. * @constructor
  12374. * @param {Array} [entries] The key-value pairs to cache.
  12375. */
  12376. function Hash(entries) {
  12377. var index = -1,
  12378. length = entries ? entries.length : 0;
  12379. this.clear();
  12380. while (++index < length) {
  12381. var entry = entries[index];
  12382. this.set(entry[0], entry[1]);
  12383. }
  12384. }
  12385. /**
  12386. * Removes all key-value entries from the hash.
  12387. *
  12388. * @private
  12389. * @name clear
  12390. * @memberOf Hash
  12391. */
  12392. function hashClear() {
  12393. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12394. }
  12395. /**
  12396. * Removes `key` and its value from the hash.
  12397. *
  12398. * @private
  12399. * @name delete
  12400. * @memberOf Hash
  12401. * @param {Object} hash The hash to modify.
  12402. * @param {string} key The key of the value to remove.
  12403. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12404. */
  12405. function hashDelete(key) {
  12406. return this.has(key) && delete this.__data__[key];
  12407. }
  12408. /**
  12409. * Gets the hash value for `key`.
  12410. *
  12411. * @private
  12412. * @name get
  12413. * @memberOf Hash
  12414. * @param {string} key The key of the value to get.
  12415. * @returns {*} Returns the entry value.
  12416. */
  12417. function hashGet(key) {
  12418. var data = this.__data__;
  12419. if (nativeCreate) {
  12420. var result = data[key];
  12421. return result === HASH_UNDEFINED ? undefined : result;
  12422. }
  12423. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12424. }
  12425. /**
  12426. * Checks if a hash value for `key` exists.
  12427. *
  12428. * @private
  12429. * @name has
  12430. * @memberOf Hash
  12431. * @param {string} key The key of the entry to check.
  12432. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12433. */
  12434. function hashHas(key) {
  12435. var data = this.__data__;
  12436. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12437. }
  12438. /**
  12439. * Sets the hash `key` to `value`.
  12440. *
  12441. * @private
  12442. * @name set
  12443. * @memberOf Hash
  12444. * @param {string} key The key of the value to set.
  12445. * @param {*} value The value to set.
  12446. * @returns {Object} Returns the hash instance.
  12447. */
  12448. function hashSet(key, value) {
  12449. var data = this.__data__;
  12450. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12451. return this;
  12452. }
  12453. // Add methods to `Hash`.
  12454. Hash.prototype.clear = hashClear;
  12455. Hash.prototype['delete'] = hashDelete;
  12456. Hash.prototype.get = hashGet;
  12457. Hash.prototype.has = hashHas;
  12458. Hash.prototype.set = hashSet;
  12459. /**
  12460. * Creates an list cache object.
  12461. *
  12462. * @private
  12463. * @constructor
  12464. * @param {Array} [entries] The key-value pairs to cache.
  12465. */
  12466. function ListCache(entries) {
  12467. var index = -1,
  12468. length = entries ? entries.length : 0;
  12469. this.clear();
  12470. while (++index < length) {
  12471. var entry = entries[index];
  12472. this.set(entry[0], entry[1]);
  12473. }
  12474. }
  12475. /**
  12476. * Removes all key-value entries from the list cache.
  12477. *
  12478. * @private
  12479. * @name clear
  12480. * @memberOf ListCache
  12481. */
  12482. function listCacheClear() {
  12483. this.__data__ = [];
  12484. }
  12485. /**
  12486. * Removes `key` and its value from the list cache.
  12487. *
  12488. * @private
  12489. * @name delete
  12490. * @memberOf ListCache
  12491. * @param {string} key The key of the value to remove.
  12492. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12493. */
  12494. function listCacheDelete(key) {
  12495. var data = this.__data__,
  12496. index = assocIndexOf(data, key);
  12497. if (index < 0) {
  12498. return false;
  12499. }
  12500. var lastIndex = data.length - 1;
  12501. if (index == lastIndex) {
  12502. data.pop();
  12503. } else {
  12504. splice.call(data, index, 1);
  12505. }
  12506. return true;
  12507. }
  12508. /**
  12509. * Gets the list cache value for `key`.
  12510. *
  12511. * @private
  12512. * @name get
  12513. * @memberOf ListCache
  12514. * @param {string} key The key of the value to get.
  12515. * @returns {*} Returns the entry value.
  12516. */
  12517. function listCacheGet(key) {
  12518. var data = this.__data__,
  12519. index = assocIndexOf(data, key);
  12520. return index < 0 ? undefined : data[index][1];
  12521. }
  12522. /**
  12523. * Checks if a list cache value for `key` exists.
  12524. *
  12525. * @private
  12526. * @name has
  12527. * @memberOf ListCache
  12528. * @param {string} key The key of the entry to check.
  12529. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12530. */
  12531. function listCacheHas(key) {
  12532. return assocIndexOf(this.__data__, key) > -1;
  12533. }
  12534. /**
  12535. * Sets the list cache `key` to `value`.
  12536. *
  12537. * @private
  12538. * @name set
  12539. * @memberOf ListCache
  12540. * @param {string} key The key of the value to set.
  12541. * @param {*} value The value to set.
  12542. * @returns {Object} Returns the list cache instance.
  12543. */
  12544. function listCacheSet(key, value) {
  12545. var data = this.__data__,
  12546. index = assocIndexOf(data, key);
  12547. if (index < 0) {
  12548. data.push([key, value]);
  12549. } else {
  12550. data[index][1] = value;
  12551. }
  12552. return this;
  12553. }
  12554. // Add methods to `ListCache`.
  12555. ListCache.prototype.clear = listCacheClear;
  12556. ListCache.prototype['delete'] = listCacheDelete;
  12557. ListCache.prototype.get = listCacheGet;
  12558. ListCache.prototype.has = listCacheHas;
  12559. ListCache.prototype.set = listCacheSet;
  12560. /**
  12561. * Creates a map cache object to store key-value pairs.
  12562. *
  12563. * @private
  12564. * @constructor
  12565. * @param {Array} [entries] The key-value pairs to cache.
  12566. */
  12567. function MapCache(entries) {
  12568. var index = -1,
  12569. length = entries ? entries.length : 0;
  12570. this.clear();
  12571. while (++index < length) {
  12572. var entry = entries[index];
  12573. this.set(entry[0], entry[1]);
  12574. }
  12575. }
  12576. /**
  12577. * Removes all key-value entries from the map.
  12578. *
  12579. * @private
  12580. * @name clear
  12581. * @memberOf MapCache
  12582. */
  12583. function mapCacheClear() {
  12584. this.__data__ = {
  12585. 'hash': new Hash,
  12586. 'map': new (Map || ListCache),
  12587. 'string': new Hash
  12588. };
  12589. }
  12590. /**
  12591. * Removes `key` and its value from the map.
  12592. *
  12593. * @private
  12594. * @name delete
  12595. * @memberOf MapCache
  12596. * @param {string} key The key of the value to remove.
  12597. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12598. */
  12599. function mapCacheDelete(key) {
  12600. return getMapData(this, key)['delete'](key);
  12601. }
  12602. /**
  12603. * Gets the map value for `key`.
  12604. *
  12605. * @private
  12606. * @name get
  12607. * @memberOf MapCache
  12608. * @param {string} key The key of the value to get.
  12609. * @returns {*} Returns the entry value.
  12610. */
  12611. function mapCacheGet(key) {
  12612. return getMapData(this, key).get(key);
  12613. }
  12614. /**
  12615. * Checks if a map value for `key` exists.
  12616. *
  12617. * @private
  12618. * @name has
  12619. * @memberOf MapCache
  12620. * @param {string} key The key of the entry to check.
  12621. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12622. */
  12623. function mapCacheHas(key) {
  12624. return getMapData(this, key).has(key);
  12625. }
  12626. /**
  12627. * Sets the map `key` to `value`.
  12628. *
  12629. * @private
  12630. * @name set
  12631. * @memberOf MapCache
  12632. * @param {string} key The key of the value to set.
  12633. * @param {*} value The value to set.
  12634. * @returns {Object} Returns the map cache instance.
  12635. */
  12636. function mapCacheSet(key, value) {
  12637. getMapData(this, key).set(key, value);
  12638. return this;
  12639. }
  12640. // Add methods to `MapCache`.
  12641. MapCache.prototype.clear = mapCacheClear;
  12642. MapCache.prototype['delete'] = mapCacheDelete;
  12643. MapCache.prototype.get = mapCacheGet;
  12644. MapCache.prototype.has = mapCacheHas;
  12645. MapCache.prototype.set = mapCacheSet;
  12646. /**
  12647. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12648. *
  12649. * @private
  12650. * @param {Array} array The array to inspect.
  12651. * @param {*} key The key to search for.
  12652. * @returns {number} Returns the index of the matched value, else `-1`.
  12653. */
  12654. function assocIndexOf(array, key) {
  12655. var length = array.length;
  12656. while (length--) {
  12657. if (eq(array[length][0], key)) {
  12658. return length;
  12659. }
  12660. }
  12661. return -1;
  12662. }
  12663. /**
  12664. * The base implementation of `_.get` without support for default values.
  12665. *
  12666. * @private
  12667. * @param {Object} object The object to query.
  12668. * @param {Array|string} path The path of the property to get.
  12669. * @returns {*} Returns the resolved value.
  12670. */
  12671. function baseGet(object, path) {
  12672. path = isKey(path, object) ? [path] : castPath(path);
  12673. var index = 0,
  12674. length = path.length;
  12675. while (object != null && index < length) {
  12676. object = object[toKey(path[index++])];
  12677. }
  12678. return (index && index == length) ? object : undefined;
  12679. }
  12680. /**
  12681. * The base implementation of `_.isNative` without bad shim checks.
  12682. *
  12683. * @private
  12684. * @param {*} value The value to check.
  12685. * @returns {boolean} Returns `true` if `value` is a native function,
  12686. * else `false`.
  12687. */
  12688. function baseIsNative(value) {
  12689. if (!isObject(value) || isMasked(value)) {
  12690. return false;
  12691. }
  12692. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12693. return pattern.test(toSource(value));
  12694. }
  12695. /**
  12696. * The base implementation of `_.toString` which doesn't convert nullish
  12697. * values to empty strings.
  12698. *
  12699. * @private
  12700. * @param {*} value The value to process.
  12701. * @returns {string} Returns the string.
  12702. */
  12703. function baseToString(value) {
  12704. // Exit early for strings to avoid a performance hit in some environments.
  12705. if (typeof value == 'string') {
  12706. return value;
  12707. }
  12708. if (isSymbol(value)) {
  12709. return symbolToString ? symbolToString.call(value) : '';
  12710. }
  12711. var result = (value + '');
  12712. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12713. }
  12714. /**
  12715. * Casts `value` to a path array if it's not one.
  12716. *
  12717. * @private
  12718. * @param {*} value The value to inspect.
  12719. * @returns {Array} Returns the cast property path array.
  12720. */
  12721. function castPath(value) {
  12722. return isArray(value) ? value : stringToPath(value);
  12723. }
  12724. /**
  12725. * Gets the data for `map`.
  12726. *
  12727. * @private
  12728. * @param {Object} map The map to query.
  12729. * @param {string} key The reference key.
  12730. * @returns {*} Returns the map data.
  12731. */
  12732. function getMapData(map, key) {
  12733. var data = map.__data__;
  12734. return isKeyable(key)
  12735. ? data[typeof key == 'string' ? 'string' : 'hash']
  12736. : data.map;
  12737. }
  12738. /**
  12739. * Gets the native function at `key` of `object`.
  12740. *
  12741. * @private
  12742. * @param {Object} object The object to query.
  12743. * @param {string} key The key of the method to get.
  12744. * @returns {*} Returns the function if it's native, else `undefined`.
  12745. */
  12746. function getNative(object, key) {
  12747. var value = getValue(object, key);
  12748. return baseIsNative(value) ? value : undefined;
  12749. }
  12750. /**
  12751. * Checks if `value` is a property name and not a property path.
  12752. *
  12753. * @private
  12754. * @param {*} value The value to check.
  12755. * @param {Object} [object] The object to query keys on.
  12756. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12757. */
  12758. function isKey(value, object) {
  12759. if (isArray(value)) {
  12760. return false;
  12761. }
  12762. var type = typeof value;
  12763. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12764. value == null || isSymbol(value)) {
  12765. return true;
  12766. }
  12767. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12768. (object != null && value in Object(object));
  12769. }
  12770. /**
  12771. * Checks if `value` is suitable for use as unique object key.
  12772. *
  12773. * @private
  12774. * @param {*} value The value to check.
  12775. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12776. */
  12777. function isKeyable(value) {
  12778. var type = typeof value;
  12779. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12780. ? (value !== '__proto__')
  12781. : (value === null);
  12782. }
  12783. /**
  12784. * Checks if `func` has its source masked.
  12785. *
  12786. * @private
  12787. * @param {Function} func The function to check.
  12788. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12789. */
  12790. function isMasked(func) {
  12791. return !!maskSrcKey && (maskSrcKey in func);
  12792. }
  12793. /**
  12794. * Converts `string` to a property path array.
  12795. *
  12796. * @private
  12797. * @param {string} string The string to convert.
  12798. * @returns {Array} Returns the property path array.
  12799. */
  12800. var stringToPath = memoize(function(string) {
  12801. string = toString(string);
  12802. var result = [];
  12803. if (reLeadingDot.test(string)) {
  12804. result.push('');
  12805. }
  12806. string.replace(rePropName, function(match, number, quote, string) {
  12807. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  12808. });
  12809. return result;
  12810. });
  12811. /**
  12812. * Converts `value` to a string key if it's not a string or symbol.
  12813. *
  12814. * @private
  12815. * @param {*} value The value to inspect.
  12816. * @returns {string|symbol} Returns the key.
  12817. */
  12818. function toKey(value) {
  12819. if (typeof value == 'string' || isSymbol(value)) {
  12820. return value;
  12821. }
  12822. var result = (value + '');
  12823. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12824. }
  12825. /**
  12826. * Converts `func` to its source code.
  12827. *
  12828. * @private
  12829. * @param {Function} func The function to process.
  12830. * @returns {string} Returns the source code.
  12831. */
  12832. function toSource(func) {
  12833. if (func != null) {
  12834. try {
  12835. return funcToString.call(func);
  12836. } catch (e) {}
  12837. try {
  12838. return (func + '');
  12839. } catch (e) {}
  12840. }
  12841. return '';
  12842. }
  12843. /**
  12844. * Creates a function that memoizes the result of `func`. If `resolver` is
  12845. * provided, it determines the cache key for storing the result based on the
  12846. * arguments provided to the memoized function. By default, the first argument
  12847. * provided to the memoized function is used as the map cache key. The `func`
  12848. * is invoked with the `this` binding of the memoized function.
  12849. *
  12850. * **Note:** The cache is exposed as the `cache` property on the memoized
  12851. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  12852. * constructor with one whose instances implement the
  12853. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  12854. * method interface of `delete`, `get`, `has`, and `set`.
  12855. *
  12856. * @static
  12857. * @memberOf _
  12858. * @since 0.1.0
  12859. * @category Function
  12860. * @param {Function} func The function to have its output memoized.
  12861. * @param {Function} [resolver] The function to resolve the cache key.
  12862. * @returns {Function} Returns the new memoized function.
  12863. * @example
  12864. *
  12865. * var object = { 'a': 1, 'b': 2 };
  12866. * var other = { 'c': 3, 'd': 4 };
  12867. *
  12868. * var values = _.memoize(_.values);
  12869. * values(object);
  12870. * // => [1, 2]
  12871. *
  12872. * values(other);
  12873. * // => [3, 4]
  12874. *
  12875. * object.a = 2;
  12876. * values(object);
  12877. * // => [1, 2]
  12878. *
  12879. * // Modify the result cache.
  12880. * values.cache.set(object, ['a', 'b']);
  12881. * values(object);
  12882. * // => ['a', 'b']
  12883. *
  12884. * // Replace `_.memoize.Cache`.
  12885. * _.memoize.Cache = WeakMap;
  12886. */
  12887. function memoize(func, resolver) {
  12888. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  12889. throw new TypeError(FUNC_ERROR_TEXT);
  12890. }
  12891. var memoized = function() {
  12892. var args = arguments,
  12893. key = resolver ? resolver.apply(this, args) : args[0],
  12894. cache = memoized.cache;
  12895. if (cache.has(key)) {
  12896. return cache.get(key);
  12897. }
  12898. var result = func.apply(this, args);
  12899. memoized.cache = cache.set(key, result);
  12900. return result;
  12901. };
  12902. memoized.cache = new (memoize.Cache || MapCache);
  12903. return memoized;
  12904. }
  12905. // Assign cache to `_.memoize`.
  12906. memoize.Cache = MapCache;
  12907. /**
  12908. * Performs a
  12909. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12910. * comparison between two values to determine if they are equivalent.
  12911. *
  12912. * @static
  12913. * @memberOf _
  12914. * @since 4.0.0
  12915. * @category Lang
  12916. * @param {*} value The value to compare.
  12917. * @param {*} other The other value to compare.
  12918. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12919. * @example
  12920. *
  12921. * var object = { 'a': 1 };
  12922. * var other = { 'a': 1 };
  12923. *
  12924. * _.eq(object, object);
  12925. * // => true
  12926. *
  12927. * _.eq(object, other);
  12928. * // => false
  12929. *
  12930. * _.eq('a', 'a');
  12931. * // => true
  12932. *
  12933. * _.eq('a', Object('a'));
  12934. * // => false
  12935. *
  12936. * _.eq(NaN, NaN);
  12937. * // => true
  12938. */
  12939. function eq(value, other) {
  12940. return value === other || (value !== value && other !== other);
  12941. }
  12942. /**
  12943. * Checks if `value` is classified as an `Array` object.
  12944. *
  12945. * @static
  12946. * @memberOf _
  12947. * @since 0.1.0
  12948. * @category Lang
  12949. * @param {*} value The value to check.
  12950. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12951. * @example
  12952. *
  12953. * _.isArray([1, 2, 3]);
  12954. * // => true
  12955. *
  12956. * _.isArray(document.body.children);
  12957. * // => false
  12958. *
  12959. * _.isArray('abc');
  12960. * // => false
  12961. *
  12962. * _.isArray(_.noop);
  12963. * // => false
  12964. */
  12965. var isArray = Array.isArray;
  12966. /**
  12967. * Checks if `value` is classified as a `Function` object.
  12968. *
  12969. * @static
  12970. * @memberOf _
  12971. * @since 0.1.0
  12972. * @category Lang
  12973. * @param {*} value The value to check.
  12974. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12975. * @example
  12976. *
  12977. * _.isFunction(_);
  12978. * // => true
  12979. *
  12980. * _.isFunction(/abc/);
  12981. * // => false
  12982. */
  12983. function isFunction(value) {
  12984. // The use of `Object#toString` avoids issues with the `typeof` operator
  12985. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  12986. var tag = isObject(value) ? objectToString.call(value) : '';
  12987. return tag == funcTag || tag == genTag;
  12988. }
  12989. /**
  12990. * Checks if `value` is the
  12991. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12992. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12993. *
  12994. * @static
  12995. * @memberOf _
  12996. * @since 0.1.0
  12997. * @category Lang
  12998. * @param {*} value The value to check.
  12999. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  13000. * @example
  13001. *
  13002. * _.isObject({});
  13003. * // => true
  13004. *
  13005. * _.isObject([1, 2, 3]);
  13006. * // => true
  13007. *
  13008. * _.isObject(_.noop);
  13009. * // => true
  13010. *
  13011. * _.isObject(null);
  13012. * // => false
  13013. */
  13014. function isObject(value) {
  13015. var type = typeof value;
  13016. return !!value && (type == 'object' || type == 'function');
  13017. }
  13018. /**
  13019. * Checks if `value` is object-like. A value is object-like if it's not `null`
  13020. * and has a `typeof` result of "object".
  13021. *
  13022. * @static
  13023. * @memberOf _
  13024. * @since 4.0.0
  13025. * @category Lang
  13026. * @param {*} value The value to check.
  13027. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  13028. * @example
  13029. *
  13030. * _.isObjectLike({});
  13031. * // => true
  13032. *
  13033. * _.isObjectLike([1, 2, 3]);
  13034. * // => true
  13035. *
  13036. * _.isObjectLike(_.noop);
  13037. * // => false
  13038. *
  13039. * _.isObjectLike(null);
  13040. * // => false
  13041. */
  13042. function isObjectLike(value) {
  13043. return !!value && typeof value == 'object';
  13044. }
  13045. /**
  13046. * Checks if `value` is classified as a `Symbol` primitive or object.
  13047. *
  13048. * @static
  13049. * @memberOf _
  13050. * @since 4.0.0
  13051. * @category Lang
  13052. * @param {*} value The value to check.
  13053. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13054. * @example
  13055. *
  13056. * _.isSymbol(Symbol.iterator);
  13057. * // => true
  13058. *
  13059. * _.isSymbol('abc');
  13060. * // => false
  13061. */
  13062. function isSymbol(value) {
  13063. return typeof value == 'symbol' ||
  13064. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13065. }
  13066. /**
  13067. * Converts `value` to a string. An empty string is returned for `null`
  13068. * and `undefined` values. The sign of `-0` is preserved.
  13069. *
  13070. * @static
  13071. * @memberOf _
  13072. * @since 4.0.0
  13073. * @category Lang
  13074. * @param {*} value The value to process.
  13075. * @returns {string} Returns the string.
  13076. * @example
  13077. *
  13078. * _.toString(null);
  13079. * // => ''
  13080. *
  13081. * _.toString(-0);
  13082. * // => '-0'
  13083. *
  13084. * _.toString([1, 2, 3]);
  13085. * // => '1,2,3'
  13086. */
  13087. function toString(value) {
  13088. return value == null ? '' : baseToString(value);
  13089. }
  13090. /**
  13091. * Gets the value at `path` of `object`. If the resolved value is
  13092. * `undefined`, the `defaultValue` is returned in its place.
  13093. *
  13094. * @static
  13095. * @memberOf _
  13096. * @since 3.7.0
  13097. * @category Object
  13098. * @param {Object} object The object to query.
  13099. * @param {Array|string} path The path of the property to get.
  13100. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  13101. * @returns {*} Returns the resolved value.
  13102. * @example
  13103. *
  13104. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13105. *
  13106. * _.get(object, 'a[0].b.c');
  13107. * // => 3
  13108. *
  13109. * _.get(object, ['a', '0', 'b', 'c']);
  13110. * // => 3
  13111. *
  13112. * _.get(object, 'a.b.c', 'default');
  13113. * // => 'default'
  13114. */
  13115. function get(object, path, defaultValue) {
  13116. var result = object == null ? undefined : baseGet(object, path);
  13117. return result === undefined ? defaultValue : result;
  13118. }
  13119. module.exports = get;
  13120. /***/ }),
  13121. /***/ 855:
  13122. /***/ (function(module, __unusedexports, __webpack_require__) {
  13123. module.exports = registerPlugin;
  13124. const factory = __webpack_require__(47);
  13125. function registerPlugin(plugins, pluginFunction) {
  13126. return factory(
  13127. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  13128. );
  13129. }
  13130. /***/ }),
  13131. /***/ 856:
  13132. /***/ (function(module, __unusedexports, __webpack_require__) {
  13133. module.exports = __webpack_require__(141);
  13134. /***/ }),
  13135. /***/ 863:
  13136. /***/ (function(module, __unusedexports, __webpack_require__) {
  13137. module.exports = authenticationBeforeRequest;
  13138. const btoa = __webpack_require__(675);
  13139. const withAuthorizationPrefix = __webpack_require__(143);
  13140. function authenticationBeforeRequest(state, options) {
  13141. if (typeof state.auth === "string") {
  13142. options.headers.authorization = withAuthorizationPrefix(state.auth);
  13143. return;
  13144. }
  13145. if (state.auth.username) {
  13146. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  13147. options.headers.authorization = `Basic ${hash}`;
  13148. if (state.otp) {
  13149. options.headers["x-github-otp"] = state.otp;
  13150. }
  13151. return;
  13152. }
  13153. if (state.auth.clientId) {
  13154. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  13155. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  13156. // URL though: `/applications/:client_id/tokens/:access_token`.
  13157. //
  13158. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  13159. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  13160. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  13161. //
  13162. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  13163. // as well as "/applications/123/tokens/token456"
  13164. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  13165. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  13166. options.headers.authorization = `Basic ${hash}`;
  13167. return;
  13168. }
  13169. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  13170. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  13171. return;
  13172. }
  13173. return Promise.resolve()
  13174. .then(() => {
  13175. return state.auth();
  13176. })
  13177. .then(authorization => {
  13178. options.headers.authorization = withAuthorizationPrefix(authorization);
  13179. });
  13180. }
  13181. /***/ }),
  13182. /***/ 866:
  13183. /***/ (function(module, __unusedexports, __webpack_require__) {
  13184. "use strict";
  13185. var shebangRegex = __webpack_require__(816);
  13186. module.exports = function (str) {
  13187. var match = str.match(shebangRegex);
  13188. if (!match) {
  13189. return null;
  13190. }
  13191. var arr = match[0].replace(/#! ?/, '').split(' ');
  13192. var bin = arr[0].split('/').pop();
  13193. var arg = arr[1];
  13194. return (bin === 'env' ?
  13195. arg :
  13196. bin + (arg ? ' ' + arg : '')
  13197. );
  13198. };
  13199. /***/ }),
  13200. /***/ 874:
  13201. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13202. "use strict";
  13203. // Copyright (c) Microsoft. All rights reserved.
  13204. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  13205. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13206. return new (P || (P = Promise))(function (resolve, reject) {
  13207. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13208. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13209. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  13210. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13211. });
  13212. };
  13213. Object.defineProperty(exports, "__esModule", { value: true });
  13214. const url = __webpack_require__(835);
  13215. const http = __webpack_require__(605);
  13216. const https = __webpack_require__(211);
  13217. let fs;
  13218. let tunnel;
  13219. var HttpCodes;
  13220. (function (HttpCodes) {
  13221. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  13222. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  13223. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  13224. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  13225. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  13226. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  13227. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  13228. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  13229. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  13230. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  13231. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  13232. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  13233. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  13234. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  13235. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  13236. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  13237. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  13238. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  13239. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  13240. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  13241. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  13242. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  13243. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  13244. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  13245. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  13246. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  13247. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  13248. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  13249. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  13250. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  13251. const ExponentialBackoffCeiling = 10;
  13252. const ExponentialBackoffTimeSlice = 5;
  13253. class HttpClientResponse {
  13254. constructor(message) {
  13255. this.message = message;
  13256. }
  13257. readBody() {
  13258. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  13259. let output = '';
  13260. this.message.on('data', (chunk) => {
  13261. output += chunk;
  13262. });
  13263. this.message.on('end', () => {
  13264. resolve(output);
  13265. });
  13266. }));
  13267. }
  13268. }
  13269. exports.HttpClientResponse = HttpClientResponse;
  13270. function isHttps(requestUrl) {
  13271. let parsedUrl = url.parse(requestUrl);
  13272. return parsedUrl.protocol === 'https:';
  13273. }
  13274. exports.isHttps = isHttps;
  13275. var EnvironmentVariables;
  13276. (function (EnvironmentVariables) {
  13277. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  13278. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  13279. })(EnvironmentVariables || (EnvironmentVariables = {}));
  13280. class HttpClient {
  13281. constructor(userAgent, handlers, requestOptions) {
  13282. this._ignoreSslError = false;
  13283. this._allowRedirects = true;
  13284. this._maxRedirects = 50;
  13285. this._allowRetries = false;
  13286. this._maxRetries = 1;
  13287. this._keepAlive = false;
  13288. this._disposed = false;
  13289. this.userAgent = userAgent;
  13290. this.handlers = handlers || [];
  13291. this.requestOptions = requestOptions;
  13292. if (requestOptions) {
  13293. if (requestOptions.ignoreSslError != null) {
  13294. this._ignoreSslError = requestOptions.ignoreSslError;
  13295. }
  13296. this._socketTimeout = requestOptions.socketTimeout;
  13297. this._httpProxy = requestOptions.proxy;
  13298. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  13299. this._httpProxyBypassHosts = [];
  13300. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  13301. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  13302. });
  13303. }
  13304. this._certConfig = requestOptions.cert;
  13305. if (this._certConfig) {
  13306. // If using cert, need fs
  13307. fs = __webpack_require__(747);
  13308. // cache the cert content into memory, so we don't have to read it from disk every time
  13309. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  13310. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  13311. }
  13312. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  13313. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  13314. }
  13315. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  13316. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  13317. }
  13318. }
  13319. if (requestOptions.allowRedirects != null) {
  13320. this._allowRedirects = requestOptions.allowRedirects;
  13321. }
  13322. if (requestOptions.maxRedirects != null) {
  13323. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  13324. }
  13325. if (requestOptions.keepAlive != null) {
  13326. this._keepAlive = requestOptions.keepAlive;
  13327. }
  13328. if (requestOptions.allowRetries != null) {
  13329. this._allowRetries = requestOptions.allowRetries;
  13330. }
  13331. if (requestOptions.maxRetries != null) {
  13332. this._maxRetries = requestOptions.maxRetries;
  13333. }
  13334. }
  13335. }
  13336. options(requestUrl, additionalHeaders) {
  13337. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  13338. }
  13339. get(requestUrl, additionalHeaders) {
  13340. return this.request('GET', requestUrl, null, additionalHeaders || {});
  13341. }
  13342. del(requestUrl, additionalHeaders) {
  13343. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  13344. }
  13345. post(requestUrl, data, additionalHeaders) {
  13346. return this.request('POST', requestUrl, data, additionalHeaders || {});
  13347. }
  13348. patch(requestUrl, data, additionalHeaders) {
  13349. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  13350. }
  13351. put(requestUrl, data, additionalHeaders) {
  13352. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  13353. }
  13354. head(requestUrl, additionalHeaders) {
  13355. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  13356. }
  13357. sendStream(verb, requestUrl, stream, additionalHeaders) {
  13358. return this.request(verb, requestUrl, stream, additionalHeaders);
  13359. }
  13360. /**
  13361. * Makes a raw http request.
  13362. * All other methods such as get, post, patch, and request ultimately call this.
  13363. * Prefer get, del, post and patch
  13364. */
  13365. request(verb, requestUrl, data, headers) {
  13366. return __awaiter(this, void 0, void 0, function* () {
  13367. if (this._disposed) {
  13368. throw new Error("Client has already been disposed.");
  13369. }
  13370. let info = this._prepareRequest(verb, requestUrl, headers);
  13371. // Only perform retries on reads since writes may not be idempotent.
  13372. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  13373. let numTries = 0;
  13374. let response;
  13375. while (numTries < maxTries) {
  13376. response = yield this.requestRaw(info, data);
  13377. // Check if it's an authentication challenge
  13378. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  13379. let authenticationHandler;
  13380. for (let i = 0; i < this.handlers.length; i++) {
  13381. if (this.handlers[i].canHandleAuthentication(response)) {
  13382. authenticationHandler = this.handlers[i];
  13383. break;
  13384. }
  13385. }
  13386. if (authenticationHandler) {
  13387. return authenticationHandler.handleAuthentication(this, info, data);
  13388. }
  13389. else {
  13390. // We have received an unauthorized response but have no handlers to handle it.
  13391. // Let the response return to the caller.
  13392. return response;
  13393. }
  13394. }
  13395. let redirectsRemaining = this._maxRedirects;
  13396. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  13397. && this._allowRedirects
  13398. && redirectsRemaining > 0) {
  13399. const redirectUrl = response.message.headers["location"];
  13400. if (!redirectUrl) {
  13401. // if there's no location to redirect to, we won't
  13402. break;
  13403. }
  13404. // we need to finish reading the response before reassigning response
  13405. // which will leak the open socket.
  13406. yield response.readBody();
  13407. // let's make the request with the new redirectUrl
  13408. info = this._prepareRequest(verb, redirectUrl, headers);
  13409. response = yield this.requestRaw(info, data);
  13410. redirectsRemaining--;
  13411. }
  13412. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  13413. // If not a retry code, return immediately instead of retrying
  13414. return response;
  13415. }
  13416. numTries += 1;
  13417. if (numTries < maxTries) {
  13418. yield response.readBody();
  13419. yield this._performExponentialBackoff(numTries);
  13420. }
  13421. }
  13422. return response;
  13423. });
  13424. }
  13425. /**
  13426. * Needs to be called if keepAlive is set to true in request options.
  13427. */
  13428. dispose() {
  13429. if (this._agent) {
  13430. this._agent.destroy();
  13431. }
  13432. this._disposed = true;
  13433. }
  13434. /**
  13435. * Raw request.
  13436. * @param info
  13437. * @param data
  13438. */
  13439. requestRaw(info, data) {
  13440. return new Promise((resolve, reject) => {
  13441. let callbackForResult = function (err, res) {
  13442. if (err) {
  13443. reject(err);
  13444. }
  13445. resolve(res);
  13446. };
  13447. this.requestRawWithCallback(info, data, callbackForResult);
  13448. });
  13449. }
  13450. /**
  13451. * Raw request with callback.
  13452. * @param info
  13453. * @param data
  13454. * @param onResult
  13455. */
  13456. requestRawWithCallback(info, data, onResult) {
  13457. let socket;
  13458. let isDataString = typeof (data) === 'string';
  13459. if (typeof (data) === 'string') {
  13460. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13461. }
  13462. let callbackCalled = false;
  13463. let handleResult = (err, res) => {
  13464. if (!callbackCalled) {
  13465. callbackCalled = true;
  13466. onResult(err, res);
  13467. }
  13468. };
  13469. let req = info.httpModule.request(info.options, (msg) => {
  13470. let res = new HttpClientResponse(msg);
  13471. handleResult(null, res);
  13472. });
  13473. req.on('socket', (sock) => {
  13474. socket = sock;
  13475. });
  13476. // If we ever get disconnected, we want the socket to timeout eventually
  13477. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13478. if (socket) {
  13479. socket.end();
  13480. }
  13481. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13482. });
  13483. req.on('error', function (err) {
  13484. // err has statusCode property
  13485. // res should have headers
  13486. handleResult(err, null);
  13487. });
  13488. if (data && typeof (data) === 'string') {
  13489. req.write(data, 'utf8');
  13490. }
  13491. if (data && typeof (data) !== 'string') {
  13492. data.on('close', function () {
  13493. req.end();
  13494. });
  13495. data.pipe(req);
  13496. }
  13497. else {
  13498. req.end();
  13499. }
  13500. }
  13501. _prepareRequest(method, requestUrl, headers) {
  13502. const info = {};
  13503. info.parsedUrl = url.parse(requestUrl);
  13504. const usingSsl = info.parsedUrl.protocol === 'https:';
  13505. info.httpModule = usingSsl ? https : http;
  13506. const defaultPort = usingSsl ? 443 : 80;
  13507. info.options = {};
  13508. info.options.host = info.parsedUrl.hostname;
  13509. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13510. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13511. info.options.method = method;
  13512. info.options.headers = this._mergeHeaders(headers);
  13513. info.options.headers["user-agent"] = this.userAgent;
  13514. info.options.agent = this._getAgent(requestUrl);
  13515. // gives handlers an opportunity to participate
  13516. if (this.handlers && !this._isPresigned(requestUrl)) {
  13517. this.handlers.forEach((handler) => {
  13518. handler.prepareRequest(info.options);
  13519. });
  13520. }
  13521. return info;
  13522. }
  13523. _isPresigned(requestUrl) {
  13524. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13525. const patterns = this.requestOptions.presignedUrlPatterns;
  13526. for (let i = 0; i < patterns.length; i++) {
  13527. if (requestUrl.match(patterns[i])) {
  13528. return true;
  13529. }
  13530. }
  13531. }
  13532. return false;
  13533. }
  13534. _mergeHeaders(headers) {
  13535. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13536. if (this.requestOptions && this.requestOptions.headers) {
  13537. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13538. }
  13539. return lowercaseKeys(headers || {});
  13540. }
  13541. _getAgent(requestUrl) {
  13542. let agent;
  13543. let proxy = this._getProxy(requestUrl);
  13544. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13545. if (this._keepAlive && useProxy) {
  13546. agent = this._proxyAgent;
  13547. }
  13548. if (this._keepAlive && !useProxy) {
  13549. agent = this._agent;
  13550. }
  13551. // if agent is already assigned use that agent.
  13552. if (!!agent) {
  13553. return agent;
  13554. }
  13555. let parsedUrl = url.parse(requestUrl);
  13556. const usingSsl = parsedUrl.protocol === 'https:';
  13557. let maxSockets = 100;
  13558. if (!!this.requestOptions) {
  13559. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13560. }
  13561. if (useProxy) {
  13562. // If using proxy, need tunnel
  13563. if (!tunnel) {
  13564. tunnel = __webpack_require__(856);
  13565. }
  13566. const agentOptions = {
  13567. maxSockets: maxSockets,
  13568. keepAlive: this._keepAlive,
  13569. proxy: {
  13570. proxyAuth: proxy.proxyAuth,
  13571. host: proxy.proxyUrl.hostname,
  13572. port: proxy.proxyUrl.port
  13573. },
  13574. };
  13575. let tunnelAgent;
  13576. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13577. if (usingSsl) {
  13578. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13579. }
  13580. else {
  13581. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13582. }
  13583. agent = tunnelAgent(agentOptions);
  13584. this._proxyAgent = agent;
  13585. }
  13586. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13587. if (this._keepAlive && !agent) {
  13588. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13589. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13590. this._agent = agent;
  13591. }
  13592. // if not using private agent and tunnel agent isn't setup then use global agent
  13593. if (!agent) {
  13594. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13595. }
  13596. if (usingSsl && this._ignoreSslError) {
  13597. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13598. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13599. // we have to cast it to any and change it directly
  13600. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13601. }
  13602. if (usingSsl && this._certConfig) {
  13603. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13604. }
  13605. return agent;
  13606. }
  13607. _getProxy(requestUrl) {
  13608. const parsedUrl = url.parse(requestUrl);
  13609. let usingSsl = parsedUrl.protocol === 'https:';
  13610. let proxyConfig = this._httpProxy;
  13611. // fallback to http_proxy and https_proxy env
  13612. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13613. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13614. if (!proxyConfig) {
  13615. if (https_proxy && usingSsl) {
  13616. proxyConfig = {
  13617. proxyUrl: https_proxy
  13618. };
  13619. }
  13620. else if (http_proxy) {
  13621. proxyConfig = {
  13622. proxyUrl: http_proxy
  13623. };
  13624. }
  13625. }
  13626. let proxyUrl;
  13627. let proxyAuth;
  13628. if (proxyConfig) {
  13629. if (proxyConfig.proxyUrl.length > 0) {
  13630. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13631. }
  13632. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13633. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13634. }
  13635. }
  13636. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13637. }
  13638. _isBypassProxy(requestUrl) {
  13639. if (!this._httpProxyBypassHosts) {
  13640. return false;
  13641. }
  13642. let bypass = false;
  13643. this._httpProxyBypassHosts.forEach(bypassHost => {
  13644. if (bypassHost.test(requestUrl)) {
  13645. bypass = true;
  13646. }
  13647. });
  13648. return bypass;
  13649. }
  13650. _performExponentialBackoff(retryNumber) {
  13651. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13652. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13653. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13654. }
  13655. }
  13656. exports.HttpClient = HttpClient;
  13657. /***/ }),
  13658. /***/ 881:
  13659. /***/ (function(module) {
  13660. "use strict";
  13661. const isWin = process.platform === 'win32';
  13662. function notFoundError(original, syscall) {
  13663. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13664. code: 'ENOENT',
  13665. errno: 'ENOENT',
  13666. syscall: `${syscall} ${original.command}`,
  13667. path: original.command,
  13668. spawnargs: original.args,
  13669. });
  13670. }
  13671. function hookChildProcess(cp, parsed) {
  13672. if (!isWin) {
  13673. return;
  13674. }
  13675. const originalEmit = cp.emit;
  13676. cp.emit = function (name, arg1) {
  13677. // If emitting "exit" event and exit code is 1, we need to check if
  13678. // the command exists and emit an "error" instead
  13679. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13680. if (name === 'exit') {
  13681. const err = verifyENOENT(arg1, parsed, 'spawn');
  13682. if (err) {
  13683. return originalEmit.call(cp, 'error', err);
  13684. }
  13685. }
  13686. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13687. };
  13688. }
  13689. function verifyENOENT(status, parsed) {
  13690. if (isWin && status === 1 && !parsed.file) {
  13691. return notFoundError(parsed.original, 'spawn');
  13692. }
  13693. return null;
  13694. }
  13695. function verifyENOENTSync(status, parsed) {
  13696. if (isWin && status === 1 && !parsed.file) {
  13697. return notFoundError(parsed.original, 'spawnSync');
  13698. }
  13699. return null;
  13700. }
  13701. module.exports = {
  13702. hookChildProcess,
  13703. verifyENOENT,
  13704. verifyENOENTSync,
  13705. notFoundError,
  13706. };
  13707. /***/ }),
  13708. /***/ 883:
  13709. /***/ (function(module) {
  13710. /**
  13711. * lodash (Custom Build) <https://lodash.com/>
  13712. * Build: `lodash modularize exports="npm" -o ./`
  13713. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13714. * Released under MIT license <https://lodash.com/license>
  13715. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13716. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13717. */
  13718. /** Used as the `TypeError` message for "Functions" methods. */
  13719. var FUNC_ERROR_TEXT = 'Expected a function';
  13720. /** Used to stand-in for `undefined` hash values. */
  13721. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13722. /** Used as references for various `Number` constants. */
  13723. var INFINITY = 1 / 0,
  13724. MAX_SAFE_INTEGER = 9007199254740991;
  13725. /** `Object#toString` result references. */
  13726. var funcTag = '[object Function]',
  13727. genTag = '[object GeneratorFunction]',
  13728. symbolTag = '[object Symbol]';
  13729. /** Used to match property names within property paths. */
  13730. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13731. reIsPlainProp = /^\w*$/,
  13732. reLeadingDot = /^\./,
  13733. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13734. /**
  13735. * Used to match `RegExp`
  13736. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13737. */
  13738. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13739. /** Used to match backslashes in property paths. */
  13740. var reEscapeChar = /\\(\\)?/g;
  13741. /** Used to detect host constructors (Safari). */
  13742. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13743. /** Used to detect unsigned integer values. */
  13744. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13745. /** Detect free variable `global` from Node.js. */
  13746. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13747. /** Detect free variable `self`. */
  13748. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13749. /** Used as a reference to the global object. */
  13750. var root = freeGlobal || freeSelf || Function('return this')();
  13751. /**
  13752. * Gets the value at `key` of `object`.
  13753. *
  13754. * @private
  13755. * @param {Object} [object] The object to query.
  13756. * @param {string} key The key of the property to get.
  13757. * @returns {*} Returns the property value.
  13758. */
  13759. function getValue(object, key) {
  13760. return object == null ? undefined : object[key];
  13761. }
  13762. /**
  13763. * Checks if `value` is a host object in IE < 9.
  13764. *
  13765. * @private
  13766. * @param {*} value The value to check.
  13767. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13768. */
  13769. function isHostObject(value) {
  13770. // Many host objects are `Object` objects that can coerce to strings
  13771. // despite having improperly defined `toString` methods.
  13772. var result = false;
  13773. if (value != null && typeof value.toString != 'function') {
  13774. try {
  13775. result = !!(value + '');
  13776. } catch (e) {}
  13777. }
  13778. return result;
  13779. }
  13780. /** Used for built-in method references. */
  13781. var arrayProto = Array.prototype,
  13782. funcProto = Function.prototype,
  13783. objectProto = Object.prototype;
  13784. /** Used to detect overreaching core-js shims. */
  13785. var coreJsData = root['__core-js_shared__'];
  13786. /** Used to detect methods masquerading as native. */
  13787. var maskSrcKey = (function() {
  13788. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  13789. return uid ? ('Symbol(src)_1.' + uid) : '';
  13790. }());
  13791. /** Used to resolve the decompiled source of functions. */
  13792. var funcToString = funcProto.toString;
  13793. /** Used to check objects for own properties. */
  13794. var hasOwnProperty = objectProto.hasOwnProperty;
  13795. /**
  13796. * Used to resolve the
  13797. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  13798. * of values.
  13799. */
  13800. var objectToString = objectProto.toString;
  13801. /** Used to detect if a method is native. */
  13802. var reIsNative = RegExp('^' +
  13803. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  13804. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  13805. );
  13806. /** Built-in value references. */
  13807. var Symbol = root.Symbol,
  13808. splice = arrayProto.splice;
  13809. /* Built-in method references that are verified to be native. */
  13810. var Map = getNative(root, 'Map'),
  13811. nativeCreate = getNative(Object, 'create');
  13812. /** Used to convert symbols to primitives and strings. */
  13813. var symbolProto = Symbol ? Symbol.prototype : undefined,
  13814. symbolToString = symbolProto ? symbolProto.toString : undefined;
  13815. /**
  13816. * Creates a hash object.
  13817. *
  13818. * @private
  13819. * @constructor
  13820. * @param {Array} [entries] The key-value pairs to cache.
  13821. */
  13822. function Hash(entries) {
  13823. var index = -1,
  13824. length = entries ? entries.length : 0;
  13825. this.clear();
  13826. while (++index < length) {
  13827. var entry = entries[index];
  13828. this.set(entry[0], entry[1]);
  13829. }
  13830. }
  13831. /**
  13832. * Removes all key-value entries from the hash.
  13833. *
  13834. * @private
  13835. * @name clear
  13836. * @memberOf Hash
  13837. */
  13838. function hashClear() {
  13839. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  13840. }
  13841. /**
  13842. * Removes `key` and its value from the hash.
  13843. *
  13844. * @private
  13845. * @name delete
  13846. * @memberOf Hash
  13847. * @param {Object} hash The hash to modify.
  13848. * @param {string} key The key of the value to remove.
  13849. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13850. */
  13851. function hashDelete(key) {
  13852. return this.has(key) && delete this.__data__[key];
  13853. }
  13854. /**
  13855. * Gets the hash value for `key`.
  13856. *
  13857. * @private
  13858. * @name get
  13859. * @memberOf Hash
  13860. * @param {string} key The key of the value to get.
  13861. * @returns {*} Returns the entry value.
  13862. */
  13863. function hashGet(key) {
  13864. var data = this.__data__;
  13865. if (nativeCreate) {
  13866. var result = data[key];
  13867. return result === HASH_UNDEFINED ? undefined : result;
  13868. }
  13869. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  13870. }
  13871. /**
  13872. * Checks if a hash value for `key` exists.
  13873. *
  13874. * @private
  13875. * @name has
  13876. * @memberOf Hash
  13877. * @param {string} key The key of the entry to check.
  13878. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13879. */
  13880. function hashHas(key) {
  13881. var data = this.__data__;
  13882. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  13883. }
  13884. /**
  13885. * Sets the hash `key` to `value`.
  13886. *
  13887. * @private
  13888. * @name set
  13889. * @memberOf Hash
  13890. * @param {string} key The key of the value to set.
  13891. * @param {*} value The value to set.
  13892. * @returns {Object} Returns the hash instance.
  13893. */
  13894. function hashSet(key, value) {
  13895. var data = this.__data__;
  13896. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  13897. return this;
  13898. }
  13899. // Add methods to `Hash`.
  13900. Hash.prototype.clear = hashClear;
  13901. Hash.prototype['delete'] = hashDelete;
  13902. Hash.prototype.get = hashGet;
  13903. Hash.prototype.has = hashHas;
  13904. Hash.prototype.set = hashSet;
  13905. /**
  13906. * Creates an list cache object.
  13907. *
  13908. * @private
  13909. * @constructor
  13910. * @param {Array} [entries] The key-value pairs to cache.
  13911. */
  13912. function ListCache(entries) {
  13913. var index = -1,
  13914. length = entries ? entries.length : 0;
  13915. this.clear();
  13916. while (++index < length) {
  13917. var entry = entries[index];
  13918. this.set(entry[0], entry[1]);
  13919. }
  13920. }
  13921. /**
  13922. * Removes all key-value entries from the list cache.
  13923. *
  13924. * @private
  13925. * @name clear
  13926. * @memberOf ListCache
  13927. */
  13928. function listCacheClear() {
  13929. this.__data__ = [];
  13930. }
  13931. /**
  13932. * Removes `key` and its value from the list cache.
  13933. *
  13934. * @private
  13935. * @name delete
  13936. * @memberOf ListCache
  13937. * @param {string} key The key of the value to remove.
  13938. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13939. */
  13940. function listCacheDelete(key) {
  13941. var data = this.__data__,
  13942. index = assocIndexOf(data, key);
  13943. if (index < 0) {
  13944. return false;
  13945. }
  13946. var lastIndex = data.length - 1;
  13947. if (index == lastIndex) {
  13948. data.pop();
  13949. } else {
  13950. splice.call(data, index, 1);
  13951. }
  13952. return true;
  13953. }
  13954. /**
  13955. * Gets the list cache value for `key`.
  13956. *
  13957. * @private
  13958. * @name get
  13959. * @memberOf ListCache
  13960. * @param {string} key The key of the value to get.
  13961. * @returns {*} Returns the entry value.
  13962. */
  13963. function listCacheGet(key) {
  13964. var data = this.__data__,
  13965. index = assocIndexOf(data, key);
  13966. return index < 0 ? undefined : data[index][1];
  13967. }
  13968. /**
  13969. * Checks if a list cache value for `key` exists.
  13970. *
  13971. * @private
  13972. * @name has
  13973. * @memberOf ListCache
  13974. * @param {string} key The key of the entry to check.
  13975. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13976. */
  13977. function listCacheHas(key) {
  13978. return assocIndexOf(this.__data__, key) > -1;
  13979. }
  13980. /**
  13981. * Sets the list cache `key` to `value`.
  13982. *
  13983. * @private
  13984. * @name set
  13985. * @memberOf ListCache
  13986. * @param {string} key The key of the value to set.
  13987. * @param {*} value The value to set.
  13988. * @returns {Object} Returns the list cache instance.
  13989. */
  13990. function listCacheSet(key, value) {
  13991. var data = this.__data__,
  13992. index = assocIndexOf(data, key);
  13993. if (index < 0) {
  13994. data.push([key, value]);
  13995. } else {
  13996. data[index][1] = value;
  13997. }
  13998. return this;
  13999. }
  14000. // Add methods to `ListCache`.
  14001. ListCache.prototype.clear = listCacheClear;
  14002. ListCache.prototype['delete'] = listCacheDelete;
  14003. ListCache.prototype.get = listCacheGet;
  14004. ListCache.prototype.has = listCacheHas;
  14005. ListCache.prototype.set = listCacheSet;
  14006. /**
  14007. * Creates a map cache object to store key-value pairs.
  14008. *
  14009. * @private
  14010. * @constructor
  14011. * @param {Array} [entries] The key-value pairs to cache.
  14012. */
  14013. function MapCache(entries) {
  14014. var index = -1,
  14015. length = entries ? entries.length : 0;
  14016. this.clear();
  14017. while (++index < length) {
  14018. var entry = entries[index];
  14019. this.set(entry[0], entry[1]);
  14020. }
  14021. }
  14022. /**
  14023. * Removes all key-value entries from the map.
  14024. *
  14025. * @private
  14026. * @name clear
  14027. * @memberOf MapCache
  14028. */
  14029. function mapCacheClear() {
  14030. this.__data__ = {
  14031. 'hash': new Hash,
  14032. 'map': new (Map || ListCache),
  14033. 'string': new Hash
  14034. };
  14035. }
  14036. /**
  14037. * Removes `key` and its value from the map.
  14038. *
  14039. * @private
  14040. * @name delete
  14041. * @memberOf MapCache
  14042. * @param {string} key The key of the value to remove.
  14043. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  14044. */
  14045. function mapCacheDelete(key) {
  14046. return getMapData(this, key)['delete'](key);
  14047. }
  14048. /**
  14049. * Gets the map value for `key`.
  14050. *
  14051. * @private
  14052. * @name get
  14053. * @memberOf MapCache
  14054. * @param {string} key The key of the value to get.
  14055. * @returns {*} Returns the entry value.
  14056. */
  14057. function mapCacheGet(key) {
  14058. return getMapData(this, key).get(key);
  14059. }
  14060. /**
  14061. * Checks if a map value for `key` exists.
  14062. *
  14063. * @private
  14064. * @name has
  14065. * @memberOf MapCache
  14066. * @param {string} key The key of the entry to check.
  14067. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  14068. */
  14069. function mapCacheHas(key) {
  14070. return getMapData(this, key).has(key);
  14071. }
  14072. /**
  14073. * Sets the map `key` to `value`.
  14074. *
  14075. * @private
  14076. * @name set
  14077. * @memberOf MapCache
  14078. * @param {string} key The key of the value to set.
  14079. * @param {*} value The value to set.
  14080. * @returns {Object} Returns the map cache instance.
  14081. */
  14082. function mapCacheSet(key, value) {
  14083. getMapData(this, key).set(key, value);
  14084. return this;
  14085. }
  14086. // Add methods to `MapCache`.
  14087. MapCache.prototype.clear = mapCacheClear;
  14088. MapCache.prototype['delete'] = mapCacheDelete;
  14089. MapCache.prototype.get = mapCacheGet;
  14090. MapCache.prototype.has = mapCacheHas;
  14091. MapCache.prototype.set = mapCacheSet;
  14092. /**
  14093. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  14094. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14095. * for equality comparisons.
  14096. *
  14097. * @private
  14098. * @param {Object} object The object to modify.
  14099. * @param {string} key The key of the property to assign.
  14100. * @param {*} value The value to assign.
  14101. */
  14102. function assignValue(object, key, value) {
  14103. var objValue = object[key];
  14104. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  14105. (value === undefined && !(key in object))) {
  14106. object[key] = value;
  14107. }
  14108. }
  14109. /**
  14110. * Gets the index at which the `key` is found in `array` of key-value pairs.
  14111. *
  14112. * @private
  14113. * @param {Array} array The array to inspect.
  14114. * @param {*} key The key to search for.
  14115. * @returns {number} Returns the index of the matched value, else `-1`.
  14116. */
  14117. function assocIndexOf(array, key) {
  14118. var length = array.length;
  14119. while (length--) {
  14120. if (eq(array[length][0], key)) {
  14121. return length;
  14122. }
  14123. }
  14124. return -1;
  14125. }
  14126. /**
  14127. * The base implementation of `_.isNative` without bad shim checks.
  14128. *
  14129. * @private
  14130. * @param {*} value The value to check.
  14131. * @returns {boolean} Returns `true` if `value` is a native function,
  14132. * else `false`.
  14133. */
  14134. function baseIsNative(value) {
  14135. if (!isObject(value) || isMasked(value)) {
  14136. return false;
  14137. }
  14138. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  14139. return pattern.test(toSource(value));
  14140. }
  14141. /**
  14142. * The base implementation of `_.set`.
  14143. *
  14144. * @private
  14145. * @param {Object} object The object to modify.
  14146. * @param {Array|string} path The path of the property to set.
  14147. * @param {*} value The value to set.
  14148. * @param {Function} [customizer] The function to customize path creation.
  14149. * @returns {Object} Returns `object`.
  14150. */
  14151. function baseSet(object, path, value, customizer) {
  14152. if (!isObject(object)) {
  14153. return object;
  14154. }
  14155. path = isKey(path, object) ? [path] : castPath(path);
  14156. var index = -1,
  14157. length = path.length,
  14158. lastIndex = length - 1,
  14159. nested = object;
  14160. while (nested != null && ++index < length) {
  14161. var key = toKey(path[index]),
  14162. newValue = value;
  14163. if (index != lastIndex) {
  14164. var objValue = nested[key];
  14165. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  14166. if (newValue === undefined) {
  14167. newValue = isObject(objValue)
  14168. ? objValue
  14169. : (isIndex(path[index + 1]) ? [] : {});
  14170. }
  14171. }
  14172. assignValue(nested, key, newValue);
  14173. nested = nested[key];
  14174. }
  14175. return object;
  14176. }
  14177. /**
  14178. * The base implementation of `_.toString` which doesn't convert nullish
  14179. * values to empty strings.
  14180. *
  14181. * @private
  14182. * @param {*} value The value to process.
  14183. * @returns {string} Returns the string.
  14184. */
  14185. function baseToString(value) {
  14186. // Exit early for strings to avoid a performance hit in some environments.
  14187. if (typeof value == 'string') {
  14188. return value;
  14189. }
  14190. if (isSymbol(value)) {
  14191. return symbolToString ? symbolToString.call(value) : '';
  14192. }
  14193. var result = (value + '');
  14194. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14195. }
  14196. /**
  14197. * Casts `value` to a path array if it's not one.
  14198. *
  14199. * @private
  14200. * @param {*} value The value to inspect.
  14201. * @returns {Array} Returns the cast property path array.
  14202. */
  14203. function castPath(value) {
  14204. return isArray(value) ? value : stringToPath(value);
  14205. }
  14206. /**
  14207. * Gets the data for `map`.
  14208. *
  14209. * @private
  14210. * @param {Object} map The map to query.
  14211. * @param {string} key The reference key.
  14212. * @returns {*} Returns the map data.
  14213. */
  14214. function getMapData(map, key) {
  14215. var data = map.__data__;
  14216. return isKeyable(key)
  14217. ? data[typeof key == 'string' ? 'string' : 'hash']
  14218. : data.map;
  14219. }
  14220. /**
  14221. * Gets the native function at `key` of `object`.
  14222. *
  14223. * @private
  14224. * @param {Object} object The object to query.
  14225. * @param {string} key The key of the method to get.
  14226. * @returns {*} Returns the function if it's native, else `undefined`.
  14227. */
  14228. function getNative(object, key) {
  14229. var value = getValue(object, key);
  14230. return baseIsNative(value) ? value : undefined;
  14231. }
  14232. /**
  14233. * Checks if `value` is a valid array-like index.
  14234. *
  14235. * @private
  14236. * @param {*} value The value to check.
  14237. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  14238. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  14239. */
  14240. function isIndex(value, length) {
  14241. length = length == null ? MAX_SAFE_INTEGER : length;
  14242. return !!length &&
  14243. (typeof value == 'number' || reIsUint.test(value)) &&
  14244. (value > -1 && value % 1 == 0 && value < length);
  14245. }
  14246. /**
  14247. * Checks if `value` is a property name and not a property path.
  14248. *
  14249. * @private
  14250. * @param {*} value The value to check.
  14251. * @param {Object} [object] The object to query keys on.
  14252. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  14253. */
  14254. function isKey(value, object) {
  14255. if (isArray(value)) {
  14256. return false;
  14257. }
  14258. var type = typeof value;
  14259. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  14260. value == null || isSymbol(value)) {
  14261. return true;
  14262. }
  14263. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  14264. (object != null && value in Object(object));
  14265. }
  14266. /**
  14267. * Checks if `value` is suitable for use as unique object key.
  14268. *
  14269. * @private
  14270. * @param {*} value The value to check.
  14271. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  14272. */
  14273. function isKeyable(value) {
  14274. var type = typeof value;
  14275. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  14276. ? (value !== '__proto__')
  14277. : (value === null);
  14278. }
  14279. /**
  14280. * Checks if `func` has its source masked.
  14281. *
  14282. * @private
  14283. * @param {Function} func The function to check.
  14284. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  14285. */
  14286. function isMasked(func) {
  14287. return !!maskSrcKey && (maskSrcKey in func);
  14288. }
  14289. /**
  14290. * Converts `string` to a property path array.
  14291. *
  14292. * @private
  14293. * @param {string} string The string to convert.
  14294. * @returns {Array} Returns the property path array.
  14295. */
  14296. var stringToPath = memoize(function(string) {
  14297. string = toString(string);
  14298. var result = [];
  14299. if (reLeadingDot.test(string)) {
  14300. result.push('');
  14301. }
  14302. string.replace(rePropName, function(match, number, quote, string) {
  14303. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  14304. });
  14305. return result;
  14306. });
  14307. /**
  14308. * Converts `value` to a string key if it's not a string or symbol.
  14309. *
  14310. * @private
  14311. * @param {*} value The value to inspect.
  14312. * @returns {string|symbol} Returns the key.
  14313. */
  14314. function toKey(value) {
  14315. if (typeof value == 'string' || isSymbol(value)) {
  14316. return value;
  14317. }
  14318. var result = (value + '');
  14319. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14320. }
  14321. /**
  14322. * Converts `func` to its source code.
  14323. *
  14324. * @private
  14325. * @param {Function} func The function to process.
  14326. * @returns {string} Returns the source code.
  14327. */
  14328. function toSource(func) {
  14329. if (func != null) {
  14330. try {
  14331. return funcToString.call(func);
  14332. } catch (e) {}
  14333. try {
  14334. return (func + '');
  14335. } catch (e) {}
  14336. }
  14337. return '';
  14338. }
  14339. /**
  14340. * Creates a function that memoizes the result of `func`. If `resolver` is
  14341. * provided, it determines the cache key for storing the result based on the
  14342. * arguments provided to the memoized function. By default, the first argument
  14343. * provided to the memoized function is used as the map cache key. The `func`
  14344. * is invoked with the `this` binding of the memoized function.
  14345. *
  14346. * **Note:** The cache is exposed as the `cache` property on the memoized
  14347. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  14348. * constructor with one whose instances implement the
  14349. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  14350. * method interface of `delete`, `get`, `has`, and `set`.
  14351. *
  14352. * @static
  14353. * @memberOf _
  14354. * @since 0.1.0
  14355. * @category Function
  14356. * @param {Function} func The function to have its output memoized.
  14357. * @param {Function} [resolver] The function to resolve the cache key.
  14358. * @returns {Function} Returns the new memoized function.
  14359. * @example
  14360. *
  14361. * var object = { 'a': 1, 'b': 2 };
  14362. * var other = { 'c': 3, 'd': 4 };
  14363. *
  14364. * var values = _.memoize(_.values);
  14365. * values(object);
  14366. * // => [1, 2]
  14367. *
  14368. * values(other);
  14369. * // => [3, 4]
  14370. *
  14371. * object.a = 2;
  14372. * values(object);
  14373. * // => [1, 2]
  14374. *
  14375. * // Modify the result cache.
  14376. * values.cache.set(object, ['a', 'b']);
  14377. * values(object);
  14378. * // => ['a', 'b']
  14379. *
  14380. * // Replace `_.memoize.Cache`.
  14381. * _.memoize.Cache = WeakMap;
  14382. */
  14383. function memoize(func, resolver) {
  14384. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  14385. throw new TypeError(FUNC_ERROR_TEXT);
  14386. }
  14387. var memoized = function() {
  14388. var args = arguments,
  14389. key = resolver ? resolver.apply(this, args) : args[0],
  14390. cache = memoized.cache;
  14391. if (cache.has(key)) {
  14392. return cache.get(key);
  14393. }
  14394. var result = func.apply(this, args);
  14395. memoized.cache = cache.set(key, result);
  14396. return result;
  14397. };
  14398. memoized.cache = new (memoize.Cache || MapCache);
  14399. return memoized;
  14400. }
  14401. // Assign cache to `_.memoize`.
  14402. memoize.Cache = MapCache;
  14403. /**
  14404. * Performs a
  14405. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14406. * comparison between two values to determine if they are equivalent.
  14407. *
  14408. * @static
  14409. * @memberOf _
  14410. * @since 4.0.0
  14411. * @category Lang
  14412. * @param {*} value The value to compare.
  14413. * @param {*} other The other value to compare.
  14414. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  14415. * @example
  14416. *
  14417. * var object = { 'a': 1 };
  14418. * var other = { 'a': 1 };
  14419. *
  14420. * _.eq(object, object);
  14421. * // => true
  14422. *
  14423. * _.eq(object, other);
  14424. * // => false
  14425. *
  14426. * _.eq('a', 'a');
  14427. * // => true
  14428. *
  14429. * _.eq('a', Object('a'));
  14430. * // => false
  14431. *
  14432. * _.eq(NaN, NaN);
  14433. * // => true
  14434. */
  14435. function eq(value, other) {
  14436. return value === other || (value !== value && other !== other);
  14437. }
  14438. /**
  14439. * Checks if `value` is classified as an `Array` object.
  14440. *
  14441. * @static
  14442. * @memberOf _
  14443. * @since 0.1.0
  14444. * @category Lang
  14445. * @param {*} value The value to check.
  14446. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14447. * @example
  14448. *
  14449. * _.isArray([1, 2, 3]);
  14450. * // => true
  14451. *
  14452. * _.isArray(document.body.children);
  14453. * // => false
  14454. *
  14455. * _.isArray('abc');
  14456. * // => false
  14457. *
  14458. * _.isArray(_.noop);
  14459. * // => false
  14460. */
  14461. var isArray = Array.isArray;
  14462. /**
  14463. * Checks if `value` is classified as a `Function` object.
  14464. *
  14465. * @static
  14466. * @memberOf _
  14467. * @since 0.1.0
  14468. * @category Lang
  14469. * @param {*} value The value to check.
  14470. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14471. * @example
  14472. *
  14473. * _.isFunction(_);
  14474. * // => true
  14475. *
  14476. * _.isFunction(/abc/);
  14477. * // => false
  14478. */
  14479. function isFunction(value) {
  14480. // The use of `Object#toString` avoids issues with the `typeof` operator
  14481. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14482. var tag = isObject(value) ? objectToString.call(value) : '';
  14483. return tag == funcTag || tag == genTag;
  14484. }
  14485. /**
  14486. * Checks if `value` is the
  14487. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14488. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14489. *
  14490. * @static
  14491. * @memberOf _
  14492. * @since 0.1.0
  14493. * @category Lang
  14494. * @param {*} value The value to check.
  14495. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14496. * @example
  14497. *
  14498. * _.isObject({});
  14499. * // => true
  14500. *
  14501. * _.isObject([1, 2, 3]);
  14502. * // => true
  14503. *
  14504. * _.isObject(_.noop);
  14505. * // => true
  14506. *
  14507. * _.isObject(null);
  14508. * // => false
  14509. */
  14510. function isObject(value) {
  14511. var type = typeof value;
  14512. return !!value && (type == 'object' || type == 'function');
  14513. }
  14514. /**
  14515. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14516. * and has a `typeof` result of "object".
  14517. *
  14518. * @static
  14519. * @memberOf _
  14520. * @since 4.0.0
  14521. * @category Lang
  14522. * @param {*} value The value to check.
  14523. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14524. * @example
  14525. *
  14526. * _.isObjectLike({});
  14527. * // => true
  14528. *
  14529. * _.isObjectLike([1, 2, 3]);
  14530. * // => true
  14531. *
  14532. * _.isObjectLike(_.noop);
  14533. * // => false
  14534. *
  14535. * _.isObjectLike(null);
  14536. * // => false
  14537. */
  14538. function isObjectLike(value) {
  14539. return !!value && typeof value == 'object';
  14540. }
  14541. /**
  14542. * Checks if `value` is classified as a `Symbol` primitive or object.
  14543. *
  14544. * @static
  14545. * @memberOf _
  14546. * @since 4.0.0
  14547. * @category Lang
  14548. * @param {*} value The value to check.
  14549. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14550. * @example
  14551. *
  14552. * _.isSymbol(Symbol.iterator);
  14553. * // => true
  14554. *
  14555. * _.isSymbol('abc');
  14556. * // => false
  14557. */
  14558. function isSymbol(value) {
  14559. return typeof value == 'symbol' ||
  14560. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14561. }
  14562. /**
  14563. * Converts `value` to a string. An empty string is returned for `null`
  14564. * and `undefined` values. The sign of `-0` is preserved.
  14565. *
  14566. * @static
  14567. * @memberOf _
  14568. * @since 4.0.0
  14569. * @category Lang
  14570. * @param {*} value The value to process.
  14571. * @returns {string} Returns the string.
  14572. * @example
  14573. *
  14574. * _.toString(null);
  14575. * // => ''
  14576. *
  14577. * _.toString(-0);
  14578. * // => '-0'
  14579. *
  14580. * _.toString([1, 2, 3]);
  14581. * // => '1,2,3'
  14582. */
  14583. function toString(value) {
  14584. return value == null ? '' : baseToString(value);
  14585. }
  14586. /**
  14587. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14588. * it's created. Arrays are created for missing index properties while objects
  14589. * are created for all other missing properties. Use `_.setWith` to customize
  14590. * `path` creation.
  14591. *
  14592. * **Note:** This method mutates `object`.
  14593. *
  14594. * @static
  14595. * @memberOf _
  14596. * @since 3.7.0
  14597. * @category Object
  14598. * @param {Object} object The object to modify.
  14599. * @param {Array|string} path The path of the property to set.
  14600. * @param {*} value The value to set.
  14601. * @returns {Object} Returns `object`.
  14602. * @example
  14603. *
  14604. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14605. *
  14606. * _.set(object, 'a[0].b.c', 4);
  14607. * console.log(object.a[0].b.c);
  14608. * // => 4
  14609. *
  14610. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14611. * console.log(object.x[0].y.z);
  14612. * // => 5
  14613. */
  14614. function set(object, path, value) {
  14615. return object == null ? object : baseSet(object, path, value);
  14616. }
  14617. module.exports = set;
  14618. /***/ }),
  14619. /***/ 898:
  14620. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14621. "use strict";
  14622. Object.defineProperty(exports, '__esModule', { value: true });
  14623. var request = __webpack_require__(753);
  14624. var universalUserAgent = __webpack_require__(796);
  14625. const VERSION = "4.3.1";
  14626. class GraphqlError extends Error {
  14627. constructor(request, response) {
  14628. const message = response.data.errors[0].message;
  14629. super(message);
  14630. Object.assign(this, response.data);
  14631. this.name = "GraphqlError";
  14632. this.request = request; // Maintains proper stack trace (only available on V8)
  14633. /* istanbul ignore next */
  14634. if (Error.captureStackTrace) {
  14635. Error.captureStackTrace(this, this.constructor);
  14636. }
  14637. }
  14638. }
  14639. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14640. function graphql(request, query, options) {
  14641. options = typeof query === "string" ? options = Object.assign({
  14642. query
  14643. }, options) : options = query;
  14644. const requestOptions = Object.keys(options).reduce((result, key) => {
  14645. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14646. result[key] = options[key];
  14647. return result;
  14648. }
  14649. if (!result.variables) {
  14650. result.variables = {};
  14651. }
  14652. result.variables[key] = options[key];
  14653. return result;
  14654. }, {});
  14655. return request(requestOptions).then(response => {
  14656. if (response.data.errors) {
  14657. throw new GraphqlError(requestOptions, {
  14658. data: response.data
  14659. });
  14660. }
  14661. return response.data.data;
  14662. });
  14663. }
  14664. function withDefaults(request$1, newDefaults) {
  14665. const newRequest = request$1.defaults(newDefaults);
  14666. const newApi = (query, options) => {
  14667. return graphql(newRequest, query, options);
  14668. };
  14669. return Object.assign(newApi, {
  14670. defaults: withDefaults.bind(null, newRequest),
  14671. endpoint: request.request.endpoint
  14672. });
  14673. }
  14674. const graphql$1 = withDefaults(request.request, {
  14675. headers: {
  14676. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14677. },
  14678. method: "POST",
  14679. url: "/graphql"
  14680. });
  14681. function withCustomRequest(customRequest) {
  14682. return withDefaults(customRequest, {
  14683. method: "POST",
  14684. url: "/graphql"
  14685. });
  14686. }
  14687. exports.graphql = graphql$1;
  14688. exports.withCustomRequest = withCustomRequest;
  14689. //# sourceMappingURL=index.js.map
  14690. /***/ }),
  14691. /***/ 899:
  14692. /***/ (function(module, __unusedexports, __webpack_require__) {
  14693. module.exports = registerEndpoints;
  14694. const { Deprecation } = __webpack_require__(692);
  14695. function registerEndpoints(octokit, routes) {
  14696. Object.keys(routes).forEach(namespaceName => {
  14697. if (!octokit[namespaceName]) {
  14698. octokit[namespaceName] = {};
  14699. }
  14700. Object.keys(routes[namespaceName]).forEach(apiName => {
  14701. const apiOptions = routes[namespaceName][apiName];
  14702. const endpointDefaults = ["method", "url", "headers"].reduce(
  14703. (map, key) => {
  14704. if (typeof apiOptions[key] !== "undefined") {
  14705. map[key] = apiOptions[key];
  14706. }
  14707. return map;
  14708. },
  14709. {}
  14710. );
  14711. endpointDefaults.request = {
  14712. validate: apiOptions.params
  14713. };
  14714. let request = octokit.request.defaults(endpointDefaults);
  14715. // patch request & endpoint methods to support deprecated parameters.
  14716. // Not the most elegant solution, but we don’t want to move deprecation
  14717. // logic into octokit/endpoint.js as it’s out of scope
  14718. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14719. key => apiOptions.params[key].deprecated
  14720. );
  14721. if (hasDeprecatedParam) {
  14722. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14723. request = patch(
  14724. octokit.request.defaults(endpointDefaults),
  14725. `.${namespaceName}.${apiName}()`
  14726. );
  14727. request.endpoint = patch(
  14728. request.endpoint,
  14729. `.${namespaceName}.${apiName}.endpoint()`
  14730. );
  14731. request.endpoint.merge = patch(
  14732. request.endpoint.merge,
  14733. `.${namespaceName}.${apiName}.endpoint.merge()`
  14734. );
  14735. }
  14736. if (apiOptions.deprecated) {
  14737. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14738. octokit.log.warn(
  14739. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14740. );
  14741. octokit[namespaceName][apiName] = request;
  14742. return request.apply(null, arguments);
  14743. };
  14744. return;
  14745. }
  14746. octokit[namespaceName][apiName] = request;
  14747. });
  14748. });
  14749. }
  14750. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14751. const patchedMethod = options => {
  14752. options = Object.assign({}, options);
  14753. Object.keys(options).forEach(key => {
  14754. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14755. const aliasKey = apiOptions.params[key].alias;
  14756. octokit.log.warn(
  14757. new Deprecation(
  14758. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14759. )
  14760. );
  14761. if (!(aliasKey in options)) {
  14762. options[aliasKey] = options[key];
  14763. }
  14764. delete options[key];
  14765. }
  14766. });
  14767. return method(options);
  14768. };
  14769. Object.keys(method).forEach(key => {
  14770. patchedMethod[key] = method[key];
  14771. });
  14772. return patchedMethod;
  14773. }
  14774. /***/ }),
  14775. /***/ 929:
  14776. /***/ (function(module, __unusedexports, __webpack_require__) {
  14777. module.exports = hasNextPage
  14778. const deprecate = __webpack_require__(370)
  14779. const getPageLinks = __webpack_require__(577)
  14780. function hasNextPage (link) {
  14781. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  14782. return getPageLinks(link).next
  14783. }
  14784. /***/ }),
  14785. /***/ 948:
  14786. /***/ (function(module) {
  14787. "use strict";
  14788. /**
  14789. * Tries to execute a function and discards any error that occurs.
  14790. * @param {Function} fn - Function that might or might not throw an error.
  14791. * @returns {?*} Return-value of the function when no error occurred.
  14792. */
  14793. module.exports = function(fn) {
  14794. try { return fn() } catch (e) {}
  14795. }
  14796. /***/ }),
  14797. /***/ 950:
  14798. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14799. "use strict";
  14800. Object.defineProperty(exports, "__esModule", { value: true });
  14801. const url = __webpack_require__(835);
  14802. function getProxyUrl(reqUrl) {
  14803. let usingSsl = reqUrl.protocol === 'https:';
  14804. let proxyUrl;
  14805. if (checkBypass(reqUrl)) {
  14806. return proxyUrl;
  14807. }
  14808. let proxyVar;
  14809. if (usingSsl) {
  14810. proxyVar = process.env["https_proxy"] ||
  14811. process.env["HTTPS_PROXY"];
  14812. }
  14813. else {
  14814. proxyVar = process.env["http_proxy"] ||
  14815. process.env["HTTP_PROXY"];
  14816. }
  14817. if (proxyVar) {
  14818. proxyUrl = url.parse(proxyVar);
  14819. }
  14820. return proxyUrl;
  14821. }
  14822. exports.getProxyUrl = getProxyUrl;
  14823. function checkBypass(reqUrl) {
  14824. if (!reqUrl.hostname) {
  14825. return false;
  14826. }
  14827. let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
  14828. if (!noProxy) {
  14829. return false;
  14830. }
  14831. // Determine the request port
  14832. let reqPort;
  14833. if (reqUrl.port) {
  14834. reqPort = Number(reqUrl.port);
  14835. }
  14836. else if (reqUrl.protocol === 'http:') {
  14837. reqPort = 80;
  14838. }
  14839. else if (reqUrl.protocol === 'https:') {
  14840. reqPort = 443;
  14841. }
  14842. // Format the request hostname and hostname with port
  14843. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  14844. if (typeof reqPort === 'number') {
  14845. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  14846. }
  14847. // Compare request host against noproxy
  14848. for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
  14849. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  14850. return true;
  14851. }
  14852. }
  14853. return false;
  14854. }
  14855. exports.checkBypass = checkBypass;
  14856. /***/ }),
  14857. /***/ 954:
  14858. /***/ (function(module) {
  14859. module.exports = validateAuth;
  14860. function validateAuth(auth) {
  14861. if (typeof auth === "string") {
  14862. return;
  14863. }
  14864. if (typeof auth === "function") {
  14865. return;
  14866. }
  14867. if (auth.username && auth.password) {
  14868. return;
  14869. }
  14870. if (auth.clientId && auth.clientSecret) {
  14871. return;
  14872. }
  14873. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  14874. }
  14875. /***/ }),
  14876. /***/ 955:
  14877. /***/ (function(module, __unusedexports, __webpack_require__) {
  14878. "use strict";
  14879. const path = __webpack_require__(622);
  14880. const childProcess = __webpack_require__(129);
  14881. const crossSpawn = __webpack_require__(20);
  14882. const stripEof = __webpack_require__(768);
  14883. const npmRunPath = __webpack_require__(621);
  14884. const isStream = __webpack_require__(323);
  14885. const _getStream = __webpack_require__(145);
  14886. const pFinally = __webpack_require__(697);
  14887. const onExit = __webpack_require__(260);
  14888. const errname = __webpack_require__(427);
  14889. const stdio = __webpack_require__(168);
  14890. const TEN_MEGABYTES = 1000 * 1000 * 10;
  14891. function handleArgs(cmd, args, opts) {
  14892. let parsed;
  14893. opts = Object.assign({
  14894. extendEnv: true,
  14895. env: {}
  14896. }, opts);
  14897. if (opts.extendEnv) {
  14898. opts.env = Object.assign({}, process.env, opts.env);
  14899. }
  14900. if (opts.__winShell === true) {
  14901. delete opts.__winShell;
  14902. parsed = {
  14903. command: cmd,
  14904. args,
  14905. options: opts,
  14906. file: cmd,
  14907. original: {
  14908. cmd,
  14909. args
  14910. }
  14911. };
  14912. } else {
  14913. parsed = crossSpawn._parse(cmd, args, opts);
  14914. }
  14915. opts = Object.assign({
  14916. maxBuffer: TEN_MEGABYTES,
  14917. buffer: true,
  14918. stripEof: true,
  14919. preferLocal: true,
  14920. localDir: parsed.options.cwd || process.cwd(),
  14921. encoding: 'utf8',
  14922. reject: true,
  14923. cleanup: true
  14924. }, parsed.options);
  14925. opts.stdio = stdio(opts);
  14926. if (opts.preferLocal) {
  14927. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  14928. }
  14929. if (opts.detached) {
  14930. // #115
  14931. opts.cleanup = false;
  14932. }
  14933. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  14934. // #116
  14935. parsed.args.unshift('/q');
  14936. }
  14937. return {
  14938. cmd: parsed.command,
  14939. args: parsed.args,
  14940. opts,
  14941. parsed
  14942. };
  14943. }
  14944. function handleInput(spawned, input) {
  14945. if (input === null || input === undefined) {
  14946. return;
  14947. }
  14948. if (isStream(input)) {
  14949. input.pipe(spawned.stdin);
  14950. } else {
  14951. spawned.stdin.end(input);
  14952. }
  14953. }
  14954. function handleOutput(opts, val) {
  14955. if (val && opts.stripEof) {
  14956. val = stripEof(val);
  14957. }
  14958. return val;
  14959. }
  14960. function handleShell(fn, cmd, opts) {
  14961. let file = '/bin/sh';
  14962. let args = ['-c', cmd];
  14963. opts = Object.assign({}, opts);
  14964. if (process.platform === 'win32') {
  14965. opts.__winShell = true;
  14966. file = process.env.comspec || 'cmd.exe';
  14967. args = ['/s', '/c', `"${cmd}"`];
  14968. opts.windowsVerbatimArguments = true;
  14969. }
  14970. if (opts.shell) {
  14971. file = opts.shell;
  14972. delete opts.shell;
  14973. }
  14974. return fn(file, args, opts);
  14975. }
  14976. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  14977. if (!process[stream]) {
  14978. return null;
  14979. }
  14980. let ret;
  14981. if (!buffer) {
  14982. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  14983. ret = new Promise((resolve, reject) => {
  14984. process[stream]
  14985. .once('end', resolve)
  14986. .once('error', reject);
  14987. });
  14988. } else if (encoding) {
  14989. ret = _getStream(process[stream], {
  14990. encoding,
  14991. maxBuffer
  14992. });
  14993. } else {
  14994. ret = _getStream.buffer(process[stream], {maxBuffer});
  14995. }
  14996. return ret.catch(err => {
  14997. err.stream = stream;
  14998. err.message = `${stream} ${err.message}`;
  14999. throw err;
  15000. });
  15001. }
  15002. function makeError(result, options) {
  15003. const {stdout, stderr} = result;
  15004. let err = result.error;
  15005. const {code, signal} = result;
  15006. const {parsed, joinedCmd} = options;
  15007. const timedOut = options.timedOut || false;
  15008. if (!err) {
  15009. let output = '';
  15010. if (Array.isArray(parsed.opts.stdio)) {
  15011. if (parsed.opts.stdio[2] !== 'inherit') {
  15012. output += output.length > 0 ? stderr : `\n${stderr}`;
  15013. }
  15014. if (parsed.opts.stdio[1] !== 'inherit') {
  15015. output += `\n${stdout}`;
  15016. }
  15017. } else if (parsed.opts.stdio !== 'inherit') {
  15018. output = `\n${stderr}${stdout}`;
  15019. }
  15020. err = new Error(`Command failed: ${joinedCmd}${output}`);
  15021. err.code = code < 0 ? errname(code) : code;
  15022. }
  15023. err.stdout = stdout;
  15024. err.stderr = stderr;
  15025. err.failed = true;
  15026. err.signal = signal || null;
  15027. err.cmd = joinedCmd;
  15028. err.timedOut = timedOut;
  15029. return err;
  15030. }
  15031. function joinCmd(cmd, args) {
  15032. let joinedCmd = cmd;
  15033. if (Array.isArray(args) && args.length > 0) {
  15034. joinedCmd += ' ' + args.join(' ');
  15035. }
  15036. return joinedCmd;
  15037. }
  15038. module.exports = (cmd, args, opts) => {
  15039. const parsed = handleArgs(cmd, args, opts);
  15040. const {encoding, buffer, maxBuffer} = parsed.opts;
  15041. const joinedCmd = joinCmd(cmd, args);
  15042. let spawned;
  15043. try {
  15044. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  15045. } catch (err) {
  15046. return Promise.reject(err);
  15047. }
  15048. let removeExitHandler;
  15049. if (parsed.opts.cleanup) {
  15050. removeExitHandler = onExit(() => {
  15051. spawned.kill();
  15052. });
  15053. }
  15054. let timeoutId = null;
  15055. let timedOut = false;
  15056. const cleanup = () => {
  15057. if (timeoutId) {
  15058. clearTimeout(timeoutId);
  15059. timeoutId = null;
  15060. }
  15061. if (removeExitHandler) {
  15062. removeExitHandler();
  15063. }
  15064. };
  15065. if (parsed.opts.timeout > 0) {
  15066. timeoutId = setTimeout(() => {
  15067. timeoutId = null;
  15068. timedOut = true;
  15069. spawned.kill(parsed.opts.killSignal);
  15070. }, parsed.opts.timeout);
  15071. }
  15072. const processDone = new Promise(resolve => {
  15073. spawned.on('exit', (code, signal) => {
  15074. cleanup();
  15075. resolve({code, signal});
  15076. });
  15077. spawned.on('error', err => {
  15078. cleanup();
  15079. resolve({error: err});
  15080. });
  15081. if (spawned.stdin) {
  15082. spawned.stdin.on('error', err => {
  15083. cleanup();
  15084. resolve({error: err});
  15085. });
  15086. }
  15087. });
  15088. function destroy() {
  15089. if (spawned.stdout) {
  15090. spawned.stdout.destroy();
  15091. }
  15092. if (spawned.stderr) {
  15093. spawned.stderr.destroy();
  15094. }
  15095. }
  15096. const handlePromise = () => pFinally(Promise.all([
  15097. processDone,
  15098. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  15099. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  15100. ]).then(arr => {
  15101. const result = arr[0];
  15102. result.stdout = arr[1];
  15103. result.stderr = arr[2];
  15104. if (result.error || result.code !== 0 || result.signal !== null) {
  15105. const err = makeError(result, {
  15106. joinedCmd,
  15107. parsed,
  15108. timedOut
  15109. });
  15110. // TODO: missing some timeout logic for killed
  15111. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  15112. // err.killed = spawned.killed || killed;
  15113. err.killed = err.killed || spawned.killed;
  15114. if (!parsed.opts.reject) {
  15115. return err;
  15116. }
  15117. throw err;
  15118. }
  15119. return {
  15120. stdout: handleOutput(parsed.opts, result.stdout),
  15121. stderr: handleOutput(parsed.opts, result.stderr),
  15122. code: 0,
  15123. failed: false,
  15124. killed: false,
  15125. signal: null,
  15126. cmd: joinedCmd,
  15127. timedOut: false
  15128. };
  15129. }), destroy);
  15130. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  15131. handleInput(spawned, parsed.opts.input);
  15132. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  15133. spawned.catch = onrejected => handlePromise().catch(onrejected);
  15134. return spawned;
  15135. };
  15136. // TODO: set `stderr: 'ignore'` when that option is implemented
  15137. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  15138. // TODO: set `stdout: 'ignore'` when that option is implemented
  15139. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  15140. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  15141. module.exports.sync = (cmd, args, opts) => {
  15142. const parsed = handleArgs(cmd, args, opts);
  15143. const joinedCmd = joinCmd(cmd, args);
  15144. if (isStream(parsed.opts.input)) {
  15145. throw new TypeError('The `input` option cannot be a stream in sync mode');
  15146. }
  15147. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  15148. result.code = result.status;
  15149. if (result.error || result.status !== 0 || result.signal !== null) {
  15150. const err = makeError(result, {
  15151. joinedCmd,
  15152. parsed
  15153. });
  15154. if (!parsed.opts.reject) {
  15155. return err;
  15156. }
  15157. throw err;
  15158. }
  15159. return {
  15160. stdout: handleOutput(parsed.opts, result.stdout),
  15161. stderr: handleOutput(parsed.opts, result.stderr),
  15162. code: 0,
  15163. failed: false,
  15164. signal: null,
  15165. cmd: joinedCmd,
  15166. timedOut: false
  15167. };
  15168. };
  15169. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  15170. /***/ }),
  15171. /***/ 966:
  15172. /***/ (function(module, __unusedexports, __webpack_require__) {
  15173. "use strict";
  15174. const {PassThrough} = __webpack_require__(413);
  15175. module.exports = options => {
  15176. options = Object.assign({}, options);
  15177. const {array} = options;
  15178. let {encoding} = options;
  15179. const buffer = encoding === 'buffer';
  15180. let objectMode = false;
  15181. if (array) {
  15182. objectMode = !(encoding || buffer);
  15183. } else {
  15184. encoding = encoding || 'utf8';
  15185. }
  15186. if (buffer) {
  15187. encoding = null;
  15188. }
  15189. let len = 0;
  15190. const ret = [];
  15191. const stream = new PassThrough({objectMode});
  15192. if (encoding) {
  15193. stream.setEncoding(encoding);
  15194. }
  15195. stream.on('data', chunk => {
  15196. ret.push(chunk);
  15197. if (objectMode) {
  15198. len = ret.length;
  15199. } else {
  15200. len += chunk.length;
  15201. }
  15202. });
  15203. stream.getBufferedValue = () => {
  15204. if (array) {
  15205. return ret;
  15206. }
  15207. return buffer ? Buffer.concat(ret, len) : ret.join('');
  15208. };
  15209. stream.getBufferedLength = () => len;
  15210. return stream;
  15211. };
  15212. /***/ }),
  15213. /***/ 969:
  15214. /***/ (function(module, __unusedexports, __webpack_require__) {
  15215. var wrappy = __webpack_require__(11)
  15216. module.exports = wrappy(once)
  15217. module.exports.strict = wrappy(onceStrict)
  15218. once.proto = once(function () {
  15219. Object.defineProperty(Function.prototype, 'once', {
  15220. value: function () {
  15221. return once(this)
  15222. },
  15223. configurable: true
  15224. })
  15225. Object.defineProperty(Function.prototype, 'onceStrict', {
  15226. value: function () {
  15227. return onceStrict(this)
  15228. },
  15229. configurable: true
  15230. })
  15231. })
  15232. function once (fn) {
  15233. var f = function () {
  15234. if (f.called) return f.value
  15235. f.called = true
  15236. return f.value = fn.apply(this, arguments)
  15237. }
  15238. f.called = false
  15239. return f
  15240. }
  15241. function onceStrict (fn) {
  15242. var f = function () {
  15243. if (f.called)
  15244. throw new Error(f.onceError)
  15245. f.called = true
  15246. return f.value = fn.apply(this, arguments)
  15247. }
  15248. var name = fn.name || 'Function wrapped with `once`'
  15249. f.onceError = name + " shouldn't be called more than once"
  15250. f.called = false
  15251. return f
  15252. }
  15253. /***/ }),
  15254. /***/ 986:
  15255. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  15256. "use strict";
  15257. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  15258. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  15259. return new (P || (P = Promise))(function (resolve, reject) {
  15260. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  15261. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  15262. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  15263. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15264. });
  15265. };
  15266. Object.defineProperty(exports, "__esModule", { value: true });
  15267. const tr = __webpack_require__(9);
  15268. /**
  15269. * Exec a command.
  15270. * Output will be streamed to the live console.
  15271. * Returns promise with return code
  15272. *
  15273. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  15274. * @param args optional arguments for tool. Escaping is handled by the lib.
  15275. * @param options optional exec options. See ExecOptions
  15276. * @returns Promise<number> exit code
  15277. */
  15278. function exec(commandLine, args, options) {
  15279. return __awaiter(this, void 0, void 0, function* () {
  15280. const commandArgs = tr.argStringToArray(commandLine);
  15281. if (commandArgs.length === 0) {
  15282. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  15283. }
  15284. // Path to tool to execute should be first arg
  15285. const toolPath = commandArgs[0];
  15286. args = commandArgs.slice(1).concat(args || []);
  15287. const runner = new tr.ToolRunner(toolPath, args, options);
  15288. return runner.exec();
  15289. });
  15290. }
  15291. exports.exec = exec;
  15292. //# sourceMappingURL=exec.js.map
  15293. /***/ }),
  15294. /***/ 991:
  15295. /***/ (function(module, __unusedexports, __webpack_require__) {
  15296. module.exports = authenticationRequestError;
  15297. const { RequestError } = __webpack_require__(463);
  15298. function authenticationRequestError(state, error, options) {
  15299. if (!error.headers) throw error;
  15300. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  15301. // handle "2FA required" error only
  15302. if (error.status !== 401 || !otpRequired) {
  15303. throw error;
  15304. }
  15305. if (
  15306. error.status === 401 &&
  15307. otpRequired &&
  15308. error.request &&
  15309. error.request.headers["x-github-otp"]
  15310. ) {
  15311. if (state.otp) {
  15312. delete state.otp; // no longer valid, request again
  15313. } else {
  15314. throw new RequestError(
  15315. "Invalid one-time password for two-factor authentication",
  15316. 401,
  15317. {
  15318. headers: error.headers,
  15319. request: options
  15320. }
  15321. );
  15322. }
  15323. }
  15324. if (typeof state.auth.on2fa !== "function") {
  15325. throw new RequestError(
  15326. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  15327. 401,
  15328. {
  15329. headers: error.headers,
  15330. request: options
  15331. }
  15332. );
  15333. }
  15334. return Promise.resolve()
  15335. .then(() => {
  15336. return state.auth.on2fa();
  15337. })
  15338. .then(oneTimePassword => {
  15339. const newOptions = Object.assign(options, {
  15340. headers: Object.assign(options.headers, {
  15341. "x-github-otp": oneTimePassword
  15342. })
  15343. });
  15344. return state.octokit.request(newOptions).then(response => {
  15345. // If OTP still valid, then persist it for following requests
  15346. state.otp = oneTimePassword;
  15347. return response;
  15348. });
  15349. });
  15350. }
  15351. /***/ })
  15352. /******/ });