index.js 596 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268
  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__(372),
  50. __webpack_require__(19), // deprecated: remove in v17
  51. __webpack_require__(190),
  52. __webpack_require__(148),
  53. __webpack_require__(248),
  54. __webpack_require__(586),
  55. __webpack_require__(430),
  56. __webpack_require__(850) // deprecated: remove in v17
  57. ];
  58. module.exports = Octokit.plugin(CORE_PLUGINS);
  59. /***/ }),
  60. /***/ 1:
  61. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  62. "use strict";
  63. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  64. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  65. return new (P || (P = Promise))(function (resolve, reject) {
  66. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  67. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  68. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  69. step((generator = generator.apply(thisArg, _arguments || [])).next());
  70. });
  71. };
  72. Object.defineProperty(exports, "__esModule", { value: true });
  73. const childProcess = __webpack_require__(129);
  74. const path = __webpack_require__(622);
  75. const util_1 = __webpack_require__(669);
  76. const ioUtil = __webpack_require__(672);
  77. const exec = util_1.promisify(childProcess.exec);
  78. /**
  79. * Copies a file or folder.
  80. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  81. *
  82. * @param source source path
  83. * @param dest destination path
  84. * @param options optional. See CopyOptions.
  85. */
  86. function cp(source, dest, options = {}) {
  87. return __awaiter(this, void 0, void 0, function* () {
  88. const { force, recursive } = readCopyOptions(options);
  89. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  90. // Dest is an existing file, but not forcing
  91. if (destStat && destStat.isFile() && !force) {
  92. return;
  93. }
  94. // If dest is an existing directory, should copy inside.
  95. const newDest = destStat && destStat.isDirectory()
  96. ? path.join(dest, path.basename(source))
  97. : dest;
  98. if (!(yield ioUtil.exists(source))) {
  99. throw new Error(`no such file or directory: ${source}`);
  100. }
  101. const sourceStat = yield ioUtil.stat(source);
  102. if (sourceStat.isDirectory()) {
  103. if (!recursive) {
  104. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  105. }
  106. else {
  107. yield cpDirRecursive(source, newDest, 0, force);
  108. }
  109. }
  110. else {
  111. if (path.relative(source, newDest) === '') {
  112. // a file cannot be copied to itself
  113. throw new Error(`'${newDest}' and '${source}' are the same file`);
  114. }
  115. yield copyFile(source, newDest, force);
  116. }
  117. });
  118. }
  119. exports.cp = cp;
  120. /**
  121. * Moves a path.
  122. *
  123. * @param source source path
  124. * @param dest destination path
  125. * @param options optional. See MoveOptions.
  126. */
  127. function mv(source, dest, options = {}) {
  128. return __awaiter(this, void 0, void 0, function* () {
  129. if (yield ioUtil.exists(dest)) {
  130. let destExists = true;
  131. if (yield ioUtil.isDirectory(dest)) {
  132. // If dest is directory copy src into dest
  133. dest = path.join(dest, path.basename(source));
  134. destExists = yield ioUtil.exists(dest);
  135. }
  136. if (destExists) {
  137. if (options.force == null || options.force) {
  138. yield rmRF(dest);
  139. }
  140. else {
  141. throw new Error('Destination already exists');
  142. }
  143. }
  144. }
  145. yield mkdirP(path.dirname(dest));
  146. yield ioUtil.rename(source, dest);
  147. });
  148. }
  149. exports.mv = mv;
  150. /**
  151. * Remove a path recursively with force
  152. *
  153. * @param inputPath path to remove
  154. */
  155. function rmRF(inputPath) {
  156. return __awaiter(this, void 0, void 0, function* () {
  157. if (ioUtil.IS_WINDOWS) {
  158. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  159. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  160. try {
  161. if (yield ioUtil.isDirectory(inputPath, true)) {
  162. yield exec(`rd /s /q "${inputPath}"`);
  163. }
  164. else {
  165. yield exec(`del /f /a "${inputPath}"`);
  166. }
  167. }
  168. catch (err) {
  169. // if you try to delete a file that doesn't exist, desired result is achieved
  170. // other errors are valid
  171. if (err.code !== 'ENOENT')
  172. throw err;
  173. }
  174. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  175. try {
  176. yield ioUtil.unlink(inputPath);
  177. }
  178. catch (err) {
  179. // if you try to delete a file that doesn't exist, desired result is achieved
  180. // other errors are valid
  181. if (err.code !== 'ENOENT')
  182. throw err;
  183. }
  184. }
  185. else {
  186. let isDir = false;
  187. try {
  188. isDir = yield ioUtil.isDirectory(inputPath);
  189. }
  190. catch (err) {
  191. // if you try to delete a file that doesn't exist, desired result is achieved
  192. // other errors are valid
  193. if (err.code !== 'ENOENT')
  194. throw err;
  195. return;
  196. }
  197. if (isDir) {
  198. yield exec(`rm -rf "${inputPath}"`);
  199. }
  200. else {
  201. yield ioUtil.unlink(inputPath);
  202. }
  203. }
  204. });
  205. }
  206. exports.rmRF = rmRF;
  207. /**
  208. * Make a directory. Creates the full path with folders in between
  209. * Will throw if it fails
  210. *
  211. * @param fsPath path to create
  212. * @returns Promise<void>
  213. */
  214. function mkdirP(fsPath) {
  215. return __awaiter(this, void 0, void 0, function* () {
  216. yield ioUtil.mkdirP(fsPath);
  217. });
  218. }
  219. exports.mkdirP = mkdirP;
  220. /**
  221. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  222. * If you check and the tool does not exist, it will throw.
  223. *
  224. * @param tool name of the tool
  225. * @param check whether to check if tool exists
  226. * @returns Promise<string> path to tool
  227. */
  228. function which(tool, check) {
  229. return __awaiter(this, void 0, void 0, function* () {
  230. if (!tool) {
  231. throw new Error("parameter 'tool' is required");
  232. }
  233. // recursive when check=true
  234. if (check) {
  235. const result = yield which(tool, false);
  236. if (!result) {
  237. if (ioUtil.IS_WINDOWS) {
  238. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
  239. }
  240. else {
  241. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
  242. }
  243. }
  244. }
  245. try {
  246. // build the list of extensions to try
  247. const extensions = [];
  248. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  249. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  250. if (extension) {
  251. extensions.push(extension);
  252. }
  253. }
  254. }
  255. // if it's rooted, return it if exists. otherwise return empty.
  256. if (ioUtil.isRooted(tool)) {
  257. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  258. if (filePath) {
  259. return filePath;
  260. }
  261. return '';
  262. }
  263. // if any path separators, return empty
  264. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  265. return '';
  266. }
  267. // build the list of directories
  268. //
  269. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  270. // it feels like we should not do this. Checking the current directory seems like more of a use
  271. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  272. // across platforms.
  273. const directories = [];
  274. if (process.env.PATH) {
  275. for (const p of process.env.PATH.split(path.delimiter)) {
  276. if (p) {
  277. directories.push(p);
  278. }
  279. }
  280. }
  281. // return the first match
  282. for (const directory of directories) {
  283. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  284. if (filePath) {
  285. return filePath;
  286. }
  287. }
  288. return '';
  289. }
  290. catch (err) {
  291. throw new Error(`which failed with message ${err.message}`);
  292. }
  293. });
  294. }
  295. exports.which = which;
  296. function readCopyOptions(options) {
  297. const force = options.force == null ? true : options.force;
  298. const recursive = Boolean(options.recursive);
  299. return { force, recursive };
  300. }
  301. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  302. return __awaiter(this, void 0, void 0, function* () {
  303. // Ensure there is not a run away recursive copy
  304. if (currentDepth >= 255)
  305. return;
  306. currentDepth++;
  307. yield mkdirP(destDir);
  308. const files = yield ioUtil.readdir(sourceDir);
  309. for (const fileName of files) {
  310. const srcFile = `${sourceDir}/${fileName}`;
  311. const destFile = `${destDir}/${fileName}`;
  312. const srcFileStat = yield ioUtil.lstat(srcFile);
  313. if (srcFileStat.isDirectory()) {
  314. // Recurse
  315. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  316. }
  317. else {
  318. yield copyFile(srcFile, destFile, force);
  319. }
  320. }
  321. // Change the mode for the newly created directory
  322. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  323. });
  324. }
  325. // Buffered file copy
  326. function copyFile(srcFile, destFile, force) {
  327. return __awaiter(this, void 0, void 0, function* () {
  328. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  329. // unlink/re-link it
  330. try {
  331. yield ioUtil.lstat(destFile);
  332. yield ioUtil.unlink(destFile);
  333. }
  334. catch (e) {
  335. // Try to override file permission
  336. if (e.code === 'EPERM') {
  337. yield ioUtil.chmod(destFile, '0666');
  338. yield ioUtil.unlink(destFile);
  339. }
  340. // other errors = it doesn't exist, no work to do
  341. }
  342. // Copy over symlink
  343. const symlinkFull = yield ioUtil.readlink(srcFile);
  344. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  345. }
  346. else if (!(yield ioUtil.exists(destFile)) || force) {
  347. yield ioUtil.copyFile(srcFile, destFile);
  348. }
  349. });
  350. }
  351. //# sourceMappingURL=io.js.map
  352. /***/ }),
  353. /***/ 2:
  354. /***/ (function(module, __unusedexports, __webpack_require__) {
  355. "use strict";
  356. const os = __webpack_require__(87);
  357. const macosRelease = __webpack_require__(118);
  358. const winRelease = __webpack_require__(49);
  359. const osName = (platform, release) => {
  360. if (!platform && release) {
  361. throw new Error('You can\'t specify a `release` without specifying `platform`');
  362. }
  363. platform = platform || os.platform();
  364. let id;
  365. if (platform === 'darwin') {
  366. if (!release && os.platform() === 'darwin') {
  367. release = os.release();
  368. }
  369. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  370. id = release ? macosRelease(release).name : '';
  371. return prefix + (id ? ' ' + id : '');
  372. }
  373. if (platform === 'linux') {
  374. if (!release && os.platform() === 'linux') {
  375. release = os.release();
  376. }
  377. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  378. return 'Linux' + (id ? ' ' + id : '');
  379. }
  380. if (platform === 'win32') {
  381. if (!release && os.platform() === 'win32') {
  382. release = os.release();
  383. }
  384. id = release ? winRelease(release) : '';
  385. return 'Windows' + (id ? ' ' + id : '');
  386. }
  387. return platform;
  388. };
  389. module.exports = osName;
  390. /***/ }),
  391. /***/ 8:
  392. /***/ (function(module, __unusedexports, __webpack_require__) {
  393. module.exports = iterator;
  394. const normalizePaginatedListResponse = __webpack_require__(301);
  395. function iterator(octokit, options) {
  396. const headers = options.headers;
  397. let url = octokit.request.endpoint(options).url;
  398. return {
  399. [Symbol.asyncIterator]: () => ({
  400. next() {
  401. if (!url) {
  402. return Promise.resolve({ done: true });
  403. }
  404. return octokit
  405. .request({ url, headers })
  406. .then(response => {
  407. normalizePaginatedListResponse(octokit, url, response);
  408. // `response.headers.link` format:
  409. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  410. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  411. url = ((response.headers.link || "").match(
  412. /<([^>]+)>;\s*rel="next"/
  413. ) || [])[1];
  414. return { value: response };
  415. });
  416. }
  417. })
  418. };
  419. }
  420. /***/ }),
  421. /***/ 9:
  422. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  423. "use strict";
  424. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  425. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  426. return new (P || (P = Promise))(function (resolve, reject) {
  427. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  428. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  429. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  430. step((generator = generator.apply(thisArg, _arguments || [])).next());
  431. });
  432. };
  433. Object.defineProperty(exports, "__esModule", { value: true });
  434. const os = __webpack_require__(87);
  435. const events = __webpack_require__(614);
  436. const child = __webpack_require__(129);
  437. /* eslint-disable @typescript-eslint/unbound-method */
  438. const IS_WINDOWS = process.platform === 'win32';
  439. /*
  440. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  441. */
  442. class ToolRunner extends events.EventEmitter {
  443. constructor(toolPath, args, options) {
  444. super();
  445. if (!toolPath) {
  446. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  447. }
  448. this.toolPath = toolPath;
  449. this.args = args || [];
  450. this.options = options || {};
  451. }
  452. _debug(message) {
  453. if (this.options.listeners && this.options.listeners.debug) {
  454. this.options.listeners.debug(message);
  455. }
  456. }
  457. _getCommandString(options, noPrefix) {
  458. const toolPath = this._getSpawnFileName();
  459. const args = this._getSpawnArgs(options);
  460. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  461. if (IS_WINDOWS) {
  462. // Windows + cmd file
  463. if (this._isCmdFile()) {
  464. cmd += toolPath;
  465. for (const a of args) {
  466. cmd += ` ${a}`;
  467. }
  468. }
  469. // Windows + verbatim
  470. else if (options.windowsVerbatimArguments) {
  471. cmd += `"${toolPath}"`;
  472. for (const a of args) {
  473. cmd += ` ${a}`;
  474. }
  475. }
  476. // Windows (regular)
  477. else {
  478. cmd += this._windowsQuoteCmdArg(toolPath);
  479. for (const a of args) {
  480. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  481. }
  482. }
  483. }
  484. else {
  485. // OSX/Linux - this can likely be improved with some form of quoting.
  486. // creating processes on Unix is fundamentally different than Windows.
  487. // on Unix, execvp() takes an arg array.
  488. cmd += toolPath;
  489. for (const a of args) {
  490. cmd += ` ${a}`;
  491. }
  492. }
  493. return cmd;
  494. }
  495. _processLineBuffer(data, strBuffer, onLine) {
  496. try {
  497. let s = strBuffer + data.toString();
  498. let n = s.indexOf(os.EOL);
  499. while (n > -1) {
  500. const line = s.substring(0, n);
  501. onLine(line);
  502. // the rest of the string ...
  503. s = s.substring(n + os.EOL.length);
  504. n = s.indexOf(os.EOL);
  505. }
  506. strBuffer = s;
  507. }
  508. catch (err) {
  509. // streaming lines to console is best effort. Don't fail a build.
  510. this._debug(`error processing line. Failed with error ${err}`);
  511. }
  512. }
  513. _getSpawnFileName() {
  514. if (IS_WINDOWS) {
  515. if (this._isCmdFile()) {
  516. return process.env['COMSPEC'] || 'cmd.exe';
  517. }
  518. }
  519. return this.toolPath;
  520. }
  521. _getSpawnArgs(options) {
  522. if (IS_WINDOWS) {
  523. if (this._isCmdFile()) {
  524. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  525. for (const a of this.args) {
  526. argline += ' ';
  527. argline += options.windowsVerbatimArguments
  528. ? a
  529. : this._windowsQuoteCmdArg(a);
  530. }
  531. argline += '"';
  532. return [argline];
  533. }
  534. }
  535. return this.args;
  536. }
  537. _endsWith(str, end) {
  538. return str.endsWith(end);
  539. }
  540. _isCmdFile() {
  541. const upperToolPath = this.toolPath.toUpperCase();
  542. return (this._endsWith(upperToolPath, '.CMD') ||
  543. this._endsWith(upperToolPath, '.BAT'));
  544. }
  545. _windowsQuoteCmdArg(arg) {
  546. // for .exe, apply the normal quoting rules that libuv applies
  547. if (!this._isCmdFile()) {
  548. return this._uvQuoteCmdArg(arg);
  549. }
  550. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  551. // the libuv rules are generic and are not designed specifically for cmd.exe
  552. // command line parser.
  553. //
  554. // for a detailed description of the cmd.exe command line parser, refer to
  555. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  556. // need quotes for empty arg
  557. if (!arg) {
  558. return '""';
  559. }
  560. // determine whether the arg needs to be quoted
  561. const cmdSpecialChars = [
  562. ' ',
  563. '\t',
  564. '&',
  565. '(',
  566. ')',
  567. '[',
  568. ']',
  569. '{',
  570. '}',
  571. '^',
  572. '=',
  573. ';',
  574. '!',
  575. "'",
  576. '+',
  577. ',',
  578. '`',
  579. '~',
  580. '|',
  581. '<',
  582. '>',
  583. '"'
  584. ];
  585. let needsQuotes = false;
  586. for (const char of arg) {
  587. if (cmdSpecialChars.some(x => x === char)) {
  588. needsQuotes = true;
  589. break;
  590. }
  591. }
  592. // short-circuit if quotes not needed
  593. if (!needsQuotes) {
  594. return arg;
  595. }
  596. // the following quoting rules are very similar to the rules that by libuv applies.
  597. //
  598. // 1) wrap the string in quotes
  599. //
  600. // 2) double-up quotes - i.e. " => ""
  601. //
  602. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  603. // doesn't work well with a cmd.exe command line.
  604. //
  605. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  606. // for example, the command line:
  607. // foo.exe "myarg:""my val"""
  608. // is parsed by a .NET console app into an arg array:
  609. // [ "myarg:\"my val\"" ]
  610. // which is the same end result when applying libuv quoting rules. although the actual
  611. // command line from libuv quoting rules would look like:
  612. // foo.exe "myarg:\"my val\""
  613. //
  614. // 3) double-up slashes that precede a quote,
  615. // e.g. hello \world => "hello \world"
  616. // hello\"world => "hello\\""world"
  617. // hello\\"world => "hello\\\\""world"
  618. // hello world\ => "hello world\\"
  619. //
  620. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  621. // the reasons for including this as a .cmd quoting rule are:
  622. //
  623. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  624. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  625. //
  626. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  627. // haven't heard any complaints about that aspect.
  628. //
  629. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  630. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  631. // by using %%.
  632. //
  633. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  634. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  635. //
  636. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  637. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  638. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  639. // to an external program.
  640. //
  641. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  642. // % can be escaped within a .cmd file.
  643. let reverse = '"';
  644. let quoteHit = true;
  645. for (let i = arg.length; i > 0; i--) {
  646. // walk the string in reverse
  647. reverse += arg[i - 1];
  648. if (quoteHit && arg[i - 1] === '\\') {
  649. reverse += '\\'; // double the slash
  650. }
  651. else if (arg[i - 1] === '"') {
  652. quoteHit = true;
  653. reverse += '"'; // double the quote
  654. }
  655. else {
  656. quoteHit = false;
  657. }
  658. }
  659. reverse += '"';
  660. return reverse
  661. .split('')
  662. .reverse()
  663. .join('');
  664. }
  665. _uvQuoteCmdArg(arg) {
  666. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  667. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  668. // is used.
  669. //
  670. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  671. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  672. // pasting copyright notice from Node within this function:
  673. //
  674. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  675. //
  676. // Permission is hereby granted, free of charge, to any person obtaining a copy
  677. // of this software and associated documentation files (the "Software"), to
  678. // deal in the Software without restriction, including without limitation the
  679. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  680. // sell copies of the Software, and to permit persons to whom the Software is
  681. // furnished to do so, subject to the following conditions:
  682. //
  683. // The above copyright notice and this permission notice shall be included in
  684. // all copies or substantial portions of the Software.
  685. //
  686. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  687. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  688. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  689. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  690. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  691. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  692. // IN THE SOFTWARE.
  693. if (!arg) {
  694. // Need double quotation for empty argument
  695. return '""';
  696. }
  697. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  698. // No quotation needed
  699. return arg;
  700. }
  701. if (!arg.includes('"') && !arg.includes('\\')) {
  702. // No embedded double quotes or backslashes, so I can just wrap
  703. // quote marks around the whole thing.
  704. return `"${arg}"`;
  705. }
  706. // Expected input/output:
  707. // input : hello"world
  708. // output: "hello\"world"
  709. // input : hello""world
  710. // output: "hello\"\"world"
  711. // input : hello\world
  712. // output: hello\world
  713. // input : hello\\world
  714. // output: hello\\world
  715. // input : hello\"world
  716. // output: "hello\\\"world"
  717. // input : hello\\"world
  718. // output: "hello\\\\\"world"
  719. // input : hello world\
  720. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  721. // but it appears the comment is wrong, it should be "hello world\\"
  722. let reverse = '"';
  723. let quoteHit = true;
  724. for (let i = arg.length; i > 0; i--) {
  725. // walk the string in reverse
  726. reverse += arg[i - 1];
  727. if (quoteHit && arg[i - 1] === '\\') {
  728. reverse += '\\';
  729. }
  730. else if (arg[i - 1] === '"') {
  731. quoteHit = true;
  732. reverse += '\\';
  733. }
  734. else {
  735. quoteHit = false;
  736. }
  737. }
  738. reverse += '"';
  739. return reverse
  740. .split('')
  741. .reverse()
  742. .join('');
  743. }
  744. _cloneExecOptions(options) {
  745. options = options || {};
  746. const result = {
  747. cwd: options.cwd || process.cwd(),
  748. env: options.env || process.env,
  749. silent: options.silent || false,
  750. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  751. failOnStdErr: options.failOnStdErr || false,
  752. ignoreReturnCode: options.ignoreReturnCode || false,
  753. delay: options.delay || 10000
  754. };
  755. result.outStream = options.outStream || process.stdout;
  756. result.errStream = options.errStream || process.stderr;
  757. return result;
  758. }
  759. _getSpawnOptions(options, toolPath) {
  760. options = options || {};
  761. const result = {};
  762. result.cwd = options.cwd;
  763. result.env = options.env;
  764. result['windowsVerbatimArguments'] =
  765. options.windowsVerbatimArguments || this._isCmdFile();
  766. if (options.windowsVerbatimArguments) {
  767. result.argv0 = `"${toolPath}"`;
  768. }
  769. return result;
  770. }
  771. /**
  772. * Exec a tool.
  773. * Output will be streamed to the live console.
  774. * Returns promise with return code
  775. *
  776. * @param tool path to tool to exec
  777. * @param options optional exec options. See ExecOptions
  778. * @returns number
  779. */
  780. exec() {
  781. return __awaiter(this, void 0, void 0, function* () {
  782. return new Promise((resolve, reject) => {
  783. this._debug(`exec tool: ${this.toolPath}`);
  784. this._debug('arguments:');
  785. for (const arg of this.args) {
  786. this._debug(` ${arg}`);
  787. }
  788. const optionsNonNull = this._cloneExecOptions(this.options);
  789. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  790. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  791. }
  792. const state = new ExecState(optionsNonNull, this.toolPath);
  793. state.on('debug', (message) => {
  794. this._debug(message);
  795. });
  796. const fileName = this._getSpawnFileName();
  797. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  798. const stdbuffer = '';
  799. if (cp.stdout) {
  800. cp.stdout.on('data', (data) => {
  801. if (this.options.listeners && this.options.listeners.stdout) {
  802. this.options.listeners.stdout(data);
  803. }
  804. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  805. optionsNonNull.outStream.write(data);
  806. }
  807. this._processLineBuffer(data, stdbuffer, (line) => {
  808. if (this.options.listeners && this.options.listeners.stdline) {
  809. this.options.listeners.stdline(line);
  810. }
  811. });
  812. });
  813. }
  814. const errbuffer = '';
  815. if (cp.stderr) {
  816. cp.stderr.on('data', (data) => {
  817. state.processStderr = true;
  818. if (this.options.listeners && this.options.listeners.stderr) {
  819. this.options.listeners.stderr(data);
  820. }
  821. if (!optionsNonNull.silent &&
  822. optionsNonNull.errStream &&
  823. optionsNonNull.outStream) {
  824. const s = optionsNonNull.failOnStdErr
  825. ? optionsNonNull.errStream
  826. : optionsNonNull.outStream;
  827. s.write(data);
  828. }
  829. this._processLineBuffer(data, errbuffer, (line) => {
  830. if (this.options.listeners && this.options.listeners.errline) {
  831. this.options.listeners.errline(line);
  832. }
  833. });
  834. });
  835. }
  836. cp.on('error', (err) => {
  837. state.processError = err.message;
  838. state.processExited = true;
  839. state.processClosed = true;
  840. state.CheckComplete();
  841. });
  842. cp.on('exit', (code) => {
  843. state.processExitCode = code;
  844. state.processExited = true;
  845. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  846. state.CheckComplete();
  847. });
  848. cp.on('close', (code) => {
  849. state.processExitCode = code;
  850. state.processExited = true;
  851. state.processClosed = true;
  852. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  853. state.CheckComplete();
  854. });
  855. state.on('done', (error, exitCode) => {
  856. if (stdbuffer.length > 0) {
  857. this.emit('stdline', stdbuffer);
  858. }
  859. if (errbuffer.length > 0) {
  860. this.emit('errline', errbuffer);
  861. }
  862. cp.removeAllListeners();
  863. if (error) {
  864. reject(error);
  865. }
  866. else {
  867. resolve(exitCode);
  868. }
  869. });
  870. });
  871. });
  872. }
  873. }
  874. exports.ToolRunner = ToolRunner;
  875. /**
  876. * Convert an arg string to an array of args. Handles escaping
  877. *
  878. * @param argString string of arguments
  879. * @returns string[] array of arguments
  880. */
  881. function argStringToArray(argString) {
  882. const args = [];
  883. let inQuotes = false;
  884. let escaped = false;
  885. let arg = '';
  886. function append(c) {
  887. // we only escape double quotes.
  888. if (escaped && c !== '"') {
  889. arg += '\\';
  890. }
  891. arg += c;
  892. escaped = false;
  893. }
  894. for (let i = 0; i < argString.length; i++) {
  895. const c = argString.charAt(i);
  896. if (c === '"') {
  897. if (!escaped) {
  898. inQuotes = !inQuotes;
  899. }
  900. else {
  901. append(c);
  902. }
  903. continue;
  904. }
  905. if (c === '\\' && escaped) {
  906. append(c);
  907. continue;
  908. }
  909. if (c === '\\' && inQuotes) {
  910. escaped = true;
  911. continue;
  912. }
  913. if (c === ' ' && !inQuotes) {
  914. if (arg.length > 0) {
  915. args.push(arg);
  916. arg = '';
  917. }
  918. continue;
  919. }
  920. append(c);
  921. }
  922. if (arg.length > 0) {
  923. args.push(arg.trim());
  924. }
  925. return args;
  926. }
  927. exports.argStringToArray = argStringToArray;
  928. class ExecState extends events.EventEmitter {
  929. constructor(options, toolPath) {
  930. super();
  931. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  932. this.processError = '';
  933. this.processExitCode = 0;
  934. this.processExited = false; // tracks whether the process has exited
  935. this.processStderr = false; // tracks whether stderr was written to
  936. this.delay = 10000; // 10 seconds
  937. this.done = false;
  938. this.timeout = null;
  939. if (!toolPath) {
  940. throw new Error('toolPath must not be empty');
  941. }
  942. this.options = options;
  943. this.toolPath = toolPath;
  944. if (options.delay) {
  945. this.delay = options.delay;
  946. }
  947. }
  948. CheckComplete() {
  949. if (this.done) {
  950. return;
  951. }
  952. if (this.processClosed) {
  953. this._setResult();
  954. }
  955. else if (this.processExited) {
  956. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  957. }
  958. }
  959. _debug(message) {
  960. this.emit('debug', message);
  961. }
  962. _setResult() {
  963. // determine whether there is an error
  964. let error;
  965. if (this.processExited) {
  966. if (this.processError) {
  967. error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
  968. }
  969. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  970. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  971. }
  972. else if (this.processStderr && this.options.failOnStdErr) {
  973. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  974. }
  975. }
  976. // clear the timeout
  977. if (this.timeout) {
  978. clearTimeout(this.timeout);
  979. this.timeout = null;
  980. }
  981. this.done = true;
  982. this.emit('done', error, this.processExitCode);
  983. }
  984. static HandleTimeout(state) {
  985. if (state.done) {
  986. return;
  987. }
  988. if (!state.processClosed && state.processExited) {
  989. const message = `The STDIO streams did not close within ${state.delay /
  990. 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
  991. state._debug(message);
  992. }
  993. state._setResult();
  994. }
  995. }
  996. //# sourceMappingURL=toolrunner.js.map
  997. /***/ }),
  998. /***/ 11:
  999. /***/ (function(module) {
  1000. // Returns a wrapper function that returns a wrapped callback
  1001. // The wrapper function should do some stuff, and return a
  1002. // presumably different callback function.
  1003. // This makes sure that own properties are retained, so that
  1004. // decorations and such are not lost along the way.
  1005. module.exports = wrappy
  1006. function wrappy (fn, cb) {
  1007. if (fn && cb) return wrappy(fn)(cb)
  1008. if (typeof fn !== 'function')
  1009. throw new TypeError('need wrapper function')
  1010. Object.keys(fn).forEach(function (k) {
  1011. wrapper[k] = fn[k]
  1012. })
  1013. return wrapper
  1014. function wrapper() {
  1015. var args = new Array(arguments.length)
  1016. for (var i = 0; i < args.length; i++) {
  1017. args[i] = arguments[i]
  1018. }
  1019. var ret = fn.apply(this, args)
  1020. var cb = args[args.length-1]
  1021. if (typeof ret === 'function' && ret !== cb) {
  1022. Object.keys(cb).forEach(function (k) {
  1023. ret[k] = cb[k]
  1024. })
  1025. }
  1026. return ret
  1027. }
  1028. }
  1029. /***/ }),
  1030. /***/ 16:
  1031. /***/ (function(module) {
  1032. module.exports = require("tls");
  1033. /***/ }),
  1034. /***/ 18:
  1035. /***/ (function() {
  1036. eval("require")("encoding");
  1037. /***/ }),
  1038. /***/ 19:
  1039. /***/ (function(module, __unusedexports, __webpack_require__) {
  1040. module.exports = authenticationPlugin;
  1041. const { Deprecation } = __webpack_require__(692);
  1042. const once = __webpack_require__(969);
  1043. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1044. const authenticate = __webpack_require__(674);
  1045. const beforeRequest = __webpack_require__(471);
  1046. const requestError = __webpack_require__(349);
  1047. function authenticationPlugin(octokit, options) {
  1048. if (options.auth) {
  1049. octokit.authenticate = () => {
  1050. deprecateAuthenticate(
  1051. octokit.log,
  1052. new Deprecation(
  1053. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1054. )
  1055. );
  1056. };
  1057. return;
  1058. }
  1059. const state = {
  1060. octokit,
  1061. auth: false
  1062. };
  1063. octokit.authenticate = authenticate.bind(null, state);
  1064. octokit.hook.before("request", beforeRequest.bind(null, state));
  1065. octokit.hook.error("request", requestError.bind(null, state));
  1066. }
  1067. /***/ }),
  1068. /***/ 20:
  1069. /***/ (function(module, __unusedexports, __webpack_require__) {
  1070. "use strict";
  1071. const cp = __webpack_require__(129);
  1072. const parse = __webpack_require__(568);
  1073. const enoent = __webpack_require__(881);
  1074. function spawn(command, args, options) {
  1075. // Parse the arguments
  1076. const parsed = parse(command, args, options);
  1077. // Spawn the child process
  1078. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1079. // Hook into child process "exit" event to emit an error if the command
  1080. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1081. enoent.hookChildProcess(spawned, parsed);
  1082. return spawned;
  1083. }
  1084. function spawnSync(command, args, options) {
  1085. // Parse the arguments
  1086. const parsed = parse(command, args, options);
  1087. // Spawn the child process
  1088. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1089. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1090. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1091. return result;
  1092. }
  1093. module.exports = spawn;
  1094. module.exports.spawn = spawn;
  1095. module.exports.sync = spawnSync;
  1096. module.exports._parse = parse;
  1097. module.exports._enoent = enoent;
  1098. /***/ }),
  1099. /***/ 39:
  1100. /***/ (function(module) {
  1101. "use strict";
  1102. module.exports = opts => {
  1103. opts = opts || {};
  1104. const env = opts.env || process.env;
  1105. const platform = opts.platform || process.platform;
  1106. if (platform !== 'win32') {
  1107. return 'PATH';
  1108. }
  1109. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1110. };
  1111. /***/ }),
  1112. /***/ 47:
  1113. /***/ (function(module, __unusedexports, __webpack_require__) {
  1114. module.exports = factory;
  1115. const Octokit = __webpack_require__(402);
  1116. const registerPlugin = __webpack_require__(855);
  1117. function factory(plugins) {
  1118. const Api = Octokit.bind(null, plugins || []);
  1119. Api.plugin = registerPlugin.bind(null, plugins || []);
  1120. return Api;
  1121. }
  1122. /***/ }),
  1123. /***/ 49:
  1124. /***/ (function(module, __unusedexports, __webpack_require__) {
  1125. "use strict";
  1126. const os = __webpack_require__(87);
  1127. const execa = __webpack_require__(955);
  1128. // Reference: https://www.gaijin.at/en/lstwinver.php
  1129. const names = new Map([
  1130. ['10.0', '10'],
  1131. ['6.3', '8.1'],
  1132. ['6.2', '8'],
  1133. ['6.1', '7'],
  1134. ['6.0', 'Vista'],
  1135. ['5.2', 'Server 2003'],
  1136. ['5.1', 'XP'],
  1137. ['5.0', '2000'],
  1138. ['4.9', 'ME'],
  1139. ['4.1', '98'],
  1140. ['4.0', '95']
  1141. ]);
  1142. const windowsRelease = release => {
  1143. const version = /\d+\.\d/.exec(release || os.release());
  1144. if (release && !version) {
  1145. throw new Error('`release` argument doesn\'t match `n.n`');
  1146. }
  1147. const ver = (version || [])[0];
  1148. // Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
  1149. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1150. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1151. // If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
  1152. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1153. const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1154. const year = (stdout.match(/2008|2012|2016/) || [])[0];
  1155. if (year) {
  1156. return `Server ${year}`;
  1157. }
  1158. }
  1159. return names.get(ver);
  1160. };
  1161. module.exports = windowsRelease;
  1162. /***/ }),
  1163. /***/ 87:
  1164. /***/ (function(module) {
  1165. module.exports = require("os");
  1166. /***/ }),
  1167. /***/ 118:
  1168. /***/ (function(module, __unusedexports, __webpack_require__) {
  1169. "use strict";
  1170. const os = __webpack_require__(87);
  1171. const nameMap = new Map([
  1172. [19, 'Catalina'],
  1173. [18, 'Mojave'],
  1174. [17, 'High Sierra'],
  1175. [16, 'Sierra'],
  1176. [15, 'El Capitan'],
  1177. [14, 'Yosemite'],
  1178. [13, 'Mavericks'],
  1179. [12, 'Mountain Lion'],
  1180. [11, 'Lion'],
  1181. [10, 'Snow Leopard'],
  1182. [9, 'Leopard'],
  1183. [8, 'Tiger'],
  1184. [7, 'Panther'],
  1185. [6, 'Jaguar'],
  1186. [5, 'Puma']
  1187. ]);
  1188. const macosRelease = release => {
  1189. release = Number((release || os.release()).split('.')[0]);
  1190. return {
  1191. name: nameMap.get(release),
  1192. version: '10.' + (release - 4)
  1193. };
  1194. };
  1195. module.exports = macosRelease;
  1196. // TODO: remove this in the next major version
  1197. module.exports.default = macosRelease;
  1198. /***/ }),
  1199. /***/ 126:
  1200. /***/ (function(module) {
  1201. /**
  1202. * lodash (Custom Build) <https://lodash.com/>
  1203. * Build: `lodash modularize exports="npm" -o ./`
  1204. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1205. * Released under MIT license <https://lodash.com/license>
  1206. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1207. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1208. */
  1209. /** Used as the size to enable large array optimizations. */
  1210. var LARGE_ARRAY_SIZE = 200;
  1211. /** Used to stand-in for `undefined` hash values. */
  1212. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1213. /** Used as references for various `Number` constants. */
  1214. var INFINITY = 1 / 0;
  1215. /** `Object#toString` result references. */
  1216. var funcTag = '[object Function]',
  1217. genTag = '[object GeneratorFunction]';
  1218. /**
  1219. * Used to match `RegExp`
  1220. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1221. */
  1222. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1223. /** Used to detect host constructors (Safari). */
  1224. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1225. /** Detect free variable `global` from Node.js. */
  1226. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1227. /** Detect free variable `self`. */
  1228. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1229. /** Used as a reference to the global object. */
  1230. var root = freeGlobal || freeSelf || Function('return this')();
  1231. /**
  1232. * A specialized version of `_.includes` for arrays without support for
  1233. * specifying an index to search from.
  1234. *
  1235. * @private
  1236. * @param {Array} [array] The array to inspect.
  1237. * @param {*} target The value to search for.
  1238. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1239. */
  1240. function arrayIncludes(array, value) {
  1241. var length = array ? array.length : 0;
  1242. return !!length && baseIndexOf(array, value, 0) > -1;
  1243. }
  1244. /**
  1245. * This function is like `arrayIncludes` except that it accepts a comparator.
  1246. *
  1247. * @private
  1248. * @param {Array} [array] The array to inspect.
  1249. * @param {*} target The value to search for.
  1250. * @param {Function} comparator The comparator invoked per element.
  1251. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1252. */
  1253. function arrayIncludesWith(array, value, comparator) {
  1254. var index = -1,
  1255. length = array ? array.length : 0;
  1256. while (++index < length) {
  1257. if (comparator(value, array[index])) {
  1258. return true;
  1259. }
  1260. }
  1261. return false;
  1262. }
  1263. /**
  1264. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1265. * support for iteratee shorthands.
  1266. *
  1267. * @private
  1268. * @param {Array} array The array to inspect.
  1269. * @param {Function} predicate The function invoked per iteration.
  1270. * @param {number} fromIndex The index to search from.
  1271. * @param {boolean} [fromRight] Specify iterating from right to left.
  1272. * @returns {number} Returns the index of the matched value, else `-1`.
  1273. */
  1274. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1275. var length = array.length,
  1276. index = fromIndex + (fromRight ? 1 : -1);
  1277. while ((fromRight ? index-- : ++index < length)) {
  1278. if (predicate(array[index], index, array)) {
  1279. return index;
  1280. }
  1281. }
  1282. return -1;
  1283. }
  1284. /**
  1285. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1286. *
  1287. * @private
  1288. * @param {Array} array The array to inspect.
  1289. * @param {*} value The value to search for.
  1290. * @param {number} fromIndex The index to search from.
  1291. * @returns {number} Returns the index of the matched value, else `-1`.
  1292. */
  1293. function baseIndexOf(array, value, fromIndex) {
  1294. if (value !== value) {
  1295. return baseFindIndex(array, baseIsNaN, fromIndex);
  1296. }
  1297. var index = fromIndex - 1,
  1298. length = array.length;
  1299. while (++index < length) {
  1300. if (array[index] === value) {
  1301. return index;
  1302. }
  1303. }
  1304. return -1;
  1305. }
  1306. /**
  1307. * The base implementation of `_.isNaN` without support for number objects.
  1308. *
  1309. * @private
  1310. * @param {*} value The value to check.
  1311. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1312. */
  1313. function baseIsNaN(value) {
  1314. return value !== value;
  1315. }
  1316. /**
  1317. * Checks if a cache value for `key` exists.
  1318. *
  1319. * @private
  1320. * @param {Object} cache The cache to query.
  1321. * @param {string} key The key of the entry to check.
  1322. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1323. */
  1324. function cacheHas(cache, key) {
  1325. return cache.has(key);
  1326. }
  1327. /**
  1328. * Gets the value at `key` of `object`.
  1329. *
  1330. * @private
  1331. * @param {Object} [object] The object to query.
  1332. * @param {string} key The key of the property to get.
  1333. * @returns {*} Returns the property value.
  1334. */
  1335. function getValue(object, key) {
  1336. return object == null ? undefined : object[key];
  1337. }
  1338. /**
  1339. * Checks if `value` is a host object in IE < 9.
  1340. *
  1341. * @private
  1342. * @param {*} value The value to check.
  1343. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1344. */
  1345. function isHostObject(value) {
  1346. // Many host objects are `Object` objects that can coerce to strings
  1347. // despite having improperly defined `toString` methods.
  1348. var result = false;
  1349. if (value != null && typeof value.toString != 'function') {
  1350. try {
  1351. result = !!(value + '');
  1352. } catch (e) {}
  1353. }
  1354. return result;
  1355. }
  1356. /**
  1357. * Converts `set` to an array of its values.
  1358. *
  1359. * @private
  1360. * @param {Object} set The set to convert.
  1361. * @returns {Array} Returns the values.
  1362. */
  1363. function setToArray(set) {
  1364. var index = -1,
  1365. result = Array(set.size);
  1366. set.forEach(function(value) {
  1367. result[++index] = value;
  1368. });
  1369. return result;
  1370. }
  1371. /** Used for built-in method references. */
  1372. var arrayProto = Array.prototype,
  1373. funcProto = Function.prototype,
  1374. objectProto = Object.prototype;
  1375. /** Used to detect overreaching core-js shims. */
  1376. var coreJsData = root['__core-js_shared__'];
  1377. /** Used to detect methods masquerading as native. */
  1378. var maskSrcKey = (function() {
  1379. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1380. return uid ? ('Symbol(src)_1.' + uid) : '';
  1381. }());
  1382. /** Used to resolve the decompiled source of functions. */
  1383. var funcToString = funcProto.toString;
  1384. /** Used to check objects for own properties. */
  1385. var hasOwnProperty = objectProto.hasOwnProperty;
  1386. /**
  1387. * Used to resolve the
  1388. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1389. * of values.
  1390. */
  1391. var objectToString = objectProto.toString;
  1392. /** Used to detect if a method is native. */
  1393. var reIsNative = RegExp('^' +
  1394. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1395. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1396. );
  1397. /** Built-in value references. */
  1398. var splice = arrayProto.splice;
  1399. /* Built-in method references that are verified to be native. */
  1400. var Map = getNative(root, 'Map'),
  1401. Set = getNative(root, 'Set'),
  1402. nativeCreate = getNative(Object, 'create');
  1403. /**
  1404. * Creates a hash object.
  1405. *
  1406. * @private
  1407. * @constructor
  1408. * @param {Array} [entries] The key-value pairs to cache.
  1409. */
  1410. function Hash(entries) {
  1411. var index = -1,
  1412. length = entries ? entries.length : 0;
  1413. this.clear();
  1414. while (++index < length) {
  1415. var entry = entries[index];
  1416. this.set(entry[0], entry[1]);
  1417. }
  1418. }
  1419. /**
  1420. * Removes all key-value entries from the hash.
  1421. *
  1422. * @private
  1423. * @name clear
  1424. * @memberOf Hash
  1425. */
  1426. function hashClear() {
  1427. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1428. }
  1429. /**
  1430. * Removes `key` and its value from the hash.
  1431. *
  1432. * @private
  1433. * @name delete
  1434. * @memberOf Hash
  1435. * @param {Object} hash The hash to modify.
  1436. * @param {string} key The key of the value to remove.
  1437. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1438. */
  1439. function hashDelete(key) {
  1440. return this.has(key) && delete this.__data__[key];
  1441. }
  1442. /**
  1443. * Gets the hash value for `key`.
  1444. *
  1445. * @private
  1446. * @name get
  1447. * @memberOf Hash
  1448. * @param {string} key The key of the value to get.
  1449. * @returns {*} Returns the entry value.
  1450. */
  1451. function hashGet(key) {
  1452. var data = this.__data__;
  1453. if (nativeCreate) {
  1454. var result = data[key];
  1455. return result === HASH_UNDEFINED ? undefined : result;
  1456. }
  1457. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1458. }
  1459. /**
  1460. * Checks if a hash value for `key` exists.
  1461. *
  1462. * @private
  1463. * @name has
  1464. * @memberOf Hash
  1465. * @param {string} key The key of the entry to check.
  1466. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1467. */
  1468. function hashHas(key) {
  1469. var data = this.__data__;
  1470. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1471. }
  1472. /**
  1473. * Sets the hash `key` to `value`.
  1474. *
  1475. * @private
  1476. * @name set
  1477. * @memberOf Hash
  1478. * @param {string} key The key of the value to set.
  1479. * @param {*} value The value to set.
  1480. * @returns {Object} Returns the hash instance.
  1481. */
  1482. function hashSet(key, value) {
  1483. var data = this.__data__;
  1484. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1485. return this;
  1486. }
  1487. // Add methods to `Hash`.
  1488. Hash.prototype.clear = hashClear;
  1489. Hash.prototype['delete'] = hashDelete;
  1490. Hash.prototype.get = hashGet;
  1491. Hash.prototype.has = hashHas;
  1492. Hash.prototype.set = hashSet;
  1493. /**
  1494. * Creates an list cache object.
  1495. *
  1496. * @private
  1497. * @constructor
  1498. * @param {Array} [entries] The key-value pairs to cache.
  1499. */
  1500. function ListCache(entries) {
  1501. var index = -1,
  1502. length = entries ? entries.length : 0;
  1503. this.clear();
  1504. while (++index < length) {
  1505. var entry = entries[index];
  1506. this.set(entry[0], entry[1]);
  1507. }
  1508. }
  1509. /**
  1510. * Removes all key-value entries from the list cache.
  1511. *
  1512. * @private
  1513. * @name clear
  1514. * @memberOf ListCache
  1515. */
  1516. function listCacheClear() {
  1517. this.__data__ = [];
  1518. }
  1519. /**
  1520. * Removes `key` and its value from the list cache.
  1521. *
  1522. * @private
  1523. * @name delete
  1524. * @memberOf ListCache
  1525. * @param {string} key The key of the value to remove.
  1526. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1527. */
  1528. function listCacheDelete(key) {
  1529. var data = this.__data__,
  1530. index = assocIndexOf(data, key);
  1531. if (index < 0) {
  1532. return false;
  1533. }
  1534. var lastIndex = data.length - 1;
  1535. if (index == lastIndex) {
  1536. data.pop();
  1537. } else {
  1538. splice.call(data, index, 1);
  1539. }
  1540. return true;
  1541. }
  1542. /**
  1543. * Gets the list cache value for `key`.
  1544. *
  1545. * @private
  1546. * @name get
  1547. * @memberOf ListCache
  1548. * @param {string} key The key of the value to get.
  1549. * @returns {*} Returns the entry value.
  1550. */
  1551. function listCacheGet(key) {
  1552. var data = this.__data__,
  1553. index = assocIndexOf(data, key);
  1554. return index < 0 ? undefined : data[index][1];
  1555. }
  1556. /**
  1557. * Checks if a list cache value for `key` exists.
  1558. *
  1559. * @private
  1560. * @name has
  1561. * @memberOf ListCache
  1562. * @param {string} key The key of the entry to check.
  1563. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1564. */
  1565. function listCacheHas(key) {
  1566. return assocIndexOf(this.__data__, key) > -1;
  1567. }
  1568. /**
  1569. * Sets the list cache `key` to `value`.
  1570. *
  1571. * @private
  1572. * @name set
  1573. * @memberOf ListCache
  1574. * @param {string} key The key of the value to set.
  1575. * @param {*} value The value to set.
  1576. * @returns {Object} Returns the list cache instance.
  1577. */
  1578. function listCacheSet(key, value) {
  1579. var data = this.__data__,
  1580. index = assocIndexOf(data, key);
  1581. if (index < 0) {
  1582. data.push([key, value]);
  1583. } else {
  1584. data[index][1] = value;
  1585. }
  1586. return this;
  1587. }
  1588. // Add methods to `ListCache`.
  1589. ListCache.prototype.clear = listCacheClear;
  1590. ListCache.prototype['delete'] = listCacheDelete;
  1591. ListCache.prototype.get = listCacheGet;
  1592. ListCache.prototype.has = listCacheHas;
  1593. ListCache.prototype.set = listCacheSet;
  1594. /**
  1595. * Creates a map cache object to store key-value pairs.
  1596. *
  1597. * @private
  1598. * @constructor
  1599. * @param {Array} [entries] The key-value pairs to cache.
  1600. */
  1601. function MapCache(entries) {
  1602. var index = -1,
  1603. length = entries ? entries.length : 0;
  1604. this.clear();
  1605. while (++index < length) {
  1606. var entry = entries[index];
  1607. this.set(entry[0], entry[1]);
  1608. }
  1609. }
  1610. /**
  1611. * Removes all key-value entries from the map.
  1612. *
  1613. * @private
  1614. * @name clear
  1615. * @memberOf MapCache
  1616. */
  1617. function mapCacheClear() {
  1618. this.__data__ = {
  1619. 'hash': new Hash,
  1620. 'map': new (Map || ListCache),
  1621. 'string': new Hash
  1622. };
  1623. }
  1624. /**
  1625. * Removes `key` and its value from the map.
  1626. *
  1627. * @private
  1628. * @name delete
  1629. * @memberOf MapCache
  1630. * @param {string} key The key of the value to remove.
  1631. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1632. */
  1633. function mapCacheDelete(key) {
  1634. return getMapData(this, key)['delete'](key);
  1635. }
  1636. /**
  1637. * Gets the map value for `key`.
  1638. *
  1639. * @private
  1640. * @name get
  1641. * @memberOf MapCache
  1642. * @param {string} key The key of the value to get.
  1643. * @returns {*} Returns the entry value.
  1644. */
  1645. function mapCacheGet(key) {
  1646. return getMapData(this, key).get(key);
  1647. }
  1648. /**
  1649. * Checks if a map value for `key` exists.
  1650. *
  1651. * @private
  1652. * @name has
  1653. * @memberOf MapCache
  1654. * @param {string} key The key of the entry to check.
  1655. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1656. */
  1657. function mapCacheHas(key) {
  1658. return getMapData(this, key).has(key);
  1659. }
  1660. /**
  1661. * Sets the map `key` to `value`.
  1662. *
  1663. * @private
  1664. * @name set
  1665. * @memberOf MapCache
  1666. * @param {string} key The key of the value to set.
  1667. * @param {*} value The value to set.
  1668. * @returns {Object} Returns the map cache instance.
  1669. */
  1670. function mapCacheSet(key, value) {
  1671. getMapData(this, key).set(key, value);
  1672. return this;
  1673. }
  1674. // Add methods to `MapCache`.
  1675. MapCache.prototype.clear = mapCacheClear;
  1676. MapCache.prototype['delete'] = mapCacheDelete;
  1677. MapCache.prototype.get = mapCacheGet;
  1678. MapCache.prototype.has = mapCacheHas;
  1679. MapCache.prototype.set = mapCacheSet;
  1680. /**
  1681. *
  1682. * Creates an array cache object to store unique values.
  1683. *
  1684. * @private
  1685. * @constructor
  1686. * @param {Array} [values] The values to cache.
  1687. */
  1688. function SetCache(values) {
  1689. var index = -1,
  1690. length = values ? values.length : 0;
  1691. this.__data__ = new MapCache;
  1692. while (++index < length) {
  1693. this.add(values[index]);
  1694. }
  1695. }
  1696. /**
  1697. * Adds `value` to the array cache.
  1698. *
  1699. * @private
  1700. * @name add
  1701. * @memberOf SetCache
  1702. * @alias push
  1703. * @param {*} value The value to cache.
  1704. * @returns {Object} Returns the cache instance.
  1705. */
  1706. function setCacheAdd(value) {
  1707. this.__data__.set(value, HASH_UNDEFINED);
  1708. return this;
  1709. }
  1710. /**
  1711. * Checks if `value` is in the array cache.
  1712. *
  1713. * @private
  1714. * @name has
  1715. * @memberOf SetCache
  1716. * @param {*} value The value to search for.
  1717. * @returns {number} Returns `true` if `value` is found, else `false`.
  1718. */
  1719. function setCacheHas(value) {
  1720. return this.__data__.has(value);
  1721. }
  1722. // Add methods to `SetCache`.
  1723. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1724. SetCache.prototype.has = setCacheHas;
  1725. /**
  1726. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1727. *
  1728. * @private
  1729. * @param {Array} array The array to inspect.
  1730. * @param {*} key The key to search for.
  1731. * @returns {number} Returns the index of the matched value, else `-1`.
  1732. */
  1733. function assocIndexOf(array, key) {
  1734. var length = array.length;
  1735. while (length--) {
  1736. if (eq(array[length][0], key)) {
  1737. return length;
  1738. }
  1739. }
  1740. return -1;
  1741. }
  1742. /**
  1743. * The base implementation of `_.isNative` without bad shim checks.
  1744. *
  1745. * @private
  1746. * @param {*} value The value to check.
  1747. * @returns {boolean} Returns `true` if `value` is a native function,
  1748. * else `false`.
  1749. */
  1750. function baseIsNative(value) {
  1751. if (!isObject(value) || isMasked(value)) {
  1752. return false;
  1753. }
  1754. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1755. return pattern.test(toSource(value));
  1756. }
  1757. /**
  1758. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1759. *
  1760. * @private
  1761. * @param {Array} array The array to inspect.
  1762. * @param {Function} [iteratee] The iteratee invoked per element.
  1763. * @param {Function} [comparator] The comparator invoked per element.
  1764. * @returns {Array} Returns the new duplicate free array.
  1765. */
  1766. function baseUniq(array, iteratee, comparator) {
  1767. var index = -1,
  1768. includes = arrayIncludes,
  1769. length = array.length,
  1770. isCommon = true,
  1771. result = [],
  1772. seen = result;
  1773. if (comparator) {
  1774. isCommon = false;
  1775. includes = arrayIncludesWith;
  1776. }
  1777. else if (length >= LARGE_ARRAY_SIZE) {
  1778. var set = iteratee ? null : createSet(array);
  1779. if (set) {
  1780. return setToArray(set);
  1781. }
  1782. isCommon = false;
  1783. includes = cacheHas;
  1784. seen = new SetCache;
  1785. }
  1786. else {
  1787. seen = iteratee ? [] : result;
  1788. }
  1789. outer:
  1790. while (++index < length) {
  1791. var value = array[index],
  1792. computed = iteratee ? iteratee(value) : value;
  1793. value = (comparator || value !== 0) ? value : 0;
  1794. if (isCommon && computed === computed) {
  1795. var seenIndex = seen.length;
  1796. while (seenIndex--) {
  1797. if (seen[seenIndex] === computed) {
  1798. continue outer;
  1799. }
  1800. }
  1801. if (iteratee) {
  1802. seen.push(computed);
  1803. }
  1804. result.push(value);
  1805. }
  1806. else if (!includes(seen, computed, comparator)) {
  1807. if (seen !== result) {
  1808. seen.push(computed);
  1809. }
  1810. result.push(value);
  1811. }
  1812. }
  1813. return result;
  1814. }
  1815. /**
  1816. * Creates a set object of `values`.
  1817. *
  1818. * @private
  1819. * @param {Array} values The values to add to the set.
  1820. * @returns {Object} Returns the new set.
  1821. */
  1822. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1823. return new Set(values);
  1824. };
  1825. /**
  1826. * Gets the data for `map`.
  1827. *
  1828. * @private
  1829. * @param {Object} map The map to query.
  1830. * @param {string} key The reference key.
  1831. * @returns {*} Returns the map data.
  1832. */
  1833. function getMapData(map, key) {
  1834. var data = map.__data__;
  1835. return isKeyable(key)
  1836. ? data[typeof key == 'string' ? 'string' : 'hash']
  1837. : data.map;
  1838. }
  1839. /**
  1840. * Gets the native function at `key` of `object`.
  1841. *
  1842. * @private
  1843. * @param {Object} object The object to query.
  1844. * @param {string} key The key of the method to get.
  1845. * @returns {*} Returns the function if it's native, else `undefined`.
  1846. */
  1847. function getNative(object, key) {
  1848. var value = getValue(object, key);
  1849. return baseIsNative(value) ? value : undefined;
  1850. }
  1851. /**
  1852. * Checks if `value` is suitable for use as unique object key.
  1853. *
  1854. * @private
  1855. * @param {*} value The value to check.
  1856. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1857. */
  1858. function isKeyable(value) {
  1859. var type = typeof value;
  1860. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1861. ? (value !== '__proto__')
  1862. : (value === null);
  1863. }
  1864. /**
  1865. * Checks if `func` has its source masked.
  1866. *
  1867. * @private
  1868. * @param {Function} func The function to check.
  1869. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1870. */
  1871. function isMasked(func) {
  1872. return !!maskSrcKey && (maskSrcKey in func);
  1873. }
  1874. /**
  1875. * Converts `func` to its source code.
  1876. *
  1877. * @private
  1878. * @param {Function} func The function to process.
  1879. * @returns {string} Returns the source code.
  1880. */
  1881. function toSource(func) {
  1882. if (func != null) {
  1883. try {
  1884. return funcToString.call(func);
  1885. } catch (e) {}
  1886. try {
  1887. return (func + '');
  1888. } catch (e) {}
  1889. }
  1890. return '';
  1891. }
  1892. /**
  1893. * Creates a duplicate-free version of an array, using
  1894. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1895. * for equality comparisons, in which only the first occurrence of each
  1896. * element is kept.
  1897. *
  1898. * @static
  1899. * @memberOf _
  1900. * @since 0.1.0
  1901. * @category Array
  1902. * @param {Array} array The array to inspect.
  1903. * @returns {Array} Returns the new duplicate free array.
  1904. * @example
  1905. *
  1906. * _.uniq([2, 1, 2]);
  1907. * // => [2, 1]
  1908. */
  1909. function uniq(array) {
  1910. return (array && array.length)
  1911. ? baseUniq(array)
  1912. : [];
  1913. }
  1914. /**
  1915. * Performs a
  1916. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1917. * comparison between two values to determine if they are equivalent.
  1918. *
  1919. * @static
  1920. * @memberOf _
  1921. * @since 4.0.0
  1922. * @category Lang
  1923. * @param {*} value The value to compare.
  1924. * @param {*} other The other value to compare.
  1925. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1926. * @example
  1927. *
  1928. * var object = { 'a': 1 };
  1929. * var other = { 'a': 1 };
  1930. *
  1931. * _.eq(object, object);
  1932. * // => true
  1933. *
  1934. * _.eq(object, other);
  1935. * // => false
  1936. *
  1937. * _.eq('a', 'a');
  1938. * // => true
  1939. *
  1940. * _.eq('a', Object('a'));
  1941. * // => false
  1942. *
  1943. * _.eq(NaN, NaN);
  1944. * // => true
  1945. */
  1946. function eq(value, other) {
  1947. return value === other || (value !== value && other !== other);
  1948. }
  1949. /**
  1950. * Checks if `value` is classified as a `Function` object.
  1951. *
  1952. * @static
  1953. * @memberOf _
  1954. * @since 0.1.0
  1955. * @category Lang
  1956. * @param {*} value The value to check.
  1957. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1958. * @example
  1959. *
  1960. * _.isFunction(_);
  1961. * // => true
  1962. *
  1963. * _.isFunction(/abc/);
  1964. * // => false
  1965. */
  1966. function isFunction(value) {
  1967. // The use of `Object#toString` avoids issues with the `typeof` operator
  1968. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  1969. var tag = isObject(value) ? objectToString.call(value) : '';
  1970. return tag == funcTag || tag == genTag;
  1971. }
  1972. /**
  1973. * Checks if `value` is the
  1974. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1975. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1976. *
  1977. * @static
  1978. * @memberOf _
  1979. * @since 0.1.0
  1980. * @category Lang
  1981. * @param {*} value The value to check.
  1982. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1983. * @example
  1984. *
  1985. * _.isObject({});
  1986. * // => true
  1987. *
  1988. * _.isObject([1, 2, 3]);
  1989. * // => true
  1990. *
  1991. * _.isObject(_.noop);
  1992. * // => true
  1993. *
  1994. * _.isObject(null);
  1995. * // => false
  1996. */
  1997. function isObject(value) {
  1998. var type = typeof value;
  1999. return !!value && (type == 'object' || type == 'function');
  2000. }
  2001. /**
  2002. * This method returns `undefined`.
  2003. *
  2004. * @static
  2005. * @memberOf _
  2006. * @since 2.3.0
  2007. * @category Util
  2008. * @example
  2009. *
  2010. * _.times(2, _.noop);
  2011. * // => [undefined, undefined]
  2012. */
  2013. function noop() {
  2014. // No operation performed.
  2015. }
  2016. module.exports = uniq;
  2017. /***/ }),
  2018. /***/ 129:
  2019. /***/ (function(module) {
  2020. module.exports = require("child_process");
  2021. /***/ }),
  2022. /***/ 139:
  2023. /***/ (function(module, __unusedexports, __webpack_require__) {
  2024. // Unique ID creation requires a high quality random # generator. In node.js
  2025. // this is pretty straight-forward - we use the crypto API.
  2026. var crypto = __webpack_require__(417);
  2027. module.exports = function nodeRNG() {
  2028. return crypto.randomBytes(16);
  2029. };
  2030. /***/ }),
  2031. /***/ 141:
  2032. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2033. "use strict";
  2034. var net = __webpack_require__(631);
  2035. var tls = __webpack_require__(16);
  2036. var http = __webpack_require__(605);
  2037. var https = __webpack_require__(211);
  2038. var events = __webpack_require__(614);
  2039. var assert = __webpack_require__(357);
  2040. var util = __webpack_require__(669);
  2041. exports.httpOverHttp = httpOverHttp;
  2042. exports.httpsOverHttp = httpsOverHttp;
  2043. exports.httpOverHttps = httpOverHttps;
  2044. exports.httpsOverHttps = httpsOverHttps;
  2045. function httpOverHttp(options) {
  2046. var agent = new TunnelingAgent(options);
  2047. agent.request = http.request;
  2048. return agent;
  2049. }
  2050. function httpsOverHttp(options) {
  2051. var agent = new TunnelingAgent(options);
  2052. agent.request = http.request;
  2053. agent.createSocket = createSecureSocket;
  2054. return agent;
  2055. }
  2056. function httpOverHttps(options) {
  2057. var agent = new TunnelingAgent(options);
  2058. agent.request = https.request;
  2059. return agent;
  2060. }
  2061. function httpsOverHttps(options) {
  2062. var agent = new TunnelingAgent(options);
  2063. agent.request = https.request;
  2064. agent.createSocket = createSecureSocket;
  2065. return agent;
  2066. }
  2067. function TunnelingAgent(options) {
  2068. var self = this;
  2069. self.options = options || {};
  2070. self.proxyOptions = self.options.proxy || {};
  2071. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2072. self.requests = [];
  2073. self.sockets = [];
  2074. self.on('free', function onFree(socket, host, port, localAddress) {
  2075. var options = toOptions(host, port, localAddress);
  2076. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2077. var pending = self.requests[i];
  2078. if (pending.host === options.host && pending.port === options.port) {
  2079. // Detect the request to connect same origin server,
  2080. // reuse the connection.
  2081. self.requests.splice(i, 1);
  2082. pending.request.onSocket(socket);
  2083. return;
  2084. }
  2085. }
  2086. socket.destroy();
  2087. self.removeSocket(socket);
  2088. });
  2089. }
  2090. util.inherits(TunnelingAgent, events.EventEmitter);
  2091. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2092. var self = this;
  2093. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2094. if (self.sockets.length >= this.maxSockets) {
  2095. // We are over limit so we'll add it to the queue.
  2096. self.requests.push(options);
  2097. return;
  2098. }
  2099. // If we are under maxSockets create a new one.
  2100. self.createSocket(options, function(socket) {
  2101. socket.on('free', onFree);
  2102. socket.on('close', onCloseOrRemove);
  2103. socket.on('agentRemove', onCloseOrRemove);
  2104. req.onSocket(socket);
  2105. function onFree() {
  2106. self.emit('free', socket, options);
  2107. }
  2108. function onCloseOrRemove(err) {
  2109. self.removeSocket(socket);
  2110. socket.removeListener('free', onFree);
  2111. socket.removeListener('close', onCloseOrRemove);
  2112. socket.removeListener('agentRemove', onCloseOrRemove);
  2113. }
  2114. });
  2115. };
  2116. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2117. var self = this;
  2118. var placeholder = {};
  2119. self.sockets.push(placeholder);
  2120. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2121. method: 'CONNECT',
  2122. path: options.host + ':' + options.port,
  2123. agent: false
  2124. });
  2125. if (connectOptions.proxyAuth) {
  2126. connectOptions.headers = connectOptions.headers || {};
  2127. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2128. new Buffer(connectOptions.proxyAuth).toString('base64');
  2129. }
  2130. debug('making CONNECT request');
  2131. var connectReq = self.request(connectOptions);
  2132. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2133. connectReq.once('response', onResponse); // for v0.6
  2134. connectReq.once('upgrade', onUpgrade); // for v0.6
  2135. connectReq.once('connect', onConnect); // for v0.7 or later
  2136. connectReq.once('error', onError);
  2137. connectReq.end();
  2138. function onResponse(res) {
  2139. // Very hacky. This is necessary to avoid http-parser leaks.
  2140. res.upgrade = true;
  2141. }
  2142. function onUpgrade(res, socket, head) {
  2143. // Hacky.
  2144. process.nextTick(function() {
  2145. onConnect(res, socket, head);
  2146. });
  2147. }
  2148. function onConnect(res, socket, head) {
  2149. connectReq.removeAllListeners();
  2150. socket.removeAllListeners();
  2151. if (res.statusCode === 200) {
  2152. assert.equal(head.length, 0);
  2153. debug('tunneling connection has established');
  2154. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2155. cb(socket);
  2156. } else {
  2157. debug('tunneling socket could not be established, statusCode=%d',
  2158. res.statusCode);
  2159. var error = new Error('tunneling socket could not be established, ' +
  2160. 'statusCode=' + res.statusCode);
  2161. error.code = 'ECONNRESET';
  2162. options.request.emit('error', error);
  2163. self.removeSocket(placeholder);
  2164. }
  2165. }
  2166. function onError(cause) {
  2167. connectReq.removeAllListeners();
  2168. debug('tunneling socket could not be established, cause=%s\n',
  2169. cause.message, cause.stack);
  2170. var error = new Error('tunneling socket could not be established, ' +
  2171. 'cause=' + cause.message);
  2172. error.code = 'ECONNRESET';
  2173. options.request.emit('error', error);
  2174. self.removeSocket(placeholder);
  2175. }
  2176. };
  2177. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2178. var pos = this.sockets.indexOf(socket)
  2179. if (pos === -1) {
  2180. return;
  2181. }
  2182. this.sockets.splice(pos, 1);
  2183. var pending = this.requests.shift();
  2184. if (pending) {
  2185. // If we have pending requests and a socket gets closed a new one
  2186. // needs to be created to take over in the pool for the one that closed.
  2187. this.createSocket(pending, function(socket) {
  2188. pending.request.onSocket(socket);
  2189. });
  2190. }
  2191. };
  2192. function createSecureSocket(options, cb) {
  2193. var self = this;
  2194. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2195. var hostHeader = options.request.getHeader('host');
  2196. var tlsOptions = mergeOptions({}, self.options, {
  2197. socket: socket,
  2198. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2199. });
  2200. // 0 is dummy port for v0.6
  2201. var secureSocket = tls.connect(0, tlsOptions);
  2202. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2203. cb(secureSocket);
  2204. });
  2205. }
  2206. function toOptions(host, port, localAddress) {
  2207. if (typeof host === 'string') { // since v0.10
  2208. return {
  2209. host: host,
  2210. port: port,
  2211. localAddress: localAddress
  2212. };
  2213. }
  2214. return host; // for v0.11 or later
  2215. }
  2216. function mergeOptions(target) {
  2217. for (var i = 1, len = arguments.length; i < len; ++i) {
  2218. var overrides = arguments[i];
  2219. if (typeof overrides === 'object') {
  2220. var keys = Object.keys(overrides);
  2221. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2222. var k = keys[j];
  2223. if (overrides[k] !== undefined) {
  2224. target[k] = overrides[k];
  2225. }
  2226. }
  2227. }
  2228. }
  2229. return target;
  2230. }
  2231. var debug;
  2232. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2233. debug = function() {
  2234. var args = Array.prototype.slice.call(arguments);
  2235. if (typeof args[0] === 'string') {
  2236. args[0] = 'TUNNEL: ' + args[0];
  2237. } else {
  2238. args.unshift('TUNNEL:');
  2239. }
  2240. console.error.apply(console, args);
  2241. }
  2242. } else {
  2243. debug = function() {};
  2244. }
  2245. exports.debug = debug; // for test
  2246. /***/ }),
  2247. /***/ 143:
  2248. /***/ (function(module, __unusedexports, __webpack_require__) {
  2249. module.exports = withAuthorizationPrefix;
  2250. const atob = __webpack_require__(368);
  2251. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2252. function withAuthorizationPrefix(authorization) {
  2253. if (/^(basic|bearer|token) /i.test(authorization)) {
  2254. return authorization;
  2255. }
  2256. try {
  2257. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2258. return `basic ${authorization}`;
  2259. }
  2260. } catch (error) {}
  2261. if (authorization.split(/\./).length === 3) {
  2262. return `bearer ${authorization}`;
  2263. }
  2264. return `token ${authorization}`;
  2265. }
  2266. /***/ }),
  2267. /***/ 145:
  2268. /***/ (function(module, __unusedexports, __webpack_require__) {
  2269. "use strict";
  2270. const pump = __webpack_require__(453);
  2271. const bufferStream = __webpack_require__(966);
  2272. class MaxBufferError extends Error {
  2273. constructor() {
  2274. super('maxBuffer exceeded');
  2275. this.name = 'MaxBufferError';
  2276. }
  2277. }
  2278. function getStream(inputStream, options) {
  2279. if (!inputStream) {
  2280. return Promise.reject(new Error('Expected a stream'));
  2281. }
  2282. options = Object.assign({maxBuffer: Infinity}, options);
  2283. const {maxBuffer} = options;
  2284. let stream;
  2285. return new Promise((resolve, reject) => {
  2286. const rejectPromise = error => {
  2287. if (error) { // A null check
  2288. error.bufferedData = stream.getBufferedValue();
  2289. }
  2290. reject(error);
  2291. };
  2292. stream = pump(inputStream, bufferStream(options), error => {
  2293. if (error) {
  2294. rejectPromise(error);
  2295. return;
  2296. }
  2297. resolve();
  2298. });
  2299. stream.on('data', () => {
  2300. if (stream.getBufferedLength() > maxBuffer) {
  2301. rejectPromise(new MaxBufferError());
  2302. }
  2303. });
  2304. }).then(() => stream.getBufferedValue());
  2305. }
  2306. module.exports = getStream;
  2307. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2308. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2309. module.exports.MaxBufferError = MaxBufferError;
  2310. /***/ }),
  2311. /***/ 148:
  2312. /***/ (function(module, __unusedexports, __webpack_require__) {
  2313. module.exports = paginatePlugin;
  2314. const iterator = __webpack_require__(8);
  2315. const paginate = __webpack_require__(807);
  2316. function paginatePlugin(octokit) {
  2317. octokit.paginate = paginate.bind(null, octokit);
  2318. octokit.paginate.iterator = iterator.bind(null, octokit);
  2319. }
  2320. /***/ }),
  2321. /***/ 153:
  2322. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2323. "use strict";
  2324. var __importStar = (this && this.__importStar) || function (mod) {
  2325. if (mod && mod.__esModule) return mod;
  2326. var result = {};
  2327. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2328. result["default"] = mod;
  2329. return result;
  2330. };
  2331. Object.defineProperty(exports, "__esModule", { value: true });
  2332. const coreCommand = __importStar(__webpack_require__(431));
  2333. /**
  2334. * Indicates whether the POST action is running
  2335. */
  2336. exports.IsPost = !!process.env['STATE_isPost'];
  2337. /**
  2338. * The repository path for the POST action. The value is empty during the MAIN action.
  2339. */
  2340. exports.RepositoryPath = process.env['STATE_repositoryPath'];
  2341. /**
  2342. * Save the repository path so the POST action can retrieve the value.
  2343. */
  2344. function setRepositoryPath(repositoryPath) {
  2345. coreCommand.issueCommand('save-state', { name: 'repositoryPath' }, repositoryPath);
  2346. }
  2347. exports.setRepositoryPath = setRepositoryPath;
  2348. // Publish a variable so that when the POST action runs, it can determine it should run the cleanup logic.
  2349. // This is necessary since we don't have a separate entry point.
  2350. if (!exports.IsPost) {
  2351. coreCommand.issueCommand('save-state', { name: 'isPost' }, 'true');
  2352. }
  2353. /***/ }),
  2354. /***/ 168:
  2355. /***/ (function(module) {
  2356. "use strict";
  2357. const alias = ['stdin', 'stdout', 'stderr'];
  2358. const hasAlias = opts => alias.some(x => Boolean(opts[x]));
  2359. module.exports = opts => {
  2360. if (!opts) {
  2361. return null;
  2362. }
  2363. if (opts.stdio && hasAlias(opts)) {
  2364. throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${alias.map(x => `\`${x}\``).join(', ')}`);
  2365. }
  2366. if (typeof opts.stdio === 'string') {
  2367. return opts.stdio;
  2368. }
  2369. const stdio = opts.stdio || [];
  2370. if (!Array.isArray(stdio)) {
  2371. throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof stdio}\``);
  2372. }
  2373. const result = [];
  2374. const len = Math.max(stdio.length, alias.length);
  2375. for (let i = 0; i < len; i++) {
  2376. let value = null;
  2377. if (stdio[i] !== undefined) {
  2378. value = stdio[i];
  2379. } else if (opts[alias[i]] !== undefined) {
  2380. value = opts[alias[i]];
  2381. }
  2382. result[i] = value;
  2383. }
  2384. return result;
  2385. };
  2386. /***/ }),
  2387. /***/ 190:
  2388. /***/ (function(module, __unusedexports, __webpack_require__) {
  2389. module.exports = authenticationPlugin;
  2390. const beforeRequest = __webpack_require__(863);
  2391. const requestError = __webpack_require__(991);
  2392. const validate = __webpack_require__(954);
  2393. function authenticationPlugin(octokit, options) {
  2394. if (!options.auth) {
  2395. return;
  2396. }
  2397. validate(options.auth);
  2398. const state = {
  2399. octokit,
  2400. auth: options.auth
  2401. };
  2402. octokit.hook.before("request", beforeRequest.bind(null, state));
  2403. octokit.hook.error("request", requestError.bind(null, state));
  2404. }
  2405. /***/ }),
  2406. /***/ 197:
  2407. /***/ (function(module, __unusedexports, __webpack_require__) {
  2408. module.exports = isexe
  2409. isexe.sync = sync
  2410. var fs = __webpack_require__(747)
  2411. function isexe (path, options, cb) {
  2412. fs.stat(path, function (er, stat) {
  2413. cb(er, er ? false : checkStat(stat, options))
  2414. })
  2415. }
  2416. function sync (path, options) {
  2417. return checkStat(fs.statSync(path), options)
  2418. }
  2419. function checkStat (stat, options) {
  2420. return stat.isFile() && checkMode(stat, options)
  2421. }
  2422. function checkMode (stat, options) {
  2423. var mod = stat.mode
  2424. var uid = stat.uid
  2425. var gid = stat.gid
  2426. var myUid = options.uid !== undefined ?
  2427. options.uid : process.getuid && process.getuid()
  2428. var myGid = options.gid !== undefined ?
  2429. options.gid : process.getgid && process.getgid()
  2430. var u = parseInt('100', 8)
  2431. var g = parseInt('010', 8)
  2432. var o = parseInt('001', 8)
  2433. var ug = u | g
  2434. var ret = (mod & o) ||
  2435. (mod & g) && gid === myGid ||
  2436. (mod & u) && uid === myUid ||
  2437. (mod & ug) && myUid === 0
  2438. return ret
  2439. }
  2440. /***/ }),
  2441. /***/ 198:
  2442. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2443. "use strict";
  2444. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2445. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2446. return new (P || (P = Promise))(function (resolve, reject) {
  2447. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2448. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2449. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2450. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2451. });
  2452. };
  2453. var __importStar = (this && this.__importStar) || function (mod) {
  2454. if (mod && mod.__esModule) return mod;
  2455. var result = {};
  2456. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2457. result["default"] = mod;
  2458. return result;
  2459. };
  2460. Object.defineProperty(exports, "__esModule", { value: true });
  2461. const core = __importStar(__webpack_require__(470));
  2462. const coreCommand = __importStar(__webpack_require__(431));
  2463. const gitSourceProvider = __importStar(__webpack_require__(293));
  2464. const inputHelper = __importStar(__webpack_require__(821));
  2465. const path = __importStar(__webpack_require__(622));
  2466. const stateHelper = __importStar(__webpack_require__(153));
  2467. function run() {
  2468. return __awaiter(this, void 0, void 0, function* () {
  2469. try {
  2470. const sourceSettings = inputHelper.getInputs();
  2471. try {
  2472. // Register problem matcher
  2473. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2474. // Get sources
  2475. yield gitSourceProvider.getSource(sourceSettings);
  2476. }
  2477. finally {
  2478. // Unregister problem matcher
  2479. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2480. }
  2481. }
  2482. catch (error) {
  2483. core.setFailed(error.message);
  2484. }
  2485. });
  2486. }
  2487. function cleanup() {
  2488. return __awaiter(this, void 0, void 0, function* () {
  2489. try {
  2490. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2491. }
  2492. catch (error) {
  2493. core.warning(error.message);
  2494. }
  2495. });
  2496. }
  2497. // Main
  2498. if (!stateHelper.IsPost) {
  2499. run();
  2500. }
  2501. // Post
  2502. else {
  2503. cleanup();
  2504. }
  2505. /***/ }),
  2506. /***/ 211:
  2507. /***/ (function(module) {
  2508. module.exports = require("https");
  2509. /***/ }),
  2510. /***/ 215:
  2511. /***/ (function(module) {
  2512. module.exports = {"name":"@octokit/rest","version":"16.35.0","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/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/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^12.0.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.0.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^2.1.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":"^3.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^14.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^15.0.0","sinon":"^7.2.4","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.35.0.tgz","_integrity":"sha512-9ShFqYWo0CLoGYhA1FdtdykJuMzS/9H6vSbbQWDX4pWr4p9v+15MsH/wpd/3fIU+tSxylaNO48+PIHqOkBRx3w==","_from":"@octokit/rest@16.35.0"};
  2513. /***/ }),
  2514. /***/ 227:
  2515. /***/ (function(__unusedmodule, exports) {
  2516. "use strict";
  2517. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2518. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2519. return new (P || (P = Promise))(function (resolve, reject) {
  2520. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2521. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2522. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2523. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2524. });
  2525. };
  2526. Object.defineProperty(exports, "__esModule", { value: true });
  2527. function getCheckoutInfo(git, ref, commit) {
  2528. return __awaiter(this, void 0, void 0, function* () {
  2529. if (!git) {
  2530. throw new Error('Arg git cannot be empty');
  2531. }
  2532. if (!ref && !commit) {
  2533. throw new Error('Args ref and commit cannot both be empty');
  2534. }
  2535. const result = {};
  2536. const upperRef = (ref || '').toUpperCase();
  2537. // SHA only
  2538. if (!ref) {
  2539. result.ref = commit;
  2540. }
  2541. // refs/heads/
  2542. else if (upperRef.startsWith('REFS/HEADS/')) {
  2543. const branch = ref.substring('refs/heads/'.length);
  2544. result.ref = branch;
  2545. result.startPoint = `refs/remotes/origin/${branch}`;
  2546. }
  2547. // refs/pull/
  2548. else if (upperRef.startsWith('REFS/PULL/')) {
  2549. const branch = ref.substring('refs/pull/'.length);
  2550. result.ref = `refs/remotes/pull/${branch}`;
  2551. }
  2552. // refs/tags/
  2553. else if (upperRef.startsWith('REFS/')) {
  2554. result.ref = ref;
  2555. }
  2556. // Unqualified ref, check for a matching branch or tag
  2557. else {
  2558. if (yield git.branchExists(true, `origin/${ref}`)) {
  2559. result.ref = ref;
  2560. result.startPoint = `refs/remotes/origin/${ref}`;
  2561. }
  2562. else if (yield git.tagExists(`${ref}`)) {
  2563. result.ref = `refs/tags/${ref}`;
  2564. }
  2565. else {
  2566. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2567. }
  2568. }
  2569. return result;
  2570. });
  2571. }
  2572. exports.getCheckoutInfo = getCheckoutInfo;
  2573. function getRefSpec(ref, commit) {
  2574. if (!ref && !commit) {
  2575. throw new Error('Args ref and commit cannot both be empty');
  2576. }
  2577. const upperRef = (ref || '').toUpperCase();
  2578. // SHA
  2579. if (commit) {
  2580. // refs/heads
  2581. if (upperRef.startsWith('REFS/HEADS/')) {
  2582. const branch = ref.substring('refs/heads/'.length);
  2583. return [`+${commit}:refs/remotes/origin/${branch}`];
  2584. }
  2585. // refs/pull/
  2586. else if (upperRef.startsWith('REFS/PULL/')) {
  2587. const branch = ref.substring('refs/pull/'.length);
  2588. return [`+${commit}:refs/remotes/pull/${branch}`];
  2589. }
  2590. // refs/tags/
  2591. else if (upperRef.startsWith('REFS/TAGS/')) {
  2592. return [`+${commit}:${ref}`];
  2593. }
  2594. // Otherwise no destination ref
  2595. else {
  2596. return [commit];
  2597. }
  2598. }
  2599. // Unqualified ref, check for a matching branch or tag
  2600. else if (!upperRef.startsWith('REFS/')) {
  2601. return [
  2602. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2603. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2604. ];
  2605. }
  2606. // refs/heads/
  2607. else if (upperRef.startsWith('REFS/HEADS/')) {
  2608. const branch = ref.substring('refs/heads/'.length);
  2609. return [`+${ref}:refs/remotes/origin/${branch}`];
  2610. }
  2611. // refs/pull/
  2612. else if (upperRef.startsWith('REFS/PULL/')) {
  2613. const branch = ref.substring('refs/pull/'.length);
  2614. return [`+${ref}:refs/remotes/pull/${branch}`];
  2615. }
  2616. // refs/tags/
  2617. else {
  2618. return [`+${ref}:${ref}`];
  2619. }
  2620. }
  2621. exports.getRefSpec = getRefSpec;
  2622. /***/ }),
  2623. /***/ 248:
  2624. /***/ (function(module, __unusedexports, __webpack_require__) {
  2625. module.exports = octokitRegisterEndpoints;
  2626. const registerEndpoints = __webpack_require__(899);
  2627. function octokitRegisterEndpoints(octokit) {
  2628. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2629. }
  2630. /***/ }),
  2631. /***/ 260:
  2632. /***/ (function(module, __unusedexports, __webpack_require__) {
  2633. // Note: since nyc uses this module to output coverage, any lines
  2634. // that are in the direct sync flow of nyc's outputCoverage are
  2635. // ignored, since we can never get coverage for them.
  2636. var assert = __webpack_require__(357)
  2637. var signals = __webpack_require__(654)
  2638. var EE = __webpack_require__(614)
  2639. /* istanbul ignore if */
  2640. if (typeof EE !== 'function') {
  2641. EE = EE.EventEmitter
  2642. }
  2643. var emitter
  2644. if (process.__signal_exit_emitter__) {
  2645. emitter = process.__signal_exit_emitter__
  2646. } else {
  2647. emitter = process.__signal_exit_emitter__ = new EE()
  2648. emitter.count = 0
  2649. emitter.emitted = {}
  2650. }
  2651. // Because this emitter is a global, we have to check to see if a
  2652. // previous version of this library failed to enable infinite listeners.
  2653. // I know what you're about to say. But literally everything about
  2654. // signal-exit is a compromise with evil. Get used to it.
  2655. if (!emitter.infinite) {
  2656. emitter.setMaxListeners(Infinity)
  2657. emitter.infinite = true
  2658. }
  2659. module.exports = function (cb, opts) {
  2660. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2661. if (loaded === false) {
  2662. load()
  2663. }
  2664. var ev = 'exit'
  2665. if (opts && opts.alwaysLast) {
  2666. ev = 'afterexit'
  2667. }
  2668. var remove = function () {
  2669. emitter.removeListener(ev, cb)
  2670. if (emitter.listeners('exit').length === 0 &&
  2671. emitter.listeners('afterexit').length === 0) {
  2672. unload()
  2673. }
  2674. }
  2675. emitter.on(ev, cb)
  2676. return remove
  2677. }
  2678. module.exports.unload = unload
  2679. function unload () {
  2680. if (!loaded) {
  2681. return
  2682. }
  2683. loaded = false
  2684. signals.forEach(function (sig) {
  2685. try {
  2686. process.removeListener(sig, sigListeners[sig])
  2687. } catch (er) {}
  2688. })
  2689. process.emit = originalProcessEmit
  2690. process.reallyExit = originalProcessReallyExit
  2691. emitter.count -= 1
  2692. }
  2693. function emit (event, code, signal) {
  2694. if (emitter.emitted[event]) {
  2695. return
  2696. }
  2697. emitter.emitted[event] = true
  2698. emitter.emit(event, code, signal)
  2699. }
  2700. // { <signal>: <listener fn>, ... }
  2701. var sigListeners = {}
  2702. signals.forEach(function (sig) {
  2703. sigListeners[sig] = function listener () {
  2704. // If there are no other listeners, an exit is coming!
  2705. // Simplest way: remove us and then re-send the signal.
  2706. // We know that this will kill the process, so we can
  2707. // safely emit now.
  2708. var listeners = process.listeners(sig)
  2709. if (listeners.length === emitter.count) {
  2710. unload()
  2711. emit('exit', null, sig)
  2712. /* istanbul ignore next */
  2713. emit('afterexit', null, sig)
  2714. /* istanbul ignore next */
  2715. process.kill(process.pid, sig)
  2716. }
  2717. }
  2718. })
  2719. module.exports.signals = function () {
  2720. return signals
  2721. }
  2722. module.exports.load = load
  2723. var loaded = false
  2724. function load () {
  2725. if (loaded) {
  2726. return
  2727. }
  2728. loaded = true
  2729. // This is the number of onSignalExit's that are in play.
  2730. // It's important so that we can count the correct number of
  2731. // listeners on signals, and don't wait for the other one to
  2732. // handle it instead of us.
  2733. emitter.count += 1
  2734. signals = signals.filter(function (sig) {
  2735. try {
  2736. process.on(sig, sigListeners[sig])
  2737. return true
  2738. } catch (er) {
  2739. return false
  2740. }
  2741. })
  2742. process.emit = processEmit
  2743. process.reallyExit = processReallyExit
  2744. }
  2745. var originalProcessReallyExit = process.reallyExit
  2746. function processReallyExit (code) {
  2747. process.exitCode = code || 0
  2748. emit('exit', process.exitCode, null)
  2749. /* istanbul ignore next */
  2750. emit('afterexit', process.exitCode, null)
  2751. /* istanbul ignore next */
  2752. originalProcessReallyExit.call(process, process.exitCode)
  2753. }
  2754. var originalProcessEmit = process.emit
  2755. function processEmit (ev, arg) {
  2756. if (ev === 'exit') {
  2757. if (arg !== undefined) {
  2758. process.exitCode = arg
  2759. }
  2760. var ret = originalProcessEmit.apply(this, arguments)
  2761. emit('exit', process.exitCode, null)
  2762. /* istanbul ignore next */
  2763. emit('afterexit', process.exitCode, null)
  2764. return ret
  2765. } else {
  2766. return originalProcessEmit.apply(this, arguments)
  2767. }
  2768. }
  2769. /***/ }),
  2770. /***/ 262:
  2771. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2772. "use strict";
  2773. Object.defineProperty(exports, "__esModule", { value: true });
  2774. const fs_1 = __webpack_require__(747);
  2775. const os_1 = __webpack_require__(87);
  2776. class Context {
  2777. /**
  2778. * Hydrate the context from the environment
  2779. */
  2780. constructor() {
  2781. this.payload = {};
  2782. if (process.env.GITHUB_EVENT_PATH) {
  2783. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  2784. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  2785. }
  2786. else {
  2787. const path = process.env.GITHUB_EVENT_PATH;
  2788. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  2789. }
  2790. }
  2791. this.eventName = process.env.GITHUB_EVENT_NAME;
  2792. this.sha = process.env.GITHUB_SHA;
  2793. this.ref = process.env.GITHUB_REF;
  2794. this.workflow = process.env.GITHUB_WORKFLOW;
  2795. this.action = process.env.GITHUB_ACTION;
  2796. this.actor = process.env.GITHUB_ACTOR;
  2797. }
  2798. get issue() {
  2799. const payload = this.payload;
  2800. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pullRequest || payload).number });
  2801. }
  2802. get repo() {
  2803. if (process.env.GITHUB_REPOSITORY) {
  2804. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  2805. return { owner, repo };
  2806. }
  2807. if (this.payload.repository) {
  2808. return {
  2809. owner: this.payload.repository.owner.login,
  2810. repo: this.payload.repository.name
  2811. };
  2812. }
  2813. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  2814. }
  2815. }
  2816. exports.Context = Context;
  2817. //# sourceMappingURL=context.js.map
  2818. /***/ }),
  2819. /***/ 265:
  2820. /***/ (function(module, __unusedexports, __webpack_require__) {
  2821. module.exports = getPage
  2822. const deprecate = __webpack_require__(370)
  2823. const getPageLinks = __webpack_require__(577)
  2824. const HttpError = __webpack_require__(297)
  2825. function getPage (octokit, link, which, headers) {
  2826. 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.`)
  2827. const url = getPageLinks(link)[which]
  2828. if (!url) {
  2829. const urlError = new HttpError(`No ${which} page found`, 404)
  2830. return Promise.reject(urlError)
  2831. }
  2832. const requestOptions = {
  2833. url,
  2834. headers: applyAcceptHeader(link, headers)
  2835. }
  2836. const promise = octokit.request(requestOptions)
  2837. return promise
  2838. }
  2839. function applyAcceptHeader (res, headers) {
  2840. const previous = res.headers && res.headers['x-github-media-type']
  2841. if (!previous || (headers && headers.accept)) {
  2842. return headers
  2843. }
  2844. headers = headers || {}
  2845. headers.accept = 'application/vnd.' + previous
  2846. .replace('; param=', '.')
  2847. .replace('; format=', '+')
  2848. return headers
  2849. }
  2850. /***/ }),
  2851. /***/ 280:
  2852. /***/ (function(module, exports) {
  2853. exports = module.exports = SemVer
  2854. var debug
  2855. /* istanbul ignore next */
  2856. if (typeof process === 'object' &&
  2857. process.env &&
  2858. process.env.NODE_DEBUG &&
  2859. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  2860. debug = function () {
  2861. var args = Array.prototype.slice.call(arguments, 0)
  2862. args.unshift('SEMVER')
  2863. console.log.apply(console, args)
  2864. }
  2865. } else {
  2866. debug = function () {}
  2867. }
  2868. // Note: this is the semver.org version of the spec that it implements
  2869. // Not necessarily the package version of this code.
  2870. exports.SEMVER_SPEC_VERSION = '2.0.0'
  2871. var MAX_LENGTH = 256
  2872. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  2873. /* istanbul ignore next */ 9007199254740991
  2874. // Max safe segment length for coercion.
  2875. var MAX_SAFE_COMPONENT_LENGTH = 16
  2876. // The actual regexps go on exports.re
  2877. var re = exports.re = []
  2878. var src = exports.src = []
  2879. var R = 0
  2880. // The following Regular Expressions can be used for tokenizing,
  2881. // validating, and parsing SemVer version strings.
  2882. // ## Numeric Identifier
  2883. // A single `0`, or a non-zero digit followed by zero or more digits.
  2884. var NUMERICIDENTIFIER = R++
  2885. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  2886. var NUMERICIDENTIFIERLOOSE = R++
  2887. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  2888. // ## Non-numeric Identifier
  2889. // Zero or more digits, followed by a letter or hyphen, and then zero or
  2890. // more letters, digits, or hyphens.
  2891. var NONNUMERICIDENTIFIER = R++
  2892. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  2893. // ## Main Version
  2894. // Three dot-separated numeric identifiers.
  2895. var MAINVERSION = R++
  2896. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2897. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  2898. '(' + src[NUMERICIDENTIFIER] + ')'
  2899. var MAINVERSIONLOOSE = R++
  2900. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2901. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  2902. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  2903. // ## Pre-release Version Identifier
  2904. // A numeric identifier, or a non-numeric identifier.
  2905. var PRERELEASEIDENTIFIER = R++
  2906. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  2907. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2908. var PRERELEASEIDENTIFIERLOOSE = R++
  2909. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  2910. '|' + src[NONNUMERICIDENTIFIER] + ')'
  2911. // ## Pre-release Version
  2912. // Hyphen, followed by one or more dot-separated pre-release version
  2913. // identifiers.
  2914. var PRERELEASE = R++
  2915. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  2916. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  2917. var PRERELEASELOOSE = R++
  2918. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  2919. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  2920. // ## Build Metadata Identifier
  2921. // Any combination of digits, letters, or hyphens.
  2922. var BUILDIDENTIFIER = R++
  2923. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  2924. // ## Build Metadata
  2925. // Plus sign, followed by one or more period-separated build metadata
  2926. // identifiers.
  2927. var BUILD = R++
  2928. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  2929. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  2930. // ## Full Version String
  2931. // A main version, followed optionally by a pre-release version and
  2932. // build metadata.
  2933. // Note that the only major, minor, patch, and pre-release sections of
  2934. // the version string are capturing groups. The build metadata is not a
  2935. // capturing group, because it should not ever be used in version
  2936. // comparison.
  2937. var FULL = R++
  2938. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  2939. src[PRERELEASE] + '?' +
  2940. src[BUILD] + '?'
  2941. src[FULL] = '^' + FULLPLAIN + '$'
  2942. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  2943. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  2944. // common in the npm registry.
  2945. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  2946. src[PRERELEASELOOSE] + '?' +
  2947. src[BUILD] + '?'
  2948. var LOOSE = R++
  2949. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  2950. var GTLT = R++
  2951. src[GTLT] = '((?:<|>)?=?)'
  2952. // Something like "2.*" or "1.2.x".
  2953. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  2954. // Only the first item is strictly required.
  2955. var XRANGEIDENTIFIERLOOSE = R++
  2956. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  2957. var XRANGEIDENTIFIER = R++
  2958. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  2959. var XRANGEPLAIN = R++
  2960. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  2961. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2962. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  2963. '(?:' + src[PRERELEASE] + ')?' +
  2964. src[BUILD] + '?' +
  2965. ')?)?'
  2966. var XRANGEPLAINLOOSE = R++
  2967. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2968. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2969. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  2970. '(?:' + src[PRERELEASELOOSE] + ')?' +
  2971. src[BUILD] + '?' +
  2972. ')?)?'
  2973. var XRANGE = R++
  2974. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  2975. var XRANGELOOSE = R++
  2976. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  2977. // Coercion.
  2978. // Extract anything that could conceivably be a part of a valid semver
  2979. var COERCE = R++
  2980. src[COERCE] = '(?:^|[^\\d])' +
  2981. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  2982. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2983. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  2984. '(?:$|[^\\d])'
  2985. // Tilde ranges.
  2986. // Meaning is "reasonably at or greater than"
  2987. var LONETILDE = R++
  2988. src[LONETILDE] = '(?:~>?)'
  2989. var TILDETRIM = R++
  2990. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  2991. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  2992. var tildeTrimReplace = '$1~'
  2993. var TILDE = R++
  2994. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  2995. var TILDELOOSE = R++
  2996. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  2997. // Caret ranges.
  2998. // Meaning is "at least and backwards compatible with"
  2999. var LONECARET = R++
  3000. src[LONECARET] = '(?:\\^)'
  3001. var CARETTRIM = R++
  3002. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3003. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3004. var caretTrimReplace = '$1^'
  3005. var CARET = R++
  3006. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3007. var CARETLOOSE = R++
  3008. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3009. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3010. var COMPARATORLOOSE = R++
  3011. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3012. var COMPARATOR = R++
  3013. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3014. // An expression to strip any whitespace between the gtlt and the thing
  3015. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3016. var COMPARATORTRIM = R++
  3017. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3018. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3019. // this one has to use the /g flag
  3020. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3021. var comparatorTrimReplace = '$1$2$3'
  3022. // Something like `1.2.3 - 1.2.4`
  3023. // Note that these all use the loose form, because they'll be
  3024. // checked against either the strict or loose comparator form
  3025. // later.
  3026. var HYPHENRANGE = R++
  3027. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3028. '\\s+-\\s+' +
  3029. '(' + src[XRANGEPLAIN] + ')' +
  3030. '\\s*$'
  3031. var HYPHENRANGELOOSE = R++
  3032. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3033. '\\s+-\\s+' +
  3034. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3035. '\\s*$'
  3036. // Star ranges basically just allow anything at all.
  3037. var STAR = R++
  3038. src[STAR] = '(<|>)?=?\\s*\\*'
  3039. // Compile to actual regexp objects.
  3040. // All are flag-free, unless they were created above with a flag.
  3041. for (var i = 0; i < R; i++) {
  3042. debug(i, src[i])
  3043. if (!re[i]) {
  3044. re[i] = new RegExp(src[i])
  3045. }
  3046. }
  3047. exports.parse = parse
  3048. function parse (version, options) {
  3049. if (!options || typeof options !== 'object') {
  3050. options = {
  3051. loose: !!options,
  3052. includePrerelease: false
  3053. }
  3054. }
  3055. if (version instanceof SemVer) {
  3056. return version
  3057. }
  3058. if (typeof version !== 'string') {
  3059. return null
  3060. }
  3061. if (version.length > MAX_LENGTH) {
  3062. return null
  3063. }
  3064. var r = options.loose ? re[LOOSE] : re[FULL]
  3065. if (!r.test(version)) {
  3066. return null
  3067. }
  3068. try {
  3069. return new SemVer(version, options)
  3070. } catch (er) {
  3071. return null
  3072. }
  3073. }
  3074. exports.valid = valid
  3075. function valid (version, options) {
  3076. var v = parse(version, options)
  3077. return v ? v.version : null
  3078. }
  3079. exports.clean = clean
  3080. function clean (version, options) {
  3081. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3082. return s ? s.version : null
  3083. }
  3084. exports.SemVer = SemVer
  3085. function SemVer (version, options) {
  3086. if (!options || typeof options !== 'object') {
  3087. options = {
  3088. loose: !!options,
  3089. includePrerelease: false
  3090. }
  3091. }
  3092. if (version instanceof SemVer) {
  3093. if (version.loose === options.loose) {
  3094. return version
  3095. } else {
  3096. version = version.version
  3097. }
  3098. } else if (typeof version !== 'string') {
  3099. throw new TypeError('Invalid Version: ' + version)
  3100. }
  3101. if (version.length > MAX_LENGTH) {
  3102. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3103. }
  3104. if (!(this instanceof SemVer)) {
  3105. return new SemVer(version, options)
  3106. }
  3107. debug('SemVer', version, options)
  3108. this.options = options
  3109. this.loose = !!options.loose
  3110. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3111. if (!m) {
  3112. throw new TypeError('Invalid Version: ' + version)
  3113. }
  3114. this.raw = version
  3115. // these are actually numbers
  3116. this.major = +m[1]
  3117. this.minor = +m[2]
  3118. this.patch = +m[3]
  3119. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3120. throw new TypeError('Invalid major version')
  3121. }
  3122. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3123. throw new TypeError('Invalid minor version')
  3124. }
  3125. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3126. throw new TypeError('Invalid patch version')
  3127. }
  3128. // numberify any prerelease numeric ids
  3129. if (!m[4]) {
  3130. this.prerelease = []
  3131. } else {
  3132. this.prerelease = m[4].split('.').map(function (id) {
  3133. if (/^[0-9]+$/.test(id)) {
  3134. var num = +id
  3135. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3136. return num
  3137. }
  3138. }
  3139. return id
  3140. })
  3141. }
  3142. this.build = m[5] ? m[5].split('.') : []
  3143. this.format()
  3144. }
  3145. SemVer.prototype.format = function () {
  3146. this.version = this.major + '.' + this.minor + '.' + this.patch
  3147. if (this.prerelease.length) {
  3148. this.version += '-' + this.prerelease.join('.')
  3149. }
  3150. return this.version
  3151. }
  3152. SemVer.prototype.toString = function () {
  3153. return this.version
  3154. }
  3155. SemVer.prototype.compare = function (other) {
  3156. debug('SemVer.compare', this.version, this.options, other)
  3157. if (!(other instanceof SemVer)) {
  3158. other = new SemVer(other, this.options)
  3159. }
  3160. return this.compareMain(other) || this.comparePre(other)
  3161. }
  3162. SemVer.prototype.compareMain = function (other) {
  3163. if (!(other instanceof SemVer)) {
  3164. other = new SemVer(other, this.options)
  3165. }
  3166. return compareIdentifiers(this.major, other.major) ||
  3167. compareIdentifiers(this.minor, other.minor) ||
  3168. compareIdentifiers(this.patch, other.patch)
  3169. }
  3170. SemVer.prototype.comparePre = function (other) {
  3171. if (!(other instanceof SemVer)) {
  3172. other = new SemVer(other, this.options)
  3173. }
  3174. // NOT having a prerelease is > having one
  3175. if (this.prerelease.length && !other.prerelease.length) {
  3176. return -1
  3177. } else if (!this.prerelease.length && other.prerelease.length) {
  3178. return 1
  3179. } else if (!this.prerelease.length && !other.prerelease.length) {
  3180. return 0
  3181. }
  3182. var i = 0
  3183. do {
  3184. var a = this.prerelease[i]
  3185. var b = other.prerelease[i]
  3186. debug('prerelease compare', i, a, b)
  3187. if (a === undefined && b === undefined) {
  3188. return 0
  3189. } else if (b === undefined) {
  3190. return 1
  3191. } else if (a === undefined) {
  3192. return -1
  3193. } else if (a === b) {
  3194. continue
  3195. } else {
  3196. return compareIdentifiers(a, b)
  3197. }
  3198. } while (++i)
  3199. }
  3200. // preminor will bump the version up to the next minor release, and immediately
  3201. // down to pre-release. premajor and prepatch work the same way.
  3202. SemVer.prototype.inc = function (release, identifier) {
  3203. switch (release) {
  3204. case 'premajor':
  3205. this.prerelease.length = 0
  3206. this.patch = 0
  3207. this.minor = 0
  3208. this.major++
  3209. this.inc('pre', identifier)
  3210. break
  3211. case 'preminor':
  3212. this.prerelease.length = 0
  3213. this.patch = 0
  3214. this.minor++
  3215. this.inc('pre', identifier)
  3216. break
  3217. case 'prepatch':
  3218. // If this is already a prerelease, it will bump to the next version
  3219. // drop any prereleases that might already exist, since they are not
  3220. // relevant at this point.
  3221. this.prerelease.length = 0
  3222. this.inc('patch', identifier)
  3223. this.inc('pre', identifier)
  3224. break
  3225. // If the input is a non-prerelease version, this acts the same as
  3226. // prepatch.
  3227. case 'prerelease':
  3228. if (this.prerelease.length === 0) {
  3229. this.inc('patch', identifier)
  3230. }
  3231. this.inc('pre', identifier)
  3232. break
  3233. case 'major':
  3234. // If this is a pre-major version, bump up to the same major version.
  3235. // Otherwise increment major.
  3236. // 1.0.0-5 bumps to 1.0.0
  3237. // 1.1.0 bumps to 2.0.0
  3238. if (this.minor !== 0 ||
  3239. this.patch !== 0 ||
  3240. this.prerelease.length === 0) {
  3241. this.major++
  3242. }
  3243. this.minor = 0
  3244. this.patch = 0
  3245. this.prerelease = []
  3246. break
  3247. case 'minor':
  3248. // If this is a pre-minor version, bump up to the same minor version.
  3249. // Otherwise increment minor.
  3250. // 1.2.0-5 bumps to 1.2.0
  3251. // 1.2.1 bumps to 1.3.0
  3252. if (this.patch !== 0 || this.prerelease.length === 0) {
  3253. this.minor++
  3254. }
  3255. this.patch = 0
  3256. this.prerelease = []
  3257. break
  3258. case 'patch':
  3259. // If this is not a pre-release version, it will increment the patch.
  3260. // If it is a pre-release it will bump up to the same patch version.
  3261. // 1.2.0-5 patches to 1.2.0
  3262. // 1.2.0 patches to 1.2.1
  3263. if (this.prerelease.length === 0) {
  3264. this.patch++
  3265. }
  3266. this.prerelease = []
  3267. break
  3268. // This probably shouldn't be used publicly.
  3269. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3270. case 'pre':
  3271. if (this.prerelease.length === 0) {
  3272. this.prerelease = [0]
  3273. } else {
  3274. var i = this.prerelease.length
  3275. while (--i >= 0) {
  3276. if (typeof this.prerelease[i] === 'number') {
  3277. this.prerelease[i]++
  3278. i = -2
  3279. }
  3280. }
  3281. if (i === -1) {
  3282. // didn't increment anything
  3283. this.prerelease.push(0)
  3284. }
  3285. }
  3286. if (identifier) {
  3287. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3288. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3289. if (this.prerelease[0] === identifier) {
  3290. if (isNaN(this.prerelease[1])) {
  3291. this.prerelease = [identifier, 0]
  3292. }
  3293. } else {
  3294. this.prerelease = [identifier, 0]
  3295. }
  3296. }
  3297. break
  3298. default:
  3299. throw new Error('invalid increment argument: ' + release)
  3300. }
  3301. this.format()
  3302. this.raw = this.version
  3303. return this
  3304. }
  3305. exports.inc = inc
  3306. function inc (version, release, loose, identifier) {
  3307. if (typeof (loose) === 'string') {
  3308. identifier = loose
  3309. loose = undefined
  3310. }
  3311. try {
  3312. return new SemVer(version, loose).inc(release, identifier).version
  3313. } catch (er) {
  3314. return null
  3315. }
  3316. }
  3317. exports.diff = diff
  3318. function diff (version1, version2) {
  3319. if (eq(version1, version2)) {
  3320. return null
  3321. } else {
  3322. var v1 = parse(version1)
  3323. var v2 = parse(version2)
  3324. var prefix = ''
  3325. if (v1.prerelease.length || v2.prerelease.length) {
  3326. prefix = 'pre'
  3327. var defaultResult = 'prerelease'
  3328. }
  3329. for (var key in v1) {
  3330. if (key === 'major' || key === 'minor' || key === 'patch') {
  3331. if (v1[key] !== v2[key]) {
  3332. return prefix + key
  3333. }
  3334. }
  3335. }
  3336. return defaultResult // may be undefined
  3337. }
  3338. }
  3339. exports.compareIdentifiers = compareIdentifiers
  3340. var numeric = /^[0-9]+$/
  3341. function compareIdentifiers (a, b) {
  3342. var anum = numeric.test(a)
  3343. var bnum = numeric.test(b)
  3344. if (anum && bnum) {
  3345. a = +a
  3346. b = +b
  3347. }
  3348. return a === b ? 0
  3349. : (anum && !bnum) ? -1
  3350. : (bnum && !anum) ? 1
  3351. : a < b ? -1
  3352. : 1
  3353. }
  3354. exports.rcompareIdentifiers = rcompareIdentifiers
  3355. function rcompareIdentifiers (a, b) {
  3356. return compareIdentifiers(b, a)
  3357. }
  3358. exports.major = major
  3359. function major (a, loose) {
  3360. return new SemVer(a, loose).major
  3361. }
  3362. exports.minor = minor
  3363. function minor (a, loose) {
  3364. return new SemVer(a, loose).minor
  3365. }
  3366. exports.patch = patch
  3367. function patch (a, loose) {
  3368. return new SemVer(a, loose).patch
  3369. }
  3370. exports.compare = compare
  3371. function compare (a, b, loose) {
  3372. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3373. }
  3374. exports.compareLoose = compareLoose
  3375. function compareLoose (a, b) {
  3376. return compare(a, b, true)
  3377. }
  3378. exports.rcompare = rcompare
  3379. function rcompare (a, b, loose) {
  3380. return compare(b, a, loose)
  3381. }
  3382. exports.sort = sort
  3383. function sort (list, loose) {
  3384. return list.sort(function (a, b) {
  3385. return exports.compare(a, b, loose)
  3386. })
  3387. }
  3388. exports.rsort = rsort
  3389. function rsort (list, loose) {
  3390. return list.sort(function (a, b) {
  3391. return exports.rcompare(a, b, loose)
  3392. })
  3393. }
  3394. exports.gt = gt
  3395. function gt (a, b, loose) {
  3396. return compare(a, b, loose) > 0
  3397. }
  3398. exports.lt = lt
  3399. function lt (a, b, loose) {
  3400. return compare(a, b, loose) < 0
  3401. }
  3402. exports.eq = eq
  3403. function eq (a, b, loose) {
  3404. return compare(a, b, loose) === 0
  3405. }
  3406. exports.neq = neq
  3407. function neq (a, b, loose) {
  3408. return compare(a, b, loose) !== 0
  3409. }
  3410. exports.gte = gte
  3411. function gte (a, b, loose) {
  3412. return compare(a, b, loose) >= 0
  3413. }
  3414. exports.lte = lte
  3415. function lte (a, b, loose) {
  3416. return compare(a, b, loose) <= 0
  3417. }
  3418. exports.cmp = cmp
  3419. function cmp (a, op, b, loose) {
  3420. switch (op) {
  3421. case '===':
  3422. if (typeof a === 'object')
  3423. a = a.version
  3424. if (typeof b === 'object')
  3425. b = b.version
  3426. return a === b
  3427. case '!==':
  3428. if (typeof a === 'object')
  3429. a = a.version
  3430. if (typeof b === 'object')
  3431. b = b.version
  3432. return a !== b
  3433. case '':
  3434. case '=':
  3435. case '==':
  3436. return eq(a, b, loose)
  3437. case '!=':
  3438. return neq(a, b, loose)
  3439. case '>':
  3440. return gt(a, b, loose)
  3441. case '>=':
  3442. return gte(a, b, loose)
  3443. case '<':
  3444. return lt(a, b, loose)
  3445. case '<=':
  3446. return lte(a, b, loose)
  3447. default:
  3448. throw new TypeError('Invalid operator: ' + op)
  3449. }
  3450. }
  3451. exports.Comparator = Comparator
  3452. function Comparator (comp, options) {
  3453. if (!options || typeof options !== 'object') {
  3454. options = {
  3455. loose: !!options,
  3456. includePrerelease: false
  3457. }
  3458. }
  3459. if (comp instanceof Comparator) {
  3460. if (comp.loose === !!options.loose) {
  3461. return comp
  3462. } else {
  3463. comp = comp.value
  3464. }
  3465. }
  3466. if (!(this instanceof Comparator)) {
  3467. return new Comparator(comp, options)
  3468. }
  3469. debug('comparator', comp, options)
  3470. this.options = options
  3471. this.loose = !!options.loose
  3472. this.parse(comp)
  3473. if (this.semver === ANY) {
  3474. this.value = ''
  3475. } else {
  3476. this.value = this.operator + this.semver.version
  3477. }
  3478. debug('comp', this)
  3479. }
  3480. var ANY = {}
  3481. Comparator.prototype.parse = function (comp) {
  3482. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3483. var m = comp.match(r)
  3484. if (!m) {
  3485. throw new TypeError('Invalid comparator: ' + comp)
  3486. }
  3487. this.operator = m[1]
  3488. if (this.operator === '=') {
  3489. this.operator = ''
  3490. }
  3491. // if it literally is just '>' or '' then allow anything.
  3492. if (!m[2]) {
  3493. this.semver = ANY
  3494. } else {
  3495. this.semver = new SemVer(m[2], this.options.loose)
  3496. }
  3497. }
  3498. Comparator.prototype.toString = function () {
  3499. return this.value
  3500. }
  3501. Comparator.prototype.test = function (version) {
  3502. debug('Comparator.test', version, this.options.loose)
  3503. if (this.semver === ANY) {
  3504. return true
  3505. }
  3506. if (typeof version === 'string') {
  3507. version = new SemVer(version, this.options)
  3508. }
  3509. return cmp(version, this.operator, this.semver, this.options)
  3510. }
  3511. Comparator.prototype.intersects = function (comp, options) {
  3512. if (!(comp instanceof Comparator)) {
  3513. throw new TypeError('a Comparator is required')
  3514. }
  3515. if (!options || typeof options !== 'object') {
  3516. options = {
  3517. loose: !!options,
  3518. includePrerelease: false
  3519. }
  3520. }
  3521. var rangeTmp
  3522. if (this.operator === '') {
  3523. rangeTmp = new Range(comp.value, options)
  3524. return satisfies(this.value, rangeTmp, options)
  3525. } else if (comp.operator === '') {
  3526. rangeTmp = new Range(this.value, options)
  3527. return satisfies(comp.semver, rangeTmp, options)
  3528. }
  3529. var sameDirectionIncreasing =
  3530. (this.operator === '>=' || this.operator === '>') &&
  3531. (comp.operator === '>=' || comp.operator === '>')
  3532. var sameDirectionDecreasing =
  3533. (this.operator === '<=' || this.operator === '<') &&
  3534. (comp.operator === '<=' || comp.operator === '<')
  3535. var sameSemVer = this.semver.version === comp.semver.version
  3536. var differentDirectionsInclusive =
  3537. (this.operator === '>=' || this.operator === '<=') &&
  3538. (comp.operator === '>=' || comp.operator === '<=')
  3539. var oppositeDirectionsLessThan =
  3540. cmp(this.semver, '<', comp.semver, options) &&
  3541. ((this.operator === '>=' || this.operator === '>') &&
  3542. (comp.operator === '<=' || comp.operator === '<'))
  3543. var oppositeDirectionsGreaterThan =
  3544. cmp(this.semver, '>', comp.semver, options) &&
  3545. ((this.operator === '<=' || this.operator === '<') &&
  3546. (comp.operator === '>=' || comp.operator === '>'))
  3547. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3548. (sameSemVer && differentDirectionsInclusive) ||
  3549. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3550. }
  3551. exports.Range = Range
  3552. function Range (range, options) {
  3553. if (!options || typeof options !== 'object') {
  3554. options = {
  3555. loose: !!options,
  3556. includePrerelease: false
  3557. }
  3558. }
  3559. if (range instanceof Range) {
  3560. if (range.loose === !!options.loose &&
  3561. range.includePrerelease === !!options.includePrerelease) {
  3562. return range
  3563. } else {
  3564. return new Range(range.raw, options)
  3565. }
  3566. }
  3567. if (range instanceof Comparator) {
  3568. return new Range(range.value, options)
  3569. }
  3570. if (!(this instanceof Range)) {
  3571. return new Range(range, options)
  3572. }
  3573. this.options = options
  3574. this.loose = !!options.loose
  3575. this.includePrerelease = !!options.includePrerelease
  3576. // First, split based on boolean or ||
  3577. this.raw = range
  3578. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3579. return this.parseRange(range.trim())
  3580. }, this).filter(function (c) {
  3581. // throw out any that are not relevant for whatever reason
  3582. return c.length
  3583. })
  3584. if (!this.set.length) {
  3585. throw new TypeError('Invalid SemVer Range: ' + range)
  3586. }
  3587. this.format()
  3588. }
  3589. Range.prototype.format = function () {
  3590. this.range = this.set.map(function (comps) {
  3591. return comps.join(' ').trim()
  3592. }).join('||').trim()
  3593. return this.range
  3594. }
  3595. Range.prototype.toString = function () {
  3596. return this.range
  3597. }
  3598. Range.prototype.parseRange = function (range) {
  3599. var loose = this.options.loose
  3600. range = range.trim()
  3601. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3602. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3603. range = range.replace(hr, hyphenReplace)
  3604. debug('hyphen replace', range)
  3605. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3606. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3607. debug('comparator trim', range, re[COMPARATORTRIM])
  3608. // `~ 1.2.3` => `~1.2.3`
  3609. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3610. // `^ 1.2.3` => `^1.2.3`
  3611. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3612. // normalize spaces
  3613. range = range.split(/\s+/).join(' ')
  3614. // At this point, the range is completely trimmed and
  3615. // ready to be split into comparators.
  3616. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3617. var set = range.split(' ').map(function (comp) {
  3618. return parseComparator(comp, this.options)
  3619. }, this).join(' ').split(/\s+/)
  3620. if (this.options.loose) {
  3621. // in loose mode, throw out any that are not valid comparators
  3622. set = set.filter(function (comp) {
  3623. return !!comp.match(compRe)
  3624. })
  3625. }
  3626. set = set.map(function (comp) {
  3627. return new Comparator(comp, this.options)
  3628. }, this)
  3629. return set
  3630. }
  3631. Range.prototype.intersects = function (range, options) {
  3632. if (!(range instanceof Range)) {
  3633. throw new TypeError('a Range is required')
  3634. }
  3635. return this.set.some(function (thisComparators) {
  3636. return thisComparators.every(function (thisComparator) {
  3637. return range.set.some(function (rangeComparators) {
  3638. return rangeComparators.every(function (rangeComparator) {
  3639. return thisComparator.intersects(rangeComparator, options)
  3640. })
  3641. })
  3642. })
  3643. })
  3644. }
  3645. // Mostly just for testing and legacy API reasons
  3646. exports.toComparators = toComparators
  3647. function toComparators (range, options) {
  3648. return new Range(range, options).set.map(function (comp) {
  3649. return comp.map(function (c) {
  3650. return c.value
  3651. }).join(' ').trim().split(' ')
  3652. })
  3653. }
  3654. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3655. // already replaced the hyphen ranges
  3656. // turn into a set of JUST comparators.
  3657. function parseComparator (comp, options) {
  3658. debug('comp', comp, options)
  3659. comp = replaceCarets(comp, options)
  3660. debug('caret', comp)
  3661. comp = replaceTildes(comp, options)
  3662. debug('tildes', comp)
  3663. comp = replaceXRanges(comp, options)
  3664. debug('xrange', comp)
  3665. comp = replaceStars(comp, options)
  3666. debug('stars', comp)
  3667. return comp
  3668. }
  3669. function isX (id) {
  3670. return !id || id.toLowerCase() === 'x' || id === '*'
  3671. }
  3672. // ~, ~> --> * (any, kinda silly)
  3673. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3674. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3675. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3676. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3677. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3678. function replaceTildes (comp, options) {
  3679. return comp.trim().split(/\s+/).map(function (comp) {
  3680. return replaceTilde(comp, options)
  3681. }).join(' ')
  3682. }
  3683. function replaceTilde (comp, options) {
  3684. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3685. return comp.replace(r, function (_, M, m, p, pr) {
  3686. debug('tilde', comp, _, M, m, p, pr)
  3687. var ret
  3688. if (isX(M)) {
  3689. ret = ''
  3690. } else if (isX(m)) {
  3691. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3692. } else if (isX(p)) {
  3693. // ~1.2 == >=1.2.0 <1.3.0
  3694. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3695. } else if (pr) {
  3696. debug('replaceTilde pr', pr)
  3697. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3698. ' <' + M + '.' + (+m + 1) + '.0'
  3699. } else {
  3700. // ~1.2.3 == >=1.2.3 <1.3.0
  3701. ret = '>=' + M + '.' + m + '.' + p +
  3702. ' <' + M + '.' + (+m + 1) + '.0'
  3703. }
  3704. debug('tilde return', ret)
  3705. return ret
  3706. })
  3707. }
  3708. // ^ --> * (any, kinda silly)
  3709. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  3710. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  3711. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  3712. // ^1.2.3 --> >=1.2.3 <2.0.0
  3713. // ^1.2.0 --> >=1.2.0 <2.0.0
  3714. function replaceCarets (comp, options) {
  3715. return comp.trim().split(/\s+/).map(function (comp) {
  3716. return replaceCaret(comp, options)
  3717. }).join(' ')
  3718. }
  3719. function replaceCaret (comp, options) {
  3720. debug('caret', comp, options)
  3721. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  3722. return comp.replace(r, function (_, M, m, p, pr) {
  3723. debug('caret', comp, _, M, m, p, pr)
  3724. var ret
  3725. if (isX(M)) {
  3726. ret = ''
  3727. } else if (isX(m)) {
  3728. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3729. } else if (isX(p)) {
  3730. if (M === '0') {
  3731. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3732. } else {
  3733. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  3734. }
  3735. } else if (pr) {
  3736. debug('replaceCaret pr', pr)
  3737. if (M === '0') {
  3738. if (m === '0') {
  3739. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3740. ' <' + M + '.' + m + '.' + (+p + 1)
  3741. } else {
  3742. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3743. ' <' + M + '.' + (+m + 1) + '.0'
  3744. }
  3745. } else {
  3746. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3747. ' <' + (+M + 1) + '.0.0'
  3748. }
  3749. } else {
  3750. debug('no pr')
  3751. if (M === '0') {
  3752. if (m === '0') {
  3753. ret = '>=' + M + '.' + m + '.' + p +
  3754. ' <' + M + '.' + m + '.' + (+p + 1)
  3755. } else {
  3756. ret = '>=' + M + '.' + m + '.' + p +
  3757. ' <' + M + '.' + (+m + 1) + '.0'
  3758. }
  3759. } else {
  3760. ret = '>=' + M + '.' + m + '.' + p +
  3761. ' <' + (+M + 1) + '.0.0'
  3762. }
  3763. }
  3764. debug('caret return', ret)
  3765. return ret
  3766. })
  3767. }
  3768. function replaceXRanges (comp, options) {
  3769. debug('replaceXRanges', comp, options)
  3770. return comp.split(/\s+/).map(function (comp) {
  3771. return replaceXRange(comp, options)
  3772. }).join(' ')
  3773. }
  3774. function replaceXRange (comp, options) {
  3775. comp = comp.trim()
  3776. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  3777. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  3778. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  3779. var xM = isX(M)
  3780. var xm = xM || isX(m)
  3781. var xp = xm || isX(p)
  3782. var anyX = xp
  3783. if (gtlt === '=' && anyX) {
  3784. gtlt = ''
  3785. }
  3786. if (xM) {
  3787. if (gtlt === '>' || gtlt === '<') {
  3788. // nothing is allowed
  3789. ret = '<0.0.0'
  3790. } else {
  3791. // nothing is forbidden
  3792. ret = '*'
  3793. }
  3794. } else if (gtlt && anyX) {
  3795. // we know patch is an x, because we have any x at all.
  3796. // replace X with 0
  3797. if (xm) {
  3798. m = 0
  3799. }
  3800. p = 0
  3801. if (gtlt === '>') {
  3802. // >1 => >=2.0.0
  3803. // >1.2 => >=1.3.0
  3804. // >1.2.3 => >= 1.2.4
  3805. gtlt = '>='
  3806. if (xm) {
  3807. M = +M + 1
  3808. m = 0
  3809. p = 0
  3810. } else {
  3811. m = +m + 1
  3812. p = 0
  3813. }
  3814. } else if (gtlt === '<=') {
  3815. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  3816. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  3817. gtlt = '<'
  3818. if (xm) {
  3819. M = +M + 1
  3820. } else {
  3821. m = +m + 1
  3822. }
  3823. }
  3824. ret = gtlt + M + '.' + m + '.' + p
  3825. } else if (xm) {
  3826. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3827. } else if (xp) {
  3828. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3829. }
  3830. debug('xRange return', ret)
  3831. return ret
  3832. })
  3833. }
  3834. // Because * is AND-ed with everything else in the comparator,
  3835. // and '' means "any version", just remove the *s entirely.
  3836. function replaceStars (comp, options) {
  3837. debug('replaceStars', comp, options)
  3838. // Looseness is ignored here. star is always as loose as it gets!
  3839. return comp.trim().replace(re[STAR], '')
  3840. }
  3841. // This function is passed to string.replace(re[HYPHENRANGE])
  3842. // M, m, patch, prerelease, build
  3843. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  3844. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  3845. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  3846. function hyphenReplace ($0,
  3847. from, fM, fm, fp, fpr, fb,
  3848. to, tM, tm, tp, tpr, tb) {
  3849. if (isX(fM)) {
  3850. from = ''
  3851. } else if (isX(fm)) {
  3852. from = '>=' + fM + '.0.0'
  3853. } else if (isX(fp)) {
  3854. from = '>=' + fM + '.' + fm + '.0'
  3855. } else {
  3856. from = '>=' + from
  3857. }
  3858. if (isX(tM)) {
  3859. to = ''
  3860. } else if (isX(tm)) {
  3861. to = '<' + (+tM + 1) + '.0.0'
  3862. } else if (isX(tp)) {
  3863. to = '<' + tM + '.' + (+tm + 1) + '.0'
  3864. } else if (tpr) {
  3865. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  3866. } else {
  3867. to = '<=' + to
  3868. }
  3869. return (from + ' ' + to).trim()
  3870. }
  3871. // if ANY of the sets match ALL of its comparators, then pass
  3872. Range.prototype.test = function (version) {
  3873. if (!version) {
  3874. return false
  3875. }
  3876. if (typeof version === 'string') {
  3877. version = new SemVer(version, this.options)
  3878. }
  3879. for (var i = 0; i < this.set.length; i++) {
  3880. if (testSet(this.set[i], version, this.options)) {
  3881. return true
  3882. }
  3883. }
  3884. return false
  3885. }
  3886. function testSet (set, version, options) {
  3887. for (var i = 0; i < set.length; i++) {
  3888. if (!set[i].test(version)) {
  3889. return false
  3890. }
  3891. }
  3892. if (version.prerelease.length && !options.includePrerelease) {
  3893. // Find the set of versions that are allowed to have prereleases
  3894. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  3895. // That should allow `1.2.3-pr.2` to pass.
  3896. // However, `1.2.4-alpha.notready` should NOT be allowed,
  3897. // even though it's within the range set by the comparators.
  3898. for (i = 0; i < set.length; i++) {
  3899. debug(set[i].semver)
  3900. if (set[i].semver === ANY) {
  3901. continue
  3902. }
  3903. if (set[i].semver.prerelease.length > 0) {
  3904. var allowed = set[i].semver
  3905. if (allowed.major === version.major &&
  3906. allowed.minor === version.minor &&
  3907. allowed.patch === version.patch) {
  3908. return true
  3909. }
  3910. }
  3911. }
  3912. // Version has a -pre, but it's not one of the ones we like.
  3913. return false
  3914. }
  3915. return true
  3916. }
  3917. exports.satisfies = satisfies
  3918. function satisfies (version, range, options) {
  3919. try {
  3920. range = new Range(range, options)
  3921. } catch (er) {
  3922. return false
  3923. }
  3924. return range.test(version)
  3925. }
  3926. exports.maxSatisfying = maxSatisfying
  3927. function maxSatisfying (versions, range, options) {
  3928. var max = null
  3929. var maxSV = null
  3930. try {
  3931. var rangeObj = new Range(range, options)
  3932. } catch (er) {
  3933. return null
  3934. }
  3935. versions.forEach(function (v) {
  3936. if (rangeObj.test(v)) {
  3937. // satisfies(v, range, options)
  3938. if (!max || maxSV.compare(v) === -1) {
  3939. // compare(max, v, true)
  3940. max = v
  3941. maxSV = new SemVer(max, options)
  3942. }
  3943. }
  3944. })
  3945. return max
  3946. }
  3947. exports.minSatisfying = minSatisfying
  3948. function minSatisfying (versions, range, options) {
  3949. var min = null
  3950. var minSV = null
  3951. try {
  3952. var rangeObj = new Range(range, options)
  3953. } catch (er) {
  3954. return null
  3955. }
  3956. versions.forEach(function (v) {
  3957. if (rangeObj.test(v)) {
  3958. // satisfies(v, range, options)
  3959. if (!min || minSV.compare(v) === 1) {
  3960. // compare(min, v, true)
  3961. min = v
  3962. minSV = new SemVer(min, options)
  3963. }
  3964. }
  3965. })
  3966. return min
  3967. }
  3968. exports.minVersion = minVersion
  3969. function minVersion (range, loose) {
  3970. range = new Range(range, loose)
  3971. var minver = new SemVer('0.0.0')
  3972. if (range.test(minver)) {
  3973. return minver
  3974. }
  3975. minver = new SemVer('0.0.0-0')
  3976. if (range.test(minver)) {
  3977. return minver
  3978. }
  3979. minver = null
  3980. for (var i = 0; i < range.set.length; ++i) {
  3981. var comparators = range.set[i]
  3982. comparators.forEach(function (comparator) {
  3983. // Clone to avoid manipulating the comparator's semver object.
  3984. var compver = new SemVer(comparator.semver.version)
  3985. switch (comparator.operator) {
  3986. case '>':
  3987. if (compver.prerelease.length === 0) {
  3988. compver.patch++
  3989. } else {
  3990. compver.prerelease.push(0)
  3991. }
  3992. compver.raw = compver.format()
  3993. /* fallthrough */
  3994. case '':
  3995. case '>=':
  3996. if (!minver || gt(minver, compver)) {
  3997. minver = compver
  3998. }
  3999. break
  4000. case '<':
  4001. case '<=':
  4002. /* Ignore maximum versions */
  4003. break
  4004. /* istanbul ignore next */
  4005. default:
  4006. throw new Error('Unexpected operation: ' + comparator.operator)
  4007. }
  4008. })
  4009. }
  4010. if (minver && range.test(minver)) {
  4011. return minver
  4012. }
  4013. return null
  4014. }
  4015. exports.validRange = validRange
  4016. function validRange (range, options) {
  4017. try {
  4018. // Return '*' instead of '' so that truthiness works.
  4019. // This will throw if it's invalid anyway
  4020. return new Range(range, options).range || '*'
  4021. } catch (er) {
  4022. return null
  4023. }
  4024. }
  4025. // Determine if version is less than all the versions possible in the range
  4026. exports.ltr = ltr
  4027. function ltr (version, range, options) {
  4028. return outside(version, range, '<', options)
  4029. }
  4030. // Determine if version is greater than all the versions possible in the range.
  4031. exports.gtr = gtr
  4032. function gtr (version, range, options) {
  4033. return outside(version, range, '>', options)
  4034. }
  4035. exports.outside = outside
  4036. function outside (version, range, hilo, options) {
  4037. version = new SemVer(version, options)
  4038. range = new Range(range, options)
  4039. var gtfn, ltefn, ltfn, comp, ecomp
  4040. switch (hilo) {
  4041. case '>':
  4042. gtfn = gt
  4043. ltefn = lte
  4044. ltfn = lt
  4045. comp = '>'
  4046. ecomp = '>='
  4047. break
  4048. case '<':
  4049. gtfn = lt
  4050. ltefn = gte
  4051. ltfn = gt
  4052. comp = '<'
  4053. ecomp = '<='
  4054. break
  4055. default:
  4056. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4057. }
  4058. // If it satisifes the range it is not outside
  4059. if (satisfies(version, range, options)) {
  4060. return false
  4061. }
  4062. // From now on, variable terms are as if we're in "gtr" mode.
  4063. // but note that everything is flipped for the "ltr" function.
  4064. for (var i = 0; i < range.set.length; ++i) {
  4065. var comparators = range.set[i]
  4066. var high = null
  4067. var low = null
  4068. comparators.forEach(function (comparator) {
  4069. if (comparator.semver === ANY) {
  4070. comparator = new Comparator('>=0.0.0')
  4071. }
  4072. high = high || comparator
  4073. low = low || comparator
  4074. if (gtfn(comparator.semver, high.semver, options)) {
  4075. high = comparator
  4076. } else if (ltfn(comparator.semver, low.semver, options)) {
  4077. low = comparator
  4078. }
  4079. })
  4080. // If the edge version comparator has a operator then our version
  4081. // isn't outside it
  4082. if (high.operator === comp || high.operator === ecomp) {
  4083. return false
  4084. }
  4085. // If the lowest version comparator has an operator and our version
  4086. // is less than it then it isn't higher than the range
  4087. if ((!low.operator || low.operator === comp) &&
  4088. ltefn(version, low.semver)) {
  4089. return false
  4090. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4091. return false
  4092. }
  4093. }
  4094. return true
  4095. }
  4096. exports.prerelease = prerelease
  4097. function prerelease (version, options) {
  4098. var parsed = parse(version, options)
  4099. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4100. }
  4101. exports.intersects = intersects
  4102. function intersects (r1, r2, options) {
  4103. r1 = new Range(r1, options)
  4104. r2 = new Range(r2, options)
  4105. return r1.intersects(r2)
  4106. }
  4107. exports.coerce = coerce
  4108. function coerce (version) {
  4109. if (version instanceof SemVer) {
  4110. return version
  4111. }
  4112. if (typeof version !== 'string') {
  4113. return null
  4114. }
  4115. var match = version.match(re[COERCE])
  4116. if (match == null) {
  4117. return null
  4118. }
  4119. return parse(match[1] +
  4120. '.' + (match[2] || '0') +
  4121. '.' + (match[3] || '0'))
  4122. }
  4123. /***/ }),
  4124. /***/ 289:
  4125. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4126. "use strict";
  4127. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4128. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4129. return new (P || (P = Promise))(function (resolve, reject) {
  4130. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4131. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4132. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4133. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4134. });
  4135. };
  4136. var __importStar = (this && this.__importStar) || function (mod) {
  4137. if (mod && mod.__esModule) return mod;
  4138. var result = {};
  4139. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4140. result["default"] = mod;
  4141. return result;
  4142. };
  4143. Object.defineProperty(exports, "__esModule", { value: true });
  4144. const core = __importStar(__webpack_require__(470));
  4145. const exec = __importStar(__webpack_require__(986));
  4146. const fshelper = __importStar(__webpack_require__(618));
  4147. const io = __importStar(__webpack_require__(1));
  4148. const path = __importStar(__webpack_require__(622));
  4149. const retryHelper = __importStar(__webpack_require__(587));
  4150. const git_version_1 = __webpack_require__(559);
  4151. // Auth header not supported before 2.9
  4152. // Wire protocol v2 not supported before 2.18
  4153. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4154. function CreateCommandManager(workingDirectory, lfs) {
  4155. return __awaiter(this, void 0, void 0, function* () {
  4156. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4157. });
  4158. }
  4159. exports.CreateCommandManager = CreateCommandManager;
  4160. class GitCommandManager {
  4161. // Private constructor; use createCommandManager()
  4162. constructor() {
  4163. this.gitEnv = {
  4164. GIT_TERMINAL_PROMPT: '0',
  4165. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4166. };
  4167. this.gitPath = '';
  4168. this.lfs = false;
  4169. this.workingDirectory = '';
  4170. }
  4171. branchDelete(remote, branch) {
  4172. return __awaiter(this, void 0, void 0, function* () {
  4173. const args = ['branch', '--delete', '--force'];
  4174. if (remote) {
  4175. args.push('--remote');
  4176. }
  4177. args.push(branch);
  4178. yield this.execGit(args);
  4179. });
  4180. }
  4181. branchExists(remote, pattern) {
  4182. return __awaiter(this, void 0, void 0, function* () {
  4183. const args = ['branch', '--list'];
  4184. if (remote) {
  4185. args.push('--remote');
  4186. }
  4187. args.push(pattern);
  4188. const output = yield this.execGit(args);
  4189. return !!output.stdout.trim();
  4190. });
  4191. }
  4192. branchList(remote) {
  4193. return __awaiter(this, void 0, void 0, function* () {
  4194. const result = [];
  4195. // Note, this implementation uses "rev-parse --symbolic" because the output from
  4196. // "branch --list" is more difficult when in a detached HEAD state.
  4197. const args = ['rev-parse', '--symbolic'];
  4198. if (remote) {
  4199. args.push('--remotes=origin');
  4200. }
  4201. else {
  4202. args.push('--branches');
  4203. }
  4204. const output = yield this.execGit(args);
  4205. for (let branch of output.stdout.trim().split('\n')) {
  4206. branch = branch.trim();
  4207. if (branch) {
  4208. result.push(branch);
  4209. }
  4210. }
  4211. return result;
  4212. });
  4213. }
  4214. checkout(ref, startPoint) {
  4215. return __awaiter(this, void 0, void 0, function* () {
  4216. const args = ['checkout', '--progress', '--force'];
  4217. if (startPoint) {
  4218. args.push('-B', ref, startPoint);
  4219. }
  4220. else {
  4221. args.push(ref);
  4222. }
  4223. yield this.execGit(args);
  4224. });
  4225. }
  4226. checkoutDetach() {
  4227. return __awaiter(this, void 0, void 0, function* () {
  4228. const args = ['checkout', '--detach'];
  4229. yield this.execGit(args);
  4230. });
  4231. }
  4232. config(configKey, configValue) {
  4233. return __awaiter(this, void 0, void 0, function* () {
  4234. yield this.execGit(['config', configKey, configValue]);
  4235. });
  4236. }
  4237. configExists(configKey) {
  4238. return __awaiter(this, void 0, void 0, function* () {
  4239. const pattern = configKey.replace(/[^a-zA-Z0-9_]/g, x => {
  4240. return `\\${x}`;
  4241. });
  4242. const output = yield this.execGit(['config', '--name-only', '--get-regexp', pattern], true);
  4243. return output.exitCode === 0;
  4244. });
  4245. }
  4246. fetch(fetchDepth, refSpec) {
  4247. return __awaiter(this, void 0, void 0, function* () {
  4248. const args = [
  4249. '-c',
  4250. 'protocol.version=2',
  4251. 'fetch',
  4252. '--no-tags',
  4253. '--prune',
  4254. '--progress',
  4255. '--no-recurse-submodules'
  4256. ];
  4257. if (fetchDepth > 0) {
  4258. args.push(`--depth=${fetchDepth}`);
  4259. }
  4260. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4261. args.push('--unshallow');
  4262. }
  4263. args.push('origin');
  4264. for (const arg of refSpec) {
  4265. args.push(arg);
  4266. }
  4267. const that = this;
  4268. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4269. yield that.execGit(args);
  4270. }));
  4271. });
  4272. }
  4273. getWorkingDirectory() {
  4274. return this.workingDirectory;
  4275. }
  4276. init() {
  4277. return __awaiter(this, void 0, void 0, function* () {
  4278. yield this.execGit(['init', this.workingDirectory]);
  4279. });
  4280. }
  4281. isDetached() {
  4282. return __awaiter(this, void 0, void 0, function* () {
  4283. // Note, this implementation uses "branch --show-current" because
  4284. // "rev-parse --symbolic-full-name HEAD" can fail on a new repo
  4285. // with nothing checked out.
  4286. const output = yield this.execGit(['branch', '--show-current']);
  4287. return output.stdout.trim() === '';
  4288. });
  4289. }
  4290. lfsFetch(ref) {
  4291. return __awaiter(this, void 0, void 0, function* () {
  4292. const args = ['lfs', 'fetch', 'origin', ref];
  4293. const that = this;
  4294. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4295. yield that.execGit(args);
  4296. }));
  4297. });
  4298. }
  4299. lfsInstall() {
  4300. return __awaiter(this, void 0, void 0, function* () {
  4301. yield this.execGit(['lfs', 'install', '--local']);
  4302. });
  4303. }
  4304. log1() {
  4305. return __awaiter(this, void 0, void 0, function* () {
  4306. yield this.execGit(['log', '-1']);
  4307. });
  4308. }
  4309. remoteAdd(remoteName, remoteUrl) {
  4310. return __awaiter(this, void 0, void 0, function* () {
  4311. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4312. });
  4313. }
  4314. tagExists(pattern) {
  4315. return __awaiter(this, void 0, void 0, function* () {
  4316. const output = yield this.execGit(['tag', '--list', pattern]);
  4317. return !!output.stdout.trim();
  4318. });
  4319. }
  4320. tryClean() {
  4321. return __awaiter(this, void 0, void 0, function* () {
  4322. const output = yield this.execGit(['clean', '-ffdx'], true);
  4323. return output.exitCode === 0;
  4324. });
  4325. }
  4326. tryConfigUnset(configKey) {
  4327. return __awaiter(this, void 0, void 0, function* () {
  4328. const output = yield this.execGit(['config', '--unset-all', configKey], true);
  4329. return output.exitCode === 0;
  4330. });
  4331. }
  4332. tryDisableAutomaticGarbageCollection() {
  4333. return __awaiter(this, void 0, void 0, function* () {
  4334. const output = yield this.execGit(['config', 'gc.auto', '0'], true);
  4335. return output.exitCode === 0;
  4336. });
  4337. }
  4338. tryGetFetchUrl() {
  4339. return __awaiter(this, void 0, void 0, function* () {
  4340. const output = yield this.execGit(['config', '--get', 'remote.origin.url'], true);
  4341. if (output.exitCode !== 0) {
  4342. return '';
  4343. }
  4344. const stdout = output.stdout.trim();
  4345. if (stdout.includes('\n')) {
  4346. return '';
  4347. }
  4348. return stdout;
  4349. });
  4350. }
  4351. tryReset() {
  4352. return __awaiter(this, void 0, void 0, function* () {
  4353. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4354. return output.exitCode === 0;
  4355. });
  4356. }
  4357. static createCommandManager(workingDirectory, lfs) {
  4358. return __awaiter(this, void 0, void 0, function* () {
  4359. const result = new GitCommandManager();
  4360. yield result.initializeCommandManager(workingDirectory, lfs);
  4361. return result;
  4362. });
  4363. }
  4364. execGit(args, allowAllExitCodes = false) {
  4365. return __awaiter(this, void 0, void 0, function* () {
  4366. fshelper.directoryExistsSync(this.workingDirectory, true);
  4367. const result = new GitOutput();
  4368. const env = {};
  4369. for (const key of Object.keys(process.env)) {
  4370. env[key] = process.env[key];
  4371. }
  4372. for (const key of Object.keys(this.gitEnv)) {
  4373. env[key] = this.gitEnv[key];
  4374. }
  4375. const stdout = [];
  4376. const options = {
  4377. cwd: this.workingDirectory,
  4378. env,
  4379. ignoreReturnCode: allowAllExitCodes,
  4380. listeners: {
  4381. stdout: (data) => {
  4382. stdout.push(data.toString());
  4383. }
  4384. }
  4385. };
  4386. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4387. result.stdout = stdout.join('');
  4388. return result;
  4389. });
  4390. }
  4391. initializeCommandManager(workingDirectory, lfs) {
  4392. return __awaiter(this, void 0, void 0, function* () {
  4393. this.workingDirectory = workingDirectory;
  4394. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4395. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4396. this.lfs = lfs;
  4397. if (!this.lfs) {
  4398. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4399. }
  4400. this.gitPath = yield io.which('git', true);
  4401. // Git version
  4402. core.debug('Getting git version');
  4403. let gitVersion = new git_version_1.GitVersion();
  4404. let gitOutput = yield this.execGit(['version']);
  4405. let stdout = gitOutput.stdout.trim();
  4406. if (!stdout.includes('\n')) {
  4407. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4408. if (match) {
  4409. gitVersion = new git_version_1.GitVersion(match[0]);
  4410. }
  4411. }
  4412. if (!gitVersion.isValid()) {
  4413. throw new Error('Unable to determine git version');
  4414. }
  4415. // Minimum git version
  4416. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  4417. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4418. }
  4419. if (this.lfs) {
  4420. // Git-lfs version
  4421. core.debug('Getting git-lfs version');
  4422. let gitLfsVersion = new git_version_1.GitVersion();
  4423. const gitLfsPath = yield io.which('git-lfs', true);
  4424. gitOutput = yield this.execGit(['lfs', 'version']);
  4425. stdout = gitOutput.stdout.trim();
  4426. if (!stdout.includes('\n')) {
  4427. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4428. if (match) {
  4429. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4430. }
  4431. }
  4432. if (!gitLfsVersion.isValid()) {
  4433. throw new Error('Unable to determine git-lfs version');
  4434. }
  4435. // Minimum git-lfs version
  4436. // Note:
  4437. // - Auth header not supported before 2.1
  4438. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4439. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4440. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4441. }
  4442. }
  4443. // Set the user agent
  4444. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4445. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4446. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4447. });
  4448. }
  4449. }
  4450. class GitOutput {
  4451. constructor() {
  4452. this.stdout = '';
  4453. this.exitCode = 0;
  4454. }
  4455. }
  4456. /***/ }),
  4457. /***/ 293:
  4458. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4459. "use strict";
  4460. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4461. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4462. return new (P || (P = Promise))(function (resolve, reject) {
  4463. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4464. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4465. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4466. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4467. });
  4468. };
  4469. var __importStar = (this && this.__importStar) || function (mod) {
  4470. if (mod && mod.__esModule) return mod;
  4471. var result = {};
  4472. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4473. result["default"] = mod;
  4474. return result;
  4475. };
  4476. Object.defineProperty(exports, "__esModule", { value: true });
  4477. const core = __importStar(__webpack_require__(470));
  4478. const fs = __importStar(__webpack_require__(747));
  4479. const fsHelper = __importStar(__webpack_require__(618));
  4480. const gitCommandManager = __importStar(__webpack_require__(289));
  4481. const githubApiHelper = __importStar(__webpack_require__(464));
  4482. const io = __importStar(__webpack_require__(1));
  4483. const path = __importStar(__webpack_require__(622));
  4484. const refHelper = __importStar(__webpack_require__(227));
  4485. const stateHelper = __importStar(__webpack_require__(153));
  4486. const authConfigKey = `http.https://github.com/.extraheader`;
  4487. function getSource(settings) {
  4488. return __awaiter(this, void 0, void 0, function* () {
  4489. // Repository URL
  4490. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  4491. const repositoryUrl = `https://github.com/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  4492. // Remove conflicting file path
  4493. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  4494. yield io.rmRF(settings.repositoryPath);
  4495. }
  4496. // Create directory
  4497. let isExisting = true;
  4498. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  4499. isExisting = false;
  4500. yield io.mkdirP(settings.repositoryPath);
  4501. }
  4502. // Git command manager
  4503. const git = yield getGitCommandManager(settings);
  4504. // Prepare existing directory, otherwise recreate
  4505. if (isExisting) {
  4506. yield prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  4507. }
  4508. if (!git) {
  4509. // Downloading using REST API
  4510. core.info(`The repository will be downloaded using the GitHub REST API`);
  4511. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  4512. yield githubApiHelper.downloadRepository(settings.accessToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  4513. }
  4514. else {
  4515. // Save state for POST action
  4516. stateHelper.setRepositoryPath(settings.repositoryPath);
  4517. // Initialize the repository
  4518. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  4519. yield git.init();
  4520. yield git.remoteAdd('origin', repositoryUrl);
  4521. }
  4522. // Disable automatic garbage collection
  4523. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  4524. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  4525. }
  4526. // Remove possible previous extraheader
  4527. yield removeGitConfig(git, authConfigKey);
  4528. // Add extraheader (auth)
  4529. const base64Credentials = Buffer.from(`x-access-token:${settings.accessToken}`, 'utf8').toString('base64');
  4530. core.setSecret(base64Credentials);
  4531. const authConfigValue = `AUTHORIZATION: basic ${base64Credentials}`;
  4532. yield git.config(authConfigKey, authConfigValue);
  4533. // LFS install
  4534. if (settings.lfs) {
  4535. yield git.lfsInstall();
  4536. }
  4537. // Fetch
  4538. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  4539. yield git.fetch(settings.fetchDepth, refSpec);
  4540. // Checkout info
  4541. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  4542. // LFS fetch
  4543. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  4544. // Explicit lfs fetch will fetch lfs objects in parallel.
  4545. if (settings.lfs) {
  4546. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  4547. }
  4548. // Checkout
  4549. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  4550. // Dump some info about the checked out commit
  4551. yield git.log1();
  4552. }
  4553. });
  4554. }
  4555. exports.getSource = getSource;
  4556. function cleanup(repositoryPath) {
  4557. return __awaiter(this, void 0, void 0, function* () {
  4558. // Repo exists?
  4559. if (!fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  4560. return;
  4561. }
  4562. fsHelper.directoryExistsSync(repositoryPath, true);
  4563. // Remove the config key
  4564. const git = yield gitCommandManager.CreateCommandManager(repositoryPath, false);
  4565. yield removeGitConfig(git, authConfigKey);
  4566. });
  4567. }
  4568. exports.cleanup = cleanup;
  4569. function getGitCommandManager(settings) {
  4570. return __awaiter(this, void 0, void 0, function* () {
  4571. core.info(`Working directory is '${settings.repositoryPath}'`);
  4572. let git = null;
  4573. try {
  4574. return yield gitCommandManager.CreateCommandManager(settings.repositoryPath, settings.lfs);
  4575. }
  4576. catch (err) {
  4577. // Git is required for LFS
  4578. if (settings.lfs) {
  4579. throw err;
  4580. }
  4581. // Otherwise fallback to REST API
  4582. return null;
  4583. }
  4584. });
  4585. }
  4586. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  4587. return __awaiter(this, void 0, void 0, function* () {
  4588. let remove = false;
  4589. // Check whether using git or REST API
  4590. if (!git) {
  4591. remove = true;
  4592. }
  4593. // Fetch URL does not match
  4594. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  4595. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  4596. remove = true;
  4597. }
  4598. else {
  4599. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  4600. const lockPaths = [
  4601. path.join(repositoryPath, '.git', 'index.lock'),
  4602. path.join(repositoryPath, '.git', 'shallow.lock')
  4603. ];
  4604. for (const lockPath of lockPaths) {
  4605. try {
  4606. yield io.rmRF(lockPath);
  4607. }
  4608. catch (error) {
  4609. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  4610. }
  4611. }
  4612. try {
  4613. // Checkout detached HEAD
  4614. if (!(yield git.isDetached())) {
  4615. yield git.checkoutDetach();
  4616. }
  4617. // Remove all refs/heads/*
  4618. let branches = yield git.branchList(false);
  4619. for (const branch of branches) {
  4620. yield git.branchDelete(false, branch);
  4621. }
  4622. // Remove all refs/remotes/origin/* to avoid conflicts
  4623. branches = yield git.branchList(true);
  4624. for (const branch of branches) {
  4625. yield git.branchDelete(true, branch);
  4626. }
  4627. // Clean
  4628. if (clean) {
  4629. if (!(yield git.tryClean())) {
  4630. 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}'.`);
  4631. remove = true;
  4632. }
  4633. else if (!(yield git.tryReset())) {
  4634. remove = true;
  4635. }
  4636. if (remove) {
  4637. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  4638. }
  4639. }
  4640. }
  4641. catch (error) {
  4642. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  4643. remove = true;
  4644. }
  4645. }
  4646. if (remove) {
  4647. // Delete the contents of the directory. Don't delete the directory itself
  4648. // since it might be the current working directory.
  4649. core.info(`Deleting the contents of '${repositoryPath}'`);
  4650. for (const file of yield fs.promises.readdir(repositoryPath)) {
  4651. yield io.rmRF(path.join(repositoryPath, file));
  4652. }
  4653. }
  4654. });
  4655. }
  4656. function removeGitConfig(git, configKey) {
  4657. return __awaiter(this, void 0, void 0, function* () {
  4658. if ((yield git.configExists(configKey)) &&
  4659. !(yield git.tryConfigUnset(configKey))) {
  4660. // Load the config contents
  4661. core.warning(`Failed to remove '${configKey}' from the git config. Attempting to remove the config value by editing the file directly.`);
  4662. const configPath = path.join(git.getWorkingDirectory(), '.git', 'config');
  4663. fsHelper.fileExistsSync(configPath);
  4664. let contents = fs.readFileSync(configPath).toString() || '';
  4665. // Filter - only includes lines that do not contain the config key
  4666. const upperConfigKey = configKey.toUpperCase();
  4667. const split = contents
  4668. .split('\n')
  4669. .filter(x => !x.toUpperCase().includes(upperConfigKey));
  4670. contents = split.join('\n');
  4671. // Rewrite the config file
  4672. fs.writeFileSync(configPath, contents);
  4673. }
  4674. });
  4675. }
  4676. /***/ }),
  4677. /***/ 294:
  4678. /***/ (function(module, __unusedexports, __webpack_require__) {
  4679. module.exports = parseOptions;
  4680. const { Deprecation } = __webpack_require__(692);
  4681. const { getUserAgent } = __webpack_require__(796);
  4682. const once = __webpack_require__(969);
  4683. const pkg = __webpack_require__(215);
  4684. const deprecateOptionsTimeout = once((log, deprecation) =>
  4685. log.warn(deprecation)
  4686. );
  4687. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  4688. const deprecateOptionsHeaders = once((log, deprecation) =>
  4689. log.warn(deprecation)
  4690. );
  4691. function parseOptions(options, log, hook) {
  4692. if (options.headers) {
  4693. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  4694. newObj[key.toLowerCase()] = options.headers[key];
  4695. return newObj;
  4696. }, {});
  4697. }
  4698. const clientDefaults = {
  4699. headers: options.headers || {},
  4700. request: options.request || {},
  4701. mediaType: {
  4702. previews: [],
  4703. format: ""
  4704. }
  4705. };
  4706. if (options.baseUrl) {
  4707. clientDefaults.baseUrl = options.baseUrl;
  4708. }
  4709. if (options.userAgent) {
  4710. clientDefaults.headers["user-agent"] = options.userAgent;
  4711. }
  4712. if (options.previews) {
  4713. clientDefaults.mediaType.previews = options.previews;
  4714. }
  4715. if (options.timeZone) {
  4716. clientDefaults.headers["time-zone"] = options.timeZone;
  4717. }
  4718. if (options.timeout) {
  4719. deprecateOptionsTimeout(
  4720. log,
  4721. new Deprecation(
  4722. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  4723. )
  4724. );
  4725. clientDefaults.request.timeout = options.timeout;
  4726. }
  4727. if (options.agent) {
  4728. deprecateOptionsAgent(
  4729. log,
  4730. new Deprecation(
  4731. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  4732. )
  4733. );
  4734. clientDefaults.request.agent = options.agent;
  4735. }
  4736. if (options.headers) {
  4737. deprecateOptionsHeaders(
  4738. log,
  4739. new Deprecation(
  4740. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  4741. )
  4742. );
  4743. }
  4744. const userAgentOption = clientDefaults.headers["user-agent"];
  4745. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  4746. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  4747. .filter(Boolean)
  4748. .join(" ");
  4749. clientDefaults.request.hook = hook.bind(null, "request");
  4750. return clientDefaults;
  4751. }
  4752. /***/ }),
  4753. /***/ 297:
  4754. /***/ (function(module) {
  4755. module.exports = class HttpError extends Error {
  4756. constructor (message, code, headers) {
  4757. super(message)
  4758. // Maintains proper stack trace (only available on V8)
  4759. /* istanbul ignore next */
  4760. if (Error.captureStackTrace) {
  4761. Error.captureStackTrace(this, this.constructor)
  4762. }
  4763. this.name = 'HttpError'
  4764. this.code = code
  4765. this.headers = headers
  4766. }
  4767. }
  4768. /***/ }),
  4769. /***/ 301:
  4770. /***/ (function(module, __unusedexports, __webpack_require__) {
  4771. /**
  4772. * Some “list” response that can be paginated have a different response structure
  4773. *
  4774. * They have a `total_count` key in the response (search also has `incomplete_results`,
  4775. * /installation/repositories also has `repository_selection`), as well as a key with
  4776. * the list of the items which name varies from endpoint to endpoint:
  4777. *
  4778. * - https://developer.github.com/v3/search/#example (key `items`)
  4779. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  4780. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  4781. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  4782. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  4783. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  4784. *
  4785. * Octokit normalizes these responses so that paginated results are always returned following
  4786. * the same structure. One challenge is that if the list response has only one page, no Link
  4787. * header is provided, so this header alone is not sufficient to check wether a response is
  4788. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  4789. * paths has to be added in order to normalize the response. We cannot check for the total_count
  4790. * property because it also exists in the response of Get the combined status for a specific ref.
  4791. */
  4792. module.exports = normalizePaginatedListResponse;
  4793. const { Deprecation } = __webpack_require__(692);
  4794. const once = __webpack_require__(969);
  4795. const deprecateIncompleteResults = once((log, deprecation) =>
  4796. log.warn(deprecation)
  4797. );
  4798. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  4799. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  4800. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  4801. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  4802. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  4803. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  4804. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  4805. function normalizePaginatedListResponse(octokit, url, response) {
  4806. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  4807. if (
  4808. !REGEX_IS_SEARCH_PATH.test(path) &&
  4809. !REGEX_IS_CHECKS_PATH.test(path) &&
  4810. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  4811. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  4812. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  4813. ) {
  4814. return;
  4815. }
  4816. // keep the additional properties intact to avoid a breaking change,
  4817. // but log a deprecation warning when accessed
  4818. const incompleteResults = response.data.incomplete_results;
  4819. const repositorySelection = response.data.repository_selection;
  4820. const totalCount = response.data.total_count;
  4821. delete response.data.incomplete_results;
  4822. delete response.data.repository_selection;
  4823. delete response.data.total_count;
  4824. const namespaceKey = Object.keys(response.data)[0];
  4825. response.data = response.data[namespaceKey];
  4826. Object.defineProperty(response.data, namespaceKey, {
  4827. get() {
  4828. deprecateNamespace(
  4829. octokit.log,
  4830. new Deprecation(
  4831. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  4832. )
  4833. );
  4834. return response.data;
  4835. }
  4836. });
  4837. if (typeof incompleteResults !== "undefined") {
  4838. Object.defineProperty(response.data, "incomplete_results", {
  4839. get() {
  4840. deprecateIncompleteResults(
  4841. octokit.log,
  4842. new Deprecation(
  4843. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  4844. )
  4845. );
  4846. return incompleteResults;
  4847. }
  4848. });
  4849. }
  4850. if (typeof repositorySelection !== "undefined") {
  4851. Object.defineProperty(response.data, "repository_selection", {
  4852. get() {
  4853. deprecateTotalCount(
  4854. octokit.log,
  4855. new Deprecation(
  4856. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  4857. )
  4858. );
  4859. return repositorySelection;
  4860. }
  4861. });
  4862. }
  4863. Object.defineProperty(response.data, "total_count", {
  4864. get() {
  4865. deprecateTotalCount(
  4866. octokit.log,
  4867. new Deprecation(
  4868. '[@octokit/rest] "result.data.total_count" is deprecated.'
  4869. )
  4870. );
  4871. return totalCount;
  4872. }
  4873. });
  4874. }
  4875. /***/ }),
  4876. /***/ 323:
  4877. /***/ (function(module) {
  4878. "use strict";
  4879. var isStream = module.exports = function (stream) {
  4880. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  4881. };
  4882. isStream.writable = function (stream) {
  4883. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  4884. };
  4885. isStream.readable = function (stream) {
  4886. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  4887. };
  4888. isStream.duplex = function (stream) {
  4889. return isStream.writable(stream) && isStream.readable(stream);
  4890. };
  4891. isStream.transform = function (stream) {
  4892. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  4893. };
  4894. /***/ }),
  4895. /***/ 336:
  4896. /***/ (function(module, __unusedexports, __webpack_require__) {
  4897. module.exports = hasLastPage
  4898. const deprecate = __webpack_require__(370)
  4899. const getPageLinks = __webpack_require__(577)
  4900. function hasLastPage (link) {
  4901. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  4902. return getPageLinks(link).last
  4903. }
  4904. /***/ }),
  4905. /***/ 348:
  4906. /***/ (function(module, __unusedexports, __webpack_require__) {
  4907. "use strict";
  4908. module.exports = validate;
  4909. const { RequestError } = __webpack_require__(463);
  4910. const get = __webpack_require__(854);
  4911. const set = __webpack_require__(883);
  4912. function validate(octokit, options) {
  4913. if (!options.request.validate) {
  4914. return;
  4915. }
  4916. const { validate: params } = options.request;
  4917. Object.keys(params).forEach(parameterName => {
  4918. const parameter = get(params, parameterName);
  4919. const expectedType = parameter.type;
  4920. let parentParameterName;
  4921. let parentValue;
  4922. let parentParamIsPresent = true;
  4923. let parentParameterIsArray = false;
  4924. if (/\./.test(parameterName)) {
  4925. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  4926. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  4927. if (parentParameterIsArray) {
  4928. parentParameterName = parentParameterName.slice(0, -2);
  4929. }
  4930. parentValue = get(options, parentParameterName);
  4931. parentParamIsPresent =
  4932. parentParameterName === "headers" ||
  4933. (typeof parentValue === "object" && parentValue !== null);
  4934. }
  4935. const values = parentParameterIsArray
  4936. ? (get(options, parentParameterName) || []).map(
  4937. value => value[parameterName.split(/\./).pop()]
  4938. )
  4939. : [get(options, parameterName)];
  4940. values.forEach((value, i) => {
  4941. const valueIsPresent = typeof value !== "undefined";
  4942. const valueIsNull = value === null;
  4943. const currentParameterName = parentParameterIsArray
  4944. ? parameterName.replace(/\[\]/, `[${i}]`)
  4945. : parameterName;
  4946. if (!parameter.required && !valueIsPresent) {
  4947. return;
  4948. }
  4949. // if the parent parameter is of type object but allows null
  4950. // then the child parameters can be ignored
  4951. if (!parentParamIsPresent) {
  4952. return;
  4953. }
  4954. if (parameter.allowNull && valueIsNull) {
  4955. return;
  4956. }
  4957. if (!parameter.allowNull && valueIsNull) {
  4958. throw new RequestError(
  4959. `'${currentParameterName}' cannot be null`,
  4960. 400,
  4961. {
  4962. request: options
  4963. }
  4964. );
  4965. }
  4966. if (parameter.required && !valueIsPresent) {
  4967. throw new RequestError(
  4968. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  4969. value
  4970. )}`,
  4971. 400,
  4972. {
  4973. request: options
  4974. }
  4975. );
  4976. }
  4977. // parse to integer before checking for enum
  4978. // so that string "1" will match enum with number 1
  4979. if (expectedType === "integer") {
  4980. const unparsedValue = value;
  4981. value = parseInt(value, 10);
  4982. if (isNaN(value)) {
  4983. throw new RequestError(
  4984. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4985. unparsedValue
  4986. )} is NaN`,
  4987. 400,
  4988. {
  4989. request: options
  4990. }
  4991. );
  4992. }
  4993. }
  4994. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  4995. throw new RequestError(
  4996. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  4997. value
  4998. )}`,
  4999. 400,
  5000. {
  5001. request: options
  5002. }
  5003. );
  5004. }
  5005. if (parameter.validation) {
  5006. const regex = new RegExp(parameter.validation);
  5007. if (!regex.test(value)) {
  5008. throw new RequestError(
  5009. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5010. value
  5011. )}`,
  5012. 400,
  5013. {
  5014. request: options
  5015. }
  5016. );
  5017. }
  5018. }
  5019. if (expectedType === "object" && typeof value === "string") {
  5020. try {
  5021. value = JSON.parse(value);
  5022. } catch (exception) {
  5023. throw new RequestError(
  5024. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5025. value
  5026. )}`,
  5027. 400,
  5028. {
  5029. request: options
  5030. }
  5031. );
  5032. }
  5033. }
  5034. set(options, parameter.mapTo || currentParameterName, value);
  5035. });
  5036. });
  5037. return options;
  5038. }
  5039. /***/ }),
  5040. /***/ 349:
  5041. /***/ (function(module, __unusedexports, __webpack_require__) {
  5042. module.exports = authenticationRequestError;
  5043. const { RequestError } = __webpack_require__(463);
  5044. function authenticationRequestError(state, error, options) {
  5045. /* istanbul ignore next */
  5046. if (!error.headers) throw error;
  5047. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5048. // handle "2FA required" error only
  5049. if (error.status !== 401 || !otpRequired) {
  5050. throw error;
  5051. }
  5052. if (
  5053. error.status === 401 &&
  5054. otpRequired &&
  5055. error.request &&
  5056. error.request.headers["x-github-otp"]
  5057. ) {
  5058. throw new RequestError(
  5059. "Invalid one-time password for two-factor authentication",
  5060. 401,
  5061. {
  5062. headers: error.headers,
  5063. request: options
  5064. }
  5065. );
  5066. }
  5067. if (typeof state.auth.on2fa !== "function") {
  5068. throw new RequestError(
  5069. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5070. 401,
  5071. {
  5072. headers: error.headers,
  5073. request: options
  5074. }
  5075. );
  5076. }
  5077. return Promise.resolve()
  5078. .then(() => {
  5079. return state.auth.on2fa();
  5080. })
  5081. .then(oneTimePassword => {
  5082. const newOptions = Object.assign(options, {
  5083. headers: Object.assign(
  5084. { "x-github-otp": oneTimePassword },
  5085. options.headers
  5086. )
  5087. });
  5088. return state.octokit.request(newOptions);
  5089. });
  5090. }
  5091. /***/ }),
  5092. /***/ 357:
  5093. /***/ (function(module) {
  5094. module.exports = require("assert");
  5095. /***/ }),
  5096. /***/ 363:
  5097. /***/ (function(module) {
  5098. module.exports = register
  5099. function register (state, name, method, options) {
  5100. if (typeof method !== 'function') {
  5101. throw new Error('method for before hook must be a function')
  5102. }
  5103. if (!options) {
  5104. options = {}
  5105. }
  5106. if (Array.isArray(name)) {
  5107. return name.reverse().reduce(function (callback, name) {
  5108. return register.bind(null, state, name, callback, options)
  5109. }, method)()
  5110. }
  5111. return Promise.resolve()
  5112. .then(function () {
  5113. if (!state.registry[name]) {
  5114. return method(options)
  5115. }
  5116. return (state.registry[name]).reduce(function (method, registered) {
  5117. return registered.hook.bind(null, method, options)
  5118. }, method)()
  5119. })
  5120. }
  5121. /***/ }),
  5122. /***/ 368:
  5123. /***/ (function(module) {
  5124. module.exports = function atob(str) {
  5125. return Buffer.from(str, 'base64').toString('binary')
  5126. }
  5127. /***/ }),
  5128. /***/ 370:
  5129. /***/ (function(module) {
  5130. module.exports = deprecate
  5131. const loggedMessages = {}
  5132. function deprecate (message) {
  5133. if (loggedMessages[message]) {
  5134. return
  5135. }
  5136. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5137. loggedMessages[message] = 1
  5138. }
  5139. /***/ }),
  5140. /***/ 372:
  5141. /***/ (function(module) {
  5142. module.exports = octokitDebug;
  5143. function octokitDebug(octokit) {
  5144. octokit.hook.wrap("request", (request, options) => {
  5145. octokit.log.debug("request", options);
  5146. const start = Date.now();
  5147. const requestOptions = octokit.request.endpoint.parse(options);
  5148. const path = requestOptions.url.replace(options.baseUrl, "");
  5149. return request(options)
  5150. .then(response => {
  5151. octokit.log.info(
  5152. `${requestOptions.method} ${path} - ${
  5153. response.status
  5154. } in ${Date.now() - start}ms`
  5155. );
  5156. return response;
  5157. })
  5158. .catch(error => {
  5159. octokit.log.info(
  5160. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5161. start}ms`
  5162. );
  5163. throw error;
  5164. });
  5165. });
  5166. }
  5167. /***/ }),
  5168. /***/ 385:
  5169. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5170. "use strict";
  5171. Object.defineProperty(exports, '__esModule', { value: true });
  5172. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5173. var isPlainObject = _interopDefault(__webpack_require__(696));
  5174. var universalUserAgent = __webpack_require__(796);
  5175. function lowercaseKeys(object) {
  5176. if (!object) {
  5177. return {};
  5178. }
  5179. return Object.keys(object).reduce((newObj, key) => {
  5180. newObj[key.toLowerCase()] = object[key];
  5181. return newObj;
  5182. }, {});
  5183. }
  5184. function mergeDeep(defaults, options) {
  5185. const result = Object.assign({}, defaults);
  5186. Object.keys(options).forEach(key => {
  5187. if (isPlainObject(options[key])) {
  5188. if (!(key in defaults)) Object.assign(result, {
  5189. [key]: options[key]
  5190. });else result[key] = mergeDeep(defaults[key], options[key]);
  5191. } else {
  5192. Object.assign(result, {
  5193. [key]: options[key]
  5194. });
  5195. }
  5196. });
  5197. return result;
  5198. }
  5199. function merge(defaults, route, options) {
  5200. if (typeof route === "string") {
  5201. let [method, url] = route.split(" ");
  5202. options = Object.assign(url ? {
  5203. method,
  5204. url
  5205. } : {
  5206. url: method
  5207. }, options);
  5208. } else {
  5209. options = Object.assign({}, route);
  5210. } // lowercase header names before merging with defaults to avoid duplicates
  5211. options.headers = lowercaseKeys(options.headers);
  5212. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5213. if (defaults && defaults.mediaType.previews.length) {
  5214. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5215. }
  5216. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5217. return mergedOptions;
  5218. }
  5219. function addQueryParameters(url, parameters) {
  5220. const separator = /\?/.test(url) ? "&" : "?";
  5221. const names = Object.keys(parameters);
  5222. if (names.length === 0) {
  5223. return url;
  5224. }
  5225. return url + separator + names.map(name => {
  5226. if (name === "q") {
  5227. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5228. }
  5229. return `${name}=${encodeURIComponent(parameters[name])}`;
  5230. }).join("&");
  5231. }
  5232. const urlVariableRegex = /\{[^}]+\}/g;
  5233. function removeNonChars(variableName) {
  5234. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5235. }
  5236. function extractUrlVariableNames(url) {
  5237. const matches = url.match(urlVariableRegex);
  5238. if (!matches) {
  5239. return [];
  5240. }
  5241. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5242. }
  5243. function omit(object, keysToOmit) {
  5244. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5245. obj[key] = object[key];
  5246. return obj;
  5247. }, {});
  5248. }
  5249. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5250. // TODO: create separate package.
  5251. //
  5252. // Copyright (c) 2012-2014, Bram Stein
  5253. // All rights reserved.
  5254. // Redistribution and use in source and binary forms, with or without
  5255. // modification, are permitted provided that the following conditions
  5256. // are met:
  5257. // 1. Redistributions of source code must retain the above copyright
  5258. // notice, this list of conditions and the following disclaimer.
  5259. // 2. Redistributions in binary form must reproduce the above copyright
  5260. // notice, this list of conditions and the following disclaimer in the
  5261. // documentation and/or other materials provided with the distribution.
  5262. // 3. The name of the author may not be used to endorse or promote products
  5263. // derived from this software without specific prior written permission.
  5264. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5265. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5266. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5267. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5268. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5269. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5270. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5271. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5272. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5273. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5274. /* istanbul ignore file */
  5275. function encodeReserved(str) {
  5276. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5277. if (!/%[0-9A-Fa-f]/.test(part)) {
  5278. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5279. }
  5280. return part;
  5281. }).join("");
  5282. }
  5283. function encodeUnreserved(str) {
  5284. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5285. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5286. });
  5287. }
  5288. function encodeValue(operator, value, key) {
  5289. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5290. if (key) {
  5291. return encodeUnreserved(key) + "=" + value;
  5292. } else {
  5293. return value;
  5294. }
  5295. }
  5296. function isDefined(value) {
  5297. return value !== undefined && value !== null;
  5298. }
  5299. function isKeyOperator(operator) {
  5300. return operator === ";" || operator === "&" || operator === "?";
  5301. }
  5302. function getValues(context, operator, key, modifier) {
  5303. var value = context[key],
  5304. result = [];
  5305. if (isDefined(value) && value !== "") {
  5306. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5307. value = value.toString();
  5308. if (modifier && modifier !== "*") {
  5309. value = value.substring(0, parseInt(modifier, 10));
  5310. }
  5311. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5312. } else {
  5313. if (modifier === "*") {
  5314. if (Array.isArray(value)) {
  5315. value.filter(isDefined).forEach(function (value) {
  5316. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5317. });
  5318. } else {
  5319. Object.keys(value).forEach(function (k) {
  5320. if (isDefined(value[k])) {
  5321. result.push(encodeValue(operator, value[k], k));
  5322. }
  5323. });
  5324. }
  5325. } else {
  5326. const tmp = [];
  5327. if (Array.isArray(value)) {
  5328. value.filter(isDefined).forEach(function (value) {
  5329. tmp.push(encodeValue(operator, value));
  5330. });
  5331. } else {
  5332. Object.keys(value).forEach(function (k) {
  5333. if (isDefined(value[k])) {
  5334. tmp.push(encodeUnreserved(k));
  5335. tmp.push(encodeValue(operator, value[k].toString()));
  5336. }
  5337. });
  5338. }
  5339. if (isKeyOperator(operator)) {
  5340. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5341. } else if (tmp.length !== 0) {
  5342. result.push(tmp.join(","));
  5343. }
  5344. }
  5345. }
  5346. } else {
  5347. if (operator === ";") {
  5348. if (isDefined(value)) {
  5349. result.push(encodeUnreserved(key));
  5350. }
  5351. } else if (value === "" && (operator === "&" || operator === "?")) {
  5352. result.push(encodeUnreserved(key) + "=");
  5353. } else if (value === "") {
  5354. result.push("");
  5355. }
  5356. }
  5357. return result;
  5358. }
  5359. function parseUrl(template) {
  5360. return {
  5361. expand: expand.bind(null, template)
  5362. };
  5363. }
  5364. function expand(template, context) {
  5365. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5366. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5367. if (expression) {
  5368. let operator = "";
  5369. const values = [];
  5370. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5371. operator = expression.charAt(0);
  5372. expression = expression.substr(1);
  5373. }
  5374. expression.split(/,/g).forEach(function (variable) {
  5375. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5376. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5377. });
  5378. if (operator && operator !== "+") {
  5379. var separator = ",";
  5380. if (operator === "?") {
  5381. separator = "&";
  5382. } else if (operator !== "#") {
  5383. separator = operator;
  5384. }
  5385. return (values.length !== 0 ? operator : "") + values.join(separator);
  5386. } else {
  5387. return values.join(",");
  5388. }
  5389. } else {
  5390. return encodeReserved(literal);
  5391. }
  5392. });
  5393. }
  5394. function parse(options) {
  5395. // https://fetch.spec.whatwg.org/#methods
  5396. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5397. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5398. let headers = Object.assign({}, options.headers);
  5399. let body;
  5400. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5401. const urlVariableNames = extractUrlVariableNames(url);
  5402. url = parseUrl(url).expand(parameters);
  5403. if (!/^http/.test(url)) {
  5404. url = options.baseUrl + url;
  5405. }
  5406. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5407. const remainingParameters = omit(parameters, omittedParameters);
  5408. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5409. if (!isBinaryRequset) {
  5410. if (options.mediaType.format) {
  5411. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5412. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5413. }
  5414. if (options.mediaType.previews.length) {
  5415. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5416. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5417. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5418. return `application/vnd.github.${preview}-preview${format}`;
  5419. }).join(",");
  5420. }
  5421. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5422. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5423. if (["GET", "HEAD"].includes(method)) {
  5424. url = addQueryParameters(url, remainingParameters);
  5425. } else {
  5426. if ("data" in remainingParameters) {
  5427. body = remainingParameters.data;
  5428. } else {
  5429. if (Object.keys(remainingParameters).length) {
  5430. body = remainingParameters;
  5431. } else {
  5432. headers["content-length"] = 0;
  5433. }
  5434. }
  5435. } // default content-type for JSON if body is set
  5436. if (!headers["content-type"] && typeof body !== "undefined") {
  5437. headers["content-type"] = "application/json; charset=utf-8";
  5438. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5439. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5440. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5441. body = "";
  5442. } // Only return body/request keys if present
  5443. return Object.assign({
  5444. method,
  5445. url,
  5446. headers
  5447. }, typeof body !== "undefined" ? {
  5448. body
  5449. } : null, options.request ? {
  5450. request: options.request
  5451. } : null);
  5452. }
  5453. function endpointWithDefaults(defaults, route, options) {
  5454. return parse(merge(defaults, route, options));
  5455. }
  5456. function withDefaults(oldDefaults, newDefaults) {
  5457. const DEFAULTS = merge(oldDefaults, newDefaults);
  5458. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5459. return Object.assign(endpoint, {
  5460. DEFAULTS,
  5461. defaults: withDefaults.bind(null, DEFAULTS),
  5462. merge: merge.bind(null, DEFAULTS),
  5463. parse
  5464. });
  5465. }
  5466. const VERSION = "5.5.1";
  5467. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  5468. // So we use RequestParameters and add method as additional required property.
  5469. const DEFAULTS = {
  5470. method: "GET",
  5471. baseUrl: "https://api.github.com",
  5472. headers: {
  5473. accept: "application/vnd.github.v3+json",
  5474. "user-agent": userAgent
  5475. },
  5476. mediaType: {
  5477. format: "",
  5478. previews: []
  5479. }
  5480. };
  5481. const endpoint = withDefaults(null, DEFAULTS);
  5482. exports.endpoint = endpoint;
  5483. //# sourceMappingURL=index.js.map
  5484. /***/ }),
  5485. /***/ 389:
  5486. /***/ (function(module, __unusedexports, __webpack_require__) {
  5487. "use strict";
  5488. const fs = __webpack_require__(747);
  5489. const shebangCommand = __webpack_require__(866);
  5490. function readShebang(command) {
  5491. // Read the first 150 bytes from the file
  5492. const size = 150;
  5493. let buffer;
  5494. if (Buffer.alloc) {
  5495. // Node.js v4.5+ / v5.10+
  5496. buffer = Buffer.alloc(size);
  5497. } else {
  5498. // Old Node.js API
  5499. buffer = new Buffer(size);
  5500. buffer.fill(0); // zero-fill
  5501. }
  5502. let fd;
  5503. try {
  5504. fd = fs.openSync(command, 'r');
  5505. fs.readSync(fd, buffer, 0, size, 0);
  5506. fs.closeSync(fd);
  5507. } catch (e) { /* Empty */ }
  5508. // Attempt to extract shebang (null is returned if not a shebang)
  5509. return shebangCommand(buffer.toString());
  5510. }
  5511. module.exports = readShebang;
  5512. /***/ }),
  5513. /***/ 402:
  5514. /***/ (function(module, __unusedexports, __webpack_require__) {
  5515. module.exports = Octokit;
  5516. const { request } = __webpack_require__(753);
  5517. const Hook = __webpack_require__(523);
  5518. const parseClientOptions = __webpack_require__(294);
  5519. function Octokit(plugins, options) {
  5520. options = options || {};
  5521. const hook = new Hook.Collection();
  5522. const log = Object.assign(
  5523. {
  5524. debug: () => {},
  5525. info: () => {},
  5526. warn: console.warn,
  5527. error: console.error
  5528. },
  5529. options && options.log
  5530. );
  5531. const api = {
  5532. hook,
  5533. log,
  5534. request: request.defaults(parseClientOptions(options, log, hook))
  5535. };
  5536. plugins.forEach(pluginFunction => pluginFunction(api, options));
  5537. return api;
  5538. }
  5539. /***/ }),
  5540. /***/ 413:
  5541. /***/ (function(module) {
  5542. module.exports = require("stream");
  5543. /***/ }),
  5544. /***/ 417:
  5545. /***/ (function(module) {
  5546. module.exports = require("crypto");
  5547. /***/ }),
  5548. /***/ 427:
  5549. /***/ (function(module, __unusedexports, __webpack_require__) {
  5550. "use strict";
  5551. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  5552. // In that case, fall back to a deprecated internal.
  5553. const util = __webpack_require__(669);
  5554. let uv;
  5555. if (typeof util.getSystemErrorName === 'function') {
  5556. module.exports = util.getSystemErrorName;
  5557. } else {
  5558. try {
  5559. uv = process.binding('uv');
  5560. if (typeof uv.errname !== 'function') {
  5561. throw new TypeError('uv.errname is not a function');
  5562. }
  5563. } catch (err) {
  5564. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  5565. uv = null;
  5566. }
  5567. module.exports = code => errname(uv, code);
  5568. }
  5569. // Used for testing the fallback behavior
  5570. module.exports.__test__ = errname;
  5571. function errname(uv, code) {
  5572. if (uv) {
  5573. return uv.errname(code);
  5574. }
  5575. if (!(code < 0)) {
  5576. throw new Error('err >= 0');
  5577. }
  5578. return `Unknown system error ${code}`;
  5579. }
  5580. /***/ }),
  5581. /***/ 430:
  5582. /***/ (function(module, __unusedexports, __webpack_require__) {
  5583. module.exports = octokitValidate;
  5584. const validate = __webpack_require__(348);
  5585. function octokitValidate(octokit) {
  5586. octokit.hook.before("request", validate.bind(null, octokit));
  5587. }
  5588. /***/ }),
  5589. /***/ 431:
  5590. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5591. "use strict";
  5592. Object.defineProperty(exports, "__esModule", { value: true });
  5593. const os = __webpack_require__(87);
  5594. /**
  5595. * Commands
  5596. *
  5597. * Command Format:
  5598. * ##[name key=value;key=value]message
  5599. *
  5600. * Examples:
  5601. * ##[warning]This is the user warning message
  5602. * ##[set-secret name=mypassword]definitelyNotAPassword!
  5603. */
  5604. function issueCommand(command, properties, message) {
  5605. const cmd = new Command(command, properties, message);
  5606. process.stdout.write(cmd.toString() + os.EOL);
  5607. }
  5608. exports.issueCommand = issueCommand;
  5609. function issue(name, message = '') {
  5610. issueCommand(name, {}, message);
  5611. }
  5612. exports.issue = issue;
  5613. const CMD_STRING = '::';
  5614. class Command {
  5615. constructor(command, properties, message) {
  5616. if (!command) {
  5617. command = 'missing.command';
  5618. }
  5619. this.command = command;
  5620. this.properties = properties;
  5621. this.message = message;
  5622. }
  5623. toString() {
  5624. let cmdStr = CMD_STRING + this.command;
  5625. if (this.properties && Object.keys(this.properties).length > 0) {
  5626. cmdStr += ' ';
  5627. for (const key in this.properties) {
  5628. if (this.properties.hasOwnProperty(key)) {
  5629. const val = this.properties[key];
  5630. if (val) {
  5631. // safely append the val - avoid blowing up when attempting to
  5632. // call .replace() if message is not a string for some reason
  5633. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  5634. }
  5635. }
  5636. }
  5637. }
  5638. cmdStr += CMD_STRING;
  5639. // safely append the message - avoid blowing up when attempting to
  5640. // call .replace() if message is not a string for some reason
  5641. const message = `${this.message || ''}`;
  5642. cmdStr += escapeData(message);
  5643. return cmdStr;
  5644. }
  5645. }
  5646. function escapeData(s) {
  5647. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  5648. }
  5649. function escape(s) {
  5650. return s
  5651. .replace(/\r/g, '%0D')
  5652. .replace(/\n/g, '%0A')
  5653. .replace(/]/g, '%5D')
  5654. .replace(/;/g, '%3B');
  5655. }
  5656. //# sourceMappingURL=command.js.map
  5657. /***/ }),
  5658. /***/ 453:
  5659. /***/ (function(module, __unusedexports, __webpack_require__) {
  5660. var once = __webpack_require__(969)
  5661. var eos = __webpack_require__(562)
  5662. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  5663. var noop = function () {}
  5664. var ancient = /^v?\.0/.test(process.version)
  5665. var isFn = function (fn) {
  5666. return typeof fn === 'function'
  5667. }
  5668. var isFS = function (stream) {
  5669. if (!ancient) return false // newer node version do not need to care about fs is a special way
  5670. if (!fs) return false // browser
  5671. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  5672. }
  5673. var isRequest = function (stream) {
  5674. return stream.setHeader && isFn(stream.abort)
  5675. }
  5676. var destroyer = function (stream, reading, writing, callback) {
  5677. callback = once(callback)
  5678. var closed = false
  5679. stream.on('close', function () {
  5680. closed = true
  5681. })
  5682. eos(stream, {readable: reading, writable: writing}, function (err) {
  5683. if (err) return callback(err)
  5684. closed = true
  5685. callback()
  5686. })
  5687. var destroyed = false
  5688. return function (err) {
  5689. if (closed) return
  5690. if (destroyed) return
  5691. destroyed = true
  5692. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  5693. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  5694. if (isFn(stream.destroy)) return stream.destroy()
  5695. callback(err || new Error('stream was destroyed'))
  5696. }
  5697. }
  5698. var call = function (fn) {
  5699. fn()
  5700. }
  5701. var pipe = function (from, to) {
  5702. return from.pipe(to)
  5703. }
  5704. var pump = function () {
  5705. var streams = Array.prototype.slice.call(arguments)
  5706. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  5707. if (Array.isArray(streams[0])) streams = streams[0]
  5708. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  5709. var error
  5710. var destroys = streams.map(function (stream, i) {
  5711. var reading = i < streams.length - 1
  5712. var writing = i > 0
  5713. return destroyer(stream, reading, writing, function (err) {
  5714. if (!error) error = err
  5715. if (err) destroys.forEach(call)
  5716. if (reading) return
  5717. destroys.forEach(call)
  5718. callback(error)
  5719. })
  5720. })
  5721. return streams.reduce(pipe)
  5722. }
  5723. module.exports = pump
  5724. /***/ }),
  5725. /***/ 454:
  5726. /***/ (function(module, exports, __webpack_require__) {
  5727. "use strict";
  5728. Object.defineProperty(exports, '__esModule', { value: true });
  5729. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5730. var Stream = _interopDefault(__webpack_require__(413));
  5731. var http = _interopDefault(__webpack_require__(605));
  5732. var Url = _interopDefault(__webpack_require__(835));
  5733. var https = _interopDefault(__webpack_require__(211));
  5734. var zlib = _interopDefault(__webpack_require__(761));
  5735. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  5736. // fix for "Readable" isn't a named export issue
  5737. const Readable = Stream.Readable;
  5738. const BUFFER = Symbol('buffer');
  5739. const TYPE = Symbol('type');
  5740. class Blob {
  5741. constructor() {
  5742. this[TYPE] = '';
  5743. const blobParts = arguments[0];
  5744. const options = arguments[1];
  5745. const buffers = [];
  5746. let size = 0;
  5747. if (blobParts) {
  5748. const a = blobParts;
  5749. const length = Number(a.length);
  5750. for (let i = 0; i < length; i++) {
  5751. const element = a[i];
  5752. let buffer;
  5753. if (element instanceof Buffer) {
  5754. buffer = element;
  5755. } else if (ArrayBuffer.isView(element)) {
  5756. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  5757. } else if (element instanceof ArrayBuffer) {
  5758. buffer = Buffer.from(element);
  5759. } else if (element instanceof Blob) {
  5760. buffer = element[BUFFER];
  5761. } else {
  5762. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  5763. }
  5764. size += buffer.length;
  5765. buffers.push(buffer);
  5766. }
  5767. }
  5768. this[BUFFER] = Buffer.concat(buffers);
  5769. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  5770. if (type && !/[^\u0020-\u007E]/.test(type)) {
  5771. this[TYPE] = type;
  5772. }
  5773. }
  5774. get size() {
  5775. return this[BUFFER].length;
  5776. }
  5777. get type() {
  5778. return this[TYPE];
  5779. }
  5780. text() {
  5781. return Promise.resolve(this[BUFFER].toString());
  5782. }
  5783. arrayBuffer() {
  5784. const buf = this[BUFFER];
  5785. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5786. return Promise.resolve(ab);
  5787. }
  5788. stream() {
  5789. const readable = new Readable();
  5790. readable._read = function () {};
  5791. readable.push(this[BUFFER]);
  5792. readable.push(null);
  5793. return readable;
  5794. }
  5795. toString() {
  5796. return '[object Blob]';
  5797. }
  5798. slice() {
  5799. const size = this.size;
  5800. const start = arguments[0];
  5801. const end = arguments[1];
  5802. let relativeStart, relativeEnd;
  5803. if (start === undefined) {
  5804. relativeStart = 0;
  5805. } else if (start < 0) {
  5806. relativeStart = Math.max(size + start, 0);
  5807. } else {
  5808. relativeStart = Math.min(start, size);
  5809. }
  5810. if (end === undefined) {
  5811. relativeEnd = size;
  5812. } else if (end < 0) {
  5813. relativeEnd = Math.max(size + end, 0);
  5814. } else {
  5815. relativeEnd = Math.min(end, size);
  5816. }
  5817. const span = Math.max(relativeEnd - relativeStart, 0);
  5818. const buffer = this[BUFFER];
  5819. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  5820. const blob = new Blob([], { type: arguments[2] });
  5821. blob[BUFFER] = slicedBuffer;
  5822. return blob;
  5823. }
  5824. }
  5825. Object.defineProperties(Blob.prototype, {
  5826. size: { enumerable: true },
  5827. type: { enumerable: true },
  5828. slice: { enumerable: true }
  5829. });
  5830. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  5831. value: 'Blob',
  5832. writable: false,
  5833. enumerable: false,
  5834. configurable: true
  5835. });
  5836. /**
  5837. * fetch-error.js
  5838. *
  5839. * FetchError interface for operational errors
  5840. */
  5841. /**
  5842. * Create FetchError instance
  5843. *
  5844. * @param String message Error message for human
  5845. * @param String type Error type for machine
  5846. * @param String systemError For Node.js system error
  5847. * @return FetchError
  5848. */
  5849. function FetchError(message, type, systemError) {
  5850. Error.call(this, message);
  5851. this.message = message;
  5852. this.type = type;
  5853. // when err.type is `system`, err.code contains system error code
  5854. if (systemError) {
  5855. this.code = this.errno = systemError.code;
  5856. }
  5857. // hide custom error implementation details from end-users
  5858. Error.captureStackTrace(this, this.constructor);
  5859. }
  5860. FetchError.prototype = Object.create(Error.prototype);
  5861. FetchError.prototype.constructor = FetchError;
  5862. FetchError.prototype.name = 'FetchError';
  5863. let convert;
  5864. try {
  5865. convert = __webpack_require__(18).convert;
  5866. } catch (e) {}
  5867. const INTERNALS = Symbol('Body internals');
  5868. // fix an issue where "PassThrough" isn't a named export for node <10
  5869. const PassThrough = Stream.PassThrough;
  5870. /**
  5871. * Body mixin
  5872. *
  5873. * Ref: https://fetch.spec.whatwg.org/#body
  5874. *
  5875. * @param Stream body Readable stream
  5876. * @param Object opts Response options
  5877. * @return Void
  5878. */
  5879. function Body(body) {
  5880. var _this = this;
  5881. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  5882. _ref$size = _ref.size;
  5883. let size = _ref$size === undefined ? 0 : _ref$size;
  5884. var _ref$timeout = _ref.timeout;
  5885. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  5886. if (body == null) {
  5887. // body is undefined or null
  5888. body = null;
  5889. } else if (isURLSearchParams(body)) {
  5890. // body is a URLSearchParams
  5891. body = Buffer.from(body.toString());
  5892. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  5893. // body is ArrayBuffer
  5894. body = Buffer.from(body);
  5895. } else if (ArrayBuffer.isView(body)) {
  5896. // body is ArrayBufferView
  5897. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  5898. } else if (body instanceof Stream) ; else {
  5899. // none of the above
  5900. // coerce to string then buffer
  5901. body = Buffer.from(String(body));
  5902. }
  5903. this[INTERNALS] = {
  5904. body,
  5905. disturbed: false,
  5906. error: null
  5907. };
  5908. this.size = size;
  5909. this.timeout = timeout;
  5910. if (body instanceof Stream) {
  5911. body.on('error', function (err) {
  5912. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  5913. _this[INTERNALS].error = error;
  5914. });
  5915. }
  5916. }
  5917. Body.prototype = {
  5918. get body() {
  5919. return this[INTERNALS].body;
  5920. },
  5921. get bodyUsed() {
  5922. return this[INTERNALS].disturbed;
  5923. },
  5924. /**
  5925. * Decode response as ArrayBuffer
  5926. *
  5927. * @return Promise
  5928. */
  5929. arrayBuffer() {
  5930. return consumeBody.call(this).then(function (buf) {
  5931. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  5932. });
  5933. },
  5934. /**
  5935. * Return raw response as Blob
  5936. *
  5937. * @return Promise
  5938. */
  5939. blob() {
  5940. let ct = this.headers && this.headers.get('content-type') || '';
  5941. return consumeBody.call(this).then(function (buf) {
  5942. return Object.assign(
  5943. // Prevent copying
  5944. new Blob([], {
  5945. type: ct.toLowerCase()
  5946. }), {
  5947. [BUFFER]: buf
  5948. });
  5949. });
  5950. },
  5951. /**
  5952. * Decode response as json
  5953. *
  5954. * @return Promise
  5955. */
  5956. json() {
  5957. var _this2 = this;
  5958. return consumeBody.call(this).then(function (buffer) {
  5959. try {
  5960. return JSON.parse(buffer.toString());
  5961. } catch (err) {
  5962. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  5963. }
  5964. });
  5965. },
  5966. /**
  5967. * Decode response as text
  5968. *
  5969. * @return Promise
  5970. */
  5971. text() {
  5972. return consumeBody.call(this).then(function (buffer) {
  5973. return buffer.toString();
  5974. });
  5975. },
  5976. /**
  5977. * Decode response as buffer (non-spec api)
  5978. *
  5979. * @return Promise
  5980. */
  5981. buffer() {
  5982. return consumeBody.call(this);
  5983. },
  5984. /**
  5985. * Decode response as text, while automatically detecting the encoding and
  5986. * trying to decode to UTF-8 (non-spec api)
  5987. *
  5988. * @return Promise
  5989. */
  5990. textConverted() {
  5991. var _this3 = this;
  5992. return consumeBody.call(this).then(function (buffer) {
  5993. return convertBody(buffer, _this3.headers);
  5994. });
  5995. }
  5996. };
  5997. // In browsers, all properties are enumerable.
  5998. Object.defineProperties(Body.prototype, {
  5999. body: { enumerable: true },
  6000. bodyUsed: { enumerable: true },
  6001. arrayBuffer: { enumerable: true },
  6002. blob: { enumerable: true },
  6003. json: { enumerable: true },
  6004. text: { enumerable: true }
  6005. });
  6006. Body.mixIn = function (proto) {
  6007. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6008. // istanbul ignore else: future proof
  6009. if (!(name in proto)) {
  6010. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6011. Object.defineProperty(proto, name, desc);
  6012. }
  6013. }
  6014. };
  6015. /**
  6016. * Consume and convert an entire Body to a Buffer.
  6017. *
  6018. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6019. *
  6020. * @return Promise
  6021. */
  6022. function consumeBody() {
  6023. var _this4 = this;
  6024. if (this[INTERNALS].disturbed) {
  6025. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6026. }
  6027. this[INTERNALS].disturbed = true;
  6028. if (this[INTERNALS].error) {
  6029. return Body.Promise.reject(this[INTERNALS].error);
  6030. }
  6031. let body = this.body;
  6032. // body is null
  6033. if (body === null) {
  6034. return Body.Promise.resolve(Buffer.alloc(0));
  6035. }
  6036. // body is blob
  6037. if (isBlob(body)) {
  6038. body = body.stream();
  6039. }
  6040. // body is buffer
  6041. if (Buffer.isBuffer(body)) {
  6042. return Body.Promise.resolve(body);
  6043. }
  6044. // istanbul ignore if: should never happen
  6045. if (!(body instanceof Stream)) {
  6046. return Body.Promise.resolve(Buffer.alloc(0));
  6047. }
  6048. // body is stream
  6049. // get ready to actually consume the body
  6050. let accum = [];
  6051. let accumBytes = 0;
  6052. let abort = false;
  6053. return new Body.Promise(function (resolve, reject) {
  6054. let resTimeout;
  6055. // allow timeout on slow response body
  6056. if (_this4.timeout) {
  6057. resTimeout = setTimeout(function () {
  6058. abort = true;
  6059. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6060. }, _this4.timeout);
  6061. }
  6062. // handle stream errors
  6063. body.on('error', function (err) {
  6064. if (err.name === 'AbortError') {
  6065. // if the request was aborted, reject with this Error
  6066. abort = true;
  6067. reject(err);
  6068. } else {
  6069. // other errors, such as incorrect content-encoding
  6070. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6071. }
  6072. });
  6073. body.on('data', function (chunk) {
  6074. if (abort || chunk === null) {
  6075. return;
  6076. }
  6077. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6078. abort = true;
  6079. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6080. return;
  6081. }
  6082. accumBytes += chunk.length;
  6083. accum.push(chunk);
  6084. });
  6085. body.on('end', function () {
  6086. if (abort) {
  6087. return;
  6088. }
  6089. clearTimeout(resTimeout);
  6090. try {
  6091. resolve(Buffer.concat(accum, accumBytes));
  6092. } catch (err) {
  6093. // handle streams that have accumulated too much data (issue #414)
  6094. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6095. }
  6096. });
  6097. });
  6098. }
  6099. /**
  6100. * Detect buffer encoding and convert to target encoding
  6101. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6102. *
  6103. * @param Buffer buffer Incoming buffer
  6104. * @param String encoding Target encoding
  6105. * @return String
  6106. */
  6107. function convertBody(buffer, headers) {
  6108. if (typeof convert !== 'function') {
  6109. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6110. }
  6111. const ct = headers.get('content-type');
  6112. let charset = 'utf-8';
  6113. let res, str;
  6114. // header
  6115. if (ct) {
  6116. res = /charset=([^;]*)/i.exec(ct);
  6117. }
  6118. // no charset in content type, peek at response body for at most 1024 bytes
  6119. str = buffer.slice(0, 1024).toString();
  6120. // html5
  6121. if (!res && str) {
  6122. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6123. }
  6124. // html4
  6125. if (!res && str) {
  6126. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6127. if (res) {
  6128. res = /charset=(.*)/i.exec(res.pop());
  6129. }
  6130. }
  6131. // xml
  6132. if (!res && str) {
  6133. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6134. }
  6135. // found charset
  6136. if (res) {
  6137. charset = res.pop();
  6138. // prevent decode issues when sites use incorrect encoding
  6139. // ref: https://hsivonen.fi/encoding-menu/
  6140. if (charset === 'gb2312' || charset === 'gbk') {
  6141. charset = 'gb18030';
  6142. }
  6143. }
  6144. // turn raw buffers into a single utf-8 buffer
  6145. return convert(buffer, 'UTF-8', charset).toString();
  6146. }
  6147. /**
  6148. * Detect a URLSearchParams object
  6149. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6150. *
  6151. * @param Object obj Object to detect by type or brand
  6152. * @return String
  6153. */
  6154. function isURLSearchParams(obj) {
  6155. // Duck-typing as a necessary condition.
  6156. 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') {
  6157. return false;
  6158. }
  6159. // Brand-checking and more duck-typing as optional condition.
  6160. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6161. }
  6162. /**
  6163. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6164. * @param {*} obj
  6165. * @return {boolean}
  6166. */
  6167. function isBlob(obj) {
  6168. 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]);
  6169. }
  6170. /**
  6171. * Clone body given Res/Req instance
  6172. *
  6173. * @param Mixed instance Response or Request instance
  6174. * @return Mixed
  6175. */
  6176. function clone(instance) {
  6177. let p1, p2;
  6178. let body = instance.body;
  6179. // don't allow cloning a used body
  6180. if (instance.bodyUsed) {
  6181. throw new Error('cannot clone body after it is used');
  6182. }
  6183. // check that body is a stream and not form-data object
  6184. // note: we can't clone the form-data object without having it as a dependency
  6185. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6186. // tee instance body
  6187. p1 = new PassThrough();
  6188. p2 = new PassThrough();
  6189. body.pipe(p1);
  6190. body.pipe(p2);
  6191. // set instance body to teed body and return the other teed body
  6192. instance[INTERNALS].body = p1;
  6193. body = p2;
  6194. }
  6195. return body;
  6196. }
  6197. /**
  6198. * Performs the operation "extract a `Content-Type` value from |object|" as
  6199. * specified in the specification:
  6200. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6201. *
  6202. * This function assumes that instance.body is present.
  6203. *
  6204. * @param Mixed instance Any options.body input
  6205. */
  6206. function extractContentType(body) {
  6207. if (body === null) {
  6208. // body is null
  6209. return null;
  6210. } else if (typeof body === 'string') {
  6211. // body is string
  6212. return 'text/plain;charset=UTF-8';
  6213. } else if (isURLSearchParams(body)) {
  6214. // body is a URLSearchParams
  6215. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6216. } else if (isBlob(body)) {
  6217. // body is blob
  6218. return body.type || null;
  6219. } else if (Buffer.isBuffer(body)) {
  6220. // body is buffer
  6221. return null;
  6222. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6223. // body is ArrayBuffer
  6224. return null;
  6225. } else if (ArrayBuffer.isView(body)) {
  6226. // body is ArrayBufferView
  6227. return null;
  6228. } else if (typeof body.getBoundary === 'function') {
  6229. // detect form data input from form-data module
  6230. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6231. } else if (body instanceof Stream) {
  6232. // body is stream
  6233. // can't really do much about this
  6234. return null;
  6235. } else {
  6236. // Body constructor defaults other things to string
  6237. return 'text/plain;charset=UTF-8';
  6238. }
  6239. }
  6240. /**
  6241. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6242. * For us, we have to explicitly get it with a function.
  6243. *
  6244. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6245. *
  6246. * @param Body instance Instance of Body
  6247. * @return Number? Number of bytes, or null if not possible
  6248. */
  6249. function getTotalBytes(instance) {
  6250. const body = instance.body;
  6251. if (body === null) {
  6252. // body is null
  6253. return 0;
  6254. } else if (isBlob(body)) {
  6255. return body.size;
  6256. } else if (Buffer.isBuffer(body)) {
  6257. // body is buffer
  6258. return body.length;
  6259. } else if (body && typeof body.getLengthSync === 'function') {
  6260. // detect form data input from form-data module
  6261. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6262. body.hasKnownLength && body.hasKnownLength()) {
  6263. // 2.x
  6264. return body.getLengthSync();
  6265. }
  6266. return null;
  6267. } else {
  6268. // body is stream
  6269. return null;
  6270. }
  6271. }
  6272. /**
  6273. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6274. *
  6275. * @param Body instance Instance of Body
  6276. * @return Void
  6277. */
  6278. function writeToStream(dest, instance) {
  6279. const body = instance.body;
  6280. if (body === null) {
  6281. // body is null
  6282. dest.end();
  6283. } else if (isBlob(body)) {
  6284. body.stream().pipe(dest);
  6285. } else if (Buffer.isBuffer(body)) {
  6286. // body is buffer
  6287. dest.write(body);
  6288. dest.end();
  6289. } else {
  6290. // body is stream
  6291. body.pipe(dest);
  6292. }
  6293. }
  6294. // expose Promise
  6295. Body.Promise = global.Promise;
  6296. /**
  6297. * headers.js
  6298. *
  6299. * Headers class offers convenient helpers
  6300. */
  6301. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6302. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6303. function validateName(name) {
  6304. name = `${name}`;
  6305. if (invalidTokenRegex.test(name) || name === '') {
  6306. throw new TypeError(`${name} is not a legal HTTP header name`);
  6307. }
  6308. }
  6309. function validateValue(value) {
  6310. value = `${value}`;
  6311. if (invalidHeaderCharRegex.test(value)) {
  6312. throw new TypeError(`${value} is not a legal HTTP header value`);
  6313. }
  6314. }
  6315. /**
  6316. * Find the key in the map object given a header name.
  6317. *
  6318. * Returns undefined if not found.
  6319. *
  6320. * @param String name Header name
  6321. * @return String|Undefined
  6322. */
  6323. function find(map, name) {
  6324. name = name.toLowerCase();
  6325. for (const key in map) {
  6326. if (key.toLowerCase() === name) {
  6327. return key;
  6328. }
  6329. }
  6330. return undefined;
  6331. }
  6332. const MAP = Symbol('map');
  6333. class Headers {
  6334. /**
  6335. * Headers class
  6336. *
  6337. * @param Object headers Response headers
  6338. * @return Void
  6339. */
  6340. constructor() {
  6341. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6342. this[MAP] = Object.create(null);
  6343. if (init instanceof Headers) {
  6344. const rawHeaders = init.raw();
  6345. const headerNames = Object.keys(rawHeaders);
  6346. for (const headerName of headerNames) {
  6347. for (const value of rawHeaders[headerName]) {
  6348. this.append(headerName, value);
  6349. }
  6350. }
  6351. return;
  6352. }
  6353. // We don't worry about converting prop to ByteString here as append()
  6354. // will handle it.
  6355. if (init == null) ; else if (typeof init === 'object') {
  6356. const method = init[Symbol.iterator];
  6357. if (method != null) {
  6358. if (typeof method !== 'function') {
  6359. throw new TypeError('Header pairs must be iterable');
  6360. }
  6361. // sequence<sequence<ByteString>>
  6362. // Note: per spec we have to first exhaust the lists then process them
  6363. const pairs = [];
  6364. for (const pair of init) {
  6365. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  6366. throw new TypeError('Each header pair must be iterable');
  6367. }
  6368. pairs.push(Array.from(pair));
  6369. }
  6370. for (const pair of pairs) {
  6371. if (pair.length !== 2) {
  6372. throw new TypeError('Each header pair must be a name/value tuple');
  6373. }
  6374. this.append(pair[0], pair[1]);
  6375. }
  6376. } else {
  6377. // record<ByteString, ByteString>
  6378. for (const key of Object.keys(init)) {
  6379. const value = init[key];
  6380. this.append(key, value);
  6381. }
  6382. }
  6383. } else {
  6384. throw new TypeError('Provided initializer must be an object');
  6385. }
  6386. }
  6387. /**
  6388. * Return combined header value given name
  6389. *
  6390. * @param String name Header name
  6391. * @return Mixed
  6392. */
  6393. get(name) {
  6394. name = `${name}`;
  6395. validateName(name);
  6396. const key = find(this[MAP], name);
  6397. if (key === undefined) {
  6398. return null;
  6399. }
  6400. return this[MAP][key].join(', ');
  6401. }
  6402. /**
  6403. * Iterate over all headers
  6404. *
  6405. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  6406. * @param Boolean thisArg `this` context for callback function
  6407. * @return Void
  6408. */
  6409. forEach(callback) {
  6410. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  6411. let pairs = getHeaders(this);
  6412. let i = 0;
  6413. while (i < pairs.length) {
  6414. var _pairs$i = pairs[i];
  6415. const name = _pairs$i[0],
  6416. value = _pairs$i[1];
  6417. callback.call(thisArg, value, name, this);
  6418. pairs = getHeaders(this);
  6419. i++;
  6420. }
  6421. }
  6422. /**
  6423. * Overwrite header values given name
  6424. *
  6425. * @param String name Header name
  6426. * @param String value Header value
  6427. * @return Void
  6428. */
  6429. set(name, value) {
  6430. name = `${name}`;
  6431. value = `${value}`;
  6432. validateName(name);
  6433. validateValue(value);
  6434. const key = find(this[MAP], name);
  6435. this[MAP][key !== undefined ? key : name] = [value];
  6436. }
  6437. /**
  6438. * Append a value onto existing header
  6439. *
  6440. * @param String name Header name
  6441. * @param String value Header value
  6442. * @return Void
  6443. */
  6444. append(name, value) {
  6445. name = `${name}`;
  6446. value = `${value}`;
  6447. validateName(name);
  6448. validateValue(value);
  6449. const key = find(this[MAP], name);
  6450. if (key !== undefined) {
  6451. this[MAP][key].push(value);
  6452. } else {
  6453. this[MAP][name] = [value];
  6454. }
  6455. }
  6456. /**
  6457. * Check for header name existence
  6458. *
  6459. * @param String name Header name
  6460. * @return Boolean
  6461. */
  6462. has(name) {
  6463. name = `${name}`;
  6464. validateName(name);
  6465. return find(this[MAP], name) !== undefined;
  6466. }
  6467. /**
  6468. * Delete all header values given name
  6469. *
  6470. * @param String name Header name
  6471. * @return Void
  6472. */
  6473. delete(name) {
  6474. name = `${name}`;
  6475. validateName(name);
  6476. const key = find(this[MAP], name);
  6477. if (key !== undefined) {
  6478. delete this[MAP][key];
  6479. }
  6480. }
  6481. /**
  6482. * Return raw headers (non-spec api)
  6483. *
  6484. * @return Object
  6485. */
  6486. raw() {
  6487. return this[MAP];
  6488. }
  6489. /**
  6490. * Get an iterator on keys.
  6491. *
  6492. * @return Iterator
  6493. */
  6494. keys() {
  6495. return createHeadersIterator(this, 'key');
  6496. }
  6497. /**
  6498. * Get an iterator on values.
  6499. *
  6500. * @return Iterator
  6501. */
  6502. values() {
  6503. return createHeadersIterator(this, 'value');
  6504. }
  6505. /**
  6506. * Get an iterator on entries.
  6507. *
  6508. * This is the default iterator of the Headers object.
  6509. *
  6510. * @return Iterator
  6511. */
  6512. [Symbol.iterator]() {
  6513. return createHeadersIterator(this, 'key+value');
  6514. }
  6515. }
  6516. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  6517. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  6518. value: 'Headers',
  6519. writable: false,
  6520. enumerable: false,
  6521. configurable: true
  6522. });
  6523. Object.defineProperties(Headers.prototype, {
  6524. get: { enumerable: true },
  6525. forEach: { enumerable: true },
  6526. set: { enumerable: true },
  6527. append: { enumerable: true },
  6528. has: { enumerable: true },
  6529. delete: { enumerable: true },
  6530. keys: { enumerable: true },
  6531. values: { enumerable: true },
  6532. entries: { enumerable: true }
  6533. });
  6534. function getHeaders(headers) {
  6535. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  6536. const keys = Object.keys(headers[MAP]).sort();
  6537. return keys.map(kind === 'key' ? function (k) {
  6538. return k.toLowerCase();
  6539. } : kind === 'value' ? function (k) {
  6540. return headers[MAP][k].join(', ');
  6541. } : function (k) {
  6542. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  6543. });
  6544. }
  6545. const INTERNAL = Symbol('internal');
  6546. function createHeadersIterator(target, kind) {
  6547. const iterator = Object.create(HeadersIteratorPrototype);
  6548. iterator[INTERNAL] = {
  6549. target,
  6550. kind,
  6551. index: 0
  6552. };
  6553. return iterator;
  6554. }
  6555. const HeadersIteratorPrototype = Object.setPrototypeOf({
  6556. next() {
  6557. // istanbul ignore if
  6558. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  6559. throw new TypeError('Value of `this` is not a HeadersIterator');
  6560. }
  6561. var _INTERNAL = this[INTERNAL];
  6562. const target = _INTERNAL.target,
  6563. kind = _INTERNAL.kind,
  6564. index = _INTERNAL.index;
  6565. const values = getHeaders(target, kind);
  6566. const len = values.length;
  6567. if (index >= len) {
  6568. return {
  6569. value: undefined,
  6570. done: true
  6571. };
  6572. }
  6573. this[INTERNAL].index = index + 1;
  6574. return {
  6575. value: values[index],
  6576. done: false
  6577. };
  6578. }
  6579. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  6580. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  6581. value: 'HeadersIterator',
  6582. writable: false,
  6583. enumerable: false,
  6584. configurable: true
  6585. });
  6586. /**
  6587. * Export the Headers object in a form that Node.js can consume.
  6588. *
  6589. * @param Headers headers
  6590. * @return Object
  6591. */
  6592. function exportNodeCompatibleHeaders(headers) {
  6593. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  6594. // http.request() only supports string as Host header. This hack makes
  6595. // specifying custom Host header possible.
  6596. const hostHeaderKey = find(headers[MAP], 'Host');
  6597. if (hostHeaderKey !== undefined) {
  6598. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  6599. }
  6600. return obj;
  6601. }
  6602. /**
  6603. * Create a Headers object from an object of headers, ignoring those that do
  6604. * not conform to HTTP grammar productions.
  6605. *
  6606. * @param Object obj Object of headers
  6607. * @return Headers
  6608. */
  6609. function createHeadersLenient(obj) {
  6610. const headers = new Headers();
  6611. for (const name of Object.keys(obj)) {
  6612. if (invalidTokenRegex.test(name)) {
  6613. continue;
  6614. }
  6615. if (Array.isArray(obj[name])) {
  6616. for (const val of obj[name]) {
  6617. if (invalidHeaderCharRegex.test(val)) {
  6618. continue;
  6619. }
  6620. if (headers[MAP][name] === undefined) {
  6621. headers[MAP][name] = [val];
  6622. } else {
  6623. headers[MAP][name].push(val);
  6624. }
  6625. }
  6626. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  6627. headers[MAP][name] = [obj[name]];
  6628. }
  6629. }
  6630. return headers;
  6631. }
  6632. const INTERNALS$1 = Symbol('Response internals');
  6633. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  6634. const STATUS_CODES = http.STATUS_CODES;
  6635. /**
  6636. * Response class
  6637. *
  6638. * @param Stream body Readable stream
  6639. * @param Object opts Response options
  6640. * @return Void
  6641. */
  6642. class Response {
  6643. constructor() {
  6644. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  6645. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6646. Body.call(this, body, opts);
  6647. const status = opts.status || 200;
  6648. const headers = new Headers(opts.headers);
  6649. if (body != null && !headers.has('Content-Type')) {
  6650. const contentType = extractContentType(body);
  6651. if (contentType) {
  6652. headers.append('Content-Type', contentType);
  6653. }
  6654. }
  6655. this[INTERNALS$1] = {
  6656. url: opts.url,
  6657. status,
  6658. statusText: opts.statusText || STATUS_CODES[status],
  6659. headers,
  6660. counter: opts.counter
  6661. };
  6662. }
  6663. get url() {
  6664. return this[INTERNALS$1].url || '';
  6665. }
  6666. get status() {
  6667. return this[INTERNALS$1].status;
  6668. }
  6669. /**
  6670. * Convenience property representing if the request ended normally
  6671. */
  6672. get ok() {
  6673. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  6674. }
  6675. get redirected() {
  6676. return this[INTERNALS$1].counter > 0;
  6677. }
  6678. get statusText() {
  6679. return this[INTERNALS$1].statusText;
  6680. }
  6681. get headers() {
  6682. return this[INTERNALS$1].headers;
  6683. }
  6684. /**
  6685. * Clone this response
  6686. *
  6687. * @return Response
  6688. */
  6689. clone() {
  6690. return new Response(clone(this), {
  6691. url: this.url,
  6692. status: this.status,
  6693. statusText: this.statusText,
  6694. headers: this.headers,
  6695. ok: this.ok,
  6696. redirected: this.redirected
  6697. });
  6698. }
  6699. }
  6700. Body.mixIn(Response.prototype);
  6701. Object.defineProperties(Response.prototype, {
  6702. url: { enumerable: true },
  6703. status: { enumerable: true },
  6704. ok: { enumerable: true },
  6705. redirected: { enumerable: true },
  6706. statusText: { enumerable: true },
  6707. headers: { enumerable: true },
  6708. clone: { enumerable: true }
  6709. });
  6710. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  6711. value: 'Response',
  6712. writable: false,
  6713. enumerable: false,
  6714. configurable: true
  6715. });
  6716. const INTERNALS$2 = Symbol('Request internals');
  6717. // fix an issue where "format", "parse" aren't a named export for node <10
  6718. const parse_url = Url.parse;
  6719. const format_url = Url.format;
  6720. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  6721. /**
  6722. * Check if a value is an instance of Request.
  6723. *
  6724. * @param Mixed input
  6725. * @return Boolean
  6726. */
  6727. function isRequest(input) {
  6728. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  6729. }
  6730. function isAbortSignal(signal) {
  6731. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  6732. return !!(proto && proto.constructor.name === 'AbortSignal');
  6733. }
  6734. /**
  6735. * Request class
  6736. *
  6737. * @param Mixed input Url or Request instance
  6738. * @param Object init Custom options
  6739. * @return Void
  6740. */
  6741. class Request {
  6742. constructor(input) {
  6743. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  6744. let parsedURL;
  6745. // normalize input
  6746. if (!isRequest(input)) {
  6747. if (input && input.href) {
  6748. // in order to support Node.js' Url objects; though WHATWG's URL objects
  6749. // will fall into this branch also (since their `toString()` will return
  6750. // `href` property anyway)
  6751. parsedURL = parse_url(input.href);
  6752. } else {
  6753. // coerce input to a string before attempting to parse
  6754. parsedURL = parse_url(`${input}`);
  6755. }
  6756. input = {};
  6757. } else {
  6758. parsedURL = parse_url(input.url);
  6759. }
  6760. let method = init.method || input.method || 'GET';
  6761. method = method.toUpperCase();
  6762. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  6763. throw new TypeError('Request with GET/HEAD method cannot have body');
  6764. }
  6765. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  6766. Body.call(this, inputBody, {
  6767. timeout: init.timeout || input.timeout || 0,
  6768. size: init.size || input.size || 0
  6769. });
  6770. const headers = new Headers(init.headers || input.headers || {});
  6771. if (inputBody != null && !headers.has('Content-Type')) {
  6772. const contentType = extractContentType(inputBody);
  6773. if (contentType) {
  6774. headers.append('Content-Type', contentType);
  6775. }
  6776. }
  6777. let signal = isRequest(input) ? input.signal : null;
  6778. if ('signal' in init) signal = init.signal;
  6779. if (signal != null && !isAbortSignal(signal)) {
  6780. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  6781. }
  6782. this[INTERNALS$2] = {
  6783. method,
  6784. redirect: init.redirect || input.redirect || 'follow',
  6785. headers,
  6786. parsedURL,
  6787. signal
  6788. };
  6789. // node-fetch-only options
  6790. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  6791. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  6792. this.counter = init.counter || input.counter || 0;
  6793. this.agent = init.agent || input.agent;
  6794. }
  6795. get method() {
  6796. return this[INTERNALS$2].method;
  6797. }
  6798. get url() {
  6799. return format_url(this[INTERNALS$2].parsedURL);
  6800. }
  6801. get headers() {
  6802. return this[INTERNALS$2].headers;
  6803. }
  6804. get redirect() {
  6805. return this[INTERNALS$2].redirect;
  6806. }
  6807. get signal() {
  6808. return this[INTERNALS$2].signal;
  6809. }
  6810. /**
  6811. * Clone this request
  6812. *
  6813. * @return Request
  6814. */
  6815. clone() {
  6816. return new Request(this);
  6817. }
  6818. }
  6819. Body.mixIn(Request.prototype);
  6820. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  6821. value: 'Request',
  6822. writable: false,
  6823. enumerable: false,
  6824. configurable: true
  6825. });
  6826. Object.defineProperties(Request.prototype, {
  6827. method: { enumerable: true },
  6828. url: { enumerable: true },
  6829. headers: { enumerable: true },
  6830. redirect: { enumerable: true },
  6831. clone: { enumerable: true },
  6832. signal: { enumerable: true }
  6833. });
  6834. /**
  6835. * Convert a Request to Node.js http request options.
  6836. *
  6837. * @param Request A Request instance
  6838. * @return Object The options object to be passed to http.request
  6839. */
  6840. function getNodeRequestOptions(request) {
  6841. const parsedURL = request[INTERNALS$2].parsedURL;
  6842. const headers = new Headers(request[INTERNALS$2].headers);
  6843. // fetch step 1.3
  6844. if (!headers.has('Accept')) {
  6845. headers.set('Accept', '*/*');
  6846. }
  6847. // Basic fetch
  6848. if (!parsedURL.protocol || !parsedURL.hostname) {
  6849. throw new TypeError('Only absolute URLs are supported');
  6850. }
  6851. if (!/^https?:$/.test(parsedURL.protocol)) {
  6852. throw new TypeError('Only HTTP(S) protocols are supported');
  6853. }
  6854. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  6855. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  6856. }
  6857. // HTTP-network-or-cache fetch steps 2.4-2.7
  6858. let contentLengthValue = null;
  6859. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  6860. contentLengthValue = '0';
  6861. }
  6862. if (request.body != null) {
  6863. const totalBytes = getTotalBytes(request);
  6864. if (typeof totalBytes === 'number') {
  6865. contentLengthValue = String(totalBytes);
  6866. }
  6867. }
  6868. if (contentLengthValue) {
  6869. headers.set('Content-Length', contentLengthValue);
  6870. }
  6871. // HTTP-network-or-cache fetch step 2.11
  6872. if (!headers.has('User-Agent')) {
  6873. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  6874. }
  6875. // HTTP-network-or-cache fetch step 2.15
  6876. if (request.compress && !headers.has('Accept-Encoding')) {
  6877. headers.set('Accept-Encoding', 'gzip,deflate');
  6878. }
  6879. let agent = request.agent;
  6880. if (typeof agent === 'function') {
  6881. agent = agent(parsedURL);
  6882. }
  6883. if (!headers.has('Connection') && !agent) {
  6884. headers.set('Connection', 'close');
  6885. }
  6886. // HTTP-network fetch step 4.2
  6887. // chunked encoding is handled by Node.js
  6888. return Object.assign({}, parsedURL, {
  6889. method: request.method,
  6890. headers: exportNodeCompatibleHeaders(headers),
  6891. agent
  6892. });
  6893. }
  6894. /**
  6895. * abort-error.js
  6896. *
  6897. * AbortError interface for cancelled requests
  6898. */
  6899. /**
  6900. * Create AbortError instance
  6901. *
  6902. * @param String message Error message for human
  6903. * @return AbortError
  6904. */
  6905. function AbortError(message) {
  6906. Error.call(this, message);
  6907. this.type = 'aborted';
  6908. this.message = message;
  6909. // hide custom error implementation details from end-users
  6910. Error.captureStackTrace(this, this.constructor);
  6911. }
  6912. AbortError.prototype = Object.create(Error.prototype);
  6913. AbortError.prototype.constructor = AbortError;
  6914. AbortError.prototype.name = 'AbortError';
  6915. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  6916. const PassThrough$1 = Stream.PassThrough;
  6917. const resolve_url = Url.resolve;
  6918. /**
  6919. * Fetch function
  6920. *
  6921. * @param Mixed url Absolute url or Request instance
  6922. * @param Object opts Fetch options
  6923. * @return Promise
  6924. */
  6925. function fetch(url, opts) {
  6926. // allow custom promise
  6927. if (!fetch.Promise) {
  6928. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  6929. }
  6930. Body.Promise = fetch.Promise;
  6931. // wrap http.request into fetch
  6932. return new fetch.Promise(function (resolve, reject) {
  6933. // build request object
  6934. const request = new Request(url, opts);
  6935. const options = getNodeRequestOptions(request);
  6936. const send = (options.protocol === 'https:' ? https : http).request;
  6937. const signal = request.signal;
  6938. let response = null;
  6939. const abort = function abort() {
  6940. let error = new AbortError('The user aborted a request.');
  6941. reject(error);
  6942. if (request.body && request.body instanceof Stream.Readable) {
  6943. request.body.destroy(error);
  6944. }
  6945. if (!response || !response.body) return;
  6946. response.body.emit('error', error);
  6947. };
  6948. if (signal && signal.aborted) {
  6949. abort();
  6950. return;
  6951. }
  6952. const abortAndFinalize = function abortAndFinalize() {
  6953. abort();
  6954. finalize();
  6955. };
  6956. // send request
  6957. const req = send(options);
  6958. let reqTimeout;
  6959. if (signal) {
  6960. signal.addEventListener('abort', abortAndFinalize);
  6961. }
  6962. function finalize() {
  6963. req.abort();
  6964. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  6965. clearTimeout(reqTimeout);
  6966. }
  6967. if (request.timeout) {
  6968. req.once('socket', function (socket) {
  6969. reqTimeout = setTimeout(function () {
  6970. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  6971. finalize();
  6972. }, request.timeout);
  6973. });
  6974. }
  6975. req.on('error', function (err) {
  6976. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  6977. finalize();
  6978. });
  6979. req.on('response', function (res) {
  6980. clearTimeout(reqTimeout);
  6981. const headers = createHeadersLenient(res.headers);
  6982. // HTTP fetch step 5
  6983. if (fetch.isRedirect(res.statusCode)) {
  6984. // HTTP fetch step 5.2
  6985. const location = headers.get('Location');
  6986. // HTTP fetch step 5.3
  6987. const locationURL = location === null ? null : resolve_url(request.url, location);
  6988. // HTTP fetch step 5.5
  6989. switch (request.redirect) {
  6990. case 'error':
  6991. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  6992. finalize();
  6993. return;
  6994. case 'manual':
  6995. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  6996. if (locationURL !== null) {
  6997. // handle corrupted header
  6998. try {
  6999. headers.set('Location', locationURL);
  7000. } catch (err) {
  7001. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7002. reject(err);
  7003. }
  7004. }
  7005. break;
  7006. case 'follow':
  7007. // HTTP-redirect fetch step 2
  7008. if (locationURL === null) {
  7009. break;
  7010. }
  7011. // HTTP-redirect fetch step 5
  7012. if (request.counter >= request.follow) {
  7013. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7014. finalize();
  7015. return;
  7016. }
  7017. // HTTP-redirect fetch step 6 (counter increment)
  7018. // Create a new Request object.
  7019. const requestOpts = {
  7020. headers: new Headers(request.headers),
  7021. follow: request.follow,
  7022. counter: request.counter + 1,
  7023. agent: request.agent,
  7024. compress: request.compress,
  7025. method: request.method,
  7026. body: request.body,
  7027. signal: request.signal,
  7028. timeout: request.timeout
  7029. };
  7030. // HTTP-redirect fetch step 9
  7031. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7032. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7033. finalize();
  7034. return;
  7035. }
  7036. // HTTP-redirect fetch step 11
  7037. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7038. requestOpts.method = 'GET';
  7039. requestOpts.body = undefined;
  7040. requestOpts.headers.delete('content-length');
  7041. }
  7042. // HTTP-redirect fetch step 15
  7043. resolve(fetch(new Request(locationURL, requestOpts)));
  7044. finalize();
  7045. return;
  7046. }
  7047. }
  7048. // prepare response
  7049. res.once('end', function () {
  7050. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7051. });
  7052. let body = res.pipe(new PassThrough$1());
  7053. const response_options = {
  7054. url: request.url,
  7055. status: res.statusCode,
  7056. statusText: res.statusMessage,
  7057. headers: headers,
  7058. size: request.size,
  7059. timeout: request.timeout,
  7060. counter: request.counter
  7061. };
  7062. // HTTP-network fetch step 12.1.1.3
  7063. const codings = headers.get('Content-Encoding');
  7064. // HTTP-network fetch step 12.1.1.4: handle content codings
  7065. // in following scenarios we ignore compression support
  7066. // 1. compression support is disabled
  7067. // 2. HEAD request
  7068. // 3. no Content-Encoding header
  7069. // 4. no content response (204)
  7070. // 5. content not modified response (304)
  7071. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7072. response = new Response(body, response_options);
  7073. resolve(response);
  7074. return;
  7075. }
  7076. // For Node v6+
  7077. // Be less strict when decoding compressed responses, since sometimes
  7078. // servers send slightly invalid responses that are still accepted
  7079. // by common browsers.
  7080. // Always using Z_SYNC_FLUSH is what cURL does.
  7081. const zlibOptions = {
  7082. flush: zlib.Z_SYNC_FLUSH,
  7083. finishFlush: zlib.Z_SYNC_FLUSH
  7084. };
  7085. // for gzip
  7086. if (codings == 'gzip' || codings == 'x-gzip') {
  7087. body = body.pipe(zlib.createGunzip(zlibOptions));
  7088. response = new Response(body, response_options);
  7089. resolve(response);
  7090. return;
  7091. }
  7092. // for deflate
  7093. if (codings == 'deflate' || codings == 'x-deflate') {
  7094. // handle the infamous raw deflate response from old servers
  7095. // a hack for old IIS and Apache servers
  7096. const raw = res.pipe(new PassThrough$1());
  7097. raw.once('data', function (chunk) {
  7098. // see http://stackoverflow.com/questions/37519828
  7099. if ((chunk[0] & 0x0F) === 0x08) {
  7100. body = body.pipe(zlib.createInflate());
  7101. } else {
  7102. body = body.pipe(zlib.createInflateRaw());
  7103. }
  7104. response = new Response(body, response_options);
  7105. resolve(response);
  7106. });
  7107. return;
  7108. }
  7109. // for br
  7110. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7111. body = body.pipe(zlib.createBrotliDecompress());
  7112. response = new Response(body, response_options);
  7113. resolve(response);
  7114. return;
  7115. }
  7116. // otherwise, use response as-is
  7117. response = new Response(body, response_options);
  7118. resolve(response);
  7119. });
  7120. writeToStream(req, request);
  7121. });
  7122. }
  7123. /**
  7124. * Redirect code matching
  7125. *
  7126. * @param Number code Status code
  7127. * @return Boolean
  7128. */
  7129. fetch.isRedirect = function (code) {
  7130. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7131. };
  7132. // expose Promise
  7133. fetch.Promise = global.Promise;
  7134. module.exports = exports = fetch;
  7135. Object.defineProperty(exports, "__esModule", { value: true });
  7136. exports.default = exports;
  7137. exports.Headers = Headers;
  7138. exports.Request = Request;
  7139. exports.Response = Response;
  7140. exports.FetchError = FetchError;
  7141. /***/ }),
  7142. /***/ 462:
  7143. /***/ (function(module) {
  7144. "use strict";
  7145. // See http://www.robvanderwoude.com/escapechars.php
  7146. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7147. function escapeCommand(arg) {
  7148. // Escape meta chars
  7149. arg = arg.replace(metaCharsRegExp, '^$1');
  7150. return arg;
  7151. }
  7152. function escapeArgument(arg, doubleEscapeMetaChars) {
  7153. // Convert to string
  7154. arg = `${arg}`;
  7155. // Algorithm below is based on https://qntm.org/cmd
  7156. // Sequence of backslashes followed by a double quote:
  7157. // double up all the backslashes and escape the double quote
  7158. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7159. // Sequence of backslashes followed by the end of the string
  7160. // (which will become a double quote later):
  7161. // double up all the backslashes
  7162. arg = arg.replace(/(\\*)$/, '$1$1');
  7163. // All other backslashes occur literally
  7164. // Quote the whole thing:
  7165. arg = `"${arg}"`;
  7166. // Escape meta chars
  7167. arg = arg.replace(metaCharsRegExp, '^$1');
  7168. // Double escape meta chars if necessary
  7169. if (doubleEscapeMetaChars) {
  7170. arg = arg.replace(metaCharsRegExp, '^$1');
  7171. }
  7172. return arg;
  7173. }
  7174. module.exports.command = escapeCommand;
  7175. module.exports.argument = escapeArgument;
  7176. /***/ }),
  7177. /***/ 463:
  7178. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7179. "use strict";
  7180. Object.defineProperty(exports, '__esModule', { value: true });
  7181. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7182. var deprecation = __webpack_require__(692);
  7183. var once = _interopDefault(__webpack_require__(969));
  7184. const logOnce = once(deprecation => console.warn(deprecation));
  7185. /**
  7186. * Error with extra properties to help with debugging
  7187. */
  7188. class RequestError extends Error {
  7189. constructor(message, statusCode, options) {
  7190. super(message); // Maintains proper stack trace (only available on V8)
  7191. /* istanbul ignore next */
  7192. if (Error.captureStackTrace) {
  7193. Error.captureStackTrace(this, this.constructor);
  7194. }
  7195. this.name = "HttpError";
  7196. this.status = statusCode;
  7197. Object.defineProperty(this, "code", {
  7198. get() {
  7199. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7200. return statusCode;
  7201. }
  7202. });
  7203. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7204. const requestCopy = Object.assign({}, options.request);
  7205. if (options.request.headers.authorization) {
  7206. requestCopy.headers = Object.assign({}, options.request.headers, {
  7207. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7208. });
  7209. }
  7210. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7211. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7212. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7213. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7214. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7215. this.request = requestCopy;
  7216. }
  7217. }
  7218. exports.RequestError = RequestError;
  7219. //# sourceMappingURL=index.js.map
  7220. /***/ }),
  7221. /***/ 464:
  7222. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7223. "use strict";
  7224. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7225. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7226. return new (P || (P = Promise))(function (resolve, reject) {
  7227. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7228. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7229. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7230. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7231. });
  7232. };
  7233. var __importStar = (this && this.__importStar) || function (mod) {
  7234. if (mod && mod.__esModule) return mod;
  7235. var result = {};
  7236. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7237. result["default"] = mod;
  7238. return result;
  7239. };
  7240. var __importDefault = (this && this.__importDefault) || function (mod) {
  7241. return (mod && mod.__esModule) ? mod : { "default": mod };
  7242. };
  7243. Object.defineProperty(exports, "__esModule", { value: true });
  7244. const assert = __importStar(__webpack_require__(357));
  7245. const core = __importStar(__webpack_require__(470));
  7246. const fs = __importStar(__webpack_require__(747));
  7247. const github = __importStar(__webpack_require__(469));
  7248. const io = __importStar(__webpack_require__(1));
  7249. const path = __importStar(__webpack_require__(622));
  7250. const retryHelper = __importStar(__webpack_require__(587));
  7251. const toolCache = __importStar(__webpack_require__(533));
  7252. const v4_1 = __importDefault(__webpack_require__(826));
  7253. const IS_WINDOWS = process.platform === 'win32';
  7254. function downloadRepository(accessToken, owner, repo, ref, commit, repositoryPath) {
  7255. return __awaiter(this, void 0, void 0, function* () {
  7256. // Download the archive
  7257. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7258. core.info('Downloading the archive');
  7259. return yield downloadArchive(accessToken, owner, repo, ref, commit);
  7260. }));
  7261. // Write archive to disk
  7262. core.info('Writing archive to disk');
  7263. const uniqueId = v4_1.default();
  7264. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  7265. yield fs.promises.writeFile(archivePath, archiveData);
  7266. archiveData = Buffer.from(''); // Free memory
  7267. // Extract archive
  7268. core.info('Extracting the archive');
  7269. const extractPath = path.join(repositoryPath, uniqueId);
  7270. yield io.mkdirP(extractPath);
  7271. if (IS_WINDOWS) {
  7272. yield toolCache.extractZip(archivePath, extractPath);
  7273. }
  7274. else {
  7275. yield toolCache.extractTar(archivePath, extractPath);
  7276. }
  7277. io.rmRF(archivePath);
  7278. // Determine the path of the repository content. The archive contains
  7279. // a top-level folder and the repository content is inside.
  7280. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7281. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7282. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  7283. core.info(`Resolved version ${archiveVersion}`);
  7284. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  7285. // Move the files
  7286. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  7287. const sourcePath = path.join(tempRepositoryPath, fileName);
  7288. const targetPath = path.join(repositoryPath, fileName);
  7289. yield io.mv(sourcePath, targetPath);
  7290. }
  7291. io.rmRF(extractPath);
  7292. });
  7293. }
  7294. exports.downloadRepository = downloadRepository;
  7295. function downloadArchive(accessToken, owner, repo, ref, commit) {
  7296. return __awaiter(this, void 0, void 0, function* () {
  7297. const octokit = new github.GitHub(accessToken);
  7298. const params = {
  7299. owner: owner,
  7300. repo: repo,
  7301. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7302. ref: commit || ref
  7303. };
  7304. const response = yield octokit.repos.getArchiveLink(params);
  7305. if (response.status != 200) {
  7306. throw new Error(`Unexpected response from GitHub API. Status: '${response.status}'`);
  7307. }
  7308. return Buffer.from(response.data); // response.data is ArrayBuffer
  7309. });
  7310. }
  7311. /***/ }),
  7312. /***/ 469:
  7313. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7314. "use strict";
  7315. var __importDefault = (this && this.__importDefault) || function (mod) {
  7316. return (mod && mod.__esModule) ? mod : { "default": mod };
  7317. };
  7318. var __importStar = (this && this.__importStar) || function (mod) {
  7319. if (mod && mod.__esModule) return mod;
  7320. var result = {};
  7321. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7322. result["default"] = mod;
  7323. return result;
  7324. };
  7325. Object.defineProperty(exports, "__esModule", { value: true });
  7326. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7327. const graphql_1 = __webpack_require__(898);
  7328. const rest_1 = __importDefault(__webpack_require__(0));
  7329. const Context = __importStar(__webpack_require__(262));
  7330. // We need this in order to extend Octokit
  7331. rest_1.default.prototype = new rest_1.default();
  7332. exports.context = new Context.Context();
  7333. class GitHub extends rest_1.default {
  7334. constructor(token, opts = {}) {
  7335. super(Object.assign(Object.assign({}, opts), { auth: `token ${token}` }));
  7336. this.graphql = graphql_1.graphql.defaults({
  7337. headers: { authorization: `token ${token}` }
  7338. });
  7339. }
  7340. }
  7341. exports.GitHub = GitHub;
  7342. //# sourceMappingURL=github.js.map
  7343. /***/ }),
  7344. /***/ 470:
  7345. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7346. "use strict";
  7347. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7348. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7349. return new (P || (P = Promise))(function (resolve, reject) {
  7350. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7351. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7352. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7353. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7354. });
  7355. };
  7356. Object.defineProperty(exports, "__esModule", { value: true });
  7357. const command_1 = __webpack_require__(431);
  7358. const os = __webpack_require__(87);
  7359. const path = __webpack_require__(622);
  7360. /**
  7361. * The code to exit an action
  7362. */
  7363. var ExitCode;
  7364. (function (ExitCode) {
  7365. /**
  7366. * A code indicating that the action was successful
  7367. */
  7368. ExitCode[ExitCode["Success"] = 0] = "Success";
  7369. /**
  7370. * A code indicating that the action was a failure
  7371. */
  7372. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  7373. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  7374. //-----------------------------------------------------------------------
  7375. // Variables
  7376. //-----------------------------------------------------------------------
  7377. /**
  7378. * Sets env variable for this action and future actions in the job
  7379. * @param name the name of the variable to set
  7380. * @param val the value of the variable
  7381. */
  7382. function exportVariable(name, val) {
  7383. process.env[name] = val;
  7384. command_1.issueCommand('set-env', { name }, val);
  7385. }
  7386. exports.exportVariable = exportVariable;
  7387. /**
  7388. * Registers a secret which will get masked from logs
  7389. * @param secret value of the secret
  7390. */
  7391. function setSecret(secret) {
  7392. command_1.issueCommand('add-mask', {}, secret);
  7393. }
  7394. exports.setSecret = setSecret;
  7395. /**
  7396. * Prepends inputPath to the PATH (for this action and future actions)
  7397. * @param inputPath
  7398. */
  7399. function addPath(inputPath) {
  7400. command_1.issueCommand('add-path', {}, inputPath);
  7401. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  7402. }
  7403. exports.addPath = addPath;
  7404. /**
  7405. * Gets the value of an input. The value is also trimmed.
  7406. *
  7407. * @param name name of the input to get
  7408. * @param options optional. See InputOptions.
  7409. * @returns string
  7410. */
  7411. function getInput(name, options) {
  7412. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  7413. if (options && options.required && !val) {
  7414. throw new Error(`Input required and not supplied: ${name}`);
  7415. }
  7416. return val.trim();
  7417. }
  7418. exports.getInput = getInput;
  7419. /**
  7420. * Sets the value of an output.
  7421. *
  7422. * @param name name of the output to set
  7423. * @param value value to store
  7424. */
  7425. function setOutput(name, value) {
  7426. command_1.issueCommand('set-output', { name }, value);
  7427. }
  7428. exports.setOutput = setOutput;
  7429. //-----------------------------------------------------------------------
  7430. // Results
  7431. //-----------------------------------------------------------------------
  7432. /**
  7433. * Sets the action status to failed.
  7434. * When the action exits it will be with an exit code of 1
  7435. * @param message add error issue message
  7436. */
  7437. function setFailed(message) {
  7438. process.exitCode = ExitCode.Failure;
  7439. error(message);
  7440. }
  7441. exports.setFailed = setFailed;
  7442. //-----------------------------------------------------------------------
  7443. // Logging Commands
  7444. //-----------------------------------------------------------------------
  7445. /**
  7446. * Writes debug message to user log
  7447. * @param message debug message
  7448. */
  7449. function debug(message) {
  7450. command_1.issueCommand('debug', {}, message);
  7451. }
  7452. exports.debug = debug;
  7453. /**
  7454. * Adds an error issue
  7455. * @param message error issue message
  7456. */
  7457. function error(message) {
  7458. command_1.issue('error', message);
  7459. }
  7460. exports.error = error;
  7461. /**
  7462. * Adds an warning issue
  7463. * @param message warning issue message
  7464. */
  7465. function warning(message) {
  7466. command_1.issue('warning', message);
  7467. }
  7468. exports.warning = warning;
  7469. /**
  7470. * Writes info to log with console.log.
  7471. * @param message info message
  7472. */
  7473. function info(message) {
  7474. process.stdout.write(message + os.EOL);
  7475. }
  7476. exports.info = info;
  7477. /**
  7478. * Begin an output group.
  7479. *
  7480. * Output until the next `groupEnd` will be foldable in this group
  7481. *
  7482. * @param name The name of the output group
  7483. */
  7484. function startGroup(name) {
  7485. command_1.issue('group', name);
  7486. }
  7487. exports.startGroup = startGroup;
  7488. /**
  7489. * End an output group.
  7490. */
  7491. function endGroup() {
  7492. command_1.issue('endgroup');
  7493. }
  7494. exports.endGroup = endGroup;
  7495. /**
  7496. * Wrap an asynchronous function call in a group.
  7497. *
  7498. * Returns the same type as the function itself.
  7499. *
  7500. * @param name The name of the group
  7501. * @param fn The function to wrap in the group
  7502. */
  7503. function group(name, fn) {
  7504. return __awaiter(this, void 0, void 0, function* () {
  7505. startGroup(name);
  7506. let result;
  7507. try {
  7508. result = yield fn();
  7509. }
  7510. finally {
  7511. endGroup();
  7512. }
  7513. return result;
  7514. });
  7515. }
  7516. exports.group = group;
  7517. //# sourceMappingURL=core.js.map
  7518. /***/ }),
  7519. /***/ 471:
  7520. /***/ (function(module, __unusedexports, __webpack_require__) {
  7521. module.exports = authenticationBeforeRequest;
  7522. const btoa = __webpack_require__(675);
  7523. const uniq = __webpack_require__(126);
  7524. function authenticationBeforeRequest(state, options) {
  7525. if (!state.auth.type) {
  7526. return;
  7527. }
  7528. if (state.auth.type === "basic") {
  7529. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  7530. options.headers.authorization = `Basic ${hash}`;
  7531. return;
  7532. }
  7533. if (state.auth.type === "token") {
  7534. options.headers.authorization = `token ${state.auth.token}`;
  7535. return;
  7536. }
  7537. if (state.auth.type === "app") {
  7538. options.headers.authorization = `Bearer ${state.auth.token}`;
  7539. const acceptHeaders = options.headers.accept
  7540. .split(",")
  7541. .concat("application/vnd.github.machine-man-preview+json");
  7542. options.headers.accept = uniq(acceptHeaders)
  7543. .filter(Boolean)
  7544. .join(",");
  7545. return;
  7546. }
  7547. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  7548. if (state.auth.token) {
  7549. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  7550. return;
  7551. }
  7552. const key = encodeURIComponent(state.auth.key);
  7553. const secret = encodeURIComponent(state.auth.secret);
  7554. options.url += `client_id=${key}&client_secret=${secret}`;
  7555. }
  7556. /***/ }),
  7557. /***/ 489:
  7558. /***/ (function(module, __unusedexports, __webpack_require__) {
  7559. "use strict";
  7560. const path = __webpack_require__(622);
  7561. const which = __webpack_require__(814);
  7562. const pathKey = __webpack_require__(39)();
  7563. function resolveCommandAttempt(parsed, withoutPathExt) {
  7564. const cwd = process.cwd();
  7565. const hasCustomCwd = parsed.options.cwd != null;
  7566. // If a custom `cwd` was specified, we need to change the process cwd
  7567. // because `which` will do stat calls but does not support a custom cwd
  7568. if (hasCustomCwd) {
  7569. try {
  7570. process.chdir(parsed.options.cwd);
  7571. } catch (err) {
  7572. /* Empty */
  7573. }
  7574. }
  7575. let resolved;
  7576. try {
  7577. resolved = which.sync(parsed.command, {
  7578. path: (parsed.options.env || process.env)[pathKey],
  7579. pathExt: withoutPathExt ? path.delimiter : undefined,
  7580. });
  7581. } catch (e) {
  7582. /* Empty */
  7583. } finally {
  7584. process.chdir(cwd);
  7585. }
  7586. // If we successfully resolved, ensure that an absolute path is returned
  7587. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  7588. if (resolved) {
  7589. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  7590. }
  7591. return resolved;
  7592. }
  7593. function resolveCommand(parsed) {
  7594. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  7595. }
  7596. module.exports = resolveCommand;
  7597. /***/ }),
  7598. /***/ 510:
  7599. /***/ (function(module) {
  7600. module.exports = addHook
  7601. function addHook (state, kind, name, hook) {
  7602. var orig = hook
  7603. if (!state.registry[name]) {
  7604. state.registry[name] = []
  7605. }
  7606. if (kind === 'before') {
  7607. hook = function (method, options) {
  7608. return Promise.resolve()
  7609. .then(orig.bind(null, options))
  7610. .then(method.bind(null, options))
  7611. }
  7612. }
  7613. if (kind === 'after') {
  7614. hook = function (method, options) {
  7615. var result
  7616. return Promise.resolve()
  7617. .then(method.bind(null, options))
  7618. .then(function (result_) {
  7619. result = result_
  7620. return orig(result, options)
  7621. })
  7622. .then(function () {
  7623. return result
  7624. })
  7625. }
  7626. }
  7627. if (kind === 'error') {
  7628. hook = function (method, options) {
  7629. return Promise.resolve()
  7630. .then(method.bind(null, options))
  7631. .catch(function (error) {
  7632. return orig(error, options)
  7633. })
  7634. }
  7635. }
  7636. state.registry[name].push({
  7637. hook: hook,
  7638. orig: orig
  7639. })
  7640. }
  7641. /***/ }),
  7642. /***/ 523:
  7643. /***/ (function(module, __unusedexports, __webpack_require__) {
  7644. var register = __webpack_require__(363)
  7645. var addHook = __webpack_require__(510)
  7646. var removeHook = __webpack_require__(763)
  7647. // bind with array of arguments: https://stackoverflow.com/a/21792913
  7648. var bind = Function.bind
  7649. var bindable = bind.bind(bind)
  7650. function bindApi (hook, state, name) {
  7651. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  7652. hook.api = { remove: removeHookRef }
  7653. hook.remove = removeHookRef
  7654. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  7655. var args = name ? [state, kind, name] : [state, kind]
  7656. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  7657. })
  7658. }
  7659. function HookSingular () {
  7660. var singularHookName = 'h'
  7661. var singularHookState = {
  7662. registry: {}
  7663. }
  7664. var singularHook = register.bind(null, singularHookState, singularHookName)
  7665. bindApi(singularHook, singularHookState, singularHookName)
  7666. return singularHook
  7667. }
  7668. function HookCollection () {
  7669. var state = {
  7670. registry: {}
  7671. }
  7672. var hook = register.bind(null, state)
  7673. bindApi(hook, state)
  7674. return hook
  7675. }
  7676. var collectionHookDeprecationMessageDisplayed = false
  7677. function Hook () {
  7678. if (!collectionHookDeprecationMessageDisplayed) {
  7679. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  7680. collectionHookDeprecationMessageDisplayed = true
  7681. }
  7682. return HookCollection()
  7683. }
  7684. Hook.Singular = HookSingular.bind()
  7685. Hook.Collection = HookCollection.bind()
  7686. module.exports = Hook
  7687. // expose constructors as a named property for TypeScript
  7688. module.exports.Hook = Hook
  7689. module.exports.Singular = Hook.Singular
  7690. module.exports.Collection = Hook.Collection
  7691. /***/ }),
  7692. /***/ 529:
  7693. /***/ (function(module, __unusedexports, __webpack_require__) {
  7694. const factory = __webpack_require__(47);
  7695. module.exports = factory();
  7696. /***/ }),
  7697. /***/ 533:
  7698. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7699. "use strict";
  7700. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7701. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7702. return new (P || (P = Promise))(function (resolve, reject) {
  7703. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7704. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7705. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7706. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7707. });
  7708. };
  7709. Object.defineProperty(exports, "__esModule", { value: true });
  7710. const core = __webpack_require__(470);
  7711. const io = __webpack_require__(1);
  7712. const fs = __webpack_require__(747);
  7713. const os = __webpack_require__(87);
  7714. const path = __webpack_require__(622);
  7715. const httpm = __webpack_require__(874);
  7716. const semver = __webpack_require__(656);
  7717. const uuidV4 = __webpack_require__(826);
  7718. const exec_1 = __webpack_require__(986);
  7719. const assert_1 = __webpack_require__(357);
  7720. class HTTPError extends Error {
  7721. constructor(httpStatusCode) {
  7722. super(`Unexpected HTTP response: ${httpStatusCode}`);
  7723. this.httpStatusCode = httpStatusCode;
  7724. Object.setPrototypeOf(this, new.target.prototype);
  7725. }
  7726. }
  7727. exports.HTTPError = HTTPError;
  7728. const IS_WINDOWS = process.platform === 'win32';
  7729. const userAgent = 'actions/tool-cache';
  7730. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  7731. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  7732. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  7733. // If directories not found, place them in common temp locations
  7734. if (!tempDirectory || !cacheRoot) {
  7735. let baseLocation;
  7736. if (IS_WINDOWS) {
  7737. // On windows use the USERPROFILE env variable
  7738. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  7739. }
  7740. else {
  7741. if (process.platform === 'darwin') {
  7742. baseLocation = '/Users';
  7743. }
  7744. else {
  7745. baseLocation = '/home';
  7746. }
  7747. }
  7748. if (!tempDirectory) {
  7749. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  7750. }
  7751. if (!cacheRoot) {
  7752. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  7753. }
  7754. }
  7755. /**
  7756. * Download a tool from an url and stream it into a file
  7757. *
  7758. * @param url url of tool to download
  7759. * @returns path to downloaded tool
  7760. */
  7761. function downloadTool(url) {
  7762. return __awaiter(this, void 0, void 0, function* () {
  7763. // Wrap in a promise so that we can resolve from within stream callbacks
  7764. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  7765. try {
  7766. const http = new httpm.HttpClient(userAgent, [], {
  7767. allowRetries: true,
  7768. maxRetries: 3
  7769. });
  7770. const destPath = path.join(tempDirectory, uuidV4());
  7771. yield io.mkdirP(tempDirectory);
  7772. core.debug(`Downloading ${url}`);
  7773. core.debug(`Downloading ${destPath}`);
  7774. if (fs.existsSync(destPath)) {
  7775. throw new Error(`Destination file path ${destPath} already exists`);
  7776. }
  7777. const response = yield http.get(url);
  7778. if (response.message.statusCode !== 200) {
  7779. const err = new HTTPError(response.message.statusCode);
  7780. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  7781. throw err;
  7782. }
  7783. const file = fs.createWriteStream(destPath);
  7784. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  7785. try {
  7786. const stream = response.message.pipe(file);
  7787. stream.on('close', () => {
  7788. core.debug('download complete');
  7789. resolve(destPath);
  7790. });
  7791. }
  7792. catch (err) {
  7793. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  7794. reject(err);
  7795. }
  7796. }));
  7797. file.on('error', err => {
  7798. file.end();
  7799. reject(err);
  7800. });
  7801. }
  7802. catch (err) {
  7803. reject(err);
  7804. }
  7805. }));
  7806. });
  7807. }
  7808. exports.downloadTool = downloadTool;
  7809. /**
  7810. * Extract a .7z file
  7811. *
  7812. * @param file path to the .7z file
  7813. * @param dest destination directory. Optional.
  7814. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  7815. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  7816. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  7817. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  7818. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  7819. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  7820. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  7821. * to 7zr.exe can be pass to this function.
  7822. * @returns path to the destination directory
  7823. */
  7824. function extract7z(file, dest, _7zPath) {
  7825. return __awaiter(this, void 0, void 0, function* () {
  7826. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  7827. assert_1.ok(file, 'parameter "file" is required');
  7828. dest = dest || (yield _createExtractFolder(dest));
  7829. const originalCwd = process.cwd();
  7830. process.chdir(dest);
  7831. if (_7zPath) {
  7832. try {
  7833. const args = [
  7834. 'x',
  7835. '-bb1',
  7836. '-bd',
  7837. '-sccUTF-8',
  7838. file
  7839. ];
  7840. const options = {
  7841. silent: true
  7842. };
  7843. yield exec_1.exec(`"${_7zPath}"`, args, options);
  7844. }
  7845. finally {
  7846. process.chdir(originalCwd);
  7847. }
  7848. }
  7849. else {
  7850. const escapedScript = path
  7851. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  7852. .replace(/'/g, "''")
  7853. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7854. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7855. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7856. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  7857. const args = [
  7858. '-NoLogo',
  7859. '-Sta',
  7860. '-NoProfile',
  7861. '-NonInteractive',
  7862. '-ExecutionPolicy',
  7863. 'Unrestricted',
  7864. '-Command',
  7865. command
  7866. ];
  7867. const options = {
  7868. silent: true
  7869. };
  7870. try {
  7871. const powershellPath = yield io.which('powershell', true);
  7872. yield exec_1.exec(`"${powershellPath}"`, args, options);
  7873. }
  7874. finally {
  7875. process.chdir(originalCwd);
  7876. }
  7877. }
  7878. return dest;
  7879. });
  7880. }
  7881. exports.extract7z = extract7z;
  7882. /**
  7883. * Extract a tar
  7884. *
  7885. * @param file path to the tar
  7886. * @param dest destination directory. Optional.
  7887. * @param flags flags for the tar. Optional.
  7888. * @returns path to the destination directory
  7889. */
  7890. function extractTar(file, dest, flags = 'xz') {
  7891. return __awaiter(this, void 0, void 0, function* () {
  7892. if (!file) {
  7893. throw new Error("parameter 'file' is required");
  7894. }
  7895. dest = dest || (yield _createExtractFolder(dest));
  7896. const tarPath = yield io.which('tar', true);
  7897. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  7898. return dest;
  7899. });
  7900. }
  7901. exports.extractTar = extractTar;
  7902. /**
  7903. * Extract a zip
  7904. *
  7905. * @param file path to the zip
  7906. * @param dest destination directory. Optional.
  7907. * @returns path to the destination directory
  7908. */
  7909. function extractZip(file, dest) {
  7910. return __awaiter(this, void 0, void 0, function* () {
  7911. if (!file) {
  7912. throw new Error("parameter 'file' is required");
  7913. }
  7914. dest = dest || (yield _createExtractFolder(dest));
  7915. if (IS_WINDOWS) {
  7916. yield extractZipWin(file, dest);
  7917. }
  7918. else {
  7919. yield extractZipNix(file, dest);
  7920. }
  7921. return dest;
  7922. });
  7923. }
  7924. exports.extractZip = extractZip;
  7925. function extractZipWin(file, dest) {
  7926. return __awaiter(this, void 0, void 0, function* () {
  7927. // build the powershell command
  7928. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  7929. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  7930. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  7931. // run powershell
  7932. const powershellPath = yield io.which('powershell');
  7933. const args = [
  7934. '-NoLogo',
  7935. '-Sta',
  7936. '-NoProfile',
  7937. '-NonInteractive',
  7938. '-ExecutionPolicy',
  7939. 'Unrestricted',
  7940. '-Command',
  7941. command
  7942. ];
  7943. yield exec_1.exec(`"${powershellPath}"`, args);
  7944. });
  7945. }
  7946. function extractZipNix(file, dest) {
  7947. return __awaiter(this, void 0, void 0, function* () {
  7948. const unzipPath = yield io.which('unzip');
  7949. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  7950. });
  7951. }
  7952. /**
  7953. * Caches a directory and installs it into the tool cacheDir
  7954. *
  7955. * @param sourceDir the directory to cache into tools
  7956. * @param tool tool name
  7957. * @param version version of the tool. semver format
  7958. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7959. */
  7960. function cacheDir(sourceDir, tool, version, arch) {
  7961. return __awaiter(this, void 0, void 0, function* () {
  7962. version = semver.clean(version) || version;
  7963. arch = arch || os.arch();
  7964. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7965. core.debug(`source dir: ${sourceDir}`);
  7966. if (!fs.statSync(sourceDir).isDirectory()) {
  7967. throw new Error('sourceDir is not a directory');
  7968. }
  7969. // Create the tool dir
  7970. const destPath = yield _createToolPath(tool, version, arch);
  7971. // copy each child item. do not move. move can fail on Windows
  7972. // due to anti-virus software having an open handle on a file.
  7973. for (const itemName of fs.readdirSync(sourceDir)) {
  7974. const s = path.join(sourceDir, itemName);
  7975. yield io.cp(s, destPath, { recursive: true });
  7976. }
  7977. // write .complete
  7978. _completeToolPath(tool, version, arch);
  7979. return destPath;
  7980. });
  7981. }
  7982. exports.cacheDir = cacheDir;
  7983. /**
  7984. * Caches a downloaded file (GUID) and installs it
  7985. * into the tool cache with a given targetName
  7986. *
  7987. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  7988. * @param targetFile the name of the file name in the tools directory
  7989. * @param tool tool name
  7990. * @param version version of the tool. semver format
  7991. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  7992. */
  7993. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  7994. return __awaiter(this, void 0, void 0, function* () {
  7995. version = semver.clean(version) || version;
  7996. arch = arch || os.arch();
  7997. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  7998. core.debug(`source file: ${sourceFile}`);
  7999. if (!fs.statSync(sourceFile).isFile()) {
  8000. throw new Error('sourceFile is not a file');
  8001. }
  8002. // create the tool dir
  8003. const destFolder = yield _createToolPath(tool, version, arch);
  8004. // copy instead of move. move can fail on Windows due to
  8005. // anti-virus software having an open handle on a file.
  8006. const destPath = path.join(destFolder, targetFile);
  8007. core.debug(`destination file ${destPath}`);
  8008. yield io.cp(sourceFile, destPath);
  8009. // write .complete
  8010. _completeToolPath(tool, version, arch);
  8011. return destFolder;
  8012. });
  8013. }
  8014. exports.cacheFile = cacheFile;
  8015. /**
  8016. * Finds the path to a tool version in the local installed tool cache
  8017. *
  8018. * @param toolName name of the tool
  8019. * @param versionSpec version of the tool
  8020. * @param arch optional arch. defaults to arch of computer
  8021. */
  8022. function find(toolName, versionSpec, arch) {
  8023. if (!toolName) {
  8024. throw new Error('toolName parameter is required');
  8025. }
  8026. if (!versionSpec) {
  8027. throw new Error('versionSpec parameter is required');
  8028. }
  8029. arch = arch || os.arch();
  8030. // attempt to resolve an explicit version
  8031. if (!_isExplicitVersion(versionSpec)) {
  8032. const localVersions = findAllVersions(toolName, arch);
  8033. const match = _evaluateVersions(localVersions, versionSpec);
  8034. versionSpec = match;
  8035. }
  8036. // check for the explicit version in the cache
  8037. let toolPath = '';
  8038. if (versionSpec) {
  8039. versionSpec = semver.clean(versionSpec) || '';
  8040. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8041. core.debug(`checking cache: ${cachePath}`);
  8042. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8043. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8044. toolPath = cachePath;
  8045. }
  8046. else {
  8047. core.debug('not found');
  8048. }
  8049. }
  8050. return toolPath;
  8051. }
  8052. exports.find = find;
  8053. /**
  8054. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8055. *
  8056. * @param toolName name of the tool
  8057. * @param arch optional arch. defaults to arch of computer
  8058. */
  8059. function findAllVersions(toolName, arch) {
  8060. const versions = [];
  8061. arch = arch || os.arch();
  8062. const toolPath = path.join(cacheRoot, toolName);
  8063. if (fs.existsSync(toolPath)) {
  8064. const children = fs.readdirSync(toolPath);
  8065. for (const child of children) {
  8066. if (_isExplicitVersion(child)) {
  8067. const fullPath = path.join(toolPath, child, arch || '');
  8068. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8069. versions.push(child);
  8070. }
  8071. }
  8072. }
  8073. }
  8074. return versions;
  8075. }
  8076. exports.findAllVersions = findAllVersions;
  8077. function _createExtractFolder(dest) {
  8078. return __awaiter(this, void 0, void 0, function* () {
  8079. if (!dest) {
  8080. // create a temp dir
  8081. dest = path.join(tempDirectory, uuidV4());
  8082. }
  8083. yield io.mkdirP(dest);
  8084. return dest;
  8085. });
  8086. }
  8087. function _createToolPath(tool, version, arch) {
  8088. return __awaiter(this, void 0, void 0, function* () {
  8089. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8090. core.debug(`destination ${folderPath}`);
  8091. const markerPath = `${folderPath}.complete`;
  8092. yield io.rmRF(folderPath);
  8093. yield io.rmRF(markerPath);
  8094. yield io.mkdirP(folderPath);
  8095. return folderPath;
  8096. });
  8097. }
  8098. function _completeToolPath(tool, version, arch) {
  8099. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8100. const markerPath = `${folderPath}.complete`;
  8101. fs.writeFileSync(markerPath, '');
  8102. core.debug('finished caching tool');
  8103. }
  8104. function _isExplicitVersion(versionSpec) {
  8105. const c = semver.clean(versionSpec) || '';
  8106. core.debug(`isExplicit: ${c}`);
  8107. const valid = semver.valid(c) != null;
  8108. core.debug(`explicit? ${valid}`);
  8109. return valid;
  8110. }
  8111. function _evaluateVersions(versions, versionSpec) {
  8112. let version = '';
  8113. core.debug(`evaluating ${versions.length} versions`);
  8114. versions = versions.sort((a, b) => {
  8115. if (semver.gt(a, b)) {
  8116. return 1;
  8117. }
  8118. return -1;
  8119. });
  8120. for (let i = versions.length - 1; i >= 0; i--) {
  8121. const potential = versions[i];
  8122. const satisfied = semver.satisfies(potential, versionSpec);
  8123. if (satisfied) {
  8124. version = potential;
  8125. break;
  8126. }
  8127. }
  8128. if (version) {
  8129. core.debug(`matched: ${version}`);
  8130. }
  8131. else {
  8132. core.debug('match not found');
  8133. }
  8134. return version;
  8135. }
  8136. //# sourceMappingURL=tool-cache.js.map
  8137. /***/ }),
  8138. /***/ 536:
  8139. /***/ (function(module, __unusedexports, __webpack_require__) {
  8140. module.exports = hasFirstPage
  8141. const deprecate = __webpack_require__(370)
  8142. const getPageLinks = __webpack_require__(577)
  8143. function hasFirstPage (link) {
  8144. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8145. return getPageLinks(link).first
  8146. }
  8147. /***/ }),
  8148. /***/ 550:
  8149. /***/ (function(module, __unusedexports, __webpack_require__) {
  8150. module.exports = getNextPage
  8151. const getPage = __webpack_require__(265)
  8152. function getNextPage (octokit, link, headers) {
  8153. return getPage(octokit, link, 'next', headers)
  8154. }
  8155. /***/ }),
  8156. /***/ 558:
  8157. /***/ (function(module, __unusedexports, __webpack_require__) {
  8158. module.exports = hasPreviousPage
  8159. const deprecate = __webpack_require__(370)
  8160. const getPageLinks = __webpack_require__(577)
  8161. function hasPreviousPage (link) {
  8162. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8163. return getPageLinks(link).prev
  8164. }
  8165. /***/ }),
  8166. /***/ 559:
  8167. /***/ (function(__unusedmodule, exports) {
  8168. "use strict";
  8169. Object.defineProperty(exports, "__esModule", { value: true });
  8170. class GitVersion {
  8171. /**
  8172. * Used for comparing the version of git and git-lfs against the minimum required version
  8173. * @param version the version string, e.g. 1.2 or 1.2.3
  8174. */
  8175. constructor(version) {
  8176. this.major = NaN;
  8177. this.minor = NaN;
  8178. this.patch = NaN;
  8179. if (version) {
  8180. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  8181. if (match) {
  8182. this.major = Number(match[1]);
  8183. this.minor = Number(match[2]);
  8184. if (match[4]) {
  8185. this.patch = Number(match[4]);
  8186. }
  8187. }
  8188. }
  8189. }
  8190. /**
  8191. * Compares the instance against a minimum required version
  8192. * @param minimum Minimum version
  8193. */
  8194. checkMinimum(minimum) {
  8195. if (!minimum.isValid()) {
  8196. throw new Error('Arg minimum is not a valid version');
  8197. }
  8198. // Major is insufficient
  8199. if (this.major < minimum.major) {
  8200. return false;
  8201. }
  8202. // Major is equal
  8203. if (this.major === minimum.major) {
  8204. // Minor is insufficient
  8205. if (this.minor < minimum.minor) {
  8206. return false;
  8207. }
  8208. // Minor is equal
  8209. if (this.minor === minimum.minor) {
  8210. // Patch is insufficient
  8211. if (this.patch && this.patch < (minimum.patch || 0)) {
  8212. return false;
  8213. }
  8214. }
  8215. }
  8216. return true;
  8217. }
  8218. /**
  8219. * Indicates whether the instance was constructed from a valid version string
  8220. */
  8221. isValid() {
  8222. return !isNaN(this.major);
  8223. }
  8224. /**
  8225. * Returns the version as a string, e.g. 1.2 or 1.2.3
  8226. */
  8227. toString() {
  8228. let result = '';
  8229. if (this.isValid()) {
  8230. result = `${this.major}.${this.minor}`;
  8231. if (!isNaN(this.patch)) {
  8232. result += `.${this.patch}`;
  8233. }
  8234. }
  8235. return result;
  8236. }
  8237. }
  8238. exports.GitVersion = GitVersion;
  8239. /***/ }),
  8240. /***/ 562:
  8241. /***/ (function(module, __unusedexports, __webpack_require__) {
  8242. var once = __webpack_require__(969);
  8243. var noop = function() {};
  8244. var isRequest = function(stream) {
  8245. return stream.setHeader && typeof stream.abort === 'function';
  8246. };
  8247. var isChildProcess = function(stream) {
  8248. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  8249. };
  8250. var eos = function(stream, opts, callback) {
  8251. if (typeof opts === 'function') return eos(stream, null, opts);
  8252. if (!opts) opts = {};
  8253. callback = once(callback || noop);
  8254. var ws = stream._writableState;
  8255. var rs = stream._readableState;
  8256. var readable = opts.readable || (opts.readable !== false && stream.readable);
  8257. var writable = opts.writable || (opts.writable !== false && stream.writable);
  8258. var cancelled = false;
  8259. var onlegacyfinish = function() {
  8260. if (!stream.writable) onfinish();
  8261. };
  8262. var onfinish = function() {
  8263. writable = false;
  8264. if (!readable) callback.call(stream);
  8265. };
  8266. var onend = function() {
  8267. readable = false;
  8268. if (!writable) callback.call(stream);
  8269. };
  8270. var onexit = function(exitCode) {
  8271. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  8272. };
  8273. var onerror = function(err) {
  8274. callback.call(stream, err);
  8275. };
  8276. var onclose = function() {
  8277. process.nextTick(onclosenexttick);
  8278. };
  8279. var onclosenexttick = function() {
  8280. if (cancelled) return;
  8281. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  8282. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  8283. };
  8284. var onrequest = function() {
  8285. stream.req.on('finish', onfinish);
  8286. };
  8287. if (isRequest(stream)) {
  8288. stream.on('complete', onfinish);
  8289. stream.on('abort', onclose);
  8290. if (stream.req) onrequest();
  8291. else stream.on('request', onrequest);
  8292. } else if (writable && !ws) { // legacy streams
  8293. stream.on('end', onlegacyfinish);
  8294. stream.on('close', onlegacyfinish);
  8295. }
  8296. if (isChildProcess(stream)) stream.on('exit', onexit);
  8297. stream.on('end', onend);
  8298. stream.on('finish', onfinish);
  8299. if (opts.error !== false) stream.on('error', onerror);
  8300. stream.on('close', onclose);
  8301. return function() {
  8302. cancelled = true;
  8303. stream.removeListener('complete', onfinish);
  8304. stream.removeListener('abort', onclose);
  8305. stream.removeListener('request', onrequest);
  8306. if (stream.req) stream.req.removeListener('finish', onfinish);
  8307. stream.removeListener('end', onlegacyfinish);
  8308. stream.removeListener('close', onlegacyfinish);
  8309. stream.removeListener('finish', onfinish);
  8310. stream.removeListener('exit', onexit);
  8311. stream.removeListener('end', onend);
  8312. stream.removeListener('error', onerror);
  8313. stream.removeListener('close', onclose);
  8314. };
  8315. };
  8316. module.exports = eos;
  8317. /***/ }),
  8318. /***/ 563:
  8319. /***/ (function(module, __unusedexports, __webpack_require__) {
  8320. module.exports = getPreviousPage
  8321. const getPage = __webpack_require__(265)
  8322. function getPreviousPage (octokit, link, headers) {
  8323. return getPage(octokit, link, 'prev', headers)
  8324. }
  8325. /***/ }),
  8326. /***/ 568:
  8327. /***/ (function(module, __unusedexports, __webpack_require__) {
  8328. "use strict";
  8329. const path = __webpack_require__(622);
  8330. const niceTry = __webpack_require__(948);
  8331. const resolveCommand = __webpack_require__(489);
  8332. const escape = __webpack_require__(462);
  8333. const readShebang = __webpack_require__(389);
  8334. const semver = __webpack_require__(280);
  8335. const isWin = process.platform === 'win32';
  8336. const isExecutableRegExp = /\.(?:com|exe)$/i;
  8337. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  8338. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  8339. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  8340. function detectShebang(parsed) {
  8341. parsed.file = resolveCommand(parsed);
  8342. const shebang = parsed.file && readShebang(parsed.file);
  8343. if (shebang) {
  8344. parsed.args.unshift(parsed.file);
  8345. parsed.command = shebang;
  8346. return resolveCommand(parsed);
  8347. }
  8348. return parsed.file;
  8349. }
  8350. function parseNonShell(parsed) {
  8351. if (!isWin) {
  8352. return parsed;
  8353. }
  8354. // Detect & add support for shebangs
  8355. const commandFile = detectShebang(parsed);
  8356. // We don't need a shell if the command filename is an executable
  8357. const needsShell = !isExecutableRegExp.test(commandFile);
  8358. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  8359. // Note that `forceShell` is an hidden option used only in tests
  8360. if (parsed.options.forceShell || needsShell) {
  8361. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  8362. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  8363. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  8364. // we need to double escape them
  8365. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  8366. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  8367. // This is necessary otherwise it will always fail with ENOENT in those cases
  8368. parsed.command = path.normalize(parsed.command);
  8369. // Escape command & arguments
  8370. parsed.command = escape.command(parsed.command);
  8371. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  8372. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  8373. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  8374. parsed.command = process.env.comspec || 'cmd.exe';
  8375. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  8376. }
  8377. return parsed;
  8378. }
  8379. function parseShell(parsed) {
  8380. // If node supports the shell option, there's no need to mimic its behavior
  8381. if (supportsShellOption) {
  8382. return parsed;
  8383. }
  8384. // Mimic node shell option
  8385. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  8386. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  8387. if (isWin) {
  8388. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  8389. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  8390. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  8391. } else {
  8392. if (typeof parsed.options.shell === 'string') {
  8393. parsed.command = parsed.options.shell;
  8394. } else if (process.platform === 'android') {
  8395. parsed.command = '/system/bin/sh';
  8396. } else {
  8397. parsed.command = '/bin/sh';
  8398. }
  8399. parsed.args = ['-c', shellCommand];
  8400. }
  8401. return parsed;
  8402. }
  8403. function parse(command, args, options) {
  8404. // Normalize arguments, similar to nodejs
  8405. if (args && !Array.isArray(args)) {
  8406. options = args;
  8407. args = null;
  8408. }
  8409. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  8410. options = Object.assign({}, options); // Clone object to avoid changing the original
  8411. // Build our parsed object
  8412. const parsed = {
  8413. command,
  8414. args,
  8415. options,
  8416. file: undefined,
  8417. original: {
  8418. command,
  8419. args,
  8420. },
  8421. };
  8422. // Delegate further parsing to shell or non-shell
  8423. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  8424. }
  8425. module.exports = parse;
  8426. /***/ }),
  8427. /***/ 577:
  8428. /***/ (function(module) {
  8429. module.exports = getPageLinks
  8430. function getPageLinks (link) {
  8431. link = link.link || link.headers.link || ''
  8432. const links = {}
  8433. // link format:
  8434. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  8435. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  8436. links[type] = uri
  8437. })
  8438. return links
  8439. }
  8440. /***/ }),
  8441. /***/ 586:
  8442. /***/ (function(module, __unusedexports, __webpack_require__) {
  8443. module.exports = octokitRestApiEndpoints;
  8444. const ROUTES = __webpack_require__(705);
  8445. function octokitRestApiEndpoints(octokit) {
  8446. // Aliasing scopes for backward compatibility
  8447. // See https://github.com/octokit/rest.js/pull/1134
  8448. ROUTES.gitdata = ROUTES.git;
  8449. ROUTES.authorization = ROUTES.oauthAuthorizations;
  8450. ROUTES.pullRequests = ROUTES.pulls;
  8451. octokit.registerEndpoints(ROUTES);
  8452. }
  8453. /***/ }),
  8454. /***/ 587:
  8455. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8456. "use strict";
  8457. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8458. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8459. return new (P || (P = Promise))(function (resolve, reject) {
  8460. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8461. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8462. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8463. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8464. });
  8465. };
  8466. var __importStar = (this && this.__importStar) || function (mod) {
  8467. if (mod && mod.__esModule) return mod;
  8468. var result = {};
  8469. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8470. result["default"] = mod;
  8471. return result;
  8472. };
  8473. Object.defineProperty(exports, "__esModule", { value: true });
  8474. const core = __importStar(__webpack_require__(470));
  8475. const defaultMaxAttempts = 3;
  8476. const defaultMinSeconds = 10;
  8477. const defaultMaxSeconds = 20;
  8478. class RetryHelper {
  8479. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  8480. this.maxAttempts = maxAttempts;
  8481. this.minSeconds = Math.floor(minSeconds);
  8482. this.maxSeconds = Math.floor(maxSeconds);
  8483. }
  8484. execute(action) {
  8485. return __awaiter(this, void 0, void 0, function* () {
  8486. let attempt = 1;
  8487. while (attempt < this.maxAttempts) {
  8488. // Try
  8489. try {
  8490. return yield action();
  8491. }
  8492. catch (err) {
  8493. core.info(err.message);
  8494. }
  8495. // Sleep
  8496. const seconds = this.getSleepAmount();
  8497. core.info(`Waiting ${seconds} seconds before trying again`);
  8498. yield this.sleep(seconds);
  8499. attempt++;
  8500. }
  8501. // Last attempt
  8502. return yield action();
  8503. });
  8504. }
  8505. getSleepAmount() {
  8506. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  8507. this.minSeconds);
  8508. }
  8509. sleep(seconds) {
  8510. return __awaiter(this, void 0, void 0, function* () {
  8511. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  8512. });
  8513. }
  8514. }
  8515. exports.RetryHelper = RetryHelper;
  8516. function execute(action) {
  8517. return __awaiter(this, void 0, void 0, function* () {
  8518. const retryHelper = new RetryHelper();
  8519. return yield retryHelper.execute(action);
  8520. });
  8521. }
  8522. exports.execute = execute;
  8523. /***/ }),
  8524. /***/ 605:
  8525. /***/ (function(module) {
  8526. module.exports = require("http");
  8527. /***/ }),
  8528. /***/ 614:
  8529. /***/ (function(module) {
  8530. module.exports = require("events");
  8531. /***/ }),
  8532. /***/ 618:
  8533. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8534. "use strict";
  8535. var __importStar = (this && this.__importStar) || function (mod) {
  8536. if (mod && mod.__esModule) return mod;
  8537. var result = {};
  8538. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  8539. result["default"] = mod;
  8540. return result;
  8541. };
  8542. Object.defineProperty(exports, "__esModule", { value: true });
  8543. const fs = __importStar(__webpack_require__(747));
  8544. function directoryExistsSync(path, required) {
  8545. if (!path) {
  8546. throw new Error("Arg 'path' must not be empty");
  8547. }
  8548. let stats;
  8549. try {
  8550. stats = fs.statSync(path);
  8551. }
  8552. catch (error) {
  8553. if (error.code === 'ENOENT') {
  8554. if (!required) {
  8555. return false;
  8556. }
  8557. throw new Error(`Directory '${path}' does not exist`);
  8558. }
  8559. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  8560. }
  8561. if (stats.isDirectory()) {
  8562. return true;
  8563. }
  8564. else if (!required) {
  8565. return false;
  8566. }
  8567. throw new Error(`Directory '${path}' does not exist`);
  8568. }
  8569. exports.directoryExistsSync = directoryExistsSync;
  8570. function existsSync(path) {
  8571. if (!path) {
  8572. throw new Error("Arg 'path' must not be empty");
  8573. }
  8574. try {
  8575. fs.statSync(path);
  8576. }
  8577. catch (error) {
  8578. if (error.code === 'ENOENT') {
  8579. return false;
  8580. }
  8581. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  8582. }
  8583. return true;
  8584. }
  8585. exports.existsSync = existsSync;
  8586. function fileExistsSync(path) {
  8587. if (!path) {
  8588. throw new Error("Arg 'path' must not be empty");
  8589. }
  8590. let stats;
  8591. try {
  8592. stats = fs.statSync(path);
  8593. }
  8594. catch (error) {
  8595. if (error.code === 'ENOENT') {
  8596. return false;
  8597. }
  8598. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  8599. }
  8600. if (!stats.isDirectory()) {
  8601. return true;
  8602. }
  8603. return false;
  8604. }
  8605. exports.fileExistsSync = fileExistsSync;
  8606. /***/ }),
  8607. /***/ 621:
  8608. /***/ (function(module, __unusedexports, __webpack_require__) {
  8609. "use strict";
  8610. const path = __webpack_require__(622);
  8611. const pathKey = __webpack_require__(39);
  8612. module.exports = opts => {
  8613. opts = Object.assign({
  8614. cwd: process.cwd(),
  8615. path: process.env[pathKey()]
  8616. }, opts);
  8617. let prev;
  8618. let pth = path.resolve(opts.cwd);
  8619. const ret = [];
  8620. while (prev !== pth) {
  8621. ret.push(path.join(pth, 'node_modules/.bin'));
  8622. prev = pth;
  8623. pth = path.resolve(pth, '..');
  8624. }
  8625. // ensure the running `node` binary is used
  8626. ret.push(path.dirname(process.execPath));
  8627. return ret.concat(opts.path).join(path.delimiter);
  8628. };
  8629. module.exports.env = opts => {
  8630. opts = Object.assign({
  8631. env: process.env
  8632. }, opts);
  8633. const env = Object.assign({}, opts.env);
  8634. const path = pathKey({env});
  8635. opts.path = env[path];
  8636. env[path] = module.exports(opts);
  8637. return env;
  8638. };
  8639. /***/ }),
  8640. /***/ 622:
  8641. /***/ (function(module) {
  8642. module.exports = require("path");
  8643. /***/ }),
  8644. /***/ 631:
  8645. /***/ (function(module) {
  8646. module.exports = require("net");
  8647. /***/ }),
  8648. /***/ 649:
  8649. /***/ (function(module, __unusedexports, __webpack_require__) {
  8650. module.exports = getLastPage
  8651. const getPage = __webpack_require__(265)
  8652. function getLastPage (octokit, link, headers) {
  8653. return getPage(octokit, link, 'last', headers)
  8654. }
  8655. /***/ }),
  8656. /***/ 654:
  8657. /***/ (function(module) {
  8658. // This is not the set of all possible signals.
  8659. //
  8660. // It IS, however, the set of all signals that trigger
  8661. // an exit on either Linux or BSD systems. Linux is a
  8662. // superset of the signal names supported on BSD, and
  8663. // the unknown signals just fail to register, so we can
  8664. // catch that easily enough.
  8665. //
  8666. // Don't bother with SIGKILL. It's uncatchable, which
  8667. // means that we can't fire any callbacks anyway.
  8668. //
  8669. // If a user does happen to register a handler on a non-
  8670. // fatal signal like SIGWINCH or something, and then
  8671. // exit, it'll end up firing `process.emit('exit')`, so
  8672. // the handler will be fired anyway.
  8673. //
  8674. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  8675. // artificially, inherently leave the process in a
  8676. // state from which it is not safe to try and enter JS
  8677. // listeners.
  8678. module.exports = [
  8679. 'SIGABRT',
  8680. 'SIGALRM',
  8681. 'SIGHUP',
  8682. 'SIGINT',
  8683. 'SIGTERM'
  8684. ]
  8685. if (process.platform !== 'win32') {
  8686. module.exports.push(
  8687. 'SIGVTALRM',
  8688. 'SIGXCPU',
  8689. 'SIGXFSZ',
  8690. 'SIGUSR2',
  8691. 'SIGTRAP',
  8692. 'SIGSYS',
  8693. 'SIGQUIT',
  8694. 'SIGIOT'
  8695. // should detect profiler and enable/disable accordingly.
  8696. // see #21
  8697. // 'SIGPROF'
  8698. )
  8699. }
  8700. if (process.platform === 'linux') {
  8701. module.exports.push(
  8702. 'SIGIO',
  8703. 'SIGPOLL',
  8704. 'SIGPWR',
  8705. 'SIGSTKFLT',
  8706. 'SIGUNUSED'
  8707. )
  8708. }
  8709. /***/ }),
  8710. /***/ 656:
  8711. /***/ (function(module, exports) {
  8712. exports = module.exports = SemVer
  8713. var debug
  8714. /* istanbul ignore next */
  8715. if (typeof process === 'object' &&
  8716. process.env &&
  8717. process.env.NODE_DEBUG &&
  8718. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  8719. debug = function () {
  8720. var args = Array.prototype.slice.call(arguments, 0)
  8721. args.unshift('SEMVER')
  8722. console.log.apply(console, args)
  8723. }
  8724. } else {
  8725. debug = function () {}
  8726. }
  8727. // Note: this is the semver.org version of the spec that it implements
  8728. // Not necessarily the package version of this code.
  8729. exports.SEMVER_SPEC_VERSION = '2.0.0'
  8730. var MAX_LENGTH = 256
  8731. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  8732. /* istanbul ignore next */ 9007199254740991
  8733. // Max safe segment length for coercion.
  8734. var MAX_SAFE_COMPONENT_LENGTH = 16
  8735. // The actual regexps go on exports.re
  8736. var re = exports.re = []
  8737. var src = exports.src = []
  8738. var t = exports.tokens = {}
  8739. var R = 0
  8740. function tok (n) {
  8741. t[n] = R++
  8742. }
  8743. // The following Regular Expressions can be used for tokenizing,
  8744. // validating, and parsing SemVer version strings.
  8745. // ## Numeric Identifier
  8746. // A single `0`, or a non-zero digit followed by zero or more digits.
  8747. tok('NUMERICIDENTIFIER')
  8748. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  8749. tok('NUMERICIDENTIFIERLOOSE')
  8750. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  8751. // ## Non-numeric Identifier
  8752. // Zero or more digits, followed by a letter or hyphen, and then zero or
  8753. // more letters, digits, or hyphens.
  8754. tok('NONNUMERICIDENTIFIER')
  8755. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  8756. // ## Main Version
  8757. // Three dot-separated numeric identifiers.
  8758. tok('MAINVERSION')
  8759. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  8760. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  8761. '(' + src[t.NUMERICIDENTIFIER] + ')'
  8762. tok('MAINVERSIONLOOSE')
  8763. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  8764. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  8765. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  8766. // ## Pre-release Version Identifier
  8767. // A numeric identifier, or a non-numeric identifier.
  8768. tok('PRERELEASEIDENTIFIER')
  8769. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  8770. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  8771. tok('PRERELEASEIDENTIFIERLOOSE')
  8772. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  8773. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  8774. // ## Pre-release Version
  8775. // Hyphen, followed by one or more dot-separated pre-release version
  8776. // identifiers.
  8777. tok('PRERELEASE')
  8778. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  8779. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  8780. tok('PRERELEASELOOSE')
  8781. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  8782. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  8783. // ## Build Metadata Identifier
  8784. // Any combination of digits, letters, or hyphens.
  8785. tok('BUILDIDENTIFIER')
  8786. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  8787. // ## Build Metadata
  8788. // Plus sign, followed by one or more period-separated build metadata
  8789. // identifiers.
  8790. tok('BUILD')
  8791. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  8792. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  8793. // ## Full Version String
  8794. // A main version, followed optionally by a pre-release version and
  8795. // build metadata.
  8796. // Note that the only major, minor, patch, and pre-release sections of
  8797. // the version string are capturing groups. The build metadata is not a
  8798. // capturing group, because it should not ever be used in version
  8799. // comparison.
  8800. tok('FULL')
  8801. tok('FULLPLAIN')
  8802. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  8803. src[t.PRERELEASE] + '?' +
  8804. src[t.BUILD] + '?'
  8805. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  8806. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  8807. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  8808. // common in the npm registry.
  8809. tok('LOOSEPLAIN')
  8810. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  8811. src[t.PRERELEASELOOSE] + '?' +
  8812. src[t.BUILD] + '?'
  8813. tok('LOOSE')
  8814. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  8815. tok('GTLT')
  8816. src[t.GTLT] = '((?:<|>)?=?)'
  8817. // Something like "2.*" or "1.2.x".
  8818. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  8819. // Only the first item is strictly required.
  8820. tok('XRANGEIDENTIFIERLOOSE')
  8821. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  8822. tok('XRANGEIDENTIFIER')
  8823. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  8824. tok('XRANGEPLAIN')
  8825. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  8826. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  8827. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  8828. '(?:' + src[t.PRERELEASE] + ')?' +
  8829. src[t.BUILD] + '?' +
  8830. ')?)?'
  8831. tok('XRANGEPLAINLOOSE')
  8832. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  8833. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  8834. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  8835. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  8836. src[t.BUILD] + '?' +
  8837. ')?)?'
  8838. tok('XRANGE')
  8839. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  8840. tok('XRANGELOOSE')
  8841. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  8842. // Coercion.
  8843. // Extract anything that could conceivably be a part of a valid semver
  8844. tok('COERCE')
  8845. src[t.COERCE] = '(^|[^\\d])' +
  8846. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  8847. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  8848. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  8849. '(?:$|[^\\d])'
  8850. tok('COERCERTL')
  8851. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  8852. // Tilde ranges.
  8853. // Meaning is "reasonably at or greater than"
  8854. tok('LONETILDE')
  8855. src[t.LONETILDE] = '(?:~>?)'
  8856. tok('TILDETRIM')
  8857. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  8858. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  8859. var tildeTrimReplace = '$1~'
  8860. tok('TILDE')
  8861. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  8862. tok('TILDELOOSE')
  8863. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  8864. // Caret ranges.
  8865. // Meaning is "at least and backwards compatible with"
  8866. tok('LONECARET')
  8867. src[t.LONECARET] = '(?:\\^)'
  8868. tok('CARETTRIM')
  8869. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  8870. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  8871. var caretTrimReplace = '$1^'
  8872. tok('CARET')
  8873. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  8874. tok('CARETLOOSE')
  8875. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  8876. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  8877. tok('COMPARATORLOOSE')
  8878. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  8879. tok('COMPARATOR')
  8880. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  8881. // An expression to strip any whitespace between the gtlt and the thing
  8882. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  8883. tok('COMPARATORTRIM')
  8884. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  8885. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  8886. // this one has to use the /g flag
  8887. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  8888. var comparatorTrimReplace = '$1$2$3'
  8889. // Something like `1.2.3 - 1.2.4`
  8890. // Note that these all use the loose form, because they'll be
  8891. // checked against either the strict or loose comparator form
  8892. // later.
  8893. tok('HYPHENRANGE')
  8894. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  8895. '\\s+-\\s+' +
  8896. '(' + src[t.XRANGEPLAIN] + ')' +
  8897. '\\s*$'
  8898. tok('HYPHENRANGELOOSE')
  8899. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  8900. '\\s+-\\s+' +
  8901. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  8902. '\\s*$'
  8903. // Star ranges basically just allow anything at all.
  8904. tok('STAR')
  8905. src[t.STAR] = '(<|>)?=?\\s*\\*'
  8906. // Compile to actual regexp objects.
  8907. // All are flag-free, unless they were created above with a flag.
  8908. for (var i = 0; i < R; i++) {
  8909. debug(i, src[i])
  8910. if (!re[i]) {
  8911. re[i] = new RegExp(src[i])
  8912. }
  8913. }
  8914. exports.parse = parse
  8915. function parse (version, options) {
  8916. if (!options || typeof options !== 'object') {
  8917. options = {
  8918. loose: !!options,
  8919. includePrerelease: false
  8920. }
  8921. }
  8922. if (version instanceof SemVer) {
  8923. return version
  8924. }
  8925. if (typeof version !== 'string') {
  8926. return null
  8927. }
  8928. if (version.length > MAX_LENGTH) {
  8929. return null
  8930. }
  8931. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  8932. if (!r.test(version)) {
  8933. return null
  8934. }
  8935. try {
  8936. return new SemVer(version, options)
  8937. } catch (er) {
  8938. return null
  8939. }
  8940. }
  8941. exports.valid = valid
  8942. function valid (version, options) {
  8943. var v = parse(version, options)
  8944. return v ? v.version : null
  8945. }
  8946. exports.clean = clean
  8947. function clean (version, options) {
  8948. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  8949. return s ? s.version : null
  8950. }
  8951. exports.SemVer = SemVer
  8952. function SemVer (version, options) {
  8953. if (!options || typeof options !== 'object') {
  8954. options = {
  8955. loose: !!options,
  8956. includePrerelease: false
  8957. }
  8958. }
  8959. if (version instanceof SemVer) {
  8960. if (version.loose === options.loose) {
  8961. return version
  8962. } else {
  8963. version = version.version
  8964. }
  8965. } else if (typeof version !== 'string') {
  8966. throw new TypeError('Invalid Version: ' + version)
  8967. }
  8968. if (version.length > MAX_LENGTH) {
  8969. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  8970. }
  8971. if (!(this instanceof SemVer)) {
  8972. return new SemVer(version, options)
  8973. }
  8974. debug('SemVer', version, options)
  8975. this.options = options
  8976. this.loose = !!options.loose
  8977. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  8978. if (!m) {
  8979. throw new TypeError('Invalid Version: ' + version)
  8980. }
  8981. this.raw = version
  8982. // these are actually numbers
  8983. this.major = +m[1]
  8984. this.minor = +m[2]
  8985. this.patch = +m[3]
  8986. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  8987. throw new TypeError('Invalid major version')
  8988. }
  8989. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  8990. throw new TypeError('Invalid minor version')
  8991. }
  8992. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  8993. throw new TypeError('Invalid patch version')
  8994. }
  8995. // numberify any prerelease numeric ids
  8996. if (!m[4]) {
  8997. this.prerelease = []
  8998. } else {
  8999. this.prerelease = m[4].split('.').map(function (id) {
  9000. if (/^[0-9]+$/.test(id)) {
  9001. var num = +id
  9002. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  9003. return num
  9004. }
  9005. }
  9006. return id
  9007. })
  9008. }
  9009. this.build = m[5] ? m[5].split('.') : []
  9010. this.format()
  9011. }
  9012. SemVer.prototype.format = function () {
  9013. this.version = this.major + '.' + this.minor + '.' + this.patch
  9014. if (this.prerelease.length) {
  9015. this.version += '-' + this.prerelease.join('.')
  9016. }
  9017. return this.version
  9018. }
  9019. SemVer.prototype.toString = function () {
  9020. return this.version
  9021. }
  9022. SemVer.prototype.compare = function (other) {
  9023. debug('SemVer.compare', this.version, this.options, other)
  9024. if (!(other instanceof SemVer)) {
  9025. other = new SemVer(other, this.options)
  9026. }
  9027. return this.compareMain(other) || this.comparePre(other)
  9028. }
  9029. SemVer.prototype.compareMain = function (other) {
  9030. if (!(other instanceof SemVer)) {
  9031. other = new SemVer(other, this.options)
  9032. }
  9033. return compareIdentifiers(this.major, other.major) ||
  9034. compareIdentifiers(this.minor, other.minor) ||
  9035. compareIdentifiers(this.patch, other.patch)
  9036. }
  9037. SemVer.prototype.comparePre = function (other) {
  9038. if (!(other instanceof SemVer)) {
  9039. other = new SemVer(other, this.options)
  9040. }
  9041. // NOT having a prerelease is > having one
  9042. if (this.prerelease.length && !other.prerelease.length) {
  9043. return -1
  9044. } else if (!this.prerelease.length && other.prerelease.length) {
  9045. return 1
  9046. } else if (!this.prerelease.length && !other.prerelease.length) {
  9047. return 0
  9048. }
  9049. var i = 0
  9050. do {
  9051. var a = this.prerelease[i]
  9052. var b = other.prerelease[i]
  9053. debug('prerelease compare', i, a, b)
  9054. if (a === undefined && b === undefined) {
  9055. return 0
  9056. } else if (b === undefined) {
  9057. return 1
  9058. } else if (a === undefined) {
  9059. return -1
  9060. } else if (a === b) {
  9061. continue
  9062. } else {
  9063. return compareIdentifiers(a, b)
  9064. }
  9065. } while (++i)
  9066. }
  9067. SemVer.prototype.compareBuild = function (other) {
  9068. if (!(other instanceof SemVer)) {
  9069. other = new SemVer(other, this.options)
  9070. }
  9071. var i = 0
  9072. do {
  9073. var a = this.build[i]
  9074. var b = other.build[i]
  9075. debug('prerelease compare', i, a, b)
  9076. if (a === undefined && b === undefined) {
  9077. return 0
  9078. } else if (b === undefined) {
  9079. return 1
  9080. } else if (a === undefined) {
  9081. return -1
  9082. } else if (a === b) {
  9083. continue
  9084. } else {
  9085. return compareIdentifiers(a, b)
  9086. }
  9087. } while (++i)
  9088. }
  9089. // preminor will bump the version up to the next minor release, and immediately
  9090. // down to pre-release. premajor and prepatch work the same way.
  9091. SemVer.prototype.inc = function (release, identifier) {
  9092. switch (release) {
  9093. case 'premajor':
  9094. this.prerelease.length = 0
  9095. this.patch = 0
  9096. this.minor = 0
  9097. this.major++
  9098. this.inc('pre', identifier)
  9099. break
  9100. case 'preminor':
  9101. this.prerelease.length = 0
  9102. this.patch = 0
  9103. this.minor++
  9104. this.inc('pre', identifier)
  9105. break
  9106. case 'prepatch':
  9107. // If this is already a prerelease, it will bump to the next version
  9108. // drop any prereleases that might already exist, since they are not
  9109. // relevant at this point.
  9110. this.prerelease.length = 0
  9111. this.inc('patch', identifier)
  9112. this.inc('pre', identifier)
  9113. break
  9114. // If the input is a non-prerelease version, this acts the same as
  9115. // prepatch.
  9116. case 'prerelease':
  9117. if (this.prerelease.length === 0) {
  9118. this.inc('patch', identifier)
  9119. }
  9120. this.inc('pre', identifier)
  9121. break
  9122. case 'major':
  9123. // If this is a pre-major version, bump up to the same major version.
  9124. // Otherwise increment major.
  9125. // 1.0.0-5 bumps to 1.0.0
  9126. // 1.1.0 bumps to 2.0.0
  9127. if (this.minor !== 0 ||
  9128. this.patch !== 0 ||
  9129. this.prerelease.length === 0) {
  9130. this.major++
  9131. }
  9132. this.minor = 0
  9133. this.patch = 0
  9134. this.prerelease = []
  9135. break
  9136. case 'minor':
  9137. // If this is a pre-minor version, bump up to the same minor version.
  9138. // Otherwise increment minor.
  9139. // 1.2.0-5 bumps to 1.2.0
  9140. // 1.2.1 bumps to 1.3.0
  9141. if (this.patch !== 0 || this.prerelease.length === 0) {
  9142. this.minor++
  9143. }
  9144. this.patch = 0
  9145. this.prerelease = []
  9146. break
  9147. case 'patch':
  9148. // If this is not a pre-release version, it will increment the patch.
  9149. // If it is a pre-release it will bump up to the same patch version.
  9150. // 1.2.0-5 patches to 1.2.0
  9151. // 1.2.0 patches to 1.2.1
  9152. if (this.prerelease.length === 0) {
  9153. this.patch++
  9154. }
  9155. this.prerelease = []
  9156. break
  9157. // This probably shouldn't be used publicly.
  9158. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  9159. case 'pre':
  9160. if (this.prerelease.length === 0) {
  9161. this.prerelease = [0]
  9162. } else {
  9163. var i = this.prerelease.length
  9164. while (--i >= 0) {
  9165. if (typeof this.prerelease[i] === 'number') {
  9166. this.prerelease[i]++
  9167. i = -2
  9168. }
  9169. }
  9170. if (i === -1) {
  9171. // didn't increment anything
  9172. this.prerelease.push(0)
  9173. }
  9174. }
  9175. if (identifier) {
  9176. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  9177. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  9178. if (this.prerelease[0] === identifier) {
  9179. if (isNaN(this.prerelease[1])) {
  9180. this.prerelease = [identifier, 0]
  9181. }
  9182. } else {
  9183. this.prerelease = [identifier, 0]
  9184. }
  9185. }
  9186. break
  9187. default:
  9188. throw new Error('invalid increment argument: ' + release)
  9189. }
  9190. this.format()
  9191. this.raw = this.version
  9192. return this
  9193. }
  9194. exports.inc = inc
  9195. function inc (version, release, loose, identifier) {
  9196. if (typeof (loose) === 'string') {
  9197. identifier = loose
  9198. loose = undefined
  9199. }
  9200. try {
  9201. return new SemVer(version, loose).inc(release, identifier).version
  9202. } catch (er) {
  9203. return null
  9204. }
  9205. }
  9206. exports.diff = diff
  9207. function diff (version1, version2) {
  9208. if (eq(version1, version2)) {
  9209. return null
  9210. } else {
  9211. var v1 = parse(version1)
  9212. var v2 = parse(version2)
  9213. var prefix = ''
  9214. if (v1.prerelease.length || v2.prerelease.length) {
  9215. prefix = 'pre'
  9216. var defaultResult = 'prerelease'
  9217. }
  9218. for (var key in v1) {
  9219. if (key === 'major' || key === 'minor' || key === 'patch') {
  9220. if (v1[key] !== v2[key]) {
  9221. return prefix + key
  9222. }
  9223. }
  9224. }
  9225. return defaultResult // may be undefined
  9226. }
  9227. }
  9228. exports.compareIdentifiers = compareIdentifiers
  9229. var numeric = /^[0-9]+$/
  9230. function compareIdentifiers (a, b) {
  9231. var anum = numeric.test(a)
  9232. var bnum = numeric.test(b)
  9233. if (anum && bnum) {
  9234. a = +a
  9235. b = +b
  9236. }
  9237. return a === b ? 0
  9238. : (anum && !bnum) ? -1
  9239. : (bnum && !anum) ? 1
  9240. : a < b ? -1
  9241. : 1
  9242. }
  9243. exports.rcompareIdentifiers = rcompareIdentifiers
  9244. function rcompareIdentifiers (a, b) {
  9245. return compareIdentifiers(b, a)
  9246. }
  9247. exports.major = major
  9248. function major (a, loose) {
  9249. return new SemVer(a, loose).major
  9250. }
  9251. exports.minor = minor
  9252. function minor (a, loose) {
  9253. return new SemVer(a, loose).minor
  9254. }
  9255. exports.patch = patch
  9256. function patch (a, loose) {
  9257. return new SemVer(a, loose).patch
  9258. }
  9259. exports.compare = compare
  9260. function compare (a, b, loose) {
  9261. return new SemVer(a, loose).compare(new SemVer(b, loose))
  9262. }
  9263. exports.compareLoose = compareLoose
  9264. function compareLoose (a, b) {
  9265. return compare(a, b, true)
  9266. }
  9267. exports.compareBuild = compareBuild
  9268. function compareBuild (a, b, loose) {
  9269. var versionA = new SemVer(a, loose)
  9270. var versionB = new SemVer(b, loose)
  9271. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  9272. }
  9273. exports.rcompare = rcompare
  9274. function rcompare (a, b, loose) {
  9275. return compare(b, a, loose)
  9276. }
  9277. exports.sort = sort
  9278. function sort (list, loose) {
  9279. return list.sort(function (a, b) {
  9280. return exports.compareBuild(a, b, loose)
  9281. })
  9282. }
  9283. exports.rsort = rsort
  9284. function rsort (list, loose) {
  9285. return list.sort(function (a, b) {
  9286. return exports.compareBuild(b, a, loose)
  9287. })
  9288. }
  9289. exports.gt = gt
  9290. function gt (a, b, loose) {
  9291. return compare(a, b, loose) > 0
  9292. }
  9293. exports.lt = lt
  9294. function lt (a, b, loose) {
  9295. return compare(a, b, loose) < 0
  9296. }
  9297. exports.eq = eq
  9298. function eq (a, b, loose) {
  9299. return compare(a, b, loose) === 0
  9300. }
  9301. exports.neq = neq
  9302. function neq (a, b, loose) {
  9303. return compare(a, b, loose) !== 0
  9304. }
  9305. exports.gte = gte
  9306. function gte (a, b, loose) {
  9307. return compare(a, b, loose) >= 0
  9308. }
  9309. exports.lte = lte
  9310. function lte (a, b, loose) {
  9311. return compare(a, b, loose) <= 0
  9312. }
  9313. exports.cmp = cmp
  9314. function cmp (a, op, b, loose) {
  9315. switch (op) {
  9316. case '===':
  9317. if (typeof a === 'object')
  9318. a = a.version
  9319. if (typeof b === 'object')
  9320. b = b.version
  9321. return a === b
  9322. case '!==':
  9323. if (typeof a === 'object')
  9324. a = a.version
  9325. if (typeof b === 'object')
  9326. b = b.version
  9327. return a !== b
  9328. case '':
  9329. case '=':
  9330. case '==':
  9331. return eq(a, b, loose)
  9332. case '!=':
  9333. return neq(a, b, loose)
  9334. case '>':
  9335. return gt(a, b, loose)
  9336. case '>=':
  9337. return gte(a, b, loose)
  9338. case '<':
  9339. return lt(a, b, loose)
  9340. case '<=':
  9341. return lte(a, b, loose)
  9342. default:
  9343. throw new TypeError('Invalid operator: ' + op)
  9344. }
  9345. }
  9346. exports.Comparator = Comparator
  9347. function Comparator (comp, options) {
  9348. if (!options || typeof options !== 'object') {
  9349. options = {
  9350. loose: !!options,
  9351. includePrerelease: false
  9352. }
  9353. }
  9354. if (comp instanceof Comparator) {
  9355. if (comp.loose === !!options.loose) {
  9356. return comp
  9357. } else {
  9358. comp = comp.value
  9359. }
  9360. }
  9361. if (!(this instanceof Comparator)) {
  9362. return new Comparator(comp, options)
  9363. }
  9364. debug('comparator', comp, options)
  9365. this.options = options
  9366. this.loose = !!options.loose
  9367. this.parse(comp)
  9368. if (this.semver === ANY) {
  9369. this.value = ''
  9370. } else {
  9371. this.value = this.operator + this.semver.version
  9372. }
  9373. debug('comp', this)
  9374. }
  9375. var ANY = {}
  9376. Comparator.prototype.parse = function (comp) {
  9377. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  9378. var m = comp.match(r)
  9379. if (!m) {
  9380. throw new TypeError('Invalid comparator: ' + comp)
  9381. }
  9382. this.operator = m[1] !== undefined ? m[1] : ''
  9383. if (this.operator === '=') {
  9384. this.operator = ''
  9385. }
  9386. // if it literally is just '>' or '' then allow anything.
  9387. if (!m[2]) {
  9388. this.semver = ANY
  9389. } else {
  9390. this.semver = new SemVer(m[2], this.options.loose)
  9391. }
  9392. }
  9393. Comparator.prototype.toString = function () {
  9394. return this.value
  9395. }
  9396. Comparator.prototype.test = function (version) {
  9397. debug('Comparator.test', version, this.options.loose)
  9398. if (this.semver === ANY || version === ANY) {
  9399. return true
  9400. }
  9401. if (typeof version === 'string') {
  9402. try {
  9403. version = new SemVer(version, this.options)
  9404. } catch (er) {
  9405. return false
  9406. }
  9407. }
  9408. return cmp(version, this.operator, this.semver, this.options)
  9409. }
  9410. Comparator.prototype.intersects = function (comp, options) {
  9411. if (!(comp instanceof Comparator)) {
  9412. throw new TypeError('a Comparator is required')
  9413. }
  9414. if (!options || typeof options !== 'object') {
  9415. options = {
  9416. loose: !!options,
  9417. includePrerelease: false
  9418. }
  9419. }
  9420. var rangeTmp
  9421. if (this.operator === '') {
  9422. if (this.value === '') {
  9423. return true
  9424. }
  9425. rangeTmp = new Range(comp.value, options)
  9426. return satisfies(this.value, rangeTmp, options)
  9427. } else if (comp.operator === '') {
  9428. if (comp.value === '') {
  9429. return true
  9430. }
  9431. rangeTmp = new Range(this.value, options)
  9432. return satisfies(comp.semver, rangeTmp, options)
  9433. }
  9434. var sameDirectionIncreasing =
  9435. (this.operator === '>=' || this.operator === '>') &&
  9436. (comp.operator === '>=' || comp.operator === '>')
  9437. var sameDirectionDecreasing =
  9438. (this.operator === '<=' || this.operator === '<') &&
  9439. (comp.operator === '<=' || comp.operator === '<')
  9440. var sameSemVer = this.semver.version === comp.semver.version
  9441. var differentDirectionsInclusive =
  9442. (this.operator === '>=' || this.operator === '<=') &&
  9443. (comp.operator === '>=' || comp.operator === '<=')
  9444. var oppositeDirectionsLessThan =
  9445. cmp(this.semver, '<', comp.semver, options) &&
  9446. ((this.operator === '>=' || this.operator === '>') &&
  9447. (comp.operator === '<=' || comp.operator === '<'))
  9448. var oppositeDirectionsGreaterThan =
  9449. cmp(this.semver, '>', comp.semver, options) &&
  9450. ((this.operator === '<=' || this.operator === '<') &&
  9451. (comp.operator === '>=' || comp.operator === '>'))
  9452. return sameDirectionIncreasing || sameDirectionDecreasing ||
  9453. (sameSemVer && differentDirectionsInclusive) ||
  9454. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  9455. }
  9456. exports.Range = Range
  9457. function Range (range, options) {
  9458. if (!options || typeof options !== 'object') {
  9459. options = {
  9460. loose: !!options,
  9461. includePrerelease: false
  9462. }
  9463. }
  9464. if (range instanceof Range) {
  9465. if (range.loose === !!options.loose &&
  9466. range.includePrerelease === !!options.includePrerelease) {
  9467. return range
  9468. } else {
  9469. return new Range(range.raw, options)
  9470. }
  9471. }
  9472. if (range instanceof Comparator) {
  9473. return new Range(range.value, options)
  9474. }
  9475. if (!(this instanceof Range)) {
  9476. return new Range(range, options)
  9477. }
  9478. this.options = options
  9479. this.loose = !!options.loose
  9480. this.includePrerelease = !!options.includePrerelease
  9481. // First, split based on boolean or ||
  9482. this.raw = range
  9483. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  9484. return this.parseRange(range.trim())
  9485. }, this).filter(function (c) {
  9486. // throw out any that are not relevant for whatever reason
  9487. return c.length
  9488. })
  9489. if (!this.set.length) {
  9490. throw new TypeError('Invalid SemVer Range: ' + range)
  9491. }
  9492. this.format()
  9493. }
  9494. Range.prototype.format = function () {
  9495. this.range = this.set.map(function (comps) {
  9496. return comps.join(' ').trim()
  9497. }).join('||').trim()
  9498. return this.range
  9499. }
  9500. Range.prototype.toString = function () {
  9501. return this.range
  9502. }
  9503. Range.prototype.parseRange = function (range) {
  9504. var loose = this.options.loose
  9505. range = range.trim()
  9506. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  9507. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  9508. range = range.replace(hr, hyphenReplace)
  9509. debug('hyphen replace', range)
  9510. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  9511. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  9512. debug('comparator trim', range, re[t.COMPARATORTRIM])
  9513. // `~ 1.2.3` => `~1.2.3`
  9514. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  9515. // `^ 1.2.3` => `^1.2.3`
  9516. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  9517. // normalize spaces
  9518. range = range.split(/\s+/).join(' ')
  9519. // At this point, the range is completely trimmed and
  9520. // ready to be split into comparators.
  9521. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  9522. var set = range.split(' ').map(function (comp) {
  9523. return parseComparator(comp, this.options)
  9524. }, this).join(' ').split(/\s+/)
  9525. if (this.options.loose) {
  9526. // in loose mode, throw out any that are not valid comparators
  9527. set = set.filter(function (comp) {
  9528. return !!comp.match(compRe)
  9529. })
  9530. }
  9531. set = set.map(function (comp) {
  9532. return new Comparator(comp, this.options)
  9533. }, this)
  9534. return set
  9535. }
  9536. Range.prototype.intersects = function (range, options) {
  9537. if (!(range instanceof Range)) {
  9538. throw new TypeError('a Range is required')
  9539. }
  9540. return this.set.some(function (thisComparators) {
  9541. return (
  9542. isSatisfiable(thisComparators, options) &&
  9543. range.set.some(function (rangeComparators) {
  9544. return (
  9545. isSatisfiable(rangeComparators, options) &&
  9546. thisComparators.every(function (thisComparator) {
  9547. return rangeComparators.every(function (rangeComparator) {
  9548. return thisComparator.intersects(rangeComparator, options)
  9549. })
  9550. })
  9551. )
  9552. })
  9553. )
  9554. })
  9555. }
  9556. // take a set of comparators and determine whether there
  9557. // exists a version which can satisfy it
  9558. function isSatisfiable (comparators, options) {
  9559. var result = true
  9560. var remainingComparators = comparators.slice()
  9561. var testComparator = remainingComparators.pop()
  9562. while (result && remainingComparators.length) {
  9563. result = remainingComparators.every(function (otherComparator) {
  9564. return testComparator.intersects(otherComparator, options)
  9565. })
  9566. testComparator = remainingComparators.pop()
  9567. }
  9568. return result
  9569. }
  9570. // Mostly just for testing and legacy API reasons
  9571. exports.toComparators = toComparators
  9572. function toComparators (range, options) {
  9573. return new Range(range, options).set.map(function (comp) {
  9574. return comp.map(function (c) {
  9575. return c.value
  9576. }).join(' ').trim().split(' ')
  9577. })
  9578. }
  9579. // comprised of xranges, tildes, stars, and gtlt's at this point.
  9580. // already replaced the hyphen ranges
  9581. // turn into a set of JUST comparators.
  9582. function parseComparator (comp, options) {
  9583. debug('comp', comp, options)
  9584. comp = replaceCarets(comp, options)
  9585. debug('caret', comp)
  9586. comp = replaceTildes(comp, options)
  9587. debug('tildes', comp)
  9588. comp = replaceXRanges(comp, options)
  9589. debug('xrange', comp)
  9590. comp = replaceStars(comp, options)
  9591. debug('stars', comp)
  9592. return comp
  9593. }
  9594. function isX (id) {
  9595. return !id || id.toLowerCase() === 'x' || id === '*'
  9596. }
  9597. // ~, ~> --> * (any, kinda silly)
  9598. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  9599. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  9600. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  9601. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  9602. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  9603. function replaceTildes (comp, options) {
  9604. return comp.trim().split(/\s+/).map(function (comp) {
  9605. return replaceTilde(comp, options)
  9606. }).join(' ')
  9607. }
  9608. function replaceTilde (comp, options) {
  9609. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  9610. return comp.replace(r, function (_, M, m, p, pr) {
  9611. debug('tilde', comp, _, M, m, p, pr)
  9612. var ret
  9613. if (isX(M)) {
  9614. ret = ''
  9615. } else if (isX(m)) {
  9616. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  9617. } else if (isX(p)) {
  9618. // ~1.2 == >=1.2.0 <1.3.0
  9619. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  9620. } else if (pr) {
  9621. debug('replaceTilde pr', pr)
  9622. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9623. ' <' + M + '.' + (+m + 1) + '.0'
  9624. } else {
  9625. // ~1.2.3 == >=1.2.3 <1.3.0
  9626. ret = '>=' + M + '.' + m + '.' + p +
  9627. ' <' + M + '.' + (+m + 1) + '.0'
  9628. }
  9629. debug('tilde return', ret)
  9630. return ret
  9631. })
  9632. }
  9633. // ^ --> * (any, kinda silly)
  9634. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  9635. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  9636. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  9637. // ^1.2.3 --> >=1.2.3 <2.0.0
  9638. // ^1.2.0 --> >=1.2.0 <2.0.0
  9639. function replaceCarets (comp, options) {
  9640. return comp.trim().split(/\s+/).map(function (comp) {
  9641. return replaceCaret(comp, options)
  9642. }).join(' ')
  9643. }
  9644. function replaceCaret (comp, options) {
  9645. debug('caret', comp, options)
  9646. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  9647. return comp.replace(r, function (_, M, m, p, pr) {
  9648. debug('caret', comp, _, M, m, p, pr)
  9649. var ret
  9650. if (isX(M)) {
  9651. ret = ''
  9652. } else if (isX(m)) {
  9653. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  9654. } else if (isX(p)) {
  9655. if (M === '0') {
  9656. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  9657. } else {
  9658. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  9659. }
  9660. } else if (pr) {
  9661. debug('replaceCaret pr', pr)
  9662. if (M === '0') {
  9663. if (m === '0') {
  9664. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9665. ' <' + M + '.' + m + '.' + (+p + 1)
  9666. } else {
  9667. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9668. ' <' + M + '.' + (+m + 1) + '.0'
  9669. }
  9670. } else {
  9671. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  9672. ' <' + (+M + 1) + '.0.0'
  9673. }
  9674. } else {
  9675. debug('no pr')
  9676. if (M === '0') {
  9677. if (m === '0') {
  9678. ret = '>=' + M + '.' + m + '.' + p +
  9679. ' <' + M + '.' + m + '.' + (+p + 1)
  9680. } else {
  9681. ret = '>=' + M + '.' + m + '.' + p +
  9682. ' <' + M + '.' + (+m + 1) + '.0'
  9683. }
  9684. } else {
  9685. ret = '>=' + M + '.' + m + '.' + p +
  9686. ' <' + (+M + 1) + '.0.0'
  9687. }
  9688. }
  9689. debug('caret return', ret)
  9690. return ret
  9691. })
  9692. }
  9693. function replaceXRanges (comp, options) {
  9694. debug('replaceXRanges', comp, options)
  9695. return comp.split(/\s+/).map(function (comp) {
  9696. return replaceXRange(comp, options)
  9697. }).join(' ')
  9698. }
  9699. function replaceXRange (comp, options) {
  9700. comp = comp.trim()
  9701. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  9702. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  9703. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  9704. var xM = isX(M)
  9705. var xm = xM || isX(m)
  9706. var xp = xm || isX(p)
  9707. var anyX = xp
  9708. if (gtlt === '=' && anyX) {
  9709. gtlt = ''
  9710. }
  9711. // if we're including prereleases in the match, then we need
  9712. // to fix this to -0, the lowest possible prerelease value
  9713. pr = options.includePrerelease ? '-0' : ''
  9714. if (xM) {
  9715. if (gtlt === '>' || gtlt === '<') {
  9716. // nothing is allowed
  9717. ret = '<0.0.0-0'
  9718. } else {
  9719. // nothing is forbidden
  9720. ret = '*'
  9721. }
  9722. } else if (gtlt && anyX) {
  9723. // we know patch is an x, because we have any x at all.
  9724. // replace X with 0
  9725. if (xm) {
  9726. m = 0
  9727. }
  9728. p = 0
  9729. if (gtlt === '>') {
  9730. // >1 => >=2.0.0
  9731. // >1.2 => >=1.3.0
  9732. // >1.2.3 => >= 1.2.4
  9733. gtlt = '>='
  9734. if (xm) {
  9735. M = +M + 1
  9736. m = 0
  9737. p = 0
  9738. } else {
  9739. m = +m + 1
  9740. p = 0
  9741. }
  9742. } else if (gtlt === '<=') {
  9743. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  9744. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  9745. gtlt = '<'
  9746. if (xm) {
  9747. M = +M + 1
  9748. } else {
  9749. m = +m + 1
  9750. }
  9751. }
  9752. ret = gtlt + M + '.' + m + '.' + p + pr
  9753. } else if (xm) {
  9754. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  9755. } else if (xp) {
  9756. ret = '>=' + M + '.' + m + '.0' + pr +
  9757. ' <' + M + '.' + (+m + 1) + '.0' + pr
  9758. }
  9759. debug('xRange return', ret)
  9760. return ret
  9761. })
  9762. }
  9763. // Because * is AND-ed with everything else in the comparator,
  9764. // and '' means "any version", just remove the *s entirely.
  9765. function replaceStars (comp, options) {
  9766. debug('replaceStars', comp, options)
  9767. // Looseness is ignored here. star is always as loose as it gets!
  9768. return comp.trim().replace(re[t.STAR], '')
  9769. }
  9770. // This function is passed to string.replace(re[t.HYPHENRANGE])
  9771. // M, m, patch, prerelease, build
  9772. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  9773. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  9774. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  9775. function hyphenReplace ($0,
  9776. from, fM, fm, fp, fpr, fb,
  9777. to, tM, tm, tp, tpr, tb) {
  9778. if (isX(fM)) {
  9779. from = ''
  9780. } else if (isX(fm)) {
  9781. from = '>=' + fM + '.0.0'
  9782. } else if (isX(fp)) {
  9783. from = '>=' + fM + '.' + fm + '.0'
  9784. } else {
  9785. from = '>=' + from
  9786. }
  9787. if (isX(tM)) {
  9788. to = ''
  9789. } else if (isX(tm)) {
  9790. to = '<' + (+tM + 1) + '.0.0'
  9791. } else if (isX(tp)) {
  9792. to = '<' + tM + '.' + (+tm + 1) + '.0'
  9793. } else if (tpr) {
  9794. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  9795. } else {
  9796. to = '<=' + to
  9797. }
  9798. return (from + ' ' + to).trim()
  9799. }
  9800. // if ANY of the sets match ALL of its comparators, then pass
  9801. Range.prototype.test = function (version) {
  9802. if (!version) {
  9803. return false
  9804. }
  9805. if (typeof version === 'string') {
  9806. try {
  9807. version = new SemVer(version, this.options)
  9808. } catch (er) {
  9809. return false
  9810. }
  9811. }
  9812. for (var i = 0; i < this.set.length; i++) {
  9813. if (testSet(this.set[i], version, this.options)) {
  9814. return true
  9815. }
  9816. }
  9817. return false
  9818. }
  9819. function testSet (set, version, options) {
  9820. for (var i = 0; i < set.length; i++) {
  9821. if (!set[i].test(version)) {
  9822. return false
  9823. }
  9824. }
  9825. if (version.prerelease.length && !options.includePrerelease) {
  9826. // Find the set of versions that are allowed to have prereleases
  9827. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  9828. // That should allow `1.2.3-pr.2` to pass.
  9829. // However, `1.2.4-alpha.notready` should NOT be allowed,
  9830. // even though it's within the range set by the comparators.
  9831. for (i = 0; i < set.length; i++) {
  9832. debug(set[i].semver)
  9833. if (set[i].semver === ANY) {
  9834. continue
  9835. }
  9836. if (set[i].semver.prerelease.length > 0) {
  9837. var allowed = set[i].semver
  9838. if (allowed.major === version.major &&
  9839. allowed.minor === version.minor &&
  9840. allowed.patch === version.patch) {
  9841. return true
  9842. }
  9843. }
  9844. }
  9845. // Version has a -pre, but it's not one of the ones we like.
  9846. return false
  9847. }
  9848. return true
  9849. }
  9850. exports.satisfies = satisfies
  9851. function satisfies (version, range, options) {
  9852. try {
  9853. range = new Range(range, options)
  9854. } catch (er) {
  9855. return false
  9856. }
  9857. return range.test(version)
  9858. }
  9859. exports.maxSatisfying = maxSatisfying
  9860. function maxSatisfying (versions, range, options) {
  9861. var max = null
  9862. var maxSV = null
  9863. try {
  9864. var rangeObj = new Range(range, options)
  9865. } catch (er) {
  9866. return null
  9867. }
  9868. versions.forEach(function (v) {
  9869. if (rangeObj.test(v)) {
  9870. // satisfies(v, range, options)
  9871. if (!max || maxSV.compare(v) === -1) {
  9872. // compare(max, v, true)
  9873. max = v
  9874. maxSV = new SemVer(max, options)
  9875. }
  9876. }
  9877. })
  9878. return max
  9879. }
  9880. exports.minSatisfying = minSatisfying
  9881. function minSatisfying (versions, range, options) {
  9882. var min = null
  9883. var minSV = null
  9884. try {
  9885. var rangeObj = new Range(range, options)
  9886. } catch (er) {
  9887. return null
  9888. }
  9889. versions.forEach(function (v) {
  9890. if (rangeObj.test(v)) {
  9891. // satisfies(v, range, options)
  9892. if (!min || minSV.compare(v) === 1) {
  9893. // compare(min, v, true)
  9894. min = v
  9895. minSV = new SemVer(min, options)
  9896. }
  9897. }
  9898. })
  9899. return min
  9900. }
  9901. exports.minVersion = minVersion
  9902. function minVersion (range, loose) {
  9903. range = new Range(range, loose)
  9904. var minver = new SemVer('0.0.0')
  9905. if (range.test(minver)) {
  9906. return minver
  9907. }
  9908. minver = new SemVer('0.0.0-0')
  9909. if (range.test(minver)) {
  9910. return minver
  9911. }
  9912. minver = null
  9913. for (var i = 0; i < range.set.length; ++i) {
  9914. var comparators = range.set[i]
  9915. comparators.forEach(function (comparator) {
  9916. // Clone to avoid manipulating the comparator's semver object.
  9917. var compver = new SemVer(comparator.semver.version)
  9918. switch (comparator.operator) {
  9919. case '>':
  9920. if (compver.prerelease.length === 0) {
  9921. compver.patch++
  9922. } else {
  9923. compver.prerelease.push(0)
  9924. }
  9925. compver.raw = compver.format()
  9926. /* fallthrough */
  9927. case '':
  9928. case '>=':
  9929. if (!minver || gt(minver, compver)) {
  9930. minver = compver
  9931. }
  9932. break
  9933. case '<':
  9934. case '<=':
  9935. /* Ignore maximum versions */
  9936. break
  9937. /* istanbul ignore next */
  9938. default:
  9939. throw new Error('Unexpected operation: ' + comparator.operator)
  9940. }
  9941. })
  9942. }
  9943. if (minver && range.test(minver)) {
  9944. return minver
  9945. }
  9946. return null
  9947. }
  9948. exports.validRange = validRange
  9949. function validRange (range, options) {
  9950. try {
  9951. // Return '*' instead of '' so that truthiness works.
  9952. // This will throw if it's invalid anyway
  9953. return new Range(range, options).range || '*'
  9954. } catch (er) {
  9955. return null
  9956. }
  9957. }
  9958. // Determine if version is less than all the versions possible in the range
  9959. exports.ltr = ltr
  9960. function ltr (version, range, options) {
  9961. return outside(version, range, '<', options)
  9962. }
  9963. // Determine if version is greater than all the versions possible in the range.
  9964. exports.gtr = gtr
  9965. function gtr (version, range, options) {
  9966. return outside(version, range, '>', options)
  9967. }
  9968. exports.outside = outside
  9969. function outside (version, range, hilo, options) {
  9970. version = new SemVer(version, options)
  9971. range = new Range(range, options)
  9972. var gtfn, ltefn, ltfn, comp, ecomp
  9973. switch (hilo) {
  9974. case '>':
  9975. gtfn = gt
  9976. ltefn = lte
  9977. ltfn = lt
  9978. comp = '>'
  9979. ecomp = '>='
  9980. break
  9981. case '<':
  9982. gtfn = lt
  9983. ltefn = gte
  9984. ltfn = gt
  9985. comp = '<'
  9986. ecomp = '<='
  9987. break
  9988. default:
  9989. throw new TypeError('Must provide a hilo val of "<" or ">"')
  9990. }
  9991. // If it satisifes the range it is not outside
  9992. if (satisfies(version, range, options)) {
  9993. return false
  9994. }
  9995. // From now on, variable terms are as if we're in "gtr" mode.
  9996. // but note that everything is flipped for the "ltr" function.
  9997. for (var i = 0; i < range.set.length; ++i) {
  9998. var comparators = range.set[i]
  9999. var high = null
  10000. var low = null
  10001. comparators.forEach(function (comparator) {
  10002. if (comparator.semver === ANY) {
  10003. comparator = new Comparator('>=0.0.0')
  10004. }
  10005. high = high || comparator
  10006. low = low || comparator
  10007. if (gtfn(comparator.semver, high.semver, options)) {
  10008. high = comparator
  10009. } else if (ltfn(comparator.semver, low.semver, options)) {
  10010. low = comparator
  10011. }
  10012. })
  10013. // If the edge version comparator has a operator then our version
  10014. // isn't outside it
  10015. if (high.operator === comp || high.operator === ecomp) {
  10016. return false
  10017. }
  10018. // If the lowest version comparator has an operator and our version
  10019. // is less than it then it isn't higher than the range
  10020. if ((!low.operator || low.operator === comp) &&
  10021. ltefn(version, low.semver)) {
  10022. return false
  10023. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  10024. return false
  10025. }
  10026. }
  10027. return true
  10028. }
  10029. exports.prerelease = prerelease
  10030. function prerelease (version, options) {
  10031. var parsed = parse(version, options)
  10032. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  10033. }
  10034. exports.intersects = intersects
  10035. function intersects (r1, r2, options) {
  10036. r1 = new Range(r1, options)
  10037. r2 = new Range(r2, options)
  10038. return r1.intersects(r2)
  10039. }
  10040. exports.coerce = coerce
  10041. function coerce (version, options) {
  10042. if (version instanceof SemVer) {
  10043. return version
  10044. }
  10045. if (typeof version === 'number') {
  10046. version = String(version)
  10047. }
  10048. if (typeof version !== 'string') {
  10049. return null
  10050. }
  10051. options = options || {}
  10052. var match = null
  10053. if (!options.rtl) {
  10054. match = version.match(re[t.COERCE])
  10055. } else {
  10056. // Find the right-most coercible string that does not share
  10057. // a terminus with a more left-ward coercible string.
  10058. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  10059. //
  10060. // Walk through the string checking with a /g regexp
  10061. // Manually set the index so as to pick up overlapping matches.
  10062. // Stop when we get a match that ends at the string end, since no
  10063. // coercible string can be more right-ward without the same terminus.
  10064. var next
  10065. while ((next = re[t.COERCERTL].exec(version)) &&
  10066. (!match || match.index + match[0].length !== version.length)
  10067. ) {
  10068. if (!match ||
  10069. next.index + next[0].length !== match.index + match[0].length) {
  10070. match = next
  10071. }
  10072. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  10073. }
  10074. // leave it in a clean state
  10075. re[t.COERCERTL].lastIndex = -1
  10076. }
  10077. if (match === null) {
  10078. return null
  10079. }
  10080. return parse(match[2] +
  10081. '.' + (match[3] || '0') +
  10082. '.' + (match[4] || '0'), options)
  10083. }
  10084. /***/ }),
  10085. /***/ 669:
  10086. /***/ (function(module) {
  10087. module.exports = require("util");
  10088. /***/ }),
  10089. /***/ 672:
  10090. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10091. "use strict";
  10092. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10093. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10094. return new (P || (P = Promise))(function (resolve, reject) {
  10095. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10096. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10097. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10098. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10099. });
  10100. };
  10101. var _a;
  10102. Object.defineProperty(exports, "__esModule", { value: true });
  10103. const assert_1 = __webpack_require__(357);
  10104. const fs = __webpack_require__(747);
  10105. const path = __webpack_require__(622);
  10106. _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;
  10107. exports.IS_WINDOWS = process.platform === 'win32';
  10108. function exists(fsPath) {
  10109. return __awaiter(this, void 0, void 0, function* () {
  10110. try {
  10111. yield exports.stat(fsPath);
  10112. }
  10113. catch (err) {
  10114. if (err.code === 'ENOENT') {
  10115. return false;
  10116. }
  10117. throw err;
  10118. }
  10119. return true;
  10120. });
  10121. }
  10122. exports.exists = exists;
  10123. function isDirectory(fsPath, useStat = false) {
  10124. return __awaiter(this, void 0, void 0, function* () {
  10125. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  10126. return stats.isDirectory();
  10127. });
  10128. }
  10129. exports.isDirectory = isDirectory;
  10130. /**
  10131. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  10132. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  10133. */
  10134. function isRooted(p) {
  10135. p = normalizeSeparators(p);
  10136. if (!p) {
  10137. throw new Error('isRooted() parameter "p" cannot be empty');
  10138. }
  10139. if (exports.IS_WINDOWS) {
  10140. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  10141. ); // e.g. C: or C:\hello
  10142. }
  10143. return p.startsWith('/');
  10144. }
  10145. exports.isRooted = isRooted;
  10146. /**
  10147. * Recursively create a directory at `fsPath`.
  10148. *
  10149. * This implementation is optimistic, meaning it attempts to create the full
  10150. * path first, and backs up the path stack from there.
  10151. *
  10152. * @param fsPath The path to create
  10153. * @param maxDepth The maximum recursion depth
  10154. * @param depth The current recursion depth
  10155. */
  10156. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  10157. return __awaiter(this, void 0, void 0, function* () {
  10158. assert_1.ok(fsPath, 'a path argument must be provided');
  10159. fsPath = path.resolve(fsPath);
  10160. if (depth >= maxDepth)
  10161. return exports.mkdir(fsPath);
  10162. try {
  10163. yield exports.mkdir(fsPath);
  10164. return;
  10165. }
  10166. catch (err) {
  10167. switch (err.code) {
  10168. case 'ENOENT': {
  10169. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  10170. yield exports.mkdir(fsPath);
  10171. return;
  10172. }
  10173. default: {
  10174. let stats;
  10175. try {
  10176. stats = yield exports.stat(fsPath);
  10177. }
  10178. catch (err2) {
  10179. throw err;
  10180. }
  10181. if (!stats.isDirectory())
  10182. throw err;
  10183. }
  10184. }
  10185. }
  10186. });
  10187. }
  10188. exports.mkdirP = mkdirP;
  10189. /**
  10190. * Best effort attempt to determine whether a file exists and is executable.
  10191. * @param filePath file path to check
  10192. * @param extensions additional file extensions to try
  10193. * @return if file exists and is executable, returns the file path. otherwise empty string.
  10194. */
  10195. function tryGetExecutablePath(filePath, extensions) {
  10196. return __awaiter(this, void 0, void 0, function* () {
  10197. let stats = undefined;
  10198. try {
  10199. // test file exists
  10200. stats = yield exports.stat(filePath);
  10201. }
  10202. catch (err) {
  10203. if (err.code !== 'ENOENT') {
  10204. // eslint-disable-next-line no-console
  10205. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  10206. }
  10207. }
  10208. if (stats && stats.isFile()) {
  10209. if (exports.IS_WINDOWS) {
  10210. // on Windows, test for valid extension
  10211. const upperExt = path.extname(filePath).toUpperCase();
  10212. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  10213. return filePath;
  10214. }
  10215. }
  10216. else {
  10217. if (isUnixExecutable(stats)) {
  10218. return filePath;
  10219. }
  10220. }
  10221. }
  10222. // try each extension
  10223. const originalFilePath = filePath;
  10224. for (const extension of extensions) {
  10225. filePath = originalFilePath + extension;
  10226. stats = undefined;
  10227. try {
  10228. stats = yield exports.stat(filePath);
  10229. }
  10230. catch (err) {
  10231. if (err.code !== 'ENOENT') {
  10232. // eslint-disable-next-line no-console
  10233. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  10234. }
  10235. }
  10236. if (stats && stats.isFile()) {
  10237. if (exports.IS_WINDOWS) {
  10238. // preserve the case of the actual file (since an extension was appended)
  10239. try {
  10240. const directory = path.dirname(filePath);
  10241. const upperName = path.basename(filePath).toUpperCase();
  10242. for (const actualName of yield exports.readdir(directory)) {
  10243. if (upperName === actualName.toUpperCase()) {
  10244. filePath = path.join(directory, actualName);
  10245. break;
  10246. }
  10247. }
  10248. }
  10249. catch (err) {
  10250. // eslint-disable-next-line no-console
  10251. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  10252. }
  10253. return filePath;
  10254. }
  10255. else {
  10256. if (isUnixExecutable(stats)) {
  10257. return filePath;
  10258. }
  10259. }
  10260. }
  10261. }
  10262. return '';
  10263. });
  10264. }
  10265. exports.tryGetExecutablePath = tryGetExecutablePath;
  10266. function normalizeSeparators(p) {
  10267. p = p || '';
  10268. if (exports.IS_WINDOWS) {
  10269. // convert slashes on Windows
  10270. p = p.replace(/\//g, '\\');
  10271. // remove redundant slashes
  10272. return p.replace(/\\\\+/g, '\\');
  10273. }
  10274. // remove redundant slashes
  10275. return p.replace(/\/\/+/g, '/');
  10276. }
  10277. // on Mac/Linux, test the execute bit
  10278. // R W X R W X R W X
  10279. // 256 128 64 32 16 8 4 2 1
  10280. function isUnixExecutable(stats) {
  10281. return ((stats.mode & 1) > 0 ||
  10282. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  10283. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  10284. }
  10285. //# sourceMappingURL=io-util.js.map
  10286. /***/ }),
  10287. /***/ 674:
  10288. /***/ (function(module, __unusedexports, __webpack_require__) {
  10289. module.exports = authenticate;
  10290. const { Deprecation } = __webpack_require__(692);
  10291. const once = __webpack_require__(969);
  10292. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  10293. function authenticate(state, options) {
  10294. deprecateAuthenticate(
  10295. state.octokit.log,
  10296. new Deprecation(
  10297. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  10298. )
  10299. );
  10300. if (!options) {
  10301. state.auth = false;
  10302. return;
  10303. }
  10304. switch (options.type) {
  10305. case "basic":
  10306. if (!options.username || !options.password) {
  10307. throw new Error(
  10308. "Basic authentication requires both a username and password to be set"
  10309. );
  10310. }
  10311. break;
  10312. case "oauth":
  10313. if (!options.token && !(options.key && options.secret)) {
  10314. throw new Error(
  10315. "OAuth2 authentication requires a token or key & secret to be set"
  10316. );
  10317. }
  10318. break;
  10319. case "token":
  10320. case "app":
  10321. if (!options.token) {
  10322. throw new Error("Token authentication requires a token to be set");
  10323. }
  10324. break;
  10325. default:
  10326. throw new Error(
  10327. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  10328. );
  10329. }
  10330. state.auth = options;
  10331. }
  10332. /***/ }),
  10333. /***/ 675:
  10334. /***/ (function(module) {
  10335. module.exports = function btoa(str) {
  10336. return new Buffer(str).toString('base64')
  10337. }
  10338. /***/ }),
  10339. /***/ 692:
  10340. /***/ (function(__unusedmodule, exports) {
  10341. "use strict";
  10342. Object.defineProperty(exports, '__esModule', { value: true });
  10343. class Deprecation extends Error {
  10344. constructor(message) {
  10345. super(message); // Maintains proper stack trace (only available on V8)
  10346. /* istanbul ignore next */
  10347. if (Error.captureStackTrace) {
  10348. Error.captureStackTrace(this, this.constructor);
  10349. }
  10350. this.name = 'Deprecation';
  10351. }
  10352. }
  10353. exports.Deprecation = Deprecation;
  10354. /***/ }),
  10355. /***/ 696:
  10356. /***/ (function(module) {
  10357. "use strict";
  10358. /*!
  10359. * isobject <https://github.com/jonschlinkert/isobject>
  10360. *
  10361. * Copyright (c) 2014-2017, Jon Schlinkert.
  10362. * Released under the MIT License.
  10363. */
  10364. function isObject(val) {
  10365. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  10366. }
  10367. /*!
  10368. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  10369. *
  10370. * Copyright (c) 2014-2017, Jon Schlinkert.
  10371. * Released under the MIT License.
  10372. */
  10373. function isObjectObject(o) {
  10374. return isObject(o) === true
  10375. && Object.prototype.toString.call(o) === '[object Object]';
  10376. }
  10377. function isPlainObject(o) {
  10378. var ctor,prot;
  10379. if (isObjectObject(o) === false) return false;
  10380. // If has modified constructor
  10381. ctor = o.constructor;
  10382. if (typeof ctor !== 'function') return false;
  10383. // If has modified prototype
  10384. prot = ctor.prototype;
  10385. if (isObjectObject(prot) === false) return false;
  10386. // If constructor does not have an Object-specific method
  10387. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  10388. return false;
  10389. }
  10390. // Most likely a plain Object
  10391. return true;
  10392. }
  10393. module.exports = isPlainObject;
  10394. /***/ }),
  10395. /***/ 697:
  10396. /***/ (function(module) {
  10397. "use strict";
  10398. module.exports = (promise, onFinally) => {
  10399. onFinally = onFinally || (() => {});
  10400. return promise.then(
  10401. val => new Promise(resolve => {
  10402. resolve(onFinally());
  10403. }).then(() => val),
  10404. err => new Promise(resolve => {
  10405. resolve(onFinally());
  10406. }).then(() => {
  10407. throw err;
  10408. })
  10409. );
  10410. };
  10411. /***/ }),
  10412. /***/ 705:
  10413. /***/ (function(module) {
  10414. 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"}},"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":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"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":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/import/authors"},"getImportProgress":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import"},"getLargeFiles":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"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"},"mapCommitAuthor":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"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":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"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":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"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":{"headers":{"accept":"application/vnd.github.barred-rock-preview+json"},"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_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":{"headers":{"accept":"application/vnd.github.echo-preview+json,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":{"headers":{"accept":"application/vnd.github.echo-preview+json,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"},"delete":{"headers":{"accept":"application/vnd.github.echo-preview+json,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":{"headers":{"accept":"application/vnd.github.echo-preview+json,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":{"headers":{"accept":"application/vnd.github.echo-preview+json,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"}},"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"},"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"}},"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"},"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"}},"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"],"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":{"headers":{"accept":"application/vnd.github.nightshade-preview+json"},"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"},"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"}},"url":"/repos/:owner/:repo"},"updateBranchProtection":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"enforce_admins":{"allowNull":true,"required":true,"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"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() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member","method":"PUT","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"addOrUpdateMembership":{"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":{"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":{"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":{"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":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"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":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"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"},"delete":{"method":"DELETE","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"deleteDiscussion":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"DELETE","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"deleteDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"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"},"get":{"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":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"method":"GET","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"getDiscussionComment":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"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"},"getMember":{"deprecated":"octokit.teams.getMember() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member","method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"getMembership":{"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":{"headers":{"accept":"application/vnd.github.hellcat-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/teams"},"listDiscussionComments":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"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":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"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":{"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":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/invitations"},"listProjects":{"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":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos"},"removeMember":{"deprecated":"octokit.teams.removeMember() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"removeMembership":{"method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"removeProject":{"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"removeRepo":{"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":{"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":{"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":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"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":{"headers":{"accept":"application/vnd.github.echo-preview+json"},"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"}},"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":{"headers":{"accept":"application/vnd.github.hagar-preview+json"},"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"}}};
  10415. /***/ }),
  10416. /***/ 722:
  10417. /***/ (function(module) {
  10418. /**
  10419. * Convert array of 16 byte values to UUID string format of the form:
  10420. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  10421. */
  10422. var byteToHex = [];
  10423. for (var i = 0; i < 256; ++i) {
  10424. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  10425. }
  10426. function bytesToUuid(buf, offset) {
  10427. var i = offset || 0;
  10428. var bth = byteToHex;
  10429. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  10430. return ([bth[buf[i++]], bth[buf[i++]],
  10431. bth[buf[i++]], bth[buf[i++]], '-',
  10432. bth[buf[i++]], bth[buf[i++]], '-',
  10433. bth[buf[i++]], bth[buf[i++]], '-',
  10434. bth[buf[i++]], bth[buf[i++]], '-',
  10435. bth[buf[i++]], bth[buf[i++]],
  10436. bth[buf[i++]], bth[buf[i++]],
  10437. bth[buf[i++]], bth[buf[i++]]]).join('');
  10438. }
  10439. module.exports = bytesToUuid;
  10440. /***/ }),
  10441. /***/ 742:
  10442. /***/ (function(module, __unusedexports, __webpack_require__) {
  10443. var fs = __webpack_require__(747)
  10444. var core
  10445. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  10446. core = __webpack_require__(818)
  10447. } else {
  10448. core = __webpack_require__(197)
  10449. }
  10450. module.exports = isexe
  10451. isexe.sync = sync
  10452. function isexe (path, options, cb) {
  10453. if (typeof options === 'function') {
  10454. cb = options
  10455. options = {}
  10456. }
  10457. if (!cb) {
  10458. if (typeof Promise !== 'function') {
  10459. throw new TypeError('callback not provided')
  10460. }
  10461. return new Promise(function (resolve, reject) {
  10462. isexe(path, options || {}, function (er, is) {
  10463. if (er) {
  10464. reject(er)
  10465. } else {
  10466. resolve(is)
  10467. }
  10468. })
  10469. })
  10470. }
  10471. core(path, options || {}, function (er, is) {
  10472. // ignore EACCES because that just means we aren't allowed to run it
  10473. if (er) {
  10474. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  10475. er = null
  10476. is = false
  10477. }
  10478. }
  10479. cb(er, is)
  10480. })
  10481. }
  10482. function sync (path, options) {
  10483. // my kingdom for a filtered catch
  10484. try {
  10485. return core.sync(path, options || {})
  10486. } catch (er) {
  10487. if (options && options.ignoreErrors || er.code === 'EACCES') {
  10488. return false
  10489. } else {
  10490. throw er
  10491. }
  10492. }
  10493. }
  10494. /***/ }),
  10495. /***/ 747:
  10496. /***/ (function(module) {
  10497. module.exports = require("fs");
  10498. /***/ }),
  10499. /***/ 753:
  10500. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10501. "use strict";
  10502. Object.defineProperty(exports, '__esModule', { value: true });
  10503. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10504. var endpoint = __webpack_require__(385);
  10505. var universalUserAgent = __webpack_require__(796);
  10506. var isPlainObject = _interopDefault(__webpack_require__(696));
  10507. var nodeFetch = _interopDefault(__webpack_require__(454));
  10508. var requestError = __webpack_require__(463);
  10509. const VERSION = "5.3.1";
  10510. function getBufferResponse(response) {
  10511. return response.arrayBuffer();
  10512. }
  10513. function fetchWrapper(requestOptions) {
  10514. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  10515. requestOptions.body = JSON.stringify(requestOptions.body);
  10516. }
  10517. let headers = {};
  10518. let status;
  10519. let url;
  10520. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  10521. return fetch(requestOptions.url, Object.assign({
  10522. method: requestOptions.method,
  10523. body: requestOptions.body,
  10524. headers: requestOptions.headers,
  10525. redirect: requestOptions.redirect
  10526. }, requestOptions.request)).then(response => {
  10527. url = response.url;
  10528. status = response.status;
  10529. for (const keyAndValue of response.headers) {
  10530. headers[keyAndValue[0]] = keyAndValue[1];
  10531. }
  10532. if (status === 204 || status === 205) {
  10533. return;
  10534. } // GitHub API returns 200 for HEAD requsets
  10535. if (requestOptions.method === "HEAD") {
  10536. if (status < 400) {
  10537. return;
  10538. }
  10539. throw new requestError.RequestError(response.statusText, status, {
  10540. headers,
  10541. request: requestOptions
  10542. });
  10543. }
  10544. if (status === 304) {
  10545. throw new requestError.RequestError("Not modified", status, {
  10546. headers,
  10547. request: requestOptions
  10548. });
  10549. }
  10550. if (status >= 400) {
  10551. return response.text().then(message => {
  10552. const error = new requestError.RequestError(message, status, {
  10553. headers,
  10554. request: requestOptions
  10555. });
  10556. try {
  10557. let responseBody = JSON.parse(error.message);
  10558. Object.assign(error, responseBody);
  10559. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  10560. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  10561. } catch (e) {// ignore, see octokit/rest.js#684
  10562. }
  10563. throw error;
  10564. });
  10565. }
  10566. const contentType = response.headers.get("content-type");
  10567. if (/application\/json/.test(contentType)) {
  10568. return response.json();
  10569. }
  10570. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  10571. return response.text();
  10572. }
  10573. return getBufferResponse(response);
  10574. }).then(data => {
  10575. return {
  10576. status,
  10577. url,
  10578. headers,
  10579. data
  10580. };
  10581. }).catch(error => {
  10582. if (error instanceof requestError.RequestError) {
  10583. throw error;
  10584. }
  10585. throw new requestError.RequestError(error.message, 500, {
  10586. headers,
  10587. request: requestOptions
  10588. });
  10589. });
  10590. }
  10591. function withDefaults(oldEndpoint, newDefaults) {
  10592. const endpoint = oldEndpoint.defaults(newDefaults);
  10593. const newApi = function (route, parameters) {
  10594. const endpointOptions = endpoint.merge(route, parameters);
  10595. if (!endpointOptions.request || !endpointOptions.request.hook) {
  10596. return fetchWrapper(endpoint.parse(endpointOptions));
  10597. }
  10598. const request = (route, parameters) => {
  10599. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  10600. };
  10601. Object.assign(request, {
  10602. endpoint,
  10603. defaults: withDefaults.bind(null, endpoint)
  10604. });
  10605. return endpointOptions.request.hook(request, endpointOptions);
  10606. };
  10607. return Object.assign(newApi, {
  10608. endpoint,
  10609. defaults: withDefaults.bind(null, endpoint)
  10610. });
  10611. }
  10612. const request = withDefaults(endpoint.endpoint, {
  10613. headers: {
  10614. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  10615. }
  10616. });
  10617. exports.request = request;
  10618. //# sourceMappingURL=index.js.map
  10619. /***/ }),
  10620. /***/ 761:
  10621. /***/ (function(module) {
  10622. module.exports = require("zlib");
  10623. /***/ }),
  10624. /***/ 763:
  10625. /***/ (function(module) {
  10626. module.exports = removeHook
  10627. function removeHook (state, name, method) {
  10628. if (!state.registry[name]) {
  10629. return
  10630. }
  10631. var index = state.registry[name]
  10632. .map(function (registered) { return registered.orig })
  10633. .indexOf(method)
  10634. if (index === -1) {
  10635. return
  10636. }
  10637. state.registry[name].splice(index, 1)
  10638. }
  10639. /***/ }),
  10640. /***/ 768:
  10641. /***/ (function(module) {
  10642. "use strict";
  10643. module.exports = function (x) {
  10644. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  10645. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  10646. if (x[x.length - 1] === lf) {
  10647. x = x.slice(0, x.length - 1);
  10648. }
  10649. if (x[x.length - 1] === cr) {
  10650. x = x.slice(0, x.length - 1);
  10651. }
  10652. return x;
  10653. };
  10654. /***/ }),
  10655. /***/ 777:
  10656. /***/ (function(module, __unusedexports, __webpack_require__) {
  10657. module.exports = getFirstPage
  10658. const getPage = __webpack_require__(265)
  10659. function getFirstPage (octokit, link, headers) {
  10660. return getPage(octokit, link, 'first', headers)
  10661. }
  10662. /***/ }),
  10663. /***/ 796:
  10664. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10665. "use strict";
  10666. Object.defineProperty(exports, '__esModule', { value: true });
  10667. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  10668. var osName = _interopDefault(__webpack_require__(2));
  10669. function getUserAgent() {
  10670. try {
  10671. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  10672. } catch (error) {
  10673. if (/wmic os get Caption/.test(error.message)) {
  10674. return "Windows <version undetectable>";
  10675. }
  10676. throw error;
  10677. }
  10678. }
  10679. exports.getUserAgent = getUserAgent;
  10680. //# sourceMappingURL=index.js.map
  10681. /***/ }),
  10682. /***/ 807:
  10683. /***/ (function(module, __unusedexports, __webpack_require__) {
  10684. module.exports = paginate;
  10685. const iterator = __webpack_require__(8);
  10686. function paginate(octokit, route, options, mapFn) {
  10687. if (typeof options === "function") {
  10688. mapFn = options;
  10689. options = undefined;
  10690. }
  10691. options = octokit.request.endpoint.merge(route, options);
  10692. return gather(
  10693. octokit,
  10694. [],
  10695. iterator(octokit, options)[Symbol.asyncIterator](),
  10696. mapFn
  10697. );
  10698. }
  10699. function gather(octokit, results, iterator, mapFn) {
  10700. return iterator.next().then(result => {
  10701. if (result.done) {
  10702. return results;
  10703. }
  10704. let earlyExit = false;
  10705. function done() {
  10706. earlyExit = true;
  10707. }
  10708. results = results.concat(
  10709. mapFn ? mapFn(result.value, done) : result.value.data
  10710. );
  10711. if (earlyExit) {
  10712. return results;
  10713. }
  10714. return gather(octokit, results, iterator, mapFn);
  10715. });
  10716. }
  10717. /***/ }),
  10718. /***/ 814:
  10719. /***/ (function(module, __unusedexports, __webpack_require__) {
  10720. module.exports = which
  10721. which.sync = whichSync
  10722. var isWindows = process.platform === 'win32' ||
  10723. process.env.OSTYPE === 'cygwin' ||
  10724. process.env.OSTYPE === 'msys'
  10725. var path = __webpack_require__(622)
  10726. var COLON = isWindows ? ';' : ':'
  10727. var isexe = __webpack_require__(742)
  10728. function getNotFoundError (cmd) {
  10729. var er = new Error('not found: ' + cmd)
  10730. er.code = 'ENOENT'
  10731. return er
  10732. }
  10733. function getPathInfo (cmd, opt) {
  10734. var colon = opt.colon || COLON
  10735. var pathEnv = opt.path || process.env.PATH || ''
  10736. var pathExt = ['']
  10737. pathEnv = pathEnv.split(colon)
  10738. var pathExtExe = ''
  10739. if (isWindows) {
  10740. pathEnv.unshift(process.cwd())
  10741. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  10742. pathExt = pathExtExe.split(colon)
  10743. // Always test the cmd itself first. isexe will check to make sure
  10744. // it's found in the pathExt set.
  10745. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  10746. pathExt.unshift('')
  10747. }
  10748. // If it has a slash, then we don't bother searching the pathenv.
  10749. // just check the file itself, and that's it.
  10750. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  10751. pathEnv = ['']
  10752. return {
  10753. env: pathEnv,
  10754. ext: pathExt,
  10755. extExe: pathExtExe
  10756. }
  10757. }
  10758. function which (cmd, opt, cb) {
  10759. if (typeof opt === 'function') {
  10760. cb = opt
  10761. opt = {}
  10762. }
  10763. var info = getPathInfo(cmd, opt)
  10764. var pathEnv = info.env
  10765. var pathExt = info.ext
  10766. var pathExtExe = info.extExe
  10767. var found = []
  10768. ;(function F (i, l) {
  10769. if (i === l) {
  10770. if (opt.all && found.length)
  10771. return cb(null, found)
  10772. else
  10773. return cb(getNotFoundError(cmd))
  10774. }
  10775. var pathPart = pathEnv[i]
  10776. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  10777. pathPart = pathPart.slice(1, -1)
  10778. var p = path.join(pathPart, cmd)
  10779. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  10780. p = cmd.slice(0, 2) + p
  10781. }
  10782. ;(function E (ii, ll) {
  10783. if (ii === ll) return F(i + 1, l)
  10784. var ext = pathExt[ii]
  10785. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  10786. if (!er && is) {
  10787. if (opt.all)
  10788. found.push(p + ext)
  10789. else
  10790. return cb(null, p + ext)
  10791. }
  10792. return E(ii + 1, ll)
  10793. })
  10794. })(0, pathExt.length)
  10795. })(0, pathEnv.length)
  10796. }
  10797. function whichSync (cmd, opt) {
  10798. opt = opt || {}
  10799. var info = getPathInfo(cmd, opt)
  10800. var pathEnv = info.env
  10801. var pathExt = info.ext
  10802. var pathExtExe = info.extExe
  10803. var found = []
  10804. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  10805. var pathPart = pathEnv[i]
  10806. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  10807. pathPart = pathPart.slice(1, -1)
  10808. var p = path.join(pathPart, cmd)
  10809. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  10810. p = cmd.slice(0, 2) + p
  10811. }
  10812. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  10813. var cur = p + pathExt[j]
  10814. var is
  10815. try {
  10816. is = isexe.sync(cur, { pathExt: pathExtExe })
  10817. if (is) {
  10818. if (opt.all)
  10819. found.push(cur)
  10820. else
  10821. return cur
  10822. }
  10823. } catch (ex) {}
  10824. }
  10825. }
  10826. if (opt.all && found.length)
  10827. return found
  10828. if (opt.nothrow)
  10829. return null
  10830. throw getNotFoundError(cmd)
  10831. }
  10832. /***/ }),
  10833. /***/ 816:
  10834. /***/ (function(module) {
  10835. "use strict";
  10836. module.exports = /^#!.*/;
  10837. /***/ }),
  10838. /***/ 818:
  10839. /***/ (function(module, __unusedexports, __webpack_require__) {
  10840. module.exports = isexe
  10841. isexe.sync = sync
  10842. var fs = __webpack_require__(747)
  10843. function checkPathExt (path, options) {
  10844. var pathext = options.pathExt !== undefined ?
  10845. options.pathExt : process.env.PATHEXT
  10846. if (!pathext) {
  10847. return true
  10848. }
  10849. pathext = pathext.split(';')
  10850. if (pathext.indexOf('') !== -1) {
  10851. return true
  10852. }
  10853. for (var i = 0; i < pathext.length; i++) {
  10854. var p = pathext[i].toLowerCase()
  10855. if (p && path.substr(-p.length).toLowerCase() === p) {
  10856. return true
  10857. }
  10858. }
  10859. return false
  10860. }
  10861. function checkStat (stat, path, options) {
  10862. if (!stat.isSymbolicLink() && !stat.isFile()) {
  10863. return false
  10864. }
  10865. return checkPathExt(path, options)
  10866. }
  10867. function isexe (path, options, cb) {
  10868. fs.stat(path, function (er, stat) {
  10869. cb(er, er ? false : checkStat(stat, path, options))
  10870. })
  10871. }
  10872. function sync (path, options) {
  10873. return checkStat(fs.statSync(path), path, options)
  10874. }
  10875. /***/ }),
  10876. /***/ 821:
  10877. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10878. "use strict";
  10879. var __importStar = (this && this.__importStar) || function (mod) {
  10880. if (mod && mod.__esModule) return mod;
  10881. var result = {};
  10882. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  10883. result["default"] = mod;
  10884. return result;
  10885. };
  10886. Object.defineProperty(exports, "__esModule", { value: true });
  10887. const core = __importStar(__webpack_require__(470));
  10888. const fsHelper = __importStar(__webpack_require__(618));
  10889. const github = __importStar(__webpack_require__(469));
  10890. const path = __importStar(__webpack_require__(622));
  10891. function getInputs() {
  10892. const result = {};
  10893. // GitHub workspace
  10894. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  10895. if (!githubWorkspacePath) {
  10896. throw new Error('GITHUB_WORKSPACE not defined');
  10897. }
  10898. githubWorkspacePath = path.resolve(githubWorkspacePath);
  10899. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  10900. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  10901. // Qualified repository
  10902. const qualifiedRepository = core.getInput('repository') ||
  10903. `${github.context.repo.owner}/${github.context.repo.repo}`;
  10904. core.debug(`qualified repository = '${qualifiedRepository}'`);
  10905. const splitRepository = qualifiedRepository.split('/');
  10906. if (splitRepository.length !== 2 ||
  10907. !splitRepository[0] ||
  10908. !splitRepository[1]) {
  10909. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  10910. }
  10911. result.repositoryOwner = splitRepository[0];
  10912. result.repositoryName = splitRepository[1];
  10913. // Repository path
  10914. result.repositoryPath = core.getInput('path') || '.';
  10915. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  10916. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  10917. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  10918. }
  10919. // Workflow repository?
  10920. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  10921. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  10922. // Source branch, source version
  10923. result.ref = core.getInput('ref');
  10924. if (!result.ref) {
  10925. if (isWorkflowRepository) {
  10926. result.ref = github.context.ref;
  10927. result.commit = github.context.sha;
  10928. }
  10929. if (!result.ref && !result.commit) {
  10930. result.ref = 'refs/heads/master';
  10931. }
  10932. }
  10933. // SHA?
  10934. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  10935. result.commit = result.ref;
  10936. result.ref = '';
  10937. }
  10938. core.debug(`ref = '${result.ref}'`);
  10939. core.debug(`commit = '${result.commit}'`);
  10940. // Clean
  10941. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  10942. core.debug(`clean = ${result.clean}`);
  10943. // Submodules
  10944. if (core.getInput('submodules')) {
  10945. throw new Error("The input 'submodules' is not supported in actions/checkout@v2");
  10946. }
  10947. // Fetch depth
  10948. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  10949. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  10950. result.fetchDepth = 0;
  10951. }
  10952. core.debug(`fetch depth = ${result.fetchDepth}`);
  10953. // LFS
  10954. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  10955. core.debug(`lfs = ${result.lfs}`);
  10956. // Access token
  10957. result.accessToken = core.getInput('token');
  10958. return result;
  10959. }
  10960. exports.getInputs = getInputs;
  10961. /***/ }),
  10962. /***/ 826:
  10963. /***/ (function(module, __unusedexports, __webpack_require__) {
  10964. var rng = __webpack_require__(139);
  10965. var bytesToUuid = __webpack_require__(722);
  10966. function v4(options, buf, offset) {
  10967. var i = buf && offset || 0;
  10968. if (typeof(options) == 'string') {
  10969. buf = options === 'binary' ? new Array(16) : null;
  10970. options = null;
  10971. }
  10972. options = options || {};
  10973. var rnds = options.random || (options.rng || rng)();
  10974. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  10975. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  10976. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  10977. // Copy bytes to buffer, if provided
  10978. if (buf) {
  10979. for (var ii = 0; ii < 16; ++ii) {
  10980. buf[i + ii] = rnds[ii];
  10981. }
  10982. }
  10983. return buf || bytesToUuid(rnds);
  10984. }
  10985. module.exports = v4;
  10986. /***/ }),
  10987. /***/ 835:
  10988. /***/ (function(module) {
  10989. module.exports = require("url");
  10990. /***/ }),
  10991. /***/ 850:
  10992. /***/ (function(module, __unusedexports, __webpack_require__) {
  10993. module.exports = paginationMethodsPlugin
  10994. function paginationMethodsPlugin (octokit) {
  10995. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  10996. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  10997. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  10998. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  10999. octokit.hasFirstPage = __webpack_require__(536)
  11000. octokit.hasLastPage = __webpack_require__(336)
  11001. octokit.hasNextPage = __webpack_require__(929)
  11002. octokit.hasPreviousPage = __webpack_require__(558)
  11003. }
  11004. /***/ }),
  11005. /***/ 854:
  11006. /***/ (function(module) {
  11007. /**
  11008. * lodash (Custom Build) <https://lodash.com/>
  11009. * Build: `lodash modularize exports="npm" -o ./`
  11010. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  11011. * Released under MIT license <https://lodash.com/license>
  11012. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  11013. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  11014. */
  11015. /** Used as the `TypeError` message for "Functions" methods. */
  11016. var FUNC_ERROR_TEXT = 'Expected a function';
  11017. /** Used to stand-in for `undefined` hash values. */
  11018. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  11019. /** Used as references for various `Number` constants. */
  11020. var INFINITY = 1 / 0;
  11021. /** `Object#toString` result references. */
  11022. var funcTag = '[object Function]',
  11023. genTag = '[object GeneratorFunction]',
  11024. symbolTag = '[object Symbol]';
  11025. /** Used to match property names within property paths. */
  11026. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  11027. reIsPlainProp = /^\w*$/,
  11028. reLeadingDot = /^\./,
  11029. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  11030. /**
  11031. * Used to match `RegExp`
  11032. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  11033. */
  11034. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  11035. /** Used to match backslashes in property paths. */
  11036. var reEscapeChar = /\\(\\)?/g;
  11037. /** Used to detect host constructors (Safari). */
  11038. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  11039. /** Detect free variable `global` from Node.js. */
  11040. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  11041. /** Detect free variable `self`. */
  11042. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  11043. /** Used as a reference to the global object. */
  11044. var root = freeGlobal || freeSelf || Function('return this')();
  11045. /**
  11046. * Gets the value at `key` of `object`.
  11047. *
  11048. * @private
  11049. * @param {Object} [object] The object to query.
  11050. * @param {string} key The key of the property to get.
  11051. * @returns {*} Returns the property value.
  11052. */
  11053. function getValue(object, key) {
  11054. return object == null ? undefined : object[key];
  11055. }
  11056. /**
  11057. * Checks if `value` is a host object in IE < 9.
  11058. *
  11059. * @private
  11060. * @param {*} value The value to check.
  11061. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  11062. */
  11063. function isHostObject(value) {
  11064. // Many host objects are `Object` objects that can coerce to strings
  11065. // despite having improperly defined `toString` methods.
  11066. var result = false;
  11067. if (value != null && typeof value.toString != 'function') {
  11068. try {
  11069. result = !!(value + '');
  11070. } catch (e) {}
  11071. }
  11072. return result;
  11073. }
  11074. /** Used for built-in method references. */
  11075. var arrayProto = Array.prototype,
  11076. funcProto = Function.prototype,
  11077. objectProto = Object.prototype;
  11078. /** Used to detect overreaching core-js shims. */
  11079. var coreJsData = root['__core-js_shared__'];
  11080. /** Used to detect methods masquerading as native. */
  11081. var maskSrcKey = (function() {
  11082. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  11083. return uid ? ('Symbol(src)_1.' + uid) : '';
  11084. }());
  11085. /** Used to resolve the decompiled source of functions. */
  11086. var funcToString = funcProto.toString;
  11087. /** Used to check objects for own properties. */
  11088. var hasOwnProperty = objectProto.hasOwnProperty;
  11089. /**
  11090. * Used to resolve the
  11091. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  11092. * of values.
  11093. */
  11094. var objectToString = objectProto.toString;
  11095. /** Used to detect if a method is native. */
  11096. var reIsNative = RegExp('^' +
  11097. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  11098. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  11099. );
  11100. /** Built-in value references. */
  11101. var Symbol = root.Symbol,
  11102. splice = arrayProto.splice;
  11103. /* Built-in method references that are verified to be native. */
  11104. var Map = getNative(root, 'Map'),
  11105. nativeCreate = getNative(Object, 'create');
  11106. /** Used to convert symbols to primitives and strings. */
  11107. var symbolProto = Symbol ? Symbol.prototype : undefined,
  11108. symbolToString = symbolProto ? symbolProto.toString : undefined;
  11109. /**
  11110. * Creates a hash object.
  11111. *
  11112. * @private
  11113. * @constructor
  11114. * @param {Array} [entries] The key-value pairs to cache.
  11115. */
  11116. function Hash(entries) {
  11117. var index = -1,
  11118. length = entries ? entries.length : 0;
  11119. this.clear();
  11120. while (++index < length) {
  11121. var entry = entries[index];
  11122. this.set(entry[0], entry[1]);
  11123. }
  11124. }
  11125. /**
  11126. * Removes all key-value entries from the hash.
  11127. *
  11128. * @private
  11129. * @name clear
  11130. * @memberOf Hash
  11131. */
  11132. function hashClear() {
  11133. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  11134. }
  11135. /**
  11136. * Removes `key` and its value from the hash.
  11137. *
  11138. * @private
  11139. * @name delete
  11140. * @memberOf Hash
  11141. * @param {Object} hash The hash to modify.
  11142. * @param {string} key The key of the value to remove.
  11143. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11144. */
  11145. function hashDelete(key) {
  11146. return this.has(key) && delete this.__data__[key];
  11147. }
  11148. /**
  11149. * Gets the hash value for `key`.
  11150. *
  11151. * @private
  11152. * @name get
  11153. * @memberOf Hash
  11154. * @param {string} key The key of the value to get.
  11155. * @returns {*} Returns the entry value.
  11156. */
  11157. function hashGet(key) {
  11158. var data = this.__data__;
  11159. if (nativeCreate) {
  11160. var result = data[key];
  11161. return result === HASH_UNDEFINED ? undefined : result;
  11162. }
  11163. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  11164. }
  11165. /**
  11166. * Checks if a hash value for `key` exists.
  11167. *
  11168. * @private
  11169. * @name has
  11170. * @memberOf Hash
  11171. * @param {string} key The key of the entry to check.
  11172. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11173. */
  11174. function hashHas(key) {
  11175. var data = this.__data__;
  11176. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  11177. }
  11178. /**
  11179. * Sets the hash `key` to `value`.
  11180. *
  11181. * @private
  11182. * @name set
  11183. * @memberOf Hash
  11184. * @param {string} key The key of the value to set.
  11185. * @param {*} value The value to set.
  11186. * @returns {Object} Returns the hash instance.
  11187. */
  11188. function hashSet(key, value) {
  11189. var data = this.__data__;
  11190. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  11191. return this;
  11192. }
  11193. // Add methods to `Hash`.
  11194. Hash.prototype.clear = hashClear;
  11195. Hash.prototype['delete'] = hashDelete;
  11196. Hash.prototype.get = hashGet;
  11197. Hash.prototype.has = hashHas;
  11198. Hash.prototype.set = hashSet;
  11199. /**
  11200. * Creates an list cache object.
  11201. *
  11202. * @private
  11203. * @constructor
  11204. * @param {Array} [entries] The key-value pairs to cache.
  11205. */
  11206. function ListCache(entries) {
  11207. var index = -1,
  11208. length = entries ? entries.length : 0;
  11209. this.clear();
  11210. while (++index < length) {
  11211. var entry = entries[index];
  11212. this.set(entry[0], entry[1]);
  11213. }
  11214. }
  11215. /**
  11216. * Removes all key-value entries from the list cache.
  11217. *
  11218. * @private
  11219. * @name clear
  11220. * @memberOf ListCache
  11221. */
  11222. function listCacheClear() {
  11223. this.__data__ = [];
  11224. }
  11225. /**
  11226. * Removes `key` and its value from the list cache.
  11227. *
  11228. * @private
  11229. * @name delete
  11230. * @memberOf ListCache
  11231. * @param {string} key The key of the value to remove.
  11232. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11233. */
  11234. function listCacheDelete(key) {
  11235. var data = this.__data__,
  11236. index = assocIndexOf(data, key);
  11237. if (index < 0) {
  11238. return false;
  11239. }
  11240. var lastIndex = data.length - 1;
  11241. if (index == lastIndex) {
  11242. data.pop();
  11243. } else {
  11244. splice.call(data, index, 1);
  11245. }
  11246. return true;
  11247. }
  11248. /**
  11249. * Gets the list cache value for `key`.
  11250. *
  11251. * @private
  11252. * @name get
  11253. * @memberOf ListCache
  11254. * @param {string} key The key of the value to get.
  11255. * @returns {*} Returns the entry value.
  11256. */
  11257. function listCacheGet(key) {
  11258. var data = this.__data__,
  11259. index = assocIndexOf(data, key);
  11260. return index < 0 ? undefined : data[index][1];
  11261. }
  11262. /**
  11263. * Checks if a list cache value for `key` exists.
  11264. *
  11265. * @private
  11266. * @name has
  11267. * @memberOf ListCache
  11268. * @param {string} key The key of the entry to check.
  11269. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11270. */
  11271. function listCacheHas(key) {
  11272. return assocIndexOf(this.__data__, key) > -1;
  11273. }
  11274. /**
  11275. * Sets the list cache `key` to `value`.
  11276. *
  11277. * @private
  11278. * @name set
  11279. * @memberOf ListCache
  11280. * @param {string} key The key of the value to set.
  11281. * @param {*} value The value to set.
  11282. * @returns {Object} Returns the list cache instance.
  11283. */
  11284. function listCacheSet(key, value) {
  11285. var data = this.__data__,
  11286. index = assocIndexOf(data, key);
  11287. if (index < 0) {
  11288. data.push([key, value]);
  11289. } else {
  11290. data[index][1] = value;
  11291. }
  11292. return this;
  11293. }
  11294. // Add methods to `ListCache`.
  11295. ListCache.prototype.clear = listCacheClear;
  11296. ListCache.prototype['delete'] = listCacheDelete;
  11297. ListCache.prototype.get = listCacheGet;
  11298. ListCache.prototype.has = listCacheHas;
  11299. ListCache.prototype.set = listCacheSet;
  11300. /**
  11301. * Creates a map cache object to store key-value pairs.
  11302. *
  11303. * @private
  11304. * @constructor
  11305. * @param {Array} [entries] The key-value pairs to cache.
  11306. */
  11307. function MapCache(entries) {
  11308. var index = -1,
  11309. length = entries ? entries.length : 0;
  11310. this.clear();
  11311. while (++index < length) {
  11312. var entry = entries[index];
  11313. this.set(entry[0], entry[1]);
  11314. }
  11315. }
  11316. /**
  11317. * Removes all key-value entries from the map.
  11318. *
  11319. * @private
  11320. * @name clear
  11321. * @memberOf MapCache
  11322. */
  11323. function mapCacheClear() {
  11324. this.__data__ = {
  11325. 'hash': new Hash,
  11326. 'map': new (Map || ListCache),
  11327. 'string': new Hash
  11328. };
  11329. }
  11330. /**
  11331. * Removes `key` and its value from the map.
  11332. *
  11333. * @private
  11334. * @name delete
  11335. * @memberOf MapCache
  11336. * @param {string} key The key of the value to remove.
  11337. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  11338. */
  11339. function mapCacheDelete(key) {
  11340. return getMapData(this, key)['delete'](key);
  11341. }
  11342. /**
  11343. * Gets the map value for `key`.
  11344. *
  11345. * @private
  11346. * @name get
  11347. * @memberOf MapCache
  11348. * @param {string} key The key of the value to get.
  11349. * @returns {*} Returns the entry value.
  11350. */
  11351. function mapCacheGet(key) {
  11352. return getMapData(this, key).get(key);
  11353. }
  11354. /**
  11355. * Checks if a map value for `key` exists.
  11356. *
  11357. * @private
  11358. * @name has
  11359. * @memberOf MapCache
  11360. * @param {string} key The key of the entry to check.
  11361. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  11362. */
  11363. function mapCacheHas(key) {
  11364. return getMapData(this, key).has(key);
  11365. }
  11366. /**
  11367. * Sets the map `key` to `value`.
  11368. *
  11369. * @private
  11370. * @name set
  11371. * @memberOf MapCache
  11372. * @param {string} key The key of the value to set.
  11373. * @param {*} value The value to set.
  11374. * @returns {Object} Returns the map cache instance.
  11375. */
  11376. function mapCacheSet(key, value) {
  11377. getMapData(this, key).set(key, value);
  11378. return this;
  11379. }
  11380. // Add methods to `MapCache`.
  11381. MapCache.prototype.clear = mapCacheClear;
  11382. MapCache.prototype['delete'] = mapCacheDelete;
  11383. MapCache.prototype.get = mapCacheGet;
  11384. MapCache.prototype.has = mapCacheHas;
  11385. MapCache.prototype.set = mapCacheSet;
  11386. /**
  11387. * Gets the index at which the `key` is found in `array` of key-value pairs.
  11388. *
  11389. * @private
  11390. * @param {Array} array The array to inspect.
  11391. * @param {*} key The key to search for.
  11392. * @returns {number} Returns the index of the matched value, else `-1`.
  11393. */
  11394. function assocIndexOf(array, key) {
  11395. var length = array.length;
  11396. while (length--) {
  11397. if (eq(array[length][0], key)) {
  11398. return length;
  11399. }
  11400. }
  11401. return -1;
  11402. }
  11403. /**
  11404. * The base implementation of `_.get` without support for default values.
  11405. *
  11406. * @private
  11407. * @param {Object} object The object to query.
  11408. * @param {Array|string} path The path of the property to get.
  11409. * @returns {*} Returns the resolved value.
  11410. */
  11411. function baseGet(object, path) {
  11412. path = isKey(path, object) ? [path] : castPath(path);
  11413. var index = 0,
  11414. length = path.length;
  11415. while (object != null && index < length) {
  11416. object = object[toKey(path[index++])];
  11417. }
  11418. return (index && index == length) ? object : undefined;
  11419. }
  11420. /**
  11421. * The base implementation of `_.isNative` without bad shim checks.
  11422. *
  11423. * @private
  11424. * @param {*} value The value to check.
  11425. * @returns {boolean} Returns `true` if `value` is a native function,
  11426. * else `false`.
  11427. */
  11428. function baseIsNative(value) {
  11429. if (!isObject(value) || isMasked(value)) {
  11430. return false;
  11431. }
  11432. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  11433. return pattern.test(toSource(value));
  11434. }
  11435. /**
  11436. * The base implementation of `_.toString` which doesn't convert nullish
  11437. * values to empty strings.
  11438. *
  11439. * @private
  11440. * @param {*} value The value to process.
  11441. * @returns {string} Returns the string.
  11442. */
  11443. function baseToString(value) {
  11444. // Exit early for strings to avoid a performance hit in some environments.
  11445. if (typeof value == 'string') {
  11446. return value;
  11447. }
  11448. if (isSymbol(value)) {
  11449. return symbolToString ? symbolToString.call(value) : '';
  11450. }
  11451. var result = (value + '');
  11452. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  11453. }
  11454. /**
  11455. * Casts `value` to a path array if it's not one.
  11456. *
  11457. * @private
  11458. * @param {*} value The value to inspect.
  11459. * @returns {Array} Returns the cast property path array.
  11460. */
  11461. function castPath(value) {
  11462. return isArray(value) ? value : stringToPath(value);
  11463. }
  11464. /**
  11465. * Gets the data for `map`.
  11466. *
  11467. * @private
  11468. * @param {Object} map The map to query.
  11469. * @param {string} key The reference key.
  11470. * @returns {*} Returns the map data.
  11471. */
  11472. function getMapData(map, key) {
  11473. var data = map.__data__;
  11474. return isKeyable(key)
  11475. ? data[typeof key == 'string' ? 'string' : 'hash']
  11476. : data.map;
  11477. }
  11478. /**
  11479. * Gets the native function at `key` of `object`.
  11480. *
  11481. * @private
  11482. * @param {Object} object The object to query.
  11483. * @param {string} key The key of the method to get.
  11484. * @returns {*} Returns the function if it's native, else `undefined`.
  11485. */
  11486. function getNative(object, key) {
  11487. var value = getValue(object, key);
  11488. return baseIsNative(value) ? value : undefined;
  11489. }
  11490. /**
  11491. * Checks if `value` is a property name and not a property path.
  11492. *
  11493. * @private
  11494. * @param {*} value The value to check.
  11495. * @param {Object} [object] The object to query keys on.
  11496. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  11497. */
  11498. function isKey(value, object) {
  11499. if (isArray(value)) {
  11500. return false;
  11501. }
  11502. var type = typeof value;
  11503. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  11504. value == null || isSymbol(value)) {
  11505. return true;
  11506. }
  11507. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  11508. (object != null && value in Object(object));
  11509. }
  11510. /**
  11511. * Checks if `value` is suitable for use as unique object key.
  11512. *
  11513. * @private
  11514. * @param {*} value The value to check.
  11515. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  11516. */
  11517. function isKeyable(value) {
  11518. var type = typeof value;
  11519. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  11520. ? (value !== '__proto__')
  11521. : (value === null);
  11522. }
  11523. /**
  11524. * Checks if `func` has its source masked.
  11525. *
  11526. * @private
  11527. * @param {Function} func The function to check.
  11528. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  11529. */
  11530. function isMasked(func) {
  11531. return !!maskSrcKey && (maskSrcKey in func);
  11532. }
  11533. /**
  11534. * Converts `string` to a property path array.
  11535. *
  11536. * @private
  11537. * @param {string} string The string to convert.
  11538. * @returns {Array} Returns the property path array.
  11539. */
  11540. var stringToPath = memoize(function(string) {
  11541. string = toString(string);
  11542. var result = [];
  11543. if (reLeadingDot.test(string)) {
  11544. result.push('');
  11545. }
  11546. string.replace(rePropName, function(match, number, quote, string) {
  11547. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  11548. });
  11549. return result;
  11550. });
  11551. /**
  11552. * Converts `value` to a string key if it's not a string or symbol.
  11553. *
  11554. * @private
  11555. * @param {*} value The value to inspect.
  11556. * @returns {string|symbol} Returns the key.
  11557. */
  11558. function toKey(value) {
  11559. if (typeof value == 'string' || isSymbol(value)) {
  11560. return value;
  11561. }
  11562. var result = (value + '');
  11563. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  11564. }
  11565. /**
  11566. * Converts `func` to its source code.
  11567. *
  11568. * @private
  11569. * @param {Function} func The function to process.
  11570. * @returns {string} Returns the source code.
  11571. */
  11572. function toSource(func) {
  11573. if (func != null) {
  11574. try {
  11575. return funcToString.call(func);
  11576. } catch (e) {}
  11577. try {
  11578. return (func + '');
  11579. } catch (e) {}
  11580. }
  11581. return '';
  11582. }
  11583. /**
  11584. * Creates a function that memoizes the result of `func`. If `resolver` is
  11585. * provided, it determines the cache key for storing the result based on the
  11586. * arguments provided to the memoized function. By default, the first argument
  11587. * provided to the memoized function is used as the map cache key. The `func`
  11588. * is invoked with the `this` binding of the memoized function.
  11589. *
  11590. * **Note:** The cache is exposed as the `cache` property on the memoized
  11591. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  11592. * constructor with one whose instances implement the
  11593. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  11594. * method interface of `delete`, `get`, `has`, and `set`.
  11595. *
  11596. * @static
  11597. * @memberOf _
  11598. * @since 0.1.0
  11599. * @category Function
  11600. * @param {Function} func The function to have its output memoized.
  11601. * @param {Function} [resolver] The function to resolve the cache key.
  11602. * @returns {Function} Returns the new memoized function.
  11603. * @example
  11604. *
  11605. * var object = { 'a': 1, 'b': 2 };
  11606. * var other = { 'c': 3, 'd': 4 };
  11607. *
  11608. * var values = _.memoize(_.values);
  11609. * values(object);
  11610. * // => [1, 2]
  11611. *
  11612. * values(other);
  11613. * // => [3, 4]
  11614. *
  11615. * object.a = 2;
  11616. * values(object);
  11617. * // => [1, 2]
  11618. *
  11619. * // Modify the result cache.
  11620. * values.cache.set(object, ['a', 'b']);
  11621. * values(object);
  11622. * // => ['a', 'b']
  11623. *
  11624. * // Replace `_.memoize.Cache`.
  11625. * _.memoize.Cache = WeakMap;
  11626. */
  11627. function memoize(func, resolver) {
  11628. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  11629. throw new TypeError(FUNC_ERROR_TEXT);
  11630. }
  11631. var memoized = function() {
  11632. var args = arguments,
  11633. key = resolver ? resolver.apply(this, args) : args[0],
  11634. cache = memoized.cache;
  11635. if (cache.has(key)) {
  11636. return cache.get(key);
  11637. }
  11638. var result = func.apply(this, args);
  11639. memoized.cache = cache.set(key, result);
  11640. return result;
  11641. };
  11642. memoized.cache = new (memoize.Cache || MapCache);
  11643. return memoized;
  11644. }
  11645. // Assign cache to `_.memoize`.
  11646. memoize.Cache = MapCache;
  11647. /**
  11648. * Performs a
  11649. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  11650. * comparison between two values to determine if they are equivalent.
  11651. *
  11652. * @static
  11653. * @memberOf _
  11654. * @since 4.0.0
  11655. * @category Lang
  11656. * @param {*} value The value to compare.
  11657. * @param {*} other The other value to compare.
  11658. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  11659. * @example
  11660. *
  11661. * var object = { 'a': 1 };
  11662. * var other = { 'a': 1 };
  11663. *
  11664. * _.eq(object, object);
  11665. * // => true
  11666. *
  11667. * _.eq(object, other);
  11668. * // => false
  11669. *
  11670. * _.eq('a', 'a');
  11671. * // => true
  11672. *
  11673. * _.eq('a', Object('a'));
  11674. * // => false
  11675. *
  11676. * _.eq(NaN, NaN);
  11677. * // => true
  11678. */
  11679. function eq(value, other) {
  11680. return value === other || (value !== value && other !== other);
  11681. }
  11682. /**
  11683. * Checks if `value` is classified as an `Array` object.
  11684. *
  11685. * @static
  11686. * @memberOf _
  11687. * @since 0.1.0
  11688. * @category Lang
  11689. * @param {*} value The value to check.
  11690. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  11691. * @example
  11692. *
  11693. * _.isArray([1, 2, 3]);
  11694. * // => true
  11695. *
  11696. * _.isArray(document.body.children);
  11697. * // => false
  11698. *
  11699. * _.isArray('abc');
  11700. * // => false
  11701. *
  11702. * _.isArray(_.noop);
  11703. * // => false
  11704. */
  11705. var isArray = Array.isArray;
  11706. /**
  11707. * Checks if `value` is classified as a `Function` object.
  11708. *
  11709. * @static
  11710. * @memberOf _
  11711. * @since 0.1.0
  11712. * @category Lang
  11713. * @param {*} value The value to check.
  11714. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  11715. * @example
  11716. *
  11717. * _.isFunction(_);
  11718. * // => true
  11719. *
  11720. * _.isFunction(/abc/);
  11721. * // => false
  11722. */
  11723. function isFunction(value) {
  11724. // The use of `Object#toString` avoids issues with the `typeof` operator
  11725. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  11726. var tag = isObject(value) ? objectToString.call(value) : '';
  11727. return tag == funcTag || tag == genTag;
  11728. }
  11729. /**
  11730. * Checks if `value` is the
  11731. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  11732. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  11733. *
  11734. * @static
  11735. * @memberOf _
  11736. * @since 0.1.0
  11737. * @category Lang
  11738. * @param {*} value The value to check.
  11739. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  11740. * @example
  11741. *
  11742. * _.isObject({});
  11743. * // => true
  11744. *
  11745. * _.isObject([1, 2, 3]);
  11746. * // => true
  11747. *
  11748. * _.isObject(_.noop);
  11749. * // => true
  11750. *
  11751. * _.isObject(null);
  11752. * // => false
  11753. */
  11754. function isObject(value) {
  11755. var type = typeof value;
  11756. return !!value && (type == 'object' || type == 'function');
  11757. }
  11758. /**
  11759. * Checks if `value` is object-like. A value is object-like if it's not `null`
  11760. * and has a `typeof` result of "object".
  11761. *
  11762. * @static
  11763. * @memberOf _
  11764. * @since 4.0.0
  11765. * @category Lang
  11766. * @param {*} value The value to check.
  11767. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  11768. * @example
  11769. *
  11770. * _.isObjectLike({});
  11771. * // => true
  11772. *
  11773. * _.isObjectLike([1, 2, 3]);
  11774. * // => true
  11775. *
  11776. * _.isObjectLike(_.noop);
  11777. * // => false
  11778. *
  11779. * _.isObjectLike(null);
  11780. * // => false
  11781. */
  11782. function isObjectLike(value) {
  11783. return !!value && typeof value == 'object';
  11784. }
  11785. /**
  11786. * Checks if `value` is classified as a `Symbol` primitive or object.
  11787. *
  11788. * @static
  11789. * @memberOf _
  11790. * @since 4.0.0
  11791. * @category Lang
  11792. * @param {*} value The value to check.
  11793. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  11794. * @example
  11795. *
  11796. * _.isSymbol(Symbol.iterator);
  11797. * // => true
  11798. *
  11799. * _.isSymbol('abc');
  11800. * // => false
  11801. */
  11802. function isSymbol(value) {
  11803. return typeof value == 'symbol' ||
  11804. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  11805. }
  11806. /**
  11807. * Converts `value` to a string. An empty string is returned for `null`
  11808. * and `undefined` values. The sign of `-0` is preserved.
  11809. *
  11810. * @static
  11811. * @memberOf _
  11812. * @since 4.0.0
  11813. * @category Lang
  11814. * @param {*} value The value to process.
  11815. * @returns {string} Returns the string.
  11816. * @example
  11817. *
  11818. * _.toString(null);
  11819. * // => ''
  11820. *
  11821. * _.toString(-0);
  11822. * // => '-0'
  11823. *
  11824. * _.toString([1, 2, 3]);
  11825. * // => '1,2,3'
  11826. */
  11827. function toString(value) {
  11828. return value == null ? '' : baseToString(value);
  11829. }
  11830. /**
  11831. * Gets the value at `path` of `object`. If the resolved value is
  11832. * `undefined`, the `defaultValue` is returned in its place.
  11833. *
  11834. * @static
  11835. * @memberOf _
  11836. * @since 3.7.0
  11837. * @category Object
  11838. * @param {Object} object The object to query.
  11839. * @param {Array|string} path The path of the property to get.
  11840. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  11841. * @returns {*} Returns the resolved value.
  11842. * @example
  11843. *
  11844. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  11845. *
  11846. * _.get(object, 'a[0].b.c');
  11847. * // => 3
  11848. *
  11849. * _.get(object, ['a', '0', 'b', 'c']);
  11850. * // => 3
  11851. *
  11852. * _.get(object, 'a.b.c', 'default');
  11853. * // => 'default'
  11854. */
  11855. function get(object, path, defaultValue) {
  11856. var result = object == null ? undefined : baseGet(object, path);
  11857. return result === undefined ? defaultValue : result;
  11858. }
  11859. module.exports = get;
  11860. /***/ }),
  11861. /***/ 855:
  11862. /***/ (function(module, __unusedexports, __webpack_require__) {
  11863. module.exports = registerPlugin;
  11864. const factory = __webpack_require__(47);
  11865. function registerPlugin(plugins, pluginFunction) {
  11866. return factory(
  11867. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  11868. );
  11869. }
  11870. /***/ }),
  11871. /***/ 856:
  11872. /***/ (function(module, __unusedexports, __webpack_require__) {
  11873. module.exports = __webpack_require__(141);
  11874. /***/ }),
  11875. /***/ 863:
  11876. /***/ (function(module, __unusedexports, __webpack_require__) {
  11877. module.exports = authenticationBeforeRequest;
  11878. const btoa = __webpack_require__(675);
  11879. const withAuthorizationPrefix = __webpack_require__(143);
  11880. function authenticationBeforeRequest(state, options) {
  11881. if (typeof state.auth === "string") {
  11882. options.headers.authorization = withAuthorizationPrefix(state.auth);
  11883. // https://developer.github.com/v3/previews/#integrations
  11884. if (
  11885. /^bearer /i.test(state.auth) &&
  11886. !/machine-man/.test(options.headers.accept)
  11887. ) {
  11888. const acceptHeaders = options.headers.accept
  11889. .split(",")
  11890. .concat("application/vnd.github.machine-man-preview+json");
  11891. options.headers.accept = acceptHeaders.filter(Boolean).join(",");
  11892. }
  11893. return;
  11894. }
  11895. if (state.auth.username) {
  11896. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  11897. options.headers.authorization = `Basic ${hash}`;
  11898. if (state.otp) {
  11899. options.headers["x-github-otp"] = state.otp;
  11900. }
  11901. return;
  11902. }
  11903. if (state.auth.clientId) {
  11904. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  11905. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  11906. // URL though: `/applications/:client_id/tokens/:access_token`.
  11907. //
  11908. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  11909. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  11910. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  11911. //
  11912. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  11913. // as well as "/applications/123/tokens/token456"
  11914. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  11915. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  11916. options.headers.authorization = `Basic ${hash}`;
  11917. return;
  11918. }
  11919. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  11920. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  11921. return;
  11922. }
  11923. return Promise.resolve()
  11924. .then(() => {
  11925. return state.auth();
  11926. })
  11927. .then(authorization => {
  11928. options.headers.authorization = withAuthorizationPrefix(authorization);
  11929. });
  11930. }
  11931. /***/ }),
  11932. /***/ 866:
  11933. /***/ (function(module, __unusedexports, __webpack_require__) {
  11934. "use strict";
  11935. var shebangRegex = __webpack_require__(816);
  11936. module.exports = function (str) {
  11937. var match = str.match(shebangRegex);
  11938. if (!match) {
  11939. return null;
  11940. }
  11941. var arr = match[0].replace(/#! ?/, '').split(' ');
  11942. var bin = arr[0].split('/').pop();
  11943. var arg = arr[1];
  11944. return (bin === 'env' ?
  11945. arg :
  11946. bin + (arg ? ' ' + arg : '')
  11947. );
  11948. };
  11949. /***/ }),
  11950. /***/ 874:
  11951. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11952. "use strict";
  11953. // Copyright (c) Microsoft. All rights reserved.
  11954. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  11955. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11956. return new (P || (P = Promise))(function (resolve, reject) {
  11957. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11958. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11959. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  11960. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11961. });
  11962. };
  11963. Object.defineProperty(exports, "__esModule", { value: true });
  11964. const url = __webpack_require__(835);
  11965. const http = __webpack_require__(605);
  11966. const https = __webpack_require__(211);
  11967. let fs;
  11968. let tunnel;
  11969. var HttpCodes;
  11970. (function (HttpCodes) {
  11971. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  11972. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  11973. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  11974. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  11975. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  11976. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  11977. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  11978. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  11979. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  11980. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  11981. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  11982. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  11983. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  11984. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  11985. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  11986. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  11987. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  11988. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  11989. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  11990. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  11991. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  11992. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  11993. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  11994. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  11995. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  11996. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  11997. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  11998. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  11999. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  12000. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  12001. const ExponentialBackoffCeiling = 10;
  12002. const ExponentialBackoffTimeSlice = 5;
  12003. class HttpClientResponse {
  12004. constructor(message) {
  12005. this.message = message;
  12006. }
  12007. readBody() {
  12008. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  12009. let output = '';
  12010. this.message.on('data', (chunk) => {
  12011. output += chunk;
  12012. });
  12013. this.message.on('end', () => {
  12014. resolve(output);
  12015. });
  12016. }));
  12017. }
  12018. }
  12019. exports.HttpClientResponse = HttpClientResponse;
  12020. function isHttps(requestUrl) {
  12021. let parsedUrl = url.parse(requestUrl);
  12022. return parsedUrl.protocol === 'https:';
  12023. }
  12024. exports.isHttps = isHttps;
  12025. var EnvironmentVariables;
  12026. (function (EnvironmentVariables) {
  12027. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  12028. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  12029. })(EnvironmentVariables || (EnvironmentVariables = {}));
  12030. class HttpClient {
  12031. constructor(userAgent, handlers, requestOptions) {
  12032. this._ignoreSslError = false;
  12033. this._allowRedirects = true;
  12034. this._maxRedirects = 50;
  12035. this._allowRetries = false;
  12036. this._maxRetries = 1;
  12037. this._keepAlive = false;
  12038. this._disposed = false;
  12039. this.userAgent = userAgent;
  12040. this.handlers = handlers || [];
  12041. this.requestOptions = requestOptions;
  12042. if (requestOptions) {
  12043. if (requestOptions.ignoreSslError != null) {
  12044. this._ignoreSslError = requestOptions.ignoreSslError;
  12045. }
  12046. this._socketTimeout = requestOptions.socketTimeout;
  12047. this._httpProxy = requestOptions.proxy;
  12048. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  12049. this._httpProxyBypassHosts = [];
  12050. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  12051. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  12052. });
  12053. }
  12054. this._certConfig = requestOptions.cert;
  12055. if (this._certConfig) {
  12056. // If using cert, need fs
  12057. fs = __webpack_require__(747);
  12058. // cache the cert content into memory, so we don't have to read it from disk every time
  12059. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  12060. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  12061. }
  12062. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  12063. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  12064. }
  12065. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  12066. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  12067. }
  12068. }
  12069. if (requestOptions.allowRedirects != null) {
  12070. this._allowRedirects = requestOptions.allowRedirects;
  12071. }
  12072. if (requestOptions.maxRedirects != null) {
  12073. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  12074. }
  12075. if (requestOptions.keepAlive != null) {
  12076. this._keepAlive = requestOptions.keepAlive;
  12077. }
  12078. if (requestOptions.allowRetries != null) {
  12079. this._allowRetries = requestOptions.allowRetries;
  12080. }
  12081. if (requestOptions.maxRetries != null) {
  12082. this._maxRetries = requestOptions.maxRetries;
  12083. }
  12084. }
  12085. }
  12086. options(requestUrl, additionalHeaders) {
  12087. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  12088. }
  12089. get(requestUrl, additionalHeaders) {
  12090. return this.request('GET', requestUrl, null, additionalHeaders || {});
  12091. }
  12092. del(requestUrl, additionalHeaders) {
  12093. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  12094. }
  12095. post(requestUrl, data, additionalHeaders) {
  12096. return this.request('POST', requestUrl, data, additionalHeaders || {});
  12097. }
  12098. patch(requestUrl, data, additionalHeaders) {
  12099. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  12100. }
  12101. put(requestUrl, data, additionalHeaders) {
  12102. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  12103. }
  12104. head(requestUrl, additionalHeaders) {
  12105. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  12106. }
  12107. sendStream(verb, requestUrl, stream, additionalHeaders) {
  12108. return this.request(verb, requestUrl, stream, additionalHeaders);
  12109. }
  12110. /**
  12111. * Makes a raw http request.
  12112. * All other methods such as get, post, patch, and request ultimately call this.
  12113. * Prefer get, del, post and patch
  12114. */
  12115. request(verb, requestUrl, data, headers) {
  12116. return __awaiter(this, void 0, void 0, function* () {
  12117. if (this._disposed) {
  12118. throw new Error("Client has already been disposed.");
  12119. }
  12120. let info = this._prepareRequest(verb, requestUrl, headers);
  12121. // Only perform retries on reads since writes may not be idempotent.
  12122. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  12123. let numTries = 0;
  12124. let response;
  12125. while (numTries < maxTries) {
  12126. response = yield this.requestRaw(info, data);
  12127. // Check if it's an authentication challenge
  12128. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  12129. let authenticationHandler;
  12130. for (let i = 0; i < this.handlers.length; i++) {
  12131. if (this.handlers[i].canHandleAuthentication(response)) {
  12132. authenticationHandler = this.handlers[i];
  12133. break;
  12134. }
  12135. }
  12136. if (authenticationHandler) {
  12137. return authenticationHandler.handleAuthentication(this, info, data);
  12138. }
  12139. else {
  12140. // We have received an unauthorized response but have no handlers to handle it.
  12141. // Let the response return to the caller.
  12142. return response;
  12143. }
  12144. }
  12145. let redirectsRemaining = this._maxRedirects;
  12146. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  12147. && this._allowRedirects
  12148. && redirectsRemaining > 0) {
  12149. const redirectUrl = response.message.headers["location"];
  12150. if (!redirectUrl) {
  12151. // if there's no location to redirect to, we won't
  12152. break;
  12153. }
  12154. // we need to finish reading the response before reassigning response
  12155. // which will leak the open socket.
  12156. yield response.readBody();
  12157. // let's make the request with the new redirectUrl
  12158. info = this._prepareRequest(verb, redirectUrl, headers);
  12159. response = yield this.requestRaw(info, data);
  12160. redirectsRemaining--;
  12161. }
  12162. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  12163. // If not a retry code, return immediately instead of retrying
  12164. return response;
  12165. }
  12166. numTries += 1;
  12167. if (numTries < maxTries) {
  12168. yield response.readBody();
  12169. yield this._performExponentialBackoff(numTries);
  12170. }
  12171. }
  12172. return response;
  12173. });
  12174. }
  12175. /**
  12176. * Needs to be called if keepAlive is set to true in request options.
  12177. */
  12178. dispose() {
  12179. if (this._agent) {
  12180. this._agent.destroy();
  12181. }
  12182. this._disposed = true;
  12183. }
  12184. /**
  12185. * Raw request.
  12186. * @param info
  12187. * @param data
  12188. */
  12189. requestRaw(info, data) {
  12190. return new Promise((resolve, reject) => {
  12191. let callbackForResult = function (err, res) {
  12192. if (err) {
  12193. reject(err);
  12194. }
  12195. resolve(res);
  12196. };
  12197. this.requestRawWithCallback(info, data, callbackForResult);
  12198. });
  12199. }
  12200. /**
  12201. * Raw request with callback.
  12202. * @param info
  12203. * @param data
  12204. * @param onResult
  12205. */
  12206. requestRawWithCallback(info, data, onResult) {
  12207. let socket;
  12208. let isDataString = typeof (data) === 'string';
  12209. if (typeof (data) === 'string') {
  12210. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  12211. }
  12212. let callbackCalled = false;
  12213. let handleResult = (err, res) => {
  12214. if (!callbackCalled) {
  12215. callbackCalled = true;
  12216. onResult(err, res);
  12217. }
  12218. };
  12219. let req = info.httpModule.request(info.options, (msg) => {
  12220. let res = new HttpClientResponse(msg);
  12221. handleResult(null, res);
  12222. });
  12223. req.on('socket', (sock) => {
  12224. socket = sock;
  12225. });
  12226. // If we ever get disconnected, we want the socket to timeout eventually
  12227. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  12228. if (socket) {
  12229. socket.end();
  12230. }
  12231. handleResult(new Error('Request timeout: ' + info.options.path), null);
  12232. });
  12233. req.on('error', function (err) {
  12234. // err has statusCode property
  12235. // res should have headers
  12236. handleResult(err, null);
  12237. });
  12238. if (data && typeof (data) === 'string') {
  12239. req.write(data, 'utf8');
  12240. }
  12241. if (data && typeof (data) !== 'string') {
  12242. data.on('close', function () {
  12243. req.end();
  12244. });
  12245. data.pipe(req);
  12246. }
  12247. else {
  12248. req.end();
  12249. }
  12250. }
  12251. _prepareRequest(method, requestUrl, headers) {
  12252. const info = {};
  12253. info.parsedUrl = url.parse(requestUrl);
  12254. const usingSsl = info.parsedUrl.protocol === 'https:';
  12255. info.httpModule = usingSsl ? https : http;
  12256. const defaultPort = usingSsl ? 443 : 80;
  12257. info.options = {};
  12258. info.options.host = info.parsedUrl.hostname;
  12259. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  12260. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  12261. info.options.method = method;
  12262. info.options.headers = this._mergeHeaders(headers);
  12263. info.options.headers["user-agent"] = this.userAgent;
  12264. info.options.agent = this._getAgent(requestUrl);
  12265. // gives handlers an opportunity to participate
  12266. if (this.handlers && !this._isPresigned(requestUrl)) {
  12267. this.handlers.forEach((handler) => {
  12268. handler.prepareRequest(info.options);
  12269. });
  12270. }
  12271. return info;
  12272. }
  12273. _isPresigned(requestUrl) {
  12274. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  12275. const patterns = this.requestOptions.presignedUrlPatterns;
  12276. for (let i = 0; i < patterns.length; i++) {
  12277. if (requestUrl.match(patterns[i])) {
  12278. return true;
  12279. }
  12280. }
  12281. }
  12282. return false;
  12283. }
  12284. _mergeHeaders(headers) {
  12285. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  12286. if (this.requestOptions && this.requestOptions.headers) {
  12287. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  12288. }
  12289. return lowercaseKeys(headers || {});
  12290. }
  12291. _getAgent(requestUrl) {
  12292. let agent;
  12293. let proxy = this._getProxy(requestUrl);
  12294. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  12295. if (this._keepAlive && useProxy) {
  12296. agent = this._proxyAgent;
  12297. }
  12298. if (this._keepAlive && !useProxy) {
  12299. agent = this._agent;
  12300. }
  12301. // if agent is already assigned use that agent.
  12302. if (!!agent) {
  12303. return agent;
  12304. }
  12305. let parsedUrl = url.parse(requestUrl);
  12306. const usingSsl = parsedUrl.protocol === 'https:';
  12307. let maxSockets = 100;
  12308. if (!!this.requestOptions) {
  12309. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  12310. }
  12311. if (useProxy) {
  12312. // If using proxy, need tunnel
  12313. if (!tunnel) {
  12314. tunnel = __webpack_require__(856);
  12315. }
  12316. const agentOptions = {
  12317. maxSockets: maxSockets,
  12318. keepAlive: this._keepAlive,
  12319. proxy: {
  12320. proxyAuth: proxy.proxyAuth,
  12321. host: proxy.proxyUrl.hostname,
  12322. port: proxy.proxyUrl.port
  12323. },
  12324. };
  12325. let tunnelAgent;
  12326. const overHttps = proxy.proxyUrl.protocol === 'https:';
  12327. if (usingSsl) {
  12328. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  12329. }
  12330. else {
  12331. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  12332. }
  12333. agent = tunnelAgent(agentOptions);
  12334. this._proxyAgent = agent;
  12335. }
  12336. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  12337. if (this._keepAlive && !agent) {
  12338. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  12339. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  12340. this._agent = agent;
  12341. }
  12342. // if not using private agent and tunnel agent isn't setup then use global agent
  12343. if (!agent) {
  12344. agent = usingSsl ? https.globalAgent : http.globalAgent;
  12345. }
  12346. if (usingSsl && this._ignoreSslError) {
  12347. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  12348. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  12349. // we have to cast it to any and change it directly
  12350. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  12351. }
  12352. if (usingSsl && this._certConfig) {
  12353. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  12354. }
  12355. return agent;
  12356. }
  12357. _getProxy(requestUrl) {
  12358. const parsedUrl = url.parse(requestUrl);
  12359. let usingSsl = parsedUrl.protocol === 'https:';
  12360. let proxyConfig = this._httpProxy;
  12361. // fallback to http_proxy and https_proxy env
  12362. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  12363. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  12364. if (!proxyConfig) {
  12365. if (https_proxy && usingSsl) {
  12366. proxyConfig = {
  12367. proxyUrl: https_proxy
  12368. };
  12369. }
  12370. else if (http_proxy) {
  12371. proxyConfig = {
  12372. proxyUrl: http_proxy
  12373. };
  12374. }
  12375. }
  12376. let proxyUrl;
  12377. let proxyAuth;
  12378. if (proxyConfig) {
  12379. if (proxyConfig.proxyUrl.length > 0) {
  12380. proxyUrl = url.parse(proxyConfig.proxyUrl);
  12381. }
  12382. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  12383. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  12384. }
  12385. }
  12386. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  12387. }
  12388. _isBypassProxy(requestUrl) {
  12389. if (!this._httpProxyBypassHosts) {
  12390. return false;
  12391. }
  12392. let bypass = false;
  12393. this._httpProxyBypassHosts.forEach(bypassHost => {
  12394. if (bypassHost.test(requestUrl)) {
  12395. bypass = true;
  12396. }
  12397. });
  12398. return bypass;
  12399. }
  12400. _performExponentialBackoff(retryNumber) {
  12401. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  12402. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  12403. return new Promise(resolve => setTimeout(() => resolve(), ms));
  12404. }
  12405. }
  12406. exports.HttpClient = HttpClient;
  12407. /***/ }),
  12408. /***/ 881:
  12409. /***/ (function(module) {
  12410. "use strict";
  12411. const isWin = process.platform === 'win32';
  12412. function notFoundError(original, syscall) {
  12413. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  12414. code: 'ENOENT',
  12415. errno: 'ENOENT',
  12416. syscall: `${syscall} ${original.command}`,
  12417. path: original.command,
  12418. spawnargs: original.args,
  12419. });
  12420. }
  12421. function hookChildProcess(cp, parsed) {
  12422. if (!isWin) {
  12423. return;
  12424. }
  12425. const originalEmit = cp.emit;
  12426. cp.emit = function (name, arg1) {
  12427. // If emitting "exit" event and exit code is 1, we need to check if
  12428. // the command exists and emit an "error" instead
  12429. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  12430. if (name === 'exit') {
  12431. const err = verifyENOENT(arg1, parsed, 'spawn');
  12432. if (err) {
  12433. return originalEmit.call(cp, 'error', err);
  12434. }
  12435. }
  12436. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  12437. };
  12438. }
  12439. function verifyENOENT(status, parsed) {
  12440. if (isWin && status === 1 && !parsed.file) {
  12441. return notFoundError(parsed.original, 'spawn');
  12442. }
  12443. return null;
  12444. }
  12445. function verifyENOENTSync(status, parsed) {
  12446. if (isWin && status === 1 && !parsed.file) {
  12447. return notFoundError(parsed.original, 'spawnSync');
  12448. }
  12449. return null;
  12450. }
  12451. module.exports = {
  12452. hookChildProcess,
  12453. verifyENOENT,
  12454. verifyENOENTSync,
  12455. notFoundError,
  12456. };
  12457. /***/ }),
  12458. /***/ 883:
  12459. /***/ (function(module) {
  12460. /**
  12461. * lodash (Custom Build) <https://lodash.com/>
  12462. * Build: `lodash modularize exports="npm" -o ./`
  12463. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12464. * Released under MIT license <https://lodash.com/license>
  12465. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12466. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12467. */
  12468. /** Used as the `TypeError` message for "Functions" methods. */
  12469. var FUNC_ERROR_TEXT = 'Expected a function';
  12470. /** Used to stand-in for `undefined` hash values. */
  12471. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12472. /** Used as references for various `Number` constants. */
  12473. var INFINITY = 1 / 0,
  12474. MAX_SAFE_INTEGER = 9007199254740991;
  12475. /** `Object#toString` result references. */
  12476. var funcTag = '[object Function]',
  12477. genTag = '[object GeneratorFunction]',
  12478. symbolTag = '[object Symbol]';
  12479. /** Used to match property names within property paths. */
  12480. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12481. reIsPlainProp = /^\w*$/,
  12482. reLeadingDot = /^\./,
  12483. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12484. /**
  12485. * Used to match `RegExp`
  12486. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12487. */
  12488. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12489. /** Used to match backslashes in property paths. */
  12490. var reEscapeChar = /\\(\\)?/g;
  12491. /** Used to detect host constructors (Safari). */
  12492. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12493. /** Used to detect unsigned integer values. */
  12494. var reIsUint = /^(?:0|[1-9]\d*)$/;
  12495. /** Detect free variable `global` from Node.js. */
  12496. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12497. /** Detect free variable `self`. */
  12498. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12499. /** Used as a reference to the global object. */
  12500. var root = freeGlobal || freeSelf || Function('return this')();
  12501. /**
  12502. * Gets the value at `key` of `object`.
  12503. *
  12504. * @private
  12505. * @param {Object} [object] The object to query.
  12506. * @param {string} key The key of the property to get.
  12507. * @returns {*} Returns the property value.
  12508. */
  12509. function getValue(object, key) {
  12510. return object == null ? undefined : object[key];
  12511. }
  12512. /**
  12513. * Checks if `value` is a host object in IE < 9.
  12514. *
  12515. * @private
  12516. * @param {*} value The value to check.
  12517. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12518. */
  12519. function isHostObject(value) {
  12520. // Many host objects are `Object` objects that can coerce to strings
  12521. // despite having improperly defined `toString` methods.
  12522. var result = false;
  12523. if (value != null && typeof value.toString != 'function') {
  12524. try {
  12525. result = !!(value + '');
  12526. } catch (e) {}
  12527. }
  12528. return result;
  12529. }
  12530. /** Used for built-in method references. */
  12531. var arrayProto = Array.prototype,
  12532. funcProto = Function.prototype,
  12533. objectProto = Object.prototype;
  12534. /** Used to detect overreaching core-js shims. */
  12535. var coreJsData = root['__core-js_shared__'];
  12536. /** Used to detect methods masquerading as native. */
  12537. var maskSrcKey = (function() {
  12538. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12539. return uid ? ('Symbol(src)_1.' + uid) : '';
  12540. }());
  12541. /** Used to resolve the decompiled source of functions. */
  12542. var funcToString = funcProto.toString;
  12543. /** Used to check objects for own properties. */
  12544. var hasOwnProperty = objectProto.hasOwnProperty;
  12545. /**
  12546. * Used to resolve the
  12547. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12548. * of values.
  12549. */
  12550. var objectToString = objectProto.toString;
  12551. /** Used to detect if a method is native. */
  12552. var reIsNative = RegExp('^' +
  12553. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12554. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12555. );
  12556. /** Built-in value references. */
  12557. var Symbol = root.Symbol,
  12558. splice = arrayProto.splice;
  12559. /* Built-in method references that are verified to be native. */
  12560. var Map = getNative(root, 'Map'),
  12561. nativeCreate = getNative(Object, 'create');
  12562. /** Used to convert symbols to primitives and strings. */
  12563. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12564. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12565. /**
  12566. * Creates a hash object.
  12567. *
  12568. * @private
  12569. * @constructor
  12570. * @param {Array} [entries] The key-value pairs to cache.
  12571. */
  12572. function Hash(entries) {
  12573. var index = -1,
  12574. length = entries ? entries.length : 0;
  12575. this.clear();
  12576. while (++index < length) {
  12577. var entry = entries[index];
  12578. this.set(entry[0], entry[1]);
  12579. }
  12580. }
  12581. /**
  12582. * Removes all key-value entries from the hash.
  12583. *
  12584. * @private
  12585. * @name clear
  12586. * @memberOf Hash
  12587. */
  12588. function hashClear() {
  12589. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12590. }
  12591. /**
  12592. * Removes `key` and its value from the hash.
  12593. *
  12594. * @private
  12595. * @name delete
  12596. * @memberOf Hash
  12597. * @param {Object} hash The hash to modify.
  12598. * @param {string} key The key of the value to remove.
  12599. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12600. */
  12601. function hashDelete(key) {
  12602. return this.has(key) && delete this.__data__[key];
  12603. }
  12604. /**
  12605. * Gets the hash value for `key`.
  12606. *
  12607. * @private
  12608. * @name get
  12609. * @memberOf Hash
  12610. * @param {string} key The key of the value to get.
  12611. * @returns {*} Returns the entry value.
  12612. */
  12613. function hashGet(key) {
  12614. var data = this.__data__;
  12615. if (nativeCreate) {
  12616. var result = data[key];
  12617. return result === HASH_UNDEFINED ? undefined : result;
  12618. }
  12619. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12620. }
  12621. /**
  12622. * Checks if a hash value for `key` exists.
  12623. *
  12624. * @private
  12625. * @name has
  12626. * @memberOf Hash
  12627. * @param {string} key The key of the entry to check.
  12628. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12629. */
  12630. function hashHas(key) {
  12631. var data = this.__data__;
  12632. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12633. }
  12634. /**
  12635. * Sets the hash `key` to `value`.
  12636. *
  12637. * @private
  12638. * @name set
  12639. * @memberOf Hash
  12640. * @param {string} key The key of the value to set.
  12641. * @param {*} value The value to set.
  12642. * @returns {Object} Returns the hash instance.
  12643. */
  12644. function hashSet(key, value) {
  12645. var data = this.__data__;
  12646. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12647. return this;
  12648. }
  12649. // Add methods to `Hash`.
  12650. Hash.prototype.clear = hashClear;
  12651. Hash.prototype['delete'] = hashDelete;
  12652. Hash.prototype.get = hashGet;
  12653. Hash.prototype.has = hashHas;
  12654. Hash.prototype.set = hashSet;
  12655. /**
  12656. * Creates an list cache object.
  12657. *
  12658. * @private
  12659. * @constructor
  12660. * @param {Array} [entries] The key-value pairs to cache.
  12661. */
  12662. function ListCache(entries) {
  12663. var index = -1,
  12664. length = entries ? entries.length : 0;
  12665. this.clear();
  12666. while (++index < length) {
  12667. var entry = entries[index];
  12668. this.set(entry[0], entry[1]);
  12669. }
  12670. }
  12671. /**
  12672. * Removes all key-value entries from the list cache.
  12673. *
  12674. * @private
  12675. * @name clear
  12676. * @memberOf ListCache
  12677. */
  12678. function listCacheClear() {
  12679. this.__data__ = [];
  12680. }
  12681. /**
  12682. * Removes `key` and its value from the list cache.
  12683. *
  12684. * @private
  12685. * @name delete
  12686. * @memberOf ListCache
  12687. * @param {string} key The key of the value to remove.
  12688. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12689. */
  12690. function listCacheDelete(key) {
  12691. var data = this.__data__,
  12692. index = assocIndexOf(data, key);
  12693. if (index < 0) {
  12694. return false;
  12695. }
  12696. var lastIndex = data.length - 1;
  12697. if (index == lastIndex) {
  12698. data.pop();
  12699. } else {
  12700. splice.call(data, index, 1);
  12701. }
  12702. return true;
  12703. }
  12704. /**
  12705. * Gets the list cache value for `key`.
  12706. *
  12707. * @private
  12708. * @name get
  12709. * @memberOf ListCache
  12710. * @param {string} key The key of the value to get.
  12711. * @returns {*} Returns the entry value.
  12712. */
  12713. function listCacheGet(key) {
  12714. var data = this.__data__,
  12715. index = assocIndexOf(data, key);
  12716. return index < 0 ? undefined : data[index][1];
  12717. }
  12718. /**
  12719. * Checks if a list cache value for `key` exists.
  12720. *
  12721. * @private
  12722. * @name has
  12723. * @memberOf ListCache
  12724. * @param {string} key The key of the entry to check.
  12725. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12726. */
  12727. function listCacheHas(key) {
  12728. return assocIndexOf(this.__data__, key) > -1;
  12729. }
  12730. /**
  12731. * Sets the list cache `key` to `value`.
  12732. *
  12733. * @private
  12734. * @name set
  12735. * @memberOf ListCache
  12736. * @param {string} key The key of the value to set.
  12737. * @param {*} value The value to set.
  12738. * @returns {Object} Returns the list cache instance.
  12739. */
  12740. function listCacheSet(key, value) {
  12741. var data = this.__data__,
  12742. index = assocIndexOf(data, key);
  12743. if (index < 0) {
  12744. data.push([key, value]);
  12745. } else {
  12746. data[index][1] = value;
  12747. }
  12748. return this;
  12749. }
  12750. // Add methods to `ListCache`.
  12751. ListCache.prototype.clear = listCacheClear;
  12752. ListCache.prototype['delete'] = listCacheDelete;
  12753. ListCache.prototype.get = listCacheGet;
  12754. ListCache.prototype.has = listCacheHas;
  12755. ListCache.prototype.set = listCacheSet;
  12756. /**
  12757. * Creates a map cache object to store key-value pairs.
  12758. *
  12759. * @private
  12760. * @constructor
  12761. * @param {Array} [entries] The key-value pairs to cache.
  12762. */
  12763. function MapCache(entries) {
  12764. var index = -1,
  12765. length = entries ? entries.length : 0;
  12766. this.clear();
  12767. while (++index < length) {
  12768. var entry = entries[index];
  12769. this.set(entry[0], entry[1]);
  12770. }
  12771. }
  12772. /**
  12773. * Removes all key-value entries from the map.
  12774. *
  12775. * @private
  12776. * @name clear
  12777. * @memberOf MapCache
  12778. */
  12779. function mapCacheClear() {
  12780. this.__data__ = {
  12781. 'hash': new Hash,
  12782. 'map': new (Map || ListCache),
  12783. 'string': new Hash
  12784. };
  12785. }
  12786. /**
  12787. * Removes `key` and its value from the map.
  12788. *
  12789. * @private
  12790. * @name delete
  12791. * @memberOf MapCache
  12792. * @param {string} key The key of the value to remove.
  12793. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12794. */
  12795. function mapCacheDelete(key) {
  12796. return getMapData(this, key)['delete'](key);
  12797. }
  12798. /**
  12799. * Gets the map value for `key`.
  12800. *
  12801. * @private
  12802. * @name get
  12803. * @memberOf MapCache
  12804. * @param {string} key The key of the value to get.
  12805. * @returns {*} Returns the entry value.
  12806. */
  12807. function mapCacheGet(key) {
  12808. return getMapData(this, key).get(key);
  12809. }
  12810. /**
  12811. * Checks if a map value for `key` exists.
  12812. *
  12813. * @private
  12814. * @name has
  12815. * @memberOf MapCache
  12816. * @param {string} key The key of the entry to check.
  12817. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12818. */
  12819. function mapCacheHas(key) {
  12820. return getMapData(this, key).has(key);
  12821. }
  12822. /**
  12823. * Sets the map `key` to `value`.
  12824. *
  12825. * @private
  12826. * @name set
  12827. * @memberOf MapCache
  12828. * @param {string} key The key of the value to set.
  12829. * @param {*} value The value to set.
  12830. * @returns {Object} Returns the map cache instance.
  12831. */
  12832. function mapCacheSet(key, value) {
  12833. getMapData(this, key).set(key, value);
  12834. return this;
  12835. }
  12836. // Add methods to `MapCache`.
  12837. MapCache.prototype.clear = mapCacheClear;
  12838. MapCache.prototype['delete'] = mapCacheDelete;
  12839. MapCache.prototype.get = mapCacheGet;
  12840. MapCache.prototype.has = mapCacheHas;
  12841. MapCache.prototype.set = mapCacheSet;
  12842. /**
  12843. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  12844. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12845. * for equality comparisons.
  12846. *
  12847. * @private
  12848. * @param {Object} object The object to modify.
  12849. * @param {string} key The key of the property to assign.
  12850. * @param {*} value The value to assign.
  12851. */
  12852. function assignValue(object, key, value) {
  12853. var objValue = object[key];
  12854. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  12855. (value === undefined && !(key in object))) {
  12856. object[key] = value;
  12857. }
  12858. }
  12859. /**
  12860. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12861. *
  12862. * @private
  12863. * @param {Array} array The array to inspect.
  12864. * @param {*} key The key to search for.
  12865. * @returns {number} Returns the index of the matched value, else `-1`.
  12866. */
  12867. function assocIndexOf(array, key) {
  12868. var length = array.length;
  12869. while (length--) {
  12870. if (eq(array[length][0], key)) {
  12871. return length;
  12872. }
  12873. }
  12874. return -1;
  12875. }
  12876. /**
  12877. * The base implementation of `_.isNative` without bad shim checks.
  12878. *
  12879. * @private
  12880. * @param {*} value The value to check.
  12881. * @returns {boolean} Returns `true` if `value` is a native function,
  12882. * else `false`.
  12883. */
  12884. function baseIsNative(value) {
  12885. if (!isObject(value) || isMasked(value)) {
  12886. return false;
  12887. }
  12888. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12889. return pattern.test(toSource(value));
  12890. }
  12891. /**
  12892. * The base implementation of `_.set`.
  12893. *
  12894. * @private
  12895. * @param {Object} object The object to modify.
  12896. * @param {Array|string} path The path of the property to set.
  12897. * @param {*} value The value to set.
  12898. * @param {Function} [customizer] The function to customize path creation.
  12899. * @returns {Object} Returns `object`.
  12900. */
  12901. function baseSet(object, path, value, customizer) {
  12902. if (!isObject(object)) {
  12903. return object;
  12904. }
  12905. path = isKey(path, object) ? [path] : castPath(path);
  12906. var index = -1,
  12907. length = path.length,
  12908. lastIndex = length - 1,
  12909. nested = object;
  12910. while (nested != null && ++index < length) {
  12911. var key = toKey(path[index]),
  12912. newValue = value;
  12913. if (index != lastIndex) {
  12914. var objValue = nested[key];
  12915. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  12916. if (newValue === undefined) {
  12917. newValue = isObject(objValue)
  12918. ? objValue
  12919. : (isIndex(path[index + 1]) ? [] : {});
  12920. }
  12921. }
  12922. assignValue(nested, key, newValue);
  12923. nested = nested[key];
  12924. }
  12925. return object;
  12926. }
  12927. /**
  12928. * The base implementation of `_.toString` which doesn't convert nullish
  12929. * values to empty strings.
  12930. *
  12931. * @private
  12932. * @param {*} value The value to process.
  12933. * @returns {string} Returns the string.
  12934. */
  12935. function baseToString(value) {
  12936. // Exit early for strings to avoid a performance hit in some environments.
  12937. if (typeof value == 'string') {
  12938. return value;
  12939. }
  12940. if (isSymbol(value)) {
  12941. return symbolToString ? symbolToString.call(value) : '';
  12942. }
  12943. var result = (value + '');
  12944. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12945. }
  12946. /**
  12947. * Casts `value` to a path array if it's not one.
  12948. *
  12949. * @private
  12950. * @param {*} value The value to inspect.
  12951. * @returns {Array} Returns the cast property path array.
  12952. */
  12953. function castPath(value) {
  12954. return isArray(value) ? value : stringToPath(value);
  12955. }
  12956. /**
  12957. * Gets the data for `map`.
  12958. *
  12959. * @private
  12960. * @param {Object} map The map to query.
  12961. * @param {string} key The reference key.
  12962. * @returns {*} Returns the map data.
  12963. */
  12964. function getMapData(map, key) {
  12965. var data = map.__data__;
  12966. return isKeyable(key)
  12967. ? data[typeof key == 'string' ? 'string' : 'hash']
  12968. : data.map;
  12969. }
  12970. /**
  12971. * Gets the native function at `key` of `object`.
  12972. *
  12973. * @private
  12974. * @param {Object} object The object to query.
  12975. * @param {string} key The key of the method to get.
  12976. * @returns {*} Returns the function if it's native, else `undefined`.
  12977. */
  12978. function getNative(object, key) {
  12979. var value = getValue(object, key);
  12980. return baseIsNative(value) ? value : undefined;
  12981. }
  12982. /**
  12983. * Checks if `value` is a valid array-like index.
  12984. *
  12985. * @private
  12986. * @param {*} value The value to check.
  12987. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  12988. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  12989. */
  12990. function isIndex(value, length) {
  12991. length = length == null ? MAX_SAFE_INTEGER : length;
  12992. return !!length &&
  12993. (typeof value == 'number' || reIsUint.test(value)) &&
  12994. (value > -1 && value % 1 == 0 && value < length);
  12995. }
  12996. /**
  12997. * Checks if `value` is a property name and not a property path.
  12998. *
  12999. * @private
  13000. * @param {*} value The value to check.
  13001. * @param {Object} [object] The object to query keys on.
  13002. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  13003. */
  13004. function isKey(value, object) {
  13005. if (isArray(value)) {
  13006. return false;
  13007. }
  13008. var type = typeof value;
  13009. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  13010. value == null || isSymbol(value)) {
  13011. return true;
  13012. }
  13013. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  13014. (object != null && value in Object(object));
  13015. }
  13016. /**
  13017. * Checks if `value` is suitable for use as unique object key.
  13018. *
  13019. * @private
  13020. * @param {*} value The value to check.
  13021. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  13022. */
  13023. function isKeyable(value) {
  13024. var type = typeof value;
  13025. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  13026. ? (value !== '__proto__')
  13027. : (value === null);
  13028. }
  13029. /**
  13030. * Checks if `func` has its source masked.
  13031. *
  13032. * @private
  13033. * @param {Function} func The function to check.
  13034. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  13035. */
  13036. function isMasked(func) {
  13037. return !!maskSrcKey && (maskSrcKey in func);
  13038. }
  13039. /**
  13040. * Converts `string` to a property path array.
  13041. *
  13042. * @private
  13043. * @param {string} string The string to convert.
  13044. * @returns {Array} Returns the property path array.
  13045. */
  13046. var stringToPath = memoize(function(string) {
  13047. string = toString(string);
  13048. var result = [];
  13049. if (reLeadingDot.test(string)) {
  13050. result.push('');
  13051. }
  13052. string.replace(rePropName, function(match, number, quote, string) {
  13053. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  13054. });
  13055. return result;
  13056. });
  13057. /**
  13058. * Converts `value` to a string key if it's not a string or symbol.
  13059. *
  13060. * @private
  13061. * @param {*} value The value to inspect.
  13062. * @returns {string|symbol} Returns the key.
  13063. */
  13064. function toKey(value) {
  13065. if (typeof value == 'string' || isSymbol(value)) {
  13066. return value;
  13067. }
  13068. var result = (value + '');
  13069. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  13070. }
  13071. /**
  13072. * Converts `func` to its source code.
  13073. *
  13074. * @private
  13075. * @param {Function} func The function to process.
  13076. * @returns {string} Returns the source code.
  13077. */
  13078. function toSource(func) {
  13079. if (func != null) {
  13080. try {
  13081. return funcToString.call(func);
  13082. } catch (e) {}
  13083. try {
  13084. return (func + '');
  13085. } catch (e) {}
  13086. }
  13087. return '';
  13088. }
  13089. /**
  13090. * Creates a function that memoizes the result of `func`. If `resolver` is
  13091. * provided, it determines the cache key for storing the result based on the
  13092. * arguments provided to the memoized function. By default, the first argument
  13093. * provided to the memoized function is used as the map cache key. The `func`
  13094. * is invoked with the `this` binding of the memoized function.
  13095. *
  13096. * **Note:** The cache is exposed as the `cache` property on the memoized
  13097. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  13098. * constructor with one whose instances implement the
  13099. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  13100. * method interface of `delete`, `get`, `has`, and `set`.
  13101. *
  13102. * @static
  13103. * @memberOf _
  13104. * @since 0.1.0
  13105. * @category Function
  13106. * @param {Function} func The function to have its output memoized.
  13107. * @param {Function} [resolver] The function to resolve the cache key.
  13108. * @returns {Function} Returns the new memoized function.
  13109. * @example
  13110. *
  13111. * var object = { 'a': 1, 'b': 2 };
  13112. * var other = { 'c': 3, 'd': 4 };
  13113. *
  13114. * var values = _.memoize(_.values);
  13115. * values(object);
  13116. * // => [1, 2]
  13117. *
  13118. * values(other);
  13119. * // => [3, 4]
  13120. *
  13121. * object.a = 2;
  13122. * values(object);
  13123. * // => [1, 2]
  13124. *
  13125. * // Modify the result cache.
  13126. * values.cache.set(object, ['a', 'b']);
  13127. * values(object);
  13128. * // => ['a', 'b']
  13129. *
  13130. * // Replace `_.memoize.Cache`.
  13131. * _.memoize.Cache = WeakMap;
  13132. */
  13133. function memoize(func, resolver) {
  13134. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  13135. throw new TypeError(FUNC_ERROR_TEXT);
  13136. }
  13137. var memoized = function() {
  13138. var args = arguments,
  13139. key = resolver ? resolver.apply(this, args) : args[0],
  13140. cache = memoized.cache;
  13141. if (cache.has(key)) {
  13142. return cache.get(key);
  13143. }
  13144. var result = func.apply(this, args);
  13145. memoized.cache = cache.set(key, result);
  13146. return result;
  13147. };
  13148. memoized.cache = new (memoize.Cache || MapCache);
  13149. return memoized;
  13150. }
  13151. // Assign cache to `_.memoize`.
  13152. memoize.Cache = MapCache;
  13153. /**
  13154. * Performs a
  13155. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13156. * comparison between two values to determine if they are equivalent.
  13157. *
  13158. * @static
  13159. * @memberOf _
  13160. * @since 4.0.0
  13161. * @category Lang
  13162. * @param {*} value The value to compare.
  13163. * @param {*} other The other value to compare.
  13164. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  13165. * @example
  13166. *
  13167. * var object = { 'a': 1 };
  13168. * var other = { 'a': 1 };
  13169. *
  13170. * _.eq(object, object);
  13171. * // => true
  13172. *
  13173. * _.eq(object, other);
  13174. * // => false
  13175. *
  13176. * _.eq('a', 'a');
  13177. * // => true
  13178. *
  13179. * _.eq('a', Object('a'));
  13180. * // => false
  13181. *
  13182. * _.eq(NaN, NaN);
  13183. * // => true
  13184. */
  13185. function eq(value, other) {
  13186. return value === other || (value !== value && other !== other);
  13187. }
  13188. /**
  13189. * Checks if `value` is classified as an `Array` object.
  13190. *
  13191. * @static
  13192. * @memberOf _
  13193. * @since 0.1.0
  13194. * @category Lang
  13195. * @param {*} value The value to check.
  13196. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  13197. * @example
  13198. *
  13199. * _.isArray([1, 2, 3]);
  13200. * // => true
  13201. *
  13202. * _.isArray(document.body.children);
  13203. * // => false
  13204. *
  13205. * _.isArray('abc');
  13206. * // => false
  13207. *
  13208. * _.isArray(_.noop);
  13209. * // => false
  13210. */
  13211. var isArray = Array.isArray;
  13212. /**
  13213. * Checks if `value` is classified as a `Function` object.
  13214. *
  13215. * @static
  13216. * @memberOf _
  13217. * @since 0.1.0
  13218. * @category Lang
  13219. * @param {*} value The value to check.
  13220. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  13221. * @example
  13222. *
  13223. * _.isFunction(_);
  13224. * // => true
  13225. *
  13226. * _.isFunction(/abc/);
  13227. * // => false
  13228. */
  13229. function isFunction(value) {
  13230. // The use of `Object#toString` avoids issues with the `typeof` operator
  13231. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  13232. var tag = isObject(value) ? objectToString.call(value) : '';
  13233. return tag == funcTag || tag == genTag;
  13234. }
  13235. /**
  13236. * Checks if `value` is the
  13237. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  13238. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  13239. *
  13240. * @static
  13241. * @memberOf _
  13242. * @since 0.1.0
  13243. * @category Lang
  13244. * @param {*} value The value to check.
  13245. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  13246. * @example
  13247. *
  13248. * _.isObject({});
  13249. * // => true
  13250. *
  13251. * _.isObject([1, 2, 3]);
  13252. * // => true
  13253. *
  13254. * _.isObject(_.noop);
  13255. * // => true
  13256. *
  13257. * _.isObject(null);
  13258. * // => false
  13259. */
  13260. function isObject(value) {
  13261. var type = typeof value;
  13262. return !!value && (type == 'object' || type == 'function');
  13263. }
  13264. /**
  13265. * Checks if `value` is object-like. A value is object-like if it's not `null`
  13266. * and has a `typeof` result of "object".
  13267. *
  13268. * @static
  13269. * @memberOf _
  13270. * @since 4.0.0
  13271. * @category Lang
  13272. * @param {*} value The value to check.
  13273. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  13274. * @example
  13275. *
  13276. * _.isObjectLike({});
  13277. * // => true
  13278. *
  13279. * _.isObjectLike([1, 2, 3]);
  13280. * // => true
  13281. *
  13282. * _.isObjectLike(_.noop);
  13283. * // => false
  13284. *
  13285. * _.isObjectLike(null);
  13286. * // => false
  13287. */
  13288. function isObjectLike(value) {
  13289. return !!value && typeof value == 'object';
  13290. }
  13291. /**
  13292. * Checks if `value` is classified as a `Symbol` primitive or object.
  13293. *
  13294. * @static
  13295. * @memberOf _
  13296. * @since 4.0.0
  13297. * @category Lang
  13298. * @param {*} value The value to check.
  13299. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  13300. * @example
  13301. *
  13302. * _.isSymbol(Symbol.iterator);
  13303. * // => true
  13304. *
  13305. * _.isSymbol('abc');
  13306. * // => false
  13307. */
  13308. function isSymbol(value) {
  13309. return typeof value == 'symbol' ||
  13310. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  13311. }
  13312. /**
  13313. * Converts `value` to a string. An empty string is returned for `null`
  13314. * and `undefined` values. The sign of `-0` is preserved.
  13315. *
  13316. * @static
  13317. * @memberOf _
  13318. * @since 4.0.0
  13319. * @category Lang
  13320. * @param {*} value The value to process.
  13321. * @returns {string} Returns the string.
  13322. * @example
  13323. *
  13324. * _.toString(null);
  13325. * // => ''
  13326. *
  13327. * _.toString(-0);
  13328. * // => '-0'
  13329. *
  13330. * _.toString([1, 2, 3]);
  13331. * // => '1,2,3'
  13332. */
  13333. function toString(value) {
  13334. return value == null ? '' : baseToString(value);
  13335. }
  13336. /**
  13337. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  13338. * it's created. Arrays are created for missing index properties while objects
  13339. * are created for all other missing properties. Use `_.setWith` to customize
  13340. * `path` creation.
  13341. *
  13342. * **Note:** This method mutates `object`.
  13343. *
  13344. * @static
  13345. * @memberOf _
  13346. * @since 3.7.0
  13347. * @category Object
  13348. * @param {Object} object The object to modify.
  13349. * @param {Array|string} path The path of the property to set.
  13350. * @param {*} value The value to set.
  13351. * @returns {Object} Returns `object`.
  13352. * @example
  13353. *
  13354. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  13355. *
  13356. * _.set(object, 'a[0].b.c', 4);
  13357. * console.log(object.a[0].b.c);
  13358. * // => 4
  13359. *
  13360. * _.set(object, ['x', '0', 'y', 'z'], 5);
  13361. * console.log(object.x[0].y.z);
  13362. * // => 5
  13363. */
  13364. function set(object, path, value) {
  13365. return object == null ? object : baseSet(object, path, value);
  13366. }
  13367. module.exports = set;
  13368. /***/ }),
  13369. /***/ 898:
  13370. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13371. "use strict";
  13372. Object.defineProperty(exports, '__esModule', { value: true });
  13373. var request = __webpack_require__(753);
  13374. var universalUserAgent = __webpack_require__(796);
  13375. const VERSION = "4.3.1";
  13376. class GraphqlError extends Error {
  13377. constructor(request, response) {
  13378. const message = response.data.errors[0].message;
  13379. super(message);
  13380. Object.assign(this, response.data);
  13381. this.name = "GraphqlError";
  13382. this.request = request; // Maintains proper stack trace (only available on V8)
  13383. /* istanbul ignore next */
  13384. if (Error.captureStackTrace) {
  13385. Error.captureStackTrace(this, this.constructor);
  13386. }
  13387. }
  13388. }
  13389. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  13390. function graphql(request, query, options) {
  13391. options = typeof query === "string" ? options = Object.assign({
  13392. query
  13393. }, options) : options = query;
  13394. const requestOptions = Object.keys(options).reduce((result, key) => {
  13395. if (NON_VARIABLE_OPTIONS.includes(key)) {
  13396. result[key] = options[key];
  13397. return result;
  13398. }
  13399. if (!result.variables) {
  13400. result.variables = {};
  13401. }
  13402. result.variables[key] = options[key];
  13403. return result;
  13404. }, {});
  13405. return request(requestOptions).then(response => {
  13406. if (response.data.errors) {
  13407. throw new GraphqlError(requestOptions, {
  13408. data: response.data
  13409. });
  13410. }
  13411. return response.data.data;
  13412. });
  13413. }
  13414. function withDefaults(request$1, newDefaults) {
  13415. const newRequest = request$1.defaults(newDefaults);
  13416. const newApi = (query, options) => {
  13417. return graphql(newRequest, query, options);
  13418. };
  13419. return Object.assign(newApi, {
  13420. defaults: withDefaults.bind(null, newRequest),
  13421. endpoint: request.request.endpoint
  13422. });
  13423. }
  13424. const graphql$1 = withDefaults(request.request, {
  13425. headers: {
  13426. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  13427. },
  13428. method: "POST",
  13429. url: "/graphql"
  13430. });
  13431. function withCustomRequest(customRequest) {
  13432. return withDefaults(customRequest, {
  13433. method: "POST",
  13434. url: "/graphql"
  13435. });
  13436. }
  13437. exports.graphql = graphql$1;
  13438. exports.withCustomRequest = withCustomRequest;
  13439. //# sourceMappingURL=index.js.map
  13440. /***/ }),
  13441. /***/ 899:
  13442. /***/ (function(module, __unusedexports, __webpack_require__) {
  13443. module.exports = registerEndpoints;
  13444. const { Deprecation } = __webpack_require__(692);
  13445. function registerEndpoints(octokit, routes) {
  13446. Object.keys(routes).forEach(namespaceName => {
  13447. if (!octokit[namespaceName]) {
  13448. octokit[namespaceName] = {};
  13449. }
  13450. Object.keys(routes[namespaceName]).forEach(apiName => {
  13451. const apiOptions = routes[namespaceName][apiName];
  13452. const endpointDefaults = ["method", "url", "headers"].reduce(
  13453. (map, key) => {
  13454. if (typeof apiOptions[key] !== "undefined") {
  13455. map[key] = apiOptions[key];
  13456. }
  13457. return map;
  13458. },
  13459. {}
  13460. );
  13461. endpointDefaults.request = {
  13462. validate: apiOptions.params
  13463. };
  13464. let request = octokit.request.defaults(endpointDefaults);
  13465. // patch request & endpoint methods to support deprecated parameters.
  13466. // Not the most elegant solution, but we don’t want to move deprecation
  13467. // logic into octokit/endpoint.js as it’s out of scope
  13468. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  13469. key => apiOptions.params[key].deprecated
  13470. );
  13471. if (hasDeprecatedParam) {
  13472. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  13473. request = patch(
  13474. octokit.request.defaults(endpointDefaults),
  13475. `.${namespaceName}.${apiName}()`
  13476. );
  13477. request.endpoint = patch(
  13478. request.endpoint,
  13479. `.${namespaceName}.${apiName}.endpoint()`
  13480. );
  13481. request.endpoint.merge = patch(
  13482. request.endpoint.merge,
  13483. `.${namespaceName}.${apiName}.endpoint.merge()`
  13484. );
  13485. }
  13486. if (apiOptions.deprecated) {
  13487. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  13488. octokit.log.warn(
  13489. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  13490. );
  13491. octokit[namespaceName][apiName] = request;
  13492. return request.apply(null, arguments);
  13493. };
  13494. return;
  13495. }
  13496. octokit[namespaceName][apiName] = request;
  13497. });
  13498. });
  13499. }
  13500. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  13501. const patchedMethod = options => {
  13502. options = Object.assign({}, options);
  13503. Object.keys(options).forEach(key => {
  13504. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  13505. const aliasKey = apiOptions.params[key].alias;
  13506. octokit.log.warn(
  13507. new Deprecation(
  13508. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  13509. )
  13510. );
  13511. if (!(aliasKey in options)) {
  13512. options[aliasKey] = options[key];
  13513. }
  13514. delete options[key];
  13515. }
  13516. });
  13517. return method(options);
  13518. };
  13519. Object.keys(method).forEach(key => {
  13520. patchedMethod[key] = method[key];
  13521. });
  13522. return patchedMethod;
  13523. }
  13524. /***/ }),
  13525. /***/ 929:
  13526. /***/ (function(module, __unusedexports, __webpack_require__) {
  13527. module.exports = hasNextPage
  13528. const deprecate = __webpack_require__(370)
  13529. const getPageLinks = __webpack_require__(577)
  13530. function hasNextPage (link) {
  13531. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  13532. return getPageLinks(link).next
  13533. }
  13534. /***/ }),
  13535. /***/ 948:
  13536. /***/ (function(module) {
  13537. "use strict";
  13538. /**
  13539. * Tries to execute a function and discards any error that occurs.
  13540. * @param {Function} fn - Function that might or might not throw an error.
  13541. * @returns {?*} Return-value of the function when no error occurred.
  13542. */
  13543. module.exports = function(fn) {
  13544. try { return fn() } catch (e) {}
  13545. }
  13546. /***/ }),
  13547. /***/ 954:
  13548. /***/ (function(module) {
  13549. module.exports = validateAuth;
  13550. function validateAuth(auth) {
  13551. if (typeof auth === "string") {
  13552. return;
  13553. }
  13554. if (typeof auth === "function") {
  13555. return;
  13556. }
  13557. if (auth.username && auth.password) {
  13558. return;
  13559. }
  13560. if (auth.clientId && auth.clientSecret) {
  13561. return;
  13562. }
  13563. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  13564. }
  13565. /***/ }),
  13566. /***/ 955:
  13567. /***/ (function(module, __unusedexports, __webpack_require__) {
  13568. "use strict";
  13569. const path = __webpack_require__(622);
  13570. const childProcess = __webpack_require__(129);
  13571. const crossSpawn = __webpack_require__(20);
  13572. const stripEof = __webpack_require__(768);
  13573. const npmRunPath = __webpack_require__(621);
  13574. const isStream = __webpack_require__(323);
  13575. const _getStream = __webpack_require__(145);
  13576. const pFinally = __webpack_require__(697);
  13577. const onExit = __webpack_require__(260);
  13578. const errname = __webpack_require__(427);
  13579. const stdio = __webpack_require__(168);
  13580. const TEN_MEGABYTES = 1000 * 1000 * 10;
  13581. function handleArgs(cmd, args, opts) {
  13582. let parsed;
  13583. opts = Object.assign({
  13584. extendEnv: true,
  13585. env: {}
  13586. }, opts);
  13587. if (opts.extendEnv) {
  13588. opts.env = Object.assign({}, process.env, opts.env);
  13589. }
  13590. if (opts.__winShell === true) {
  13591. delete opts.__winShell;
  13592. parsed = {
  13593. command: cmd,
  13594. args,
  13595. options: opts,
  13596. file: cmd,
  13597. original: {
  13598. cmd,
  13599. args
  13600. }
  13601. };
  13602. } else {
  13603. parsed = crossSpawn._parse(cmd, args, opts);
  13604. }
  13605. opts = Object.assign({
  13606. maxBuffer: TEN_MEGABYTES,
  13607. buffer: true,
  13608. stripEof: true,
  13609. preferLocal: true,
  13610. localDir: parsed.options.cwd || process.cwd(),
  13611. encoding: 'utf8',
  13612. reject: true,
  13613. cleanup: true
  13614. }, parsed.options);
  13615. opts.stdio = stdio(opts);
  13616. if (opts.preferLocal) {
  13617. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  13618. }
  13619. if (opts.detached) {
  13620. // #115
  13621. opts.cleanup = false;
  13622. }
  13623. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  13624. // #116
  13625. parsed.args.unshift('/q');
  13626. }
  13627. return {
  13628. cmd: parsed.command,
  13629. args: parsed.args,
  13630. opts,
  13631. parsed
  13632. };
  13633. }
  13634. function handleInput(spawned, input) {
  13635. if (input === null || input === undefined) {
  13636. return;
  13637. }
  13638. if (isStream(input)) {
  13639. input.pipe(spawned.stdin);
  13640. } else {
  13641. spawned.stdin.end(input);
  13642. }
  13643. }
  13644. function handleOutput(opts, val) {
  13645. if (val && opts.stripEof) {
  13646. val = stripEof(val);
  13647. }
  13648. return val;
  13649. }
  13650. function handleShell(fn, cmd, opts) {
  13651. let file = '/bin/sh';
  13652. let args = ['-c', cmd];
  13653. opts = Object.assign({}, opts);
  13654. if (process.platform === 'win32') {
  13655. opts.__winShell = true;
  13656. file = process.env.comspec || 'cmd.exe';
  13657. args = ['/s', '/c', `"${cmd}"`];
  13658. opts.windowsVerbatimArguments = true;
  13659. }
  13660. if (opts.shell) {
  13661. file = opts.shell;
  13662. delete opts.shell;
  13663. }
  13664. return fn(file, args, opts);
  13665. }
  13666. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  13667. if (!process[stream]) {
  13668. return null;
  13669. }
  13670. let ret;
  13671. if (!buffer) {
  13672. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  13673. ret = new Promise((resolve, reject) => {
  13674. process[stream]
  13675. .once('end', resolve)
  13676. .once('error', reject);
  13677. });
  13678. } else if (encoding) {
  13679. ret = _getStream(process[stream], {
  13680. encoding,
  13681. maxBuffer
  13682. });
  13683. } else {
  13684. ret = _getStream.buffer(process[stream], {maxBuffer});
  13685. }
  13686. return ret.catch(err => {
  13687. err.stream = stream;
  13688. err.message = `${stream} ${err.message}`;
  13689. throw err;
  13690. });
  13691. }
  13692. function makeError(result, options) {
  13693. const {stdout, stderr} = result;
  13694. let err = result.error;
  13695. const {code, signal} = result;
  13696. const {parsed, joinedCmd} = options;
  13697. const timedOut = options.timedOut || false;
  13698. if (!err) {
  13699. let output = '';
  13700. if (Array.isArray(parsed.opts.stdio)) {
  13701. if (parsed.opts.stdio[2] !== 'inherit') {
  13702. output += output.length > 0 ? stderr : `\n${stderr}`;
  13703. }
  13704. if (parsed.opts.stdio[1] !== 'inherit') {
  13705. output += `\n${stdout}`;
  13706. }
  13707. } else if (parsed.opts.stdio !== 'inherit') {
  13708. output = `\n${stderr}${stdout}`;
  13709. }
  13710. err = new Error(`Command failed: ${joinedCmd}${output}`);
  13711. err.code = code < 0 ? errname(code) : code;
  13712. }
  13713. err.stdout = stdout;
  13714. err.stderr = stderr;
  13715. err.failed = true;
  13716. err.signal = signal || null;
  13717. err.cmd = joinedCmd;
  13718. err.timedOut = timedOut;
  13719. return err;
  13720. }
  13721. function joinCmd(cmd, args) {
  13722. let joinedCmd = cmd;
  13723. if (Array.isArray(args) && args.length > 0) {
  13724. joinedCmd += ' ' + args.join(' ');
  13725. }
  13726. return joinedCmd;
  13727. }
  13728. module.exports = (cmd, args, opts) => {
  13729. const parsed = handleArgs(cmd, args, opts);
  13730. const {encoding, buffer, maxBuffer} = parsed.opts;
  13731. const joinedCmd = joinCmd(cmd, args);
  13732. let spawned;
  13733. try {
  13734. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  13735. } catch (err) {
  13736. return Promise.reject(err);
  13737. }
  13738. let removeExitHandler;
  13739. if (parsed.opts.cleanup) {
  13740. removeExitHandler = onExit(() => {
  13741. spawned.kill();
  13742. });
  13743. }
  13744. let timeoutId = null;
  13745. let timedOut = false;
  13746. const cleanup = () => {
  13747. if (timeoutId) {
  13748. clearTimeout(timeoutId);
  13749. timeoutId = null;
  13750. }
  13751. if (removeExitHandler) {
  13752. removeExitHandler();
  13753. }
  13754. };
  13755. if (parsed.opts.timeout > 0) {
  13756. timeoutId = setTimeout(() => {
  13757. timeoutId = null;
  13758. timedOut = true;
  13759. spawned.kill(parsed.opts.killSignal);
  13760. }, parsed.opts.timeout);
  13761. }
  13762. const processDone = new Promise(resolve => {
  13763. spawned.on('exit', (code, signal) => {
  13764. cleanup();
  13765. resolve({code, signal});
  13766. });
  13767. spawned.on('error', err => {
  13768. cleanup();
  13769. resolve({error: err});
  13770. });
  13771. if (spawned.stdin) {
  13772. spawned.stdin.on('error', err => {
  13773. cleanup();
  13774. resolve({error: err});
  13775. });
  13776. }
  13777. });
  13778. function destroy() {
  13779. if (spawned.stdout) {
  13780. spawned.stdout.destroy();
  13781. }
  13782. if (spawned.stderr) {
  13783. spawned.stderr.destroy();
  13784. }
  13785. }
  13786. const handlePromise = () => pFinally(Promise.all([
  13787. processDone,
  13788. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  13789. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  13790. ]).then(arr => {
  13791. const result = arr[0];
  13792. result.stdout = arr[1];
  13793. result.stderr = arr[2];
  13794. if (result.error || result.code !== 0 || result.signal !== null) {
  13795. const err = makeError(result, {
  13796. joinedCmd,
  13797. parsed,
  13798. timedOut
  13799. });
  13800. // TODO: missing some timeout logic for killed
  13801. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  13802. // err.killed = spawned.killed || killed;
  13803. err.killed = err.killed || spawned.killed;
  13804. if (!parsed.opts.reject) {
  13805. return err;
  13806. }
  13807. throw err;
  13808. }
  13809. return {
  13810. stdout: handleOutput(parsed.opts, result.stdout),
  13811. stderr: handleOutput(parsed.opts, result.stderr),
  13812. code: 0,
  13813. failed: false,
  13814. killed: false,
  13815. signal: null,
  13816. cmd: joinedCmd,
  13817. timedOut: false
  13818. };
  13819. }), destroy);
  13820. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  13821. handleInput(spawned, parsed.opts.input);
  13822. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  13823. spawned.catch = onrejected => handlePromise().catch(onrejected);
  13824. return spawned;
  13825. };
  13826. // TODO: set `stderr: 'ignore'` when that option is implemented
  13827. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  13828. // TODO: set `stdout: 'ignore'` when that option is implemented
  13829. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  13830. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  13831. module.exports.sync = (cmd, args, opts) => {
  13832. const parsed = handleArgs(cmd, args, opts);
  13833. const joinedCmd = joinCmd(cmd, args);
  13834. if (isStream(parsed.opts.input)) {
  13835. throw new TypeError('The `input` option cannot be a stream in sync mode');
  13836. }
  13837. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  13838. result.code = result.status;
  13839. if (result.error || result.status !== 0 || result.signal !== null) {
  13840. const err = makeError(result, {
  13841. joinedCmd,
  13842. parsed
  13843. });
  13844. if (!parsed.opts.reject) {
  13845. return err;
  13846. }
  13847. throw err;
  13848. }
  13849. return {
  13850. stdout: handleOutput(parsed.opts, result.stdout),
  13851. stderr: handleOutput(parsed.opts, result.stderr),
  13852. code: 0,
  13853. failed: false,
  13854. signal: null,
  13855. cmd: joinedCmd,
  13856. timedOut: false
  13857. };
  13858. };
  13859. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  13860. /***/ }),
  13861. /***/ 966:
  13862. /***/ (function(module, __unusedexports, __webpack_require__) {
  13863. "use strict";
  13864. const {PassThrough} = __webpack_require__(413);
  13865. module.exports = options => {
  13866. options = Object.assign({}, options);
  13867. const {array} = options;
  13868. let {encoding} = options;
  13869. const buffer = encoding === 'buffer';
  13870. let objectMode = false;
  13871. if (array) {
  13872. objectMode = !(encoding || buffer);
  13873. } else {
  13874. encoding = encoding || 'utf8';
  13875. }
  13876. if (buffer) {
  13877. encoding = null;
  13878. }
  13879. let len = 0;
  13880. const ret = [];
  13881. const stream = new PassThrough({objectMode});
  13882. if (encoding) {
  13883. stream.setEncoding(encoding);
  13884. }
  13885. stream.on('data', chunk => {
  13886. ret.push(chunk);
  13887. if (objectMode) {
  13888. len = ret.length;
  13889. } else {
  13890. len += chunk.length;
  13891. }
  13892. });
  13893. stream.getBufferedValue = () => {
  13894. if (array) {
  13895. return ret;
  13896. }
  13897. return buffer ? Buffer.concat(ret, len) : ret.join('');
  13898. };
  13899. stream.getBufferedLength = () => len;
  13900. return stream;
  13901. };
  13902. /***/ }),
  13903. /***/ 969:
  13904. /***/ (function(module, __unusedexports, __webpack_require__) {
  13905. var wrappy = __webpack_require__(11)
  13906. module.exports = wrappy(once)
  13907. module.exports.strict = wrappy(onceStrict)
  13908. once.proto = once(function () {
  13909. Object.defineProperty(Function.prototype, 'once', {
  13910. value: function () {
  13911. return once(this)
  13912. },
  13913. configurable: true
  13914. })
  13915. Object.defineProperty(Function.prototype, 'onceStrict', {
  13916. value: function () {
  13917. return onceStrict(this)
  13918. },
  13919. configurable: true
  13920. })
  13921. })
  13922. function once (fn) {
  13923. var f = function () {
  13924. if (f.called) return f.value
  13925. f.called = true
  13926. return f.value = fn.apply(this, arguments)
  13927. }
  13928. f.called = false
  13929. return f
  13930. }
  13931. function onceStrict (fn) {
  13932. var f = function () {
  13933. if (f.called)
  13934. throw new Error(f.onceError)
  13935. f.called = true
  13936. return f.value = fn.apply(this, arguments)
  13937. }
  13938. var name = fn.name || 'Function wrapped with `once`'
  13939. f.onceError = name + " shouldn't be called more than once"
  13940. f.called = false
  13941. return f
  13942. }
  13943. /***/ }),
  13944. /***/ 986:
  13945. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13946. "use strict";
  13947. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13948. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  13949. return new (P || (P = Promise))(function (resolve, reject) {
  13950. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13951. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13952. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  13953. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13954. });
  13955. };
  13956. Object.defineProperty(exports, "__esModule", { value: true });
  13957. const tr = __webpack_require__(9);
  13958. /**
  13959. * Exec a command.
  13960. * Output will be streamed to the live console.
  13961. * Returns promise with return code
  13962. *
  13963. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  13964. * @param args optional arguments for tool. Escaping is handled by the lib.
  13965. * @param options optional exec options. See ExecOptions
  13966. * @returns Promise<number> exit code
  13967. */
  13968. function exec(commandLine, args, options) {
  13969. return __awaiter(this, void 0, void 0, function* () {
  13970. const commandArgs = tr.argStringToArray(commandLine);
  13971. if (commandArgs.length === 0) {
  13972. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  13973. }
  13974. // Path to tool to execute should be first arg
  13975. const toolPath = commandArgs[0];
  13976. args = commandArgs.slice(1).concat(args || []);
  13977. const runner = new tr.ToolRunner(toolPath, args, options);
  13978. return runner.exec();
  13979. });
  13980. }
  13981. exports.exec = exec;
  13982. //# sourceMappingURL=exec.js.map
  13983. /***/ }),
  13984. /***/ 991:
  13985. /***/ (function(module, __unusedexports, __webpack_require__) {
  13986. module.exports = authenticationRequestError;
  13987. const { RequestError } = __webpack_require__(463);
  13988. function authenticationRequestError(state, error, options) {
  13989. if (!error.headers) throw error;
  13990. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  13991. // handle "2FA required" error only
  13992. if (error.status !== 401 || !otpRequired) {
  13993. throw error;
  13994. }
  13995. if (
  13996. error.status === 401 &&
  13997. otpRequired &&
  13998. error.request &&
  13999. error.request.headers["x-github-otp"]
  14000. ) {
  14001. if (state.otp) {
  14002. delete state.otp; // no longer valid, request again
  14003. } else {
  14004. throw new RequestError(
  14005. "Invalid one-time password for two-factor authentication",
  14006. 401,
  14007. {
  14008. headers: error.headers,
  14009. request: options
  14010. }
  14011. );
  14012. }
  14013. }
  14014. if (typeof state.auth.on2fa !== "function") {
  14015. throw new RequestError(
  14016. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  14017. 401,
  14018. {
  14019. headers: error.headers,
  14020. request: options
  14021. }
  14022. );
  14023. }
  14024. return Promise.resolve()
  14025. .then(() => {
  14026. return state.auth.on2fa();
  14027. })
  14028. .then(oneTimePassword => {
  14029. const newOptions = Object.assign(options, {
  14030. headers: Object.assign(options.headers, {
  14031. "x-github-otp": oneTimePassword
  14032. })
  14033. });
  14034. return state.octokit.request(newOptions).then(response => {
  14035. // If OTP still valid, then persist it for following requests
  14036. state.otp = oneTimePassword;
  14037. return response;
  14038. });
  14039. });
  14040. }
  14041. /***/ })
  14042. /******/ });