index.js 667 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312173131731417315173161731717318173191732017321173221732317324173251732617327173281732917330173311733217333173341733517336173371733817339173401734117342173431734417345173461734717348173491735017351173521735317354173551735617357173581735917360173611736217363173641736517366173671736817369173701737117372173731737417375173761737717378173791738017381173821738317384173851738617387173881738917390173911739217393173941739517396173971739817399174001740117402174031740417405174061740717408174091741017411174121741317414174151741617417174181741917420174211742217423174241742517426174271742817429174301743117432174331743417435174361743717438174391744017441174421744317444174451744617447174481744917450174511745217453174541745517456174571745817459174601746117462174631746417465174661746717468174691747017471174721747317474174751747617477174781747917480174811748217483174841748517486174871748817489174901749117492174931749417495
  1. module.exports =
  2. /******/ (function(modules, runtime) { // webpackBootstrap
  3. /******/ "use strict";
  4. /******/ // The module cache
  5. /******/ var installedModules = {};
  6. /******/
  7. /******/ // The require function
  8. /******/ function __webpack_require__(moduleId) {
  9. /******/
  10. /******/ // Check if module is in cache
  11. /******/ if(installedModules[moduleId]) {
  12. /******/ return installedModules[moduleId].exports;
  13. /******/ }
  14. /******/ // Create a new module (and put it into the cache)
  15. /******/ var module = installedModules[moduleId] = {
  16. /******/ i: moduleId,
  17. /******/ l: false,
  18. /******/ exports: {}
  19. /******/ };
  20. /******/
  21. /******/ // Execute the module function
  22. /******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
  23. /******/
  24. /******/ // Flag the module as loaded
  25. /******/ module.l = true;
  26. /******/
  27. /******/ // Return the exports of the module
  28. /******/ return module.exports;
  29. /******/ }
  30. /******/
  31. /******/
  32. /******/ __webpack_require__.ab = __dirname + "/";
  33. /******/
  34. /******/ // the startup function
  35. /******/ function startup() {
  36. /******/ // Load entry module and return exports
  37. /******/ return __webpack_require__(198);
  38. /******/ };
  39. /******/
  40. /******/ // run startup
  41. /******/ return startup();
  42. /******/ })
  43. /************************************************************************/
  44. /******/ ({
  45. /***/ 0:
  46. /***/ (function(module, __unusedexports, __webpack_require__) {
  47. const Octokit = __webpack_require__(529);
  48. const CORE_PLUGINS = [
  49. __webpack_require__(190),
  50. __webpack_require__(19), // deprecated: remove in v17
  51. __webpack_require__(372),
  52. __webpack_require__(148),
  53. __webpack_require__(248),
  54. __webpack_require__(586),
  55. __webpack_require__(430),
  56. __webpack_require__(850) // deprecated: remove in v17
  57. ];
  58. module.exports = Octokit.plugin(CORE_PLUGINS);
  59. /***/ }),
  60. /***/ 1:
  61. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  62. "use strict";
  63. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  64. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  65. return new (P || (P = Promise))(function (resolve, reject) {
  66. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  67. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  68. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  69. step((generator = generator.apply(thisArg, _arguments || [])).next());
  70. });
  71. };
  72. Object.defineProperty(exports, "__esModule", { value: true });
  73. const childProcess = __webpack_require__(129);
  74. const path = __webpack_require__(622);
  75. const util_1 = __webpack_require__(669);
  76. const ioUtil = __webpack_require__(672);
  77. const exec = util_1.promisify(childProcess.exec);
  78. /**
  79. * Copies a file or folder.
  80. * Based off of shelljs - https://github.com/shelljs/shelljs/blob/9237f66c52e5daa40458f94f9565e18e8132f5a6/src/cp.js
  81. *
  82. * @param source source path
  83. * @param dest destination path
  84. * @param options optional. See CopyOptions.
  85. */
  86. function cp(source, dest, options = {}) {
  87. return __awaiter(this, void 0, void 0, function* () {
  88. const { force, recursive } = readCopyOptions(options);
  89. const destStat = (yield ioUtil.exists(dest)) ? yield ioUtil.stat(dest) : null;
  90. // Dest is an existing file, but not forcing
  91. if (destStat && destStat.isFile() && !force) {
  92. return;
  93. }
  94. // If dest is an existing directory, should copy inside.
  95. const newDest = destStat && destStat.isDirectory()
  96. ? path.join(dest, path.basename(source))
  97. : dest;
  98. if (!(yield ioUtil.exists(source))) {
  99. throw new Error(`no such file or directory: ${source}`);
  100. }
  101. const sourceStat = yield ioUtil.stat(source);
  102. if (sourceStat.isDirectory()) {
  103. if (!recursive) {
  104. throw new Error(`Failed to copy. ${source} is a directory, but tried to copy without recursive flag.`);
  105. }
  106. else {
  107. yield cpDirRecursive(source, newDest, 0, force);
  108. }
  109. }
  110. else {
  111. if (path.relative(source, newDest) === '') {
  112. // a file cannot be copied to itself
  113. throw new Error(`'${newDest}' and '${source}' are the same file`);
  114. }
  115. yield copyFile(source, newDest, force);
  116. }
  117. });
  118. }
  119. exports.cp = cp;
  120. /**
  121. * Moves a path.
  122. *
  123. * @param source source path
  124. * @param dest destination path
  125. * @param options optional. See MoveOptions.
  126. */
  127. function mv(source, dest, options = {}) {
  128. return __awaiter(this, void 0, void 0, function* () {
  129. if (yield ioUtil.exists(dest)) {
  130. let destExists = true;
  131. if (yield ioUtil.isDirectory(dest)) {
  132. // If dest is directory copy src into dest
  133. dest = path.join(dest, path.basename(source));
  134. destExists = yield ioUtil.exists(dest);
  135. }
  136. if (destExists) {
  137. if (options.force == null || options.force) {
  138. yield rmRF(dest);
  139. }
  140. else {
  141. throw new Error('Destination already exists');
  142. }
  143. }
  144. }
  145. yield mkdirP(path.dirname(dest));
  146. yield ioUtil.rename(source, dest);
  147. });
  148. }
  149. exports.mv = mv;
  150. /**
  151. * Remove a path recursively with force
  152. *
  153. * @param inputPath path to remove
  154. */
  155. function rmRF(inputPath) {
  156. return __awaiter(this, void 0, void 0, function* () {
  157. if (ioUtil.IS_WINDOWS) {
  158. // Node doesn't provide a delete operation, only an unlink function. This means that if the file is being used by another
  159. // program (e.g. antivirus), it won't be deleted. To address this, we shell out the work to rd/del.
  160. try {
  161. if (yield ioUtil.isDirectory(inputPath, true)) {
  162. yield exec(`rd /s /q "${inputPath}"`);
  163. }
  164. else {
  165. yield exec(`del /f /a "${inputPath}"`);
  166. }
  167. }
  168. catch (err) {
  169. // if you try to delete a file that doesn't exist, desired result is achieved
  170. // other errors are valid
  171. if (err.code !== 'ENOENT')
  172. throw err;
  173. }
  174. // Shelling out fails to remove a symlink folder with missing source, this unlink catches that
  175. try {
  176. yield ioUtil.unlink(inputPath);
  177. }
  178. catch (err) {
  179. // if you try to delete a file that doesn't exist, desired result is achieved
  180. // other errors are valid
  181. if (err.code !== 'ENOENT')
  182. throw err;
  183. }
  184. }
  185. else {
  186. let isDir = false;
  187. try {
  188. isDir = yield ioUtil.isDirectory(inputPath);
  189. }
  190. catch (err) {
  191. // if you try to delete a file that doesn't exist, desired result is achieved
  192. // other errors are valid
  193. if (err.code !== 'ENOENT')
  194. throw err;
  195. return;
  196. }
  197. if (isDir) {
  198. yield exec(`rm -rf "${inputPath}"`);
  199. }
  200. else {
  201. yield ioUtil.unlink(inputPath);
  202. }
  203. }
  204. });
  205. }
  206. exports.rmRF = rmRF;
  207. /**
  208. * Make a directory. Creates the full path with folders in between
  209. * Will throw if it fails
  210. *
  211. * @param fsPath path to create
  212. * @returns Promise<void>
  213. */
  214. function mkdirP(fsPath) {
  215. return __awaiter(this, void 0, void 0, function* () {
  216. yield ioUtil.mkdirP(fsPath);
  217. });
  218. }
  219. exports.mkdirP = mkdirP;
  220. /**
  221. * Returns path of a tool had the tool actually been invoked. Resolves via paths.
  222. * If you check and the tool does not exist, it will throw.
  223. *
  224. * @param tool name of the tool
  225. * @param check whether to check if tool exists
  226. * @returns Promise<string> path to tool
  227. */
  228. function which(tool, check) {
  229. return __awaiter(this, void 0, void 0, function* () {
  230. if (!tool) {
  231. throw new Error("parameter 'tool' is required");
  232. }
  233. // recursive when check=true
  234. if (check) {
  235. const result = yield which(tool, false);
  236. if (!result) {
  237. if (ioUtil.IS_WINDOWS) {
  238. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.`);
  239. }
  240. else {
  241. throw new Error(`Unable to locate executable file: ${tool}. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also check the file mode to verify the file is executable.`);
  242. }
  243. }
  244. }
  245. try {
  246. // build the list of extensions to try
  247. const extensions = [];
  248. if (ioUtil.IS_WINDOWS && process.env.PATHEXT) {
  249. for (const extension of process.env.PATHEXT.split(path.delimiter)) {
  250. if (extension) {
  251. extensions.push(extension);
  252. }
  253. }
  254. }
  255. // if it's rooted, return it if exists. otherwise return empty.
  256. if (ioUtil.isRooted(tool)) {
  257. const filePath = yield ioUtil.tryGetExecutablePath(tool, extensions);
  258. if (filePath) {
  259. return filePath;
  260. }
  261. return '';
  262. }
  263. // if any path separators, return empty
  264. if (tool.includes('/') || (ioUtil.IS_WINDOWS && tool.includes('\\'))) {
  265. return '';
  266. }
  267. // build the list of directories
  268. //
  269. // Note, technically "where" checks the current directory on Windows. From a toolkit perspective,
  270. // it feels like we should not do this. Checking the current directory seems like more of a use
  271. // case of a shell, and the which() function exposed by the toolkit should strive for consistency
  272. // across platforms.
  273. const directories = [];
  274. if (process.env.PATH) {
  275. for (const p of process.env.PATH.split(path.delimiter)) {
  276. if (p) {
  277. directories.push(p);
  278. }
  279. }
  280. }
  281. // return the first match
  282. for (const directory of directories) {
  283. const filePath = yield ioUtil.tryGetExecutablePath(directory + path.sep + tool, extensions);
  284. if (filePath) {
  285. return filePath;
  286. }
  287. }
  288. return '';
  289. }
  290. catch (err) {
  291. throw new Error(`which failed with message ${err.message}`);
  292. }
  293. });
  294. }
  295. exports.which = which;
  296. function readCopyOptions(options) {
  297. const force = options.force == null ? true : options.force;
  298. const recursive = Boolean(options.recursive);
  299. return { force, recursive };
  300. }
  301. function cpDirRecursive(sourceDir, destDir, currentDepth, force) {
  302. return __awaiter(this, void 0, void 0, function* () {
  303. // Ensure there is not a run away recursive copy
  304. if (currentDepth >= 255)
  305. return;
  306. currentDepth++;
  307. yield mkdirP(destDir);
  308. const files = yield ioUtil.readdir(sourceDir);
  309. for (const fileName of files) {
  310. const srcFile = `${sourceDir}/${fileName}`;
  311. const destFile = `${destDir}/${fileName}`;
  312. const srcFileStat = yield ioUtil.lstat(srcFile);
  313. if (srcFileStat.isDirectory()) {
  314. // Recurse
  315. yield cpDirRecursive(srcFile, destFile, currentDepth, force);
  316. }
  317. else {
  318. yield copyFile(srcFile, destFile, force);
  319. }
  320. }
  321. // Change the mode for the newly created directory
  322. yield ioUtil.chmod(destDir, (yield ioUtil.stat(sourceDir)).mode);
  323. });
  324. }
  325. // Buffered file copy
  326. function copyFile(srcFile, destFile, force) {
  327. return __awaiter(this, void 0, void 0, function* () {
  328. if ((yield ioUtil.lstat(srcFile)).isSymbolicLink()) {
  329. // unlink/re-link it
  330. try {
  331. yield ioUtil.lstat(destFile);
  332. yield ioUtil.unlink(destFile);
  333. }
  334. catch (e) {
  335. // Try to override file permission
  336. if (e.code === 'EPERM') {
  337. yield ioUtil.chmod(destFile, '0666');
  338. yield ioUtil.unlink(destFile);
  339. }
  340. // other errors = it doesn't exist, no work to do
  341. }
  342. // Copy over symlink
  343. const symlinkFull = yield ioUtil.readlink(srcFile);
  344. yield ioUtil.symlink(symlinkFull, destFile, ioUtil.IS_WINDOWS ? 'junction' : null);
  345. }
  346. else if (!(yield ioUtil.exists(destFile)) || force) {
  347. yield ioUtil.copyFile(srcFile, destFile);
  348. }
  349. });
  350. }
  351. //# sourceMappingURL=io.js.map
  352. /***/ }),
  353. /***/ 2:
  354. /***/ (function(module, __unusedexports, __webpack_require__) {
  355. "use strict";
  356. const os = __webpack_require__(87);
  357. const macosRelease = __webpack_require__(118);
  358. const winRelease = __webpack_require__(49);
  359. const osName = (platform, release) => {
  360. if (!platform && release) {
  361. throw new Error('You can\'t specify a `release` without specifying `platform`');
  362. }
  363. platform = platform || os.platform();
  364. let id;
  365. if (platform === 'darwin') {
  366. if (!release && os.platform() === 'darwin') {
  367. release = os.release();
  368. }
  369. const prefix = release ? (Number(release.split('.')[0]) > 15 ? 'macOS' : 'OS X') : 'macOS';
  370. id = release ? macosRelease(release).name : '';
  371. return prefix + (id ? ' ' + id : '');
  372. }
  373. if (platform === 'linux') {
  374. if (!release && os.platform() === 'linux') {
  375. release = os.release();
  376. }
  377. id = release ? release.replace(/^(\d+\.\d+).*/, '$1') : '';
  378. return 'Linux' + (id ? ' ' + id : '');
  379. }
  380. if (platform === 'win32') {
  381. if (!release && os.platform() === 'win32') {
  382. release = os.release();
  383. }
  384. id = release ? winRelease(release) : '';
  385. return 'Windows' + (id ? ' ' + id : '');
  386. }
  387. return platform;
  388. };
  389. module.exports = osName;
  390. /***/ }),
  391. /***/ 8:
  392. /***/ (function(module, __unusedexports, __webpack_require__) {
  393. module.exports = iterator;
  394. const normalizePaginatedListResponse = __webpack_require__(301);
  395. function iterator(octokit, options) {
  396. const headers = options.headers;
  397. let url = octokit.request.endpoint(options).url;
  398. return {
  399. [Symbol.asyncIterator]: () => ({
  400. next() {
  401. if (!url) {
  402. return Promise.resolve({ done: true });
  403. }
  404. return octokit
  405. .request({ url, headers })
  406. .then(response => {
  407. normalizePaginatedListResponse(octokit, url, response);
  408. // `response.headers.link` format:
  409. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  410. // sets `url` to undefined if "next" URL is not present or `link` header is not set
  411. url = ((response.headers.link || "").match(
  412. /<([^>]+)>;\s*rel="next"/
  413. ) || [])[1];
  414. return { value: response };
  415. });
  416. }
  417. })
  418. };
  419. }
  420. /***/ }),
  421. /***/ 9:
  422. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  423. "use strict";
  424. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  425. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  426. return new (P || (P = Promise))(function (resolve, reject) {
  427. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  428. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  429. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  430. step((generator = generator.apply(thisArg, _arguments || [])).next());
  431. });
  432. };
  433. Object.defineProperty(exports, "__esModule", { value: true });
  434. const os = __webpack_require__(87);
  435. const events = __webpack_require__(614);
  436. const child = __webpack_require__(129);
  437. /* eslint-disable @typescript-eslint/unbound-method */
  438. const IS_WINDOWS = process.platform === 'win32';
  439. /*
  440. * Class for running command line tools. Handles quoting and arg parsing in a platform agnostic way.
  441. */
  442. class ToolRunner extends events.EventEmitter {
  443. constructor(toolPath, args, options) {
  444. super();
  445. if (!toolPath) {
  446. throw new Error("Parameter 'toolPath' cannot be null or empty.");
  447. }
  448. this.toolPath = toolPath;
  449. this.args = args || [];
  450. this.options = options || {};
  451. }
  452. _debug(message) {
  453. if (this.options.listeners && this.options.listeners.debug) {
  454. this.options.listeners.debug(message);
  455. }
  456. }
  457. _getCommandString(options, noPrefix) {
  458. const toolPath = this._getSpawnFileName();
  459. const args = this._getSpawnArgs(options);
  460. let cmd = noPrefix ? '' : '[command]'; // omit prefix when piped to a second tool
  461. if (IS_WINDOWS) {
  462. // Windows + cmd file
  463. if (this._isCmdFile()) {
  464. cmd += toolPath;
  465. for (const a of args) {
  466. cmd += ` ${a}`;
  467. }
  468. }
  469. // Windows + verbatim
  470. else if (options.windowsVerbatimArguments) {
  471. cmd += `"${toolPath}"`;
  472. for (const a of args) {
  473. cmd += ` ${a}`;
  474. }
  475. }
  476. // Windows (regular)
  477. else {
  478. cmd += this._windowsQuoteCmdArg(toolPath);
  479. for (const a of args) {
  480. cmd += ` ${this._windowsQuoteCmdArg(a)}`;
  481. }
  482. }
  483. }
  484. else {
  485. // OSX/Linux - this can likely be improved with some form of quoting.
  486. // creating processes on Unix is fundamentally different than Windows.
  487. // on Unix, execvp() takes an arg array.
  488. cmd += toolPath;
  489. for (const a of args) {
  490. cmd += ` ${a}`;
  491. }
  492. }
  493. return cmd;
  494. }
  495. _processLineBuffer(data, strBuffer, onLine) {
  496. try {
  497. let s = strBuffer + data.toString();
  498. let n = s.indexOf(os.EOL);
  499. while (n > -1) {
  500. const line = s.substring(0, n);
  501. onLine(line);
  502. // the rest of the string ...
  503. s = s.substring(n + os.EOL.length);
  504. n = s.indexOf(os.EOL);
  505. }
  506. strBuffer = s;
  507. }
  508. catch (err) {
  509. // streaming lines to console is best effort. Don't fail a build.
  510. this._debug(`error processing line. Failed with error ${err}`);
  511. }
  512. }
  513. _getSpawnFileName() {
  514. if (IS_WINDOWS) {
  515. if (this._isCmdFile()) {
  516. return process.env['COMSPEC'] || 'cmd.exe';
  517. }
  518. }
  519. return this.toolPath;
  520. }
  521. _getSpawnArgs(options) {
  522. if (IS_WINDOWS) {
  523. if (this._isCmdFile()) {
  524. let argline = `/D /S /C "${this._windowsQuoteCmdArg(this.toolPath)}`;
  525. for (const a of this.args) {
  526. argline += ' ';
  527. argline += options.windowsVerbatimArguments
  528. ? a
  529. : this._windowsQuoteCmdArg(a);
  530. }
  531. argline += '"';
  532. return [argline];
  533. }
  534. }
  535. return this.args;
  536. }
  537. _endsWith(str, end) {
  538. return str.endsWith(end);
  539. }
  540. _isCmdFile() {
  541. const upperToolPath = this.toolPath.toUpperCase();
  542. return (this._endsWith(upperToolPath, '.CMD') ||
  543. this._endsWith(upperToolPath, '.BAT'));
  544. }
  545. _windowsQuoteCmdArg(arg) {
  546. // for .exe, apply the normal quoting rules that libuv applies
  547. if (!this._isCmdFile()) {
  548. return this._uvQuoteCmdArg(arg);
  549. }
  550. // otherwise apply quoting rules specific to the cmd.exe command line parser.
  551. // the libuv rules are generic and are not designed specifically for cmd.exe
  552. // command line parser.
  553. //
  554. // for a detailed description of the cmd.exe command line parser, refer to
  555. // http://stackoverflow.com/questions/4094699/how-does-the-windows-command-interpreter-cmd-exe-parse-scripts/7970912#7970912
  556. // need quotes for empty arg
  557. if (!arg) {
  558. return '""';
  559. }
  560. // determine whether the arg needs to be quoted
  561. const cmdSpecialChars = [
  562. ' ',
  563. '\t',
  564. '&',
  565. '(',
  566. ')',
  567. '[',
  568. ']',
  569. '{',
  570. '}',
  571. '^',
  572. '=',
  573. ';',
  574. '!',
  575. "'",
  576. '+',
  577. ',',
  578. '`',
  579. '~',
  580. '|',
  581. '<',
  582. '>',
  583. '"'
  584. ];
  585. let needsQuotes = false;
  586. for (const char of arg) {
  587. if (cmdSpecialChars.some(x => x === char)) {
  588. needsQuotes = true;
  589. break;
  590. }
  591. }
  592. // short-circuit if quotes not needed
  593. if (!needsQuotes) {
  594. return arg;
  595. }
  596. // the following quoting rules are very similar to the rules that by libuv applies.
  597. //
  598. // 1) wrap the string in quotes
  599. //
  600. // 2) double-up quotes - i.e. " => ""
  601. //
  602. // this is different from the libuv quoting rules. libuv replaces " with \", which unfortunately
  603. // doesn't work well with a cmd.exe command line.
  604. //
  605. // note, replacing " with "" also works well if the arg is passed to a downstream .NET console app.
  606. // for example, the command line:
  607. // foo.exe "myarg:""my val"""
  608. // is parsed by a .NET console app into an arg array:
  609. // [ "myarg:\"my val\"" ]
  610. // which is the same end result when applying libuv quoting rules. although the actual
  611. // command line from libuv quoting rules would look like:
  612. // foo.exe "myarg:\"my val\""
  613. //
  614. // 3) double-up slashes that precede a quote,
  615. // e.g. hello \world => "hello \world"
  616. // hello\"world => "hello\\""world"
  617. // hello\\"world => "hello\\\\""world"
  618. // hello world\ => "hello world\\"
  619. //
  620. // technically this is not required for a cmd.exe command line, or the batch argument parser.
  621. // the reasons for including this as a .cmd quoting rule are:
  622. //
  623. // a) this is optimized for the scenario where the argument is passed from the .cmd file to an
  624. // external program. many programs (e.g. .NET console apps) rely on the slash-doubling rule.
  625. //
  626. // b) it's what we've been doing previously (by deferring to node default behavior) and we
  627. // haven't heard any complaints about that aspect.
  628. //
  629. // note, a weakness of the quoting rules chosen here, is that % is not escaped. in fact, % cannot be
  630. // escaped when used on the command line directly - even though within a .cmd file % can be escaped
  631. // by using %%.
  632. //
  633. // the saving grace is, on the command line, %var% is left as-is if var is not defined. this contrasts
  634. // the line parsing rules within a .cmd file, where if var is not defined it is replaced with nothing.
  635. //
  636. // one option that was explored was replacing % with ^% - i.e. %var% => ^%var^%. this hack would
  637. // often work, since it is unlikely that var^ would exist, and the ^ character is removed when the
  638. // variable is used. the problem, however, is that ^ is not removed when %* is used to pass the args
  639. // to an external program.
  640. //
  641. // an unexplored potential solution for the % escaping problem, is to create a wrapper .cmd file.
  642. // % can be escaped within a .cmd file.
  643. let reverse = '"';
  644. let quoteHit = true;
  645. for (let i = arg.length; i > 0; i--) {
  646. // walk the string in reverse
  647. reverse += arg[i - 1];
  648. if (quoteHit && arg[i - 1] === '\\') {
  649. reverse += '\\'; // double the slash
  650. }
  651. else if (arg[i - 1] === '"') {
  652. quoteHit = true;
  653. reverse += '"'; // double the quote
  654. }
  655. else {
  656. quoteHit = false;
  657. }
  658. }
  659. reverse += '"';
  660. return reverse
  661. .split('')
  662. .reverse()
  663. .join('');
  664. }
  665. _uvQuoteCmdArg(arg) {
  666. // Tool runner wraps child_process.spawn() and needs to apply the same quoting as
  667. // Node in certain cases where the undocumented spawn option windowsVerbatimArguments
  668. // is used.
  669. //
  670. // Since this function is a port of quote_cmd_arg from Node 4.x (technically, lib UV,
  671. // see https://github.com/nodejs/node/blob/v4.x/deps/uv/src/win/process.c for details),
  672. // pasting copyright notice from Node within this function:
  673. //
  674. // Copyright Joyent, Inc. and other Node contributors. All rights reserved.
  675. //
  676. // Permission is hereby granted, free of charge, to any person obtaining a copy
  677. // of this software and associated documentation files (the "Software"), to
  678. // deal in the Software without restriction, including without limitation the
  679. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  680. // sell copies of the Software, and to permit persons to whom the Software is
  681. // furnished to do so, subject to the following conditions:
  682. //
  683. // The above copyright notice and this permission notice shall be included in
  684. // all copies or substantial portions of the Software.
  685. //
  686. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  687. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  688. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  689. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  690. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  691. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  692. // IN THE SOFTWARE.
  693. if (!arg) {
  694. // Need double quotation for empty argument
  695. return '""';
  696. }
  697. if (!arg.includes(' ') && !arg.includes('\t') && !arg.includes('"')) {
  698. // No quotation needed
  699. return arg;
  700. }
  701. if (!arg.includes('"') && !arg.includes('\\')) {
  702. // No embedded double quotes or backslashes, so I can just wrap
  703. // quote marks around the whole thing.
  704. return `"${arg}"`;
  705. }
  706. // Expected input/output:
  707. // input : hello"world
  708. // output: "hello\"world"
  709. // input : hello""world
  710. // output: "hello\"\"world"
  711. // input : hello\world
  712. // output: hello\world
  713. // input : hello\\world
  714. // output: hello\\world
  715. // input : hello\"world
  716. // output: "hello\\\"world"
  717. // input : hello\\"world
  718. // output: "hello\\\\\"world"
  719. // input : hello world\
  720. // output: "hello world\\" - note the comment in libuv actually reads "hello world\"
  721. // but it appears the comment is wrong, it should be "hello world\\"
  722. let reverse = '"';
  723. let quoteHit = true;
  724. for (let i = arg.length; i > 0; i--) {
  725. // walk the string in reverse
  726. reverse += arg[i - 1];
  727. if (quoteHit && arg[i - 1] === '\\') {
  728. reverse += '\\';
  729. }
  730. else if (arg[i - 1] === '"') {
  731. quoteHit = true;
  732. reverse += '\\';
  733. }
  734. else {
  735. quoteHit = false;
  736. }
  737. }
  738. reverse += '"';
  739. return reverse
  740. .split('')
  741. .reverse()
  742. .join('');
  743. }
  744. _cloneExecOptions(options) {
  745. options = options || {};
  746. const result = {
  747. cwd: options.cwd || process.cwd(),
  748. env: options.env || process.env,
  749. silent: options.silent || false,
  750. windowsVerbatimArguments: options.windowsVerbatimArguments || false,
  751. failOnStdErr: options.failOnStdErr || false,
  752. ignoreReturnCode: options.ignoreReturnCode || false,
  753. delay: options.delay || 10000
  754. };
  755. result.outStream = options.outStream || process.stdout;
  756. result.errStream = options.errStream || process.stderr;
  757. return result;
  758. }
  759. _getSpawnOptions(options, toolPath) {
  760. options = options || {};
  761. const result = {};
  762. result.cwd = options.cwd;
  763. result.env = options.env;
  764. result['windowsVerbatimArguments'] =
  765. options.windowsVerbatimArguments || this._isCmdFile();
  766. if (options.windowsVerbatimArguments) {
  767. result.argv0 = `"${toolPath}"`;
  768. }
  769. return result;
  770. }
  771. /**
  772. * Exec a tool.
  773. * Output will be streamed to the live console.
  774. * Returns promise with return code
  775. *
  776. * @param tool path to tool to exec
  777. * @param options optional exec options. See ExecOptions
  778. * @returns number
  779. */
  780. exec() {
  781. return __awaiter(this, void 0, void 0, function* () {
  782. return new Promise((resolve, reject) => {
  783. this._debug(`exec tool: ${this.toolPath}`);
  784. this._debug('arguments:');
  785. for (const arg of this.args) {
  786. this._debug(` ${arg}`);
  787. }
  788. const optionsNonNull = this._cloneExecOptions(this.options);
  789. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  790. optionsNonNull.outStream.write(this._getCommandString(optionsNonNull) + os.EOL);
  791. }
  792. const state = new ExecState(optionsNonNull, this.toolPath);
  793. state.on('debug', (message) => {
  794. this._debug(message);
  795. });
  796. const fileName = this._getSpawnFileName();
  797. const cp = child.spawn(fileName, this._getSpawnArgs(optionsNonNull), this._getSpawnOptions(this.options, fileName));
  798. const stdbuffer = '';
  799. if (cp.stdout) {
  800. cp.stdout.on('data', (data) => {
  801. if (this.options.listeners && this.options.listeners.stdout) {
  802. this.options.listeners.stdout(data);
  803. }
  804. if (!optionsNonNull.silent && optionsNonNull.outStream) {
  805. optionsNonNull.outStream.write(data);
  806. }
  807. this._processLineBuffer(data, stdbuffer, (line) => {
  808. if (this.options.listeners && this.options.listeners.stdline) {
  809. this.options.listeners.stdline(line);
  810. }
  811. });
  812. });
  813. }
  814. const errbuffer = '';
  815. if (cp.stderr) {
  816. cp.stderr.on('data', (data) => {
  817. state.processStderr = true;
  818. if (this.options.listeners && this.options.listeners.stderr) {
  819. this.options.listeners.stderr(data);
  820. }
  821. if (!optionsNonNull.silent &&
  822. optionsNonNull.errStream &&
  823. optionsNonNull.outStream) {
  824. const s = optionsNonNull.failOnStdErr
  825. ? optionsNonNull.errStream
  826. : optionsNonNull.outStream;
  827. s.write(data);
  828. }
  829. this._processLineBuffer(data, errbuffer, (line) => {
  830. if (this.options.listeners && this.options.listeners.errline) {
  831. this.options.listeners.errline(line);
  832. }
  833. });
  834. });
  835. }
  836. cp.on('error', (err) => {
  837. state.processError = err.message;
  838. state.processExited = true;
  839. state.processClosed = true;
  840. state.CheckComplete();
  841. });
  842. cp.on('exit', (code) => {
  843. state.processExitCode = code;
  844. state.processExited = true;
  845. this._debug(`Exit code ${code} received from tool '${this.toolPath}'`);
  846. state.CheckComplete();
  847. });
  848. cp.on('close', (code) => {
  849. state.processExitCode = code;
  850. state.processExited = true;
  851. state.processClosed = true;
  852. this._debug(`STDIO streams have closed for tool '${this.toolPath}'`);
  853. state.CheckComplete();
  854. });
  855. state.on('done', (error, exitCode) => {
  856. if (stdbuffer.length > 0) {
  857. this.emit('stdline', stdbuffer);
  858. }
  859. if (errbuffer.length > 0) {
  860. this.emit('errline', errbuffer);
  861. }
  862. cp.removeAllListeners();
  863. if (error) {
  864. reject(error);
  865. }
  866. else {
  867. resolve(exitCode);
  868. }
  869. });
  870. });
  871. });
  872. }
  873. }
  874. exports.ToolRunner = ToolRunner;
  875. /**
  876. * Convert an arg string to an array of args. Handles escaping
  877. *
  878. * @param argString string of arguments
  879. * @returns string[] array of arguments
  880. */
  881. function argStringToArray(argString) {
  882. const args = [];
  883. let inQuotes = false;
  884. let escaped = false;
  885. let arg = '';
  886. function append(c) {
  887. // we only escape double quotes.
  888. if (escaped && c !== '"') {
  889. arg += '\\';
  890. }
  891. arg += c;
  892. escaped = false;
  893. }
  894. for (let i = 0; i < argString.length; i++) {
  895. const c = argString.charAt(i);
  896. if (c === '"') {
  897. if (!escaped) {
  898. inQuotes = !inQuotes;
  899. }
  900. else {
  901. append(c);
  902. }
  903. continue;
  904. }
  905. if (c === '\\' && escaped) {
  906. append(c);
  907. continue;
  908. }
  909. if (c === '\\' && inQuotes) {
  910. escaped = true;
  911. continue;
  912. }
  913. if (c === ' ' && !inQuotes) {
  914. if (arg.length > 0) {
  915. args.push(arg);
  916. arg = '';
  917. }
  918. continue;
  919. }
  920. append(c);
  921. }
  922. if (arg.length > 0) {
  923. args.push(arg.trim());
  924. }
  925. return args;
  926. }
  927. exports.argStringToArray = argStringToArray;
  928. class ExecState extends events.EventEmitter {
  929. constructor(options, toolPath) {
  930. super();
  931. this.processClosed = false; // tracks whether the process has exited and stdio is closed
  932. this.processError = '';
  933. this.processExitCode = 0;
  934. this.processExited = false; // tracks whether the process has exited
  935. this.processStderr = false; // tracks whether stderr was written to
  936. this.delay = 10000; // 10 seconds
  937. this.done = false;
  938. this.timeout = null;
  939. if (!toolPath) {
  940. throw new Error('toolPath must not be empty');
  941. }
  942. this.options = options;
  943. this.toolPath = toolPath;
  944. if (options.delay) {
  945. this.delay = options.delay;
  946. }
  947. }
  948. CheckComplete() {
  949. if (this.done) {
  950. return;
  951. }
  952. if (this.processClosed) {
  953. this._setResult();
  954. }
  955. else if (this.processExited) {
  956. this.timeout = setTimeout(ExecState.HandleTimeout, this.delay, this);
  957. }
  958. }
  959. _debug(message) {
  960. this.emit('debug', message);
  961. }
  962. _setResult() {
  963. // determine whether there is an error
  964. let error;
  965. if (this.processExited) {
  966. if (this.processError) {
  967. error = new Error(`There was an error when attempting to execute the process '${this.toolPath}'. This may indicate the process failed to start. Error: ${this.processError}`);
  968. }
  969. else if (this.processExitCode !== 0 && !this.options.ignoreReturnCode) {
  970. error = new Error(`The process '${this.toolPath}' failed with exit code ${this.processExitCode}`);
  971. }
  972. else if (this.processStderr && this.options.failOnStdErr) {
  973. error = new Error(`The process '${this.toolPath}' failed because one or more lines were written to the STDERR stream`);
  974. }
  975. }
  976. // clear the timeout
  977. if (this.timeout) {
  978. clearTimeout(this.timeout);
  979. this.timeout = null;
  980. }
  981. this.done = true;
  982. this.emit('done', error, this.processExitCode);
  983. }
  984. static HandleTimeout(state) {
  985. if (state.done) {
  986. return;
  987. }
  988. if (!state.processClosed && state.processExited) {
  989. const message = `The STDIO streams did not close within ${state.delay /
  990. 1000} seconds of the exit event from process '${state.toolPath}'. This may indicate a child process inherited the STDIO streams and has not yet exited.`;
  991. state._debug(message);
  992. }
  993. state._setResult();
  994. }
  995. }
  996. //# sourceMappingURL=toolrunner.js.map
  997. /***/ }),
  998. /***/ 11:
  999. /***/ (function(module) {
  1000. // Returns a wrapper function that returns a wrapped callback
  1001. // The wrapper function should do some stuff, and return a
  1002. // presumably different callback function.
  1003. // This makes sure that own properties are retained, so that
  1004. // decorations and such are not lost along the way.
  1005. module.exports = wrappy
  1006. function wrappy (fn, cb) {
  1007. if (fn && cb) return wrappy(fn)(cb)
  1008. if (typeof fn !== 'function')
  1009. throw new TypeError('need wrapper function')
  1010. Object.keys(fn).forEach(function (k) {
  1011. wrapper[k] = fn[k]
  1012. })
  1013. return wrapper
  1014. function wrapper() {
  1015. var args = new Array(arguments.length)
  1016. for (var i = 0; i < args.length; i++) {
  1017. args[i] = arguments[i]
  1018. }
  1019. var ret = fn.apply(this, args)
  1020. var cb = args[args.length-1]
  1021. if (typeof ret === 'function' && ret !== cb) {
  1022. Object.keys(cb).forEach(function (k) {
  1023. ret[k] = cb[k]
  1024. })
  1025. }
  1026. return ret
  1027. }
  1028. }
  1029. /***/ }),
  1030. /***/ 16:
  1031. /***/ (function(module) {
  1032. module.exports = require("tls");
  1033. /***/ }),
  1034. /***/ 18:
  1035. /***/ (function() {
  1036. eval("require")("encoding");
  1037. /***/ }),
  1038. /***/ 19:
  1039. /***/ (function(module, __unusedexports, __webpack_require__) {
  1040. module.exports = authenticationPlugin;
  1041. const { Deprecation } = __webpack_require__(692);
  1042. const once = __webpack_require__(969);
  1043. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  1044. const authenticate = __webpack_require__(674);
  1045. const beforeRequest = __webpack_require__(471);
  1046. const requestError = __webpack_require__(349);
  1047. function authenticationPlugin(octokit, options) {
  1048. if (options.auth) {
  1049. octokit.authenticate = () => {
  1050. deprecateAuthenticate(
  1051. octokit.log,
  1052. new Deprecation(
  1053. '[@octokit/rest] octokit.authenticate() is deprecated and has no effect when "auth" option is set on Octokit constructor'
  1054. )
  1055. );
  1056. };
  1057. return;
  1058. }
  1059. const state = {
  1060. octokit,
  1061. auth: false
  1062. };
  1063. octokit.authenticate = authenticate.bind(null, state);
  1064. octokit.hook.before("request", beforeRequest.bind(null, state));
  1065. octokit.hook.error("request", requestError.bind(null, state));
  1066. }
  1067. /***/ }),
  1068. /***/ 20:
  1069. /***/ (function(module, __unusedexports, __webpack_require__) {
  1070. "use strict";
  1071. const cp = __webpack_require__(129);
  1072. const parse = __webpack_require__(568);
  1073. const enoent = __webpack_require__(881);
  1074. function spawn(command, args, options) {
  1075. // Parse the arguments
  1076. const parsed = parse(command, args, options);
  1077. // Spawn the child process
  1078. const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);
  1079. // Hook into child process "exit" event to emit an error if the command
  1080. // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1081. enoent.hookChildProcess(spawned, parsed);
  1082. return spawned;
  1083. }
  1084. function spawnSync(command, args, options) {
  1085. // Parse the arguments
  1086. const parsed = parse(command, args, options);
  1087. // Spawn the child process
  1088. const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);
  1089. // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
  1090. result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
  1091. return result;
  1092. }
  1093. module.exports = spawn;
  1094. module.exports.spawn = spawn;
  1095. module.exports.sync = spawnSync;
  1096. module.exports._parse = parse;
  1097. module.exports._enoent = enoent;
  1098. /***/ }),
  1099. /***/ 39:
  1100. /***/ (function(module) {
  1101. "use strict";
  1102. module.exports = opts => {
  1103. opts = opts || {};
  1104. const env = opts.env || process.env;
  1105. const platform = opts.platform || process.platform;
  1106. if (platform !== 'win32') {
  1107. return 'PATH';
  1108. }
  1109. return Object.keys(env).find(x => x.toUpperCase() === 'PATH') || 'Path';
  1110. };
  1111. /***/ }),
  1112. /***/ 47:
  1113. /***/ (function(module, __unusedexports, __webpack_require__) {
  1114. module.exports = factory;
  1115. const Octokit = __webpack_require__(402);
  1116. const registerPlugin = __webpack_require__(855);
  1117. function factory(plugins) {
  1118. const Api = Octokit.bind(null, plugins || []);
  1119. Api.plugin = registerPlugin.bind(null, plugins || []);
  1120. return Api;
  1121. }
  1122. /***/ }),
  1123. /***/ 49:
  1124. /***/ (function(module, __unusedexports, __webpack_require__) {
  1125. "use strict";
  1126. const os = __webpack_require__(87);
  1127. const execa = __webpack_require__(955);
  1128. // Reference: https://www.gaijin.at/en/lstwinver.php
  1129. const names = new Map([
  1130. ['10.0', '10'],
  1131. ['6.3', '8.1'],
  1132. ['6.2', '8'],
  1133. ['6.1', '7'],
  1134. ['6.0', 'Vista'],
  1135. ['5.2', 'Server 2003'],
  1136. ['5.1', 'XP'],
  1137. ['5.0', '2000'],
  1138. ['4.9', 'ME'],
  1139. ['4.1', '98'],
  1140. ['4.0', '95']
  1141. ]);
  1142. const windowsRelease = release => {
  1143. const version = /\d+\.\d/.exec(release || os.release());
  1144. if (release && !version) {
  1145. throw new Error('`release` argument doesn\'t match `n.n`');
  1146. }
  1147. const ver = (version || [])[0];
  1148. // Server 2008, 2012 and 2016 versions are ambiguous with desktop versions and must be detected at runtime.
  1149. // If `release` is omitted or we're on a Windows system, and the version number is an ambiguous version
  1150. // then use `wmic` to get the OS caption: https://msdn.microsoft.com/en-us/library/aa394531(v=vs.85).aspx
  1151. // If the resulting caption contains the year 2008, 2012 or 2016, it is a server version, so return a server OS name.
  1152. if ((!release || release === os.release()) && ['6.1', '6.2', '6.3', '10.0'].includes(ver)) {
  1153. const stdout = execa.sync('wmic', ['os', 'get', 'Caption']).stdout || '';
  1154. const year = (stdout.match(/2008|2012|2016/) || [])[0];
  1155. if (year) {
  1156. return `Server ${year}`;
  1157. }
  1158. }
  1159. return names.get(ver);
  1160. };
  1161. module.exports = windowsRelease;
  1162. /***/ }),
  1163. /***/ 87:
  1164. /***/ (function(module) {
  1165. module.exports = require("os");
  1166. /***/ }),
  1167. /***/ 118:
  1168. /***/ (function(module, __unusedexports, __webpack_require__) {
  1169. "use strict";
  1170. const os = __webpack_require__(87);
  1171. const nameMap = new Map([
  1172. [19, 'Catalina'],
  1173. [18, 'Mojave'],
  1174. [17, 'High Sierra'],
  1175. [16, 'Sierra'],
  1176. [15, 'El Capitan'],
  1177. [14, 'Yosemite'],
  1178. [13, 'Mavericks'],
  1179. [12, 'Mountain Lion'],
  1180. [11, 'Lion'],
  1181. [10, 'Snow Leopard'],
  1182. [9, 'Leopard'],
  1183. [8, 'Tiger'],
  1184. [7, 'Panther'],
  1185. [6, 'Jaguar'],
  1186. [5, 'Puma']
  1187. ]);
  1188. const macosRelease = release => {
  1189. release = Number((release || os.release()).split('.')[0]);
  1190. return {
  1191. name: nameMap.get(release),
  1192. version: '10.' + (release - 4)
  1193. };
  1194. };
  1195. module.exports = macosRelease;
  1196. // TODO: remove this in the next major version
  1197. module.exports.default = macosRelease;
  1198. /***/ }),
  1199. /***/ 126:
  1200. /***/ (function(module) {
  1201. /**
  1202. * lodash (Custom Build) <https://lodash.com/>
  1203. * Build: `lodash modularize exports="npm" -o ./`
  1204. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  1205. * Released under MIT license <https://lodash.com/license>
  1206. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  1207. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  1208. */
  1209. /** Used as the size to enable large array optimizations. */
  1210. var LARGE_ARRAY_SIZE = 200;
  1211. /** Used to stand-in for `undefined` hash values. */
  1212. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  1213. /** Used as references for various `Number` constants. */
  1214. var INFINITY = 1 / 0;
  1215. /** `Object#toString` result references. */
  1216. var funcTag = '[object Function]',
  1217. genTag = '[object GeneratorFunction]';
  1218. /**
  1219. * Used to match `RegExp`
  1220. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  1221. */
  1222. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  1223. /** Used to detect host constructors (Safari). */
  1224. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  1225. /** Detect free variable `global` from Node.js. */
  1226. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  1227. /** Detect free variable `self`. */
  1228. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  1229. /** Used as a reference to the global object. */
  1230. var root = freeGlobal || freeSelf || Function('return this')();
  1231. /**
  1232. * A specialized version of `_.includes` for arrays without support for
  1233. * specifying an index to search from.
  1234. *
  1235. * @private
  1236. * @param {Array} [array] The array to inspect.
  1237. * @param {*} target The value to search for.
  1238. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1239. */
  1240. function arrayIncludes(array, value) {
  1241. var length = array ? array.length : 0;
  1242. return !!length && baseIndexOf(array, value, 0) > -1;
  1243. }
  1244. /**
  1245. * This function is like `arrayIncludes` except that it accepts a comparator.
  1246. *
  1247. * @private
  1248. * @param {Array} [array] The array to inspect.
  1249. * @param {*} target The value to search for.
  1250. * @param {Function} comparator The comparator invoked per element.
  1251. * @returns {boolean} Returns `true` if `target` is found, else `false`.
  1252. */
  1253. function arrayIncludesWith(array, value, comparator) {
  1254. var index = -1,
  1255. length = array ? array.length : 0;
  1256. while (++index < length) {
  1257. if (comparator(value, array[index])) {
  1258. return true;
  1259. }
  1260. }
  1261. return false;
  1262. }
  1263. /**
  1264. * The base implementation of `_.findIndex` and `_.findLastIndex` without
  1265. * support for iteratee shorthands.
  1266. *
  1267. * @private
  1268. * @param {Array} array The array to inspect.
  1269. * @param {Function} predicate The function invoked per iteration.
  1270. * @param {number} fromIndex The index to search from.
  1271. * @param {boolean} [fromRight] Specify iterating from right to left.
  1272. * @returns {number} Returns the index of the matched value, else `-1`.
  1273. */
  1274. function baseFindIndex(array, predicate, fromIndex, fromRight) {
  1275. var length = array.length,
  1276. index = fromIndex + (fromRight ? 1 : -1);
  1277. while ((fromRight ? index-- : ++index < length)) {
  1278. if (predicate(array[index], index, array)) {
  1279. return index;
  1280. }
  1281. }
  1282. return -1;
  1283. }
  1284. /**
  1285. * The base implementation of `_.indexOf` without `fromIndex` bounds checks.
  1286. *
  1287. * @private
  1288. * @param {Array} array The array to inspect.
  1289. * @param {*} value The value to search for.
  1290. * @param {number} fromIndex The index to search from.
  1291. * @returns {number} Returns the index of the matched value, else `-1`.
  1292. */
  1293. function baseIndexOf(array, value, fromIndex) {
  1294. if (value !== value) {
  1295. return baseFindIndex(array, baseIsNaN, fromIndex);
  1296. }
  1297. var index = fromIndex - 1,
  1298. length = array.length;
  1299. while (++index < length) {
  1300. if (array[index] === value) {
  1301. return index;
  1302. }
  1303. }
  1304. return -1;
  1305. }
  1306. /**
  1307. * The base implementation of `_.isNaN` without support for number objects.
  1308. *
  1309. * @private
  1310. * @param {*} value The value to check.
  1311. * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`.
  1312. */
  1313. function baseIsNaN(value) {
  1314. return value !== value;
  1315. }
  1316. /**
  1317. * Checks if a cache value for `key` exists.
  1318. *
  1319. * @private
  1320. * @param {Object} cache The cache to query.
  1321. * @param {string} key The key of the entry to check.
  1322. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1323. */
  1324. function cacheHas(cache, key) {
  1325. return cache.has(key);
  1326. }
  1327. /**
  1328. * Gets the value at `key` of `object`.
  1329. *
  1330. * @private
  1331. * @param {Object} [object] The object to query.
  1332. * @param {string} key The key of the property to get.
  1333. * @returns {*} Returns the property value.
  1334. */
  1335. function getValue(object, key) {
  1336. return object == null ? undefined : object[key];
  1337. }
  1338. /**
  1339. * Checks if `value` is a host object in IE < 9.
  1340. *
  1341. * @private
  1342. * @param {*} value The value to check.
  1343. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  1344. */
  1345. function isHostObject(value) {
  1346. // Many host objects are `Object` objects that can coerce to strings
  1347. // despite having improperly defined `toString` methods.
  1348. var result = false;
  1349. if (value != null && typeof value.toString != 'function') {
  1350. try {
  1351. result = !!(value + '');
  1352. } catch (e) {}
  1353. }
  1354. return result;
  1355. }
  1356. /**
  1357. * Converts `set` to an array of its values.
  1358. *
  1359. * @private
  1360. * @param {Object} set The set to convert.
  1361. * @returns {Array} Returns the values.
  1362. */
  1363. function setToArray(set) {
  1364. var index = -1,
  1365. result = Array(set.size);
  1366. set.forEach(function(value) {
  1367. result[++index] = value;
  1368. });
  1369. return result;
  1370. }
  1371. /** Used for built-in method references. */
  1372. var arrayProto = Array.prototype,
  1373. funcProto = Function.prototype,
  1374. objectProto = Object.prototype;
  1375. /** Used to detect overreaching core-js shims. */
  1376. var coreJsData = root['__core-js_shared__'];
  1377. /** Used to detect methods masquerading as native. */
  1378. var maskSrcKey = (function() {
  1379. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  1380. return uid ? ('Symbol(src)_1.' + uid) : '';
  1381. }());
  1382. /** Used to resolve the decompiled source of functions. */
  1383. var funcToString = funcProto.toString;
  1384. /** Used to check objects for own properties. */
  1385. var hasOwnProperty = objectProto.hasOwnProperty;
  1386. /**
  1387. * Used to resolve the
  1388. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  1389. * of values.
  1390. */
  1391. var objectToString = objectProto.toString;
  1392. /** Used to detect if a method is native. */
  1393. var reIsNative = RegExp('^' +
  1394. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  1395. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  1396. );
  1397. /** Built-in value references. */
  1398. var splice = arrayProto.splice;
  1399. /* Built-in method references that are verified to be native. */
  1400. var Map = getNative(root, 'Map'),
  1401. Set = getNative(root, 'Set'),
  1402. nativeCreate = getNative(Object, 'create');
  1403. /**
  1404. * Creates a hash object.
  1405. *
  1406. * @private
  1407. * @constructor
  1408. * @param {Array} [entries] The key-value pairs to cache.
  1409. */
  1410. function Hash(entries) {
  1411. var index = -1,
  1412. length = entries ? entries.length : 0;
  1413. this.clear();
  1414. while (++index < length) {
  1415. var entry = entries[index];
  1416. this.set(entry[0], entry[1]);
  1417. }
  1418. }
  1419. /**
  1420. * Removes all key-value entries from the hash.
  1421. *
  1422. * @private
  1423. * @name clear
  1424. * @memberOf Hash
  1425. */
  1426. function hashClear() {
  1427. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  1428. }
  1429. /**
  1430. * Removes `key` and its value from the hash.
  1431. *
  1432. * @private
  1433. * @name delete
  1434. * @memberOf Hash
  1435. * @param {Object} hash The hash to modify.
  1436. * @param {string} key The key of the value to remove.
  1437. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1438. */
  1439. function hashDelete(key) {
  1440. return this.has(key) && delete this.__data__[key];
  1441. }
  1442. /**
  1443. * Gets the hash value for `key`.
  1444. *
  1445. * @private
  1446. * @name get
  1447. * @memberOf Hash
  1448. * @param {string} key The key of the value to get.
  1449. * @returns {*} Returns the entry value.
  1450. */
  1451. function hashGet(key) {
  1452. var data = this.__data__;
  1453. if (nativeCreate) {
  1454. var result = data[key];
  1455. return result === HASH_UNDEFINED ? undefined : result;
  1456. }
  1457. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  1458. }
  1459. /**
  1460. * Checks if a hash value for `key` exists.
  1461. *
  1462. * @private
  1463. * @name has
  1464. * @memberOf Hash
  1465. * @param {string} key The key of the entry to check.
  1466. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1467. */
  1468. function hashHas(key) {
  1469. var data = this.__data__;
  1470. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  1471. }
  1472. /**
  1473. * Sets the hash `key` to `value`.
  1474. *
  1475. * @private
  1476. * @name set
  1477. * @memberOf Hash
  1478. * @param {string} key The key of the value to set.
  1479. * @param {*} value The value to set.
  1480. * @returns {Object} Returns the hash instance.
  1481. */
  1482. function hashSet(key, value) {
  1483. var data = this.__data__;
  1484. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  1485. return this;
  1486. }
  1487. // Add methods to `Hash`.
  1488. Hash.prototype.clear = hashClear;
  1489. Hash.prototype['delete'] = hashDelete;
  1490. Hash.prototype.get = hashGet;
  1491. Hash.prototype.has = hashHas;
  1492. Hash.prototype.set = hashSet;
  1493. /**
  1494. * Creates an list cache object.
  1495. *
  1496. * @private
  1497. * @constructor
  1498. * @param {Array} [entries] The key-value pairs to cache.
  1499. */
  1500. function ListCache(entries) {
  1501. var index = -1,
  1502. length = entries ? entries.length : 0;
  1503. this.clear();
  1504. while (++index < length) {
  1505. var entry = entries[index];
  1506. this.set(entry[0], entry[1]);
  1507. }
  1508. }
  1509. /**
  1510. * Removes all key-value entries from the list cache.
  1511. *
  1512. * @private
  1513. * @name clear
  1514. * @memberOf ListCache
  1515. */
  1516. function listCacheClear() {
  1517. this.__data__ = [];
  1518. }
  1519. /**
  1520. * Removes `key` and its value from the list cache.
  1521. *
  1522. * @private
  1523. * @name delete
  1524. * @memberOf ListCache
  1525. * @param {string} key The key of the value to remove.
  1526. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1527. */
  1528. function listCacheDelete(key) {
  1529. var data = this.__data__,
  1530. index = assocIndexOf(data, key);
  1531. if (index < 0) {
  1532. return false;
  1533. }
  1534. var lastIndex = data.length - 1;
  1535. if (index == lastIndex) {
  1536. data.pop();
  1537. } else {
  1538. splice.call(data, index, 1);
  1539. }
  1540. return true;
  1541. }
  1542. /**
  1543. * Gets the list cache value for `key`.
  1544. *
  1545. * @private
  1546. * @name get
  1547. * @memberOf ListCache
  1548. * @param {string} key The key of the value to get.
  1549. * @returns {*} Returns the entry value.
  1550. */
  1551. function listCacheGet(key) {
  1552. var data = this.__data__,
  1553. index = assocIndexOf(data, key);
  1554. return index < 0 ? undefined : data[index][1];
  1555. }
  1556. /**
  1557. * Checks if a list cache value for `key` exists.
  1558. *
  1559. * @private
  1560. * @name has
  1561. * @memberOf ListCache
  1562. * @param {string} key The key of the entry to check.
  1563. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1564. */
  1565. function listCacheHas(key) {
  1566. return assocIndexOf(this.__data__, key) > -1;
  1567. }
  1568. /**
  1569. * Sets the list cache `key` to `value`.
  1570. *
  1571. * @private
  1572. * @name set
  1573. * @memberOf ListCache
  1574. * @param {string} key The key of the value to set.
  1575. * @param {*} value The value to set.
  1576. * @returns {Object} Returns the list cache instance.
  1577. */
  1578. function listCacheSet(key, value) {
  1579. var data = this.__data__,
  1580. index = assocIndexOf(data, key);
  1581. if (index < 0) {
  1582. data.push([key, value]);
  1583. } else {
  1584. data[index][1] = value;
  1585. }
  1586. return this;
  1587. }
  1588. // Add methods to `ListCache`.
  1589. ListCache.prototype.clear = listCacheClear;
  1590. ListCache.prototype['delete'] = listCacheDelete;
  1591. ListCache.prototype.get = listCacheGet;
  1592. ListCache.prototype.has = listCacheHas;
  1593. ListCache.prototype.set = listCacheSet;
  1594. /**
  1595. * Creates a map cache object to store key-value pairs.
  1596. *
  1597. * @private
  1598. * @constructor
  1599. * @param {Array} [entries] The key-value pairs to cache.
  1600. */
  1601. function MapCache(entries) {
  1602. var index = -1,
  1603. length = entries ? entries.length : 0;
  1604. this.clear();
  1605. while (++index < length) {
  1606. var entry = entries[index];
  1607. this.set(entry[0], entry[1]);
  1608. }
  1609. }
  1610. /**
  1611. * Removes all key-value entries from the map.
  1612. *
  1613. * @private
  1614. * @name clear
  1615. * @memberOf MapCache
  1616. */
  1617. function mapCacheClear() {
  1618. this.__data__ = {
  1619. 'hash': new Hash,
  1620. 'map': new (Map || ListCache),
  1621. 'string': new Hash
  1622. };
  1623. }
  1624. /**
  1625. * Removes `key` and its value from the map.
  1626. *
  1627. * @private
  1628. * @name delete
  1629. * @memberOf MapCache
  1630. * @param {string} key The key of the value to remove.
  1631. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  1632. */
  1633. function mapCacheDelete(key) {
  1634. return getMapData(this, key)['delete'](key);
  1635. }
  1636. /**
  1637. * Gets the map value for `key`.
  1638. *
  1639. * @private
  1640. * @name get
  1641. * @memberOf MapCache
  1642. * @param {string} key The key of the value to get.
  1643. * @returns {*} Returns the entry value.
  1644. */
  1645. function mapCacheGet(key) {
  1646. return getMapData(this, key).get(key);
  1647. }
  1648. /**
  1649. * Checks if a map value for `key` exists.
  1650. *
  1651. * @private
  1652. * @name has
  1653. * @memberOf MapCache
  1654. * @param {string} key The key of the entry to check.
  1655. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  1656. */
  1657. function mapCacheHas(key) {
  1658. return getMapData(this, key).has(key);
  1659. }
  1660. /**
  1661. * Sets the map `key` to `value`.
  1662. *
  1663. * @private
  1664. * @name set
  1665. * @memberOf MapCache
  1666. * @param {string} key The key of the value to set.
  1667. * @param {*} value The value to set.
  1668. * @returns {Object} Returns the map cache instance.
  1669. */
  1670. function mapCacheSet(key, value) {
  1671. getMapData(this, key).set(key, value);
  1672. return this;
  1673. }
  1674. // Add methods to `MapCache`.
  1675. MapCache.prototype.clear = mapCacheClear;
  1676. MapCache.prototype['delete'] = mapCacheDelete;
  1677. MapCache.prototype.get = mapCacheGet;
  1678. MapCache.prototype.has = mapCacheHas;
  1679. MapCache.prototype.set = mapCacheSet;
  1680. /**
  1681. *
  1682. * Creates an array cache object to store unique values.
  1683. *
  1684. * @private
  1685. * @constructor
  1686. * @param {Array} [values] The values to cache.
  1687. */
  1688. function SetCache(values) {
  1689. var index = -1,
  1690. length = values ? values.length : 0;
  1691. this.__data__ = new MapCache;
  1692. while (++index < length) {
  1693. this.add(values[index]);
  1694. }
  1695. }
  1696. /**
  1697. * Adds `value` to the array cache.
  1698. *
  1699. * @private
  1700. * @name add
  1701. * @memberOf SetCache
  1702. * @alias push
  1703. * @param {*} value The value to cache.
  1704. * @returns {Object} Returns the cache instance.
  1705. */
  1706. function setCacheAdd(value) {
  1707. this.__data__.set(value, HASH_UNDEFINED);
  1708. return this;
  1709. }
  1710. /**
  1711. * Checks if `value` is in the array cache.
  1712. *
  1713. * @private
  1714. * @name has
  1715. * @memberOf SetCache
  1716. * @param {*} value The value to search for.
  1717. * @returns {number} Returns `true` if `value` is found, else `false`.
  1718. */
  1719. function setCacheHas(value) {
  1720. return this.__data__.has(value);
  1721. }
  1722. // Add methods to `SetCache`.
  1723. SetCache.prototype.add = SetCache.prototype.push = setCacheAdd;
  1724. SetCache.prototype.has = setCacheHas;
  1725. /**
  1726. * Gets the index at which the `key` is found in `array` of key-value pairs.
  1727. *
  1728. * @private
  1729. * @param {Array} array The array to inspect.
  1730. * @param {*} key The key to search for.
  1731. * @returns {number} Returns the index of the matched value, else `-1`.
  1732. */
  1733. function assocIndexOf(array, key) {
  1734. var length = array.length;
  1735. while (length--) {
  1736. if (eq(array[length][0], key)) {
  1737. return length;
  1738. }
  1739. }
  1740. return -1;
  1741. }
  1742. /**
  1743. * The base implementation of `_.isNative` without bad shim checks.
  1744. *
  1745. * @private
  1746. * @param {*} value The value to check.
  1747. * @returns {boolean} Returns `true` if `value` is a native function,
  1748. * else `false`.
  1749. */
  1750. function baseIsNative(value) {
  1751. if (!isObject(value) || isMasked(value)) {
  1752. return false;
  1753. }
  1754. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  1755. return pattern.test(toSource(value));
  1756. }
  1757. /**
  1758. * The base implementation of `_.uniqBy` without support for iteratee shorthands.
  1759. *
  1760. * @private
  1761. * @param {Array} array The array to inspect.
  1762. * @param {Function} [iteratee] The iteratee invoked per element.
  1763. * @param {Function} [comparator] The comparator invoked per element.
  1764. * @returns {Array} Returns the new duplicate free array.
  1765. */
  1766. function baseUniq(array, iteratee, comparator) {
  1767. var index = -1,
  1768. includes = arrayIncludes,
  1769. length = array.length,
  1770. isCommon = true,
  1771. result = [],
  1772. seen = result;
  1773. if (comparator) {
  1774. isCommon = false;
  1775. includes = arrayIncludesWith;
  1776. }
  1777. else if (length >= LARGE_ARRAY_SIZE) {
  1778. var set = iteratee ? null : createSet(array);
  1779. if (set) {
  1780. return setToArray(set);
  1781. }
  1782. isCommon = false;
  1783. includes = cacheHas;
  1784. seen = new SetCache;
  1785. }
  1786. else {
  1787. seen = iteratee ? [] : result;
  1788. }
  1789. outer:
  1790. while (++index < length) {
  1791. var value = array[index],
  1792. computed = iteratee ? iteratee(value) : value;
  1793. value = (comparator || value !== 0) ? value : 0;
  1794. if (isCommon && computed === computed) {
  1795. var seenIndex = seen.length;
  1796. while (seenIndex--) {
  1797. if (seen[seenIndex] === computed) {
  1798. continue outer;
  1799. }
  1800. }
  1801. if (iteratee) {
  1802. seen.push(computed);
  1803. }
  1804. result.push(value);
  1805. }
  1806. else if (!includes(seen, computed, comparator)) {
  1807. if (seen !== result) {
  1808. seen.push(computed);
  1809. }
  1810. result.push(value);
  1811. }
  1812. }
  1813. return result;
  1814. }
  1815. /**
  1816. * Creates a set object of `values`.
  1817. *
  1818. * @private
  1819. * @param {Array} values The values to add to the set.
  1820. * @returns {Object} Returns the new set.
  1821. */
  1822. var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) {
  1823. return new Set(values);
  1824. };
  1825. /**
  1826. * Gets the data for `map`.
  1827. *
  1828. * @private
  1829. * @param {Object} map The map to query.
  1830. * @param {string} key The reference key.
  1831. * @returns {*} Returns the map data.
  1832. */
  1833. function getMapData(map, key) {
  1834. var data = map.__data__;
  1835. return isKeyable(key)
  1836. ? data[typeof key == 'string' ? 'string' : 'hash']
  1837. : data.map;
  1838. }
  1839. /**
  1840. * Gets the native function at `key` of `object`.
  1841. *
  1842. * @private
  1843. * @param {Object} object The object to query.
  1844. * @param {string} key The key of the method to get.
  1845. * @returns {*} Returns the function if it's native, else `undefined`.
  1846. */
  1847. function getNative(object, key) {
  1848. var value = getValue(object, key);
  1849. return baseIsNative(value) ? value : undefined;
  1850. }
  1851. /**
  1852. * Checks if `value` is suitable for use as unique object key.
  1853. *
  1854. * @private
  1855. * @param {*} value The value to check.
  1856. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  1857. */
  1858. function isKeyable(value) {
  1859. var type = typeof value;
  1860. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  1861. ? (value !== '__proto__')
  1862. : (value === null);
  1863. }
  1864. /**
  1865. * Checks if `func` has its source masked.
  1866. *
  1867. * @private
  1868. * @param {Function} func The function to check.
  1869. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  1870. */
  1871. function isMasked(func) {
  1872. return !!maskSrcKey && (maskSrcKey in func);
  1873. }
  1874. /**
  1875. * Converts `func` to its source code.
  1876. *
  1877. * @private
  1878. * @param {Function} func The function to process.
  1879. * @returns {string} Returns the source code.
  1880. */
  1881. function toSource(func) {
  1882. if (func != null) {
  1883. try {
  1884. return funcToString.call(func);
  1885. } catch (e) {}
  1886. try {
  1887. return (func + '');
  1888. } catch (e) {}
  1889. }
  1890. return '';
  1891. }
  1892. /**
  1893. * Creates a duplicate-free version of an array, using
  1894. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1895. * for equality comparisons, in which only the first occurrence of each
  1896. * element is kept.
  1897. *
  1898. * @static
  1899. * @memberOf _
  1900. * @since 0.1.0
  1901. * @category Array
  1902. * @param {Array} array The array to inspect.
  1903. * @returns {Array} Returns the new duplicate free array.
  1904. * @example
  1905. *
  1906. * _.uniq([2, 1, 2]);
  1907. * // => [2, 1]
  1908. */
  1909. function uniq(array) {
  1910. return (array && array.length)
  1911. ? baseUniq(array)
  1912. : [];
  1913. }
  1914. /**
  1915. * Performs a
  1916. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  1917. * comparison between two values to determine if they are equivalent.
  1918. *
  1919. * @static
  1920. * @memberOf _
  1921. * @since 4.0.0
  1922. * @category Lang
  1923. * @param {*} value The value to compare.
  1924. * @param {*} other The other value to compare.
  1925. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  1926. * @example
  1927. *
  1928. * var object = { 'a': 1 };
  1929. * var other = { 'a': 1 };
  1930. *
  1931. * _.eq(object, object);
  1932. * // => true
  1933. *
  1934. * _.eq(object, other);
  1935. * // => false
  1936. *
  1937. * _.eq('a', 'a');
  1938. * // => true
  1939. *
  1940. * _.eq('a', Object('a'));
  1941. * // => false
  1942. *
  1943. * _.eq(NaN, NaN);
  1944. * // => true
  1945. */
  1946. function eq(value, other) {
  1947. return value === other || (value !== value && other !== other);
  1948. }
  1949. /**
  1950. * Checks if `value` is classified as a `Function` object.
  1951. *
  1952. * @static
  1953. * @memberOf _
  1954. * @since 0.1.0
  1955. * @category Lang
  1956. * @param {*} value The value to check.
  1957. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  1958. * @example
  1959. *
  1960. * _.isFunction(_);
  1961. * // => true
  1962. *
  1963. * _.isFunction(/abc/);
  1964. * // => false
  1965. */
  1966. function isFunction(value) {
  1967. // The use of `Object#toString` avoids issues with the `typeof` operator
  1968. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  1969. var tag = isObject(value) ? objectToString.call(value) : '';
  1970. return tag == funcTag || tag == genTag;
  1971. }
  1972. /**
  1973. * Checks if `value` is the
  1974. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  1975. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  1976. *
  1977. * @static
  1978. * @memberOf _
  1979. * @since 0.1.0
  1980. * @category Lang
  1981. * @param {*} value The value to check.
  1982. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  1983. * @example
  1984. *
  1985. * _.isObject({});
  1986. * // => true
  1987. *
  1988. * _.isObject([1, 2, 3]);
  1989. * // => true
  1990. *
  1991. * _.isObject(_.noop);
  1992. * // => true
  1993. *
  1994. * _.isObject(null);
  1995. * // => false
  1996. */
  1997. function isObject(value) {
  1998. var type = typeof value;
  1999. return !!value && (type == 'object' || type == 'function');
  2000. }
  2001. /**
  2002. * This method returns `undefined`.
  2003. *
  2004. * @static
  2005. * @memberOf _
  2006. * @since 2.3.0
  2007. * @category Util
  2008. * @example
  2009. *
  2010. * _.times(2, _.noop);
  2011. * // => [undefined, undefined]
  2012. */
  2013. function noop() {
  2014. // No operation performed.
  2015. }
  2016. module.exports = uniq;
  2017. /***/ }),
  2018. /***/ 129:
  2019. /***/ (function(module) {
  2020. module.exports = require("child_process");
  2021. /***/ }),
  2022. /***/ 139:
  2023. /***/ (function(module, __unusedexports, __webpack_require__) {
  2024. // Unique ID creation requires a high quality random # generator. In node.js
  2025. // this is pretty straight-forward - we use the crypto API.
  2026. var crypto = __webpack_require__(417);
  2027. module.exports = function nodeRNG() {
  2028. return crypto.randomBytes(16);
  2029. };
  2030. /***/ }),
  2031. /***/ 141:
  2032. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2033. "use strict";
  2034. var net = __webpack_require__(631);
  2035. var tls = __webpack_require__(16);
  2036. var http = __webpack_require__(605);
  2037. var https = __webpack_require__(211);
  2038. var events = __webpack_require__(614);
  2039. var assert = __webpack_require__(357);
  2040. var util = __webpack_require__(669);
  2041. exports.httpOverHttp = httpOverHttp;
  2042. exports.httpsOverHttp = httpsOverHttp;
  2043. exports.httpOverHttps = httpOverHttps;
  2044. exports.httpsOverHttps = httpsOverHttps;
  2045. function httpOverHttp(options) {
  2046. var agent = new TunnelingAgent(options);
  2047. agent.request = http.request;
  2048. return agent;
  2049. }
  2050. function httpsOverHttp(options) {
  2051. var agent = new TunnelingAgent(options);
  2052. agent.request = http.request;
  2053. agent.createSocket = createSecureSocket;
  2054. return agent;
  2055. }
  2056. function httpOverHttps(options) {
  2057. var agent = new TunnelingAgent(options);
  2058. agent.request = https.request;
  2059. return agent;
  2060. }
  2061. function httpsOverHttps(options) {
  2062. var agent = new TunnelingAgent(options);
  2063. agent.request = https.request;
  2064. agent.createSocket = createSecureSocket;
  2065. return agent;
  2066. }
  2067. function TunnelingAgent(options) {
  2068. var self = this;
  2069. self.options = options || {};
  2070. self.proxyOptions = self.options.proxy || {};
  2071. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2072. self.requests = [];
  2073. self.sockets = [];
  2074. self.on('free', function onFree(socket, host, port, localAddress) {
  2075. var options = toOptions(host, port, localAddress);
  2076. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2077. var pending = self.requests[i];
  2078. if (pending.host === options.host && pending.port === options.port) {
  2079. // Detect the request to connect same origin server,
  2080. // reuse the connection.
  2081. self.requests.splice(i, 1);
  2082. pending.request.onSocket(socket);
  2083. return;
  2084. }
  2085. }
  2086. socket.destroy();
  2087. self.removeSocket(socket);
  2088. });
  2089. }
  2090. util.inherits(TunnelingAgent, events.EventEmitter);
  2091. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2092. var self = this;
  2093. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2094. if (self.sockets.length >= this.maxSockets) {
  2095. // We are over limit so we'll add it to the queue.
  2096. self.requests.push(options);
  2097. return;
  2098. }
  2099. // If we are under maxSockets create a new one.
  2100. self.createSocket(options, function(socket) {
  2101. socket.on('free', onFree);
  2102. socket.on('close', onCloseOrRemove);
  2103. socket.on('agentRemove', onCloseOrRemove);
  2104. req.onSocket(socket);
  2105. function onFree() {
  2106. self.emit('free', socket, options);
  2107. }
  2108. function onCloseOrRemove(err) {
  2109. self.removeSocket(socket);
  2110. socket.removeListener('free', onFree);
  2111. socket.removeListener('close', onCloseOrRemove);
  2112. socket.removeListener('agentRemove', onCloseOrRemove);
  2113. }
  2114. });
  2115. };
  2116. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2117. var self = this;
  2118. var placeholder = {};
  2119. self.sockets.push(placeholder);
  2120. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2121. method: 'CONNECT',
  2122. path: options.host + ':' + options.port,
  2123. agent: false
  2124. });
  2125. if (connectOptions.proxyAuth) {
  2126. connectOptions.headers = connectOptions.headers || {};
  2127. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2128. new Buffer(connectOptions.proxyAuth).toString('base64');
  2129. }
  2130. debug('making CONNECT request');
  2131. var connectReq = self.request(connectOptions);
  2132. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2133. connectReq.once('response', onResponse); // for v0.6
  2134. connectReq.once('upgrade', onUpgrade); // for v0.6
  2135. connectReq.once('connect', onConnect); // for v0.7 or later
  2136. connectReq.once('error', onError);
  2137. connectReq.end();
  2138. function onResponse(res) {
  2139. // Very hacky. This is necessary to avoid http-parser leaks.
  2140. res.upgrade = true;
  2141. }
  2142. function onUpgrade(res, socket, head) {
  2143. // Hacky.
  2144. process.nextTick(function() {
  2145. onConnect(res, socket, head);
  2146. });
  2147. }
  2148. function onConnect(res, socket, head) {
  2149. connectReq.removeAllListeners();
  2150. socket.removeAllListeners();
  2151. if (res.statusCode === 200) {
  2152. assert.equal(head.length, 0);
  2153. debug('tunneling connection has established');
  2154. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2155. cb(socket);
  2156. } else {
  2157. debug('tunneling socket could not be established, statusCode=%d',
  2158. res.statusCode);
  2159. var error = new Error('tunneling socket could not be established, ' +
  2160. 'statusCode=' + res.statusCode);
  2161. error.code = 'ECONNRESET';
  2162. options.request.emit('error', error);
  2163. self.removeSocket(placeholder);
  2164. }
  2165. }
  2166. function onError(cause) {
  2167. connectReq.removeAllListeners();
  2168. debug('tunneling socket could not be established, cause=%s\n',
  2169. cause.message, cause.stack);
  2170. var error = new Error('tunneling socket could not be established, ' +
  2171. 'cause=' + cause.message);
  2172. error.code = 'ECONNRESET';
  2173. options.request.emit('error', error);
  2174. self.removeSocket(placeholder);
  2175. }
  2176. };
  2177. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2178. var pos = this.sockets.indexOf(socket)
  2179. if (pos === -1) {
  2180. return;
  2181. }
  2182. this.sockets.splice(pos, 1);
  2183. var pending = this.requests.shift();
  2184. if (pending) {
  2185. // If we have pending requests and a socket gets closed a new one
  2186. // needs to be created to take over in the pool for the one that closed.
  2187. this.createSocket(pending, function(socket) {
  2188. pending.request.onSocket(socket);
  2189. });
  2190. }
  2191. };
  2192. function createSecureSocket(options, cb) {
  2193. var self = this;
  2194. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2195. var hostHeader = options.request.getHeader('host');
  2196. var tlsOptions = mergeOptions({}, self.options, {
  2197. socket: socket,
  2198. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2199. });
  2200. // 0 is dummy port for v0.6
  2201. var secureSocket = tls.connect(0, tlsOptions);
  2202. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2203. cb(secureSocket);
  2204. });
  2205. }
  2206. function toOptions(host, port, localAddress) {
  2207. if (typeof host === 'string') { // since v0.10
  2208. return {
  2209. host: host,
  2210. port: port,
  2211. localAddress: localAddress
  2212. };
  2213. }
  2214. return host; // for v0.11 or later
  2215. }
  2216. function mergeOptions(target) {
  2217. for (var i = 1, len = arguments.length; i < len; ++i) {
  2218. var overrides = arguments[i];
  2219. if (typeof overrides === 'object') {
  2220. var keys = Object.keys(overrides);
  2221. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2222. var k = keys[j];
  2223. if (overrides[k] !== undefined) {
  2224. target[k] = overrides[k];
  2225. }
  2226. }
  2227. }
  2228. }
  2229. return target;
  2230. }
  2231. var debug;
  2232. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2233. debug = function() {
  2234. var args = Array.prototype.slice.call(arguments);
  2235. if (typeof args[0] === 'string') {
  2236. args[0] = 'TUNNEL: ' + args[0];
  2237. } else {
  2238. args.unshift('TUNNEL:');
  2239. }
  2240. console.error.apply(console, args);
  2241. }
  2242. } else {
  2243. debug = function() {};
  2244. }
  2245. exports.debug = debug; // for test
  2246. /***/ }),
  2247. /***/ 143:
  2248. /***/ (function(module, __unusedexports, __webpack_require__) {
  2249. module.exports = withAuthorizationPrefix;
  2250. const atob = __webpack_require__(368);
  2251. const REGEX_IS_BASIC_AUTH = /^[\w-]+:/;
  2252. function withAuthorizationPrefix(authorization) {
  2253. if (/^(basic|bearer|token) /i.test(authorization)) {
  2254. return authorization;
  2255. }
  2256. try {
  2257. if (REGEX_IS_BASIC_AUTH.test(atob(authorization))) {
  2258. return `basic ${authorization}`;
  2259. }
  2260. } catch (error) {}
  2261. if (authorization.split(/\./).length === 3) {
  2262. return `bearer ${authorization}`;
  2263. }
  2264. return `token ${authorization}`;
  2265. }
  2266. /***/ }),
  2267. /***/ 145:
  2268. /***/ (function(module, __unusedexports, __webpack_require__) {
  2269. "use strict";
  2270. const pump = __webpack_require__(453);
  2271. const bufferStream = __webpack_require__(966);
  2272. class MaxBufferError extends Error {
  2273. constructor() {
  2274. super('maxBuffer exceeded');
  2275. this.name = 'MaxBufferError';
  2276. }
  2277. }
  2278. function getStream(inputStream, options) {
  2279. if (!inputStream) {
  2280. return Promise.reject(new Error('Expected a stream'));
  2281. }
  2282. options = Object.assign({maxBuffer: Infinity}, options);
  2283. const {maxBuffer} = options;
  2284. let stream;
  2285. return new Promise((resolve, reject) => {
  2286. const rejectPromise = error => {
  2287. if (error) { // A null check
  2288. error.bufferedData = stream.getBufferedValue();
  2289. }
  2290. reject(error);
  2291. };
  2292. stream = pump(inputStream, bufferStream(options), error => {
  2293. if (error) {
  2294. rejectPromise(error);
  2295. return;
  2296. }
  2297. resolve();
  2298. });
  2299. stream.on('data', () => {
  2300. if (stream.getBufferedLength() > maxBuffer) {
  2301. rejectPromise(new MaxBufferError());
  2302. }
  2303. });
  2304. }).then(() => stream.getBufferedValue());
  2305. }
  2306. module.exports = getStream;
  2307. module.exports.buffer = (stream, options) => getStream(stream, Object.assign({}, options, {encoding: 'buffer'}));
  2308. module.exports.array = (stream, options) => getStream(stream, Object.assign({}, options, {array: true}));
  2309. module.exports.MaxBufferError = MaxBufferError;
  2310. /***/ }),
  2311. /***/ 148:
  2312. /***/ (function(module, __unusedexports, __webpack_require__) {
  2313. module.exports = paginatePlugin;
  2314. const iterator = __webpack_require__(8);
  2315. const paginate = __webpack_require__(807);
  2316. function paginatePlugin(octokit) {
  2317. octokit.paginate = paginate.bind(null, octokit);
  2318. octokit.paginate.iterator = iterator.bind(null, octokit);
  2319. }
  2320. /***/ }),
  2321. /***/ 153:
  2322. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2323. "use strict";
  2324. var __importStar = (this && this.__importStar) || function (mod) {
  2325. if (mod && mod.__esModule) return mod;
  2326. var result = {};
  2327. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2328. result["default"] = mod;
  2329. return result;
  2330. };
  2331. Object.defineProperty(exports, "__esModule", { value: true });
  2332. const coreCommand = __importStar(__webpack_require__(431));
  2333. /**
  2334. * Indicates whether the POST action is running
  2335. */
  2336. exports.IsPost = !!process.env['STATE_isPost'];
  2337. /**
  2338. * The repository path for the POST action. The value is empty during the MAIN action.
  2339. */
  2340. exports.RepositoryPath = process.env['STATE_repositoryPath'] || '';
  2341. /**
  2342. * 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. /***/ 179:
  2388. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2389. "use strict";
  2390. var net = __webpack_require__(631);
  2391. var tls = __webpack_require__(16);
  2392. var http = __webpack_require__(605);
  2393. var https = __webpack_require__(211);
  2394. var events = __webpack_require__(614);
  2395. var assert = __webpack_require__(357);
  2396. var util = __webpack_require__(669);
  2397. exports.httpOverHttp = httpOverHttp;
  2398. exports.httpsOverHttp = httpsOverHttp;
  2399. exports.httpOverHttps = httpOverHttps;
  2400. exports.httpsOverHttps = httpsOverHttps;
  2401. function httpOverHttp(options) {
  2402. var agent = new TunnelingAgent(options);
  2403. agent.request = http.request;
  2404. return agent;
  2405. }
  2406. function httpsOverHttp(options) {
  2407. var agent = new TunnelingAgent(options);
  2408. agent.request = http.request;
  2409. agent.createSocket = createSecureSocket;
  2410. agent.defaultPort = 443;
  2411. return agent;
  2412. }
  2413. function httpOverHttps(options) {
  2414. var agent = new TunnelingAgent(options);
  2415. agent.request = https.request;
  2416. return agent;
  2417. }
  2418. function httpsOverHttps(options) {
  2419. var agent = new TunnelingAgent(options);
  2420. agent.request = https.request;
  2421. agent.createSocket = createSecureSocket;
  2422. agent.defaultPort = 443;
  2423. return agent;
  2424. }
  2425. function TunnelingAgent(options) {
  2426. var self = this;
  2427. self.options = options || {};
  2428. self.proxyOptions = self.options.proxy || {};
  2429. self.maxSockets = self.options.maxSockets || http.Agent.defaultMaxSockets;
  2430. self.requests = [];
  2431. self.sockets = [];
  2432. self.on('free', function onFree(socket, host, port, localAddress) {
  2433. var options = toOptions(host, port, localAddress);
  2434. for (var i = 0, len = self.requests.length; i < len; ++i) {
  2435. var pending = self.requests[i];
  2436. if (pending.host === options.host && pending.port === options.port) {
  2437. // Detect the request to connect same origin server,
  2438. // reuse the connection.
  2439. self.requests.splice(i, 1);
  2440. pending.request.onSocket(socket);
  2441. return;
  2442. }
  2443. }
  2444. socket.destroy();
  2445. self.removeSocket(socket);
  2446. });
  2447. }
  2448. util.inherits(TunnelingAgent, events.EventEmitter);
  2449. TunnelingAgent.prototype.addRequest = function addRequest(req, host, port, localAddress) {
  2450. var self = this;
  2451. var options = mergeOptions({request: req}, self.options, toOptions(host, port, localAddress));
  2452. if (self.sockets.length >= this.maxSockets) {
  2453. // We are over limit so we'll add it to the queue.
  2454. self.requests.push(options);
  2455. return;
  2456. }
  2457. // If we are under maxSockets create a new one.
  2458. self.createSocket(options, function(socket) {
  2459. socket.on('free', onFree);
  2460. socket.on('close', onCloseOrRemove);
  2461. socket.on('agentRemove', onCloseOrRemove);
  2462. req.onSocket(socket);
  2463. function onFree() {
  2464. self.emit('free', socket, options);
  2465. }
  2466. function onCloseOrRemove(err) {
  2467. self.removeSocket(socket);
  2468. socket.removeListener('free', onFree);
  2469. socket.removeListener('close', onCloseOrRemove);
  2470. socket.removeListener('agentRemove', onCloseOrRemove);
  2471. }
  2472. });
  2473. };
  2474. TunnelingAgent.prototype.createSocket = function createSocket(options, cb) {
  2475. var self = this;
  2476. var placeholder = {};
  2477. self.sockets.push(placeholder);
  2478. var connectOptions = mergeOptions({}, self.proxyOptions, {
  2479. method: 'CONNECT',
  2480. path: options.host + ':' + options.port,
  2481. agent: false,
  2482. headers: {
  2483. host: options.host + ':' + options.port
  2484. }
  2485. });
  2486. if (options.localAddress) {
  2487. connectOptions.localAddress = options.localAddress;
  2488. }
  2489. if (connectOptions.proxyAuth) {
  2490. connectOptions.headers = connectOptions.headers || {};
  2491. connectOptions.headers['Proxy-Authorization'] = 'Basic ' +
  2492. new Buffer(connectOptions.proxyAuth).toString('base64');
  2493. }
  2494. debug('making CONNECT request');
  2495. var connectReq = self.request(connectOptions);
  2496. connectReq.useChunkedEncodingByDefault = false; // for v0.6
  2497. connectReq.once('response', onResponse); // for v0.6
  2498. connectReq.once('upgrade', onUpgrade); // for v0.6
  2499. connectReq.once('connect', onConnect); // for v0.7 or later
  2500. connectReq.once('error', onError);
  2501. connectReq.end();
  2502. function onResponse(res) {
  2503. // Very hacky. This is necessary to avoid http-parser leaks.
  2504. res.upgrade = true;
  2505. }
  2506. function onUpgrade(res, socket, head) {
  2507. // Hacky.
  2508. process.nextTick(function() {
  2509. onConnect(res, socket, head);
  2510. });
  2511. }
  2512. function onConnect(res, socket, head) {
  2513. connectReq.removeAllListeners();
  2514. socket.removeAllListeners();
  2515. if (res.statusCode !== 200) {
  2516. debug('tunneling socket could not be established, statusCode=%d',
  2517. res.statusCode);
  2518. socket.destroy();
  2519. var error = new Error('tunneling socket could not be established, ' +
  2520. 'statusCode=' + res.statusCode);
  2521. error.code = 'ECONNRESET';
  2522. options.request.emit('error', error);
  2523. self.removeSocket(placeholder);
  2524. return;
  2525. }
  2526. if (head.length > 0) {
  2527. debug('got illegal response body from proxy');
  2528. socket.destroy();
  2529. var error = new Error('got illegal response body from proxy');
  2530. error.code = 'ECONNRESET';
  2531. options.request.emit('error', error);
  2532. self.removeSocket(placeholder);
  2533. return;
  2534. }
  2535. debug('tunneling connection has established');
  2536. self.sockets[self.sockets.indexOf(placeholder)] = socket;
  2537. return cb(socket);
  2538. }
  2539. function onError(cause) {
  2540. connectReq.removeAllListeners();
  2541. debug('tunneling socket could not be established, cause=%s\n',
  2542. cause.message, cause.stack);
  2543. var error = new Error('tunneling socket could not be established, ' +
  2544. 'cause=' + cause.message);
  2545. error.code = 'ECONNRESET';
  2546. options.request.emit('error', error);
  2547. self.removeSocket(placeholder);
  2548. }
  2549. };
  2550. TunnelingAgent.prototype.removeSocket = function removeSocket(socket) {
  2551. var pos = this.sockets.indexOf(socket)
  2552. if (pos === -1) {
  2553. return;
  2554. }
  2555. this.sockets.splice(pos, 1);
  2556. var pending = this.requests.shift();
  2557. if (pending) {
  2558. // If we have pending requests and a socket gets closed a new one
  2559. // needs to be created to take over in the pool for the one that closed.
  2560. this.createSocket(pending, function(socket) {
  2561. pending.request.onSocket(socket);
  2562. });
  2563. }
  2564. };
  2565. function createSecureSocket(options, cb) {
  2566. var self = this;
  2567. TunnelingAgent.prototype.createSocket.call(self, options, function(socket) {
  2568. var hostHeader = options.request.getHeader('host');
  2569. var tlsOptions = mergeOptions({}, self.options, {
  2570. socket: socket,
  2571. servername: hostHeader ? hostHeader.replace(/:.*$/, '') : options.host
  2572. });
  2573. // 0 is dummy port for v0.6
  2574. var secureSocket = tls.connect(0, tlsOptions);
  2575. self.sockets[self.sockets.indexOf(socket)] = secureSocket;
  2576. cb(secureSocket);
  2577. });
  2578. }
  2579. function toOptions(host, port, localAddress) {
  2580. if (typeof host === 'string') { // since v0.10
  2581. return {
  2582. host: host,
  2583. port: port,
  2584. localAddress: localAddress
  2585. };
  2586. }
  2587. return host; // for v0.11 or later
  2588. }
  2589. function mergeOptions(target) {
  2590. for (var i = 1, len = arguments.length; i < len; ++i) {
  2591. var overrides = arguments[i];
  2592. if (typeof overrides === 'object') {
  2593. var keys = Object.keys(overrides);
  2594. for (var j = 0, keyLen = keys.length; j < keyLen; ++j) {
  2595. var k = keys[j];
  2596. if (overrides[k] !== undefined) {
  2597. target[k] = overrides[k];
  2598. }
  2599. }
  2600. }
  2601. }
  2602. return target;
  2603. }
  2604. var debug;
  2605. if (process.env.NODE_DEBUG && /\btunnel\b/.test(process.env.NODE_DEBUG)) {
  2606. debug = function() {
  2607. var args = Array.prototype.slice.call(arguments);
  2608. if (typeof args[0] === 'string') {
  2609. args[0] = 'TUNNEL: ' + args[0];
  2610. } else {
  2611. args.unshift('TUNNEL:');
  2612. }
  2613. console.error.apply(console, args);
  2614. }
  2615. } else {
  2616. debug = function() {};
  2617. }
  2618. exports.debug = debug; // for test
  2619. /***/ }),
  2620. /***/ 190:
  2621. /***/ (function(module, __unusedexports, __webpack_require__) {
  2622. module.exports = authenticationPlugin;
  2623. const { createTokenAuth } = __webpack_require__(813);
  2624. const { Deprecation } = __webpack_require__(692);
  2625. const once = __webpack_require__(969);
  2626. const beforeRequest = __webpack_require__(863);
  2627. const requestError = __webpack_require__(991);
  2628. const validate = __webpack_require__(954);
  2629. const withAuthorizationPrefix = __webpack_require__(143);
  2630. const deprecateAuthBasic = once((log, deprecation) => log.warn(deprecation));
  2631. const deprecateAuthObject = once((log, deprecation) => log.warn(deprecation));
  2632. function authenticationPlugin(octokit, options) {
  2633. // If `options.authStrategy` is set then use it and pass in `options.auth`
  2634. if (options.authStrategy) {
  2635. const auth = options.authStrategy(options.auth);
  2636. octokit.hook.wrap("request", auth.hook);
  2637. octokit.auth = auth;
  2638. return;
  2639. }
  2640. // If neither `options.authStrategy` nor `options.auth` are set, the `octokit` instance
  2641. // is unauthenticated. The `octokit.auth()` method is a no-op and no request hook is registred.
  2642. if (!options.auth) {
  2643. octokit.auth = () =>
  2644. Promise.resolve({
  2645. type: "unauthenticated"
  2646. });
  2647. return;
  2648. }
  2649. const isBasicAuthString =
  2650. typeof options.auth === "string" &&
  2651. /^basic/.test(withAuthorizationPrefix(options.auth));
  2652. // If only `options.auth` is set to a string, use the default token authentication strategy.
  2653. if (typeof options.auth === "string" && !isBasicAuthString) {
  2654. const auth = createTokenAuth(options.auth);
  2655. octokit.hook.wrap("request", auth.hook);
  2656. octokit.auth = auth;
  2657. return;
  2658. }
  2659. // Otherwise log a deprecation message
  2660. const [deprecationMethod, deprecationMessapge] = isBasicAuthString
  2661. ? [
  2662. deprecateAuthBasic,
  2663. 'Setting the "new Octokit({ auth })" option to a Basic Auth string is deprecated. Use https://github.com/octokit/auth-basic.js instead. See (https://octokit.github.io/rest.js/#authentication)'
  2664. ]
  2665. : [
  2666. deprecateAuthObject,
  2667. 'Setting the "new Octokit({ auth })" option to an object without also setting the "authStrategy" option is deprecated and will be removed in v17. See (https://octokit.github.io/rest.js/#authentication)'
  2668. ];
  2669. deprecationMethod(
  2670. octokit.log,
  2671. new Deprecation("[@octokit/rest] " + deprecationMessapge)
  2672. );
  2673. octokit.auth = () =>
  2674. Promise.resolve({
  2675. type: "deprecated",
  2676. message: deprecationMessapge
  2677. });
  2678. validate(options.auth);
  2679. const state = {
  2680. octokit,
  2681. auth: options.auth
  2682. };
  2683. octokit.hook.before("request", beforeRequest.bind(null, state));
  2684. octokit.hook.error("request", requestError.bind(null, state));
  2685. }
  2686. /***/ }),
  2687. /***/ 197:
  2688. /***/ (function(module, __unusedexports, __webpack_require__) {
  2689. module.exports = isexe
  2690. isexe.sync = sync
  2691. var fs = __webpack_require__(747)
  2692. function isexe (path, options, cb) {
  2693. fs.stat(path, function (er, stat) {
  2694. cb(er, er ? false : checkStat(stat, options))
  2695. })
  2696. }
  2697. function sync (path, options) {
  2698. return checkStat(fs.statSync(path), options)
  2699. }
  2700. function checkStat (stat, options) {
  2701. return stat.isFile() && checkMode(stat, options)
  2702. }
  2703. function checkMode (stat, options) {
  2704. var mod = stat.mode
  2705. var uid = stat.uid
  2706. var gid = stat.gid
  2707. var myUid = options.uid !== undefined ?
  2708. options.uid : process.getuid && process.getuid()
  2709. var myGid = options.gid !== undefined ?
  2710. options.gid : process.getgid && process.getgid()
  2711. var u = parseInt('100', 8)
  2712. var g = parseInt('010', 8)
  2713. var o = parseInt('001', 8)
  2714. var ug = u | g
  2715. var ret = (mod & o) ||
  2716. (mod & g) && gid === myGid ||
  2717. (mod & u) && uid === myUid ||
  2718. (mod & ug) && myUid === 0
  2719. return ret
  2720. }
  2721. /***/ }),
  2722. /***/ 198:
  2723. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  2724. "use strict";
  2725. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2726. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2727. return new (P || (P = Promise))(function (resolve, reject) {
  2728. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2729. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2730. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2731. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2732. });
  2733. };
  2734. var __importStar = (this && this.__importStar) || function (mod) {
  2735. if (mod && mod.__esModule) return mod;
  2736. var result = {};
  2737. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  2738. result["default"] = mod;
  2739. return result;
  2740. };
  2741. Object.defineProperty(exports, "__esModule", { value: true });
  2742. const core = __importStar(__webpack_require__(470));
  2743. const coreCommand = __importStar(__webpack_require__(431));
  2744. const gitSourceProvider = __importStar(__webpack_require__(293));
  2745. const inputHelper = __importStar(__webpack_require__(821));
  2746. const path = __importStar(__webpack_require__(622));
  2747. const stateHelper = __importStar(__webpack_require__(153));
  2748. function run() {
  2749. return __awaiter(this, void 0, void 0, function* () {
  2750. try {
  2751. const sourceSettings = inputHelper.getInputs();
  2752. try {
  2753. // Register problem matcher
  2754. coreCommand.issueCommand('add-matcher', {}, path.join(__dirname, 'problem-matcher.json'));
  2755. // Get sources
  2756. yield gitSourceProvider.getSource(sourceSettings);
  2757. }
  2758. finally {
  2759. // Unregister problem matcher
  2760. coreCommand.issueCommand('remove-matcher', { owner: 'checkout-git' }, '');
  2761. }
  2762. }
  2763. catch (error) {
  2764. core.setFailed(error.message);
  2765. }
  2766. });
  2767. }
  2768. function cleanup() {
  2769. return __awaiter(this, void 0, void 0, function* () {
  2770. try {
  2771. yield gitSourceProvider.cleanup(stateHelper.RepositoryPath);
  2772. }
  2773. catch (error) {
  2774. core.warning(error.message);
  2775. }
  2776. });
  2777. }
  2778. // Main
  2779. if (!stateHelper.IsPost) {
  2780. run();
  2781. }
  2782. // Post
  2783. else {
  2784. cleanup();
  2785. }
  2786. /***/ }),
  2787. /***/ 211:
  2788. /***/ (function(module) {
  2789. module.exports = require("https");
  2790. /***/ }),
  2791. /***/ 215:
  2792. /***/ (function(module) {
  2793. module.exports = {"name":"@octokit/rest","version":"16.38.1","publishConfig":{"access":"public"},"description":"GitHub REST API client for Node.js","keywords":["octokit","github","rest","api-client"],"author":"Gregor Martynus (https://github.com/gr2m)","contributors":[{"name":"Mike de Boer","email":"info@mikedeboer.nl"},{"name":"Fabian Jakobs","email":"fabian@c9.io"},{"name":"Joe Gallo","email":"joe@brassafrax.com"},{"name":"Gregor Martynus","url":"https://github.com/gr2m"}],"repository":"https://github.com/octokit/rest.js","dependencies":{"@octokit/auth-token":"^2.4.0","@octokit/request":"^5.2.0","@octokit/request-error":"^1.0.2","atob-lite":"^2.0.0","before-after-hook":"^2.0.0","btoa-lite":"^1.0.0","deprecation":"^2.0.0","lodash.get":"^4.4.2","lodash.set":"^4.3.2","lodash.uniq":"^4.5.0","octokit-pagination-methods":"^1.1.0","once":"^1.4.0","universal-user-agent":"^4.0.0"},"devDependencies":{"@gimenete/type-writer":"^0.1.3","@octokit/auth":"^1.1.1","@octokit/fixtures-server":"^5.0.6","@octokit/graphql":"^4.2.0","@types/node":"^13.1.0","bundlesize":"^0.18.0","chai":"^4.1.2","compression-webpack-plugin":"^3.1.0","cypress":"^3.0.0","glob":"^7.1.2","http-proxy-agent":"^3.0.0","lodash.camelcase":"^4.3.0","lodash.merge":"^4.6.1","lodash.upperfirst":"^4.3.1","mkdirp":"^0.5.1","mocha":"^6.0.0","mustache":"^4.0.0","nock":"^11.3.3","npm-run-all":"^4.1.2","nyc":"^15.0.0","prettier":"^1.14.2","proxy":"^1.0.0","semantic-release":"^16.0.0","sinon":"^8.0.0","sinon-chai":"^3.0.0","sort-keys":"^4.0.0","string-to-arraybuffer":"^1.0.0","string-to-jsdoc-comment":"^1.0.0","typescript":"^3.3.1","webpack":"^4.0.0","webpack-bundle-analyzer":"^3.0.0","webpack-cli":"^3.0.0"},"types":"index.d.ts","scripts":{"coverage":"nyc report --reporter=html && open coverage/index.html","lint":"prettier --check '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","lint:fix":"prettier --write '{lib,plugins,scripts,test}/**/*.{js,json,ts}' 'docs/*.{js,json}' 'docs/src/**/*' index.js README.md package.json","pretest":"npm run -s lint","test":"nyc mocha test/mocha-node-setup.js \"test/*/**/*-test.js\"","test:browser":"cypress run --browser chrome","build":"npm-run-all build:*","build:ts":"npm run -s update-endpoints:typescript","prebuild:browser":"mkdirp dist/","build:browser":"npm-run-all build:browser:*","build:browser:development":"webpack --mode development --entry . --output-library=Octokit --output=./dist/octokit-rest.js --profile --json > dist/bundle-stats.json","build:browser:production":"webpack --mode production --entry . --plugin=compression-webpack-plugin --output-library=Octokit --output-path=./dist --output-filename=octokit-rest.min.js --devtool source-map","generate-bundle-report":"webpack-bundle-analyzer dist/bundle-stats.json --mode=static --no-open --report dist/bundle-report.html","update-endpoints":"npm-run-all update-endpoints:*","update-endpoints:fetch-json":"node scripts/update-endpoints/fetch-json","update-endpoints:code":"node scripts/update-endpoints/code","update-endpoints:typescript":"node scripts/update-endpoints/typescript","prevalidate:ts":"npm run -s build:ts","validate:ts":"tsc --target es6 --noImplicitAny index.d.ts","postvalidate:ts":"tsc --noEmit --target es6 test/typescript-validate.ts","start-fixtures-server":"octokit-fixtures-server"},"license":"MIT","files":["index.js","index.d.ts","lib","plugins"],"nyc":{"ignore":["test"]},"release":{"publish":["@semantic-release/npm",{"path":"@semantic-release/github","assets":["dist/*","!dist/*.map.gz"]}]},"bundlesize":[{"path":"./dist/octokit-rest.min.js.gz","maxSize":"33 kB"}],"_resolved":"https://registry.npmjs.org/@octokit/rest/-/rest-16.38.1.tgz","_integrity":"sha512-zyNFx+/Bd1EXt7LQjfrc6H4wryBQ/oDuZeZhGMBSFr1eMPFDmpEweFQR3R25zjKwBQpDY7L5GQO6A3XSaOfV1w==","_from":"@octokit/rest@16.38.1"};
  2794. /***/ }),
  2795. /***/ 227:
  2796. /***/ (function(__unusedmodule, exports) {
  2797. "use strict";
  2798. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  2799. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  2800. return new (P || (P = Promise))(function (resolve, reject) {
  2801. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  2802. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  2803. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  2804. step((generator = generator.apply(thisArg, _arguments || [])).next());
  2805. });
  2806. };
  2807. Object.defineProperty(exports, "__esModule", { value: true });
  2808. function getCheckoutInfo(git, ref, commit) {
  2809. return __awaiter(this, void 0, void 0, function* () {
  2810. if (!git) {
  2811. throw new Error('Arg git cannot be empty');
  2812. }
  2813. if (!ref && !commit) {
  2814. throw new Error('Args ref and commit cannot both be empty');
  2815. }
  2816. const result = {};
  2817. const upperRef = (ref || '').toUpperCase();
  2818. // SHA only
  2819. if (!ref) {
  2820. result.ref = commit;
  2821. }
  2822. // refs/heads/
  2823. else if (upperRef.startsWith('REFS/HEADS/')) {
  2824. const branch = ref.substring('refs/heads/'.length);
  2825. result.ref = branch;
  2826. result.startPoint = `refs/remotes/origin/${branch}`;
  2827. }
  2828. // refs/pull/
  2829. else if (upperRef.startsWith('REFS/PULL/')) {
  2830. const branch = ref.substring('refs/pull/'.length);
  2831. result.ref = `refs/remotes/pull/${branch}`;
  2832. }
  2833. // refs/tags/
  2834. else if (upperRef.startsWith('REFS/')) {
  2835. result.ref = ref;
  2836. }
  2837. // Unqualified ref, check for a matching branch or tag
  2838. else {
  2839. if (yield git.branchExists(true, `origin/${ref}`)) {
  2840. result.ref = ref;
  2841. result.startPoint = `refs/remotes/origin/${ref}`;
  2842. }
  2843. else if (yield git.tagExists(`${ref}`)) {
  2844. result.ref = `refs/tags/${ref}`;
  2845. }
  2846. else {
  2847. throw new Error(`A branch or tag with the name '${ref}' could not be found`);
  2848. }
  2849. }
  2850. return result;
  2851. });
  2852. }
  2853. exports.getCheckoutInfo = getCheckoutInfo;
  2854. function getRefSpec(ref, commit) {
  2855. if (!ref && !commit) {
  2856. throw new Error('Args ref and commit cannot both be empty');
  2857. }
  2858. const upperRef = (ref || '').toUpperCase();
  2859. // SHA
  2860. if (commit) {
  2861. // refs/heads
  2862. if (upperRef.startsWith('REFS/HEADS/')) {
  2863. const branch = ref.substring('refs/heads/'.length);
  2864. return [`+${commit}:refs/remotes/origin/${branch}`];
  2865. }
  2866. // refs/pull/
  2867. else if (upperRef.startsWith('REFS/PULL/')) {
  2868. const branch = ref.substring('refs/pull/'.length);
  2869. return [`+${commit}:refs/remotes/pull/${branch}`];
  2870. }
  2871. // refs/tags/
  2872. else if (upperRef.startsWith('REFS/TAGS/')) {
  2873. return [`+${commit}:${ref}`];
  2874. }
  2875. // Otherwise no destination ref
  2876. else {
  2877. return [commit];
  2878. }
  2879. }
  2880. // Unqualified ref, check for a matching branch or tag
  2881. else if (!upperRef.startsWith('REFS/')) {
  2882. return [
  2883. `+refs/heads/${ref}*:refs/remotes/origin/${ref}*`,
  2884. `+refs/tags/${ref}*:refs/tags/${ref}*`
  2885. ];
  2886. }
  2887. // refs/heads/
  2888. else if (upperRef.startsWith('REFS/HEADS/')) {
  2889. const branch = ref.substring('refs/heads/'.length);
  2890. return [`+${ref}:refs/remotes/origin/${branch}`];
  2891. }
  2892. // refs/pull/
  2893. else if (upperRef.startsWith('REFS/PULL/')) {
  2894. const branch = ref.substring('refs/pull/'.length);
  2895. return [`+${ref}:refs/remotes/pull/${branch}`];
  2896. }
  2897. // refs/tags/
  2898. else {
  2899. return [`+${ref}:${ref}`];
  2900. }
  2901. }
  2902. exports.getRefSpec = getRefSpec;
  2903. /***/ }),
  2904. /***/ 248:
  2905. /***/ (function(module, __unusedexports, __webpack_require__) {
  2906. module.exports = octokitRegisterEndpoints;
  2907. const registerEndpoints = __webpack_require__(899);
  2908. function octokitRegisterEndpoints(octokit) {
  2909. octokit.registerEndpoints = registerEndpoints.bind(null, octokit);
  2910. }
  2911. /***/ }),
  2912. /***/ 260:
  2913. /***/ (function(module, __unusedexports, __webpack_require__) {
  2914. // Note: since nyc uses this module to output coverage, any lines
  2915. // that are in the direct sync flow of nyc's outputCoverage are
  2916. // ignored, since we can never get coverage for them.
  2917. var assert = __webpack_require__(357)
  2918. var signals = __webpack_require__(654)
  2919. var EE = __webpack_require__(614)
  2920. /* istanbul ignore if */
  2921. if (typeof EE !== 'function') {
  2922. EE = EE.EventEmitter
  2923. }
  2924. var emitter
  2925. if (process.__signal_exit_emitter__) {
  2926. emitter = process.__signal_exit_emitter__
  2927. } else {
  2928. emitter = process.__signal_exit_emitter__ = new EE()
  2929. emitter.count = 0
  2930. emitter.emitted = {}
  2931. }
  2932. // Because this emitter is a global, we have to check to see if a
  2933. // previous version of this library failed to enable infinite listeners.
  2934. // I know what you're about to say. But literally everything about
  2935. // signal-exit is a compromise with evil. Get used to it.
  2936. if (!emitter.infinite) {
  2937. emitter.setMaxListeners(Infinity)
  2938. emitter.infinite = true
  2939. }
  2940. module.exports = function (cb, opts) {
  2941. assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler')
  2942. if (loaded === false) {
  2943. load()
  2944. }
  2945. var ev = 'exit'
  2946. if (opts && opts.alwaysLast) {
  2947. ev = 'afterexit'
  2948. }
  2949. var remove = function () {
  2950. emitter.removeListener(ev, cb)
  2951. if (emitter.listeners('exit').length === 0 &&
  2952. emitter.listeners('afterexit').length === 0) {
  2953. unload()
  2954. }
  2955. }
  2956. emitter.on(ev, cb)
  2957. return remove
  2958. }
  2959. module.exports.unload = unload
  2960. function unload () {
  2961. if (!loaded) {
  2962. return
  2963. }
  2964. loaded = false
  2965. signals.forEach(function (sig) {
  2966. try {
  2967. process.removeListener(sig, sigListeners[sig])
  2968. } catch (er) {}
  2969. })
  2970. process.emit = originalProcessEmit
  2971. process.reallyExit = originalProcessReallyExit
  2972. emitter.count -= 1
  2973. }
  2974. function emit (event, code, signal) {
  2975. if (emitter.emitted[event]) {
  2976. return
  2977. }
  2978. emitter.emitted[event] = true
  2979. emitter.emit(event, code, signal)
  2980. }
  2981. // { <signal>: <listener fn>, ... }
  2982. var sigListeners = {}
  2983. signals.forEach(function (sig) {
  2984. sigListeners[sig] = function listener () {
  2985. // If there are no other listeners, an exit is coming!
  2986. // Simplest way: remove us and then re-send the signal.
  2987. // We know that this will kill the process, so we can
  2988. // safely emit now.
  2989. var listeners = process.listeners(sig)
  2990. if (listeners.length === emitter.count) {
  2991. unload()
  2992. emit('exit', null, sig)
  2993. /* istanbul ignore next */
  2994. emit('afterexit', null, sig)
  2995. /* istanbul ignore next */
  2996. process.kill(process.pid, sig)
  2997. }
  2998. }
  2999. })
  3000. module.exports.signals = function () {
  3001. return signals
  3002. }
  3003. module.exports.load = load
  3004. var loaded = false
  3005. function load () {
  3006. if (loaded) {
  3007. return
  3008. }
  3009. loaded = true
  3010. // This is the number of onSignalExit's that are in play.
  3011. // It's important so that we can count the correct number of
  3012. // listeners on signals, and don't wait for the other one to
  3013. // handle it instead of us.
  3014. emitter.count += 1
  3015. signals = signals.filter(function (sig) {
  3016. try {
  3017. process.on(sig, sigListeners[sig])
  3018. return true
  3019. } catch (er) {
  3020. return false
  3021. }
  3022. })
  3023. process.emit = processEmit
  3024. process.reallyExit = processReallyExit
  3025. }
  3026. var originalProcessReallyExit = process.reallyExit
  3027. function processReallyExit (code) {
  3028. process.exitCode = code || 0
  3029. emit('exit', process.exitCode, null)
  3030. /* istanbul ignore next */
  3031. emit('afterexit', process.exitCode, null)
  3032. /* istanbul ignore next */
  3033. originalProcessReallyExit.call(process, process.exitCode)
  3034. }
  3035. var originalProcessEmit = process.emit
  3036. function processEmit (ev, arg) {
  3037. if (ev === 'exit') {
  3038. if (arg !== undefined) {
  3039. process.exitCode = arg
  3040. }
  3041. var ret = originalProcessEmit.apply(this, arguments)
  3042. emit('exit', process.exitCode, null)
  3043. /* istanbul ignore next */
  3044. emit('afterexit', process.exitCode, null)
  3045. return ret
  3046. } else {
  3047. return originalProcessEmit.apply(this, arguments)
  3048. }
  3049. }
  3050. /***/ }),
  3051. /***/ 262:
  3052. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  3053. "use strict";
  3054. Object.defineProperty(exports, "__esModule", { value: true });
  3055. const fs_1 = __webpack_require__(747);
  3056. const os_1 = __webpack_require__(87);
  3057. class Context {
  3058. /**
  3059. * Hydrate the context from the environment
  3060. */
  3061. constructor() {
  3062. this.payload = {};
  3063. if (process.env.GITHUB_EVENT_PATH) {
  3064. if (fs_1.existsSync(process.env.GITHUB_EVENT_PATH)) {
  3065. this.payload = JSON.parse(fs_1.readFileSync(process.env.GITHUB_EVENT_PATH, { encoding: 'utf8' }));
  3066. }
  3067. else {
  3068. const path = process.env.GITHUB_EVENT_PATH;
  3069. process.stdout.write(`GITHUB_EVENT_PATH ${path} does not exist${os_1.EOL}`);
  3070. }
  3071. }
  3072. this.eventName = process.env.GITHUB_EVENT_NAME;
  3073. this.sha = process.env.GITHUB_SHA;
  3074. this.ref = process.env.GITHUB_REF;
  3075. this.workflow = process.env.GITHUB_WORKFLOW;
  3076. this.action = process.env.GITHUB_ACTION;
  3077. this.actor = process.env.GITHUB_ACTOR;
  3078. }
  3079. get issue() {
  3080. const payload = this.payload;
  3081. return Object.assign(Object.assign({}, this.repo), { number: (payload.issue || payload.pull_request || payload).number });
  3082. }
  3083. get repo() {
  3084. if (process.env.GITHUB_REPOSITORY) {
  3085. const [owner, repo] = process.env.GITHUB_REPOSITORY.split('/');
  3086. return { owner, repo };
  3087. }
  3088. if (this.payload.repository) {
  3089. return {
  3090. owner: this.payload.repository.owner.login,
  3091. repo: this.payload.repository.name
  3092. };
  3093. }
  3094. throw new Error("context.repo requires a GITHUB_REPOSITORY environment variable like 'owner/repo'");
  3095. }
  3096. }
  3097. exports.Context = Context;
  3098. //# sourceMappingURL=context.js.map
  3099. /***/ }),
  3100. /***/ 265:
  3101. /***/ (function(module, __unusedexports, __webpack_require__) {
  3102. module.exports = getPage
  3103. const deprecate = __webpack_require__(370)
  3104. const getPageLinks = __webpack_require__(577)
  3105. const HttpError = __webpack_require__(297)
  3106. function getPage (octokit, link, which, headers) {
  3107. 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.`)
  3108. const url = getPageLinks(link)[which]
  3109. if (!url) {
  3110. const urlError = new HttpError(`No ${which} page found`, 404)
  3111. return Promise.reject(urlError)
  3112. }
  3113. const requestOptions = {
  3114. url,
  3115. headers: applyAcceptHeader(link, headers)
  3116. }
  3117. const promise = octokit.request(requestOptions)
  3118. return promise
  3119. }
  3120. function applyAcceptHeader (res, headers) {
  3121. const previous = res.headers && res.headers['x-github-media-type']
  3122. if (!previous || (headers && headers.accept)) {
  3123. return headers
  3124. }
  3125. headers = headers || {}
  3126. headers.accept = 'application/vnd.' + previous
  3127. .replace('; param=', '.')
  3128. .replace('; format=', '+')
  3129. return headers
  3130. }
  3131. /***/ }),
  3132. /***/ 280:
  3133. /***/ (function(module, exports) {
  3134. exports = module.exports = SemVer
  3135. var debug
  3136. /* istanbul ignore next */
  3137. if (typeof process === 'object' &&
  3138. process.env &&
  3139. process.env.NODE_DEBUG &&
  3140. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  3141. debug = function () {
  3142. var args = Array.prototype.slice.call(arguments, 0)
  3143. args.unshift('SEMVER')
  3144. console.log.apply(console, args)
  3145. }
  3146. } else {
  3147. debug = function () {}
  3148. }
  3149. // Note: this is the semver.org version of the spec that it implements
  3150. // Not necessarily the package version of this code.
  3151. exports.SEMVER_SPEC_VERSION = '2.0.0'
  3152. var MAX_LENGTH = 256
  3153. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  3154. /* istanbul ignore next */ 9007199254740991
  3155. // Max safe segment length for coercion.
  3156. var MAX_SAFE_COMPONENT_LENGTH = 16
  3157. // The actual regexps go on exports.re
  3158. var re = exports.re = []
  3159. var src = exports.src = []
  3160. var R = 0
  3161. // The following Regular Expressions can be used for tokenizing,
  3162. // validating, and parsing SemVer version strings.
  3163. // ## Numeric Identifier
  3164. // A single `0`, or a non-zero digit followed by zero or more digits.
  3165. var NUMERICIDENTIFIER = R++
  3166. src[NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  3167. var NUMERICIDENTIFIERLOOSE = R++
  3168. src[NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  3169. // ## Non-numeric Identifier
  3170. // Zero or more digits, followed by a letter or hyphen, and then zero or
  3171. // more letters, digits, or hyphens.
  3172. var NONNUMERICIDENTIFIER = R++
  3173. src[NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  3174. // ## Main Version
  3175. // Three dot-separated numeric identifiers.
  3176. var MAINVERSION = R++
  3177. src[MAINVERSION] = '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3178. '(' + src[NUMERICIDENTIFIER] + ')\\.' +
  3179. '(' + src[NUMERICIDENTIFIER] + ')'
  3180. var MAINVERSIONLOOSE = R++
  3181. src[MAINVERSIONLOOSE] = '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3182. '(' + src[NUMERICIDENTIFIERLOOSE] + ')\\.' +
  3183. '(' + src[NUMERICIDENTIFIERLOOSE] + ')'
  3184. // ## Pre-release Version Identifier
  3185. // A numeric identifier, or a non-numeric identifier.
  3186. var PRERELEASEIDENTIFIER = R++
  3187. src[PRERELEASEIDENTIFIER] = '(?:' + src[NUMERICIDENTIFIER] +
  3188. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3189. var PRERELEASEIDENTIFIERLOOSE = R++
  3190. src[PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[NUMERICIDENTIFIERLOOSE] +
  3191. '|' + src[NONNUMERICIDENTIFIER] + ')'
  3192. // ## Pre-release Version
  3193. // Hyphen, followed by one or more dot-separated pre-release version
  3194. // identifiers.
  3195. var PRERELEASE = R++
  3196. src[PRERELEASE] = '(?:-(' + src[PRERELEASEIDENTIFIER] +
  3197. '(?:\\.' + src[PRERELEASEIDENTIFIER] + ')*))'
  3198. var PRERELEASELOOSE = R++
  3199. src[PRERELEASELOOSE] = '(?:-?(' + src[PRERELEASEIDENTIFIERLOOSE] +
  3200. '(?:\\.' + src[PRERELEASEIDENTIFIERLOOSE] + ')*))'
  3201. // ## Build Metadata Identifier
  3202. // Any combination of digits, letters, or hyphens.
  3203. var BUILDIDENTIFIER = R++
  3204. src[BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  3205. // ## Build Metadata
  3206. // Plus sign, followed by one or more period-separated build metadata
  3207. // identifiers.
  3208. var BUILD = R++
  3209. src[BUILD] = '(?:\\+(' + src[BUILDIDENTIFIER] +
  3210. '(?:\\.' + src[BUILDIDENTIFIER] + ')*))'
  3211. // ## Full Version String
  3212. // A main version, followed optionally by a pre-release version and
  3213. // build metadata.
  3214. // Note that the only major, minor, patch, and pre-release sections of
  3215. // the version string are capturing groups. The build metadata is not a
  3216. // capturing group, because it should not ever be used in version
  3217. // comparison.
  3218. var FULL = R++
  3219. var FULLPLAIN = 'v?' + src[MAINVERSION] +
  3220. src[PRERELEASE] + '?' +
  3221. src[BUILD] + '?'
  3222. src[FULL] = '^' + FULLPLAIN + '$'
  3223. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  3224. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  3225. // common in the npm registry.
  3226. var LOOSEPLAIN = '[v=\\s]*' + src[MAINVERSIONLOOSE] +
  3227. src[PRERELEASELOOSE] + '?' +
  3228. src[BUILD] + '?'
  3229. var LOOSE = R++
  3230. src[LOOSE] = '^' + LOOSEPLAIN + '$'
  3231. var GTLT = R++
  3232. src[GTLT] = '((?:<|>)?=?)'
  3233. // Something like "2.*" or "1.2.x".
  3234. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  3235. // Only the first item is strictly required.
  3236. var XRANGEIDENTIFIERLOOSE = R++
  3237. src[XRANGEIDENTIFIERLOOSE] = src[NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  3238. var XRANGEIDENTIFIER = R++
  3239. src[XRANGEIDENTIFIER] = src[NUMERICIDENTIFIER] + '|x|X|\\*'
  3240. var XRANGEPLAIN = R++
  3241. src[XRANGEPLAIN] = '[v=\\s]*(' + src[XRANGEIDENTIFIER] + ')' +
  3242. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3243. '(?:\\.(' + src[XRANGEIDENTIFIER] + ')' +
  3244. '(?:' + src[PRERELEASE] + ')?' +
  3245. src[BUILD] + '?' +
  3246. ')?)?'
  3247. var XRANGEPLAINLOOSE = R++
  3248. src[XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3249. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3250. '(?:\\.(' + src[XRANGEIDENTIFIERLOOSE] + ')' +
  3251. '(?:' + src[PRERELEASELOOSE] + ')?' +
  3252. src[BUILD] + '?' +
  3253. ')?)?'
  3254. var XRANGE = R++
  3255. src[XRANGE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAIN] + '$'
  3256. var XRANGELOOSE = R++
  3257. src[XRANGELOOSE] = '^' + src[GTLT] + '\\s*' + src[XRANGEPLAINLOOSE] + '$'
  3258. // Coercion.
  3259. // Extract anything that could conceivably be a part of a valid semver
  3260. var COERCE = R++
  3261. src[COERCE] = '(?:^|[^\\d])' +
  3262. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  3263. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3264. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  3265. '(?:$|[^\\d])'
  3266. // Tilde ranges.
  3267. // Meaning is "reasonably at or greater than"
  3268. var LONETILDE = R++
  3269. src[LONETILDE] = '(?:~>?)'
  3270. var TILDETRIM = R++
  3271. src[TILDETRIM] = '(\\s*)' + src[LONETILDE] + '\\s+'
  3272. re[TILDETRIM] = new RegExp(src[TILDETRIM], 'g')
  3273. var tildeTrimReplace = '$1~'
  3274. var TILDE = R++
  3275. src[TILDE] = '^' + src[LONETILDE] + src[XRANGEPLAIN] + '$'
  3276. var TILDELOOSE = R++
  3277. src[TILDELOOSE] = '^' + src[LONETILDE] + src[XRANGEPLAINLOOSE] + '$'
  3278. // Caret ranges.
  3279. // Meaning is "at least and backwards compatible with"
  3280. var LONECARET = R++
  3281. src[LONECARET] = '(?:\\^)'
  3282. var CARETTRIM = R++
  3283. src[CARETTRIM] = '(\\s*)' + src[LONECARET] + '\\s+'
  3284. re[CARETTRIM] = new RegExp(src[CARETTRIM], 'g')
  3285. var caretTrimReplace = '$1^'
  3286. var CARET = R++
  3287. src[CARET] = '^' + src[LONECARET] + src[XRANGEPLAIN] + '$'
  3288. var CARETLOOSE = R++
  3289. src[CARETLOOSE] = '^' + src[LONECARET] + src[XRANGEPLAINLOOSE] + '$'
  3290. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  3291. var COMPARATORLOOSE = R++
  3292. src[COMPARATORLOOSE] = '^' + src[GTLT] + '\\s*(' + LOOSEPLAIN + ')$|^$'
  3293. var COMPARATOR = R++
  3294. src[COMPARATOR] = '^' + src[GTLT] + '\\s*(' + FULLPLAIN + ')$|^$'
  3295. // An expression to strip any whitespace between the gtlt and the thing
  3296. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  3297. var COMPARATORTRIM = R++
  3298. src[COMPARATORTRIM] = '(\\s*)' + src[GTLT] +
  3299. '\\s*(' + LOOSEPLAIN + '|' + src[XRANGEPLAIN] + ')'
  3300. // this one has to use the /g flag
  3301. re[COMPARATORTRIM] = new RegExp(src[COMPARATORTRIM], 'g')
  3302. var comparatorTrimReplace = '$1$2$3'
  3303. // Something like `1.2.3 - 1.2.4`
  3304. // Note that these all use the loose form, because they'll be
  3305. // checked against either the strict or loose comparator form
  3306. // later.
  3307. var HYPHENRANGE = R++
  3308. src[HYPHENRANGE] = '^\\s*(' + src[XRANGEPLAIN] + ')' +
  3309. '\\s+-\\s+' +
  3310. '(' + src[XRANGEPLAIN] + ')' +
  3311. '\\s*$'
  3312. var HYPHENRANGELOOSE = R++
  3313. src[HYPHENRANGELOOSE] = '^\\s*(' + src[XRANGEPLAINLOOSE] + ')' +
  3314. '\\s+-\\s+' +
  3315. '(' + src[XRANGEPLAINLOOSE] + ')' +
  3316. '\\s*$'
  3317. // Star ranges basically just allow anything at all.
  3318. var STAR = R++
  3319. src[STAR] = '(<|>)?=?\\s*\\*'
  3320. // Compile to actual regexp objects.
  3321. // All are flag-free, unless they were created above with a flag.
  3322. for (var i = 0; i < R; i++) {
  3323. debug(i, src[i])
  3324. if (!re[i]) {
  3325. re[i] = new RegExp(src[i])
  3326. }
  3327. }
  3328. exports.parse = parse
  3329. function parse (version, options) {
  3330. if (!options || typeof options !== 'object') {
  3331. options = {
  3332. loose: !!options,
  3333. includePrerelease: false
  3334. }
  3335. }
  3336. if (version instanceof SemVer) {
  3337. return version
  3338. }
  3339. if (typeof version !== 'string') {
  3340. return null
  3341. }
  3342. if (version.length > MAX_LENGTH) {
  3343. return null
  3344. }
  3345. var r = options.loose ? re[LOOSE] : re[FULL]
  3346. if (!r.test(version)) {
  3347. return null
  3348. }
  3349. try {
  3350. return new SemVer(version, options)
  3351. } catch (er) {
  3352. return null
  3353. }
  3354. }
  3355. exports.valid = valid
  3356. function valid (version, options) {
  3357. var v = parse(version, options)
  3358. return v ? v.version : null
  3359. }
  3360. exports.clean = clean
  3361. function clean (version, options) {
  3362. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  3363. return s ? s.version : null
  3364. }
  3365. exports.SemVer = SemVer
  3366. function SemVer (version, options) {
  3367. if (!options || typeof options !== 'object') {
  3368. options = {
  3369. loose: !!options,
  3370. includePrerelease: false
  3371. }
  3372. }
  3373. if (version instanceof SemVer) {
  3374. if (version.loose === options.loose) {
  3375. return version
  3376. } else {
  3377. version = version.version
  3378. }
  3379. } else if (typeof version !== 'string') {
  3380. throw new TypeError('Invalid Version: ' + version)
  3381. }
  3382. if (version.length > MAX_LENGTH) {
  3383. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  3384. }
  3385. if (!(this instanceof SemVer)) {
  3386. return new SemVer(version, options)
  3387. }
  3388. debug('SemVer', version, options)
  3389. this.options = options
  3390. this.loose = !!options.loose
  3391. var m = version.trim().match(options.loose ? re[LOOSE] : re[FULL])
  3392. if (!m) {
  3393. throw new TypeError('Invalid Version: ' + version)
  3394. }
  3395. this.raw = version
  3396. // these are actually numbers
  3397. this.major = +m[1]
  3398. this.minor = +m[2]
  3399. this.patch = +m[3]
  3400. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  3401. throw new TypeError('Invalid major version')
  3402. }
  3403. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  3404. throw new TypeError('Invalid minor version')
  3405. }
  3406. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  3407. throw new TypeError('Invalid patch version')
  3408. }
  3409. // numberify any prerelease numeric ids
  3410. if (!m[4]) {
  3411. this.prerelease = []
  3412. } else {
  3413. this.prerelease = m[4].split('.').map(function (id) {
  3414. if (/^[0-9]+$/.test(id)) {
  3415. var num = +id
  3416. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  3417. return num
  3418. }
  3419. }
  3420. return id
  3421. })
  3422. }
  3423. this.build = m[5] ? m[5].split('.') : []
  3424. this.format()
  3425. }
  3426. SemVer.prototype.format = function () {
  3427. this.version = this.major + '.' + this.minor + '.' + this.patch
  3428. if (this.prerelease.length) {
  3429. this.version += '-' + this.prerelease.join('.')
  3430. }
  3431. return this.version
  3432. }
  3433. SemVer.prototype.toString = function () {
  3434. return this.version
  3435. }
  3436. SemVer.prototype.compare = function (other) {
  3437. debug('SemVer.compare', this.version, this.options, other)
  3438. if (!(other instanceof SemVer)) {
  3439. other = new SemVer(other, this.options)
  3440. }
  3441. return this.compareMain(other) || this.comparePre(other)
  3442. }
  3443. SemVer.prototype.compareMain = function (other) {
  3444. if (!(other instanceof SemVer)) {
  3445. other = new SemVer(other, this.options)
  3446. }
  3447. return compareIdentifiers(this.major, other.major) ||
  3448. compareIdentifiers(this.minor, other.minor) ||
  3449. compareIdentifiers(this.patch, other.patch)
  3450. }
  3451. SemVer.prototype.comparePre = function (other) {
  3452. if (!(other instanceof SemVer)) {
  3453. other = new SemVer(other, this.options)
  3454. }
  3455. // NOT having a prerelease is > having one
  3456. if (this.prerelease.length && !other.prerelease.length) {
  3457. return -1
  3458. } else if (!this.prerelease.length && other.prerelease.length) {
  3459. return 1
  3460. } else if (!this.prerelease.length && !other.prerelease.length) {
  3461. return 0
  3462. }
  3463. var i = 0
  3464. do {
  3465. var a = this.prerelease[i]
  3466. var b = other.prerelease[i]
  3467. debug('prerelease compare', i, a, b)
  3468. if (a === undefined && b === undefined) {
  3469. return 0
  3470. } else if (b === undefined) {
  3471. return 1
  3472. } else if (a === undefined) {
  3473. return -1
  3474. } else if (a === b) {
  3475. continue
  3476. } else {
  3477. return compareIdentifiers(a, b)
  3478. }
  3479. } while (++i)
  3480. }
  3481. // preminor will bump the version up to the next minor release, and immediately
  3482. // down to pre-release. premajor and prepatch work the same way.
  3483. SemVer.prototype.inc = function (release, identifier) {
  3484. switch (release) {
  3485. case 'premajor':
  3486. this.prerelease.length = 0
  3487. this.patch = 0
  3488. this.minor = 0
  3489. this.major++
  3490. this.inc('pre', identifier)
  3491. break
  3492. case 'preminor':
  3493. this.prerelease.length = 0
  3494. this.patch = 0
  3495. this.minor++
  3496. this.inc('pre', identifier)
  3497. break
  3498. case 'prepatch':
  3499. // If this is already a prerelease, it will bump to the next version
  3500. // drop any prereleases that might already exist, since they are not
  3501. // relevant at this point.
  3502. this.prerelease.length = 0
  3503. this.inc('patch', identifier)
  3504. this.inc('pre', identifier)
  3505. break
  3506. // If the input is a non-prerelease version, this acts the same as
  3507. // prepatch.
  3508. case 'prerelease':
  3509. if (this.prerelease.length === 0) {
  3510. this.inc('patch', identifier)
  3511. }
  3512. this.inc('pre', identifier)
  3513. break
  3514. case 'major':
  3515. // If this is a pre-major version, bump up to the same major version.
  3516. // Otherwise increment major.
  3517. // 1.0.0-5 bumps to 1.0.0
  3518. // 1.1.0 bumps to 2.0.0
  3519. if (this.minor !== 0 ||
  3520. this.patch !== 0 ||
  3521. this.prerelease.length === 0) {
  3522. this.major++
  3523. }
  3524. this.minor = 0
  3525. this.patch = 0
  3526. this.prerelease = []
  3527. break
  3528. case 'minor':
  3529. // If this is a pre-minor version, bump up to the same minor version.
  3530. // Otherwise increment minor.
  3531. // 1.2.0-5 bumps to 1.2.0
  3532. // 1.2.1 bumps to 1.3.0
  3533. if (this.patch !== 0 || this.prerelease.length === 0) {
  3534. this.minor++
  3535. }
  3536. this.patch = 0
  3537. this.prerelease = []
  3538. break
  3539. case 'patch':
  3540. // If this is not a pre-release version, it will increment the patch.
  3541. // If it is a pre-release it will bump up to the same patch version.
  3542. // 1.2.0-5 patches to 1.2.0
  3543. // 1.2.0 patches to 1.2.1
  3544. if (this.prerelease.length === 0) {
  3545. this.patch++
  3546. }
  3547. this.prerelease = []
  3548. break
  3549. // This probably shouldn't be used publicly.
  3550. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  3551. case 'pre':
  3552. if (this.prerelease.length === 0) {
  3553. this.prerelease = [0]
  3554. } else {
  3555. var i = this.prerelease.length
  3556. while (--i >= 0) {
  3557. if (typeof this.prerelease[i] === 'number') {
  3558. this.prerelease[i]++
  3559. i = -2
  3560. }
  3561. }
  3562. if (i === -1) {
  3563. // didn't increment anything
  3564. this.prerelease.push(0)
  3565. }
  3566. }
  3567. if (identifier) {
  3568. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  3569. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  3570. if (this.prerelease[0] === identifier) {
  3571. if (isNaN(this.prerelease[1])) {
  3572. this.prerelease = [identifier, 0]
  3573. }
  3574. } else {
  3575. this.prerelease = [identifier, 0]
  3576. }
  3577. }
  3578. break
  3579. default:
  3580. throw new Error('invalid increment argument: ' + release)
  3581. }
  3582. this.format()
  3583. this.raw = this.version
  3584. return this
  3585. }
  3586. exports.inc = inc
  3587. function inc (version, release, loose, identifier) {
  3588. if (typeof (loose) === 'string') {
  3589. identifier = loose
  3590. loose = undefined
  3591. }
  3592. try {
  3593. return new SemVer(version, loose).inc(release, identifier).version
  3594. } catch (er) {
  3595. return null
  3596. }
  3597. }
  3598. exports.diff = diff
  3599. function diff (version1, version2) {
  3600. if (eq(version1, version2)) {
  3601. return null
  3602. } else {
  3603. var v1 = parse(version1)
  3604. var v2 = parse(version2)
  3605. var prefix = ''
  3606. if (v1.prerelease.length || v2.prerelease.length) {
  3607. prefix = 'pre'
  3608. var defaultResult = 'prerelease'
  3609. }
  3610. for (var key in v1) {
  3611. if (key === 'major' || key === 'minor' || key === 'patch') {
  3612. if (v1[key] !== v2[key]) {
  3613. return prefix + key
  3614. }
  3615. }
  3616. }
  3617. return defaultResult // may be undefined
  3618. }
  3619. }
  3620. exports.compareIdentifiers = compareIdentifiers
  3621. var numeric = /^[0-9]+$/
  3622. function compareIdentifiers (a, b) {
  3623. var anum = numeric.test(a)
  3624. var bnum = numeric.test(b)
  3625. if (anum && bnum) {
  3626. a = +a
  3627. b = +b
  3628. }
  3629. return a === b ? 0
  3630. : (anum && !bnum) ? -1
  3631. : (bnum && !anum) ? 1
  3632. : a < b ? -1
  3633. : 1
  3634. }
  3635. exports.rcompareIdentifiers = rcompareIdentifiers
  3636. function rcompareIdentifiers (a, b) {
  3637. return compareIdentifiers(b, a)
  3638. }
  3639. exports.major = major
  3640. function major (a, loose) {
  3641. return new SemVer(a, loose).major
  3642. }
  3643. exports.minor = minor
  3644. function minor (a, loose) {
  3645. return new SemVer(a, loose).minor
  3646. }
  3647. exports.patch = patch
  3648. function patch (a, loose) {
  3649. return new SemVer(a, loose).patch
  3650. }
  3651. exports.compare = compare
  3652. function compare (a, b, loose) {
  3653. return new SemVer(a, loose).compare(new SemVer(b, loose))
  3654. }
  3655. exports.compareLoose = compareLoose
  3656. function compareLoose (a, b) {
  3657. return compare(a, b, true)
  3658. }
  3659. exports.rcompare = rcompare
  3660. function rcompare (a, b, loose) {
  3661. return compare(b, a, loose)
  3662. }
  3663. exports.sort = sort
  3664. function sort (list, loose) {
  3665. return list.sort(function (a, b) {
  3666. return exports.compare(a, b, loose)
  3667. })
  3668. }
  3669. exports.rsort = rsort
  3670. function rsort (list, loose) {
  3671. return list.sort(function (a, b) {
  3672. return exports.rcompare(a, b, loose)
  3673. })
  3674. }
  3675. exports.gt = gt
  3676. function gt (a, b, loose) {
  3677. return compare(a, b, loose) > 0
  3678. }
  3679. exports.lt = lt
  3680. function lt (a, b, loose) {
  3681. return compare(a, b, loose) < 0
  3682. }
  3683. exports.eq = eq
  3684. function eq (a, b, loose) {
  3685. return compare(a, b, loose) === 0
  3686. }
  3687. exports.neq = neq
  3688. function neq (a, b, loose) {
  3689. return compare(a, b, loose) !== 0
  3690. }
  3691. exports.gte = gte
  3692. function gte (a, b, loose) {
  3693. return compare(a, b, loose) >= 0
  3694. }
  3695. exports.lte = lte
  3696. function lte (a, b, loose) {
  3697. return compare(a, b, loose) <= 0
  3698. }
  3699. exports.cmp = cmp
  3700. function cmp (a, op, b, loose) {
  3701. switch (op) {
  3702. case '===':
  3703. if (typeof a === 'object')
  3704. a = a.version
  3705. if (typeof b === 'object')
  3706. b = b.version
  3707. return a === b
  3708. case '!==':
  3709. if (typeof a === 'object')
  3710. a = a.version
  3711. if (typeof b === 'object')
  3712. b = b.version
  3713. return a !== b
  3714. case '':
  3715. case '=':
  3716. case '==':
  3717. return eq(a, b, loose)
  3718. case '!=':
  3719. return neq(a, b, loose)
  3720. case '>':
  3721. return gt(a, b, loose)
  3722. case '>=':
  3723. return gte(a, b, loose)
  3724. case '<':
  3725. return lt(a, b, loose)
  3726. case '<=':
  3727. return lte(a, b, loose)
  3728. default:
  3729. throw new TypeError('Invalid operator: ' + op)
  3730. }
  3731. }
  3732. exports.Comparator = Comparator
  3733. function Comparator (comp, options) {
  3734. if (!options || typeof options !== 'object') {
  3735. options = {
  3736. loose: !!options,
  3737. includePrerelease: false
  3738. }
  3739. }
  3740. if (comp instanceof Comparator) {
  3741. if (comp.loose === !!options.loose) {
  3742. return comp
  3743. } else {
  3744. comp = comp.value
  3745. }
  3746. }
  3747. if (!(this instanceof Comparator)) {
  3748. return new Comparator(comp, options)
  3749. }
  3750. debug('comparator', comp, options)
  3751. this.options = options
  3752. this.loose = !!options.loose
  3753. this.parse(comp)
  3754. if (this.semver === ANY) {
  3755. this.value = ''
  3756. } else {
  3757. this.value = this.operator + this.semver.version
  3758. }
  3759. debug('comp', this)
  3760. }
  3761. var ANY = {}
  3762. Comparator.prototype.parse = function (comp) {
  3763. var r = this.options.loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3764. var m = comp.match(r)
  3765. if (!m) {
  3766. throw new TypeError('Invalid comparator: ' + comp)
  3767. }
  3768. this.operator = m[1]
  3769. if (this.operator === '=') {
  3770. this.operator = ''
  3771. }
  3772. // if it literally is just '>' or '' then allow anything.
  3773. if (!m[2]) {
  3774. this.semver = ANY
  3775. } else {
  3776. this.semver = new SemVer(m[2], this.options.loose)
  3777. }
  3778. }
  3779. Comparator.prototype.toString = function () {
  3780. return this.value
  3781. }
  3782. Comparator.prototype.test = function (version) {
  3783. debug('Comparator.test', version, this.options.loose)
  3784. if (this.semver === ANY) {
  3785. return true
  3786. }
  3787. if (typeof version === 'string') {
  3788. version = new SemVer(version, this.options)
  3789. }
  3790. return cmp(version, this.operator, this.semver, this.options)
  3791. }
  3792. Comparator.prototype.intersects = function (comp, options) {
  3793. if (!(comp instanceof Comparator)) {
  3794. throw new TypeError('a Comparator is required')
  3795. }
  3796. if (!options || typeof options !== 'object') {
  3797. options = {
  3798. loose: !!options,
  3799. includePrerelease: false
  3800. }
  3801. }
  3802. var rangeTmp
  3803. if (this.operator === '') {
  3804. rangeTmp = new Range(comp.value, options)
  3805. return satisfies(this.value, rangeTmp, options)
  3806. } else if (comp.operator === '') {
  3807. rangeTmp = new Range(this.value, options)
  3808. return satisfies(comp.semver, rangeTmp, options)
  3809. }
  3810. var sameDirectionIncreasing =
  3811. (this.operator === '>=' || this.operator === '>') &&
  3812. (comp.operator === '>=' || comp.operator === '>')
  3813. var sameDirectionDecreasing =
  3814. (this.operator === '<=' || this.operator === '<') &&
  3815. (comp.operator === '<=' || comp.operator === '<')
  3816. var sameSemVer = this.semver.version === comp.semver.version
  3817. var differentDirectionsInclusive =
  3818. (this.operator === '>=' || this.operator === '<=') &&
  3819. (comp.operator === '>=' || comp.operator === '<=')
  3820. var oppositeDirectionsLessThan =
  3821. cmp(this.semver, '<', comp.semver, options) &&
  3822. ((this.operator === '>=' || this.operator === '>') &&
  3823. (comp.operator === '<=' || comp.operator === '<'))
  3824. var oppositeDirectionsGreaterThan =
  3825. cmp(this.semver, '>', comp.semver, options) &&
  3826. ((this.operator === '<=' || this.operator === '<') &&
  3827. (comp.operator === '>=' || comp.operator === '>'))
  3828. return sameDirectionIncreasing || sameDirectionDecreasing ||
  3829. (sameSemVer && differentDirectionsInclusive) ||
  3830. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  3831. }
  3832. exports.Range = Range
  3833. function Range (range, options) {
  3834. if (!options || typeof options !== 'object') {
  3835. options = {
  3836. loose: !!options,
  3837. includePrerelease: false
  3838. }
  3839. }
  3840. if (range instanceof Range) {
  3841. if (range.loose === !!options.loose &&
  3842. range.includePrerelease === !!options.includePrerelease) {
  3843. return range
  3844. } else {
  3845. return new Range(range.raw, options)
  3846. }
  3847. }
  3848. if (range instanceof Comparator) {
  3849. return new Range(range.value, options)
  3850. }
  3851. if (!(this instanceof Range)) {
  3852. return new Range(range, options)
  3853. }
  3854. this.options = options
  3855. this.loose = !!options.loose
  3856. this.includePrerelease = !!options.includePrerelease
  3857. // First, split based on boolean or ||
  3858. this.raw = range
  3859. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  3860. return this.parseRange(range.trim())
  3861. }, this).filter(function (c) {
  3862. // throw out any that are not relevant for whatever reason
  3863. return c.length
  3864. })
  3865. if (!this.set.length) {
  3866. throw new TypeError('Invalid SemVer Range: ' + range)
  3867. }
  3868. this.format()
  3869. }
  3870. Range.prototype.format = function () {
  3871. this.range = this.set.map(function (comps) {
  3872. return comps.join(' ').trim()
  3873. }).join('||').trim()
  3874. return this.range
  3875. }
  3876. Range.prototype.toString = function () {
  3877. return this.range
  3878. }
  3879. Range.prototype.parseRange = function (range) {
  3880. var loose = this.options.loose
  3881. range = range.trim()
  3882. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  3883. var hr = loose ? re[HYPHENRANGELOOSE] : re[HYPHENRANGE]
  3884. range = range.replace(hr, hyphenReplace)
  3885. debug('hyphen replace', range)
  3886. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  3887. range = range.replace(re[COMPARATORTRIM], comparatorTrimReplace)
  3888. debug('comparator trim', range, re[COMPARATORTRIM])
  3889. // `~ 1.2.3` => `~1.2.3`
  3890. range = range.replace(re[TILDETRIM], tildeTrimReplace)
  3891. // `^ 1.2.3` => `^1.2.3`
  3892. range = range.replace(re[CARETTRIM], caretTrimReplace)
  3893. // normalize spaces
  3894. range = range.split(/\s+/).join(' ')
  3895. // At this point, the range is completely trimmed and
  3896. // ready to be split into comparators.
  3897. var compRe = loose ? re[COMPARATORLOOSE] : re[COMPARATOR]
  3898. var set = range.split(' ').map(function (comp) {
  3899. return parseComparator(comp, this.options)
  3900. }, this).join(' ').split(/\s+/)
  3901. if (this.options.loose) {
  3902. // in loose mode, throw out any that are not valid comparators
  3903. set = set.filter(function (comp) {
  3904. return !!comp.match(compRe)
  3905. })
  3906. }
  3907. set = set.map(function (comp) {
  3908. return new Comparator(comp, this.options)
  3909. }, this)
  3910. return set
  3911. }
  3912. Range.prototype.intersects = function (range, options) {
  3913. if (!(range instanceof Range)) {
  3914. throw new TypeError('a Range is required')
  3915. }
  3916. return this.set.some(function (thisComparators) {
  3917. return thisComparators.every(function (thisComparator) {
  3918. return range.set.some(function (rangeComparators) {
  3919. return rangeComparators.every(function (rangeComparator) {
  3920. return thisComparator.intersects(rangeComparator, options)
  3921. })
  3922. })
  3923. })
  3924. })
  3925. }
  3926. // Mostly just for testing and legacy API reasons
  3927. exports.toComparators = toComparators
  3928. function toComparators (range, options) {
  3929. return new Range(range, options).set.map(function (comp) {
  3930. return comp.map(function (c) {
  3931. return c.value
  3932. }).join(' ').trim().split(' ')
  3933. })
  3934. }
  3935. // comprised of xranges, tildes, stars, and gtlt's at this point.
  3936. // already replaced the hyphen ranges
  3937. // turn into a set of JUST comparators.
  3938. function parseComparator (comp, options) {
  3939. debug('comp', comp, options)
  3940. comp = replaceCarets(comp, options)
  3941. debug('caret', comp)
  3942. comp = replaceTildes(comp, options)
  3943. debug('tildes', comp)
  3944. comp = replaceXRanges(comp, options)
  3945. debug('xrange', comp)
  3946. comp = replaceStars(comp, options)
  3947. debug('stars', comp)
  3948. return comp
  3949. }
  3950. function isX (id) {
  3951. return !id || id.toLowerCase() === 'x' || id === '*'
  3952. }
  3953. // ~, ~> --> * (any, kinda silly)
  3954. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  3955. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  3956. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  3957. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  3958. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  3959. function replaceTildes (comp, options) {
  3960. return comp.trim().split(/\s+/).map(function (comp) {
  3961. return replaceTilde(comp, options)
  3962. }).join(' ')
  3963. }
  3964. function replaceTilde (comp, options) {
  3965. var r = options.loose ? re[TILDELOOSE] : re[TILDE]
  3966. return comp.replace(r, function (_, M, m, p, pr) {
  3967. debug('tilde', comp, _, M, m, p, pr)
  3968. var ret
  3969. if (isX(M)) {
  3970. ret = ''
  3971. } else if (isX(m)) {
  3972. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  3973. } else if (isX(p)) {
  3974. // ~1.2 == >=1.2.0 <1.3.0
  3975. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  3976. } else if (pr) {
  3977. debug('replaceTilde pr', pr)
  3978. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  3979. ' <' + M + '.' + (+m + 1) + '.0'
  3980. } else {
  3981. // ~1.2.3 == >=1.2.3 <1.3.0
  3982. ret = '>=' + M + '.' + m + '.' + p +
  3983. ' <' + M + '.' + (+m + 1) + '.0'
  3984. }
  3985. debug('tilde return', ret)
  3986. return ret
  3987. })
  3988. }
  3989. // ^ --> * (any, kinda silly)
  3990. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  3991. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  3992. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  3993. // ^1.2.3 --> >=1.2.3 <2.0.0
  3994. // ^1.2.0 --> >=1.2.0 <2.0.0
  3995. function replaceCarets (comp, options) {
  3996. return comp.trim().split(/\s+/).map(function (comp) {
  3997. return replaceCaret(comp, options)
  3998. }).join(' ')
  3999. }
  4000. function replaceCaret (comp, options) {
  4001. debug('caret', comp, options)
  4002. var r = options.loose ? re[CARETLOOSE] : re[CARET]
  4003. return comp.replace(r, function (_, M, m, p, pr) {
  4004. debug('caret', comp, _, M, m, p, pr)
  4005. var ret
  4006. if (isX(M)) {
  4007. ret = ''
  4008. } else if (isX(m)) {
  4009. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4010. } else if (isX(p)) {
  4011. if (M === '0') {
  4012. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4013. } else {
  4014. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  4015. }
  4016. } else if (pr) {
  4017. debug('replaceCaret pr', pr)
  4018. if (M === '0') {
  4019. if (m === '0') {
  4020. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4021. ' <' + M + '.' + m + '.' + (+p + 1)
  4022. } else {
  4023. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4024. ' <' + M + '.' + (+m + 1) + '.0'
  4025. }
  4026. } else {
  4027. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  4028. ' <' + (+M + 1) + '.0.0'
  4029. }
  4030. } else {
  4031. debug('no pr')
  4032. if (M === '0') {
  4033. if (m === '0') {
  4034. ret = '>=' + M + '.' + m + '.' + p +
  4035. ' <' + M + '.' + m + '.' + (+p + 1)
  4036. } else {
  4037. ret = '>=' + M + '.' + m + '.' + p +
  4038. ' <' + M + '.' + (+m + 1) + '.0'
  4039. }
  4040. } else {
  4041. ret = '>=' + M + '.' + m + '.' + p +
  4042. ' <' + (+M + 1) + '.0.0'
  4043. }
  4044. }
  4045. debug('caret return', ret)
  4046. return ret
  4047. })
  4048. }
  4049. function replaceXRanges (comp, options) {
  4050. debug('replaceXRanges', comp, options)
  4051. return comp.split(/\s+/).map(function (comp) {
  4052. return replaceXRange(comp, options)
  4053. }).join(' ')
  4054. }
  4055. function replaceXRange (comp, options) {
  4056. comp = comp.trim()
  4057. var r = options.loose ? re[XRANGELOOSE] : re[XRANGE]
  4058. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  4059. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  4060. var xM = isX(M)
  4061. var xm = xM || isX(m)
  4062. var xp = xm || isX(p)
  4063. var anyX = xp
  4064. if (gtlt === '=' && anyX) {
  4065. gtlt = ''
  4066. }
  4067. if (xM) {
  4068. if (gtlt === '>' || gtlt === '<') {
  4069. // nothing is allowed
  4070. ret = '<0.0.0'
  4071. } else {
  4072. // nothing is forbidden
  4073. ret = '*'
  4074. }
  4075. } else if (gtlt && anyX) {
  4076. // we know patch is an x, because we have any x at all.
  4077. // replace X with 0
  4078. if (xm) {
  4079. m = 0
  4080. }
  4081. p = 0
  4082. if (gtlt === '>') {
  4083. // >1 => >=2.0.0
  4084. // >1.2 => >=1.3.0
  4085. // >1.2.3 => >= 1.2.4
  4086. gtlt = '>='
  4087. if (xm) {
  4088. M = +M + 1
  4089. m = 0
  4090. p = 0
  4091. } else {
  4092. m = +m + 1
  4093. p = 0
  4094. }
  4095. } else if (gtlt === '<=') {
  4096. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  4097. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  4098. gtlt = '<'
  4099. if (xm) {
  4100. M = +M + 1
  4101. } else {
  4102. m = +m + 1
  4103. }
  4104. }
  4105. ret = gtlt + M + '.' + m + '.' + p
  4106. } else if (xm) {
  4107. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  4108. } else if (xp) {
  4109. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  4110. }
  4111. debug('xRange return', ret)
  4112. return ret
  4113. })
  4114. }
  4115. // Because * is AND-ed with everything else in the comparator,
  4116. // and '' means "any version", just remove the *s entirely.
  4117. function replaceStars (comp, options) {
  4118. debug('replaceStars', comp, options)
  4119. // Looseness is ignored here. star is always as loose as it gets!
  4120. return comp.trim().replace(re[STAR], '')
  4121. }
  4122. // This function is passed to string.replace(re[HYPHENRANGE])
  4123. // M, m, patch, prerelease, build
  4124. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  4125. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  4126. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  4127. function hyphenReplace ($0,
  4128. from, fM, fm, fp, fpr, fb,
  4129. to, tM, tm, tp, tpr, tb) {
  4130. if (isX(fM)) {
  4131. from = ''
  4132. } else if (isX(fm)) {
  4133. from = '>=' + fM + '.0.0'
  4134. } else if (isX(fp)) {
  4135. from = '>=' + fM + '.' + fm + '.0'
  4136. } else {
  4137. from = '>=' + from
  4138. }
  4139. if (isX(tM)) {
  4140. to = ''
  4141. } else if (isX(tm)) {
  4142. to = '<' + (+tM + 1) + '.0.0'
  4143. } else if (isX(tp)) {
  4144. to = '<' + tM + '.' + (+tm + 1) + '.0'
  4145. } else if (tpr) {
  4146. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  4147. } else {
  4148. to = '<=' + to
  4149. }
  4150. return (from + ' ' + to).trim()
  4151. }
  4152. // if ANY of the sets match ALL of its comparators, then pass
  4153. Range.prototype.test = function (version) {
  4154. if (!version) {
  4155. return false
  4156. }
  4157. if (typeof version === 'string') {
  4158. version = new SemVer(version, this.options)
  4159. }
  4160. for (var i = 0; i < this.set.length; i++) {
  4161. if (testSet(this.set[i], version, this.options)) {
  4162. return true
  4163. }
  4164. }
  4165. return false
  4166. }
  4167. function testSet (set, version, options) {
  4168. for (var i = 0; i < set.length; i++) {
  4169. if (!set[i].test(version)) {
  4170. return false
  4171. }
  4172. }
  4173. if (version.prerelease.length && !options.includePrerelease) {
  4174. // Find the set of versions that are allowed to have prereleases
  4175. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  4176. // That should allow `1.2.3-pr.2` to pass.
  4177. // However, `1.2.4-alpha.notready` should NOT be allowed,
  4178. // even though it's within the range set by the comparators.
  4179. for (i = 0; i < set.length; i++) {
  4180. debug(set[i].semver)
  4181. if (set[i].semver === ANY) {
  4182. continue
  4183. }
  4184. if (set[i].semver.prerelease.length > 0) {
  4185. var allowed = set[i].semver
  4186. if (allowed.major === version.major &&
  4187. allowed.minor === version.minor &&
  4188. allowed.patch === version.patch) {
  4189. return true
  4190. }
  4191. }
  4192. }
  4193. // Version has a -pre, but it's not one of the ones we like.
  4194. return false
  4195. }
  4196. return true
  4197. }
  4198. exports.satisfies = satisfies
  4199. function satisfies (version, range, options) {
  4200. try {
  4201. range = new Range(range, options)
  4202. } catch (er) {
  4203. return false
  4204. }
  4205. return range.test(version)
  4206. }
  4207. exports.maxSatisfying = maxSatisfying
  4208. function maxSatisfying (versions, range, options) {
  4209. var max = null
  4210. var maxSV = null
  4211. try {
  4212. var rangeObj = new Range(range, options)
  4213. } catch (er) {
  4214. return null
  4215. }
  4216. versions.forEach(function (v) {
  4217. if (rangeObj.test(v)) {
  4218. // satisfies(v, range, options)
  4219. if (!max || maxSV.compare(v) === -1) {
  4220. // compare(max, v, true)
  4221. max = v
  4222. maxSV = new SemVer(max, options)
  4223. }
  4224. }
  4225. })
  4226. return max
  4227. }
  4228. exports.minSatisfying = minSatisfying
  4229. function minSatisfying (versions, range, options) {
  4230. var min = null
  4231. var minSV = null
  4232. try {
  4233. var rangeObj = new Range(range, options)
  4234. } catch (er) {
  4235. return null
  4236. }
  4237. versions.forEach(function (v) {
  4238. if (rangeObj.test(v)) {
  4239. // satisfies(v, range, options)
  4240. if (!min || minSV.compare(v) === 1) {
  4241. // compare(min, v, true)
  4242. min = v
  4243. minSV = new SemVer(min, options)
  4244. }
  4245. }
  4246. })
  4247. return min
  4248. }
  4249. exports.minVersion = minVersion
  4250. function minVersion (range, loose) {
  4251. range = new Range(range, loose)
  4252. var minver = new SemVer('0.0.0')
  4253. if (range.test(minver)) {
  4254. return minver
  4255. }
  4256. minver = new SemVer('0.0.0-0')
  4257. if (range.test(minver)) {
  4258. return minver
  4259. }
  4260. minver = null
  4261. for (var i = 0; i < range.set.length; ++i) {
  4262. var comparators = range.set[i]
  4263. comparators.forEach(function (comparator) {
  4264. // Clone to avoid manipulating the comparator's semver object.
  4265. var compver = new SemVer(comparator.semver.version)
  4266. switch (comparator.operator) {
  4267. case '>':
  4268. if (compver.prerelease.length === 0) {
  4269. compver.patch++
  4270. } else {
  4271. compver.prerelease.push(0)
  4272. }
  4273. compver.raw = compver.format()
  4274. /* fallthrough */
  4275. case '':
  4276. case '>=':
  4277. if (!minver || gt(minver, compver)) {
  4278. minver = compver
  4279. }
  4280. break
  4281. case '<':
  4282. case '<=':
  4283. /* Ignore maximum versions */
  4284. break
  4285. /* istanbul ignore next */
  4286. default:
  4287. throw new Error('Unexpected operation: ' + comparator.operator)
  4288. }
  4289. })
  4290. }
  4291. if (minver && range.test(minver)) {
  4292. return minver
  4293. }
  4294. return null
  4295. }
  4296. exports.validRange = validRange
  4297. function validRange (range, options) {
  4298. try {
  4299. // Return '*' instead of '' so that truthiness works.
  4300. // This will throw if it's invalid anyway
  4301. return new Range(range, options).range || '*'
  4302. } catch (er) {
  4303. return null
  4304. }
  4305. }
  4306. // Determine if version is less than all the versions possible in the range
  4307. exports.ltr = ltr
  4308. function ltr (version, range, options) {
  4309. return outside(version, range, '<', options)
  4310. }
  4311. // Determine if version is greater than all the versions possible in the range.
  4312. exports.gtr = gtr
  4313. function gtr (version, range, options) {
  4314. return outside(version, range, '>', options)
  4315. }
  4316. exports.outside = outside
  4317. function outside (version, range, hilo, options) {
  4318. version = new SemVer(version, options)
  4319. range = new Range(range, options)
  4320. var gtfn, ltefn, ltfn, comp, ecomp
  4321. switch (hilo) {
  4322. case '>':
  4323. gtfn = gt
  4324. ltefn = lte
  4325. ltfn = lt
  4326. comp = '>'
  4327. ecomp = '>='
  4328. break
  4329. case '<':
  4330. gtfn = lt
  4331. ltefn = gte
  4332. ltfn = gt
  4333. comp = '<'
  4334. ecomp = '<='
  4335. break
  4336. default:
  4337. throw new TypeError('Must provide a hilo val of "<" or ">"')
  4338. }
  4339. // If it satisifes the range it is not outside
  4340. if (satisfies(version, range, options)) {
  4341. return false
  4342. }
  4343. // From now on, variable terms are as if we're in "gtr" mode.
  4344. // but note that everything is flipped for the "ltr" function.
  4345. for (var i = 0; i < range.set.length; ++i) {
  4346. var comparators = range.set[i]
  4347. var high = null
  4348. var low = null
  4349. comparators.forEach(function (comparator) {
  4350. if (comparator.semver === ANY) {
  4351. comparator = new Comparator('>=0.0.0')
  4352. }
  4353. high = high || comparator
  4354. low = low || comparator
  4355. if (gtfn(comparator.semver, high.semver, options)) {
  4356. high = comparator
  4357. } else if (ltfn(comparator.semver, low.semver, options)) {
  4358. low = comparator
  4359. }
  4360. })
  4361. // If the edge version comparator has a operator then our version
  4362. // isn't outside it
  4363. if (high.operator === comp || high.operator === ecomp) {
  4364. return false
  4365. }
  4366. // If the lowest version comparator has an operator and our version
  4367. // is less than it then it isn't higher than the range
  4368. if ((!low.operator || low.operator === comp) &&
  4369. ltefn(version, low.semver)) {
  4370. return false
  4371. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  4372. return false
  4373. }
  4374. }
  4375. return true
  4376. }
  4377. exports.prerelease = prerelease
  4378. function prerelease (version, options) {
  4379. var parsed = parse(version, options)
  4380. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  4381. }
  4382. exports.intersects = intersects
  4383. function intersects (r1, r2, options) {
  4384. r1 = new Range(r1, options)
  4385. r2 = new Range(r2, options)
  4386. return r1.intersects(r2)
  4387. }
  4388. exports.coerce = coerce
  4389. function coerce (version) {
  4390. if (version instanceof SemVer) {
  4391. return version
  4392. }
  4393. if (typeof version !== 'string') {
  4394. return null
  4395. }
  4396. var match = version.match(re[COERCE])
  4397. if (match == null) {
  4398. return null
  4399. }
  4400. return parse(match[1] +
  4401. '.' + (match[2] || '0') +
  4402. '.' + (match[3] || '0'))
  4403. }
  4404. /***/ }),
  4405. /***/ 287:
  4406. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4407. "use strict";
  4408. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4409. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4410. return new (P || (P = Promise))(function (resolve, reject) {
  4411. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4412. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4413. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4414. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4415. });
  4416. };
  4417. var __importStar = (this && this.__importStar) || function (mod) {
  4418. if (mod && mod.__esModule) return mod;
  4419. var result = {};
  4420. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4421. result["default"] = mod;
  4422. return result;
  4423. };
  4424. var __importDefault = (this && this.__importDefault) || function (mod) {
  4425. return (mod && mod.__esModule) ? mod : { "default": mod };
  4426. };
  4427. Object.defineProperty(exports, "__esModule", { value: true });
  4428. const assert = __importStar(__webpack_require__(357));
  4429. const core = __importStar(__webpack_require__(470));
  4430. const fs = __importStar(__webpack_require__(747));
  4431. const io = __importStar(__webpack_require__(1));
  4432. const os = __importStar(__webpack_require__(87));
  4433. const path = __importStar(__webpack_require__(622));
  4434. const regexpHelper = __importStar(__webpack_require__(528));
  4435. const v4_1 = __importDefault(__webpack_require__(826));
  4436. const IS_WINDOWS = process.platform === 'win32';
  4437. const HOSTNAME = 'github.com';
  4438. function createAuthHelper(git, settings) {
  4439. return new GitAuthHelper(git, settings);
  4440. }
  4441. exports.createAuthHelper = createAuthHelper;
  4442. class GitAuthHelper {
  4443. constructor(gitCommandManager, gitSourceSettings) {
  4444. this.tokenConfigKey = `http.https://${HOSTNAME}/.extraheader`;
  4445. this.temporaryHomePath = '';
  4446. this.git = gitCommandManager;
  4447. this.settings = gitSourceSettings || {};
  4448. // Token auth header
  4449. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4450. core.setSecret(basicCredential);
  4451. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4452. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4453. }
  4454. configureAuth() {
  4455. return __awaiter(this, void 0, void 0, function* () {
  4456. // Remove possible previous values
  4457. yield this.removeAuth();
  4458. // Configure new values
  4459. yield this.configureToken();
  4460. });
  4461. }
  4462. configureGlobalAuth() {
  4463. return __awaiter(this, void 0, void 0, function* () {
  4464. // Create a temp home directory
  4465. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4466. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4467. const uniqueId = v4_1.default();
  4468. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4469. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4470. // Copy the global git config
  4471. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4472. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4473. let configExists = false;
  4474. try {
  4475. yield fs.promises.stat(gitConfigPath);
  4476. configExists = true;
  4477. }
  4478. catch (err) {
  4479. if (err.code !== 'ENOENT') {
  4480. throw err;
  4481. }
  4482. }
  4483. if (configExists) {
  4484. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4485. yield io.cp(gitConfigPath, newGitConfigPath);
  4486. }
  4487. else {
  4488. yield fs.promises.writeFile(newGitConfigPath, '');
  4489. }
  4490. // Configure the token
  4491. try {
  4492. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4493. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4494. yield this.configureToken(newGitConfigPath, true);
  4495. }
  4496. catch (err) {
  4497. // Unset in case somehow written to the real global config
  4498. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4499. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4500. throw err;
  4501. }
  4502. });
  4503. }
  4504. configureSubmoduleAuth() {
  4505. return __awaiter(this, void 0, void 0, function* () {
  4506. if (this.settings.persistCredentials) {
  4507. // Configure a placeholder value. This approach avoids the credential being captured
  4508. // by process creation audit events, which are commonly logged. For more information,
  4509. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4510. const output = yield this.git.submoduleForeach(`git config "${this.tokenConfigKey}" "${this.tokenPlaceholderConfigValue}" && git config --local --show-origin --name-only --get-regexp remote.origin.url`, this.settings.nestedSubmodules);
  4511. // Replace the placeholder
  4512. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4513. for (const configPath of configPaths) {
  4514. core.debug(`Replacing token placeholder in '${configPath}'`);
  4515. this.replaceTokenPlaceholder(configPath);
  4516. }
  4517. }
  4518. });
  4519. }
  4520. removeAuth() {
  4521. return __awaiter(this, void 0, void 0, function* () {
  4522. yield this.removeToken();
  4523. });
  4524. }
  4525. removeGlobalAuth() {
  4526. return __awaiter(this, void 0, void 0, function* () {
  4527. core.info(`Unsetting HOME override`);
  4528. this.git.removeEnvironmentVariable('HOME');
  4529. yield io.rmRF(this.temporaryHomePath);
  4530. });
  4531. }
  4532. configureToken(configPath, globalConfig) {
  4533. return __awaiter(this, void 0, void 0, function* () {
  4534. // Validate args
  4535. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4536. // Default config path
  4537. if (!configPath && !globalConfig) {
  4538. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4539. }
  4540. // Configure a placeholder value. This approach avoids the credential being captured
  4541. // by process creation audit events, which are commonly logged. For more information,
  4542. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4543. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4544. // Replace the placeholder
  4545. yield this.replaceTokenPlaceholder(configPath || '');
  4546. });
  4547. }
  4548. replaceTokenPlaceholder(configPath) {
  4549. return __awaiter(this, void 0, void 0, function* () {
  4550. assert.ok(configPath, 'configPath is not defined');
  4551. let content = (yield fs.promises.readFile(configPath)).toString();
  4552. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4553. if (placeholderIndex < 0 ||
  4554. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4555. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4556. }
  4557. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4558. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4559. yield fs.promises.writeFile(configPath, content);
  4560. });
  4561. }
  4562. removeToken() {
  4563. return __awaiter(this, void 0, void 0, function* () {
  4564. // HTTP extra header
  4565. yield this.removeGitConfig(this.tokenConfigKey);
  4566. });
  4567. }
  4568. removeGitConfig(configKey) {
  4569. return __awaiter(this, void 0, void 0, function* () {
  4570. if ((yield this.git.configExists(configKey)) &&
  4571. !(yield this.git.tryConfigUnset(configKey))) {
  4572. // Load the config contents
  4573. core.warning(`Failed to remove '${configKey}' from the git config`);
  4574. }
  4575. const pattern = regexpHelper.escape(configKey);
  4576. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp ${pattern} && git config --local --unset-all ${configKey} || :`, true);
  4577. });
  4578. }
  4579. }
  4580. /***/ }),
  4581. /***/ 289:
  4582. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4583. "use strict";
  4584. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4585. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4586. return new (P || (P = Promise))(function (resolve, reject) {
  4587. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4588. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4589. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4590. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4591. });
  4592. };
  4593. var __importStar = (this && this.__importStar) || function (mod) {
  4594. if (mod && mod.__esModule) return mod;
  4595. var result = {};
  4596. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4597. result["default"] = mod;
  4598. return result;
  4599. };
  4600. Object.defineProperty(exports, "__esModule", { value: true });
  4601. const core = __importStar(__webpack_require__(470));
  4602. const exec = __importStar(__webpack_require__(986));
  4603. const fshelper = __importStar(__webpack_require__(618));
  4604. const io = __importStar(__webpack_require__(1));
  4605. const path = __importStar(__webpack_require__(622));
  4606. const regexpHelper = __importStar(__webpack_require__(528));
  4607. const retryHelper = __importStar(__webpack_require__(587));
  4608. const git_version_1 = __webpack_require__(559);
  4609. // Auth header not supported before 2.9
  4610. // Wire protocol v2 not supported before 2.18
  4611. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4612. function createCommandManager(workingDirectory, lfs) {
  4613. return __awaiter(this, void 0, void 0, function* () {
  4614. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4615. });
  4616. }
  4617. exports.createCommandManager = createCommandManager;
  4618. class GitCommandManager {
  4619. // Private constructor; use createCommandManager()
  4620. constructor() {
  4621. this.gitEnv = {
  4622. GIT_TERMINAL_PROMPT: '0',
  4623. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4624. };
  4625. this.gitPath = '';
  4626. this.lfs = false;
  4627. this.workingDirectory = '';
  4628. }
  4629. branchDelete(remote, branch) {
  4630. return __awaiter(this, void 0, void 0, function* () {
  4631. const args = ['branch', '--delete', '--force'];
  4632. if (remote) {
  4633. args.push('--remote');
  4634. }
  4635. args.push(branch);
  4636. yield this.execGit(args);
  4637. });
  4638. }
  4639. branchExists(remote, pattern) {
  4640. return __awaiter(this, void 0, void 0, function* () {
  4641. const args = ['branch', '--list'];
  4642. if (remote) {
  4643. args.push('--remote');
  4644. }
  4645. args.push(pattern);
  4646. const output = yield this.execGit(args);
  4647. return !!output.stdout.trim();
  4648. });
  4649. }
  4650. branchList(remote) {
  4651. return __awaiter(this, void 0, void 0, function* () {
  4652. const result = [];
  4653. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4654. // "branch --list" is more difficult when in a detached HEAD state.
  4655. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4656. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4657. const args = ['rev-parse', '--symbolic-full-name'];
  4658. if (remote) {
  4659. args.push('--remotes=origin');
  4660. }
  4661. else {
  4662. args.push('--branches');
  4663. }
  4664. const output = yield this.execGit(args);
  4665. for (let branch of output.stdout.trim().split('\n')) {
  4666. branch = branch.trim();
  4667. if (branch) {
  4668. if (branch.startsWith('refs/heads/')) {
  4669. branch = branch.substr('refs/heads/'.length);
  4670. }
  4671. else if (branch.startsWith('refs/remotes/')) {
  4672. branch = branch.substr('refs/remotes/'.length);
  4673. }
  4674. result.push(branch);
  4675. }
  4676. }
  4677. return result;
  4678. });
  4679. }
  4680. checkout(ref, startPoint) {
  4681. return __awaiter(this, void 0, void 0, function* () {
  4682. const args = ['checkout', '--progress', '--force'];
  4683. if (startPoint) {
  4684. args.push('-B', ref, startPoint);
  4685. }
  4686. else {
  4687. args.push(ref);
  4688. }
  4689. yield this.execGit(args);
  4690. });
  4691. }
  4692. checkoutDetach() {
  4693. return __awaiter(this, void 0, void 0, function* () {
  4694. const args = ['checkout', '--detach'];
  4695. yield this.execGit(args);
  4696. });
  4697. }
  4698. config(configKey, configValue, globalConfig) {
  4699. return __awaiter(this, void 0, void 0, function* () {
  4700. yield this.execGit([
  4701. 'config',
  4702. globalConfig ? '--global' : '--local',
  4703. configKey,
  4704. configValue
  4705. ]);
  4706. });
  4707. }
  4708. configExists(configKey, globalConfig) {
  4709. return __awaiter(this, void 0, void 0, function* () {
  4710. const pattern = regexpHelper.escape(configKey);
  4711. const output = yield this.execGit([
  4712. 'config',
  4713. globalConfig ? '--global' : '--local',
  4714. '--name-only',
  4715. '--get-regexp',
  4716. pattern
  4717. ], true);
  4718. return output.exitCode === 0;
  4719. });
  4720. }
  4721. fetch(fetchDepth, refSpec) {
  4722. return __awaiter(this, void 0, void 0, function* () {
  4723. const args = [
  4724. '-c',
  4725. 'protocol.version=2',
  4726. 'fetch',
  4727. '--no-tags',
  4728. '--prune',
  4729. '--progress',
  4730. '--no-recurse-submodules'
  4731. ];
  4732. if (fetchDepth > 0) {
  4733. args.push(`--depth=${fetchDepth}`);
  4734. }
  4735. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4736. args.push('--unshallow');
  4737. }
  4738. args.push('origin');
  4739. for (const arg of refSpec) {
  4740. args.push(arg);
  4741. }
  4742. const that = this;
  4743. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4744. yield that.execGit(args);
  4745. }));
  4746. });
  4747. }
  4748. getWorkingDirectory() {
  4749. return this.workingDirectory;
  4750. }
  4751. init() {
  4752. return __awaiter(this, void 0, void 0, function* () {
  4753. yield this.execGit(['init', this.workingDirectory]);
  4754. });
  4755. }
  4756. isDetached() {
  4757. return __awaiter(this, void 0, void 0, function* () {
  4758. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  4759. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  4760. return !output.stdout.trim().startsWith('refs/heads/');
  4761. });
  4762. }
  4763. lfsFetch(ref) {
  4764. return __awaiter(this, void 0, void 0, function* () {
  4765. const args = ['lfs', 'fetch', 'origin', ref];
  4766. const that = this;
  4767. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4768. yield that.execGit(args);
  4769. }));
  4770. });
  4771. }
  4772. lfsInstall() {
  4773. return __awaiter(this, void 0, void 0, function* () {
  4774. yield this.execGit(['lfs', 'install', '--local']);
  4775. });
  4776. }
  4777. log1() {
  4778. return __awaiter(this, void 0, void 0, function* () {
  4779. yield this.execGit(['log', '-1']);
  4780. });
  4781. }
  4782. remoteAdd(remoteName, remoteUrl) {
  4783. return __awaiter(this, void 0, void 0, function* () {
  4784. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4785. });
  4786. }
  4787. removeEnvironmentVariable(name) {
  4788. delete this.gitEnv[name];
  4789. }
  4790. setEnvironmentVariable(name, value) {
  4791. this.gitEnv[name] = value;
  4792. }
  4793. submoduleForeach(command, recursive) {
  4794. return __awaiter(this, void 0, void 0, function* () {
  4795. const args = ['submodule', 'foreach'];
  4796. if (recursive) {
  4797. args.push('--recursive');
  4798. }
  4799. args.push(command);
  4800. const output = yield this.execGit(args);
  4801. return output.stdout;
  4802. });
  4803. }
  4804. submoduleSync(recursive) {
  4805. return __awaiter(this, void 0, void 0, function* () {
  4806. const args = ['submodule', 'sync'];
  4807. if (recursive) {
  4808. args.push('--recursive');
  4809. }
  4810. yield this.execGit(args);
  4811. });
  4812. }
  4813. submoduleUpdate(fetchDepth, recursive) {
  4814. return __awaiter(this, void 0, void 0, function* () {
  4815. const args = ['-c', 'protocol.version=2'];
  4816. args.push('submodule', 'update', '--init', '--force');
  4817. if (fetchDepth > 0) {
  4818. args.push(`--depth=${fetchDepth}`);
  4819. }
  4820. if (recursive) {
  4821. args.push('--recursive');
  4822. }
  4823. yield this.execGit(args);
  4824. });
  4825. }
  4826. tagExists(pattern) {
  4827. return __awaiter(this, void 0, void 0, function* () {
  4828. const output = yield this.execGit(['tag', '--list', pattern]);
  4829. return !!output.stdout.trim();
  4830. });
  4831. }
  4832. tryClean() {
  4833. return __awaiter(this, void 0, void 0, function* () {
  4834. const output = yield this.execGit(['clean', '-ffdx'], true);
  4835. return output.exitCode === 0;
  4836. });
  4837. }
  4838. tryConfigUnset(configKey, globalConfig) {
  4839. return __awaiter(this, void 0, void 0, function* () {
  4840. const output = yield this.execGit([
  4841. 'config',
  4842. globalConfig ? '--global' : '--local',
  4843. '--unset-all',
  4844. configKey
  4845. ], true);
  4846. return output.exitCode === 0;
  4847. });
  4848. }
  4849. tryDisableAutomaticGarbageCollection() {
  4850. return __awaiter(this, void 0, void 0, function* () {
  4851. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  4852. return output.exitCode === 0;
  4853. });
  4854. }
  4855. tryGetFetchUrl() {
  4856. return __awaiter(this, void 0, void 0, function* () {
  4857. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  4858. if (output.exitCode !== 0) {
  4859. return '';
  4860. }
  4861. const stdout = output.stdout.trim();
  4862. if (stdout.includes('\n')) {
  4863. return '';
  4864. }
  4865. return stdout;
  4866. });
  4867. }
  4868. tryReset() {
  4869. return __awaiter(this, void 0, void 0, function* () {
  4870. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4871. return output.exitCode === 0;
  4872. });
  4873. }
  4874. static createCommandManager(workingDirectory, lfs) {
  4875. return __awaiter(this, void 0, void 0, function* () {
  4876. const result = new GitCommandManager();
  4877. yield result.initializeCommandManager(workingDirectory, lfs);
  4878. return result;
  4879. });
  4880. }
  4881. execGit(args, allowAllExitCodes = false) {
  4882. return __awaiter(this, void 0, void 0, function* () {
  4883. fshelper.directoryExistsSync(this.workingDirectory, true);
  4884. const result = new GitOutput();
  4885. const env = {};
  4886. for (const key of Object.keys(process.env)) {
  4887. env[key] = process.env[key];
  4888. }
  4889. for (const key of Object.keys(this.gitEnv)) {
  4890. env[key] = this.gitEnv[key];
  4891. }
  4892. const stdout = [];
  4893. const options = {
  4894. cwd: this.workingDirectory,
  4895. env,
  4896. ignoreReturnCode: allowAllExitCodes,
  4897. listeners: {
  4898. stdout: (data) => {
  4899. stdout.push(data.toString());
  4900. }
  4901. }
  4902. };
  4903. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4904. result.stdout = stdout.join('');
  4905. return result;
  4906. });
  4907. }
  4908. initializeCommandManager(workingDirectory, lfs) {
  4909. return __awaiter(this, void 0, void 0, function* () {
  4910. this.workingDirectory = workingDirectory;
  4911. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4912. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4913. this.lfs = lfs;
  4914. if (!this.lfs) {
  4915. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4916. }
  4917. this.gitPath = yield io.which('git', true);
  4918. // Git version
  4919. core.debug('Getting git version');
  4920. let gitVersion = new git_version_1.GitVersion();
  4921. let gitOutput = yield this.execGit(['version']);
  4922. let stdout = gitOutput.stdout.trim();
  4923. if (!stdout.includes('\n')) {
  4924. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4925. if (match) {
  4926. gitVersion = new git_version_1.GitVersion(match[0]);
  4927. }
  4928. }
  4929. if (!gitVersion.isValid()) {
  4930. throw new Error('Unable to determine git version');
  4931. }
  4932. // Minimum git version
  4933. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  4934. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4935. }
  4936. if (this.lfs) {
  4937. // Git-lfs version
  4938. core.debug('Getting git-lfs version');
  4939. let gitLfsVersion = new git_version_1.GitVersion();
  4940. const gitLfsPath = yield io.which('git-lfs', true);
  4941. gitOutput = yield this.execGit(['lfs', 'version']);
  4942. stdout = gitOutput.stdout.trim();
  4943. if (!stdout.includes('\n')) {
  4944. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4945. if (match) {
  4946. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4947. }
  4948. }
  4949. if (!gitLfsVersion.isValid()) {
  4950. throw new Error('Unable to determine git-lfs version');
  4951. }
  4952. // Minimum git-lfs version
  4953. // Note:
  4954. // - Auth header not supported before 2.1
  4955. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4956. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4957. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4958. }
  4959. }
  4960. // Set the user agent
  4961. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4962. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4963. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4964. });
  4965. }
  4966. }
  4967. class GitOutput {
  4968. constructor() {
  4969. this.stdout = '';
  4970. this.exitCode = 0;
  4971. }
  4972. }
  4973. /***/ }),
  4974. /***/ 293:
  4975. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4976. "use strict";
  4977. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4978. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4979. return new (P || (P = Promise))(function (resolve, reject) {
  4980. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4981. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4982. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4983. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4984. });
  4985. };
  4986. var __importStar = (this && this.__importStar) || function (mod) {
  4987. if (mod && mod.__esModule) return mod;
  4988. var result = {};
  4989. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4990. result["default"] = mod;
  4991. return result;
  4992. };
  4993. Object.defineProperty(exports, "__esModule", { value: true });
  4994. const core = __importStar(__webpack_require__(470));
  4995. const fsHelper = __importStar(__webpack_require__(618));
  4996. const gitAuthHelper = __importStar(__webpack_require__(287));
  4997. const gitCommandManager = __importStar(__webpack_require__(289));
  4998. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  4999. const githubApiHelper = __importStar(__webpack_require__(464));
  5000. const io = __importStar(__webpack_require__(1));
  5001. const path = __importStar(__webpack_require__(622));
  5002. const refHelper = __importStar(__webpack_require__(227));
  5003. const stateHelper = __importStar(__webpack_require__(153));
  5004. const hostname = 'github.com';
  5005. function getSource(settings) {
  5006. return __awaiter(this, void 0, void 0, function* () {
  5007. // Repository URL
  5008. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5009. const repositoryUrl = `https://${hostname}/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  5010. // Remove conflicting file path
  5011. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5012. yield io.rmRF(settings.repositoryPath);
  5013. }
  5014. // Create directory
  5015. let isExisting = true;
  5016. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5017. isExisting = false;
  5018. yield io.mkdirP(settings.repositoryPath);
  5019. }
  5020. // Git command manager
  5021. const git = yield getGitCommandManager(settings);
  5022. // Prepare existing directory, otherwise recreate
  5023. if (isExisting) {
  5024. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  5025. }
  5026. if (!git) {
  5027. // Downloading using REST API
  5028. core.info(`The repository will be downloaded using the GitHub REST API`);
  5029. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5030. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5031. return;
  5032. }
  5033. // Save state for POST action
  5034. stateHelper.setRepositoryPath(settings.repositoryPath);
  5035. // Initialize the repository
  5036. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5037. yield git.init();
  5038. yield git.remoteAdd('origin', repositoryUrl);
  5039. }
  5040. // Disable automatic garbage collection
  5041. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5042. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5043. }
  5044. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5045. try {
  5046. // Configure auth
  5047. yield authHelper.configureAuth();
  5048. // LFS install
  5049. if (settings.lfs) {
  5050. yield git.lfsInstall();
  5051. }
  5052. // Fetch
  5053. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5054. yield git.fetch(settings.fetchDepth, refSpec);
  5055. // Checkout info
  5056. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5057. // LFS fetch
  5058. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5059. // Explicit lfs fetch will fetch lfs objects in parallel.
  5060. if (settings.lfs) {
  5061. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5062. }
  5063. // Checkout
  5064. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5065. // Submodules
  5066. if (settings.submodules) {
  5067. try {
  5068. // Temporarily override global config
  5069. yield authHelper.configureGlobalAuth();
  5070. // Checkout submodules
  5071. yield git.submoduleSync(settings.nestedSubmodules);
  5072. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5073. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5074. // Persist credentials
  5075. if (settings.persistCredentials) {
  5076. yield authHelper.configureSubmoduleAuth();
  5077. }
  5078. }
  5079. finally {
  5080. // Remove temporary global config override
  5081. yield authHelper.removeGlobalAuth();
  5082. }
  5083. }
  5084. // Dump some info about the checked out commit
  5085. yield git.log1();
  5086. }
  5087. finally {
  5088. // Remove auth
  5089. if (!settings.persistCredentials) {
  5090. yield authHelper.removeAuth();
  5091. }
  5092. }
  5093. });
  5094. }
  5095. exports.getSource = getSource;
  5096. function cleanup(repositoryPath) {
  5097. return __awaiter(this, void 0, void 0, function* () {
  5098. // Repo exists?
  5099. if (!repositoryPath ||
  5100. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5101. return;
  5102. }
  5103. let git;
  5104. try {
  5105. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5106. }
  5107. catch (_a) {
  5108. return;
  5109. }
  5110. // Remove auth
  5111. const authHelper = gitAuthHelper.createAuthHelper(git);
  5112. yield authHelper.removeAuth();
  5113. });
  5114. }
  5115. exports.cleanup = cleanup;
  5116. function getGitCommandManager(settings) {
  5117. return __awaiter(this, void 0, void 0, function* () {
  5118. core.info(`Working directory is '${settings.repositoryPath}'`);
  5119. try {
  5120. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5121. }
  5122. catch (err) {
  5123. // Git is required for LFS
  5124. if (settings.lfs) {
  5125. throw err;
  5126. }
  5127. // Otherwise fallback to REST API
  5128. return undefined;
  5129. }
  5130. });
  5131. }
  5132. /***/ }),
  5133. /***/ 294:
  5134. /***/ (function(module, __unusedexports, __webpack_require__) {
  5135. module.exports = parseOptions;
  5136. const { Deprecation } = __webpack_require__(692);
  5137. const { getUserAgent } = __webpack_require__(796);
  5138. const once = __webpack_require__(969);
  5139. const pkg = __webpack_require__(215);
  5140. const deprecateOptionsTimeout = once((log, deprecation) =>
  5141. log.warn(deprecation)
  5142. );
  5143. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5144. const deprecateOptionsHeaders = once((log, deprecation) =>
  5145. log.warn(deprecation)
  5146. );
  5147. function parseOptions(options, log, hook) {
  5148. if (options.headers) {
  5149. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5150. newObj[key.toLowerCase()] = options.headers[key];
  5151. return newObj;
  5152. }, {});
  5153. }
  5154. const clientDefaults = {
  5155. headers: options.headers || {},
  5156. request: options.request || {},
  5157. mediaType: {
  5158. previews: [],
  5159. format: ""
  5160. }
  5161. };
  5162. if (options.baseUrl) {
  5163. clientDefaults.baseUrl = options.baseUrl;
  5164. }
  5165. if (options.userAgent) {
  5166. clientDefaults.headers["user-agent"] = options.userAgent;
  5167. }
  5168. if (options.previews) {
  5169. clientDefaults.mediaType.previews = options.previews;
  5170. }
  5171. if (options.timeZone) {
  5172. clientDefaults.headers["time-zone"] = options.timeZone;
  5173. }
  5174. if (options.timeout) {
  5175. deprecateOptionsTimeout(
  5176. log,
  5177. new Deprecation(
  5178. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5179. )
  5180. );
  5181. clientDefaults.request.timeout = options.timeout;
  5182. }
  5183. if (options.agent) {
  5184. deprecateOptionsAgent(
  5185. log,
  5186. new Deprecation(
  5187. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5188. )
  5189. );
  5190. clientDefaults.request.agent = options.agent;
  5191. }
  5192. if (options.headers) {
  5193. deprecateOptionsHeaders(
  5194. log,
  5195. new Deprecation(
  5196. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5197. )
  5198. );
  5199. }
  5200. const userAgentOption = clientDefaults.headers["user-agent"];
  5201. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5202. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5203. .filter(Boolean)
  5204. .join(" ");
  5205. clientDefaults.request.hook = hook.bind(null, "request");
  5206. return clientDefaults;
  5207. }
  5208. /***/ }),
  5209. /***/ 297:
  5210. /***/ (function(module) {
  5211. module.exports = class HttpError extends Error {
  5212. constructor (message, code, headers) {
  5213. super(message)
  5214. // Maintains proper stack trace (only available on V8)
  5215. /* istanbul ignore next */
  5216. if (Error.captureStackTrace) {
  5217. Error.captureStackTrace(this, this.constructor)
  5218. }
  5219. this.name = 'HttpError'
  5220. this.code = code
  5221. this.headers = headers
  5222. }
  5223. }
  5224. /***/ }),
  5225. /***/ 301:
  5226. /***/ (function(module, __unusedexports, __webpack_require__) {
  5227. /**
  5228. * Some “list” response that can be paginated have a different response structure
  5229. *
  5230. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5231. * /installation/repositories also has `repository_selection`), as well as a key with
  5232. * the list of the items which name varies from endpoint to endpoint:
  5233. *
  5234. * - https://developer.github.com/v3/search/#example (key `items`)
  5235. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5236. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5237. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5238. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5239. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5240. *
  5241. * Octokit normalizes these responses so that paginated results are always returned following
  5242. * the same structure. One challenge is that if the list response has only one page, no Link
  5243. * header is provided, so this header alone is not sufficient to check wether a response is
  5244. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5245. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5246. * property because it also exists in the response of Get the combined status for a specific ref.
  5247. */
  5248. module.exports = normalizePaginatedListResponse;
  5249. const { Deprecation } = __webpack_require__(692);
  5250. const once = __webpack_require__(969);
  5251. const deprecateIncompleteResults = once((log, deprecation) =>
  5252. log.warn(deprecation)
  5253. );
  5254. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5255. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5256. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5257. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5258. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5259. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5260. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5261. function normalizePaginatedListResponse(octokit, url, response) {
  5262. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5263. if (
  5264. !REGEX_IS_SEARCH_PATH.test(path) &&
  5265. !REGEX_IS_CHECKS_PATH.test(path) &&
  5266. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5267. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5268. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5269. ) {
  5270. return;
  5271. }
  5272. // keep the additional properties intact to avoid a breaking change,
  5273. // but log a deprecation warning when accessed
  5274. const incompleteResults = response.data.incomplete_results;
  5275. const repositorySelection = response.data.repository_selection;
  5276. const totalCount = response.data.total_count;
  5277. delete response.data.incomplete_results;
  5278. delete response.data.repository_selection;
  5279. delete response.data.total_count;
  5280. const namespaceKey = Object.keys(response.data)[0];
  5281. response.data = response.data[namespaceKey];
  5282. Object.defineProperty(response.data, namespaceKey, {
  5283. get() {
  5284. deprecateNamespace(
  5285. octokit.log,
  5286. new Deprecation(
  5287. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5288. )
  5289. );
  5290. return response.data;
  5291. }
  5292. });
  5293. if (typeof incompleteResults !== "undefined") {
  5294. Object.defineProperty(response.data, "incomplete_results", {
  5295. get() {
  5296. deprecateIncompleteResults(
  5297. octokit.log,
  5298. new Deprecation(
  5299. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5300. )
  5301. );
  5302. return incompleteResults;
  5303. }
  5304. });
  5305. }
  5306. if (typeof repositorySelection !== "undefined") {
  5307. Object.defineProperty(response.data, "repository_selection", {
  5308. get() {
  5309. deprecateTotalCount(
  5310. octokit.log,
  5311. new Deprecation(
  5312. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5313. )
  5314. );
  5315. return repositorySelection;
  5316. }
  5317. });
  5318. }
  5319. Object.defineProperty(response.data, "total_count", {
  5320. get() {
  5321. deprecateTotalCount(
  5322. octokit.log,
  5323. new Deprecation(
  5324. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5325. )
  5326. );
  5327. return totalCount;
  5328. }
  5329. });
  5330. }
  5331. /***/ }),
  5332. /***/ 323:
  5333. /***/ (function(module) {
  5334. "use strict";
  5335. var isStream = module.exports = function (stream) {
  5336. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5337. };
  5338. isStream.writable = function (stream) {
  5339. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5340. };
  5341. isStream.readable = function (stream) {
  5342. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5343. };
  5344. isStream.duplex = function (stream) {
  5345. return isStream.writable(stream) && isStream.readable(stream);
  5346. };
  5347. isStream.transform = function (stream) {
  5348. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5349. };
  5350. /***/ }),
  5351. /***/ 335:
  5352. /***/ (function(module, __unusedexports, __webpack_require__) {
  5353. module.exports = __webpack_require__(179);
  5354. /***/ }),
  5355. /***/ 336:
  5356. /***/ (function(module, __unusedexports, __webpack_require__) {
  5357. module.exports = hasLastPage
  5358. const deprecate = __webpack_require__(370)
  5359. const getPageLinks = __webpack_require__(577)
  5360. function hasLastPage (link) {
  5361. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5362. return getPageLinks(link).last
  5363. }
  5364. /***/ }),
  5365. /***/ 348:
  5366. /***/ (function(module, __unusedexports, __webpack_require__) {
  5367. "use strict";
  5368. module.exports = validate;
  5369. const { RequestError } = __webpack_require__(463);
  5370. const get = __webpack_require__(854);
  5371. const set = __webpack_require__(883);
  5372. function validate(octokit, options) {
  5373. if (!options.request.validate) {
  5374. return;
  5375. }
  5376. const { validate: params } = options.request;
  5377. Object.keys(params).forEach(parameterName => {
  5378. const parameter = get(params, parameterName);
  5379. const expectedType = parameter.type;
  5380. let parentParameterName;
  5381. let parentValue;
  5382. let parentParamIsPresent = true;
  5383. let parentParameterIsArray = false;
  5384. if (/\./.test(parameterName)) {
  5385. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5386. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5387. if (parentParameterIsArray) {
  5388. parentParameterName = parentParameterName.slice(0, -2);
  5389. }
  5390. parentValue = get(options, parentParameterName);
  5391. parentParamIsPresent =
  5392. parentParameterName === "headers" ||
  5393. (typeof parentValue === "object" && parentValue !== null);
  5394. }
  5395. const values = parentParameterIsArray
  5396. ? (get(options, parentParameterName) || []).map(
  5397. value => value[parameterName.split(/\./).pop()]
  5398. )
  5399. : [get(options, parameterName)];
  5400. values.forEach((value, i) => {
  5401. const valueIsPresent = typeof value !== "undefined";
  5402. const valueIsNull = value === null;
  5403. const currentParameterName = parentParameterIsArray
  5404. ? parameterName.replace(/\[\]/, `[${i}]`)
  5405. : parameterName;
  5406. if (!parameter.required && !valueIsPresent) {
  5407. return;
  5408. }
  5409. // if the parent parameter is of type object but allows null
  5410. // then the child parameters can be ignored
  5411. if (!parentParamIsPresent) {
  5412. return;
  5413. }
  5414. if (parameter.allowNull && valueIsNull) {
  5415. return;
  5416. }
  5417. if (!parameter.allowNull && valueIsNull) {
  5418. throw new RequestError(
  5419. `'${currentParameterName}' cannot be null`,
  5420. 400,
  5421. {
  5422. request: options
  5423. }
  5424. );
  5425. }
  5426. if (parameter.required && !valueIsPresent) {
  5427. throw new RequestError(
  5428. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5429. value
  5430. )}`,
  5431. 400,
  5432. {
  5433. request: options
  5434. }
  5435. );
  5436. }
  5437. // parse to integer before checking for enum
  5438. // so that string "1" will match enum with number 1
  5439. if (expectedType === "integer") {
  5440. const unparsedValue = value;
  5441. value = parseInt(value, 10);
  5442. if (isNaN(value)) {
  5443. throw new RequestError(
  5444. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5445. unparsedValue
  5446. )} is NaN`,
  5447. 400,
  5448. {
  5449. request: options
  5450. }
  5451. );
  5452. }
  5453. }
  5454. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5455. throw new RequestError(
  5456. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5457. value
  5458. )}`,
  5459. 400,
  5460. {
  5461. request: options
  5462. }
  5463. );
  5464. }
  5465. if (parameter.validation) {
  5466. const regex = new RegExp(parameter.validation);
  5467. if (!regex.test(value)) {
  5468. throw new RequestError(
  5469. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5470. value
  5471. )}`,
  5472. 400,
  5473. {
  5474. request: options
  5475. }
  5476. );
  5477. }
  5478. }
  5479. if (expectedType === "object" && typeof value === "string") {
  5480. try {
  5481. value = JSON.parse(value);
  5482. } catch (exception) {
  5483. throw new RequestError(
  5484. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5485. value
  5486. )}`,
  5487. 400,
  5488. {
  5489. request: options
  5490. }
  5491. );
  5492. }
  5493. }
  5494. set(options, parameter.mapTo || currentParameterName, value);
  5495. });
  5496. });
  5497. return options;
  5498. }
  5499. /***/ }),
  5500. /***/ 349:
  5501. /***/ (function(module, __unusedexports, __webpack_require__) {
  5502. module.exports = authenticationRequestError;
  5503. const { RequestError } = __webpack_require__(463);
  5504. function authenticationRequestError(state, error, options) {
  5505. /* istanbul ignore next */
  5506. if (!error.headers) throw error;
  5507. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5508. // handle "2FA required" error only
  5509. if (error.status !== 401 || !otpRequired) {
  5510. throw error;
  5511. }
  5512. if (
  5513. error.status === 401 &&
  5514. otpRequired &&
  5515. error.request &&
  5516. error.request.headers["x-github-otp"]
  5517. ) {
  5518. throw new RequestError(
  5519. "Invalid one-time password for two-factor authentication",
  5520. 401,
  5521. {
  5522. headers: error.headers,
  5523. request: options
  5524. }
  5525. );
  5526. }
  5527. if (typeof state.auth.on2fa !== "function") {
  5528. throw new RequestError(
  5529. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5530. 401,
  5531. {
  5532. headers: error.headers,
  5533. request: options
  5534. }
  5535. );
  5536. }
  5537. return Promise.resolve()
  5538. .then(() => {
  5539. return state.auth.on2fa();
  5540. })
  5541. .then(oneTimePassword => {
  5542. const newOptions = Object.assign(options, {
  5543. headers: Object.assign(
  5544. { "x-github-otp": oneTimePassword },
  5545. options.headers
  5546. )
  5547. });
  5548. return state.octokit.request(newOptions);
  5549. });
  5550. }
  5551. /***/ }),
  5552. /***/ 357:
  5553. /***/ (function(module) {
  5554. module.exports = require("assert");
  5555. /***/ }),
  5556. /***/ 363:
  5557. /***/ (function(module) {
  5558. module.exports = register
  5559. function register (state, name, method, options) {
  5560. if (typeof method !== 'function') {
  5561. throw new Error('method for before hook must be a function')
  5562. }
  5563. if (!options) {
  5564. options = {}
  5565. }
  5566. if (Array.isArray(name)) {
  5567. return name.reverse().reduce(function (callback, name) {
  5568. return register.bind(null, state, name, callback, options)
  5569. }, method)()
  5570. }
  5571. return Promise.resolve()
  5572. .then(function () {
  5573. if (!state.registry[name]) {
  5574. return method(options)
  5575. }
  5576. return (state.registry[name]).reduce(function (method, registered) {
  5577. return registered.hook.bind(null, method, options)
  5578. }, method)()
  5579. })
  5580. }
  5581. /***/ }),
  5582. /***/ 368:
  5583. /***/ (function(module) {
  5584. module.exports = function atob(str) {
  5585. return Buffer.from(str, 'base64').toString('binary')
  5586. }
  5587. /***/ }),
  5588. /***/ 370:
  5589. /***/ (function(module) {
  5590. module.exports = deprecate
  5591. const loggedMessages = {}
  5592. function deprecate (message) {
  5593. if (loggedMessages[message]) {
  5594. return
  5595. }
  5596. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5597. loggedMessages[message] = 1
  5598. }
  5599. /***/ }),
  5600. /***/ 372:
  5601. /***/ (function(module) {
  5602. module.exports = octokitDebug;
  5603. function octokitDebug(octokit) {
  5604. octokit.hook.wrap("request", (request, options) => {
  5605. octokit.log.debug("request", options);
  5606. const start = Date.now();
  5607. const requestOptions = octokit.request.endpoint.parse(options);
  5608. const path = requestOptions.url.replace(options.baseUrl, "");
  5609. return request(options)
  5610. .then(response => {
  5611. octokit.log.info(
  5612. `${requestOptions.method} ${path} - ${
  5613. response.status
  5614. } in ${Date.now() - start}ms`
  5615. );
  5616. return response;
  5617. })
  5618. .catch(error => {
  5619. octokit.log.info(
  5620. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5621. start}ms`
  5622. );
  5623. throw error;
  5624. });
  5625. });
  5626. }
  5627. /***/ }),
  5628. /***/ 385:
  5629. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5630. "use strict";
  5631. Object.defineProperty(exports, '__esModule', { value: true });
  5632. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5633. var isPlainObject = _interopDefault(__webpack_require__(696));
  5634. var universalUserAgent = __webpack_require__(796);
  5635. function lowercaseKeys(object) {
  5636. if (!object) {
  5637. return {};
  5638. }
  5639. return Object.keys(object).reduce((newObj, key) => {
  5640. newObj[key.toLowerCase()] = object[key];
  5641. return newObj;
  5642. }, {});
  5643. }
  5644. function mergeDeep(defaults, options) {
  5645. const result = Object.assign({}, defaults);
  5646. Object.keys(options).forEach(key => {
  5647. if (isPlainObject(options[key])) {
  5648. if (!(key in defaults)) Object.assign(result, {
  5649. [key]: options[key]
  5650. });else result[key] = mergeDeep(defaults[key], options[key]);
  5651. } else {
  5652. Object.assign(result, {
  5653. [key]: options[key]
  5654. });
  5655. }
  5656. });
  5657. return result;
  5658. }
  5659. function merge(defaults, route, options) {
  5660. if (typeof route === "string") {
  5661. let [method, url] = route.split(" ");
  5662. options = Object.assign(url ? {
  5663. method,
  5664. url
  5665. } : {
  5666. url: method
  5667. }, options);
  5668. } else {
  5669. options = Object.assign({}, route);
  5670. } // lowercase header names before merging with defaults to avoid duplicates
  5671. options.headers = lowercaseKeys(options.headers);
  5672. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5673. if (defaults && defaults.mediaType.previews.length) {
  5674. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5675. }
  5676. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5677. return mergedOptions;
  5678. }
  5679. function addQueryParameters(url, parameters) {
  5680. const separator = /\?/.test(url) ? "&" : "?";
  5681. const names = Object.keys(parameters);
  5682. if (names.length === 0) {
  5683. return url;
  5684. }
  5685. return url + separator + names.map(name => {
  5686. if (name === "q") {
  5687. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5688. }
  5689. return `${name}=${encodeURIComponent(parameters[name])}`;
  5690. }).join("&");
  5691. }
  5692. const urlVariableRegex = /\{[^}]+\}/g;
  5693. function removeNonChars(variableName) {
  5694. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5695. }
  5696. function extractUrlVariableNames(url) {
  5697. const matches = url.match(urlVariableRegex);
  5698. if (!matches) {
  5699. return [];
  5700. }
  5701. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5702. }
  5703. function omit(object, keysToOmit) {
  5704. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5705. obj[key] = object[key];
  5706. return obj;
  5707. }, {});
  5708. }
  5709. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5710. // TODO: create separate package.
  5711. //
  5712. // Copyright (c) 2012-2014, Bram Stein
  5713. // All rights reserved.
  5714. // Redistribution and use in source and binary forms, with or without
  5715. // modification, are permitted provided that the following conditions
  5716. // are met:
  5717. // 1. Redistributions of source code must retain the above copyright
  5718. // notice, this list of conditions and the following disclaimer.
  5719. // 2. Redistributions in binary form must reproduce the above copyright
  5720. // notice, this list of conditions and the following disclaimer in the
  5721. // documentation and/or other materials provided with the distribution.
  5722. // 3. The name of the author may not be used to endorse or promote products
  5723. // derived from this software without specific prior written permission.
  5724. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5725. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5726. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5727. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5728. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5729. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5730. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5731. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5732. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5733. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5734. /* istanbul ignore file */
  5735. function encodeReserved(str) {
  5736. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5737. if (!/%[0-9A-Fa-f]/.test(part)) {
  5738. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5739. }
  5740. return part;
  5741. }).join("");
  5742. }
  5743. function encodeUnreserved(str) {
  5744. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5745. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5746. });
  5747. }
  5748. function encodeValue(operator, value, key) {
  5749. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5750. if (key) {
  5751. return encodeUnreserved(key) + "=" + value;
  5752. } else {
  5753. return value;
  5754. }
  5755. }
  5756. function isDefined(value) {
  5757. return value !== undefined && value !== null;
  5758. }
  5759. function isKeyOperator(operator) {
  5760. return operator === ";" || operator === "&" || operator === "?";
  5761. }
  5762. function getValues(context, operator, key, modifier) {
  5763. var value = context[key],
  5764. result = [];
  5765. if (isDefined(value) && value !== "") {
  5766. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5767. value = value.toString();
  5768. if (modifier && modifier !== "*") {
  5769. value = value.substring(0, parseInt(modifier, 10));
  5770. }
  5771. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5772. } else {
  5773. if (modifier === "*") {
  5774. if (Array.isArray(value)) {
  5775. value.filter(isDefined).forEach(function (value) {
  5776. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5777. });
  5778. } else {
  5779. Object.keys(value).forEach(function (k) {
  5780. if (isDefined(value[k])) {
  5781. result.push(encodeValue(operator, value[k], k));
  5782. }
  5783. });
  5784. }
  5785. } else {
  5786. const tmp = [];
  5787. if (Array.isArray(value)) {
  5788. value.filter(isDefined).forEach(function (value) {
  5789. tmp.push(encodeValue(operator, value));
  5790. });
  5791. } else {
  5792. Object.keys(value).forEach(function (k) {
  5793. if (isDefined(value[k])) {
  5794. tmp.push(encodeUnreserved(k));
  5795. tmp.push(encodeValue(operator, value[k].toString()));
  5796. }
  5797. });
  5798. }
  5799. if (isKeyOperator(operator)) {
  5800. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5801. } else if (tmp.length !== 0) {
  5802. result.push(tmp.join(","));
  5803. }
  5804. }
  5805. }
  5806. } else {
  5807. if (operator === ";") {
  5808. if (isDefined(value)) {
  5809. result.push(encodeUnreserved(key));
  5810. }
  5811. } else if (value === "" && (operator === "&" || operator === "?")) {
  5812. result.push(encodeUnreserved(key) + "=");
  5813. } else if (value === "") {
  5814. result.push("");
  5815. }
  5816. }
  5817. return result;
  5818. }
  5819. function parseUrl(template) {
  5820. return {
  5821. expand: expand.bind(null, template)
  5822. };
  5823. }
  5824. function expand(template, context) {
  5825. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5826. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5827. if (expression) {
  5828. let operator = "";
  5829. const values = [];
  5830. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5831. operator = expression.charAt(0);
  5832. expression = expression.substr(1);
  5833. }
  5834. expression.split(/,/g).forEach(function (variable) {
  5835. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5836. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5837. });
  5838. if (operator && operator !== "+") {
  5839. var separator = ",";
  5840. if (operator === "?") {
  5841. separator = "&";
  5842. } else if (operator !== "#") {
  5843. separator = operator;
  5844. }
  5845. return (values.length !== 0 ? operator : "") + values.join(separator);
  5846. } else {
  5847. return values.join(",");
  5848. }
  5849. } else {
  5850. return encodeReserved(literal);
  5851. }
  5852. });
  5853. }
  5854. function parse(options) {
  5855. // https://fetch.spec.whatwg.org/#methods
  5856. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5857. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5858. let headers = Object.assign({}, options.headers);
  5859. let body;
  5860. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5861. const urlVariableNames = extractUrlVariableNames(url);
  5862. url = parseUrl(url).expand(parameters);
  5863. if (!/^http/.test(url)) {
  5864. url = options.baseUrl + url;
  5865. }
  5866. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5867. const remainingParameters = omit(parameters, omittedParameters);
  5868. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5869. if (!isBinaryRequset) {
  5870. if (options.mediaType.format) {
  5871. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5872. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5873. }
  5874. if (options.mediaType.previews.length) {
  5875. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5876. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5877. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5878. return `application/vnd.github.${preview}-preview${format}`;
  5879. }).join(",");
  5880. }
  5881. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5882. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5883. if (["GET", "HEAD"].includes(method)) {
  5884. url = addQueryParameters(url, remainingParameters);
  5885. } else {
  5886. if ("data" in remainingParameters) {
  5887. body = remainingParameters.data;
  5888. } else {
  5889. if (Object.keys(remainingParameters).length) {
  5890. body = remainingParameters;
  5891. } else {
  5892. headers["content-length"] = 0;
  5893. }
  5894. }
  5895. } // default content-type for JSON if body is set
  5896. if (!headers["content-type"] && typeof body !== "undefined") {
  5897. headers["content-type"] = "application/json; charset=utf-8";
  5898. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5899. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5900. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5901. body = "";
  5902. } // Only return body/request keys if present
  5903. return Object.assign({
  5904. method,
  5905. url,
  5906. headers
  5907. }, typeof body !== "undefined" ? {
  5908. body
  5909. } : null, options.request ? {
  5910. request: options.request
  5911. } : null);
  5912. }
  5913. function endpointWithDefaults(defaults, route, options) {
  5914. return parse(merge(defaults, route, options));
  5915. }
  5916. function withDefaults(oldDefaults, newDefaults) {
  5917. const DEFAULTS = merge(oldDefaults, newDefaults);
  5918. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5919. return Object.assign(endpoint, {
  5920. DEFAULTS,
  5921. defaults: withDefaults.bind(null, DEFAULTS),
  5922. merge: merge.bind(null, DEFAULTS),
  5923. parse
  5924. });
  5925. }
  5926. const VERSION = "5.5.1";
  5927. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  5928. // So we use RequestParameters and add method as additional required property.
  5929. const DEFAULTS = {
  5930. method: "GET",
  5931. baseUrl: "https://api.github.com",
  5932. headers: {
  5933. accept: "application/vnd.github.v3+json",
  5934. "user-agent": userAgent
  5935. },
  5936. mediaType: {
  5937. format: "",
  5938. previews: []
  5939. }
  5940. };
  5941. const endpoint = withDefaults(null, DEFAULTS);
  5942. exports.endpoint = endpoint;
  5943. //# sourceMappingURL=index.js.map
  5944. /***/ }),
  5945. /***/ 389:
  5946. /***/ (function(module, __unusedexports, __webpack_require__) {
  5947. "use strict";
  5948. const fs = __webpack_require__(747);
  5949. const shebangCommand = __webpack_require__(866);
  5950. function readShebang(command) {
  5951. // Read the first 150 bytes from the file
  5952. const size = 150;
  5953. let buffer;
  5954. if (Buffer.alloc) {
  5955. // Node.js v4.5+ / v5.10+
  5956. buffer = Buffer.alloc(size);
  5957. } else {
  5958. // Old Node.js API
  5959. buffer = new Buffer(size);
  5960. buffer.fill(0); // zero-fill
  5961. }
  5962. let fd;
  5963. try {
  5964. fd = fs.openSync(command, 'r');
  5965. fs.readSync(fd, buffer, 0, size, 0);
  5966. fs.closeSync(fd);
  5967. } catch (e) { /* Empty */ }
  5968. // Attempt to extract shebang (null is returned if not a shebang)
  5969. return shebangCommand(buffer.toString());
  5970. }
  5971. module.exports = readShebang;
  5972. /***/ }),
  5973. /***/ 402:
  5974. /***/ (function(module, __unusedexports, __webpack_require__) {
  5975. module.exports = Octokit;
  5976. const { request } = __webpack_require__(753);
  5977. const Hook = __webpack_require__(523);
  5978. const parseClientOptions = __webpack_require__(294);
  5979. function Octokit(plugins, options) {
  5980. options = options || {};
  5981. const hook = new Hook.Collection();
  5982. const log = Object.assign(
  5983. {
  5984. debug: () => {},
  5985. info: () => {},
  5986. warn: console.warn,
  5987. error: console.error
  5988. },
  5989. options && options.log
  5990. );
  5991. const api = {
  5992. hook,
  5993. log,
  5994. request: request.defaults(parseClientOptions(options, log, hook))
  5995. };
  5996. plugins.forEach(pluginFunction => pluginFunction(api, options));
  5997. return api;
  5998. }
  5999. /***/ }),
  6000. /***/ 413:
  6001. /***/ (function(module) {
  6002. module.exports = require("stream");
  6003. /***/ }),
  6004. /***/ 417:
  6005. /***/ (function(module) {
  6006. module.exports = require("crypto");
  6007. /***/ }),
  6008. /***/ 427:
  6009. /***/ (function(module, __unusedexports, __webpack_require__) {
  6010. "use strict";
  6011. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6012. // In that case, fall back to a deprecated internal.
  6013. const util = __webpack_require__(669);
  6014. let uv;
  6015. if (typeof util.getSystemErrorName === 'function') {
  6016. module.exports = util.getSystemErrorName;
  6017. } else {
  6018. try {
  6019. uv = process.binding('uv');
  6020. if (typeof uv.errname !== 'function') {
  6021. throw new TypeError('uv.errname is not a function');
  6022. }
  6023. } catch (err) {
  6024. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6025. uv = null;
  6026. }
  6027. module.exports = code => errname(uv, code);
  6028. }
  6029. // Used for testing the fallback behavior
  6030. module.exports.__test__ = errname;
  6031. function errname(uv, code) {
  6032. if (uv) {
  6033. return uv.errname(code);
  6034. }
  6035. if (!(code < 0)) {
  6036. throw new Error('err >= 0');
  6037. }
  6038. return `Unknown system error ${code}`;
  6039. }
  6040. /***/ }),
  6041. /***/ 430:
  6042. /***/ (function(module, __unusedexports, __webpack_require__) {
  6043. module.exports = octokitValidate;
  6044. const validate = __webpack_require__(348);
  6045. function octokitValidate(octokit) {
  6046. octokit.hook.before("request", validate.bind(null, octokit));
  6047. }
  6048. /***/ }),
  6049. /***/ 431:
  6050. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6051. "use strict";
  6052. Object.defineProperty(exports, "__esModule", { value: true });
  6053. const os = __webpack_require__(87);
  6054. /**
  6055. * Commands
  6056. *
  6057. * Command Format:
  6058. * ##[name key=value;key=value]message
  6059. *
  6060. * Examples:
  6061. * ##[warning]This is the user warning message
  6062. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6063. */
  6064. function issueCommand(command, properties, message) {
  6065. const cmd = new Command(command, properties, message);
  6066. process.stdout.write(cmd.toString() + os.EOL);
  6067. }
  6068. exports.issueCommand = issueCommand;
  6069. function issue(name, message = '') {
  6070. issueCommand(name, {}, message);
  6071. }
  6072. exports.issue = issue;
  6073. const CMD_STRING = '::';
  6074. class Command {
  6075. constructor(command, properties, message) {
  6076. if (!command) {
  6077. command = 'missing.command';
  6078. }
  6079. this.command = command;
  6080. this.properties = properties;
  6081. this.message = message;
  6082. }
  6083. toString() {
  6084. let cmdStr = CMD_STRING + this.command;
  6085. if (this.properties && Object.keys(this.properties).length > 0) {
  6086. cmdStr += ' ';
  6087. for (const key in this.properties) {
  6088. if (this.properties.hasOwnProperty(key)) {
  6089. const val = this.properties[key];
  6090. if (val) {
  6091. // safely append the val - avoid blowing up when attempting to
  6092. // call .replace() if message is not a string for some reason
  6093. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6094. }
  6095. }
  6096. }
  6097. }
  6098. cmdStr += CMD_STRING;
  6099. // safely append the message - avoid blowing up when attempting to
  6100. // call .replace() if message is not a string for some reason
  6101. const message = `${this.message || ''}`;
  6102. cmdStr += escapeData(message);
  6103. return cmdStr;
  6104. }
  6105. }
  6106. function escapeData(s) {
  6107. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6108. }
  6109. function escape(s) {
  6110. return s
  6111. .replace(/\r/g, '%0D')
  6112. .replace(/\n/g, '%0A')
  6113. .replace(/]/g, '%5D')
  6114. .replace(/;/g, '%3B');
  6115. }
  6116. //# sourceMappingURL=command.js.map
  6117. /***/ }),
  6118. /***/ 438:
  6119. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6120. "use strict";
  6121. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6122. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6123. return new (P || (P = Promise))(function (resolve, reject) {
  6124. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6125. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6126. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6127. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6128. });
  6129. };
  6130. var __importStar = (this && this.__importStar) || function (mod) {
  6131. if (mod && mod.__esModule) return mod;
  6132. var result = {};
  6133. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6134. result["default"] = mod;
  6135. return result;
  6136. };
  6137. Object.defineProperty(exports, "__esModule", { value: true });
  6138. const core = __importStar(__webpack_require__(470));
  6139. const fs = __importStar(__webpack_require__(747));
  6140. const fsHelper = __importStar(__webpack_require__(618));
  6141. const io = __importStar(__webpack_require__(1));
  6142. const path = __importStar(__webpack_require__(622));
  6143. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  6144. return __awaiter(this, void 0, void 0, function* () {
  6145. let remove = false;
  6146. // Check whether using git or REST API
  6147. if (!git) {
  6148. remove = true;
  6149. }
  6150. // Fetch URL does not match
  6151. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6152. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6153. remove = true;
  6154. }
  6155. else {
  6156. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6157. const lockPaths = [
  6158. path.join(repositoryPath, '.git', 'index.lock'),
  6159. path.join(repositoryPath, '.git', 'shallow.lock')
  6160. ];
  6161. for (const lockPath of lockPaths) {
  6162. try {
  6163. yield io.rmRF(lockPath);
  6164. }
  6165. catch (error) {
  6166. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6167. }
  6168. }
  6169. try {
  6170. // Checkout detached HEAD
  6171. if (!(yield git.isDetached())) {
  6172. yield git.checkoutDetach();
  6173. }
  6174. // Remove all refs/heads/*
  6175. let branches = yield git.branchList(false);
  6176. for (const branch of branches) {
  6177. yield git.branchDelete(false, branch);
  6178. }
  6179. // Remove all refs/remotes/origin/* to avoid conflicts
  6180. branches = yield git.branchList(true);
  6181. for (const branch of branches) {
  6182. yield git.branchDelete(true, branch);
  6183. }
  6184. // Clean
  6185. if (clean) {
  6186. if (!(yield git.tryClean())) {
  6187. 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}'.`);
  6188. remove = true;
  6189. }
  6190. else if (!(yield git.tryReset())) {
  6191. remove = true;
  6192. }
  6193. if (remove) {
  6194. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6195. }
  6196. }
  6197. }
  6198. catch (error) {
  6199. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6200. remove = true;
  6201. }
  6202. }
  6203. if (remove) {
  6204. // Delete the contents of the directory. Don't delete the directory itself
  6205. // since it might be the current working directory.
  6206. core.info(`Deleting the contents of '${repositoryPath}'`);
  6207. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6208. yield io.rmRF(path.join(repositoryPath, file));
  6209. }
  6210. }
  6211. });
  6212. }
  6213. exports.prepareExistingDirectory = prepareExistingDirectory;
  6214. /***/ }),
  6215. /***/ 453:
  6216. /***/ (function(module, __unusedexports, __webpack_require__) {
  6217. var once = __webpack_require__(969)
  6218. var eos = __webpack_require__(562)
  6219. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6220. var noop = function () {}
  6221. var ancient = /^v?\.0/.test(process.version)
  6222. var isFn = function (fn) {
  6223. return typeof fn === 'function'
  6224. }
  6225. var isFS = function (stream) {
  6226. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6227. if (!fs) return false // browser
  6228. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6229. }
  6230. var isRequest = function (stream) {
  6231. return stream.setHeader && isFn(stream.abort)
  6232. }
  6233. var destroyer = function (stream, reading, writing, callback) {
  6234. callback = once(callback)
  6235. var closed = false
  6236. stream.on('close', function () {
  6237. closed = true
  6238. })
  6239. eos(stream, {readable: reading, writable: writing}, function (err) {
  6240. if (err) return callback(err)
  6241. closed = true
  6242. callback()
  6243. })
  6244. var destroyed = false
  6245. return function (err) {
  6246. if (closed) return
  6247. if (destroyed) return
  6248. destroyed = true
  6249. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6250. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6251. if (isFn(stream.destroy)) return stream.destroy()
  6252. callback(err || new Error('stream was destroyed'))
  6253. }
  6254. }
  6255. var call = function (fn) {
  6256. fn()
  6257. }
  6258. var pipe = function (from, to) {
  6259. return from.pipe(to)
  6260. }
  6261. var pump = function () {
  6262. var streams = Array.prototype.slice.call(arguments)
  6263. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6264. if (Array.isArray(streams[0])) streams = streams[0]
  6265. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6266. var error
  6267. var destroys = streams.map(function (stream, i) {
  6268. var reading = i < streams.length - 1
  6269. var writing = i > 0
  6270. return destroyer(stream, reading, writing, function (err) {
  6271. if (!error) error = err
  6272. if (err) destroys.forEach(call)
  6273. if (reading) return
  6274. destroys.forEach(call)
  6275. callback(error)
  6276. })
  6277. })
  6278. return streams.reduce(pipe)
  6279. }
  6280. module.exports = pump
  6281. /***/ }),
  6282. /***/ 454:
  6283. /***/ (function(module, exports, __webpack_require__) {
  6284. "use strict";
  6285. Object.defineProperty(exports, '__esModule', { value: true });
  6286. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6287. var Stream = _interopDefault(__webpack_require__(413));
  6288. var http = _interopDefault(__webpack_require__(605));
  6289. var Url = _interopDefault(__webpack_require__(835));
  6290. var https = _interopDefault(__webpack_require__(211));
  6291. var zlib = _interopDefault(__webpack_require__(761));
  6292. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6293. // fix for "Readable" isn't a named export issue
  6294. const Readable = Stream.Readable;
  6295. const BUFFER = Symbol('buffer');
  6296. const TYPE = Symbol('type');
  6297. class Blob {
  6298. constructor() {
  6299. this[TYPE] = '';
  6300. const blobParts = arguments[0];
  6301. const options = arguments[1];
  6302. const buffers = [];
  6303. let size = 0;
  6304. if (blobParts) {
  6305. const a = blobParts;
  6306. const length = Number(a.length);
  6307. for (let i = 0; i < length; i++) {
  6308. const element = a[i];
  6309. let buffer;
  6310. if (element instanceof Buffer) {
  6311. buffer = element;
  6312. } else if (ArrayBuffer.isView(element)) {
  6313. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6314. } else if (element instanceof ArrayBuffer) {
  6315. buffer = Buffer.from(element);
  6316. } else if (element instanceof Blob) {
  6317. buffer = element[BUFFER];
  6318. } else {
  6319. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6320. }
  6321. size += buffer.length;
  6322. buffers.push(buffer);
  6323. }
  6324. }
  6325. this[BUFFER] = Buffer.concat(buffers);
  6326. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6327. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6328. this[TYPE] = type;
  6329. }
  6330. }
  6331. get size() {
  6332. return this[BUFFER].length;
  6333. }
  6334. get type() {
  6335. return this[TYPE];
  6336. }
  6337. text() {
  6338. return Promise.resolve(this[BUFFER].toString());
  6339. }
  6340. arrayBuffer() {
  6341. const buf = this[BUFFER];
  6342. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6343. return Promise.resolve(ab);
  6344. }
  6345. stream() {
  6346. const readable = new Readable();
  6347. readable._read = function () {};
  6348. readable.push(this[BUFFER]);
  6349. readable.push(null);
  6350. return readable;
  6351. }
  6352. toString() {
  6353. return '[object Blob]';
  6354. }
  6355. slice() {
  6356. const size = this.size;
  6357. const start = arguments[0];
  6358. const end = arguments[1];
  6359. let relativeStart, relativeEnd;
  6360. if (start === undefined) {
  6361. relativeStart = 0;
  6362. } else if (start < 0) {
  6363. relativeStart = Math.max(size + start, 0);
  6364. } else {
  6365. relativeStart = Math.min(start, size);
  6366. }
  6367. if (end === undefined) {
  6368. relativeEnd = size;
  6369. } else if (end < 0) {
  6370. relativeEnd = Math.max(size + end, 0);
  6371. } else {
  6372. relativeEnd = Math.min(end, size);
  6373. }
  6374. const span = Math.max(relativeEnd - relativeStart, 0);
  6375. const buffer = this[BUFFER];
  6376. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6377. const blob = new Blob([], { type: arguments[2] });
  6378. blob[BUFFER] = slicedBuffer;
  6379. return blob;
  6380. }
  6381. }
  6382. Object.defineProperties(Blob.prototype, {
  6383. size: { enumerable: true },
  6384. type: { enumerable: true },
  6385. slice: { enumerable: true }
  6386. });
  6387. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6388. value: 'Blob',
  6389. writable: false,
  6390. enumerable: false,
  6391. configurable: true
  6392. });
  6393. /**
  6394. * fetch-error.js
  6395. *
  6396. * FetchError interface for operational errors
  6397. */
  6398. /**
  6399. * Create FetchError instance
  6400. *
  6401. * @param String message Error message for human
  6402. * @param String type Error type for machine
  6403. * @param String systemError For Node.js system error
  6404. * @return FetchError
  6405. */
  6406. function FetchError(message, type, systemError) {
  6407. Error.call(this, message);
  6408. this.message = message;
  6409. this.type = type;
  6410. // when err.type is `system`, err.code contains system error code
  6411. if (systemError) {
  6412. this.code = this.errno = systemError.code;
  6413. }
  6414. // hide custom error implementation details from end-users
  6415. Error.captureStackTrace(this, this.constructor);
  6416. }
  6417. FetchError.prototype = Object.create(Error.prototype);
  6418. FetchError.prototype.constructor = FetchError;
  6419. FetchError.prototype.name = 'FetchError';
  6420. let convert;
  6421. try {
  6422. convert = __webpack_require__(18).convert;
  6423. } catch (e) {}
  6424. const INTERNALS = Symbol('Body internals');
  6425. // fix an issue where "PassThrough" isn't a named export for node <10
  6426. const PassThrough = Stream.PassThrough;
  6427. /**
  6428. * Body mixin
  6429. *
  6430. * Ref: https://fetch.spec.whatwg.org/#body
  6431. *
  6432. * @param Stream body Readable stream
  6433. * @param Object opts Response options
  6434. * @return Void
  6435. */
  6436. function Body(body) {
  6437. var _this = this;
  6438. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6439. _ref$size = _ref.size;
  6440. let size = _ref$size === undefined ? 0 : _ref$size;
  6441. var _ref$timeout = _ref.timeout;
  6442. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6443. if (body == null) {
  6444. // body is undefined or null
  6445. body = null;
  6446. } else if (isURLSearchParams(body)) {
  6447. // body is a URLSearchParams
  6448. body = Buffer.from(body.toString());
  6449. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6450. // body is ArrayBuffer
  6451. body = Buffer.from(body);
  6452. } else if (ArrayBuffer.isView(body)) {
  6453. // body is ArrayBufferView
  6454. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6455. } else if (body instanceof Stream) ; else {
  6456. // none of the above
  6457. // coerce to string then buffer
  6458. body = Buffer.from(String(body));
  6459. }
  6460. this[INTERNALS] = {
  6461. body,
  6462. disturbed: false,
  6463. error: null
  6464. };
  6465. this.size = size;
  6466. this.timeout = timeout;
  6467. if (body instanceof Stream) {
  6468. body.on('error', function (err) {
  6469. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6470. _this[INTERNALS].error = error;
  6471. });
  6472. }
  6473. }
  6474. Body.prototype = {
  6475. get body() {
  6476. return this[INTERNALS].body;
  6477. },
  6478. get bodyUsed() {
  6479. return this[INTERNALS].disturbed;
  6480. },
  6481. /**
  6482. * Decode response as ArrayBuffer
  6483. *
  6484. * @return Promise
  6485. */
  6486. arrayBuffer() {
  6487. return consumeBody.call(this).then(function (buf) {
  6488. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6489. });
  6490. },
  6491. /**
  6492. * Return raw response as Blob
  6493. *
  6494. * @return Promise
  6495. */
  6496. blob() {
  6497. let ct = this.headers && this.headers.get('content-type') || '';
  6498. return consumeBody.call(this).then(function (buf) {
  6499. return Object.assign(
  6500. // Prevent copying
  6501. new Blob([], {
  6502. type: ct.toLowerCase()
  6503. }), {
  6504. [BUFFER]: buf
  6505. });
  6506. });
  6507. },
  6508. /**
  6509. * Decode response as json
  6510. *
  6511. * @return Promise
  6512. */
  6513. json() {
  6514. var _this2 = this;
  6515. return consumeBody.call(this).then(function (buffer) {
  6516. try {
  6517. return JSON.parse(buffer.toString());
  6518. } catch (err) {
  6519. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6520. }
  6521. });
  6522. },
  6523. /**
  6524. * Decode response as text
  6525. *
  6526. * @return Promise
  6527. */
  6528. text() {
  6529. return consumeBody.call(this).then(function (buffer) {
  6530. return buffer.toString();
  6531. });
  6532. },
  6533. /**
  6534. * Decode response as buffer (non-spec api)
  6535. *
  6536. * @return Promise
  6537. */
  6538. buffer() {
  6539. return consumeBody.call(this);
  6540. },
  6541. /**
  6542. * Decode response as text, while automatically detecting the encoding and
  6543. * trying to decode to UTF-8 (non-spec api)
  6544. *
  6545. * @return Promise
  6546. */
  6547. textConverted() {
  6548. var _this3 = this;
  6549. return consumeBody.call(this).then(function (buffer) {
  6550. return convertBody(buffer, _this3.headers);
  6551. });
  6552. }
  6553. };
  6554. // In browsers, all properties are enumerable.
  6555. Object.defineProperties(Body.prototype, {
  6556. body: { enumerable: true },
  6557. bodyUsed: { enumerable: true },
  6558. arrayBuffer: { enumerable: true },
  6559. blob: { enumerable: true },
  6560. json: { enumerable: true },
  6561. text: { enumerable: true }
  6562. });
  6563. Body.mixIn = function (proto) {
  6564. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6565. // istanbul ignore else: future proof
  6566. if (!(name in proto)) {
  6567. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6568. Object.defineProperty(proto, name, desc);
  6569. }
  6570. }
  6571. };
  6572. /**
  6573. * Consume and convert an entire Body to a Buffer.
  6574. *
  6575. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6576. *
  6577. * @return Promise
  6578. */
  6579. function consumeBody() {
  6580. var _this4 = this;
  6581. if (this[INTERNALS].disturbed) {
  6582. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6583. }
  6584. this[INTERNALS].disturbed = true;
  6585. if (this[INTERNALS].error) {
  6586. return Body.Promise.reject(this[INTERNALS].error);
  6587. }
  6588. let body = this.body;
  6589. // body is null
  6590. if (body === null) {
  6591. return Body.Promise.resolve(Buffer.alloc(0));
  6592. }
  6593. // body is blob
  6594. if (isBlob(body)) {
  6595. body = body.stream();
  6596. }
  6597. // body is buffer
  6598. if (Buffer.isBuffer(body)) {
  6599. return Body.Promise.resolve(body);
  6600. }
  6601. // istanbul ignore if: should never happen
  6602. if (!(body instanceof Stream)) {
  6603. return Body.Promise.resolve(Buffer.alloc(0));
  6604. }
  6605. // body is stream
  6606. // get ready to actually consume the body
  6607. let accum = [];
  6608. let accumBytes = 0;
  6609. let abort = false;
  6610. return new Body.Promise(function (resolve, reject) {
  6611. let resTimeout;
  6612. // allow timeout on slow response body
  6613. if (_this4.timeout) {
  6614. resTimeout = setTimeout(function () {
  6615. abort = true;
  6616. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6617. }, _this4.timeout);
  6618. }
  6619. // handle stream errors
  6620. body.on('error', function (err) {
  6621. if (err.name === 'AbortError') {
  6622. // if the request was aborted, reject with this Error
  6623. abort = true;
  6624. reject(err);
  6625. } else {
  6626. // other errors, such as incorrect content-encoding
  6627. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6628. }
  6629. });
  6630. body.on('data', function (chunk) {
  6631. if (abort || chunk === null) {
  6632. return;
  6633. }
  6634. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6635. abort = true;
  6636. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6637. return;
  6638. }
  6639. accumBytes += chunk.length;
  6640. accum.push(chunk);
  6641. });
  6642. body.on('end', function () {
  6643. if (abort) {
  6644. return;
  6645. }
  6646. clearTimeout(resTimeout);
  6647. try {
  6648. resolve(Buffer.concat(accum, accumBytes));
  6649. } catch (err) {
  6650. // handle streams that have accumulated too much data (issue #414)
  6651. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6652. }
  6653. });
  6654. });
  6655. }
  6656. /**
  6657. * Detect buffer encoding and convert to target encoding
  6658. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6659. *
  6660. * @param Buffer buffer Incoming buffer
  6661. * @param String encoding Target encoding
  6662. * @return String
  6663. */
  6664. function convertBody(buffer, headers) {
  6665. if (typeof convert !== 'function') {
  6666. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6667. }
  6668. const ct = headers.get('content-type');
  6669. let charset = 'utf-8';
  6670. let res, str;
  6671. // header
  6672. if (ct) {
  6673. res = /charset=([^;]*)/i.exec(ct);
  6674. }
  6675. // no charset in content type, peek at response body for at most 1024 bytes
  6676. str = buffer.slice(0, 1024).toString();
  6677. // html5
  6678. if (!res && str) {
  6679. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6680. }
  6681. // html4
  6682. if (!res && str) {
  6683. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6684. if (res) {
  6685. res = /charset=(.*)/i.exec(res.pop());
  6686. }
  6687. }
  6688. // xml
  6689. if (!res && str) {
  6690. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6691. }
  6692. // found charset
  6693. if (res) {
  6694. charset = res.pop();
  6695. // prevent decode issues when sites use incorrect encoding
  6696. // ref: https://hsivonen.fi/encoding-menu/
  6697. if (charset === 'gb2312' || charset === 'gbk') {
  6698. charset = 'gb18030';
  6699. }
  6700. }
  6701. // turn raw buffers into a single utf-8 buffer
  6702. return convert(buffer, 'UTF-8', charset).toString();
  6703. }
  6704. /**
  6705. * Detect a URLSearchParams object
  6706. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6707. *
  6708. * @param Object obj Object to detect by type or brand
  6709. * @return String
  6710. */
  6711. function isURLSearchParams(obj) {
  6712. // Duck-typing as a necessary condition.
  6713. 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') {
  6714. return false;
  6715. }
  6716. // Brand-checking and more duck-typing as optional condition.
  6717. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6718. }
  6719. /**
  6720. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6721. * @param {*} obj
  6722. * @return {boolean}
  6723. */
  6724. function isBlob(obj) {
  6725. 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]);
  6726. }
  6727. /**
  6728. * Clone body given Res/Req instance
  6729. *
  6730. * @param Mixed instance Response or Request instance
  6731. * @return Mixed
  6732. */
  6733. function clone(instance) {
  6734. let p1, p2;
  6735. let body = instance.body;
  6736. // don't allow cloning a used body
  6737. if (instance.bodyUsed) {
  6738. throw new Error('cannot clone body after it is used');
  6739. }
  6740. // check that body is a stream and not form-data object
  6741. // note: we can't clone the form-data object without having it as a dependency
  6742. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6743. // tee instance body
  6744. p1 = new PassThrough();
  6745. p2 = new PassThrough();
  6746. body.pipe(p1);
  6747. body.pipe(p2);
  6748. // set instance body to teed body and return the other teed body
  6749. instance[INTERNALS].body = p1;
  6750. body = p2;
  6751. }
  6752. return body;
  6753. }
  6754. /**
  6755. * Performs the operation "extract a `Content-Type` value from |object|" as
  6756. * specified in the specification:
  6757. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6758. *
  6759. * This function assumes that instance.body is present.
  6760. *
  6761. * @param Mixed instance Any options.body input
  6762. */
  6763. function extractContentType(body) {
  6764. if (body === null) {
  6765. // body is null
  6766. return null;
  6767. } else if (typeof body === 'string') {
  6768. // body is string
  6769. return 'text/plain;charset=UTF-8';
  6770. } else if (isURLSearchParams(body)) {
  6771. // body is a URLSearchParams
  6772. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6773. } else if (isBlob(body)) {
  6774. // body is blob
  6775. return body.type || null;
  6776. } else if (Buffer.isBuffer(body)) {
  6777. // body is buffer
  6778. return null;
  6779. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6780. // body is ArrayBuffer
  6781. return null;
  6782. } else if (ArrayBuffer.isView(body)) {
  6783. // body is ArrayBufferView
  6784. return null;
  6785. } else if (typeof body.getBoundary === 'function') {
  6786. // detect form data input from form-data module
  6787. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6788. } else if (body instanceof Stream) {
  6789. // body is stream
  6790. // can't really do much about this
  6791. return null;
  6792. } else {
  6793. // Body constructor defaults other things to string
  6794. return 'text/plain;charset=UTF-8';
  6795. }
  6796. }
  6797. /**
  6798. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6799. * For us, we have to explicitly get it with a function.
  6800. *
  6801. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6802. *
  6803. * @param Body instance Instance of Body
  6804. * @return Number? Number of bytes, or null if not possible
  6805. */
  6806. function getTotalBytes(instance) {
  6807. const body = instance.body;
  6808. if (body === null) {
  6809. // body is null
  6810. return 0;
  6811. } else if (isBlob(body)) {
  6812. return body.size;
  6813. } else if (Buffer.isBuffer(body)) {
  6814. // body is buffer
  6815. return body.length;
  6816. } else if (body && typeof body.getLengthSync === 'function') {
  6817. // detect form data input from form-data module
  6818. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6819. body.hasKnownLength && body.hasKnownLength()) {
  6820. // 2.x
  6821. return body.getLengthSync();
  6822. }
  6823. return null;
  6824. } else {
  6825. // body is stream
  6826. return null;
  6827. }
  6828. }
  6829. /**
  6830. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6831. *
  6832. * @param Body instance Instance of Body
  6833. * @return Void
  6834. */
  6835. function writeToStream(dest, instance) {
  6836. const body = instance.body;
  6837. if (body === null) {
  6838. // body is null
  6839. dest.end();
  6840. } else if (isBlob(body)) {
  6841. body.stream().pipe(dest);
  6842. } else if (Buffer.isBuffer(body)) {
  6843. // body is buffer
  6844. dest.write(body);
  6845. dest.end();
  6846. } else {
  6847. // body is stream
  6848. body.pipe(dest);
  6849. }
  6850. }
  6851. // expose Promise
  6852. Body.Promise = global.Promise;
  6853. /**
  6854. * headers.js
  6855. *
  6856. * Headers class offers convenient helpers
  6857. */
  6858. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6859. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6860. function validateName(name) {
  6861. name = `${name}`;
  6862. if (invalidTokenRegex.test(name) || name === '') {
  6863. throw new TypeError(`${name} is not a legal HTTP header name`);
  6864. }
  6865. }
  6866. function validateValue(value) {
  6867. value = `${value}`;
  6868. if (invalidHeaderCharRegex.test(value)) {
  6869. throw new TypeError(`${value} is not a legal HTTP header value`);
  6870. }
  6871. }
  6872. /**
  6873. * Find the key in the map object given a header name.
  6874. *
  6875. * Returns undefined if not found.
  6876. *
  6877. * @param String name Header name
  6878. * @return String|Undefined
  6879. */
  6880. function find(map, name) {
  6881. name = name.toLowerCase();
  6882. for (const key in map) {
  6883. if (key.toLowerCase() === name) {
  6884. return key;
  6885. }
  6886. }
  6887. return undefined;
  6888. }
  6889. const MAP = Symbol('map');
  6890. class Headers {
  6891. /**
  6892. * Headers class
  6893. *
  6894. * @param Object headers Response headers
  6895. * @return Void
  6896. */
  6897. constructor() {
  6898. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6899. this[MAP] = Object.create(null);
  6900. if (init instanceof Headers) {
  6901. const rawHeaders = init.raw();
  6902. const headerNames = Object.keys(rawHeaders);
  6903. for (const headerName of headerNames) {
  6904. for (const value of rawHeaders[headerName]) {
  6905. this.append(headerName, value);
  6906. }
  6907. }
  6908. return;
  6909. }
  6910. // We don't worry about converting prop to ByteString here as append()
  6911. // will handle it.
  6912. if (init == null) ; else if (typeof init === 'object') {
  6913. const method = init[Symbol.iterator];
  6914. if (method != null) {
  6915. if (typeof method !== 'function') {
  6916. throw new TypeError('Header pairs must be iterable');
  6917. }
  6918. // sequence<sequence<ByteString>>
  6919. // Note: per spec we have to first exhaust the lists then process them
  6920. const pairs = [];
  6921. for (const pair of init) {
  6922. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  6923. throw new TypeError('Each header pair must be iterable');
  6924. }
  6925. pairs.push(Array.from(pair));
  6926. }
  6927. for (const pair of pairs) {
  6928. if (pair.length !== 2) {
  6929. throw new TypeError('Each header pair must be a name/value tuple');
  6930. }
  6931. this.append(pair[0], pair[1]);
  6932. }
  6933. } else {
  6934. // record<ByteString, ByteString>
  6935. for (const key of Object.keys(init)) {
  6936. const value = init[key];
  6937. this.append(key, value);
  6938. }
  6939. }
  6940. } else {
  6941. throw new TypeError('Provided initializer must be an object');
  6942. }
  6943. }
  6944. /**
  6945. * Return combined header value given name
  6946. *
  6947. * @param String name Header name
  6948. * @return Mixed
  6949. */
  6950. get(name) {
  6951. name = `${name}`;
  6952. validateName(name);
  6953. const key = find(this[MAP], name);
  6954. if (key === undefined) {
  6955. return null;
  6956. }
  6957. return this[MAP][key].join(', ');
  6958. }
  6959. /**
  6960. * Iterate over all headers
  6961. *
  6962. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  6963. * @param Boolean thisArg `this` context for callback function
  6964. * @return Void
  6965. */
  6966. forEach(callback) {
  6967. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  6968. let pairs = getHeaders(this);
  6969. let i = 0;
  6970. while (i < pairs.length) {
  6971. var _pairs$i = pairs[i];
  6972. const name = _pairs$i[0],
  6973. value = _pairs$i[1];
  6974. callback.call(thisArg, value, name, this);
  6975. pairs = getHeaders(this);
  6976. i++;
  6977. }
  6978. }
  6979. /**
  6980. * Overwrite header values given name
  6981. *
  6982. * @param String name Header name
  6983. * @param String value Header value
  6984. * @return Void
  6985. */
  6986. set(name, value) {
  6987. name = `${name}`;
  6988. value = `${value}`;
  6989. validateName(name);
  6990. validateValue(value);
  6991. const key = find(this[MAP], name);
  6992. this[MAP][key !== undefined ? key : name] = [value];
  6993. }
  6994. /**
  6995. * Append a value onto existing header
  6996. *
  6997. * @param String name Header name
  6998. * @param String value Header value
  6999. * @return Void
  7000. */
  7001. append(name, value) {
  7002. name = `${name}`;
  7003. value = `${value}`;
  7004. validateName(name);
  7005. validateValue(value);
  7006. const key = find(this[MAP], name);
  7007. if (key !== undefined) {
  7008. this[MAP][key].push(value);
  7009. } else {
  7010. this[MAP][name] = [value];
  7011. }
  7012. }
  7013. /**
  7014. * Check for header name existence
  7015. *
  7016. * @param String name Header name
  7017. * @return Boolean
  7018. */
  7019. has(name) {
  7020. name = `${name}`;
  7021. validateName(name);
  7022. return find(this[MAP], name) !== undefined;
  7023. }
  7024. /**
  7025. * Delete all header values given name
  7026. *
  7027. * @param String name Header name
  7028. * @return Void
  7029. */
  7030. delete(name) {
  7031. name = `${name}`;
  7032. validateName(name);
  7033. const key = find(this[MAP], name);
  7034. if (key !== undefined) {
  7035. delete this[MAP][key];
  7036. }
  7037. }
  7038. /**
  7039. * Return raw headers (non-spec api)
  7040. *
  7041. * @return Object
  7042. */
  7043. raw() {
  7044. return this[MAP];
  7045. }
  7046. /**
  7047. * Get an iterator on keys.
  7048. *
  7049. * @return Iterator
  7050. */
  7051. keys() {
  7052. return createHeadersIterator(this, 'key');
  7053. }
  7054. /**
  7055. * Get an iterator on values.
  7056. *
  7057. * @return Iterator
  7058. */
  7059. values() {
  7060. return createHeadersIterator(this, 'value');
  7061. }
  7062. /**
  7063. * Get an iterator on entries.
  7064. *
  7065. * This is the default iterator of the Headers object.
  7066. *
  7067. * @return Iterator
  7068. */
  7069. [Symbol.iterator]() {
  7070. return createHeadersIterator(this, 'key+value');
  7071. }
  7072. }
  7073. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7074. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7075. value: 'Headers',
  7076. writable: false,
  7077. enumerable: false,
  7078. configurable: true
  7079. });
  7080. Object.defineProperties(Headers.prototype, {
  7081. get: { enumerable: true },
  7082. forEach: { enumerable: true },
  7083. set: { enumerable: true },
  7084. append: { enumerable: true },
  7085. has: { enumerable: true },
  7086. delete: { enumerable: true },
  7087. keys: { enumerable: true },
  7088. values: { enumerable: true },
  7089. entries: { enumerable: true }
  7090. });
  7091. function getHeaders(headers) {
  7092. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7093. const keys = Object.keys(headers[MAP]).sort();
  7094. return keys.map(kind === 'key' ? function (k) {
  7095. return k.toLowerCase();
  7096. } : kind === 'value' ? function (k) {
  7097. return headers[MAP][k].join(', ');
  7098. } : function (k) {
  7099. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7100. });
  7101. }
  7102. const INTERNAL = Symbol('internal');
  7103. function createHeadersIterator(target, kind) {
  7104. const iterator = Object.create(HeadersIteratorPrototype);
  7105. iterator[INTERNAL] = {
  7106. target,
  7107. kind,
  7108. index: 0
  7109. };
  7110. return iterator;
  7111. }
  7112. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7113. next() {
  7114. // istanbul ignore if
  7115. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7116. throw new TypeError('Value of `this` is not a HeadersIterator');
  7117. }
  7118. var _INTERNAL = this[INTERNAL];
  7119. const target = _INTERNAL.target,
  7120. kind = _INTERNAL.kind,
  7121. index = _INTERNAL.index;
  7122. const values = getHeaders(target, kind);
  7123. const len = values.length;
  7124. if (index >= len) {
  7125. return {
  7126. value: undefined,
  7127. done: true
  7128. };
  7129. }
  7130. this[INTERNAL].index = index + 1;
  7131. return {
  7132. value: values[index],
  7133. done: false
  7134. };
  7135. }
  7136. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7137. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7138. value: 'HeadersIterator',
  7139. writable: false,
  7140. enumerable: false,
  7141. configurable: true
  7142. });
  7143. /**
  7144. * Export the Headers object in a form that Node.js can consume.
  7145. *
  7146. * @param Headers headers
  7147. * @return Object
  7148. */
  7149. function exportNodeCompatibleHeaders(headers) {
  7150. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7151. // http.request() only supports string as Host header. This hack makes
  7152. // specifying custom Host header possible.
  7153. const hostHeaderKey = find(headers[MAP], 'Host');
  7154. if (hostHeaderKey !== undefined) {
  7155. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7156. }
  7157. return obj;
  7158. }
  7159. /**
  7160. * Create a Headers object from an object of headers, ignoring those that do
  7161. * not conform to HTTP grammar productions.
  7162. *
  7163. * @param Object obj Object of headers
  7164. * @return Headers
  7165. */
  7166. function createHeadersLenient(obj) {
  7167. const headers = new Headers();
  7168. for (const name of Object.keys(obj)) {
  7169. if (invalidTokenRegex.test(name)) {
  7170. continue;
  7171. }
  7172. if (Array.isArray(obj[name])) {
  7173. for (const val of obj[name]) {
  7174. if (invalidHeaderCharRegex.test(val)) {
  7175. continue;
  7176. }
  7177. if (headers[MAP][name] === undefined) {
  7178. headers[MAP][name] = [val];
  7179. } else {
  7180. headers[MAP][name].push(val);
  7181. }
  7182. }
  7183. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7184. headers[MAP][name] = [obj[name]];
  7185. }
  7186. }
  7187. return headers;
  7188. }
  7189. const INTERNALS$1 = Symbol('Response internals');
  7190. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7191. const STATUS_CODES = http.STATUS_CODES;
  7192. /**
  7193. * Response class
  7194. *
  7195. * @param Stream body Readable stream
  7196. * @param Object opts Response options
  7197. * @return Void
  7198. */
  7199. class Response {
  7200. constructor() {
  7201. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7202. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7203. Body.call(this, body, opts);
  7204. const status = opts.status || 200;
  7205. const headers = new Headers(opts.headers);
  7206. if (body != null && !headers.has('Content-Type')) {
  7207. const contentType = extractContentType(body);
  7208. if (contentType) {
  7209. headers.append('Content-Type', contentType);
  7210. }
  7211. }
  7212. this[INTERNALS$1] = {
  7213. url: opts.url,
  7214. status,
  7215. statusText: opts.statusText || STATUS_CODES[status],
  7216. headers,
  7217. counter: opts.counter
  7218. };
  7219. }
  7220. get url() {
  7221. return this[INTERNALS$1].url || '';
  7222. }
  7223. get status() {
  7224. return this[INTERNALS$1].status;
  7225. }
  7226. /**
  7227. * Convenience property representing if the request ended normally
  7228. */
  7229. get ok() {
  7230. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7231. }
  7232. get redirected() {
  7233. return this[INTERNALS$1].counter > 0;
  7234. }
  7235. get statusText() {
  7236. return this[INTERNALS$1].statusText;
  7237. }
  7238. get headers() {
  7239. return this[INTERNALS$1].headers;
  7240. }
  7241. /**
  7242. * Clone this response
  7243. *
  7244. * @return Response
  7245. */
  7246. clone() {
  7247. return new Response(clone(this), {
  7248. url: this.url,
  7249. status: this.status,
  7250. statusText: this.statusText,
  7251. headers: this.headers,
  7252. ok: this.ok,
  7253. redirected: this.redirected
  7254. });
  7255. }
  7256. }
  7257. Body.mixIn(Response.prototype);
  7258. Object.defineProperties(Response.prototype, {
  7259. url: { enumerable: true },
  7260. status: { enumerable: true },
  7261. ok: { enumerable: true },
  7262. redirected: { enumerable: true },
  7263. statusText: { enumerable: true },
  7264. headers: { enumerable: true },
  7265. clone: { enumerable: true }
  7266. });
  7267. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7268. value: 'Response',
  7269. writable: false,
  7270. enumerable: false,
  7271. configurable: true
  7272. });
  7273. const INTERNALS$2 = Symbol('Request internals');
  7274. // fix an issue where "format", "parse" aren't a named export for node <10
  7275. const parse_url = Url.parse;
  7276. const format_url = Url.format;
  7277. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7278. /**
  7279. * Check if a value is an instance of Request.
  7280. *
  7281. * @param Mixed input
  7282. * @return Boolean
  7283. */
  7284. function isRequest(input) {
  7285. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7286. }
  7287. function isAbortSignal(signal) {
  7288. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7289. return !!(proto && proto.constructor.name === 'AbortSignal');
  7290. }
  7291. /**
  7292. * Request class
  7293. *
  7294. * @param Mixed input Url or Request instance
  7295. * @param Object init Custom options
  7296. * @return Void
  7297. */
  7298. class Request {
  7299. constructor(input) {
  7300. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7301. let parsedURL;
  7302. // normalize input
  7303. if (!isRequest(input)) {
  7304. if (input && input.href) {
  7305. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7306. // will fall into this branch also (since their `toString()` will return
  7307. // `href` property anyway)
  7308. parsedURL = parse_url(input.href);
  7309. } else {
  7310. // coerce input to a string before attempting to parse
  7311. parsedURL = parse_url(`${input}`);
  7312. }
  7313. input = {};
  7314. } else {
  7315. parsedURL = parse_url(input.url);
  7316. }
  7317. let method = init.method || input.method || 'GET';
  7318. method = method.toUpperCase();
  7319. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7320. throw new TypeError('Request with GET/HEAD method cannot have body');
  7321. }
  7322. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7323. Body.call(this, inputBody, {
  7324. timeout: init.timeout || input.timeout || 0,
  7325. size: init.size || input.size || 0
  7326. });
  7327. const headers = new Headers(init.headers || input.headers || {});
  7328. if (inputBody != null && !headers.has('Content-Type')) {
  7329. const contentType = extractContentType(inputBody);
  7330. if (contentType) {
  7331. headers.append('Content-Type', contentType);
  7332. }
  7333. }
  7334. let signal = isRequest(input) ? input.signal : null;
  7335. if ('signal' in init) signal = init.signal;
  7336. if (signal != null && !isAbortSignal(signal)) {
  7337. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7338. }
  7339. this[INTERNALS$2] = {
  7340. method,
  7341. redirect: init.redirect || input.redirect || 'follow',
  7342. headers,
  7343. parsedURL,
  7344. signal
  7345. };
  7346. // node-fetch-only options
  7347. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7348. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7349. this.counter = init.counter || input.counter || 0;
  7350. this.agent = init.agent || input.agent;
  7351. }
  7352. get method() {
  7353. return this[INTERNALS$2].method;
  7354. }
  7355. get url() {
  7356. return format_url(this[INTERNALS$2].parsedURL);
  7357. }
  7358. get headers() {
  7359. return this[INTERNALS$2].headers;
  7360. }
  7361. get redirect() {
  7362. return this[INTERNALS$2].redirect;
  7363. }
  7364. get signal() {
  7365. return this[INTERNALS$2].signal;
  7366. }
  7367. /**
  7368. * Clone this request
  7369. *
  7370. * @return Request
  7371. */
  7372. clone() {
  7373. return new Request(this);
  7374. }
  7375. }
  7376. Body.mixIn(Request.prototype);
  7377. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7378. value: 'Request',
  7379. writable: false,
  7380. enumerable: false,
  7381. configurable: true
  7382. });
  7383. Object.defineProperties(Request.prototype, {
  7384. method: { enumerable: true },
  7385. url: { enumerable: true },
  7386. headers: { enumerable: true },
  7387. redirect: { enumerable: true },
  7388. clone: { enumerable: true },
  7389. signal: { enumerable: true }
  7390. });
  7391. /**
  7392. * Convert a Request to Node.js http request options.
  7393. *
  7394. * @param Request A Request instance
  7395. * @return Object The options object to be passed to http.request
  7396. */
  7397. function getNodeRequestOptions(request) {
  7398. const parsedURL = request[INTERNALS$2].parsedURL;
  7399. const headers = new Headers(request[INTERNALS$2].headers);
  7400. // fetch step 1.3
  7401. if (!headers.has('Accept')) {
  7402. headers.set('Accept', '*/*');
  7403. }
  7404. // Basic fetch
  7405. if (!parsedURL.protocol || !parsedURL.hostname) {
  7406. throw new TypeError('Only absolute URLs are supported');
  7407. }
  7408. if (!/^https?:$/.test(parsedURL.protocol)) {
  7409. throw new TypeError('Only HTTP(S) protocols are supported');
  7410. }
  7411. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7412. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7413. }
  7414. // HTTP-network-or-cache fetch steps 2.4-2.7
  7415. let contentLengthValue = null;
  7416. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7417. contentLengthValue = '0';
  7418. }
  7419. if (request.body != null) {
  7420. const totalBytes = getTotalBytes(request);
  7421. if (typeof totalBytes === 'number') {
  7422. contentLengthValue = String(totalBytes);
  7423. }
  7424. }
  7425. if (contentLengthValue) {
  7426. headers.set('Content-Length', contentLengthValue);
  7427. }
  7428. // HTTP-network-or-cache fetch step 2.11
  7429. if (!headers.has('User-Agent')) {
  7430. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7431. }
  7432. // HTTP-network-or-cache fetch step 2.15
  7433. if (request.compress && !headers.has('Accept-Encoding')) {
  7434. headers.set('Accept-Encoding', 'gzip,deflate');
  7435. }
  7436. let agent = request.agent;
  7437. if (typeof agent === 'function') {
  7438. agent = agent(parsedURL);
  7439. }
  7440. if (!headers.has('Connection') && !agent) {
  7441. headers.set('Connection', 'close');
  7442. }
  7443. // HTTP-network fetch step 4.2
  7444. // chunked encoding is handled by Node.js
  7445. return Object.assign({}, parsedURL, {
  7446. method: request.method,
  7447. headers: exportNodeCompatibleHeaders(headers),
  7448. agent
  7449. });
  7450. }
  7451. /**
  7452. * abort-error.js
  7453. *
  7454. * AbortError interface for cancelled requests
  7455. */
  7456. /**
  7457. * Create AbortError instance
  7458. *
  7459. * @param String message Error message for human
  7460. * @return AbortError
  7461. */
  7462. function AbortError(message) {
  7463. Error.call(this, message);
  7464. this.type = 'aborted';
  7465. this.message = message;
  7466. // hide custom error implementation details from end-users
  7467. Error.captureStackTrace(this, this.constructor);
  7468. }
  7469. AbortError.prototype = Object.create(Error.prototype);
  7470. AbortError.prototype.constructor = AbortError;
  7471. AbortError.prototype.name = 'AbortError';
  7472. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7473. const PassThrough$1 = Stream.PassThrough;
  7474. const resolve_url = Url.resolve;
  7475. /**
  7476. * Fetch function
  7477. *
  7478. * @param Mixed url Absolute url or Request instance
  7479. * @param Object opts Fetch options
  7480. * @return Promise
  7481. */
  7482. function fetch(url, opts) {
  7483. // allow custom promise
  7484. if (!fetch.Promise) {
  7485. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7486. }
  7487. Body.Promise = fetch.Promise;
  7488. // wrap http.request into fetch
  7489. return new fetch.Promise(function (resolve, reject) {
  7490. // build request object
  7491. const request = new Request(url, opts);
  7492. const options = getNodeRequestOptions(request);
  7493. const send = (options.protocol === 'https:' ? https : http).request;
  7494. const signal = request.signal;
  7495. let response = null;
  7496. const abort = function abort() {
  7497. let error = new AbortError('The user aborted a request.');
  7498. reject(error);
  7499. if (request.body && request.body instanceof Stream.Readable) {
  7500. request.body.destroy(error);
  7501. }
  7502. if (!response || !response.body) return;
  7503. response.body.emit('error', error);
  7504. };
  7505. if (signal && signal.aborted) {
  7506. abort();
  7507. return;
  7508. }
  7509. const abortAndFinalize = function abortAndFinalize() {
  7510. abort();
  7511. finalize();
  7512. };
  7513. // send request
  7514. const req = send(options);
  7515. let reqTimeout;
  7516. if (signal) {
  7517. signal.addEventListener('abort', abortAndFinalize);
  7518. }
  7519. function finalize() {
  7520. req.abort();
  7521. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7522. clearTimeout(reqTimeout);
  7523. }
  7524. if (request.timeout) {
  7525. req.once('socket', function (socket) {
  7526. reqTimeout = setTimeout(function () {
  7527. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7528. finalize();
  7529. }, request.timeout);
  7530. });
  7531. }
  7532. req.on('error', function (err) {
  7533. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7534. finalize();
  7535. });
  7536. req.on('response', function (res) {
  7537. clearTimeout(reqTimeout);
  7538. const headers = createHeadersLenient(res.headers);
  7539. // HTTP fetch step 5
  7540. if (fetch.isRedirect(res.statusCode)) {
  7541. // HTTP fetch step 5.2
  7542. const location = headers.get('Location');
  7543. // HTTP fetch step 5.3
  7544. const locationURL = location === null ? null : resolve_url(request.url, location);
  7545. // HTTP fetch step 5.5
  7546. switch (request.redirect) {
  7547. case 'error':
  7548. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7549. finalize();
  7550. return;
  7551. case 'manual':
  7552. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7553. if (locationURL !== null) {
  7554. // handle corrupted header
  7555. try {
  7556. headers.set('Location', locationURL);
  7557. } catch (err) {
  7558. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7559. reject(err);
  7560. }
  7561. }
  7562. break;
  7563. case 'follow':
  7564. // HTTP-redirect fetch step 2
  7565. if (locationURL === null) {
  7566. break;
  7567. }
  7568. // HTTP-redirect fetch step 5
  7569. if (request.counter >= request.follow) {
  7570. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7571. finalize();
  7572. return;
  7573. }
  7574. // HTTP-redirect fetch step 6 (counter increment)
  7575. // Create a new Request object.
  7576. const requestOpts = {
  7577. headers: new Headers(request.headers),
  7578. follow: request.follow,
  7579. counter: request.counter + 1,
  7580. agent: request.agent,
  7581. compress: request.compress,
  7582. method: request.method,
  7583. body: request.body,
  7584. signal: request.signal,
  7585. timeout: request.timeout
  7586. };
  7587. // HTTP-redirect fetch step 9
  7588. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7589. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7590. finalize();
  7591. return;
  7592. }
  7593. // HTTP-redirect fetch step 11
  7594. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7595. requestOpts.method = 'GET';
  7596. requestOpts.body = undefined;
  7597. requestOpts.headers.delete('content-length');
  7598. }
  7599. // HTTP-redirect fetch step 15
  7600. resolve(fetch(new Request(locationURL, requestOpts)));
  7601. finalize();
  7602. return;
  7603. }
  7604. }
  7605. // prepare response
  7606. res.once('end', function () {
  7607. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7608. });
  7609. let body = res.pipe(new PassThrough$1());
  7610. const response_options = {
  7611. url: request.url,
  7612. status: res.statusCode,
  7613. statusText: res.statusMessage,
  7614. headers: headers,
  7615. size: request.size,
  7616. timeout: request.timeout,
  7617. counter: request.counter
  7618. };
  7619. // HTTP-network fetch step 12.1.1.3
  7620. const codings = headers.get('Content-Encoding');
  7621. // HTTP-network fetch step 12.1.1.4: handle content codings
  7622. // in following scenarios we ignore compression support
  7623. // 1. compression support is disabled
  7624. // 2. HEAD request
  7625. // 3. no Content-Encoding header
  7626. // 4. no content response (204)
  7627. // 5. content not modified response (304)
  7628. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7629. response = new Response(body, response_options);
  7630. resolve(response);
  7631. return;
  7632. }
  7633. // For Node v6+
  7634. // Be less strict when decoding compressed responses, since sometimes
  7635. // servers send slightly invalid responses that are still accepted
  7636. // by common browsers.
  7637. // Always using Z_SYNC_FLUSH is what cURL does.
  7638. const zlibOptions = {
  7639. flush: zlib.Z_SYNC_FLUSH,
  7640. finishFlush: zlib.Z_SYNC_FLUSH
  7641. };
  7642. // for gzip
  7643. if (codings == 'gzip' || codings == 'x-gzip') {
  7644. body = body.pipe(zlib.createGunzip(zlibOptions));
  7645. response = new Response(body, response_options);
  7646. resolve(response);
  7647. return;
  7648. }
  7649. // for deflate
  7650. if (codings == 'deflate' || codings == 'x-deflate') {
  7651. // handle the infamous raw deflate response from old servers
  7652. // a hack for old IIS and Apache servers
  7653. const raw = res.pipe(new PassThrough$1());
  7654. raw.once('data', function (chunk) {
  7655. // see http://stackoverflow.com/questions/37519828
  7656. if ((chunk[0] & 0x0F) === 0x08) {
  7657. body = body.pipe(zlib.createInflate());
  7658. } else {
  7659. body = body.pipe(zlib.createInflateRaw());
  7660. }
  7661. response = new Response(body, response_options);
  7662. resolve(response);
  7663. });
  7664. return;
  7665. }
  7666. // for br
  7667. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7668. body = body.pipe(zlib.createBrotliDecompress());
  7669. response = new Response(body, response_options);
  7670. resolve(response);
  7671. return;
  7672. }
  7673. // otherwise, use response as-is
  7674. response = new Response(body, response_options);
  7675. resolve(response);
  7676. });
  7677. writeToStream(req, request);
  7678. });
  7679. }
  7680. /**
  7681. * Redirect code matching
  7682. *
  7683. * @param Number code Status code
  7684. * @return Boolean
  7685. */
  7686. fetch.isRedirect = function (code) {
  7687. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7688. };
  7689. // expose Promise
  7690. fetch.Promise = global.Promise;
  7691. module.exports = exports = fetch;
  7692. Object.defineProperty(exports, "__esModule", { value: true });
  7693. exports.default = exports;
  7694. exports.Headers = Headers;
  7695. exports.Request = Request;
  7696. exports.Response = Response;
  7697. exports.FetchError = FetchError;
  7698. /***/ }),
  7699. /***/ 462:
  7700. /***/ (function(module) {
  7701. "use strict";
  7702. // See http://www.robvanderwoude.com/escapechars.php
  7703. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7704. function escapeCommand(arg) {
  7705. // Escape meta chars
  7706. arg = arg.replace(metaCharsRegExp, '^$1');
  7707. return arg;
  7708. }
  7709. function escapeArgument(arg, doubleEscapeMetaChars) {
  7710. // Convert to string
  7711. arg = `${arg}`;
  7712. // Algorithm below is based on https://qntm.org/cmd
  7713. // Sequence of backslashes followed by a double quote:
  7714. // double up all the backslashes and escape the double quote
  7715. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7716. // Sequence of backslashes followed by the end of the string
  7717. // (which will become a double quote later):
  7718. // double up all the backslashes
  7719. arg = arg.replace(/(\\*)$/, '$1$1');
  7720. // All other backslashes occur literally
  7721. // Quote the whole thing:
  7722. arg = `"${arg}"`;
  7723. // Escape meta chars
  7724. arg = arg.replace(metaCharsRegExp, '^$1');
  7725. // Double escape meta chars if necessary
  7726. if (doubleEscapeMetaChars) {
  7727. arg = arg.replace(metaCharsRegExp, '^$1');
  7728. }
  7729. return arg;
  7730. }
  7731. module.exports.command = escapeCommand;
  7732. module.exports.argument = escapeArgument;
  7733. /***/ }),
  7734. /***/ 463:
  7735. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7736. "use strict";
  7737. Object.defineProperty(exports, '__esModule', { value: true });
  7738. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7739. var deprecation = __webpack_require__(692);
  7740. var once = _interopDefault(__webpack_require__(969));
  7741. const logOnce = once(deprecation => console.warn(deprecation));
  7742. /**
  7743. * Error with extra properties to help with debugging
  7744. */
  7745. class RequestError extends Error {
  7746. constructor(message, statusCode, options) {
  7747. super(message); // Maintains proper stack trace (only available on V8)
  7748. /* istanbul ignore next */
  7749. if (Error.captureStackTrace) {
  7750. Error.captureStackTrace(this, this.constructor);
  7751. }
  7752. this.name = "HttpError";
  7753. this.status = statusCode;
  7754. Object.defineProperty(this, "code", {
  7755. get() {
  7756. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7757. return statusCode;
  7758. }
  7759. });
  7760. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7761. const requestCopy = Object.assign({}, options.request);
  7762. if (options.request.headers.authorization) {
  7763. requestCopy.headers = Object.assign({}, options.request.headers, {
  7764. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7765. });
  7766. }
  7767. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7768. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7769. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7770. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7771. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7772. this.request = requestCopy;
  7773. }
  7774. }
  7775. exports.RequestError = RequestError;
  7776. //# sourceMappingURL=index.js.map
  7777. /***/ }),
  7778. /***/ 464:
  7779. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7780. "use strict";
  7781. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7782. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7783. return new (P || (P = Promise))(function (resolve, reject) {
  7784. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7785. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7786. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7787. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7788. });
  7789. };
  7790. var __importStar = (this && this.__importStar) || function (mod) {
  7791. if (mod && mod.__esModule) return mod;
  7792. var result = {};
  7793. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7794. result["default"] = mod;
  7795. return result;
  7796. };
  7797. var __importDefault = (this && this.__importDefault) || function (mod) {
  7798. return (mod && mod.__esModule) ? mod : { "default": mod };
  7799. };
  7800. Object.defineProperty(exports, "__esModule", { value: true });
  7801. const assert = __importStar(__webpack_require__(357));
  7802. const core = __importStar(__webpack_require__(470));
  7803. const fs = __importStar(__webpack_require__(747));
  7804. const github = __importStar(__webpack_require__(469));
  7805. const io = __importStar(__webpack_require__(1));
  7806. const path = __importStar(__webpack_require__(622));
  7807. const retryHelper = __importStar(__webpack_require__(587));
  7808. const toolCache = __importStar(__webpack_require__(533));
  7809. const v4_1 = __importDefault(__webpack_require__(826));
  7810. const IS_WINDOWS = process.platform === 'win32';
  7811. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  7812. return __awaiter(this, void 0, void 0, function* () {
  7813. // Download the archive
  7814. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7815. core.info('Downloading the archive');
  7816. return yield downloadArchive(authToken, owner, repo, ref, commit);
  7817. }));
  7818. // Write archive to disk
  7819. core.info('Writing archive to disk');
  7820. const uniqueId = v4_1.default();
  7821. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  7822. yield fs.promises.writeFile(archivePath, archiveData);
  7823. archiveData = Buffer.from(''); // Free memory
  7824. // Extract archive
  7825. core.info('Extracting the archive');
  7826. const extractPath = path.join(repositoryPath, uniqueId);
  7827. yield io.mkdirP(extractPath);
  7828. if (IS_WINDOWS) {
  7829. yield toolCache.extractZip(archivePath, extractPath);
  7830. }
  7831. else {
  7832. yield toolCache.extractTar(archivePath, extractPath);
  7833. }
  7834. io.rmRF(archivePath);
  7835. // Determine the path of the repository content. The archive contains
  7836. // a top-level folder and the repository content is inside.
  7837. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7838. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7839. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  7840. core.info(`Resolved version ${archiveVersion}`);
  7841. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  7842. // Move the files
  7843. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  7844. const sourcePath = path.join(tempRepositoryPath, fileName);
  7845. const targetPath = path.join(repositoryPath, fileName);
  7846. if (IS_WINDOWS) {
  7847. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  7848. }
  7849. else {
  7850. yield io.mv(sourcePath, targetPath);
  7851. }
  7852. }
  7853. io.rmRF(extractPath);
  7854. });
  7855. }
  7856. exports.downloadRepository = downloadRepository;
  7857. function downloadArchive(authToken, owner, repo, ref, commit) {
  7858. return __awaiter(this, void 0, void 0, function* () {
  7859. const octokit = new github.GitHub(authToken);
  7860. const params = {
  7861. owner: owner,
  7862. repo: repo,
  7863. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7864. ref: commit || ref
  7865. };
  7866. const response = yield octokit.repos.getArchiveLink(params);
  7867. if (response.status != 200) {
  7868. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  7869. }
  7870. return Buffer.from(response.data); // response.data is ArrayBuffer
  7871. });
  7872. }
  7873. /***/ }),
  7874. /***/ 469:
  7875. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7876. "use strict";
  7877. var __importDefault = (this && this.__importDefault) || function (mod) {
  7878. return (mod && mod.__esModule) ? mod : { "default": mod };
  7879. };
  7880. var __importStar = (this && this.__importStar) || function (mod) {
  7881. if (mod && mod.__esModule) return mod;
  7882. var result = {};
  7883. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7884. result["default"] = mod;
  7885. return result;
  7886. };
  7887. Object.defineProperty(exports, "__esModule", { value: true });
  7888. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7889. const graphql_1 = __webpack_require__(898);
  7890. const rest_1 = __importDefault(__webpack_require__(0));
  7891. const Context = __importStar(__webpack_require__(262));
  7892. const httpClient = __importStar(__webpack_require__(539));
  7893. // We need this in order to extend Octokit
  7894. rest_1.default.prototype = new rest_1.default();
  7895. exports.context = new Context.Context();
  7896. class GitHub extends rest_1.default {
  7897. constructor(token, opts) {
  7898. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  7899. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  7900. }
  7901. /**
  7902. * Disambiguates the constructor overload parameters
  7903. */
  7904. static disambiguate(token, opts) {
  7905. return [
  7906. typeof token === 'string' ? token : '',
  7907. typeof token === 'object' ? token : opts || {}
  7908. ];
  7909. }
  7910. static getOctokitOptions(args) {
  7911. const token = args[0];
  7912. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  7913. // Auth
  7914. const auth = GitHub.getAuthString(token, options);
  7915. if (auth) {
  7916. options.auth = auth;
  7917. }
  7918. // Proxy
  7919. const agent = GitHub.getProxyAgent(options);
  7920. if (agent) {
  7921. // Shallow clone - don't mutate the object provided by the caller
  7922. options.request = options.request ? Object.assign({}, options.request) : {};
  7923. // Set the agent
  7924. options.request.agent = agent;
  7925. }
  7926. return options;
  7927. }
  7928. static getGraphQL(args) {
  7929. const defaults = {};
  7930. const token = args[0];
  7931. const options = args[1];
  7932. // Authorization
  7933. const auth = this.getAuthString(token, options);
  7934. if (auth) {
  7935. defaults.headers = {
  7936. authorization: auth
  7937. };
  7938. }
  7939. // Proxy
  7940. const agent = GitHub.getProxyAgent(options);
  7941. if (agent) {
  7942. defaults.request = { agent };
  7943. }
  7944. return graphql_1.graphql.defaults(defaults);
  7945. }
  7946. static getAuthString(token, options) {
  7947. // Validate args
  7948. if (!token && !options.auth) {
  7949. throw new Error('Parameter token or opts.auth is required');
  7950. }
  7951. else if (token && options.auth) {
  7952. throw new Error('Parameters token and opts.auth may not both be specified');
  7953. }
  7954. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  7955. }
  7956. static getProxyAgent(options) {
  7957. var _a;
  7958. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  7959. const serverUrl = 'https://api.github.com';
  7960. if (httpClient.getProxyUrl(serverUrl)) {
  7961. const hc = new httpClient.HttpClient();
  7962. return hc.getAgent(serverUrl);
  7963. }
  7964. }
  7965. return undefined;
  7966. }
  7967. }
  7968. exports.GitHub = GitHub;
  7969. //# sourceMappingURL=github.js.map
  7970. /***/ }),
  7971. /***/ 470:
  7972. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7973. "use strict";
  7974. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7975. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7976. return new (P || (P = Promise))(function (resolve, reject) {
  7977. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7978. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7979. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7980. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7981. });
  7982. };
  7983. Object.defineProperty(exports, "__esModule", { value: true });
  7984. const command_1 = __webpack_require__(431);
  7985. const os = __webpack_require__(87);
  7986. const path = __webpack_require__(622);
  7987. /**
  7988. * The code to exit an action
  7989. */
  7990. var ExitCode;
  7991. (function (ExitCode) {
  7992. /**
  7993. * A code indicating that the action was successful
  7994. */
  7995. ExitCode[ExitCode["Success"] = 0] = "Success";
  7996. /**
  7997. * A code indicating that the action was a failure
  7998. */
  7999. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8000. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8001. //-----------------------------------------------------------------------
  8002. // Variables
  8003. //-----------------------------------------------------------------------
  8004. /**
  8005. * Sets env variable for this action and future actions in the job
  8006. * @param name the name of the variable to set
  8007. * @param val the value of the variable
  8008. */
  8009. function exportVariable(name, val) {
  8010. process.env[name] = val;
  8011. command_1.issueCommand('set-env', { name }, val);
  8012. }
  8013. exports.exportVariable = exportVariable;
  8014. /**
  8015. * Registers a secret which will get masked from logs
  8016. * @param secret value of the secret
  8017. */
  8018. function setSecret(secret) {
  8019. command_1.issueCommand('add-mask', {}, secret);
  8020. }
  8021. exports.setSecret = setSecret;
  8022. /**
  8023. * Prepends inputPath to the PATH (for this action and future actions)
  8024. * @param inputPath
  8025. */
  8026. function addPath(inputPath) {
  8027. command_1.issueCommand('add-path', {}, inputPath);
  8028. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8029. }
  8030. exports.addPath = addPath;
  8031. /**
  8032. * Gets the value of an input. The value is also trimmed.
  8033. *
  8034. * @param name name of the input to get
  8035. * @param options optional. See InputOptions.
  8036. * @returns string
  8037. */
  8038. function getInput(name, options) {
  8039. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8040. if (options && options.required && !val) {
  8041. throw new Error(`Input required and not supplied: ${name}`);
  8042. }
  8043. return val.trim();
  8044. }
  8045. exports.getInput = getInput;
  8046. /**
  8047. * Sets the value of an output.
  8048. *
  8049. * @param name name of the output to set
  8050. * @param value value to store
  8051. */
  8052. function setOutput(name, value) {
  8053. command_1.issueCommand('set-output', { name }, value);
  8054. }
  8055. exports.setOutput = setOutput;
  8056. //-----------------------------------------------------------------------
  8057. // Results
  8058. //-----------------------------------------------------------------------
  8059. /**
  8060. * Sets the action status to failed.
  8061. * When the action exits it will be with an exit code of 1
  8062. * @param message add error issue message
  8063. */
  8064. function setFailed(message) {
  8065. process.exitCode = ExitCode.Failure;
  8066. error(message);
  8067. }
  8068. exports.setFailed = setFailed;
  8069. //-----------------------------------------------------------------------
  8070. // Logging Commands
  8071. //-----------------------------------------------------------------------
  8072. /**
  8073. * Writes debug message to user log
  8074. * @param message debug message
  8075. */
  8076. function debug(message) {
  8077. command_1.issueCommand('debug', {}, message);
  8078. }
  8079. exports.debug = debug;
  8080. /**
  8081. * Adds an error issue
  8082. * @param message error issue message
  8083. */
  8084. function error(message) {
  8085. command_1.issue('error', message);
  8086. }
  8087. exports.error = error;
  8088. /**
  8089. * Adds an warning issue
  8090. * @param message warning issue message
  8091. */
  8092. function warning(message) {
  8093. command_1.issue('warning', message);
  8094. }
  8095. exports.warning = warning;
  8096. /**
  8097. * Writes info to log with console.log.
  8098. * @param message info message
  8099. */
  8100. function info(message) {
  8101. process.stdout.write(message + os.EOL);
  8102. }
  8103. exports.info = info;
  8104. /**
  8105. * Begin an output group.
  8106. *
  8107. * Output until the next `groupEnd` will be foldable in this group
  8108. *
  8109. * @param name The name of the output group
  8110. */
  8111. function startGroup(name) {
  8112. command_1.issue('group', name);
  8113. }
  8114. exports.startGroup = startGroup;
  8115. /**
  8116. * End an output group.
  8117. */
  8118. function endGroup() {
  8119. command_1.issue('endgroup');
  8120. }
  8121. exports.endGroup = endGroup;
  8122. /**
  8123. * Wrap an asynchronous function call in a group.
  8124. *
  8125. * Returns the same type as the function itself.
  8126. *
  8127. * @param name The name of the group
  8128. * @param fn The function to wrap in the group
  8129. */
  8130. function group(name, fn) {
  8131. return __awaiter(this, void 0, void 0, function* () {
  8132. startGroup(name);
  8133. let result;
  8134. try {
  8135. result = yield fn();
  8136. }
  8137. finally {
  8138. endGroup();
  8139. }
  8140. return result;
  8141. });
  8142. }
  8143. exports.group = group;
  8144. //# sourceMappingURL=core.js.map
  8145. /***/ }),
  8146. /***/ 471:
  8147. /***/ (function(module, __unusedexports, __webpack_require__) {
  8148. module.exports = authenticationBeforeRequest;
  8149. const btoa = __webpack_require__(675);
  8150. const uniq = __webpack_require__(126);
  8151. function authenticationBeforeRequest(state, options) {
  8152. if (!state.auth.type) {
  8153. return;
  8154. }
  8155. if (state.auth.type === "basic") {
  8156. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8157. options.headers.authorization = `Basic ${hash}`;
  8158. return;
  8159. }
  8160. if (state.auth.type === "token") {
  8161. options.headers.authorization = `token ${state.auth.token}`;
  8162. return;
  8163. }
  8164. if (state.auth.type === "app") {
  8165. options.headers.authorization = `Bearer ${state.auth.token}`;
  8166. const acceptHeaders = options.headers.accept
  8167. .split(",")
  8168. .concat("application/vnd.github.machine-man-preview+json");
  8169. options.headers.accept = uniq(acceptHeaders)
  8170. .filter(Boolean)
  8171. .join(",");
  8172. return;
  8173. }
  8174. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8175. if (state.auth.token) {
  8176. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8177. return;
  8178. }
  8179. const key = encodeURIComponent(state.auth.key);
  8180. const secret = encodeURIComponent(state.auth.secret);
  8181. options.url += `client_id=${key}&client_secret=${secret}`;
  8182. }
  8183. /***/ }),
  8184. /***/ 489:
  8185. /***/ (function(module, __unusedexports, __webpack_require__) {
  8186. "use strict";
  8187. const path = __webpack_require__(622);
  8188. const which = __webpack_require__(814);
  8189. const pathKey = __webpack_require__(39)();
  8190. function resolveCommandAttempt(parsed, withoutPathExt) {
  8191. const cwd = process.cwd();
  8192. const hasCustomCwd = parsed.options.cwd != null;
  8193. // If a custom `cwd` was specified, we need to change the process cwd
  8194. // because `which` will do stat calls but does not support a custom cwd
  8195. if (hasCustomCwd) {
  8196. try {
  8197. process.chdir(parsed.options.cwd);
  8198. } catch (err) {
  8199. /* Empty */
  8200. }
  8201. }
  8202. let resolved;
  8203. try {
  8204. resolved = which.sync(parsed.command, {
  8205. path: (parsed.options.env || process.env)[pathKey],
  8206. pathExt: withoutPathExt ? path.delimiter : undefined,
  8207. });
  8208. } catch (e) {
  8209. /* Empty */
  8210. } finally {
  8211. process.chdir(cwd);
  8212. }
  8213. // If we successfully resolved, ensure that an absolute path is returned
  8214. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8215. if (resolved) {
  8216. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8217. }
  8218. return resolved;
  8219. }
  8220. function resolveCommand(parsed) {
  8221. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8222. }
  8223. module.exports = resolveCommand;
  8224. /***/ }),
  8225. /***/ 510:
  8226. /***/ (function(module) {
  8227. module.exports = addHook
  8228. function addHook (state, kind, name, hook) {
  8229. var orig = hook
  8230. if (!state.registry[name]) {
  8231. state.registry[name] = []
  8232. }
  8233. if (kind === 'before') {
  8234. hook = function (method, options) {
  8235. return Promise.resolve()
  8236. .then(orig.bind(null, options))
  8237. .then(method.bind(null, options))
  8238. }
  8239. }
  8240. if (kind === 'after') {
  8241. hook = function (method, options) {
  8242. var result
  8243. return Promise.resolve()
  8244. .then(method.bind(null, options))
  8245. .then(function (result_) {
  8246. result = result_
  8247. return orig(result, options)
  8248. })
  8249. .then(function () {
  8250. return result
  8251. })
  8252. }
  8253. }
  8254. if (kind === 'error') {
  8255. hook = function (method, options) {
  8256. return Promise.resolve()
  8257. .then(method.bind(null, options))
  8258. .catch(function (error) {
  8259. return orig(error, options)
  8260. })
  8261. }
  8262. }
  8263. state.registry[name].push({
  8264. hook: hook,
  8265. orig: orig
  8266. })
  8267. }
  8268. /***/ }),
  8269. /***/ 523:
  8270. /***/ (function(module, __unusedexports, __webpack_require__) {
  8271. var register = __webpack_require__(363)
  8272. var addHook = __webpack_require__(510)
  8273. var removeHook = __webpack_require__(763)
  8274. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8275. var bind = Function.bind
  8276. var bindable = bind.bind(bind)
  8277. function bindApi (hook, state, name) {
  8278. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8279. hook.api = { remove: removeHookRef }
  8280. hook.remove = removeHookRef
  8281. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8282. var args = name ? [state, kind, name] : [state, kind]
  8283. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8284. })
  8285. }
  8286. function HookSingular () {
  8287. var singularHookName = 'h'
  8288. var singularHookState = {
  8289. registry: {}
  8290. }
  8291. var singularHook = register.bind(null, singularHookState, singularHookName)
  8292. bindApi(singularHook, singularHookState, singularHookName)
  8293. return singularHook
  8294. }
  8295. function HookCollection () {
  8296. var state = {
  8297. registry: {}
  8298. }
  8299. var hook = register.bind(null, state)
  8300. bindApi(hook, state)
  8301. return hook
  8302. }
  8303. var collectionHookDeprecationMessageDisplayed = false
  8304. function Hook () {
  8305. if (!collectionHookDeprecationMessageDisplayed) {
  8306. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8307. collectionHookDeprecationMessageDisplayed = true
  8308. }
  8309. return HookCollection()
  8310. }
  8311. Hook.Singular = HookSingular.bind()
  8312. Hook.Collection = HookCollection.bind()
  8313. module.exports = Hook
  8314. // expose constructors as a named property for TypeScript
  8315. module.exports.Hook = Hook
  8316. module.exports.Singular = Hook.Singular
  8317. module.exports.Collection = Hook.Collection
  8318. /***/ }),
  8319. /***/ 528:
  8320. /***/ (function(__unusedmodule, exports) {
  8321. "use strict";
  8322. Object.defineProperty(exports, "__esModule", { value: true });
  8323. function escape(value) {
  8324. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8325. return `\\${x}`;
  8326. });
  8327. }
  8328. exports.escape = escape;
  8329. /***/ }),
  8330. /***/ 529:
  8331. /***/ (function(module, __unusedexports, __webpack_require__) {
  8332. const factory = __webpack_require__(47);
  8333. module.exports = factory();
  8334. /***/ }),
  8335. /***/ 533:
  8336. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8337. "use strict";
  8338. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8339. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8340. return new (P || (P = Promise))(function (resolve, reject) {
  8341. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8342. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8343. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8344. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8345. });
  8346. };
  8347. Object.defineProperty(exports, "__esModule", { value: true });
  8348. const core = __webpack_require__(470);
  8349. const io = __webpack_require__(1);
  8350. const fs = __webpack_require__(747);
  8351. const os = __webpack_require__(87);
  8352. const path = __webpack_require__(622);
  8353. const httpm = __webpack_require__(874);
  8354. const semver = __webpack_require__(656);
  8355. const uuidV4 = __webpack_require__(826);
  8356. const exec_1 = __webpack_require__(986);
  8357. const assert_1 = __webpack_require__(357);
  8358. class HTTPError extends Error {
  8359. constructor(httpStatusCode) {
  8360. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8361. this.httpStatusCode = httpStatusCode;
  8362. Object.setPrototypeOf(this, new.target.prototype);
  8363. }
  8364. }
  8365. exports.HTTPError = HTTPError;
  8366. const IS_WINDOWS = process.platform === 'win32';
  8367. const userAgent = 'actions/tool-cache';
  8368. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8369. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8370. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8371. // If directories not found, place them in common temp locations
  8372. if (!tempDirectory || !cacheRoot) {
  8373. let baseLocation;
  8374. if (IS_WINDOWS) {
  8375. // On windows use the USERPROFILE env variable
  8376. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8377. }
  8378. else {
  8379. if (process.platform === 'darwin') {
  8380. baseLocation = '/Users';
  8381. }
  8382. else {
  8383. baseLocation = '/home';
  8384. }
  8385. }
  8386. if (!tempDirectory) {
  8387. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8388. }
  8389. if (!cacheRoot) {
  8390. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8391. }
  8392. }
  8393. /**
  8394. * Download a tool from an url and stream it into a file
  8395. *
  8396. * @param url url of tool to download
  8397. * @returns path to downloaded tool
  8398. */
  8399. function downloadTool(url) {
  8400. return __awaiter(this, void 0, void 0, function* () {
  8401. // Wrap in a promise so that we can resolve from within stream callbacks
  8402. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8403. try {
  8404. const http = new httpm.HttpClient(userAgent, [], {
  8405. allowRetries: true,
  8406. maxRetries: 3
  8407. });
  8408. const destPath = path.join(tempDirectory, uuidV4());
  8409. yield io.mkdirP(tempDirectory);
  8410. core.debug(`Downloading ${url}`);
  8411. core.debug(`Downloading ${destPath}`);
  8412. if (fs.existsSync(destPath)) {
  8413. throw new Error(`Destination file path ${destPath} already exists`);
  8414. }
  8415. const response = yield http.get(url);
  8416. if (response.message.statusCode !== 200) {
  8417. const err = new HTTPError(response.message.statusCode);
  8418. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8419. throw err;
  8420. }
  8421. const file = fs.createWriteStream(destPath);
  8422. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8423. try {
  8424. const stream = response.message.pipe(file);
  8425. stream.on('close', () => {
  8426. core.debug('download complete');
  8427. resolve(destPath);
  8428. });
  8429. }
  8430. catch (err) {
  8431. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8432. reject(err);
  8433. }
  8434. }));
  8435. file.on('error', err => {
  8436. file.end();
  8437. reject(err);
  8438. });
  8439. }
  8440. catch (err) {
  8441. reject(err);
  8442. }
  8443. }));
  8444. });
  8445. }
  8446. exports.downloadTool = downloadTool;
  8447. /**
  8448. * Extract a .7z file
  8449. *
  8450. * @param file path to the .7z file
  8451. * @param dest destination directory. Optional.
  8452. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8453. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8454. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8455. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8456. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8457. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8458. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8459. * to 7zr.exe can be pass to this function.
  8460. * @returns path to the destination directory
  8461. */
  8462. function extract7z(file, dest, _7zPath) {
  8463. return __awaiter(this, void 0, void 0, function* () {
  8464. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8465. assert_1.ok(file, 'parameter "file" is required');
  8466. dest = dest || (yield _createExtractFolder(dest));
  8467. const originalCwd = process.cwd();
  8468. process.chdir(dest);
  8469. if (_7zPath) {
  8470. try {
  8471. const args = [
  8472. 'x',
  8473. '-bb1',
  8474. '-bd',
  8475. '-sccUTF-8',
  8476. file
  8477. ];
  8478. const options = {
  8479. silent: true
  8480. };
  8481. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8482. }
  8483. finally {
  8484. process.chdir(originalCwd);
  8485. }
  8486. }
  8487. else {
  8488. const escapedScript = path
  8489. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8490. .replace(/'/g, "''")
  8491. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8492. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8493. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8494. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8495. const args = [
  8496. '-NoLogo',
  8497. '-Sta',
  8498. '-NoProfile',
  8499. '-NonInteractive',
  8500. '-ExecutionPolicy',
  8501. 'Unrestricted',
  8502. '-Command',
  8503. command
  8504. ];
  8505. const options = {
  8506. silent: true
  8507. };
  8508. try {
  8509. const powershellPath = yield io.which('powershell', true);
  8510. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8511. }
  8512. finally {
  8513. process.chdir(originalCwd);
  8514. }
  8515. }
  8516. return dest;
  8517. });
  8518. }
  8519. exports.extract7z = extract7z;
  8520. /**
  8521. * Extract a tar
  8522. *
  8523. * @param file path to the tar
  8524. * @param dest destination directory. Optional.
  8525. * @param flags flags for the tar. Optional.
  8526. * @returns path to the destination directory
  8527. */
  8528. function extractTar(file, dest, flags = 'xz') {
  8529. return __awaiter(this, void 0, void 0, function* () {
  8530. if (!file) {
  8531. throw new Error("parameter 'file' is required");
  8532. }
  8533. dest = dest || (yield _createExtractFolder(dest));
  8534. const tarPath = yield io.which('tar', true);
  8535. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8536. return dest;
  8537. });
  8538. }
  8539. exports.extractTar = extractTar;
  8540. /**
  8541. * Extract a zip
  8542. *
  8543. * @param file path to the zip
  8544. * @param dest destination directory. Optional.
  8545. * @returns path to the destination directory
  8546. */
  8547. function extractZip(file, dest) {
  8548. return __awaiter(this, void 0, void 0, function* () {
  8549. if (!file) {
  8550. throw new Error("parameter 'file' is required");
  8551. }
  8552. dest = dest || (yield _createExtractFolder(dest));
  8553. if (IS_WINDOWS) {
  8554. yield extractZipWin(file, dest);
  8555. }
  8556. else {
  8557. yield extractZipNix(file, dest);
  8558. }
  8559. return dest;
  8560. });
  8561. }
  8562. exports.extractZip = extractZip;
  8563. function extractZipWin(file, dest) {
  8564. return __awaiter(this, void 0, void 0, function* () {
  8565. // build the powershell command
  8566. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8567. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8568. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8569. // run powershell
  8570. const powershellPath = yield io.which('powershell');
  8571. const args = [
  8572. '-NoLogo',
  8573. '-Sta',
  8574. '-NoProfile',
  8575. '-NonInteractive',
  8576. '-ExecutionPolicy',
  8577. 'Unrestricted',
  8578. '-Command',
  8579. command
  8580. ];
  8581. yield exec_1.exec(`"${powershellPath}"`, args);
  8582. });
  8583. }
  8584. function extractZipNix(file, dest) {
  8585. return __awaiter(this, void 0, void 0, function* () {
  8586. const unzipPath = yield io.which('unzip');
  8587. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8588. });
  8589. }
  8590. /**
  8591. * Caches a directory and installs it into the tool cacheDir
  8592. *
  8593. * @param sourceDir the directory to cache into tools
  8594. * @param tool tool name
  8595. * @param version version of the tool. semver format
  8596. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8597. */
  8598. function cacheDir(sourceDir, tool, version, arch) {
  8599. return __awaiter(this, void 0, void 0, function* () {
  8600. version = semver.clean(version) || version;
  8601. arch = arch || os.arch();
  8602. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8603. core.debug(`source dir: ${sourceDir}`);
  8604. if (!fs.statSync(sourceDir).isDirectory()) {
  8605. throw new Error('sourceDir is not a directory');
  8606. }
  8607. // Create the tool dir
  8608. const destPath = yield _createToolPath(tool, version, arch);
  8609. // copy each child item. do not move. move can fail on Windows
  8610. // due to anti-virus software having an open handle on a file.
  8611. for (const itemName of fs.readdirSync(sourceDir)) {
  8612. const s = path.join(sourceDir, itemName);
  8613. yield io.cp(s, destPath, { recursive: true });
  8614. }
  8615. // write .complete
  8616. _completeToolPath(tool, version, arch);
  8617. return destPath;
  8618. });
  8619. }
  8620. exports.cacheDir = cacheDir;
  8621. /**
  8622. * Caches a downloaded file (GUID) and installs it
  8623. * into the tool cache with a given targetName
  8624. *
  8625. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8626. * @param targetFile the name of the file name in the tools directory
  8627. * @param tool tool name
  8628. * @param version version of the tool. semver format
  8629. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8630. */
  8631. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8632. return __awaiter(this, void 0, void 0, function* () {
  8633. version = semver.clean(version) || version;
  8634. arch = arch || os.arch();
  8635. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8636. core.debug(`source file: ${sourceFile}`);
  8637. if (!fs.statSync(sourceFile).isFile()) {
  8638. throw new Error('sourceFile is not a file');
  8639. }
  8640. // create the tool dir
  8641. const destFolder = yield _createToolPath(tool, version, arch);
  8642. // copy instead of move. move can fail on Windows due to
  8643. // anti-virus software having an open handle on a file.
  8644. const destPath = path.join(destFolder, targetFile);
  8645. core.debug(`destination file ${destPath}`);
  8646. yield io.cp(sourceFile, destPath);
  8647. // write .complete
  8648. _completeToolPath(tool, version, arch);
  8649. return destFolder;
  8650. });
  8651. }
  8652. exports.cacheFile = cacheFile;
  8653. /**
  8654. * Finds the path to a tool version in the local installed tool cache
  8655. *
  8656. * @param toolName name of the tool
  8657. * @param versionSpec version of the tool
  8658. * @param arch optional arch. defaults to arch of computer
  8659. */
  8660. function find(toolName, versionSpec, arch) {
  8661. if (!toolName) {
  8662. throw new Error('toolName parameter is required');
  8663. }
  8664. if (!versionSpec) {
  8665. throw new Error('versionSpec parameter is required');
  8666. }
  8667. arch = arch || os.arch();
  8668. // attempt to resolve an explicit version
  8669. if (!_isExplicitVersion(versionSpec)) {
  8670. const localVersions = findAllVersions(toolName, arch);
  8671. const match = _evaluateVersions(localVersions, versionSpec);
  8672. versionSpec = match;
  8673. }
  8674. // check for the explicit version in the cache
  8675. let toolPath = '';
  8676. if (versionSpec) {
  8677. versionSpec = semver.clean(versionSpec) || '';
  8678. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8679. core.debug(`checking cache: ${cachePath}`);
  8680. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8681. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8682. toolPath = cachePath;
  8683. }
  8684. else {
  8685. core.debug('not found');
  8686. }
  8687. }
  8688. return toolPath;
  8689. }
  8690. exports.find = find;
  8691. /**
  8692. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8693. *
  8694. * @param toolName name of the tool
  8695. * @param arch optional arch. defaults to arch of computer
  8696. */
  8697. function findAllVersions(toolName, arch) {
  8698. const versions = [];
  8699. arch = arch || os.arch();
  8700. const toolPath = path.join(cacheRoot, toolName);
  8701. if (fs.existsSync(toolPath)) {
  8702. const children = fs.readdirSync(toolPath);
  8703. for (const child of children) {
  8704. if (_isExplicitVersion(child)) {
  8705. const fullPath = path.join(toolPath, child, arch || '');
  8706. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8707. versions.push(child);
  8708. }
  8709. }
  8710. }
  8711. }
  8712. return versions;
  8713. }
  8714. exports.findAllVersions = findAllVersions;
  8715. function _createExtractFolder(dest) {
  8716. return __awaiter(this, void 0, void 0, function* () {
  8717. if (!dest) {
  8718. // create a temp dir
  8719. dest = path.join(tempDirectory, uuidV4());
  8720. }
  8721. yield io.mkdirP(dest);
  8722. return dest;
  8723. });
  8724. }
  8725. function _createToolPath(tool, version, arch) {
  8726. return __awaiter(this, void 0, void 0, function* () {
  8727. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8728. core.debug(`destination ${folderPath}`);
  8729. const markerPath = `${folderPath}.complete`;
  8730. yield io.rmRF(folderPath);
  8731. yield io.rmRF(markerPath);
  8732. yield io.mkdirP(folderPath);
  8733. return folderPath;
  8734. });
  8735. }
  8736. function _completeToolPath(tool, version, arch) {
  8737. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8738. const markerPath = `${folderPath}.complete`;
  8739. fs.writeFileSync(markerPath, '');
  8740. core.debug('finished caching tool');
  8741. }
  8742. function _isExplicitVersion(versionSpec) {
  8743. const c = semver.clean(versionSpec) || '';
  8744. core.debug(`isExplicit: ${c}`);
  8745. const valid = semver.valid(c) != null;
  8746. core.debug(`explicit? ${valid}`);
  8747. return valid;
  8748. }
  8749. function _evaluateVersions(versions, versionSpec) {
  8750. let version = '';
  8751. core.debug(`evaluating ${versions.length} versions`);
  8752. versions = versions.sort((a, b) => {
  8753. if (semver.gt(a, b)) {
  8754. return 1;
  8755. }
  8756. return -1;
  8757. });
  8758. for (let i = versions.length - 1; i >= 0; i--) {
  8759. const potential = versions[i];
  8760. const satisfied = semver.satisfies(potential, versionSpec);
  8761. if (satisfied) {
  8762. version = potential;
  8763. break;
  8764. }
  8765. }
  8766. if (version) {
  8767. core.debug(`matched: ${version}`);
  8768. }
  8769. else {
  8770. core.debug('match not found');
  8771. }
  8772. return version;
  8773. }
  8774. //# sourceMappingURL=tool-cache.js.map
  8775. /***/ }),
  8776. /***/ 536:
  8777. /***/ (function(module, __unusedexports, __webpack_require__) {
  8778. module.exports = hasFirstPage
  8779. const deprecate = __webpack_require__(370)
  8780. const getPageLinks = __webpack_require__(577)
  8781. function hasFirstPage (link) {
  8782. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8783. return getPageLinks(link).first
  8784. }
  8785. /***/ }),
  8786. /***/ 539:
  8787. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8788. "use strict";
  8789. Object.defineProperty(exports, "__esModule", { value: true });
  8790. const url = __webpack_require__(835);
  8791. const http = __webpack_require__(605);
  8792. const https = __webpack_require__(211);
  8793. const pm = __webpack_require__(950);
  8794. let tunnel;
  8795. var HttpCodes;
  8796. (function (HttpCodes) {
  8797. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  8798. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  8799. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  8800. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  8801. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  8802. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  8803. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  8804. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  8805. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  8806. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  8807. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  8808. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  8809. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  8810. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  8811. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  8812. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  8813. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  8814. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  8815. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  8816. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  8817. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  8818. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  8819. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  8820. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  8821. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  8822. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  8823. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  8824. /**
  8825. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  8826. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  8827. */
  8828. function getProxyUrl(serverUrl) {
  8829. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  8830. return proxyUrl ? proxyUrl.href : '';
  8831. }
  8832. exports.getProxyUrl = getProxyUrl;
  8833. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  8834. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  8835. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  8836. const ExponentialBackoffCeiling = 10;
  8837. const ExponentialBackoffTimeSlice = 5;
  8838. class HttpClientResponse {
  8839. constructor(message) {
  8840. this.message = message;
  8841. }
  8842. readBody() {
  8843. return new Promise(async (resolve, reject) => {
  8844. let output = Buffer.alloc(0);
  8845. this.message.on('data', (chunk) => {
  8846. output = Buffer.concat([output, chunk]);
  8847. });
  8848. this.message.on('end', () => {
  8849. resolve(output.toString());
  8850. });
  8851. });
  8852. }
  8853. }
  8854. exports.HttpClientResponse = HttpClientResponse;
  8855. function isHttps(requestUrl) {
  8856. let parsedUrl = url.parse(requestUrl);
  8857. return parsedUrl.protocol === 'https:';
  8858. }
  8859. exports.isHttps = isHttps;
  8860. class HttpClient {
  8861. constructor(userAgent, handlers, requestOptions) {
  8862. this._ignoreSslError = false;
  8863. this._allowRedirects = true;
  8864. this._allowRedirectDowngrade = false;
  8865. this._maxRedirects = 50;
  8866. this._allowRetries = false;
  8867. this._maxRetries = 1;
  8868. this._keepAlive = false;
  8869. this._disposed = false;
  8870. this.userAgent = userAgent;
  8871. this.handlers = handlers || [];
  8872. this.requestOptions = requestOptions;
  8873. if (requestOptions) {
  8874. if (requestOptions.ignoreSslError != null) {
  8875. this._ignoreSslError = requestOptions.ignoreSslError;
  8876. }
  8877. this._socketTimeout = requestOptions.socketTimeout;
  8878. if (requestOptions.allowRedirects != null) {
  8879. this._allowRedirects = requestOptions.allowRedirects;
  8880. }
  8881. if (requestOptions.allowRedirectDowngrade != null) {
  8882. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  8883. }
  8884. if (requestOptions.maxRedirects != null) {
  8885. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  8886. }
  8887. if (requestOptions.keepAlive != null) {
  8888. this._keepAlive = requestOptions.keepAlive;
  8889. }
  8890. if (requestOptions.allowRetries != null) {
  8891. this._allowRetries = requestOptions.allowRetries;
  8892. }
  8893. if (requestOptions.maxRetries != null) {
  8894. this._maxRetries = requestOptions.maxRetries;
  8895. }
  8896. }
  8897. }
  8898. options(requestUrl, additionalHeaders) {
  8899. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  8900. }
  8901. get(requestUrl, additionalHeaders) {
  8902. return this.request('GET', requestUrl, null, additionalHeaders || {});
  8903. }
  8904. del(requestUrl, additionalHeaders) {
  8905. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  8906. }
  8907. post(requestUrl, data, additionalHeaders) {
  8908. return this.request('POST', requestUrl, data, additionalHeaders || {});
  8909. }
  8910. patch(requestUrl, data, additionalHeaders) {
  8911. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  8912. }
  8913. put(requestUrl, data, additionalHeaders) {
  8914. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  8915. }
  8916. head(requestUrl, additionalHeaders) {
  8917. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  8918. }
  8919. sendStream(verb, requestUrl, stream, additionalHeaders) {
  8920. return this.request(verb, requestUrl, stream, additionalHeaders);
  8921. }
  8922. /**
  8923. * Makes a raw http request.
  8924. * All other methods such as get, post, patch, and request ultimately call this.
  8925. * Prefer get, del, post and patch
  8926. */
  8927. async request(verb, requestUrl, data, headers) {
  8928. if (this._disposed) {
  8929. throw new Error("Client has already been disposed.");
  8930. }
  8931. let parsedUrl = url.parse(requestUrl);
  8932. let info = this._prepareRequest(verb, parsedUrl, headers);
  8933. // Only perform retries on reads since writes may not be idempotent.
  8934. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  8935. let numTries = 0;
  8936. let response;
  8937. while (numTries < maxTries) {
  8938. response = await this.requestRaw(info, data);
  8939. // Check if it's an authentication challenge
  8940. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  8941. let authenticationHandler;
  8942. for (let i = 0; i < this.handlers.length; i++) {
  8943. if (this.handlers[i].canHandleAuthentication(response)) {
  8944. authenticationHandler = this.handlers[i];
  8945. break;
  8946. }
  8947. }
  8948. if (authenticationHandler) {
  8949. return authenticationHandler.handleAuthentication(this, info, data);
  8950. }
  8951. else {
  8952. // We have received an unauthorized response but have no handlers to handle it.
  8953. // Let the response return to the caller.
  8954. return response;
  8955. }
  8956. }
  8957. let redirectsRemaining = this._maxRedirects;
  8958. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  8959. && this._allowRedirects
  8960. && redirectsRemaining > 0) {
  8961. const redirectUrl = response.message.headers["location"];
  8962. if (!redirectUrl) {
  8963. // if there's no location to redirect to, we won't
  8964. break;
  8965. }
  8966. let parsedRedirectUrl = url.parse(redirectUrl);
  8967. if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
  8968. throw new Error("Redirect from HTTPS to HTTP protocol. This downgrade is not allowed for security reasons. If you want to allow this behavior, set the allowRedirectDowngrade option to true.");
  8969. }
  8970. // we need to finish reading the response before reassigning response
  8971. // which will leak the open socket.
  8972. await response.readBody();
  8973. // let's make the request with the new redirectUrl
  8974. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  8975. response = await this.requestRaw(info, data);
  8976. redirectsRemaining--;
  8977. }
  8978. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  8979. // If not a retry code, return immediately instead of retrying
  8980. return response;
  8981. }
  8982. numTries += 1;
  8983. if (numTries < maxTries) {
  8984. await response.readBody();
  8985. await this._performExponentialBackoff(numTries);
  8986. }
  8987. }
  8988. return response;
  8989. }
  8990. /**
  8991. * Needs to be called if keepAlive is set to true in request options.
  8992. */
  8993. dispose() {
  8994. if (this._agent) {
  8995. this._agent.destroy();
  8996. }
  8997. this._disposed = true;
  8998. }
  8999. /**
  9000. * Raw request.
  9001. * @param info
  9002. * @param data
  9003. */
  9004. requestRaw(info, data) {
  9005. return new Promise((resolve, reject) => {
  9006. let callbackForResult = function (err, res) {
  9007. if (err) {
  9008. reject(err);
  9009. }
  9010. resolve(res);
  9011. };
  9012. this.requestRawWithCallback(info, data, callbackForResult);
  9013. });
  9014. }
  9015. /**
  9016. * Raw request with callback.
  9017. * @param info
  9018. * @param data
  9019. * @param onResult
  9020. */
  9021. requestRawWithCallback(info, data, onResult) {
  9022. let socket;
  9023. if (typeof (data) === 'string') {
  9024. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  9025. }
  9026. let callbackCalled = false;
  9027. let handleResult = (err, res) => {
  9028. if (!callbackCalled) {
  9029. callbackCalled = true;
  9030. onResult(err, res);
  9031. }
  9032. };
  9033. let req = info.httpModule.request(info.options, (msg) => {
  9034. let res = new HttpClientResponse(msg);
  9035. handleResult(null, res);
  9036. });
  9037. req.on('socket', (sock) => {
  9038. socket = sock;
  9039. });
  9040. // If we ever get disconnected, we want the socket to timeout eventually
  9041. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9042. if (socket) {
  9043. socket.end();
  9044. }
  9045. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9046. });
  9047. req.on('error', function (err) {
  9048. // err has statusCode property
  9049. // res should have headers
  9050. handleResult(err, null);
  9051. });
  9052. if (data && typeof (data) === 'string') {
  9053. req.write(data, 'utf8');
  9054. }
  9055. if (data && typeof (data) !== 'string') {
  9056. data.on('close', function () {
  9057. req.end();
  9058. });
  9059. data.pipe(req);
  9060. }
  9061. else {
  9062. req.end();
  9063. }
  9064. }
  9065. /**
  9066. * Gets an http agent. This function is useful when you need an http agent that handles
  9067. * routing through a proxy server - depending upon the url and proxy environment variables.
  9068. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9069. */
  9070. getAgent(serverUrl) {
  9071. let parsedUrl = url.parse(serverUrl);
  9072. return this._getAgent(parsedUrl);
  9073. }
  9074. _prepareRequest(method, requestUrl, headers) {
  9075. const info = {};
  9076. info.parsedUrl = requestUrl;
  9077. const usingSsl = info.parsedUrl.protocol === 'https:';
  9078. info.httpModule = usingSsl ? https : http;
  9079. const defaultPort = usingSsl ? 443 : 80;
  9080. info.options = {};
  9081. info.options.host = info.parsedUrl.hostname;
  9082. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  9083. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9084. info.options.method = method;
  9085. info.options.headers = this._mergeHeaders(headers);
  9086. if (this.userAgent != null) {
  9087. info.options.headers["user-agent"] = this.userAgent;
  9088. }
  9089. info.options.agent = this._getAgent(info.parsedUrl);
  9090. // gives handlers an opportunity to participate
  9091. if (this.handlers) {
  9092. this.handlers.forEach((handler) => {
  9093. handler.prepareRequest(info.options);
  9094. });
  9095. }
  9096. return info;
  9097. }
  9098. _mergeHeaders(headers) {
  9099. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  9100. if (this.requestOptions && this.requestOptions.headers) {
  9101. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9102. }
  9103. return lowercaseKeys(headers || {});
  9104. }
  9105. _getAgent(parsedUrl) {
  9106. let agent;
  9107. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9108. let useProxy = proxyUrl && proxyUrl.hostname;
  9109. if (this._keepAlive && useProxy) {
  9110. agent = this._proxyAgent;
  9111. }
  9112. if (this._keepAlive && !useProxy) {
  9113. agent = this._agent;
  9114. }
  9115. // if agent is already assigned use that agent.
  9116. if (!!agent) {
  9117. return agent;
  9118. }
  9119. const usingSsl = parsedUrl.protocol === 'https:';
  9120. let maxSockets = 100;
  9121. if (!!this.requestOptions) {
  9122. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9123. }
  9124. if (useProxy) {
  9125. // If using proxy, need tunnel
  9126. if (!tunnel) {
  9127. tunnel = __webpack_require__(335);
  9128. }
  9129. const agentOptions = {
  9130. maxSockets: maxSockets,
  9131. keepAlive: this._keepAlive,
  9132. proxy: {
  9133. proxyAuth: proxyUrl.auth,
  9134. host: proxyUrl.hostname,
  9135. port: proxyUrl.port
  9136. },
  9137. };
  9138. let tunnelAgent;
  9139. const overHttps = proxyUrl.protocol === 'https:';
  9140. if (usingSsl) {
  9141. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9142. }
  9143. else {
  9144. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9145. }
  9146. agent = tunnelAgent(agentOptions);
  9147. this._proxyAgent = agent;
  9148. }
  9149. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9150. if (this._keepAlive && !agent) {
  9151. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9152. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9153. this._agent = agent;
  9154. }
  9155. // if not using private agent and tunnel agent isn't setup then use global agent
  9156. if (!agent) {
  9157. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9158. }
  9159. if (usingSsl && this._ignoreSslError) {
  9160. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9161. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9162. // we have to cast it to any and change it directly
  9163. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  9164. }
  9165. return agent;
  9166. }
  9167. _performExponentialBackoff(retryNumber) {
  9168. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9169. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9170. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9171. }
  9172. }
  9173. exports.HttpClient = HttpClient;
  9174. /***/ }),
  9175. /***/ 550:
  9176. /***/ (function(module, __unusedexports, __webpack_require__) {
  9177. module.exports = getNextPage
  9178. const getPage = __webpack_require__(265)
  9179. function getNextPage (octokit, link, headers) {
  9180. return getPage(octokit, link, 'next', headers)
  9181. }
  9182. /***/ }),
  9183. /***/ 558:
  9184. /***/ (function(module, __unusedexports, __webpack_require__) {
  9185. module.exports = hasPreviousPage
  9186. const deprecate = __webpack_require__(370)
  9187. const getPageLinks = __webpack_require__(577)
  9188. function hasPreviousPage (link) {
  9189. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9190. return getPageLinks(link).prev
  9191. }
  9192. /***/ }),
  9193. /***/ 559:
  9194. /***/ (function(__unusedmodule, exports) {
  9195. "use strict";
  9196. Object.defineProperty(exports, "__esModule", { value: true });
  9197. class GitVersion {
  9198. /**
  9199. * Used for comparing the version of git and git-lfs against the minimum required version
  9200. * @param version the version string, e.g. 1.2 or 1.2.3
  9201. */
  9202. constructor(version) {
  9203. this.major = NaN;
  9204. this.minor = NaN;
  9205. this.patch = NaN;
  9206. if (version) {
  9207. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9208. if (match) {
  9209. this.major = Number(match[1]);
  9210. this.minor = Number(match[2]);
  9211. if (match[4]) {
  9212. this.patch = Number(match[4]);
  9213. }
  9214. }
  9215. }
  9216. }
  9217. /**
  9218. * Compares the instance against a minimum required version
  9219. * @param minimum Minimum version
  9220. */
  9221. checkMinimum(minimum) {
  9222. if (!minimum.isValid()) {
  9223. throw new Error('Arg minimum is not a valid version');
  9224. }
  9225. // Major is insufficient
  9226. if (this.major < minimum.major) {
  9227. return false;
  9228. }
  9229. // Major is equal
  9230. if (this.major === minimum.major) {
  9231. // Minor is insufficient
  9232. if (this.minor < minimum.minor) {
  9233. return false;
  9234. }
  9235. // Minor is equal
  9236. if (this.minor === minimum.minor) {
  9237. // Patch is insufficient
  9238. if (this.patch && this.patch < (minimum.patch || 0)) {
  9239. return false;
  9240. }
  9241. }
  9242. }
  9243. return true;
  9244. }
  9245. /**
  9246. * Indicates whether the instance was constructed from a valid version string
  9247. */
  9248. isValid() {
  9249. return !isNaN(this.major);
  9250. }
  9251. /**
  9252. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9253. */
  9254. toString() {
  9255. let result = '';
  9256. if (this.isValid()) {
  9257. result = `${this.major}.${this.minor}`;
  9258. if (!isNaN(this.patch)) {
  9259. result += `.${this.patch}`;
  9260. }
  9261. }
  9262. return result;
  9263. }
  9264. }
  9265. exports.GitVersion = GitVersion;
  9266. /***/ }),
  9267. /***/ 562:
  9268. /***/ (function(module, __unusedexports, __webpack_require__) {
  9269. var once = __webpack_require__(969);
  9270. var noop = function() {};
  9271. var isRequest = function(stream) {
  9272. return stream.setHeader && typeof stream.abort === 'function';
  9273. };
  9274. var isChildProcess = function(stream) {
  9275. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9276. };
  9277. var eos = function(stream, opts, callback) {
  9278. if (typeof opts === 'function') return eos(stream, null, opts);
  9279. if (!opts) opts = {};
  9280. callback = once(callback || noop);
  9281. var ws = stream._writableState;
  9282. var rs = stream._readableState;
  9283. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9284. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9285. var cancelled = false;
  9286. var onlegacyfinish = function() {
  9287. if (!stream.writable) onfinish();
  9288. };
  9289. var onfinish = function() {
  9290. writable = false;
  9291. if (!readable) callback.call(stream);
  9292. };
  9293. var onend = function() {
  9294. readable = false;
  9295. if (!writable) callback.call(stream);
  9296. };
  9297. var onexit = function(exitCode) {
  9298. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9299. };
  9300. var onerror = function(err) {
  9301. callback.call(stream, err);
  9302. };
  9303. var onclose = function() {
  9304. process.nextTick(onclosenexttick);
  9305. };
  9306. var onclosenexttick = function() {
  9307. if (cancelled) return;
  9308. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9309. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9310. };
  9311. var onrequest = function() {
  9312. stream.req.on('finish', onfinish);
  9313. };
  9314. if (isRequest(stream)) {
  9315. stream.on('complete', onfinish);
  9316. stream.on('abort', onclose);
  9317. if (stream.req) onrequest();
  9318. else stream.on('request', onrequest);
  9319. } else if (writable && !ws) { // legacy streams
  9320. stream.on('end', onlegacyfinish);
  9321. stream.on('close', onlegacyfinish);
  9322. }
  9323. if (isChildProcess(stream)) stream.on('exit', onexit);
  9324. stream.on('end', onend);
  9325. stream.on('finish', onfinish);
  9326. if (opts.error !== false) stream.on('error', onerror);
  9327. stream.on('close', onclose);
  9328. return function() {
  9329. cancelled = true;
  9330. stream.removeListener('complete', onfinish);
  9331. stream.removeListener('abort', onclose);
  9332. stream.removeListener('request', onrequest);
  9333. if (stream.req) stream.req.removeListener('finish', onfinish);
  9334. stream.removeListener('end', onlegacyfinish);
  9335. stream.removeListener('close', onlegacyfinish);
  9336. stream.removeListener('finish', onfinish);
  9337. stream.removeListener('exit', onexit);
  9338. stream.removeListener('end', onend);
  9339. stream.removeListener('error', onerror);
  9340. stream.removeListener('close', onclose);
  9341. };
  9342. };
  9343. module.exports = eos;
  9344. /***/ }),
  9345. /***/ 563:
  9346. /***/ (function(module, __unusedexports, __webpack_require__) {
  9347. module.exports = getPreviousPage
  9348. const getPage = __webpack_require__(265)
  9349. function getPreviousPage (octokit, link, headers) {
  9350. return getPage(octokit, link, 'prev', headers)
  9351. }
  9352. /***/ }),
  9353. /***/ 568:
  9354. /***/ (function(module, __unusedexports, __webpack_require__) {
  9355. "use strict";
  9356. const path = __webpack_require__(622);
  9357. const niceTry = __webpack_require__(948);
  9358. const resolveCommand = __webpack_require__(489);
  9359. const escape = __webpack_require__(462);
  9360. const readShebang = __webpack_require__(389);
  9361. const semver = __webpack_require__(280);
  9362. const isWin = process.platform === 'win32';
  9363. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9364. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9365. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9366. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9367. function detectShebang(parsed) {
  9368. parsed.file = resolveCommand(parsed);
  9369. const shebang = parsed.file && readShebang(parsed.file);
  9370. if (shebang) {
  9371. parsed.args.unshift(parsed.file);
  9372. parsed.command = shebang;
  9373. return resolveCommand(parsed);
  9374. }
  9375. return parsed.file;
  9376. }
  9377. function parseNonShell(parsed) {
  9378. if (!isWin) {
  9379. return parsed;
  9380. }
  9381. // Detect & add support for shebangs
  9382. const commandFile = detectShebang(parsed);
  9383. // We don't need a shell if the command filename is an executable
  9384. const needsShell = !isExecutableRegExp.test(commandFile);
  9385. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9386. // Note that `forceShell` is an hidden option used only in tests
  9387. if (parsed.options.forceShell || needsShell) {
  9388. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9389. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9390. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9391. // we need to double escape them
  9392. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9393. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9394. // This is necessary otherwise it will always fail with ENOENT in those cases
  9395. parsed.command = path.normalize(parsed.command);
  9396. // Escape command & arguments
  9397. parsed.command = escape.command(parsed.command);
  9398. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9399. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9400. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9401. parsed.command = process.env.comspec || 'cmd.exe';
  9402. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9403. }
  9404. return parsed;
  9405. }
  9406. function parseShell(parsed) {
  9407. // If node supports the shell option, there's no need to mimic its behavior
  9408. if (supportsShellOption) {
  9409. return parsed;
  9410. }
  9411. // Mimic node shell option
  9412. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9413. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9414. if (isWin) {
  9415. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9416. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9417. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9418. } else {
  9419. if (typeof parsed.options.shell === 'string') {
  9420. parsed.command = parsed.options.shell;
  9421. } else if (process.platform === 'android') {
  9422. parsed.command = '/system/bin/sh';
  9423. } else {
  9424. parsed.command = '/bin/sh';
  9425. }
  9426. parsed.args = ['-c', shellCommand];
  9427. }
  9428. return parsed;
  9429. }
  9430. function parse(command, args, options) {
  9431. // Normalize arguments, similar to nodejs
  9432. if (args && !Array.isArray(args)) {
  9433. options = args;
  9434. args = null;
  9435. }
  9436. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9437. options = Object.assign({}, options); // Clone object to avoid changing the original
  9438. // Build our parsed object
  9439. const parsed = {
  9440. command,
  9441. args,
  9442. options,
  9443. file: undefined,
  9444. original: {
  9445. command,
  9446. args,
  9447. },
  9448. };
  9449. // Delegate further parsing to shell or non-shell
  9450. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9451. }
  9452. module.exports = parse;
  9453. /***/ }),
  9454. /***/ 577:
  9455. /***/ (function(module) {
  9456. module.exports = getPageLinks
  9457. function getPageLinks (link) {
  9458. link = link.link || link.headers.link || ''
  9459. const links = {}
  9460. // link format:
  9461. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9462. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9463. links[type] = uri
  9464. })
  9465. return links
  9466. }
  9467. /***/ }),
  9468. /***/ 586:
  9469. /***/ (function(module, __unusedexports, __webpack_require__) {
  9470. module.exports = octokitRestApiEndpoints;
  9471. const ROUTES = __webpack_require__(705);
  9472. function octokitRestApiEndpoints(octokit) {
  9473. // Aliasing scopes for backward compatibility
  9474. // See https://github.com/octokit/rest.js/pull/1134
  9475. ROUTES.gitdata = ROUTES.git;
  9476. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9477. ROUTES.pullRequests = ROUTES.pulls;
  9478. octokit.registerEndpoints(ROUTES);
  9479. }
  9480. /***/ }),
  9481. /***/ 587:
  9482. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9483. "use strict";
  9484. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9485. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9486. return new (P || (P = Promise))(function (resolve, reject) {
  9487. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9488. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9489. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9490. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9491. });
  9492. };
  9493. var __importStar = (this && this.__importStar) || function (mod) {
  9494. if (mod && mod.__esModule) return mod;
  9495. var result = {};
  9496. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9497. result["default"] = mod;
  9498. return result;
  9499. };
  9500. Object.defineProperty(exports, "__esModule", { value: true });
  9501. const core = __importStar(__webpack_require__(470));
  9502. const defaultMaxAttempts = 3;
  9503. const defaultMinSeconds = 10;
  9504. const defaultMaxSeconds = 20;
  9505. class RetryHelper {
  9506. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9507. this.maxAttempts = maxAttempts;
  9508. this.minSeconds = Math.floor(minSeconds);
  9509. this.maxSeconds = Math.floor(maxSeconds);
  9510. if (this.minSeconds > this.maxSeconds) {
  9511. throw new Error('min seconds should be less than or equal to max seconds');
  9512. }
  9513. }
  9514. execute(action) {
  9515. return __awaiter(this, void 0, void 0, function* () {
  9516. let attempt = 1;
  9517. while (attempt < this.maxAttempts) {
  9518. // Try
  9519. try {
  9520. return yield action();
  9521. }
  9522. catch (err) {
  9523. core.info(err.message);
  9524. }
  9525. // Sleep
  9526. const seconds = this.getSleepAmount();
  9527. core.info(`Waiting ${seconds} seconds before trying again`);
  9528. yield this.sleep(seconds);
  9529. attempt++;
  9530. }
  9531. // Last attempt
  9532. return yield action();
  9533. });
  9534. }
  9535. getSleepAmount() {
  9536. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9537. this.minSeconds);
  9538. }
  9539. sleep(seconds) {
  9540. return __awaiter(this, void 0, void 0, function* () {
  9541. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9542. });
  9543. }
  9544. }
  9545. exports.RetryHelper = RetryHelper;
  9546. function execute(action) {
  9547. return __awaiter(this, void 0, void 0, function* () {
  9548. const retryHelper = new RetryHelper();
  9549. return yield retryHelper.execute(action);
  9550. });
  9551. }
  9552. exports.execute = execute;
  9553. /***/ }),
  9554. /***/ 605:
  9555. /***/ (function(module) {
  9556. module.exports = require("http");
  9557. /***/ }),
  9558. /***/ 614:
  9559. /***/ (function(module) {
  9560. module.exports = require("events");
  9561. /***/ }),
  9562. /***/ 618:
  9563. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9564. "use strict";
  9565. var __importStar = (this && this.__importStar) || function (mod) {
  9566. if (mod && mod.__esModule) return mod;
  9567. var result = {};
  9568. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9569. result["default"] = mod;
  9570. return result;
  9571. };
  9572. Object.defineProperty(exports, "__esModule", { value: true });
  9573. const fs = __importStar(__webpack_require__(747));
  9574. function directoryExistsSync(path, required) {
  9575. if (!path) {
  9576. throw new Error("Arg 'path' must not be empty");
  9577. }
  9578. let stats;
  9579. try {
  9580. stats = fs.statSync(path);
  9581. }
  9582. catch (error) {
  9583. if (error.code === 'ENOENT') {
  9584. if (!required) {
  9585. return false;
  9586. }
  9587. throw new Error(`Directory '${path}' does not exist`);
  9588. }
  9589. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9590. }
  9591. if (stats.isDirectory()) {
  9592. return true;
  9593. }
  9594. else if (!required) {
  9595. return false;
  9596. }
  9597. throw new Error(`Directory '${path}' does not exist`);
  9598. }
  9599. exports.directoryExistsSync = directoryExistsSync;
  9600. function existsSync(path) {
  9601. if (!path) {
  9602. throw new Error("Arg 'path' must not be empty");
  9603. }
  9604. try {
  9605. fs.statSync(path);
  9606. }
  9607. catch (error) {
  9608. if (error.code === 'ENOENT') {
  9609. return false;
  9610. }
  9611. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9612. }
  9613. return true;
  9614. }
  9615. exports.existsSync = existsSync;
  9616. function fileExistsSync(path) {
  9617. if (!path) {
  9618. throw new Error("Arg 'path' must not be empty");
  9619. }
  9620. let stats;
  9621. try {
  9622. stats = fs.statSync(path);
  9623. }
  9624. catch (error) {
  9625. if (error.code === 'ENOENT') {
  9626. return false;
  9627. }
  9628. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9629. }
  9630. if (!stats.isDirectory()) {
  9631. return true;
  9632. }
  9633. return false;
  9634. }
  9635. exports.fileExistsSync = fileExistsSync;
  9636. /***/ }),
  9637. /***/ 621:
  9638. /***/ (function(module, __unusedexports, __webpack_require__) {
  9639. "use strict";
  9640. const path = __webpack_require__(622);
  9641. const pathKey = __webpack_require__(39);
  9642. module.exports = opts => {
  9643. opts = Object.assign({
  9644. cwd: process.cwd(),
  9645. path: process.env[pathKey()]
  9646. }, opts);
  9647. let prev;
  9648. let pth = path.resolve(opts.cwd);
  9649. const ret = [];
  9650. while (prev !== pth) {
  9651. ret.push(path.join(pth, 'node_modules/.bin'));
  9652. prev = pth;
  9653. pth = path.resolve(pth, '..');
  9654. }
  9655. // ensure the running `node` binary is used
  9656. ret.push(path.dirname(process.execPath));
  9657. return ret.concat(opts.path).join(path.delimiter);
  9658. };
  9659. module.exports.env = opts => {
  9660. opts = Object.assign({
  9661. env: process.env
  9662. }, opts);
  9663. const env = Object.assign({}, opts.env);
  9664. const path = pathKey({env});
  9665. opts.path = env[path];
  9666. env[path] = module.exports(opts);
  9667. return env;
  9668. };
  9669. /***/ }),
  9670. /***/ 622:
  9671. /***/ (function(module) {
  9672. module.exports = require("path");
  9673. /***/ }),
  9674. /***/ 631:
  9675. /***/ (function(module) {
  9676. module.exports = require("net");
  9677. /***/ }),
  9678. /***/ 649:
  9679. /***/ (function(module, __unusedexports, __webpack_require__) {
  9680. module.exports = getLastPage
  9681. const getPage = __webpack_require__(265)
  9682. function getLastPage (octokit, link, headers) {
  9683. return getPage(octokit, link, 'last', headers)
  9684. }
  9685. /***/ }),
  9686. /***/ 654:
  9687. /***/ (function(module) {
  9688. // This is not the set of all possible signals.
  9689. //
  9690. // It IS, however, the set of all signals that trigger
  9691. // an exit on either Linux or BSD systems. Linux is a
  9692. // superset of the signal names supported on BSD, and
  9693. // the unknown signals just fail to register, so we can
  9694. // catch that easily enough.
  9695. //
  9696. // Don't bother with SIGKILL. It's uncatchable, which
  9697. // means that we can't fire any callbacks anyway.
  9698. //
  9699. // If a user does happen to register a handler on a non-
  9700. // fatal signal like SIGWINCH or something, and then
  9701. // exit, it'll end up firing `process.emit('exit')`, so
  9702. // the handler will be fired anyway.
  9703. //
  9704. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9705. // artificially, inherently leave the process in a
  9706. // state from which it is not safe to try and enter JS
  9707. // listeners.
  9708. module.exports = [
  9709. 'SIGABRT',
  9710. 'SIGALRM',
  9711. 'SIGHUP',
  9712. 'SIGINT',
  9713. 'SIGTERM'
  9714. ]
  9715. if (process.platform !== 'win32') {
  9716. module.exports.push(
  9717. 'SIGVTALRM',
  9718. 'SIGXCPU',
  9719. 'SIGXFSZ',
  9720. 'SIGUSR2',
  9721. 'SIGTRAP',
  9722. 'SIGSYS',
  9723. 'SIGQUIT',
  9724. 'SIGIOT'
  9725. // should detect profiler and enable/disable accordingly.
  9726. // see #21
  9727. // 'SIGPROF'
  9728. )
  9729. }
  9730. if (process.platform === 'linux') {
  9731. module.exports.push(
  9732. 'SIGIO',
  9733. 'SIGPOLL',
  9734. 'SIGPWR',
  9735. 'SIGSTKFLT',
  9736. 'SIGUNUSED'
  9737. )
  9738. }
  9739. /***/ }),
  9740. /***/ 656:
  9741. /***/ (function(module, exports) {
  9742. exports = module.exports = SemVer
  9743. var debug
  9744. /* istanbul ignore next */
  9745. if (typeof process === 'object' &&
  9746. process.env &&
  9747. process.env.NODE_DEBUG &&
  9748. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9749. debug = function () {
  9750. var args = Array.prototype.slice.call(arguments, 0)
  9751. args.unshift('SEMVER')
  9752. console.log.apply(console, args)
  9753. }
  9754. } else {
  9755. debug = function () {}
  9756. }
  9757. // Note: this is the semver.org version of the spec that it implements
  9758. // Not necessarily the package version of this code.
  9759. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9760. var MAX_LENGTH = 256
  9761. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9762. /* istanbul ignore next */ 9007199254740991
  9763. // Max safe segment length for coercion.
  9764. var MAX_SAFE_COMPONENT_LENGTH = 16
  9765. // The actual regexps go on exports.re
  9766. var re = exports.re = []
  9767. var src = exports.src = []
  9768. var t = exports.tokens = {}
  9769. var R = 0
  9770. function tok (n) {
  9771. t[n] = R++
  9772. }
  9773. // The following Regular Expressions can be used for tokenizing,
  9774. // validating, and parsing SemVer version strings.
  9775. // ## Numeric Identifier
  9776. // A single `0`, or a non-zero digit followed by zero or more digits.
  9777. tok('NUMERICIDENTIFIER')
  9778. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9779. tok('NUMERICIDENTIFIERLOOSE')
  9780. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9781. // ## Non-numeric Identifier
  9782. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9783. // more letters, digits, or hyphens.
  9784. tok('NONNUMERICIDENTIFIER')
  9785. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9786. // ## Main Version
  9787. // Three dot-separated numeric identifiers.
  9788. tok('MAINVERSION')
  9789. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9790. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9791. '(' + src[t.NUMERICIDENTIFIER] + ')'
  9792. tok('MAINVERSIONLOOSE')
  9793. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9794. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9795. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  9796. // ## Pre-release Version Identifier
  9797. // A numeric identifier, or a non-numeric identifier.
  9798. tok('PRERELEASEIDENTIFIER')
  9799. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  9800. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9801. tok('PRERELEASEIDENTIFIERLOOSE')
  9802. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  9803. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9804. // ## Pre-release Version
  9805. // Hyphen, followed by one or more dot-separated pre-release version
  9806. // identifiers.
  9807. tok('PRERELEASE')
  9808. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  9809. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  9810. tok('PRERELEASELOOSE')
  9811. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  9812. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  9813. // ## Build Metadata Identifier
  9814. // Any combination of digits, letters, or hyphens.
  9815. tok('BUILDIDENTIFIER')
  9816. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  9817. // ## Build Metadata
  9818. // Plus sign, followed by one or more period-separated build metadata
  9819. // identifiers.
  9820. tok('BUILD')
  9821. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  9822. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  9823. // ## Full Version String
  9824. // A main version, followed optionally by a pre-release version and
  9825. // build metadata.
  9826. // Note that the only major, minor, patch, and pre-release sections of
  9827. // the version string are capturing groups. The build metadata is not a
  9828. // capturing group, because it should not ever be used in version
  9829. // comparison.
  9830. tok('FULL')
  9831. tok('FULLPLAIN')
  9832. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  9833. src[t.PRERELEASE] + '?' +
  9834. src[t.BUILD] + '?'
  9835. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  9836. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  9837. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  9838. // common in the npm registry.
  9839. tok('LOOSEPLAIN')
  9840. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  9841. src[t.PRERELEASELOOSE] + '?' +
  9842. src[t.BUILD] + '?'
  9843. tok('LOOSE')
  9844. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  9845. tok('GTLT')
  9846. src[t.GTLT] = '((?:<|>)?=?)'
  9847. // Something like "2.*" or "1.2.x".
  9848. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  9849. // Only the first item is strictly required.
  9850. tok('XRANGEIDENTIFIERLOOSE')
  9851. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  9852. tok('XRANGEIDENTIFIER')
  9853. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  9854. tok('XRANGEPLAIN')
  9855. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  9856. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9857. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9858. '(?:' + src[t.PRERELEASE] + ')?' +
  9859. src[t.BUILD] + '?' +
  9860. ')?)?'
  9861. tok('XRANGEPLAINLOOSE')
  9862. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9863. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9864. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9865. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  9866. src[t.BUILD] + '?' +
  9867. ')?)?'
  9868. tok('XRANGE')
  9869. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  9870. tok('XRANGELOOSE')
  9871. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  9872. // Coercion.
  9873. // Extract anything that could conceivably be a part of a valid semver
  9874. tok('COERCE')
  9875. src[t.COERCE] = '(^|[^\\d])' +
  9876. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  9877. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  9878. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  9879. '(?:$|[^\\d])'
  9880. tok('COERCERTL')
  9881. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  9882. // Tilde ranges.
  9883. // Meaning is "reasonably at or greater than"
  9884. tok('LONETILDE')
  9885. src[t.LONETILDE] = '(?:~>?)'
  9886. tok('TILDETRIM')
  9887. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  9888. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  9889. var tildeTrimReplace = '$1~'
  9890. tok('TILDE')
  9891. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  9892. tok('TILDELOOSE')
  9893. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  9894. // Caret ranges.
  9895. // Meaning is "at least and backwards compatible with"
  9896. tok('LONECARET')
  9897. src[t.LONECARET] = '(?:\\^)'
  9898. tok('CARETTRIM')
  9899. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  9900. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  9901. var caretTrimReplace = '$1^'
  9902. tok('CARET')
  9903. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  9904. tok('CARETLOOSE')
  9905. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  9906. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  9907. tok('COMPARATORLOOSE')
  9908. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  9909. tok('COMPARATOR')
  9910. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  9911. // An expression to strip any whitespace between the gtlt and the thing
  9912. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  9913. tok('COMPARATORTRIM')
  9914. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  9915. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  9916. // this one has to use the /g flag
  9917. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  9918. var comparatorTrimReplace = '$1$2$3'
  9919. // Something like `1.2.3 - 1.2.4`
  9920. // Note that these all use the loose form, because they'll be
  9921. // checked against either the strict or loose comparator form
  9922. // later.
  9923. tok('HYPHENRANGE')
  9924. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  9925. '\\s+-\\s+' +
  9926. '(' + src[t.XRANGEPLAIN] + ')' +
  9927. '\\s*$'
  9928. tok('HYPHENRANGELOOSE')
  9929. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  9930. '\\s+-\\s+' +
  9931. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  9932. '\\s*$'
  9933. // Star ranges basically just allow anything at all.
  9934. tok('STAR')
  9935. src[t.STAR] = '(<|>)?=?\\s*\\*'
  9936. // Compile to actual regexp objects.
  9937. // All are flag-free, unless they were created above with a flag.
  9938. for (var i = 0; i < R; i++) {
  9939. debug(i, src[i])
  9940. if (!re[i]) {
  9941. re[i] = new RegExp(src[i])
  9942. }
  9943. }
  9944. exports.parse = parse
  9945. function parse (version, options) {
  9946. if (!options || typeof options !== 'object') {
  9947. options = {
  9948. loose: !!options,
  9949. includePrerelease: false
  9950. }
  9951. }
  9952. if (version instanceof SemVer) {
  9953. return version
  9954. }
  9955. if (typeof version !== 'string') {
  9956. return null
  9957. }
  9958. if (version.length > MAX_LENGTH) {
  9959. return null
  9960. }
  9961. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  9962. if (!r.test(version)) {
  9963. return null
  9964. }
  9965. try {
  9966. return new SemVer(version, options)
  9967. } catch (er) {
  9968. return null
  9969. }
  9970. }
  9971. exports.valid = valid
  9972. function valid (version, options) {
  9973. var v = parse(version, options)
  9974. return v ? v.version : null
  9975. }
  9976. exports.clean = clean
  9977. function clean (version, options) {
  9978. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  9979. return s ? s.version : null
  9980. }
  9981. exports.SemVer = SemVer
  9982. function SemVer (version, options) {
  9983. if (!options || typeof options !== 'object') {
  9984. options = {
  9985. loose: !!options,
  9986. includePrerelease: false
  9987. }
  9988. }
  9989. if (version instanceof SemVer) {
  9990. if (version.loose === options.loose) {
  9991. return version
  9992. } else {
  9993. version = version.version
  9994. }
  9995. } else if (typeof version !== 'string') {
  9996. throw new TypeError('Invalid Version: ' + version)
  9997. }
  9998. if (version.length > MAX_LENGTH) {
  9999. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10000. }
  10001. if (!(this instanceof SemVer)) {
  10002. return new SemVer(version, options)
  10003. }
  10004. debug('SemVer', version, options)
  10005. this.options = options
  10006. this.loose = !!options.loose
  10007. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10008. if (!m) {
  10009. throw new TypeError('Invalid Version: ' + version)
  10010. }
  10011. this.raw = version
  10012. // these are actually numbers
  10013. this.major = +m[1]
  10014. this.minor = +m[2]
  10015. this.patch = +m[3]
  10016. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10017. throw new TypeError('Invalid major version')
  10018. }
  10019. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10020. throw new TypeError('Invalid minor version')
  10021. }
  10022. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10023. throw new TypeError('Invalid patch version')
  10024. }
  10025. // numberify any prerelease numeric ids
  10026. if (!m[4]) {
  10027. this.prerelease = []
  10028. } else {
  10029. this.prerelease = m[4].split('.').map(function (id) {
  10030. if (/^[0-9]+$/.test(id)) {
  10031. var num = +id
  10032. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10033. return num
  10034. }
  10035. }
  10036. return id
  10037. })
  10038. }
  10039. this.build = m[5] ? m[5].split('.') : []
  10040. this.format()
  10041. }
  10042. SemVer.prototype.format = function () {
  10043. this.version = this.major + '.' + this.minor + '.' + this.patch
  10044. if (this.prerelease.length) {
  10045. this.version += '-' + this.prerelease.join('.')
  10046. }
  10047. return this.version
  10048. }
  10049. SemVer.prototype.toString = function () {
  10050. return this.version
  10051. }
  10052. SemVer.prototype.compare = function (other) {
  10053. debug('SemVer.compare', this.version, this.options, other)
  10054. if (!(other instanceof SemVer)) {
  10055. other = new SemVer(other, this.options)
  10056. }
  10057. return this.compareMain(other) || this.comparePre(other)
  10058. }
  10059. SemVer.prototype.compareMain = function (other) {
  10060. if (!(other instanceof SemVer)) {
  10061. other = new SemVer(other, this.options)
  10062. }
  10063. return compareIdentifiers(this.major, other.major) ||
  10064. compareIdentifiers(this.minor, other.minor) ||
  10065. compareIdentifiers(this.patch, other.patch)
  10066. }
  10067. SemVer.prototype.comparePre = function (other) {
  10068. if (!(other instanceof SemVer)) {
  10069. other = new SemVer(other, this.options)
  10070. }
  10071. // NOT having a prerelease is > having one
  10072. if (this.prerelease.length && !other.prerelease.length) {
  10073. return -1
  10074. } else if (!this.prerelease.length && other.prerelease.length) {
  10075. return 1
  10076. } else if (!this.prerelease.length && !other.prerelease.length) {
  10077. return 0
  10078. }
  10079. var i = 0
  10080. do {
  10081. var a = this.prerelease[i]
  10082. var b = other.prerelease[i]
  10083. debug('prerelease compare', i, a, b)
  10084. if (a === undefined && b === undefined) {
  10085. return 0
  10086. } else if (b === undefined) {
  10087. return 1
  10088. } else if (a === undefined) {
  10089. return -1
  10090. } else if (a === b) {
  10091. continue
  10092. } else {
  10093. return compareIdentifiers(a, b)
  10094. }
  10095. } while (++i)
  10096. }
  10097. SemVer.prototype.compareBuild = function (other) {
  10098. if (!(other instanceof SemVer)) {
  10099. other = new SemVer(other, this.options)
  10100. }
  10101. var i = 0
  10102. do {
  10103. var a = this.build[i]
  10104. var b = other.build[i]
  10105. debug('prerelease compare', i, a, b)
  10106. if (a === undefined && b === undefined) {
  10107. return 0
  10108. } else if (b === undefined) {
  10109. return 1
  10110. } else if (a === undefined) {
  10111. return -1
  10112. } else if (a === b) {
  10113. continue
  10114. } else {
  10115. return compareIdentifiers(a, b)
  10116. }
  10117. } while (++i)
  10118. }
  10119. // preminor will bump the version up to the next minor release, and immediately
  10120. // down to pre-release. premajor and prepatch work the same way.
  10121. SemVer.prototype.inc = function (release, identifier) {
  10122. switch (release) {
  10123. case 'premajor':
  10124. this.prerelease.length = 0
  10125. this.patch = 0
  10126. this.minor = 0
  10127. this.major++
  10128. this.inc('pre', identifier)
  10129. break
  10130. case 'preminor':
  10131. this.prerelease.length = 0
  10132. this.patch = 0
  10133. this.minor++
  10134. this.inc('pre', identifier)
  10135. break
  10136. case 'prepatch':
  10137. // If this is already a prerelease, it will bump to the next version
  10138. // drop any prereleases that might already exist, since they are not
  10139. // relevant at this point.
  10140. this.prerelease.length = 0
  10141. this.inc('patch', identifier)
  10142. this.inc('pre', identifier)
  10143. break
  10144. // If the input is a non-prerelease version, this acts the same as
  10145. // prepatch.
  10146. case 'prerelease':
  10147. if (this.prerelease.length === 0) {
  10148. this.inc('patch', identifier)
  10149. }
  10150. this.inc('pre', identifier)
  10151. break
  10152. case 'major':
  10153. // If this is a pre-major version, bump up to the same major version.
  10154. // Otherwise increment major.
  10155. // 1.0.0-5 bumps to 1.0.0
  10156. // 1.1.0 bumps to 2.0.0
  10157. if (this.minor !== 0 ||
  10158. this.patch !== 0 ||
  10159. this.prerelease.length === 0) {
  10160. this.major++
  10161. }
  10162. this.minor = 0
  10163. this.patch = 0
  10164. this.prerelease = []
  10165. break
  10166. case 'minor':
  10167. // If this is a pre-minor version, bump up to the same minor version.
  10168. // Otherwise increment minor.
  10169. // 1.2.0-5 bumps to 1.2.0
  10170. // 1.2.1 bumps to 1.3.0
  10171. if (this.patch !== 0 || this.prerelease.length === 0) {
  10172. this.minor++
  10173. }
  10174. this.patch = 0
  10175. this.prerelease = []
  10176. break
  10177. case 'patch':
  10178. // If this is not a pre-release version, it will increment the patch.
  10179. // If it is a pre-release it will bump up to the same patch version.
  10180. // 1.2.0-5 patches to 1.2.0
  10181. // 1.2.0 patches to 1.2.1
  10182. if (this.prerelease.length === 0) {
  10183. this.patch++
  10184. }
  10185. this.prerelease = []
  10186. break
  10187. // This probably shouldn't be used publicly.
  10188. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10189. case 'pre':
  10190. if (this.prerelease.length === 0) {
  10191. this.prerelease = [0]
  10192. } else {
  10193. var i = this.prerelease.length
  10194. while (--i >= 0) {
  10195. if (typeof this.prerelease[i] === 'number') {
  10196. this.prerelease[i]++
  10197. i = -2
  10198. }
  10199. }
  10200. if (i === -1) {
  10201. // didn't increment anything
  10202. this.prerelease.push(0)
  10203. }
  10204. }
  10205. if (identifier) {
  10206. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10207. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10208. if (this.prerelease[0] === identifier) {
  10209. if (isNaN(this.prerelease[1])) {
  10210. this.prerelease = [identifier, 0]
  10211. }
  10212. } else {
  10213. this.prerelease = [identifier, 0]
  10214. }
  10215. }
  10216. break
  10217. default:
  10218. throw new Error('invalid increment argument: ' + release)
  10219. }
  10220. this.format()
  10221. this.raw = this.version
  10222. return this
  10223. }
  10224. exports.inc = inc
  10225. function inc (version, release, loose, identifier) {
  10226. if (typeof (loose) === 'string') {
  10227. identifier = loose
  10228. loose = undefined
  10229. }
  10230. try {
  10231. return new SemVer(version, loose).inc(release, identifier).version
  10232. } catch (er) {
  10233. return null
  10234. }
  10235. }
  10236. exports.diff = diff
  10237. function diff (version1, version2) {
  10238. if (eq(version1, version2)) {
  10239. return null
  10240. } else {
  10241. var v1 = parse(version1)
  10242. var v2 = parse(version2)
  10243. var prefix = ''
  10244. if (v1.prerelease.length || v2.prerelease.length) {
  10245. prefix = 'pre'
  10246. var defaultResult = 'prerelease'
  10247. }
  10248. for (var key in v1) {
  10249. if (key === 'major' || key === 'minor' || key === 'patch') {
  10250. if (v1[key] !== v2[key]) {
  10251. return prefix + key
  10252. }
  10253. }
  10254. }
  10255. return defaultResult // may be undefined
  10256. }
  10257. }
  10258. exports.compareIdentifiers = compareIdentifiers
  10259. var numeric = /^[0-9]+$/
  10260. function compareIdentifiers (a, b) {
  10261. var anum = numeric.test(a)
  10262. var bnum = numeric.test(b)
  10263. if (anum && bnum) {
  10264. a = +a
  10265. b = +b
  10266. }
  10267. return a === b ? 0
  10268. : (anum && !bnum) ? -1
  10269. : (bnum && !anum) ? 1
  10270. : a < b ? -1
  10271. : 1
  10272. }
  10273. exports.rcompareIdentifiers = rcompareIdentifiers
  10274. function rcompareIdentifiers (a, b) {
  10275. return compareIdentifiers(b, a)
  10276. }
  10277. exports.major = major
  10278. function major (a, loose) {
  10279. return new SemVer(a, loose).major
  10280. }
  10281. exports.minor = minor
  10282. function minor (a, loose) {
  10283. return new SemVer(a, loose).minor
  10284. }
  10285. exports.patch = patch
  10286. function patch (a, loose) {
  10287. return new SemVer(a, loose).patch
  10288. }
  10289. exports.compare = compare
  10290. function compare (a, b, loose) {
  10291. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10292. }
  10293. exports.compareLoose = compareLoose
  10294. function compareLoose (a, b) {
  10295. return compare(a, b, true)
  10296. }
  10297. exports.compareBuild = compareBuild
  10298. function compareBuild (a, b, loose) {
  10299. var versionA = new SemVer(a, loose)
  10300. var versionB = new SemVer(b, loose)
  10301. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10302. }
  10303. exports.rcompare = rcompare
  10304. function rcompare (a, b, loose) {
  10305. return compare(b, a, loose)
  10306. }
  10307. exports.sort = sort
  10308. function sort (list, loose) {
  10309. return list.sort(function (a, b) {
  10310. return exports.compareBuild(a, b, loose)
  10311. })
  10312. }
  10313. exports.rsort = rsort
  10314. function rsort (list, loose) {
  10315. return list.sort(function (a, b) {
  10316. return exports.compareBuild(b, a, loose)
  10317. })
  10318. }
  10319. exports.gt = gt
  10320. function gt (a, b, loose) {
  10321. return compare(a, b, loose) > 0
  10322. }
  10323. exports.lt = lt
  10324. function lt (a, b, loose) {
  10325. return compare(a, b, loose) < 0
  10326. }
  10327. exports.eq = eq
  10328. function eq (a, b, loose) {
  10329. return compare(a, b, loose) === 0
  10330. }
  10331. exports.neq = neq
  10332. function neq (a, b, loose) {
  10333. return compare(a, b, loose) !== 0
  10334. }
  10335. exports.gte = gte
  10336. function gte (a, b, loose) {
  10337. return compare(a, b, loose) >= 0
  10338. }
  10339. exports.lte = lte
  10340. function lte (a, b, loose) {
  10341. return compare(a, b, loose) <= 0
  10342. }
  10343. exports.cmp = cmp
  10344. function cmp (a, op, b, loose) {
  10345. switch (op) {
  10346. case '===':
  10347. if (typeof a === 'object')
  10348. a = a.version
  10349. if (typeof b === 'object')
  10350. b = b.version
  10351. return a === b
  10352. case '!==':
  10353. if (typeof a === 'object')
  10354. a = a.version
  10355. if (typeof b === 'object')
  10356. b = b.version
  10357. return a !== b
  10358. case '':
  10359. case '=':
  10360. case '==':
  10361. return eq(a, b, loose)
  10362. case '!=':
  10363. return neq(a, b, loose)
  10364. case '>':
  10365. return gt(a, b, loose)
  10366. case '>=':
  10367. return gte(a, b, loose)
  10368. case '<':
  10369. return lt(a, b, loose)
  10370. case '<=':
  10371. return lte(a, b, loose)
  10372. default:
  10373. throw new TypeError('Invalid operator: ' + op)
  10374. }
  10375. }
  10376. exports.Comparator = Comparator
  10377. function Comparator (comp, options) {
  10378. if (!options || typeof options !== 'object') {
  10379. options = {
  10380. loose: !!options,
  10381. includePrerelease: false
  10382. }
  10383. }
  10384. if (comp instanceof Comparator) {
  10385. if (comp.loose === !!options.loose) {
  10386. return comp
  10387. } else {
  10388. comp = comp.value
  10389. }
  10390. }
  10391. if (!(this instanceof Comparator)) {
  10392. return new Comparator(comp, options)
  10393. }
  10394. debug('comparator', comp, options)
  10395. this.options = options
  10396. this.loose = !!options.loose
  10397. this.parse(comp)
  10398. if (this.semver === ANY) {
  10399. this.value = ''
  10400. } else {
  10401. this.value = this.operator + this.semver.version
  10402. }
  10403. debug('comp', this)
  10404. }
  10405. var ANY = {}
  10406. Comparator.prototype.parse = function (comp) {
  10407. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10408. var m = comp.match(r)
  10409. if (!m) {
  10410. throw new TypeError('Invalid comparator: ' + comp)
  10411. }
  10412. this.operator = m[1] !== undefined ? m[1] : ''
  10413. if (this.operator === '=') {
  10414. this.operator = ''
  10415. }
  10416. // if it literally is just '>' or '' then allow anything.
  10417. if (!m[2]) {
  10418. this.semver = ANY
  10419. } else {
  10420. this.semver = new SemVer(m[2], this.options.loose)
  10421. }
  10422. }
  10423. Comparator.prototype.toString = function () {
  10424. return this.value
  10425. }
  10426. Comparator.prototype.test = function (version) {
  10427. debug('Comparator.test', version, this.options.loose)
  10428. if (this.semver === ANY || version === ANY) {
  10429. return true
  10430. }
  10431. if (typeof version === 'string') {
  10432. try {
  10433. version = new SemVer(version, this.options)
  10434. } catch (er) {
  10435. return false
  10436. }
  10437. }
  10438. return cmp(version, this.operator, this.semver, this.options)
  10439. }
  10440. Comparator.prototype.intersects = function (comp, options) {
  10441. if (!(comp instanceof Comparator)) {
  10442. throw new TypeError('a Comparator is required')
  10443. }
  10444. if (!options || typeof options !== 'object') {
  10445. options = {
  10446. loose: !!options,
  10447. includePrerelease: false
  10448. }
  10449. }
  10450. var rangeTmp
  10451. if (this.operator === '') {
  10452. if (this.value === '') {
  10453. return true
  10454. }
  10455. rangeTmp = new Range(comp.value, options)
  10456. return satisfies(this.value, rangeTmp, options)
  10457. } else if (comp.operator === '') {
  10458. if (comp.value === '') {
  10459. return true
  10460. }
  10461. rangeTmp = new Range(this.value, options)
  10462. return satisfies(comp.semver, rangeTmp, options)
  10463. }
  10464. var sameDirectionIncreasing =
  10465. (this.operator === '>=' || this.operator === '>') &&
  10466. (comp.operator === '>=' || comp.operator === '>')
  10467. var sameDirectionDecreasing =
  10468. (this.operator === '<=' || this.operator === '<') &&
  10469. (comp.operator === '<=' || comp.operator === '<')
  10470. var sameSemVer = this.semver.version === comp.semver.version
  10471. var differentDirectionsInclusive =
  10472. (this.operator === '>=' || this.operator === '<=') &&
  10473. (comp.operator === '>=' || comp.operator === '<=')
  10474. var oppositeDirectionsLessThan =
  10475. cmp(this.semver, '<', comp.semver, options) &&
  10476. ((this.operator === '>=' || this.operator === '>') &&
  10477. (comp.operator === '<=' || comp.operator === '<'))
  10478. var oppositeDirectionsGreaterThan =
  10479. cmp(this.semver, '>', comp.semver, options) &&
  10480. ((this.operator === '<=' || this.operator === '<') &&
  10481. (comp.operator === '>=' || comp.operator === '>'))
  10482. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10483. (sameSemVer && differentDirectionsInclusive) ||
  10484. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10485. }
  10486. exports.Range = Range
  10487. function Range (range, options) {
  10488. if (!options || typeof options !== 'object') {
  10489. options = {
  10490. loose: !!options,
  10491. includePrerelease: false
  10492. }
  10493. }
  10494. if (range instanceof Range) {
  10495. if (range.loose === !!options.loose &&
  10496. range.includePrerelease === !!options.includePrerelease) {
  10497. return range
  10498. } else {
  10499. return new Range(range.raw, options)
  10500. }
  10501. }
  10502. if (range instanceof Comparator) {
  10503. return new Range(range.value, options)
  10504. }
  10505. if (!(this instanceof Range)) {
  10506. return new Range(range, options)
  10507. }
  10508. this.options = options
  10509. this.loose = !!options.loose
  10510. this.includePrerelease = !!options.includePrerelease
  10511. // First, split based on boolean or ||
  10512. this.raw = range
  10513. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10514. return this.parseRange(range.trim())
  10515. }, this).filter(function (c) {
  10516. // throw out any that are not relevant for whatever reason
  10517. return c.length
  10518. })
  10519. if (!this.set.length) {
  10520. throw new TypeError('Invalid SemVer Range: ' + range)
  10521. }
  10522. this.format()
  10523. }
  10524. Range.prototype.format = function () {
  10525. this.range = this.set.map(function (comps) {
  10526. return comps.join(' ').trim()
  10527. }).join('||').trim()
  10528. return this.range
  10529. }
  10530. Range.prototype.toString = function () {
  10531. return this.range
  10532. }
  10533. Range.prototype.parseRange = function (range) {
  10534. var loose = this.options.loose
  10535. range = range.trim()
  10536. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10537. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10538. range = range.replace(hr, hyphenReplace)
  10539. debug('hyphen replace', range)
  10540. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10541. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10542. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10543. // `~ 1.2.3` => `~1.2.3`
  10544. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10545. // `^ 1.2.3` => `^1.2.3`
  10546. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10547. // normalize spaces
  10548. range = range.split(/\s+/).join(' ')
  10549. // At this point, the range is completely trimmed and
  10550. // ready to be split into comparators.
  10551. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10552. var set = range.split(' ').map(function (comp) {
  10553. return parseComparator(comp, this.options)
  10554. }, this).join(' ').split(/\s+/)
  10555. if (this.options.loose) {
  10556. // in loose mode, throw out any that are not valid comparators
  10557. set = set.filter(function (comp) {
  10558. return !!comp.match(compRe)
  10559. })
  10560. }
  10561. set = set.map(function (comp) {
  10562. return new Comparator(comp, this.options)
  10563. }, this)
  10564. return set
  10565. }
  10566. Range.prototype.intersects = function (range, options) {
  10567. if (!(range instanceof Range)) {
  10568. throw new TypeError('a Range is required')
  10569. }
  10570. return this.set.some(function (thisComparators) {
  10571. return (
  10572. isSatisfiable(thisComparators, options) &&
  10573. range.set.some(function (rangeComparators) {
  10574. return (
  10575. isSatisfiable(rangeComparators, options) &&
  10576. thisComparators.every(function (thisComparator) {
  10577. return rangeComparators.every(function (rangeComparator) {
  10578. return thisComparator.intersects(rangeComparator, options)
  10579. })
  10580. })
  10581. )
  10582. })
  10583. )
  10584. })
  10585. }
  10586. // take a set of comparators and determine whether there
  10587. // exists a version which can satisfy it
  10588. function isSatisfiable (comparators, options) {
  10589. var result = true
  10590. var remainingComparators = comparators.slice()
  10591. var testComparator = remainingComparators.pop()
  10592. while (result && remainingComparators.length) {
  10593. result = remainingComparators.every(function (otherComparator) {
  10594. return testComparator.intersects(otherComparator, options)
  10595. })
  10596. testComparator = remainingComparators.pop()
  10597. }
  10598. return result
  10599. }
  10600. // Mostly just for testing and legacy API reasons
  10601. exports.toComparators = toComparators
  10602. function toComparators (range, options) {
  10603. return new Range(range, options).set.map(function (comp) {
  10604. return comp.map(function (c) {
  10605. return c.value
  10606. }).join(' ').trim().split(' ')
  10607. })
  10608. }
  10609. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10610. // already replaced the hyphen ranges
  10611. // turn into a set of JUST comparators.
  10612. function parseComparator (comp, options) {
  10613. debug('comp', comp, options)
  10614. comp = replaceCarets(comp, options)
  10615. debug('caret', comp)
  10616. comp = replaceTildes(comp, options)
  10617. debug('tildes', comp)
  10618. comp = replaceXRanges(comp, options)
  10619. debug('xrange', comp)
  10620. comp = replaceStars(comp, options)
  10621. debug('stars', comp)
  10622. return comp
  10623. }
  10624. function isX (id) {
  10625. return !id || id.toLowerCase() === 'x' || id === '*'
  10626. }
  10627. // ~, ~> --> * (any, kinda silly)
  10628. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10629. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10630. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10631. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10632. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10633. function replaceTildes (comp, options) {
  10634. return comp.trim().split(/\s+/).map(function (comp) {
  10635. return replaceTilde(comp, options)
  10636. }).join(' ')
  10637. }
  10638. function replaceTilde (comp, options) {
  10639. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10640. return comp.replace(r, function (_, M, m, p, pr) {
  10641. debug('tilde', comp, _, M, m, p, pr)
  10642. var ret
  10643. if (isX(M)) {
  10644. ret = ''
  10645. } else if (isX(m)) {
  10646. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10647. } else if (isX(p)) {
  10648. // ~1.2 == >=1.2.0 <1.3.0
  10649. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10650. } else if (pr) {
  10651. debug('replaceTilde pr', pr)
  10652. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10653. ' <' + M + '.' + (+m + 1) + '.0'
  10654. } else {
  10655. // ~1.2.3 == >=1.2.3 <1.3.0
  10656. ret = '>=' + M + '.' + m + '.' + p +
  10657. ' <' + M + '.' + (+m + 1) + '.0'
  10658. }
  10659. debug('tilde return', ret)
  10660. return ret
  10661. })
  10662. }
  10663. // ^ --> * (any, kinda silly)
  10664. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10665. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10666. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10667. // ^1.2.3 --> >=1.2.3 <2.0.0
  10668. // ^1.2.0 --> >=1.2.0 <2.0.0
  10669. function replaceCarets (comp, options) {
  10670. return comp.trim().split(/\s+/).map(function (comp) {
  10671. return replaceCaret(comp, options)
  10672. }).join(' ')
  10673. }
  10674. function replaceCaret (comp, options) {
  10675. debug('caret', comp, options)
  10676. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10677. return comp.replace(r, function (_, M, m, p, pr) {
  10678. debug('caret', comp, _, M, m, p, pr)
  10679. var ret
  10680. if (isX(M)) {
  10681. ret = ''
  10682. } else if (isX(m)) {
  10683. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10684. } else if (isX(p)) {
  10685. if (M === '0') {
  10686. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10687. } else {
  10688. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10689. }
  10690. } else if (pr) {
  10691. debug('replaceCaret pr', pr)
  10692. if (M === '0') {
  10693. if (m === '0') {
  10694. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10695. ' <' + M + '.' + m + '.' + (+p + 1)
  10696. } else {
  10697. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10698. ' <' + M + '.' + (+m + 1) + '.0'
  10699. }
  10700. } else {
  10701. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10702. ' <' + (+M + 1) + '.0.0'
  10703. }
  10704. } else {
  10705. debug('no pr')
  10706. if (M === '0') {
  10707. if (m === '0') {
  10708. ret = '>=' + M + '.' + m + '.' + p +
  10709. ' <' + M + '.' + m + '.' + (+p + 1)
  10710. } else {
  10711. ret = '>=' + M + '.' + m + '.' + p +
  10712. ' <' + M + '.' + (+m + 1) + '.0'
  10713. }
  10714. } else {
  10715. ret = '>=' + M + '.' + m + '.' + p +
  10716. ' <' + (+M + 1) + '.0.0'
  10717. }
  10718. }
  10719. debug('caret return', ret)
  10720. return ret
  10721. })
  10722. }
  10723. function replaceXRanges (comp, options) {
  10724. debug('replaceXRanges', comp, options)
  10725. return comp.split(/\s+/).map(function (comp) {
  10726. return replaceXRange(comp, options)
  10727. }).join(' ')
  10728. }
  10729. function replaceXRange (comp, options) {
  10730. comp = comp.trim()
  10731. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10732. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10733. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10734. var xM = isX(M)
  10735. var xm = xM || isX(m)
  10736. var xp = xm || isX(p)
  10737. var anyX = xp
  10738. if (gtlt === '=' && anyX) {
  10739. gtlt = ''
  10740. }
  10741. // if we're including prereleases in the match, then we need
  10742. // to fix this to -0, the lowest possible prerelease value
  10743. pr = options.includePrerelease ? '-0' : ''
  10744. if (xM) {
  10745. if (gtlt === '>' || gtlt === '<') {
  10746. // nothing is allowed
  10747. ret = '<0.0.0-0'
  10748. } else {
  10749. // nothing is forbidden
  10750. ret = '*'
  10751. }
  10752. } else if (gtlt && anyX) {
  10753. // we know patch is an x, because we have any x at all.
  10754. // replace X with 0
  10755. if (xm) {
  10756. m = 0
  10757. }
  10758. p = 0
  10759. if (gtlt === '>') {
  10760. // >1 => >=2.0.0
  10761. // >1.2 => >=1.3.0
  10762. // >1.2.3 => >= 1.2.4
  10763. gtlt = '>='
  10764. if (xm) {
  10765. M = +M + 1
  10766. m = 0
  10767. p = 0
  10768. } else {
  10769. m = +m + 1
  10770. p = 0
  10771. }
  10772. } else if (gtlt === '<=') {
  10773. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10774. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10775. gtlt = '<'
  10776. if (xm) {
  10777. M = +M + 1
  10778. } else {
  10779. m = +m + 1
  10780. }
  10781. }
  10782. ret = gtlt + M + '.' + m + '.' + p + pr
  10783. } else if (xm) {
  10784. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10785. } else if (xp) {
  10786. ret = '>=' + M + '.' + m + '.0' + pr +
  10787. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10788. }
  10789. debug('xRange return', ret)
  10790. return ret
  10791. })
  10792. }
  10793. // Because * is AND-ed with everything else in the comparator,
  10794. // and '' means "any version", just remove the *s entirely.
  10795. function replaceStars (comp, options) {
  10796. debug('replaceStars', comp, options)
  10797. // Looseness is ignored here. star is always as loose as it gets!
  10798. return comp.trim().replace(re[t.STAR], '')
  10799. }
  10800. // This function is passed to string.replace(re[t.HYPHENRANGE])
  10801. // M, m, patch, prerelease, build
  10802. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  10803. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  10804. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  10805. function hyphenReplace ($0,
  10806. from, fM, fm, fp, fpr, fb,
  10807. to, tM, tm, tp, tpr, tb) {
  10808. if (isX(fM)) {
  10809. from = ''
  10810. } else if (isX(fm)) {
  10811. from = '>=' + fM + '.0.0'
  10812. } else if (isX(fp)) {
  10813. from = '>=' + fM + '.' + fm + '.0'
  10814. } else {
  10815. from = '>=' + from
  10816. }
  10817. if (isX(tM)) {
  10818. to = ''
  10819. } else if (isX(tm)) {
  10820. to = '<' + (+tM + 1) + '.0.0'
  10821. } else if (isX(tp)) {
  10822. to = '<' + tM + '.' + (+tm + 1) + '.0'
  10823. } else if (tpr) {
  10824. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  10825. } else {
  10826. to = '<=' + to
  10827. }
  10828. return (from + ' ' + to).trim()
  10829. }
  10830. // if ANY of the sets match ALL of its comparators, then pass
  10831. Range.prototype.test = function (version) {
  10832. if (!version) {
  10833. return false
  10834. }
  10835. if (typeof version === 'string') {
  10836. try {
  10837. version = new SemVer(version, this.options)
  10838. } catch (er) {
  10839. return false
  10840. }
  10841. }
  10842. for (var i = 0; i < this.set.length; i++) {
  10843. if (testSet(this.set[i], version, this.options)) {
  10844. return true
  10845. }
  10846. }
  10847. return false
  10848. }
  10849. function testSet (set, version, options) {
  10850. for (var i = 0; i < set.length; i++) {
  10851. if (!set[i].test(version)) {
  10852. return false
  10853. }
  10854. }
  10855. if (version.prerelease.length && !options.includePrerelease) {
  10856. // Find the set of versions that are allowed to have prereleases
  10857. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  10858. // That should allow `1.2.3-pr.2` to pass.
  10859. // However, `1.2.4-alpha.notready` should NOT be allowed,
  10860. // even though it's within the range set by the comparators.
  10861. for (i = 0; i < set.length; i++) {
  10862. debug(set[i].semver)
  10863. if (set[i].semver === ANY) {
  10864. continue
  10865. }
  10866. if (set[i].semver.prerelease.length > 0) {
  10867. var allowed = set[i].semver
  10868. if (allowed.major === version.major &&
  10869. allowed.minor === version.minor &&
  10870. allowed.patch === version.patch) {
  10871. return true
  10872. }
  10873. }
  10874. }
  10875. // Version has a -pre, but it's not one of the ones we like.
  10876. return false
  10877. }
  10878. return true
  10879. }
  10880. exports.satisfies = satisfies
  10881. function satisfies (version, range, options) {
  10882. try {
  10883. range = new Range(range, options)
  10884. } catch (er) {
  10885. return false
  10886. }
  10887. return range.test(version)
  10888. }
  10889. exports.maxSatisfying = maxSatisfying
  10890. function maxSatisfying (versions, range, options) {
  10891. var max = null
  10892. var maxSV = null
  10893. try {
  10894. var rangeObj = new Range(range, options)
  10895. } catch (er) {
  10896. return null
  10897. }
  10898. versions.forEach(function (v) {
  10899. if (rangeObj.test(v)) {
  10900. // satisfies(v, range, options)
  10901. if (!max || maxSV.compare(v) === -1) {
  10902. // compare(max, v, true)
  10903. max = v
  10904. maxSV = new SemVer(max, options)
  10905. }
  10906. }
  10907. })
  10908. return max
  10909. }
  10910. exports.minSatisfying = minSatisfying
  10911. function minSatisfying (versions, range, options) {
  10912. var min = null
  10913. var minSV = null
  10914. try {
  10915. var rangeObj = new Range(range, options)
  10916. } catch (er) {
  10917. return null
  10918. }
  10919. versions.forEach(function (v) {
  10920. if (rangeObj.test(v)) {
  10921. // satisfies(v, range, options)
  10922. if (!min || minSV.compare(v) === 1) {
  10923. // compare(min, v, true)
  10924. min = v
  10925. minSV = new SemVer(min, options)
  10926. }
  10927. }
  10928. })
  10929. return min
  10930. }
  10931. exports.minVersion = minVersion
  10932. function minVersion (range, loose) {
  10933. range = new Range(range, loose)
  10934. var minver = new SemVer('0.0.0')
  10935. if (range.test(minver)) {
  10936. return minver
  10937. }
  10938. minver = new SemVer('0.0.0-0')
  10939. if (range.test(minver)) {
  10940. return minver
  10941. }
  10942. minver = null
  10943. for (var i = 0; i < range.set.length; ++i) {
  10944. var comparators = range.set[i]
  10945. comparators.forEach(function (comparator) {
  10946. // Clone to avoid manipulating the comparator's semver object.
  10947. var compver = new SemVer(comparator.semver.version)
  10948. switch (comparator.operator) {
  10949. case '>':
  10950. if (compver.prerelease.length === 0) {
  10951. compver.patch++
  10952. } else {
  10953. compver.prerelease.push(0)
  10954. }
  10955. compver.raw = compver.format()
  10956. /* fallthrough */
  10957. case '':
  10958. case '>=':
  10959. if (!minver || gt(minver, compver)) {
  10960. minver = compver
  10961. }
  10962. break
  10963. case '<':
  10964. case '<=':
  10965. /* Ignore maximum versions */
  10966. break
  10967. /* istanbul ignore next */
  10968. default:
  10969. throw new Error('Unexpected operation: ' + comparator.operator)
  10970. }
  10971. })
  10972. }
  10973. if (minver && range.test(minver)) {
  10974. return minver
  10975. }
  10976. return null
  10977. }
  10978. exports.validRange = validRange
  10979. function validRange (range, options) {
  10980. try {
  10981. // Return '*' instead of '' so that truthiness works.
  10982. // This will throw if it's invalid anyway
  10983. return new Range(range, options).range || '*'
  10984. } catch (er) {
  10985. return null
  10986. }
  10987. }
  10988. // Determine if version is less than all the versions possible in the range
  10989. exports.ltr = ltr
  10990. function ltr (version, range, options) {
  10991. return outside(version, range, '<', options)
  10992. }
  10993. // Determine if version is greater than all the versions possible in the range.
  10994. exports.gtr = gtr
  10995. function gtr (version, range, options) {
  10996. return outside(version, range, '>', options)
  10997. }
  10998. exports.outside = outside
  10999. function outside (version, range, hilo, options) {
  11000. version = new SemVer(version, options)
  11001. range = new Range(range, options)
  11002. var gtfn, ltefn, ltfn, comp, ecomp
  11003. switch (hilo) {
  11004. case '>':
  11005. gtfn = gt
  11006. ltefn = lte
  11007. ltfn = lt
  11008. comp = '>'
  11009. ecomp = '>='
  11010. break
  11011. case '<':
  11012. gtfn = lt
  11013. ltefn = gte
  11014. ltfn = gt
  11015. comp = '<'
  11016. ecomp = '<='
  11017. break
  11018. default:
  11019. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11020. }
  11021. // If it satisifes the range it is not outside
  11022. if (satisfies(version, range, options)) {
  11023. return false
  11024. }
  11025. // From now on, variable terms are as if we're in "gtr" mode.
  11026. // but note that everything is flipped for the "ltr" function.
  11027. for (var i = 0; i < range.set.length; ++i) {
  11028. var comparators = range.set[i]
  11029. var high = null
  11030. var low = null
  11031. comparators.forEach(function (comparator) {
  11032. if (comparator.semver === ANY) {
  11033. comparator = new Comparator('>=0.0.0')
  11034. }
  11035. high = high || comparator
  11036. low = low || comparator
  11037. if (gtfn(comparator.semver, high.semver, options)) {
  11038. high = comparator
  11039. } else if (ltfn(comparator.semver, low.semver, options)) {
  11040. low = comparator
  11041. }
  11042. })
  11043. // If the edge version comparator has a operator then our version
  11044. // isn't outside it
  11045. if (high.operator === comp || high.operator === ecomp) {
  11046. return false
  11047. }
  11048. // If the lowest version comparator has an operator and our version
  11049. // is less than it then it isn't higher than the range
  11050. if ((!low.operator || low.operator === comp) &&
  11051. ltefn(version, low.semver)) {
  11052. return false
  11053. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11054. return false
  11055. }
  11056. }
  11057. return true
  11058. }
  11059. exports.prerelease = prerelease
  11060. function prerelease (version, options) {
  11061. var parsed = parse(version, options)
  11062. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11063. }
  11064. exports.intersects = intersects
  11065. function intersects (r1, r2, options) {
  11066. r1 = new Range(r1, options)
  11067. r2 = new Range(r2, options)
  11068. return r1.intersects(r2)
  11069. }
  11070. exports.coerce = coerce
  11071. function coerce (version, options) {
  11072. if (version instanceof SemVer) {
  11073. return version
  11074. }
  11075. if (typeof version === 'number') {
  11076. version = String(version)
  11077. }
  11078. if (typeof version !== 'string') {
  11079. return null
  11080. }
  11081. options = options || {}
  11082. var match = null
  11083. if (!options.rtl) {
  11084. match = version.match(re[t.COERCE])
  11085. } else {
  11086. // Find the right-most coercible string that does not share
  11087. // a terminus with a more left-ward coercible string.
  11088. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11089. //
  11090. // Walk through the string checking with a /g regexp
  11091. // Manually set the index so as to pick up overlapping matches.
  11092. // Stop when we get a match that ends at the string end, since no
  11093. // coercible string can be more right-ward without the same terminus.
  11094. var next
  11095. while ((next = re[t.COERCERTL].exec(version)) &&
  11096. (!match || match.index + match[0].length !== version.length)
  11097. ) {
  11098. if (!match ||
  11099. next.index + next[0].length !== match.index + match[0].length) {
  11100. match = next
  11101. }
  11102. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11103. }
  11104. // leave it in a clean state
  11105. re[t.COERCERTL].lastIndex = -1
  11106. }
  11107. if (match === null) {
  11108. return null
  11109. }
  11110. return parse(match[2] +
  11111. '.' + (match[3] || '0') +
  11112. '.' + (match[4] || '0'), options)
  11113. }
  11114. /***/ }),
  11115. /***/ 669:
  11116. /***/ (function(module) {
  11117. module.exports = require("util");
  11118. /***/ }),
  11119. /***/ 672:
  11120. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11121. "use strict";
  11122. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11123. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11124. return new (P || (P = Promise))(function (resolve, reject) {
  11125. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11126. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11127. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11128. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11129. });
  11130. };
  11131. var _a;
  11132. Object.defineProperty(exports, "__esModule", { value: true });
  11133. const assert_1 = __webpack_require__(357);
  11134. const fs = __webpack_require__(747);
  11135. const path = __webpack_require__(622);
  11136. _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;
  11137. exports.IS_WINDOWS = process.platform === 'win32';
  11138. function exists(fsPath) {
  11139. return __awaiter(this, void 0, void 0, function* () {
  11140. try {
  11141. yield exports.stat(fsPath);
  11142. }
  11143. catch (err) {
  11144. if (err.code === 'ENOENT') {
  11145. return false;
  11146. }
  11147. throw err;
  11148. }
  11149. return true;
  11150. });
  11151. }
  11152. exports.exists = exists;
  11153. function isDirectory(fsPath, useStat = false) {
  11154. return __awaiter(this, void 0, void 0, function* () {
  11155. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11156. return stats.isDirectory();
  11157. });
  11158. }
  11159. exports.isDirectory = isDirectory;
  11160. /**
  11161. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11162. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11163. */
  11164. function isRooted(p) {
  11165. p = normalizeSeparators(p);
  11166. if (!p) {
  11167. throw new Error('isRooted() parameter "p" cannot be empty');
  11168. }
  11169. if (exports.IS_WINDOWS) {
  11170. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11171. ); // e.g. C: or C:\hello
  11172. }
  11173. return p.startsWith('/');
  11174. }
  11175. exports.isRooted = isRooted;
  11176. /**
  11177. * Recursively create a directory at `fsPath`.
  11178. *
  11179. * This implementation is optimistic, meaning it attempts to create the full
  11180. * path first, and backs up the path stack from there.
  11181. *
  11182. * @param fsPath The path to create
  11183. * @param maxDepth The maximum recursion depth
  11184. * @param depth The current recursion depth
  11185. */
  11186. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11187. return __awaiter(this, void 0, void 0, function* () {
  11188. assert_1.ok(fsPath, 'a path argument must be provided');
  11189. fsPath = path.resolve(fsPath);
  11190. if (depth >= maxDepth)
  11191. return exports.mkdir(fsPath);
  11192. try {
  11193. yield exports.mkdir(fsPath);
  11194. return;
  11195. }
  11196. catch (err) {
  11197. switch (err.code) {
  11198. case 'ENOENT': {
  11199. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11200. yield exports.mkdir(fsPath);
  11201. return;
  11202. }
  11203. default: {
  11204. let stats;
  11205. try {
  11206. stats = yield exports.stat(fsPath);
  11207. }
  11208. catch (err2) {
  11209. throw err;
  11210. }
  11211. if (!stats.isDirectory())
  11212. throw err;
  11213. }
  11214. }
  11215. }
  11216. });
  11217. }
  11218. exports.mkdirP = mkdirP;
  11219. /**
  11220. * Best effort attempt to determine whether a file exists and is executable.
  11221. * @param filePath file path to check
  11222. * @param extensions additional file extensions to try
  11223. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11224. */
  11225. function tryGetExecutablePath(filePath, extensions) {
  11226. return __awaiter(this, void 0, void 0, function* () {
  11227. let stats = undefined;
  11228. try {
  11229. // test file exists
  11230. stats = yield exports.stat(filePath);
  11231. }
  11232. catch (err) {
  11233. if (err.code !== 'ENOENT') {
  11234. // eslint-disable-next-line no-console
  11235. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11236. }
  11237. }
  11238. if (stats && stats.isFile()) {
  11239. if (exports.IS_WINDOWS) {
  11240. // on Windows, test for valid extension
  11241. const upperExt = path.extname(filePath).toUpperCase();
  11242. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11243. return filePath;
  11244. }
  11245. }
  11246. else {
  11247. if (isUnixExecutable(stats)) {
  11248. return filePath;
  11249. }
  11250. }
  11251. }
  11252. // try each extension
  11253. const originalFilePath = filePath;
  11254. for (const extension of extensions) {
  11255. filePath = originalFilePath + extension;
  11256. stats = undefined;
  11257. try {
  11258. stats = yield exports.stat(filePath);
  11259. }
  11260. catch (err) {
  11261. if (err.code !== 'ENOENT') {
  11262. // eslint-disable-next-line no-console
  11263. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11264. }
  11265. }
  11266. if (stats && stats.isFile()) {
  11267. if (exports.IS_WINDOWS) {
  11268. // preserve the case of the actual file (since an extension was appended)
  11269. try {
  11270. const directory = path.dirname(filePath);
  11271. const upperName = path.basename(filePath).toUpperCase();
  11272. for (const actualName of yield exports.readdir(directory)) {
  11273. if (upperName === actualName.toUpperCase()) {
  11274. filePath = path.join(directory, actualName);
  11275. break;
  11276. }
  11277. }
  11278. }
  11279. catch (err) {
  11280. // eslint-disable-next-line no-console
  11281. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11282. }
  11283. return filePath;
  11284. }
  11285. else {
  11286. if (isUnixExecutable(stats)) {
  11287. return filePath;
  11288. }
  11289. }
  11290. }
  11291. }
  11292. return '';
  11293. });
  11294. }
  11295. exports.tryGetExecutablePath = tryGetExecutablePath;
  11296. function normalizeSeparators(p) {
  11297. p = p || '';
  11298. if (exports.IS_WINDOWS) {
  11299. // convert slashes on Windows
  11300. p = p.replace(/\//g, '\\');
  11301. // remove redundant slashes
  11302. return p.replace(/\\\\+/g, '\\');
  11303. }
  11304. // remove redundant slashes
  11305. return p.replace(/\/\/+/g, '/');
  11306. }
  11307. // on Mac/Linux, test the execute bit
  11308. // R W X R W X R W X
  11309. // 256 128 64 32 16 8 4 2 1
  11310. function isUnixExecutable(stats) {
  11311. return ((stats.mode & 1) > 0 ||
  11312. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11313. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11314. }
  11315. //# sourceMappingURL=io-util.js.map
  11316. /***/ }),
  11317. /***/ 674:
  11318. /***/ (function(module, __unusedexports, __webpack_require__) {
  11319. module.exports = authenticate;
  11320. const { Deprecation } = __webpack_require__(692);
  11321. const once = __webpack_require__(969);
  11322. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11323. function authenticate(state, options) {
  11324. deprecateAuthenticate(
  11325. state.octokit.log,
  11326. new Deprecation(
  11327. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11328. )
  11329. );
  11330. if (!options) {
  11331. state.auth = false;
  11332. return;
  11333. }
  11334. switch (options.type) {
  11335. case "basic":
  11336. if (!options.username || !options.password) {
  11337. throw new Error(
  11338. "Basic authentication requires both a username and password to be set"
  11339. );
  11340. }
  11341. break;
  11342. case "oauth":
  11343. if (!options.token && !(options.key && options.secret)) {
  11344. throw new Error(
  11345. "OAuth2 authentication requires a token or key & secret to be set"
  11346. );
  11347. }
  11348. break;
  11349. case "token":
  11350. case "app":
  11351. if (!options.token) {
  11352. throw new Error("Token authentication requires a token to be set");
  11353. }
  11354. break;
  11355. default:
  11356. throw new Error(
  11357. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11358. );
  11359. }
  11360. state.auth = options;
  11361. }
  11362. /***/ }),
  11363. /***/ 675:
  11364. /***/ (function(module) {
  11365. module.exports = function btoa(str) {
  11366. return new Buffer(str).toString('base64')
  11367. }
  11368. /***/ }),
  11369. /***/ 692:
  11370. /***/ (function(__unusedmodule, exports) {
  11371. "use strict";
  11372. Object.defineProperty(exports, '__esModule', { value: true });
  11373. class Deprecation extends Error {
  11374. constructor(message) {
  11375. super(message); // Maintains proper stack trace (only available on V8)
  11376. /* istanbul ignore next */
  11377. if (Error.captureStackTrace) {
  11378. Error.captureStackTrace(this, this.constructor);
  11379. }
  11380. this.name = 'Deprecation';
  11381. }
  11382. }
  11383. exports.Deprecation = Deprecation;
  11384. /***/ }),
  11385. /***/ 696:
  11386. /***/ (function(module) {
  11387. "use strict";
  11388. /*!
  11389. * isobject <https://github.com/jonschlinkert/isobject>
  11390. *
  11391. * Copyright (c) 2014-2017, Jon Schlinkert.
  11392. * Released under the MIT License.
  11393. */
  11394. function isObject(val) {
  11395. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11396. }
  11397. /*!
  11398. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11399. *
  11400. * Copyright (c) 2014-2017, Jon Schlinkert.
  11401. * Released under the MIT License.
  11402. */
  11403. function isObjectObject(o) {
  11404. return isObject(o) === true
  11405. && Object.prototype.toString.call(o) === '[object Object]';
  11406. }
  11407. function isPlainObject(o) {
  11408. var ctor,prot;
  11409. if (isObjectObject(o) === false) return false;
  11410. // If has modified constructor
  11411. ctor = o.constructor;
  11412. if (typeof ctor !== 'function') return false;
  11413. // If has modified prototype
  11414. prot = ctor.prototype;
  11415. if (isObjectObject(prot) === false) return false;
  11416. // If constructor does not have an Object-specific method
  11417. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11418. return false;
  11419. }
  11420. // Most likely a plain Object
  11421. return true;
  11422. }
  11423. module.exports = isPlainObject;
  11424. /***/ }),
  11425. /***/ 697:
  11426. /***/ (function(module) {
  11427. "use strict";
  11428. module.exports = (promise, onFinally) => {
  11429. onFinally = onFinally || (() => {});
  11430. return promise.then(
  11431. val => new Promise(resolve => {
  11432. resolve(onFinally());
  11433. }).then(() => val),
  11434. err => new Promise(resolve => {
  11435. resolve(onFinally());
  11436. }).then(() => {
  11437. throw err;
  11438. })
  11439. );
  11440. };
  11441. /***/ }),
  11442. /***/ 705:
  11443. /***/ (function(module) {
  11444. module.exports = {"activity":{"checkStarringRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"},"deleteRepoSubscription":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscription"},"deleteThreadSubscription":{"method":"DELETE","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"getRepoSubscription":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscription"},"getThread":{"method":"GET","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id"},"getThreadSubscription":{"method":"GET","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"listEventsForOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events/orgs/:org"},"listEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events"},"listFeeds":{"method":"GET","params":{},"url":"/feeds"},"listNotifications":{"method":"GET","params":{"all":{"type":"boolean"},"before":{"type":"string"},"page":{"type":"integer"},"participating":{"type":"boolean"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/notifications"},"listNotificationsForRepo":{"method":"GET","params":{"all":{"type":"boolean"},"before":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"participating":{"type":"boolean"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/notifications"},"listPublicEvents":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/events"},"listPublicEventsForOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/events"},"listPublicEventsForRepoNetwork":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/networks/:owner/:repo/events"},"listPublicEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/events/public"},"listReceivedEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/received_events"},"listReceivedPublicEventsForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/received_events/public"},"listRepoEvents":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/events"},"listReposStarredByAuthenticatedUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/user/starred"},"listReposStarredByUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/starred"},"listReposWatchedByUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/subscriptions"},"listStargazersForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stargazers"},"listWatchedReposForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/subscriptions"},"listWatchersForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/subscribers"},"markAsRead":{"method":"PUT","params":{"last_read_at":{"type":"string"}},"url":"/notifications"},"markNotificationsAsReadForRepo":{"method":"PUT","params":{"last_read_at":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/notifications"},"markThreadAsRead":{"method":"PATCH","params":{"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id"},"setRepoSubscription":{"method":"PUT","params":{"ignored":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"subscribed":{"type":"boolean"}},"url":"/repos/:owner/:repo/subscription"},"setThreadSubscription":{"method":"PUT","params":{"ignored":{"type":"boolean"},"thread_id":{"required":true,"type":"integer"}},"url":"/notifications/threads/:thread_id/subscription"},"starRepo":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"},"unstarRepo":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/user/starred/:owner/:repo"}},"apps":{"addRepoToInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"PUT","params":{"installation_id":{"required":true,"type":"integer"},"repository_id":{"required":true,"type":"integer"}},"url":"/user/installations/:installation_id/repositories/:repository_id"},"checkAccountIsAssociatedWithAny":{"method":"GET","params":{"account_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/accounts/:account_id"},"checkAccountIsAssociatedWithAnyStubbed":{"method":"GET","params":{"account_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/stubbed/accounts/:account_id"},"checkAuthorization":{"deprecated":"octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)","method":"GET","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"checkToken":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"POST","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/token"},"createContentAttachment":{"headers":{"accept":"application/vnd.github.corsair-preview+json"},"method":"POST","params":{"body":{"required":true,"type":"string"},"content_reference_id":{"required":true,"type":"integer"},"title":{"required":true,"type":"string"}},"url":"/content_references/:content_reference_id/attachments"},"createFromManifest":{"headers":{"accept":"application/vnd.github.fury-preview+json"},"method":"POST","params":{"code":{"required":true,"type":"string"}},"url":"/app-manifests/:code/conversions"},"createInstallationToken":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"POST","params":{"installation_id":{"required":true,"type":"integer"},"permissions":{"type":"object"},"repository_ids":{"type":"integer[]"}},"url":"/app/installations/:installation_id/access_tokens"},"deleteAuthorization":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"DELETE","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grant"},"deleteInstallation":{"headers":{"accept":"application/vnd.github.gambit-preview+json,application/vnd.github.machine-man-preview+json"},"method":"DELETE","params":{"installation_id":{"required":true,"type":"integer"}},"url":"/app/installations/:installation_id"},"deleteToken":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"DELETE","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/token"},"findOrgInstallation":{"deprecated":"octokit.apps.findOrgInstallation() has been renamed to octokit.apps.getOrgInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/installation"},"findRepoInstallation":{"deprecated":"octokit.apps.findRepoInstallation() has been renamed to octokit.apps.getRepoInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/installation"},"findUserInstallation":{"deprecated":"octokit.apps.findUserInstallation() has been renamed to octokit.apps.getUserInstallation() (2019-04-10)","headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username/installation"},"getAuthenticated":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{},"url":"/app"},"getBySlug":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"app_slug":{"required":true,"type":"string"}},"url":"/apps/:app_slug"},"getInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"installation_id":{"required":true,"type":"integer"}},"url":"/app/installations/:installation_id"},"getOrgInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/installation"},"getRepoInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/installation"},"getUserInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username/installation"},"listAccountsUserOrOrgOnPlan":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"plan_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/marketplace_listing/plans/:plan_id/accounts"},"listAccountsUserOrOrgOnPlanStubbed":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"plan_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/marketplace_listing/stubbed/plans/:plan_id/accounts"},"listInstallationReposForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"installation_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/installations/:installation_id/repositories"},"listInstallations":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/app/installations"},"listInstallationsForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/installations"},"listMarketplacePurchasesForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/marketplace_purchases"},"listMarketplacePurchasesForAuthenticatedUserStubbed":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/marketplace_purchases/stubbed"},"listPlans":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/plans"},"listPlansStubbed":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/marketplace_listing/stubbed/plans"},"listRepos":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/installation/repositories"},"removeRepoFromInstallation":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"DELETE","params":{"installation_id":{"required":true,"type":"integer"},"repository_id":{"required":true,"type":"integer"}},"url":"/user/installations/:installation_id/repositories/:repository_id"},"resetAuthorization":{"deprecated":"octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)","method":"POST","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"resetToken":{"headers":{"accept":"application/vnd.github.doctor-strange-preview+json"},"method":"PATCH","params":{"access_token":{"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/token"},"revokeAuthorizationForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeGrantForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grants/:access_token"},"revokeInstallationToken":{"headers":{"accept":"application/vnd.github.gambit-preview+json"},"method":"DELETE","params":{},"url":"/installation/token"}},"checks":{"create":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"actions":{"type":"object[]"},"actions[].description":{"required":true,"type":"string"},"actions[].identifier":{"required":true,"type":"string"},"actions[].label":{"required":true,"type":"string"},"completed_at":{"type":"string"},"conclusion":{"enum":["success","failure","neutral","cancelled","timed_out","action_required"],"type":"string"},"details_url":{"type":"string"},"external_id":{"type":"string"},"head_sha":{"required":true,"type":"string"},"name":{"required":true,"type":"string"},"output":{"type":"object"},"output.annotations":{"type":"object[]"},"output.annotations[].annotation_level":{"enum":["notice","warning","failure"],"required":true,"type":"string"},"output.annotations[].end_column":{"type":"integer"},"output.annotations[].end_line":{"required":true,"type":"integer"},"output.annotations[].message":{"required":true,"type":"string"},"output.annotations[].path":{"required":true,"type":"string"},"output.annotations[].raw_details":{"type":"string"},"output.annotations[].start_column":{"type":"integer"},"output.annotations[].start_line":{"required":true,"type":"integer"},"output.annotations[].title":{"type":"string"},"output.images":{"type":"object[]"},"output.images[].alt":{"required":true,"type":"string"},"output.images[].caption":{"type":"string"},"output.images[].image_url":{"required":true,"type":"string"},"output.summary":{"required":true,"type":"string"},"output.text":{"type":"string"},"output.title":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"started_at":{"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-runs"},"createSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"head_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites"},"get":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_run_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id"},"getSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_suite_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id"},"listAnnotations":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_run_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id/annotations"},"listForRef":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_name":{"type":"string"},"filter":{"enum":["latest","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/check-runs"},"listForSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"check_name":{"type":"string"},"check_suite_id":{"required":true,"type":"integer"},"filter":{"enum":["latest","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id/check-runs"},"listSuitesForRef":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"GET","params":{"app_id":{"type":"integer"},"check_name":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/check-suites"},"rerequestSuite":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"POST","params":{"check_suite_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/:check_suite_id/rerequest"},"setSuitesPreferences":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"PATCH","params":{"auto_trigger_checks":{"type":"object[]"},"auto_trigger_checks[].app_id":{"required":true,"type":"integer"},"auto_trigger_checks[].setting":{"required":true,"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/check-suites/preferences"},"update":{"headers":{"accept":"application/vnd.github.antiope-preview+json"},"method":"PATCH","params":{"actions":{"type":"object[]"},"actions[].description":{"required":true,"type":"string"},"actions[].identifier":{"required":true,"type":"string"},"actions[].label":{"required":true,"type":"string"},"check_run_id":{"required":true,"type":"integer"},"completed_at":{"type":"string"},"conclusion":{"enum":["success","failure","neutral","cancelled","timed_out","action_required"],"type":"string"},"details_url":{"type":"string"},"external_id":{"type":"string"},"name":{"type":"string"},"output":{"type":"object"},"output.annotations":{"type":"object[]"},"output.annotations[].annotation_level":{"enum":["notice","warning","failure"],"required":true,"type":"string"},"output.annotations[].end_column":{"type":"integer"},"output.annotations[].end_line":{"required":true,"type":"integer"},"output.annotations[].message":{"required":true,"type":"string"},"output.annotations[].path":{"required":true,"type":"string"},"output.annotations[].raw_details":{"type":"string"},"output.annotations[].start_column":{"type":"integer"},"output.annotations[].start_line":{"required":true,"type":"integer"},"output.annotations[].title":{"type":"string"},"output.images":{"type":"object[]"},"output.images[].alt":{"required":true,"type":"string"},"output.images[].caption":{"type":"string"},"output.images[].image_url":{"required":true,"type":"string"},"output.summary":{"required":true,"type":"string"},"output.text":{"type":"string"},"output.title":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"started_at":{"type":"string"},"status":{"enum":["queued","in_progress","completed"],"type":"string"}},"url":"/repos/:owner/:repo/check-runs/:check_run_id"}},"codesOfConduct":{"getConductCode":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{"key":{"required":true,"type":"string"}},"url":"/codes_of_conduct/:key"},"getForRepo":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/community/code_of_conduct"},"listConductCodes":{"headers":{"accept":"application/vnd.github.scarlet-witch-preview+json"},"method":"GET","params":{},"url":"/codes_of_conduct"}},"emojis":{"get":{"method":"GET","params":{},"url":"/emojis"}},"gists":{"checkIsStarred":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"create":{"method":"POST","params":{"description":{"type":"string"},"files":{"required":true,"type":"object"},"files.content":{"type":"string"},"public":{"type":"boolean"}},"url":"/gists"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments"},"delete":{"method":"DELETE","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"},"fork":{"method":"POST","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/forks"},"get":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"},"getRevision":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/gists/:gist_id/:sha"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists"},"listComments":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/comments"},"listCommits":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/commits"},"listForks":{"method":"GET","params":{"gist_id":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/gists/:gist_id/forks"},"listPublic":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists/public"},"listPublicForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/gists"},"listStarred":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/gists/starred"},"star":{"method":"PUT","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"unstar":{"method":"DELETE","params":{"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/star"},"update":{"method":"PATCH","params":{"description":{"type":"string"},"files":{"type":"object"},"files.content":{"type":"string"},"files.filename":{"type":"string"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"gist_id":{"required":true,"type":"string"}},"url":"/gists/:gist_id/comments/:comment_id"}},"git":{"createBlob":{"method":"POST","params":{"content":{"required":true,"type":"string"},"encoding":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/blobs"},"createCommit":{"method":"POST","params":{"author":{"type":"object"},"author.date":{"type":"string"},"author.email":{"type":"string"},"author.name":{"type":"string"},"committer":{"type":"object"},"committer.date":{"type":"string"},"committer.email":{"type":"string"},"committer.name":{"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"parents":{"required":true,"type":"string[]"},"repo":{"required":true,"type":"string"},"signature":{"type":"string"},"tree":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/commits"},"createRef":{"method":"POST","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs"},"createTag":{"method":"POST","params":{"message":{"required":true,"type":"string"},"object":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag":{"required":true,"type":"string"},"tagger":{"type":"object"},"tagger.date":{"type":"string"},"tagger.email":{"type":"string"},"tagger.name":{"type":"string"},"type":{"enum":["commit","tree","blob"],"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/tags"},"createTree":{"method":"POST","params":{"base_tree":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tree":{"required":true,"type":"object[]"},"tree[].content":{"type":"string"},"tree[].mode":{"enum":["100644","100755","040000","160000","120000"],"type":"string"},"tree[].path":{"type":"string"},"tree[].sha":{"allowNull":true,"type":"string"},"tree[].type":{"enum":["blob","tree","commit"],"type":"string"}},"url":"/repos/:owner/:repo/git/trees"},"deleteRef":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:ref"},"getBlob":{"method":"GET","params":{"file_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/blobs/:file_sha"},"getCommit":{"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/commits/:commit_sha"},"getRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/ref/:ref"},"getTag":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag_sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/tags/:tag_sha"},"getTree":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"recursive":{"enum":["1"],"type":"integer"},"repo":{"required":true,"type":"string"},"tree_sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/trees/:tree_sha"},"listMatchingRefs":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/matching-refs/:ref"},"listRefs":{"method":"GET","params":{"namespace":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:namespace"},"updateRef":{"method":"PATCH","params":{"force":{"type":"boolean"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/git/refs/:ref"}},"gitignore":{"getTemplate":{"method":"GET","params":{"name":{"required":true,"type":"string"}},"url":"/gitignore/templates/:name"},"listTemplates":{"method":"GET","params":{},"url":"/gitignore/templates"}},"interactions":{"addOrUpdateRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"PUT","params":{"limit":{"enum":["existing_users","contributors_only","collaborators_only"],"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"addOrUpdateRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"PUT","params":{"limit":{"enum":["existing_users","contributors_only","collaborators_only"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"},"getRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"getRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"},"removeRestrictionsForOrg":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"DELETE","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/interaction-limits"},"removeRestrictionsForRepo":{"headers":{"accept":"application/vnd.github.sombra-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/interaction-limits"}},"issues":{"addAssignees":{"method":"POST","params":{"assignees":{"type":"string[]"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/assignees"},"addLabels":{"method":"POST","params":{"issue_number":{"required":true,"type":"integer"},"labels":{"required":true,"type":"string[]"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"checkAssignee":{"method":"GET","params":{"assignee":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/assignees/:assignee"},"create":{"method":"POST","params":{"assignee":{"type":"string"},"assignees":{"type":"string[]"},"body":{"type":"string"},"labels":{"type":"string[]"},"milestone":{"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/comments"},"createLabel":{"method":"POST","params":{"color":{"required":true,"type":"string"},"description":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels"},"createMilestone":{"method":"POST","params":{"description":{"type":"string"},"due_on":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"deleteLabel":{"method":"DELETE","params":{"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:name"},"deleteMilestone":{"method":"DELETE","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"},"get":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"getEvent":{"method":"GET","params":{"event_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/events/:event_id"},"getLabel":{"method":"GET","params":{"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:name"},"getMilestone":{"method":"GET","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"},"list":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/issues"},"listAssignees":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/assignees"},"listComments":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/comments"},"listCommentsForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/issues/comments"},"listEvents":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/events"},"listEventsForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/events"},"listEventsForTimeline":{"headers":{"accept":"application/vnd.github.mockingbird-preview+json"},"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/timeline"},"listForAuthenticatedUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/user/issues"},"listForOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"filter":{"enum":["assigned","created","mentioned","subscribed","all"],"type":"string"},"labels":{"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/orgs/:org/issues"},"listForRepo":{"method":"GET","params":{"assignee":{"type":"string"},"creator":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"labels":{"type":"string"},"mentioned":{"type":"string"},"milestone":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated","comments"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/issues"},"listLabelsForMilestone":{"method":"GET","params":{"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number/labels"},"listLabelsForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels"},"listLabelsOnIssue":{"method":"GET","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"listMilestonesForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["due_on","completeness"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/milestones"},"lock":{"method":"PUT","params":{"issue_number":{"required":true,"type":"integer"},"lock_reason":{"enum":["off-topic","too heated","resolved","spam"],"type":"string"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/lock"},"removeAssignees":{"method":"DELETE","params":{"assignees":{"type":"string[]"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/assignees"},"removeLabel":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"name":{"required":true,"type":"string"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels/:name"},"removeLabels":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"replaceLabels":{"method":"PUT","params":{"issue_number":{"required":true,"type":"integer"},"labels":{"type":"string[]"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/labels"},"unlock":{"method":"DELETE","params":{"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/lock"},"update":{"method":"PATCH","params":{"assignee":{"type":"string"},"assignees":{"type":"string[]"},"body":{"type":"string"},"issue_number":{"required":true,"type":"integer"},"labels":{"type":"string[]"},"milestone":{"allowNull":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id"},"updateLabel":{"method":"PATCH","params":{"color":{"type":"string"},"current_name":{"required":true,"type":"string"},"description":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/labels/:current_name"},"updateMilestone":{"method":"PATCH","params":{"description":{"type":"string"},"due_on":{"type":"string"},"milestone_number":{"required":true,"type":"integer"},"number":{"alias":"milestone_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/milestones/:milestone_number"}},"licenses":{"get":{"method":"GET","params":{"license":{"required":true,"type":"string"}},"url":"/licenses/:license"},"getForRepo":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/license"},"list":{"deprecated":"octokit.licenses.list() has been renamed to octokit.licenses.listCommonlyUsed() (2019-03-05)","method":"GET","params":{},"url":"/licenses"},"listCommonlyUsed":{"method":"GET","params":{},"url":"/licenses"}},"markdown":{"render":{"method":"POST","params":{"context":{"type":"string"},"mode":{"enum":["markdown","gfm"],"type":"string"},"text":{"required":true,"type":"string"}},"url":"/markdown"},"renderRaw":{"headers":{"content-type":"text/plain; charset=utf-8"},"method":"POST","params":{"data":{"mapTo":"data","required":true,"type":"string"}},"url":"/markdown/raw"}},"meta":{"get":{"method":"GET","params":{},"url":"/meta"}},"migrations":{"cancelImport":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import"},"deleteArchiveForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id/archive"},"deleteArchiveForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/archive"},"getArchiveForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id/archive"},"getArchiveForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/archive"},"getCommitAuthors":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"since":{"type":"string"}},"url":"/repos/:owner/:repo/import/authors"},"getImportProgress":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import"},"getLargeFiles":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/large_files"},"getStatusForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"}},"url":"/user/migrations/:migration_id"},"getStatusForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id"},"listForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/migrations"},"listForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/migrations"},"listReposForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/migrations/:migration_id/repositories"},"listReposForUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"GET","params":{"migration_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/:migration_id/repositories"},"mapCommitAuthor":{"method":"PATCH","params":{"author_id":{"required":true,"type":"integer"},"email":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/authors/:author_id"},"setLfsPreference":{"method":"PATCH","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"use_lfs":{"enum":["opt_in","opt_out"],"required":true,"type":"string"}},"url":"/repos/:owner/:repo/import/lfs"},"startForAuthenticatedUser":{"method":"POST","params":{"exclude_attachments":{"type":"boolean"},"lock_repositories":{"type":"boolean"},"repositories":{"required":true,"type":"string[]"}},"url":"/user/migrations"},"startForOrg":{"method":"POST","params":{"exclude_attachments":{"type":"boolean"},"lock_repositories":{"type":"boolean"},"org":{"required":true,"type":"string"},"repositories":{"required":true,"type":"string[]"}},"url":"/orgs/:org/migrations"},"startImport":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tfvc_project":{"type":"string"},"vcs":{"enum":["subversion","git","mercurial","tfvc"],"type":"string"},"vcs_password":{"type":"string"},"vcs_url":{"required":true,"type":"string"},"vcs_username":{"type":"string"}},"url":"/repos/:owner/:repo/import"},"unlockRepoForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"repo_name":{"required":true,"type":"string"}},"url":"/user/migrations/:migration_id/repos/:repo_name/lock"},"unlockRepoForOrg":{"headers":{"accept":"application/vnd.github.wyandotte-preview+json"},"method":"DELETE","params":{"migration_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"repo_name":{"required":true,"type":"string"}},"url":"/orgs/:org/migrations/:migration_id/repos/:repo_name/lock"},"updateImport":{"method":"PATCH","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"vcs_password":{"type":"string"},"vcs_username":{"type":"string"}},"url":"/repos/:owner/:repo/import"}},"oauthAuthorizations":{"checkAuthorization":{"deprecated":"octokit.oauthAuthorizations.checkAuthorization() has been renamed to octokit.apps.checkAuthorization() (2019-11-05)","method":"GET","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"createAuthorization":{"deprecated":"octokit.oauthAuthorizations.createAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#create-a-new-authorization","method":"POST","params":{"client_id":{"type":"string"},"client_secret":{"type":"string"},"fingerprint":{"type":"string"},"note":{"required":true,"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations"},"deleteAuthorization":{"deprecated":"octokit.oauthAuthorizations.deleteAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-an-authorization","method":"DELETE","params":{"authorization_id":{"required":true,"type":"integer"}},"url":"/authorizations/:authorization_id"},"deleteGrant":{"deprecated":"octokit.oauthAuthorizations.deleteGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#delete-a-grant","method":"DELETE","params":{"grant_id":{"required":true,"type":"integer"}},"url":"/applications/grants/:grant_id"},"getAuthorization":{"deprecated":"octokit.oauthAuthorizations.getAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-authorization","method":"GET","params":{"authorization_id":{"required":true,"type":"integer"}},"url":"/authorizations/:authorization_id"},"getGrant":{"deprecated":"octokit.oauthAuthorizations.getGrant() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-a-single-grant","method":"GET","params":{"grant_id":{"required":true,"type":"integer"}},"url":"/applications/grants/:grant_id"},"getOrCreateAuthorizationForApp":{"deprecated":"octokit.oauthAuthorizations.getOrCreateAuthorizationForApp() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id"},"getOrCreateAuthorizationForAppAndFingerprint":{"deprecated":"octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#get-or-create-an-authorization-for-a-specific-app-and-fingerprint","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"required":true,"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id/:fingerprint"},"getOrCreateAuthorizationForAppFingerprint":{"deprecated":"octokit.oauthAuthorizations.getOrCreateAuthorizationForAppFingerprint() has been renamed to octokit.oauthAuthorizations.getOrCreateAuthorizationForAppAndFingerprint() (2018-12-27)","method":"PUT","params":{"client_id":{"required":true,"type":"string"},"client_secret":{"required":true,"type":"string"},"fingerprint":{"required":true,"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"scopes":{"type":"string[]"}},"url":"/authorizations/clients/:client_id/:fingerprint"},"listAuthorizations":{"deprecated":"octokit.oauthAuthorizations.listAuthorizations() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-authorizations","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/authorizations"},"listGrants":{"deprecated":"octokit.oauthAuthorizations.listGrants() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#list-your-grants","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/applications/grants"},"resetAuthorization":{"deprecated":"octokit.oauthAuthorizations.resetAuthorization() has been renamed to octokit.apps.resetAuthorization() (2019-11-05)","method":"POST","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeAuthorizationForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeAuthorizationForApplication() has been renamed to octokit.apps.revokeAuthorizationForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/tokens/:access_token"},"revokeGrantForApplication":{"deprecated":"octokit.oauthAuthorizations.revokeGrantForApplication() has been renamed to octokit.apps.revokeGrantForApplication() (2019-11-05)","method":"DELETE","params":{"access_token":{"required":true,"type":"string"},"client_id":{"required":true,"type":"string"}},"url":"/applications/:client_id/grants/:access_token"},"updateAuthorization":{"deprecated":"octokit.oauthAuthorizations.updateAuthorization() is deprecated, see https://developer.github.com/v3/oauth_authorizations/#update-an-existing-authorization","method":"PATCH","params":{"add_scopes":{"type":"string[]"},"authorization_id":{"required":true,"type":"integer"},"fingerprint":{"type":"string"},"note":{"type":"string"},"note_url":{"type":"string"},"remove_scopes":{"type":"string[]"},"scopes":{"type":"string[]"}},"url":"/authorizations/:authorization_id"}},"orgs":{"addOrUpdateMembership":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"role":{"enum":["admin","member"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"blockUser":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"checkBlockedUser":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"checkMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/members/:username"},"checkPublicMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"concealMembership":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"convertMemberToOutsideCollaborator":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/outside_collaborators/:username"},"createHook":{"method":"POST","params":{"active":{"type":"boolean"},"config":{"required":true,"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks"},"createInvitation":{"method":"POST","params":{"email":{"type":"string"},"invitee_id":{"type":"integer"},"org":{"required":true,"type":"string"},"role":{"enum":["admin","direct_member","billing_manager"],"type":"string"},"team_ids":{"type":"integer[]"}},"url":"/orgs/:org/invitations"},"deleteHook":{"method":"DELETE","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"get":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org"},"getHook":{"method":"GET","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"getMembership":{"method":"GET","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"getMembershipForAuthenticatedUser":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/user/memberships/orgs/:org"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/organizations"},"listBlockedUsers":{"method":"GET","params":{"org":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks"},"listForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/orgs"},"listForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/orgs"},"listHooks":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/hooks"},"listInstallations":{"headers":{"accept":"application/vnd.github.machine-man-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/installations"},"listInvitationTeams":{"method":"GET","params":{"invitation_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/invitations/:invitation_id/teams"},"listMembers":{"method":"GET","params":{"filter":{"enum":["2fa_disabled","all"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["all","admin","member"],"type":"string"}},"url":"/orgs/:org/members"},"listMemberships":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["active","pending"],"type":"string"}},"url":"/user/memberships/orgs"},"listOutsideCollaborators":{"method":"GET","params":{"filter":{"enum":["2fa_disabled","all"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/outside_collaborators"},"listPendingInvitations":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/invitations"},"listPublicMembers":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/public_members"},"pingHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id/pings"},"publicizeMembership":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/public_members/:username"},"removeMember":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/members/:username"},"removeMembership":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/memberships/:username"},"removeOutsideCollaborator":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/outside_collaborators/:username"},"unblockUser":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/blocks/:username"},"update":{"method":"PATCH","params":{"billing_email":{"type":"string"},"company":{"type":"string"},"default_repository_permission":{"enum":["read","write","admin","none"],"type":"string"},"description":{"type":"string"},"email":{"type":"string"},"has_organization_projects":{"type":"boolean"},"has_repository_projects":{"type":"boolean"},"location":{"type":"string"},"members_allowed_repository_creation_type":{"enum":["all","private","none"],"type":"string"},"members_can_create_internal_repositories":{"type":"boolean"},"members_can_create_private_repositories":{"type":"boolean"},"members_can_create_public_repositories":{"type":"boolean"},"members_can_create_repositories":{"type":"boolean"},"name":{"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org"},"updateHook":{"method":"PATCH","params":{"active":{"type":"boolean"},"config":{"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"hook_id":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/hooks/:hook_id"},"updateMembership":{"method":"PATCH","params":{"org":{"required":true,"type":"string"},"state":{"enum":["active"],"required":true,"type":"string"}},"url":"/user/memberships/orgs/:org"}},"projects":{"addCollaborator":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username"},"createCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"column_id":{"required":true,"type":"integer"},"content_id":{"type":"integer"},"content_type":{"type":"string"},"note":{"type":"string"}},"url":"/projects/columns/:column_id/cards"},"createColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"name":{"required":true,"type":"string"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/columns"},"createForAuthenticatedUser":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"}},"url":"/user/projects"},"createForOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"}},"url":"/orgs/:org/projects"},"createForRepo":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"body":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/projects"},"delete":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id"},"deleteCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"card_id":{"required":true,"type":"integer"}},"url":"/projects/columns/cards/:card_id"},"deleteColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"column_id":{"required":true,"type":"integer"}},"url":"/projects/columns/:column_id"},"get":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id"},"getCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"card_id":{"required":true,"type":"integer"}},"url":"/projects/columns/cards/:card_id"},"getColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"column_id":{"required":true,"type":"integer"}},"url":"/projects/columns/:column_id"},"listCards":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"archived_state":{"enum":["all","archived","not_archived"],"type":"string"},"column_id":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/projects/columns/:column_id/cards"},"listCollaborators":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"affiliation":{"enum":["outside","direct","all"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/collaborators"},"listColumns":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"project_id":{"required":true,"type":"integer"}},"url":"/projects/:project_id/columns"},"listForOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/orgs/:org/projects"},"listForRepo":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/projects"},"listForUser":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"state":{"enum":["open","closed","all"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/projects"},"moveCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"card_id":{"required":true,"type":"integer"},"column_id":{"type":"integer"},"position":{"required":true,"type":"string","validation":"^(top|bottom|after:\\d+)$"}},"url":"/projects/columns/cards/:card_id/moves"},"moveColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"POST","params":{"column_id":{"required":true,"type":"integer"},"position":{"required":true,"type":"string","validation":"^(first|last|after:\\d+)$"}},"url":"/projects/columns/:column_id/moves"},"removeCollaborator":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username"},"reviewUserPermissionLevel":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"project_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/projects/:project_id/collaborators/:username/permission"},"update":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"body":{"type":"string"},"name":{"type":"string"},"organization_permission":{"type":"string"},"private":{"type":"boolean"},"project_id":{"required":true,"type":"integer"},"state":{"enum":["open","closed"],"type":"string"}},"url":"/projects/:project_id"},"updateCard":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"archived":{"type":"boolean"},"card_id":{"required":true,"type":"integer"},"note":{"type":"string"}},"url":"/projects/columns/cards/:card_id"},"updateColumn":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PATCH","params":{"column_id":{"required":true,"type":"integer"},"name":{"required":true,"type":"string"}},"url":"/projects/columns/:column_id"}},"pulls":{"checkIfMerged":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/merge"},"create":{"method":"POST","params":{"base":{"required":true,"type":"string"},"body":{"type":"string"},"draft":{"type":"boolean"},"head":{"required":true,"type":"string"},"maintainer_can_modify":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"title":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"createComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"commit_id":{"required":true,"type":"string"},"in_reply_to":{"deprecated":true,"description":"The comment ID to reply to. **Note**: This must be the ID of a top-level comment, not a reply to that comment. Replies to replies are not supported.","type":"integer"},"line":{"type":"integer"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"position":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"side":{"enum":["LEFT","RIGHT"],"type":"string"},"start_line":{"type":"integer"},"start_side":{"enum":["LEFT","RIGHT","side"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"createCommentReply":{"deprecated":"octokit.pulls.createCommentReply() has been renamed to octokit.pulls.createComment() (2019-09-09)","method":"POST","params":{"body":{"required":true,"type":"string"},"commit_id":{"required":true,"type":"string"},"in_reply_to":{"deprecated":true,"description":"The comment ID to reply to. **Note**: This must be the ID of a top-level comment, not a reply to that comment. Replies to replies are not supported.","type":"integer"},"line":{"type":"integer"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"position":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"side":{"enum":["LEFT","RIGHT"],"type":"string"},"start_line":{"type":"integer"},"start_side":{"enum":["LEFT","RIGHT","side"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"createFromIssue":{"deprecated":"octokit.pulls.createFromIssue() is deprecated, see https://developer.github.com/v3/pulls/#create-a-pull-request","method":"POST","params":{"base":{"required":true,"type":"string"},"draft":{"type":"boolean"},"head":{"required":true,"type":"string"},"issue":{"required":true,"type":"integer"},"maintainer_can_modify":{"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"createReview":{"method":"POST","params":{"body":{"type":"string"},"comments":{"type":"object[]"},"comments[].body":{"required":true,"type":"string"},"comments[].path":{"required":true,"type":"string"},"comments[].position":{"required":true,"type":"integer"},"commit_id":{"type":"string"},"event":{"enum":["APPROVE","REQUEST_CHANGES","COMMENT"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews"},"createReviewCommentReply":{"method":"POST","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments/:comment_id/replies"},"createReviewRequest":{"method":"POST","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"reviewers":{"type":"string[]"},"team_reviewers":{"type":"string[]"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"deleteComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"deletePendingReview":{"method":"DELETE","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"},"deleteReviewRequest":{"method":"DELETE","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"reviewers":{"type":"string[]"},"team_reviewers":{"type":"string[]"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"dismissReview":{"method":"PUT","params":{"message":{"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/dismissals"},"get":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number"},"getComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"getCommentsForReview":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/comments"},"getReview":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"},"list":{"method":"GET","params":{"base":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"head":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["created","updated","popularity","long-running"],"type":"string"},"state":{"enum":["open","closed","all"],"type":"string"}},"url":"/repos/:owner/:repo/pulls"},"listComments":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/comments"},"listCommentsForRepo":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"since":{"type":"string"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments"},"listCommits":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/commits"},"listFiles":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/files"},"listReviewRequests":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/requested_reviewers"},"listReviews":{"method":"GET","params":{"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews"},"merge":{"method":"PUT","params":{"commit_message":{"type":"string"},"commit_title":{"type":"string"},"merge_method":{"enum":["merge","squash","rebase"],"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/merge"},"submitReview":{"method":"POST","params":{"body":{"type":"string"},"event":{"enum":["APPROVE","REQUEST_CHANGES","COMMENT"],"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id/events"},"update":{"method":"PATCH","params":{"base":{"type":"string"},"body":{"type":"string"},"maintainer_can_modify":{"type":"boolean"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"state":{"enum":["open","closed"],"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number"},"updateBranch":{"headers":{"accept":"application/vnd.github.lydian-preview+json"},"method":"PUT","params":{"expected_head_sha":{"type":"string"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/:pull_number/update-branch"},"updateComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id"},"updateReview":{"method":"PUT","params":{"body":{"required":true,"type":"string"},"number":{"alias":"pull_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"pull_number":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"review_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/pulls/:pull_number/reviews/:review_id"}},"rateLimit":{"get":{"method":"GET","params":{},"url":"/rate_limit"}},"reactions":{"createForCommitComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id/reactions"},"createForIssue":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/reactions"},"createForIssueComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id/reactions"},"createForPullRequestReviewComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id/reactions"},"createForTeamDiscussion":{"deprecated":"octokit.reactions.createForTeamDiscussion() has been renamed to octokit.reactions.createForTeamDiscussionLegacy() (2020-01-16)","headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"createForTeamDiscussionComment":{"deprecated":"octokit.reactions.createForTeamDiscussionComment() has been renamed to octokit.reactions.createForTeamDiscussionCommentLegacy() (2020-01-16)","headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"},"createForTeamDiscussionCommentInOrg":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"},"createForTeamDiscussionCommentLegacy":{"deprecated":"octokit.reactions.createForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-comment-legacy","headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"},"createForTeamDiscussionInOrg":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"},"createForTeamDiscussionLegacy":{"deprecated":"octokit.reactions.createForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#create-reaction-for-a-team-discussion-legacy","headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"POST","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"delete":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"DELETE","params":{"reaction_id":{"required":true,"type":"integer"}},"url":"/reactions/:reaction_id"},"listForCommitComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id/reactions"},"listForIssue":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"issue_number":{"required":true,"type":"integer"},"number":{"alias":"issue_number","deprecated":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/:issue_number/reactions"},"listForIssueComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/issues/comments/:comment_id/reactions"},"listForPullRequestReviewComment":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pulls/comments/:comment_id/reactions"},"listForTeamDiscussion":{"deprecated":"octokit.reactions.listForTeamDiscussion() has been renamed to octokit.reactions.listForTeamDiscussionLegacy() (2020-01-16)","headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"},"listForTeamDiscussionComment":{"deprecated":"octokit.reactions.listForTeamDiscussionComment() has been renamed to octokit.reactions.listForTeamDiscussionCommentLegacy() (2020-01-16)","headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"},"listForTeamDiscussionCommentInOrg":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number/reactions"},"listForTeamDiscussionCommentLegacy":{"deprecated":"octokit.reactions.listForTeamDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-comment-legacy","headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number/reactions"},"listForTeamDiscussionInOrg":{"headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/reactions"},"listForTeamDiscussionLegacy":{"deprecated":"octokit.reactions.listForTeamDiscussionLegacy() is deprecated, see https://developer.github.com/v3/reactions/#list-reactions-for-a-team-discussion-legacy","headers":{"accept":"application/vnd.github.squirrel-girl-preview+json"},"method":"GET","params":{"content":{"enum":["+1","-1","laugh","confused","heart","hooray","rocket","eyes"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/reactions"}},"repos":{"acceptInvitation":{"method":"PATCH","params":{"invitation_id":{"required":true,"type":"integer"}},"url":"/user/repository_invitations/:invitation_id"},"addCollaborator":{"method":"PUT","params":{"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"addDeployKey":{"method":"POST","params":{"key":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"read_only":{"type":"boolean"},"repo":{"required":true,"type":"string"},"title":{"type":"string"}},"url":"/repos/:owner/:repo/keys"},"addProtectedBranchAdminEnforcement":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"addProtectedBranchAppRestrictions":{"method":"POST","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"addProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"addProtectedBranchRequiredStatusChecksContexts":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"addProtectedBranchTeamRestrictions":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"addProtectedBranchUserRestrictions":{"method":"POST","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"checkCollaborator":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"checkVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"compareCommits":{"method":"GET","params":{"base":{"required":true,"type":"string"},"head":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/compare/:base...:head"},"createCommitComment":{"method":"POST","params":{"body":{"required":true,"type":"string"},"commit_sha":{"required":true,"type":"string"},"line":{"type":"integer"},"owner":{"required":true,"type":"string"},"path":{"type":"string"},"position":{"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"alias":"commit_sha","deprecated":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/comments"},"createDeployment":{"method":"POST","params":{"auto_merge":{"type":"boolean"},"description":{"type":"string"},"environment":{"type":"string"},"owner":{"required":true,"type":"string"},"payload":{"type":"string"},"production_environment":{"type":"boolean"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"required_contexts":{"type":"string[]"},"task":{"type":"string"},"transient_environment":{"type":"boolean"}},"url":"/repos/:owner/:repo/deployments"},"createDeploymentStatus":{"method":"POST","params":{"auto_inactive":{"type":"boolean"},"deployment_id":{"required":true,"type":"integer"},"description":{"type":"string"},"environment":{"enum":["production","staging","qa"],"type":"string"},"environment_url":{"type":"string"},"log_url":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"state":{"enum":["error","failure","inactive","in_progress","queued","pending","success"],"required":true,"type":"string"},"target_url":{"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses"},"createDispatchEvent":{"headers":{"accept":"application/vnd.github.everest-preview+json"},"method":"POST","params":{"client_payload":{"type":"object"},"event_type":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/dispatches"},"createFile":{"deprecated":"octokit.repos.createFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)","method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"createForAuthenticatedUser":{"method":"POST","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"auto_init":{"type":"boolean"},"delete_branch_on_merge":{"type":"boolean"},"description":{"type":"string"},"gitignore_template":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"license_template":{"type":"string"},"name":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"type":"integer"},"visibility":{"enum":["public","private","visibility","internal"],"type":"string"}},"url":"/user/repos"},"createFork":{"method":"POST","params":{"organization":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/forks"},"createHook":{"method":"POST","params":{"active":{"type":"boolean"},"config":{"required":true,"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks"},"createInOrg":{"method":"POST","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"auto_init":{"type":"boolean"},"delete_branch_on_merge":{"type":"boolean"},"description":{"type":"string"},"gitignore_template":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"license_template":{"type":"string"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"type":"integer"},"visibility":{"enum":["public","private","visibility","internal"],"type":"string"}},"url":"/orgs/:org/repos"},"createOrUpdateFile":{"method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"createRelease":{"method":"POST","params":{"body":{"type":"string"},"draft":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"prerelease":{"type":"boolean"},"repo":{"required":true,"type":"string"},"tag_name":{"required":true,"type":"string"},"target_commitish":{"type":"string"}},"url":"/repos/:owner/:repo/releases"},"createStatus":{"method":"POST","params":{"context":{"type":"string"},"description":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"},"state":{"enum":["error","failure","pending","success"],"required":true,"type":"string"},"target_url":{"type":"string"}},"url":"/repos/:owner/:repo/statuses/:sha"},"createUsingTemplate":{"headers":{"accept":"application/vnd.github.baptiste-preview+json"},"method":"POST","params":{"description":{"type":"string"},"name":{"required":true,"type":"string"},"owner":{"type":"string"},"private":{"type":"boolean"},"template_owner":{"required":true,"type":"string"},"template_repo":{"required":true,"type":"string"}},"url":"/repos/:template_owner/:template_repo/generate"},"declineInvitation":{"method":"DELETE","params":{"invitation_id":{"required":true,"type":"integer"}},"url":"/user/repository_invitations/:invitation_id"},"delete":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"deleteCommitComment":{"method":"DELETE","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"deleteDownload":{"method":"DELETE","params":{"download_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads/:download_id"},"deleteFile":{"method":"DELETE","params":{"author":{"type":"object"},"author.email":{"type":"string"},"author.name":{"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"type":"string"},"committer.name":{"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"deleteHook":{"method":"DELETE","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"deleteInvitation":{"method":"DELETE","params":{"invitation_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations/:invitation_id"},"deleteRelease":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"deleteReleaseAsset":{"method":"DELETE","params":{"asset_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"disableAutomatedSecurityFixes":{"headers":{"accept":"application/vnd.github.london-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/automated-security-fixes"},"disablePagesSite":{"headers":{"accept":"application/vnd.github.switcheroo-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages"},"disableVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"enableAutomatedSecurityFixes":{"headers":{"accept":"application/vnd.github.london-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/automated-security-fixes"},"enablePagesSite":{"headers":{"accept":"application/vnd.github.switcheroo-preview+json"},"method":"POST","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"source":{"type":"object"},"source.branch":{"enum":["master","gh-pages"],"type":"string"},"source.path":{"type":"string"}},"url":"/repos/:owner/:repo/pages"},"enableVulnerabilityAlerts":{"headers":{"accept":"application/vnd.github.dorian-preview+json"},"method":"PUT","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/vulnerability-alerts"},"get":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo"},"getAppsWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"getArchiveLink":{"method":"GET","params":{"archive_format":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/:archive_format/:ref"},"getBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch"},"getBranchProtection":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"getClones":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"per":{"enum":["day","week"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/clones"},"getCodeFrequencyStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/code_frequency"},"getCollaboratorPermissionLevel":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username/permission"},"getCombinedStatusForRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/status"},"getCommit":{"method":"GET","params":{"commit_sha":{"alias":"ref","deprecated":true,"type":"string"},"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"alias":"ref","deprecated":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref"},"getCommitActivityStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/commit_activity"},"getCommitComment":{"method":"GET","params":{"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"getCommitRefSha":{"deprecated":"octokit.repos.getCommitRefSha() is deprecated, see https://developer.github.com/v3/repos/commits/#get-a-single-commit","headers":{"accept":"application/vnd.github.v3.sha"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref"},"getContents":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"getContributorsStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/contributors"},"getDeployKey":{"method":"GET","params":{"key_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys/:key_id"},"getDeployment":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id"},"getDeploymentStatus":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"status_id":{"required":true,"type":"integer"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses/:status_id"},"getDownload":{"method":"GET","params":{"download_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads/:download_id"},"getHook":{"method":"GET","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"getLatestPagesBuild":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds/latest"},"getLatestRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/latest"},"getPages":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages"},"getPagesBuild":{"method":"GET","params":{"build_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds/:build_id"},"getParticipationStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/participation"},"getProtectedBranchAdminEnforcement":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"getProtectedBranchPullRequestReviewEnforcement":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"getProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"getProtectedBranchRequiredStatusChecks":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"getProtectedBranchRestrictions":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions"},"getPunchCardStats":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/stats/punch_card"},"getReadme":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/readme"},"getRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"getReleaseAsset":{"method":"GET","params":{"asset_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"getReleaseByTag":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"tag":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/tags/:tag"},"getTeamsWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"getTopPaths":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/popular/paths"},"getTopReferrers":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/popular/referrers"},"getUsersWithAccessToProtectedBranch":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"getViews":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"per":{"enum":["day","week"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/traffic/views"},"list":{"method":"GET","params":{"affiliation":{"type":"string"},"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","owner","public","private","member"],"type":"string"},"visibility":{"enum":["all","public","private"],"type":"string"}},"url":"/user/repos"},"listAppsWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listAppsWithAccessToProtectedBranch() has been renamed to octokit.repos.getAppsWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"listAssetsForRelease":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id/assets"},"listBranches":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"protected":{"type":"boolean"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches"},"listBranchesForHeadCommit":{"headers":{"accept":"application/vnd.github.groot-preview+json"},"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/branches-where-head"},"listCollaborators":{"method":"GET","params":{"affiliation":{"enum":["outside","direct","all"],"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators"},"listCommentsForCommit":{"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"alias":"commit_sha","deprecated":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/comments"},"listCommitComments":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments"},"listCommits":{"method":"GET","params":{"author":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"path":{"type":"string"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"},"since":{"type":"string"},"until":{"type":"string"}},"url":"/repos/:owner/:repo/commits"},"listContributors":{"method":"GET","params":{"anon":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/contributors"},"listDeployKeys":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys"},"listDeploymentStatuses":{"method":"GET","params":{"deployment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/deployments/:deployment_id/statuses"},"listDeployments":{"method":"GET","params":{"environment":{"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"},"task":{"type":"string"}},"url":"/repos/:owner/:repo/deployments"},"listDownloads":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/downloads"},"listForOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","public","private","forks","sources","member","internal"],"type":"string"}},"url":"/orgs/:org/repos"},"listForUser":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"sort":{"enum":["created","updated","pushed","full_name"],"type":"string"},"type":{"enum":["all","owner","member"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/repos"},"listForks":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"},"sort":{"enum":["newest","oldest","stargazers"],"type":"string"}},"url":"/repos/:owner/:repo/forks"},"listHooks":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks"},"listInvitations":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations"},"listInvitationsForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/repository_invitations"},"listLanguages":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/languages"},"listPagesBuilds":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds"},"listProtectedBranchRequiredStatusChecksContexts":{"method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"listProtectedBranchTeamRestrictions":{"deprecated":"octokit.repos.listProtectedBranchTeamRestrictions() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-09)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"listProtectedBranchUserRestrictions":{"deprecated":"octokit.repos.listProtectedBranchUserRestrictions() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-09)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"listPublic":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/repositories"},"listPullRequestsAssociatedWithCommit":{"headers":{"accept":"application/vnd.github.groot-preview+json"},"method":"GET","params":{"commit_sha":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:commit_sha/pulls"},"listReleases":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases"},"listStatusesForRef":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"ref":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/commits/:ref/statuses"},"listTags":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/tags"},"listTeams":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/teams"},"listTeamsWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listTeamsWithAccessToProtectedBranch() has been renamed to octokit.repos.getTeamsWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"listTopics":{"headers":{"accept":"application/vnd.github.mercy-preview+json"},"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/topics"},"listUsersWithAccessToProtectedBranch":{"deprecated":"octokit.repos.listUsersWithAccessToProtectedBranch() has been renamed to octokit.repos.getUsersWithAccessToProtectedBranch() (2019-09-13)","method":"GET","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"merge":{"method":"POST","params":{"base":{"required":true,"type":"string"},"commit_message":{"type":"string"},"head":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/merges"},"pingHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id/pings"},"removeBranchProtection":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"removeCollaborator":{"method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/collaborators/:username"},"removeDeployKey":{"method":"DELETE","params":{"key_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/keys/:key_id"},"removeProtectedBranchAdminEnforcement":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/enforce_admins"},"removeProtectedBranchAppRestrictions":{"method":"DELETE","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"removeProtectedBranchPullRequestReviewEnforcement":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"removeProtectedBranchRequiredSignatures":{"headers":{"accept":"application/vnd.github.zzzax-preview+json"},"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_signatures"},"removeProtectedBranchRequiredStatusChecks":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"removeProtectedBranchRequiredStatusChecksContexts":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"removeProtectedBranchRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions"},"removeProtectedBranchTeamRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"removeProtectedBranchUserRestrictions":{"method":"DELETE","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"replaceProtectedBranchAppRestrictions":{"method":"PUT","params":{"apps":{"mapTo":"data","required":true,"type":"string[]"},"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/apps"},"replaceProtectedBranchRequiredStatusChecksContexts":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"contexts":{"mapTo":"data","required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks/contexts"},"replaceProtectedBranchTeamRestrictions":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"teams":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/teams"},"replaceProtectedBranchUserRestrictions":{"method":"PUT","params":{"branch":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"users":{"mapTo":"data","required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection/restrictions/users"},"replaceTopics":{"headers":{"accept":"application/vnd.github.mercy-preview+json"},"method":"PUT","params":{"names":{"required":true,"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/topics"},"requestPageBuild":{"method":"POST","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/pages/builds"},"retrieveCommunityProfileMetrics":{"method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/community/profile"},"testPushHook":{"method":"POST","params":{"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id/tests"},"transfer":{"method":"POST","params":{"new_owner":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_ids":{"type":"integer[]"}},"url":"/repos/:owner/:repo/transfer"},"update":{"method":"PATCH","params":{"allow_merge_commit":{"type":"boolean"},"allow_rebase_merge":{"type":"boolean"},"allow_squash_merge":{"type":"boolean"},"archived":{"type":"boolean"},"default_branch":{"type":"string"},"delete_branch_on_merge":{"type":"boolean"},"description":{"type":"string"},"has_issues":{"type":"boolean"},"has_projects":{"type":"boolean"},"has_wiki":{"type":"boolean"},"homepage":{"type":"string"},"is_template":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"private":{"type":"boolean"},"repo":{"required":true,"type":"string"},"visibility":{"enum":["public","private","visibility","internal"],"type":"string"}},"url":"/repos/:owner/:repo"},"updateBranchProtection":{"method":"PUT","params":{"allow_deletions":{"type":"boolean"},"allow_force_pushes":{"allowNull":true,"type":"boolean"},"branch":{"required":true,"type":"string"},"enforce_admins":{"allowNull":true,"required":true,"type":"boolean"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"required_linear_history":{"type":"boolean"},"required_pull_request_reviews":{"allowNull":true,"required":true,"type":"object"},"required_pull_request_reviews.dismiss_stale_reviews":{"type":"boolean"},"required_pull_request_reviews.dismissal_restrictions":{"type":"object"},"required_pull_request_reviews.dismissal_restrictions.teams":{"type":"string[]"},"required_pull_request_reviews.dismissal_restrictions.users":{"type":"string[]"},"required_pull_request_reviews.require_code_owner_reviews":{"type":"boolean"},"required_pull_request_reviews.required_approving_review_count":{"type":"integer"},"required_status_checks":{"allowNull":true,"required":true,"type":"object"},"required_status_checks.contexts":{"required":true,"type":"string[]"},"required_status_checks.strict":{"required":true,"type":"boolean"},"restrictions":{"allowNull":true,"required":true,"type":"object"},"restrictions.apps":{"type":"string[]"},"restrictions.teams":{"required":true,"type":"string[]"},"restrictions.users":{"required":true,"type":"string[]"}},"url":"/repos/:owner/:repo/branches/:branch/protection"},"updateCommitComment":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/comments/:comment_id"},"updateFile":{"deprecated":"octokit.repos.updateFile() has been renamed to octokit.repos.createOrUpdateFile() (2019-06-07)","method":"PUT","params":{"author":{"type":"object"},"author.email":{"required":true,"type":"string"},"author.name":{"required":true,"type":"string"},"branch":{"type":"string"},"committer":{"type":"object"},"committer.email":{"required":true,"type":"string"},"committer.name":{"required":true,"type":"string"},"content":{"required":true,"type":"string"},"message":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"path":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"sha":{"type":"string"}},"url":"/repos/:owner/:repo/contents/:path"},"updateHook":{"method":"PATCH","params":{"active":{"type":"boolean"},"add_events":{"type":"string[]"},"config":{"type":"object"},"config.content_type":{"type":"string"},"config.insecure_ssl":{"type":"string"},"config.secret":{"type":"string"},"config.url":{"required":true,"type":"string"},"events":{"type":"string[]"},"hook_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"remove_events":{"type":"string[]"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/hooks/:hook_id"},"updateInformationAboutPagesSite":{"method":"PUT","params":{"cname":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"source":{"enum":["\"gh-pages\"","\"master\"","\"master /docs\""],"type":"string"}},"url":"/repos/:owner/:repo/pages"},"updateInvitation":{"method":"PATCH","params":{"invitation_id":{"required":true,"type":"integer"},"owner":{"required":true,"type":"string"},"permissions":{"enum":["read","write","admin"],"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/invitations/:invitation_id"},"updateProtectedBranchPullRequestReviewEnforcement":{"method":"PATCH","params":{"branch":{"required":true,"type":"string"},"dismiss_stale_reviews":{"type":"boolean"},"dismissal_restrictions":{"type":"object"},"dismissal_restrictions.teams":{"type":"string[]"},"dismissal_restrictions.users":{"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"require_code_owner_reviews":{"type":"boolean"},"required_approving_review_count":{"type":"integer"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_pull_request_reviews"},"updateProtectedBranchRequiredStatusChecks":{"method":"PATCH","params":{"branch":{"required":true,"type":"string"},"contexts":{"type":"string[]"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"strict":{"type":"boolean"}},"url":"/repos/:owner/:repo/branches/:branch/protection/required_status_checks"},"updateRelease":{"method":"PATCH","params":{"body":{"type":"string"},"draft":{"type":"boolean"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"prerelease":{"type":"boolean"},"release_id":{"required":true,"type":"integer"},"repo":{"required":true,"type":"string"},"tag_name":{"type":"string"},"target_commitish":{"type":"string"}},"url":"/repos/:owner/:repo/releases/:release_id"},"updateReleaseAsset":{"method":"PATCH","params":{"asset_id":{"required":true,"type":"integer"},"label":{"type":"string"},"name":{"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"}},"url":"/repos/:owner/:repo/releases/assets/:asset_id"},"uploadReleaseAsset":{"method":"POST","params":{"file":{"mapTo":"data","required":true,"type":"string | object"},"headers":{"required":true,"type":"object"},"headers.content-length":{"required":true,"type":"integer"},"headers.content-type":{"required":true,"type":"string"},"label":{"type":"string"},"name":{"required":true,"type":"string"},"url":{"required":true,"type":"string"}},"url":":url"}},"search":{"code":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["indexed"],"type":"string"}},"url":"/search/code"},"commits":{"headers":{"accept":"application/vnd.github.cloak-preview+json"},"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["author-date","committer-date"],"type":"string"}},"url":"/search/commits"},"issues":{"deprecated":"octokit.search.issues() has been renamed to octokit.search.issuesAndPullRequests() (2018-12-27)","method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["comments","reactions","reactions-+1","reactions--1","reactions-smile","reactions-thinking_face","reactions-heart","reactions-tada","interactions","created","updated"],"type":"string"}},"url":"/search/issues"},"issuesAndPullRequests":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["comments","reactions","reactions-+1","reactions--1","reactions-smile","reactions-thinking_face","reactions-heart","reactions-tada","interactions","created","updated"],"type":"string"}},"url":"/search/issues"},"labels":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"q":{"required":true,"type":"string"},"repository_id":{"required":true,"type":"integer"},"sort":{"enum":["created","updated"],"type":"string"}},"url":"/search/labels"},"repos":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["stars","forks","help-wanted-issues","updated"],"type":"string"}},"url":"/search/repositories"},"topics":{"method":"GET","params":{"q":{"required":true,"type":"string"}},"url":"/search/topics"},"users":{"method":"GET","params":{"order":{"enum":["desc","asc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"q":{"required":true,"type":"string"},"sort":{"enum":["followers","repositories","joined"],"type":"string"}},"url":"/search/users"}},"teams":{"addMember":{"deprecated":"octokit.teams.addMember() has been renamed to octokit.teams.addMemberLegacy() (2020-01-16)","method":"PUT","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"addMemberLegacy":{"deprecated":"octokit.teams.addMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-team-member-legacy","method":"PUT","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"addOrUpdateMembership":{"deprecated":"octokit.teams.addOrUpdateMembership() has been renamed to octokit.teams.addOrUpdateMembershipLegacy() (2020-01-16)","method":"PUT","params":{"role":{"enum":["member","maintainer"],"type":"string"},"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"addOrUpdateMembershipInOrg":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"role":{"enum":["member","maintainer"],"type":"string"},"team_slug":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/memberships/:username"},"addOrUpdateMembershipLegacy":{"deprecated":"octokit.teams.addOrUpdateMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#add-or-update-team-membership-legacy","method":"PUT","params":{"role":{"enum":["member","maintainer"],"type":"string"},"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"addOrUpdateProject":{"deprecated":"octokit.teams.addOrUpdateProject() has been renamed to octokit.teams.addOrUpdateProjectLegacy() (2020-01-16)","headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"addOrUpdateProjectInOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"org":{"required":true,"type":"string"},"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/projects/:project_id"},"addOrUpdateProjectLegacy":{"deprecated":"octokit.teams.addOrUpdateProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-project-legacy","headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"PUT","params":{"permission":{"enum":["read","write","admin"],"type":"string"},"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"addOrUpdateRepo":{"deprecated":"octokit.teams.addOrUpdateRepo() has been renamed to octokit.teams.addOrUpdateRepoLegacy() (2020-01-16)","method":"PUT","params":{"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"addOrUpdateRepoInOrg":{"method":"PUT","params":{"org":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/repos/:owner/:repo"},"addOrUpdateRepoLegacy":{"deprecated":"octokit.teams.addOrUpdateRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#add-or-update-team-repository-legacy","method":"PUT","params":{"owner":{"required":true,"type":"string"},"permission":{"enum":["pull","push","admin"],"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"checkManagesRepo":{"deprecated":"octokit.teams.checkManagesRepo() has been renamed to octokit.teams.checkManagesRepoLegacy() (2020-01-16)","method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"checkManagesRepoInOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/repos/:owner/:repo"},"checkManagesRepoLegacy":{"deprecated":"octokit.teams.checkManagesRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#check-if-a-team-manages-a-repository-legacy","method":"GET","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"create":{"method":"POST","params":{"description":{"type":"string"},"maintainers":{"type":"string[]"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"parent_team_id":{"type":"integer"},"permission":{"enum":["pull","push","admin"],"type":"string"},"privacy":{"enum":["secret","closed"],"type":"string"},"repo_names":{"type":"string[]"}},"url":"/orgs/:org/teams"},"createDiscussion":{"deprecated":"octokit.teams.createDiscussion() has been renamed to octokit.teams.createDiscussionLegacy() (2020-01-16)","method":"POST","params":{"body":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"required":true,"type":"integer"},"title":{"required":true,"type":"string"}},"url":"/teams/:team_id/discussions"},"createDiscussionComment":{"deprecated":"octokit.teams.createDiscussionComment() has been renamed to octokit.teams.createDiscussionCommentLegacy() (2020-01-16)","method":"POST","params":{"body":{"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments"},"createDiscussionCommentInOrg":{"method":"POST","params":{"body":{"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"},"createDiscussionCommentLegacy":{"deprecated":"octokit.teams.createDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#create-a-comment-legacy","method":"POST","params":{"body":{"required":true,"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments"},"createDiscussionInOrg":{"method":"POST","params":{"body":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_slug":{"required":true,"type":"string"},"title":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions"},"createDiscussionLegacy":{"deprecated":"octokit.teams.createDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#create-a-discussion-legacy","method":"POST","params":{"body":{"required":true,"type":"string"},"private":{"type":"boolean"},"team_id":{"required":true,"type":"integer"},"title":{"required":true,"type":"string"}},"url":"/teams/:team_id/discussions"},"delete":{"deprecated":"octokit.teams.delete() has been renamed to octokit.teams.deleteLegacy() (2020-01-16)","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"deleteDiscussion":{"deprecated":"octokit.teams.deleteDiscussion() has been renamed to octokit.teams.deleteDiscussionLegacy() (2020-01-16)","method":"DELETE","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"deleteDiscussionComment":{"deprecated":"octokit.teams.deleteDiscussionComment() has been renamed to octokit.teams.deleteDiscussionCommentLegacy() (2020-01-16)","method":"DELETE","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"deleteDiscussionCommentInOrg":{"method":"DELETE","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"},"deleteDiscussionCommentLegacy":{"deprecated":"octokit.teams.deleteDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#delete-a-comment-legacy","method":"DELETE","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"deleteDiscussionInOrg":{"method":"DELETE","params":{"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number"},"deleteDiscussionLegacy":{"deprecated":"octokit.teams.deleteDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#delete-a-discussion-legacy","method":"DELETE","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"deleteInOrg":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug"},"deleteLegacy":{"deprecated":"octokit.teams.deleteLegacy() is deprecated, see https://developer.github.com/v3/teams/#delete-team-legacy","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"get":{"deprecated":"octokit.teams.get() has been renamed to octokit.teams.getLegacy() (2020-01-16)","method":"GET","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"getByName":{"method":"GET","params":{"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug"},"getDiscussion":{"deprecated":"octokit.teams.getDiscussion() has been renamed to octokit.teams.getDiscussionLegacy() (2020-01-16)","method":"GET","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"getDiscussionComment":{"deprecated":"octokit.teams.getDiscussionComment() has been renamed to octokit.teams.getDiscussionCommentLegacy() (2020-01-16)","method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"getDiscussionCommentInOrg":{"method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"},"getDiscussionCommentLegacy":{"deprecated":"octokit.teams.getDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#get-a-single-comment-legacy","method":"GET","params":{"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"getDiscussionInOrg":{"method":"GET","params":{"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number"},"getDiscussionLegacy":{"deprecated":"octokit.teams.getDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#get-a-single-discussion-legacy","method":"GET","params":{"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number"},"getLegacy":{"deprecated":"octokit.teams.getLegacy() is deprecated, see https://developer.github.com/v3/teams/#get-team-legacy","method":"GET","params":{"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"getMember":{"deprecated":"octokit.teams.getMember() has been renamed to octokit.teams.getMemberLegacy() (2020-01-16)","method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"getMemberLegacy":{"deprecated":"octokit.teams.getMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-member-legacy","method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"getMembership":{"deprecated":"octokit.teams.getMembership() has been renamed to octokit.teams.getMembershipLegacy() (2020-01-16)","method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"getMembershipInOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/memberships/:username"},"getMembershipLegacy":{"deprecated":"octokit.teams.getMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#get-team-membership-legacy","method":"GET","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"list":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/orgs/:org/teams"},"listChild":{"deprecated":"octokit.teams.listChild() has been renamed to octokit.teams.listChildLegacy() (2020-01-16)","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/teams"},"listChildInOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/teams"},"listChildLegacy":{"deprecated":"octokit.teams.listChildLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-child-teams-legacy","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/teams"},"listDiscussionComments":{"deprecated":"octokit.teams.listDiscussionComments() has been renamed to octokit.teams.listDiscussionCommentsLegacy() (2020-01-16)","method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments"},"listDiscussionCommentsInOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments"},"listDiscussionCommentsLegacy":{"deprecated":"octokit.teams.listDiscussionCommentsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#list-comments-legacy","method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"discussion_number":{"required":true,"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments"},"listDiscussions":{"deprecated":"octokit.teams.listDiscussions() has been renamed to octokit.teams.listDiscussionsLegacy() (2020-01-16)","method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions"},"listDiscussionsInOrg":{"method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions"},"listDiscussionsLegacy":{"deprecated":"octokit.teams.listDiscussionsLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#list-discussions-legacy","method":"GET","params":{"direction":{"enum":["asc","desc"],"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions"},"listForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/teams"},"listMembers":{"deprecated":"octokit.teams.listMembers() has been renamed to octokit.teams.listMembersLegacy() (2020-01-16)","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["member","maintainer","all"],"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/members"},"listMembersInOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["member","maintainer","all"],"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/members"},"listMembersLegacy":{"deprecated":"octokit.teams.listMembersLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-team-members-legacy","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"role":{"enum":["member","maintainer","all"],"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/members"},"listPendingInvitations":{"deprecated":"octokit.teams.listPendingInvitations() has been renamed to octokit.teams.listPendingInvitationsLegacy() (2020-01-16)","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/invitations"},"listPendingInvitationsInOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/invitations"},"listPendingInvitationsLegacy":{"deprecated":"octokit.teams.listPendingInvitationsLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#list-pending-team-invitations-legacy","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/invitations"},"listProjects":{"deprecated":"octokit.teams.listProjects() has been renamed to octokit.teams.listProjectsLegacy() (2020-01-16)","headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects"},"listProjectsInOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/projects"},"listProjectsLegacy":{"deprecated":"octokit.teams.listProjectsLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-projects-legacy","headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects"},"listRepos":{"deprecated":"octokit.teams.listRepos() has been renamed to octokit.teams.listReposLegacy() (2020-01-16)","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos"},"listReposInOrg":{"method":"GET","params":{"org":{"required":true,"type":"string"},"page":{"type":"integer"},"per_page":{"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/repos"},"listReposLegacy":{"deprecated":"octokit.teams.listReposLegacy() is deprecated, see https://developer.github.com/v3/teams/#list-team-repos-legacy","method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos"},"removeMemberLegacy":{"deprecated":"octokit.teams.removeMemberLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-member-legacy","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/members/:username"},"removeMembershipInOrg":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/memberships/:username"},"removeMembershipLegacy":{"deprecated":"octokit.teams.removeMembershipLegacy() is deprecated, see https://developer.github.com/v3/teams/members/#remove-team-membership-legacy","method":"DELETE","params":{"team_id":{"required":true,"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/teams/:team_id/memberships/:username"},"removeProject":{"deprecated":"octokit.teams.removeProject() has been renamed to octokit.teams.removeProjectLegacy() (2020-01-16)","method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"removeProjectInOrg":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"project_id":{"required":true,"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/projects/:project_id"},"removeProjectLegacy":{"deprecated":"octokit.teams.removeProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-project-legacy","method":"DELETE","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"removeRepo":{"deprecated":"octokit.teams.removeRepo() has been renamed to octokit.teams.removeRepoLegacy() (2020-01-16)","method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"removeRepoInOrg":{"method":"DELETE","params":{"org":{"required":true,"type":"string"},"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/repos/:owner/:repo"},"removeRepoLegacy":{"deprecated":"octokit.teams.removeRepoLegacy() is deprecated, see https://developer.github.com/v3/teams/#remove-team-repository-legacy","method":"DELETE","params":{"owner":{"required":true,"type":"string"},"repo":{"required":true,"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/repos/:owner/:repo"},"reviewProject":{"deprecated":"octokit.teams.reviewProject() has been renamed to octokit.teams.reviewProjectLegacy() (2020-01-16)","headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"reviewProjectInOrg":{"headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"org":{"required":true,"type":"string"},"project_id":{"required":true,"type":"integer"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/projects/:project_id"},"reviewProjectLegacy":{"deprecated":"octokit.teams.reviewProjectLegacy() is deprecated, see https://developer.github.com/v3/teams/#review-a-team-project-legacy","headers":{"accept":"application/vnd.github.inertia-preview+json"},"method":"GET","params":{"project_id":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/projects/:project_id"},"update":{"deprecated":"octokit.teams.update() has been renamed to octokit.teams.updateLegacy() (2020-01-16)","method":"PATCH","params":{"description":{"type":"string"},"name":{"required":true,"type":"string"},"parent_team_id":{"type":"integer"},"permission":{"enum":["pull","push","admin"],"type":"string"},"privacy":{"enum":["secret","closed"],"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"},"updateDiscussion":{"deprecated":"octokit.teams.updateDiscussion() has been renamed to octokit.teams.updateDiscussionLegacy() (2020-01-16)","method":"PATCH","params":{"body":{"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"},"title":{"type":"string"}},"url":"/teams/:team_id/discussions/:discussion_number"},"updateDiscussionComment":{"deprecated":"octokit.teams.updateDiscussionComment() has been renamed to octokit.teams.updateDiscussionCommentLegacy() (2020-01-16)","method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"updateDiscussionCommentInOrg":{"method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number/comments/:comment_number"},"updateDiscussionCommentLegacy":{"deprecated":"octokit.teams.updateDiscussionCommentLegacy() is deprecated, see https://developer.github.com/v3/teams/discussion_comments/#edit-a-comment-legacy","method":"PATCH","params":{"body":{"required":true,"type":"string"},"comment_number":{"required":true,"type":"integer"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id/discussions/:discussion_number/comments/:comment_number"},"updateDiscussionInOrg":{"method":"PATCH","params":{"body":{"type":"string"},"discussion_number":{"required":true,"type":"integer"},"org":{"required":true,"type":"string"},"team_slug":{"required":true,"type":"string"},"title":{"type":"string"}},"url":"/orgs/:org/teams/:team_slug/discussions/:discussion_number"},"updateDiscussionLegacy":{"deprecated":"octokit.teams.updateDiscussionLegacy() is deprecated, see https://developer.github.com/v3/teams/discussions/#edit-a-discussion-legacy","method":"PATCH","params":{"body":{"type":"string"},"discussion_number":{"required":true,"type":"integer"},"team_id":{"required":true,"type":"integer"},"title":{"type":"string"}},"url":"/teams/:team_id/discussions/:discussion_number"},"updateInOrg":{"method":"PATCH","params":{"description":{"type":"string"},"name":{"required":true,"type":"string"},"org":{"required":true,"type":"string"},"parent_team_id":{"type":"integer"},"permission":{"enum":["pull","push","admin"],"type":"string"},"privacy":{"enum":["secret","closed"],"type":"string"},"team_slug":{"required":true,"type":"string"}},"url":"/orgs/:org/teams/:team_slug"},"updateLegacy":{"deprecated":"octokit.teams.updateLegacy() is deprecated, see https://developer.github.com/v3/teams/#edit-team-legacy","method":"PATCH","params":{"description":{"type":"string"},"name":{"required":true,"type":"string"},"parent_team_id":{"type":"integer"},"permission":{"enum":["pull","push","admin"],"type":"string"},"privacy":{"enum":["secret","closed"],"type":"string"},"team_id":{"required":true,"type":"integer"}},"url":"/teams/:team_id"}},"users":{"addEmails":{"method":"POST","params":{"emails":{"required":true,"type":"string[]"}},"url":"/user/emails"},"block":{"method":"PUT","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"checkBlocked":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"checkFollowing":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"checkFollowingForUser":{"method":"GET","params":{"target_user":{"required":true,"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/following/:target_user"},"createGpgKey":{"method":"POST","params":{"armored_public_key":{"type":"string"}},"url":"/user/gpg_keys"},"createPublicKey":{"method":"POST","params":{"key":{"type":"string"},"title":{"type":"string"}},"url":"/user/keys"},"deleteEmails":{"method":"DELETE","params":{"emails":{"required":true,"type":"string[]"}},"url":"/user/emails"},"deleteGpgKey":{"method":"DELETE","params":{"gpg_key_id":{"required":true,"type":"integer"}},"url":"/user/gpg_keys/:gpg_key_id"},"deletePublicKey":{"method":"DELETE","params":{"key_id":{"required":true,"type":"integer"}},"url":"/user/keys/:key_id"},"follow":{"method":"PUT","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"getAuthenticated":{"method":"GET","params":{},"url":"/user"},"getByUsername":{"method":"GET","params":{"username":{"required":true,"type":"string"}},"url":"/users/:username"},"getContextForUser":{"method":"GET","params":{"subject_id":{"type":"string"},"subject_type":{"enum":["organization","repository","issue","pull_request"],"type":"string"},"username":{"required":true,"type":"string"}},"url":"/users/:username/hovercard"},"getGpgKey":{"method":"GET","params":{"gpg_key_id":{"required":true,"type":"integer"}},"url":"/user/gpg_keys/:gpg_key_id"},"getPublicKey":{"method":"GET","params":{"key_id":{"required":true,"type":"integer"}},"url":"/user/keys/:key_id"},"list":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"since":{"type":"string"}},"url":"/users"},"listBlocked":{"method":"GET","params":{},"url":"/user/blocks"},"listEmails":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/emails"},"listFollowersForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/followers"},"listFollowersForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/followers"},"listFollowingForAuthenticatedUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/following"},"listFollowingForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/following"},"listGpgKeys":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/gpg_keys"},"listGpgKeysForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/gpg_keys"},"listPublicEmails":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/public_emails"},"listPublicKeys":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"}},"url":"/user/keys"},"listPublicKeysForUser":{"method":"GET","params":{"page":{"type":"integer"},"per_page":{"type":"integer"},"username":{"required":true,"type":"string"}},"url":"/users/:username/keys"},"togglePrimaryEmailVisibility":{"method":"PATCH","params":{"email":{"required":true,"type":"string"},"visibility":{"required":true,"type":"string"}},"url":"/user/email/visibility"},"unblock":{"method":"DELETE","params":{"username":{"required":true,"type":"string"}},"url":"/user/blocks/:username"},"unfollow":{"method":"DELETE","params":{"username":{"required":true,"type":"string"}},"url":"/user/following/:username"},"updateAuthenticated":{"method":"PATCH","params":{"bio":{"type":"string"},"blog":{"type":"string"},"company":{"type":"string"},"email":{"type":"string"},"hireable":{"type":"boolean"},"location":{"type":"string"},"name":{"type":"string"}},"url":"/user"}}};
  11445. /***/ }),
  11446. /***/ 722:
  11447. /***/ (function(module) {
  11448. /**
  11449. * Convert array of 16 byte values to UUID string format of the form:
  11450. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11451. */
  11452. var byteToHex = [];
  11453. for (var i = 0; i < 256; ++i) {
  11454. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11455. }
  11456. function bytesToUuid(buf, offset) {
  11457. var i = offset || 0;
  11458. var bth = byteToHex;
  11459. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11460. return ([bth[buf[i++]], bth[buf[i++]],
  11461. bth[buf[i++]], bth[buf[i++]], '-',
  11462. bth[buf[i++]], bth[buf[i++]], '-',
  11463. bth[buf[i++]], bth[buf[i++]], '-',
  11464. bth[buf[i++]], bth[buf[i++]], '-',
  11465. bth[buf[i++]], bth[buf[i++]],
  11466. bth[buf[i++]], bth[buf[i++]],
  11467. bth[buf[i++]], bth[buf[i++]]]).join('');
  11468. }
  11469. module.exports = bytesToUuid;
  11470. /***/ }),
  11471. /***/ 742:
  11472. /***/ (function(module, __unusedexports, __webpack_require__) {
  11473. var fs = __webpack_require__(747)
  11474. var core
  11475. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11476. core = __webpack_require__(818)
  11477. } else {
  11478. core = __webpack_require__(197)
  11479. }
  11480. module.exports = isexe
  11481. isexe.sync = sync
  11482. function isexe (path, options, cb) {
  11483. if (typeof options === 'function') {
  11484. cb = options
  11485. options = {}
  11486. }
  11487. if (!cb) {
  11488. if (typeof Promise !== 'function') {
  11489. throw new TypeError('callback not provided')
  11490. }
  11491. return new Promise(function (resolve, reject) {
  11492. isexe(path, options || {}, function (er, is) {
  11493. if (er) {
  11494. reject(er)
  11495. } else {
  11496. resolve(is)
  11497. }
  11498. })
  11499. })
  11500. }
  11501. core(path, options || {}, function (er, is) {
  11502. // ignore EACCES because that just means we aren't allowed to run it
  11503. if (er) {
  11504. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11505. er = null
  11506. is = false
  11507. }
  11508. }
  11509. cb(er, is)
  11510. })
  11511. }
  11512. function sync (path, options) {
  11513. // my kingdom for a filtered catch
  11514. try {
  11515. return core.sync(path, options || {})
  11516. } catch (er) {
  11517. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11518. return false
  11519. } else {
  11520. throw er
  11521. }
  11522. }
  11523. }
  11524. /***/ }),
  11525. /***/ 747:
  11526. /***/ (function(module) {
  11527. module.exports = require("fs");
  11528. /***/ }),
  11529. /***/ 753:
  11530. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11531. "use strict";
  11532. Object.defineProperty(exports, '__esModule', { value: true });
  11533. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11534. var endpoint = __webpack_require__(385);
  11535. var universalUserAgent = __webpack_require__(796);
  11536. var isPlainObject = _interopDefault(__webpack_require__(696));
  11537. var nodeFetch = _interopDefault(__webpack_require__(454));
  11538. var requestError = __webpack_require__(463);
  11539. const VERSION = "5.3.1";
  11540. function getBufferResponse(response) {
  11541. return response.arrayBuffer();
  11542. }
  11543. function fetchWrapper(requestOptions) {
  11544. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11545. requestOptions.body = JSON.stringify(requestOptions.body);
  11546. }
  11547. let headers = {};
  11548. let status;
  11549. let url;
  11550. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11551. return fetch(requestOptions.url, Object.assign({
  11552. method: requestOptions.method,
  11553. body: requestOptions.body,
  11554. headers: requestOptions.headers,
  11555. redirect: requestOptions.redirect
  11556. }, requestOptions.request)).then(response => {
  11557. url = response.url;
  11558. status = response.status;
  11559. for (const keyAndValue of response.headers) {
  11560. headers[keyAndValue[0]] = keyAndValue[1];
  11561. }
  11562. if (status === 204 || status === 205) {
  11563. return;
  11564. } // GitHub API returns 200 for HEAD requsets
  11565. if (requestOptions.method === "HEAD") {
  11566. if (status < 400) {
  11567. return;
  11568. }
  11569. throw new requestError.RequestError(response.statusText, status, {
  11570. headers,
  11571. request: requestOptions
  11572. });
  11573. }
  11574. if (status === 304) {
  11575. throw new requestError.RequestError("Not modified", status, {
  11576. headers,
  11577. request: requestOptions
  11578. });
  11579. }
  11580. if (status >= 400) {
  11581. return response.text().then(message => {
  11582. const error = new requestError.RequestError(message, status, {
  11583. headers,
  11584. request: requestOptions
  11585. });
  11586. try {
  11587. let responseBody = JSON.parse(error.message);
  11588. Object.assign(error, responseBody);
  11589. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11590. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11591. } catch (e) {// ignore, see octokit/rest.js#684
  11592. }
  11593. throw error;
  11594. });
  11595. }
  11596. const contentType = response.headers.get("content-type");
  11597. if (/application\/json/.test(contentType)) {
  11598. return response.json();
  11599. }
  11600. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11601. return response.text();
  11602. }
  11603. return getBufferResponse(response);
  11604. }).then(data => {
  11605. return {
  11606. status,
  11607. url,
  11608. headers,
  11609. data
  11610. };
  11611. }).catch(error => {
  11612. if (error instanceof requestError.RequestError) {
  11613. throw error;
  11614. }
  11615. throw new requestError.RequestError(error.message, 500, {
  11616. headers,
  11617. request: requestOptions
  11618. });
  11619. });
  11620. }
  11621. function withDefaults(oldEndpoint, newDefaults) {
  11622. const endpoint = oldEndpoint.defaults(newDefaults);
  11623. const newApi = function (route, parameters) {
  11624. const endpointOptions = endpoint.merge(route, parameters);
  11625. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11626. return fetchWrapper(endpoint.parse(endpointOptions));
  11627. }
  11628. const request = (route, parameters) => {
  11629. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11630. };
  11631. Object.assign(request, {
  11632. endpoint,
  11633. defaults: withDefaults.bind(null, endpoint)
  11634. });
  11635. return endpointOptions.request.hook(request, endpointOptions);
  11636. };
  11637. return Object.assign(newApi, {
  11638. endpoint,
  11639. defaults: withDefaults.bind(null, endpoint)
  11640. });
  11641. }
  11642. const request = withDefaults(endpoint.endpoint, {
  11643. headers: {
  11644. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11645. }
  11646. });
  11647. exports.request = request;
  11648. //# sourceMappingURL=index.js.map
  11649. /***/ }),
  11650. /***/ 761:
  11651. /***/ (function(module) {
  11652. module.exports = require("zlib");
  11653. /***/ }),
  11654. /***/ 763:
  11655. /***/ (function(module) {
  11656. module.exports = removeHook
  11657. function removeHook (state, name, method) {
  11658. if (!state.registry[name]) {
  11659. return
  11660. }
  11661. var index = state.registry[name]
  11662. .map(function (registered) { return registered.orig })
  11663. .indexOf(method)
  11664. if (index === -1) {
  11665. return
  11666. }
  11667. state.registry[name].splice(index, 1)
  11668. }
  11669. /***/ }),
  11670. /***/ 768:
  11671. /***/ (function(module) {
  11672. "use strict";
  11673. module.exports = function (x) {
  11674. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11675. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11676. if (x[x.length - 1] === lf) {
  11677. x = x.slice(0, x.length - 1);
  11678. }
  11679. if (x[x.length - 1] === cr) {
  11680. x = x.slice(0, x.length - 1);
  11681. }
  11682. return x;
  11683. };
  11684. /***/ }),
  11685. /***/ 777:
  11686. /***/ (function(module, __unusedexports, __webpack_require__) {
  11687. module.exports = getFirstPage
  11688. const getPage = __webpack_require__(265)
  11689. function getFirstPage (octokit, link, headers) {
  11690. return getPage(octokit, link, 'first', headers)
  11691. }
  11692. /***/ }),
  11693. /***/ 796:
  11694. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11695. "use strict";
  11696. Object.defineProperty(exports, '__esModule', { value: true });
  11697. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11698. var osName = _interopDefault(__webpack_require__(2));
  11699. function getUserAgent() {
  11700. try {
  11701. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  11702. } catch (error) {
  11703. if (/wmic os get Caption/.test(error.message)) {
  11704. return "Windows <version undetectable>";
  11705. }
  11706. throw error;
  11707. }
  11708. }
  11709. exports.getUserAgent = getUserAgent;
  11710. //# sourceMappingURL=index.js.map
  11711. /***/ }),
  11712. /***/ 807:
  11713. /***/ (function(module, __unusedexports, __webpack_require__) {
  11714. module.exports = paginate;
  11715. const iterator = __webpack_require__(8);
  11716. function paginate(octokit, route, options, mapFn) {
  11717. if (typeof options === "function") {
  11718. mapFn = options;
  11719. options = undefined;
  11720. }
  11721. options = octokit.request.endpoint.merge(route, options);
  11722. return gather(
  11723. octokit,
  11724. [],
  11725. iterator(octokit, options)[Symbol.asyncIterator](),
  11726. mapFn
  11727. );
  11728. }
  11729. function gather(octokit, results, iterator, mapFn) {
  11730. return iterator.next().then(result => {
  11731. if (result.done) {
  11732. return results;
  11733. }
  11734. let earlyExit = false;
  11735. function done() {
  11736. earlyExit = true;
  11737. }
  11738. results = results.concat(
  11739. mapFn ? mapFn(result.value, done) : result.value.data
  11740. );
  11741. if (earlyExit) {
  11742. return results;
  11743. }
  11744. return gather(octokit, results, iterator, mapFn);
  11745. });
  11746. }
  11747. /***/ }),
  11748. /***/ 813:
  11749. /***/ (function(__unusedmodule, exports) {
  11750. "use strict";
  11751. Object.defineProperty(exports, '__esModule', { value: true });
  11752. async function auth(token) {
  11753. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  11754. return {
  11755. type: "token",
  11756. token: token,
  11757. tokenType
  11758. };
  11759. }
  11760. /**
  11761. * Prefix token for usage in the Authorization header
  11762. *
  11763. * @param token OAuth token or JSON Web Token
  11764. */
  11765. function withAuthorizationPrefix(token) {
  11766. if (token.split(/\./).length === 3) {
  11767. return `bearer ${token}`;
  11768. }
  11769. return `token ${token}`;
  11770. }
  11771. async function hook(token, request, route, parameters) {
  11772. const endpoint = request.endpoint.merge(route, parameters);
  11773. endpoint.headers.authorization = withAuthorizationPrefix(token);
  11774. return request(endpoint);
  11775. }
  11776. const createTokenAuth = function createTokenAuth(token) {
  11777. if (!token) {
  11778. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  11779. }
  11780. if (typeof token !== "string") {
  11781. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  11782. }
  11783. token = token.replace(/^(token|bearer) +/i, "");
  11784. return Object.assign(auth.bind(null, token), {
  11785. hook: hook.bind(null, token)
  11786. });
  11787. };
  11788. exports.createTokenAuth = createTokenAuth;
  11789. //# sourceMappingURL=index.js.map
  11790. /***/ }),
  11791. /***/ 814:
  11792. /***/ (function(module, __unusedexports, __webpack_require__) {
  11793. module.exports = which
  11794. which.sync = whichSync
  11795. var isWindows = process.platform === 'win32' ||
  11796. process.env.OSTYPE === 'cygwin' ||
  11797. process.env.OSTYPE === 'msys'
  11798. var path = __webpack_require__(622)
  11799. var COLON = isWindows ? ';' : ':'
  11800. var isexe = __webpack_require__(742)
  11801. function getNotFoundError (cmd) {
  11802. var er = new Error('not found: ' + cmd)
  11803. er.code = 'ENOENT'
  11804. return er
  11805. }
  11806. function getPathInfo (cmd, opt) {
  11807. var colon = opt.colon || COLON
  11808. var pathEnv = opt.path || process.env.PATH || ''
  11809. var pathExt = ['']
  11810. pathEnv = pathEnv.split(colon)
  11811. var pathExtExe = ''
  11812. if (isWindows) {
  11813. pathEnv.unshift(process.cwd())
  11814. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  11815. pathExt = pathExtExe.split(colon)
  11816. // Always test the cmd itself first. isexe will check to make sure
  11817. // it's found in the pathExt set.
  11818. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  11819. pathExt.unshift('')
  11820. }
  11821. // If it has a slash, then we don't bother searching the pathenv.
  11822. // just check the file itself, and that's it.
  11823. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  11824. pathEnv = ['']
  11825. return {
  11826. env: pathEnv,
  11827. ext: pathExt,
  11828. extExe: pathExtExe
  11829. }
  11830. }
  11831. function which (cmd, opt, cb) {
  11832. if (typeof opt === 'function') {
  11833. cb = opt
  11834. opt = {}
  11835. }
  11836. var info = getPathInfo(cmd, opt)
  11837. var pathEnv = info.env
  11838. var pathExt = info.ext
  11839. var pathExtExe = info.extExe
  11840. var found = []
  11841. ;(function F (i, l) {
  11842. if (i === l) {
  11843. if (opt.all && found.length)
  11844. return cb(null, found)
  11845. else
  11846. return cb(getNotFoundError(cmd))
  11847. }
  11848. var pathPart = pathEnv[i]
  11849. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  11850. pathPart = pathPart.slice(1, -1)
  11851. var p = path.join(pathPart, cmd)
  11852. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  11853. p = cmd.slice(0, 2) + p
  11854. }
  11855. ;(function E (ii, ll) {
  11856. if (ii === ll) return F(i + 1, l)
  11857. var ext = pathExt[ii]
  11858. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  11859. if (!er && is) {
  11860. if (opt.all)
  11861. found.push(p + ext)
  11862. else
  11863. return cb(null, p + ext)
  11864. }
  11865. return E(ii + 1, ll)
  11866. })
  11867. })(0, pathExt.length)
  11868. })(0, pathEnv.length)
  11869. }
  11870. function whichSync (cmd, opt) {
  11871. opt = opt || {}
  11872. var info = getPathInfo(cmd, opt)
  11873. var pathEnv = info.env
  11874. var pathExt = info.ext
  11875. var pathExtExe = info.extExe
  11876. var found = []
  11877. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  11878. var pathPart = pathEnv[i]
  11879. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  11880. pathPart = pathPart.slice(1, -1)
  11881. var p = path.join(pathPart, cmd)
  11882. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  11883. p = cmd.slice(0, 2) + p
  11884. }
  11885. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  11886. var cur = p + pathExt[j]
  11887. var is
  11888. try {
  11889. is = isexe.sync(cur, { pathExt: pathExtExe })
  11890. if (is) {
  11891. if (opt.all)
  11892. found.push(cur)
  11893. else
  11894. return cur
  11895. }
  11896. } catch (ex) {}
  11897. }
  11898. }
  11899. if (opt.all && found.length)
  11900. return found
  11901. if (opt.nothrow)
  11902. return null
  11903. throw getNotFoundError(cmd)
  11904. }
  11905. /***/ }),
  11906. /***/ 816:
  11907. /***/ (function(module) {
  11908. "use strict";
  11909. module.exports = /^#!.*/;
  11910. /***/ }),
  11911. /***/ 818:
  11912. /***/ (function(module, __unusedexports, __webpack_require__) {
  11913. module.exports = isexe
  11914. isexe.sync = sync
  11915. var fs = __webpack_require__(747)
  11916. function checkPathExt (path, options) {
  11917. var pathext = options.pathExt !== undefined ?
  11918. options.pathExt : process.env.PATHEXT
  11919. if (!pathext) {
  11920. return true
  11921. }
  11922. pathext = pathext.split(';')
  11923. if (pathext.indexOf('') !== -1) {
  11924. return true
  11925. }
  11926. for (var i = 0; i < pathext.length; i++) {
  11927. var p = pathext[i].toLowerCase()
  11928. if (p && path.substr(-p.length).toLowerCase() === p) {
  11929. return true
  11930. }
  11931. }
  11932. return false
  11933. }
  11934. function checkStat (stat, path, options) {
  11935. if (!stat.isSymbolicLink() && !stat.isFile()) {
  11936. return false
  11937. }
  11938. return checkPathExt(path, options)
  11939. }
  11940. function isexe (path, options, cb) {
  11941. fs.stat(path, function (er, stat) {
  11942. cb(er, er ? false : checkStat(stat, path, options))
  11943. })
  11944. }
  11945. function sync (path, options) {
  11946. return checkStat(fs.statSync(path), path, options)
  11947. }
  11948. /***/ }),
  11949. /***/ 821:
  11950. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11951. "use strict";
  11952. var __importStar = (this && this.__importStar) || function (mod) {
  11953. if (mod && mod.__esModule) return mod;
  11954. var result = {};
  11955. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  11956. result["default"] = mod;
  11957. return result;
  11958. };
  11959. Object.defineProperty(exports, "__esModule", { value: true });
  11960. const core = __importStar(__webpack_require__(470));
  11961. const fsHelper = __importStar(__webpack_require__(618));
  11962. const github = __importStar(__webpack_require__(469));
  11963. const path = __importStar(__webpack_require__(622));
  11964. function getInputs() {
  11965. const result = {};
  11966. // GitHub workspace
  11967. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  11968. if (!githubWorkspacePath) {
  11969. throw new Error('GITHUB_WORKSPACE not defined');
  11970. }
  11971. githubWorkspacePath = path.resolve(githubWorkspacePath);
  11972. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  11973. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  11974. // Qualified repository
  11975. const qualifiedRepository = core.getInput('repository') ||
  11976. `${github.context.repo.owner}/${github.context.repo.repo}`;
  11977. core.debug(`qualified repository = '${qualifiedRepository}'`);
  11978. const splitRepository = qualifiedRepository.split('/');
  11979. if (splitRepository.length !== 2 ||
  11980. !splitRepository[0] ||
  11981. !splitRepository[1]) {
  11982. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  11983. }
  11984. result.repositoryOwner = splitRepository[0];
  11985. result.repositoryName = splitRepository[1];
  11986. // Repository path
  11987. result.repositoryPath = core.getInput('path') || '.';
  11988. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  11989. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  11990. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  11991. }
  11992. // Workflow repository?
  11993. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  11994. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  11995. // Source branch, source version
  11996. result.ref = core.getInput('ref');
  11997. if (!result.ref) {
  11998. if (isWorkflowRepository) {
  11999. result.ref = github.context.ref;
  12000. result.commit = github.context.sha;
  12001. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12002. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12003. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12004. result.ref = `refs/heads/${result.ref}`;
  12005. }
  12006. }
  12007. if (!result.ref && !result.commit) {
  12008. result.ref = 'refs/heads/master';
  12009. }
  12010. }
  12011. // SHA?
  12012. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12013. result.commit = result.ref;
  12014. result.ref = '';
  12015. }
  12016. core.debug(`ref = '${result.ref}'`);
  12017. core.debug(`commit = '${result.commit}'`);
  12018. // Clean
  12019. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12020. core.debug(`clean = ${result.clean}`);
  12021. // Fetch depth
  12022. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12023. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12024. result.fetchDepth = 0;
  12025. }
  12026. core.debug(`fetch depth = ${result.fetchDepth}`);
  12027. // LFS
  12028. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12029. core.debug(`lfs = ${result.lfs}`);
  12030. // Submodules
  12031. result.submodules = false;
  12032. result.nestedSubmodules = false;
  12033. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12034. if (submodulesString == 'RECURSIVE') {
  12035. result.submodules = true;
  12036. result.nestedSubmodules = true;
  12037. }
  12038. else if (submodulesString == 'TRUE') {
  12039. result.submodules = true;
  12040. }
  12041. core.debug(`submodules = ${result.submodules}`);
  12042. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12043. // Auth token
  12044. result.authToken = core.getInput('token');
  12045. // Persist credentials
  12046. result.persistCredentials =
  12047. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12048. return result;
  12049. }
  12050. exports.getInputs = getInputs;
  12051. /***/ }),
  12052. /***/ 826:
  12053. /***/ (function(module, __unusedexports, __webpack_require__) {
  12054. var rng = __webpack_require__(139);
  12055. var bytesToUuid = __webpack_require__(722);
  12056. function v4(options, buf, offset) {
  12057. var i = buf && offset || 0;
  12058. if (typeof(options) == 'string') {
  12059. buf = options === 'binary' ? new Array(16) : null;
  12060. options = null;
  12061. }
  12062. options = options || {};
  12063. var rnds = options.random || (options.rng || rng)();
  12064. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12065. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12066. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12067. // Copy bytes to buffer, if provided
  12068. if (buf) {
  12069. for (var ii = 0; ii < 16; ++ii) {
  12070. buf[i + ii] = rnds[ii];
  12071. }
  12072. }
  12073. return buf || bytesToUuid(rnds);
  12074. }
  12075. module.exports = v4;
  12076. /***/ }),
  12077. /***/ 835:
  12078. /***/ (function(module) {
  12079. module.exports = require("url");
  12080. /***/ }),
  12081. /***/ 850:
  12082. /***/ (function(module, __unusedexports, __webpack_require__) {
  12083. module.exports = paginationMethodsPlugin
  12084. function paginationMethodsPlugin (octokit) {
  12085. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  12086. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  12087. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  12088. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  12089. octokit.hasFirstPage = __webpack_require__(536)
  12090. octokit.hasLastPage = __webpack_require__(336)
  12091. octokit.hasNextPage = __webpack_require__(929)
  12092. octokit.hasPreviousPage = __webpack_require__(558)
  12093. }
  12094. /***/ }),
  12095. /***/ 854:
  12096. /***/ (function(module) {
  12097. /**
  12098. * lodash (Custom Build) <https://lodash.com/>
  12099. * Build: `lodash modularize exports="npm" -o ./`
  12100. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12101. * Released under MIT license <https://lodash.com/license>
  12102. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12103. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12104. */
  12105. /** Used as the `TypeError` message for "Functions" methods. */
  12106. var FUNC_ERROR_TEXT = 'Expected a function';
  12107. /** Used to stand-in for `undefined` hash values. */
  12108. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12109. /** Used as references for various `Number` constants. */
  12110. var INFINITY = 1 / 0;
  12111. /** `Object#toString` result references. */
  12112. var funcTag = '[object Function]',
  12113. genTag = '[object GeneratorFunction]',
  12114. symbolTag = '[object Symbol]';
  12115. /** Used to match property names within property paths. */
  12116. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12117. reIsPlainProp = /^\w*$/,
  12118. reLeadingDot = /^\./,
  12119. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12120. /**
  12121. * Used to match `RegExp`
  12122. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12123. */
  12124. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12125. /** Used to match backslashes in property paths. */
  12126. var reEscapeChar = /\\(\\)?/g;
  12127. /** Used to detect host constructors (Safari). */
  12128. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12129. /** Detect free variable `global` from Node.js. */
  12130. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12131. /** Detect free variable `self`. */
  12132. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12133. /** Used as a reference to the global object. */
  12134. var root = freeGlobal || freeSelf || Function('return this')();
  12135. /**
  12136. * Gets the value at `key` of `object`.
  12137. *
  12138. * @private
  12139. * @param {Object} [object] The object to query.
  12140. * @param {string} key The key of the property to get.
  12141. * @returns {*} Returns the property value.
  12142. */
  12143. function getValue(object, key) {
  12144. return object == null ? undefined : object[key];
  12145. }
  12146. /**
  12147. * Checks if `value` is a host object in IE < 9.
  12148. *
  12149. * @private
  12150. * @param {*} value The value to check.
  12151. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12152. */
  12153. function isHostObject(value) {
  12154. // Many host objects are `Object` objects that can coerce to strings
  12155. // despite having improperly defined `toString` methods.
  12156. var result = false;
  12157. if (value != null && typeof value.toString != 'function') {
  12158. try {
  12159. result = !!(value + '');
  12160. } catch (e) {}
  12161. }
  12162. return result;
  12163. }
  12164. /** Used for built-in method references. */
  12165. var arrayProto = Array.prototype,
  12166. funcProto = Function.prototype,
  12167. objectProto = Object.prototype;
  12168. /** Used to detect overreaching core-js shims. */
  12169. var coreJsData = root['__core-js_shared__'];
  12170. /** Used to detect methods masquerading as native. */
  12171. var maskSrcKey = (function() {
  12172. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12173. return uid ? ('Symbol(src)_1.' + uid) : '';
  12174. }());
  12175. /** Used to resolve the decompiled source of functions. */
  12176. var funcToString = funcProto.toString;
  12177. /** Used to check objects for own properties. */
  12178. var hasOwnProperty = objectProto.hasOwnProperty;
  12179. /**
  12180. * Used to resolve the
  12181. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12182. * of values.
  12183. */
  12184. var objectToString = objectProto.toString;
  12185. /** Used to detect if a method is native. */
  12186. var reIsNative = RegExp('^' +
  12187. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12188. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12189. );
  12190. /** Built-in value references. */
  12191. var Symbol = root.Symbol,
  12192. splice = arrayProto.splice;
  12193. /* Built-in method references that are verified to be native. */
  12194. var Map = getNative(root, 'Map'),
  12195. nativeCreate = getNative(Object, 'create');
  12196. /** Used to convert symbols to primitives and strings. */
  12197. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12198. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12199. /**
  12200. * Creates a hash object.
  12201. *
  12202. * @private
  12203. * @constructor
  12204. * @param {Array} [entries] The key-value pairs to cache.
  12205. */
  12206. function Hash(entries) {
  12207. var index = -1,
  12208. length = entries ? entries.length : 0;
  12209. this.clear();
  12210. while (++index < length) {
  12211. var entry = entries[index];
  12212. this.set(entry[0], entry[1]);
  12213. }
  12214. }
  12215. /**
  12216. * Removes all key-value entries from the hash.
  12217. *
  12218. * @private
  12219. * @name clear
  12220. * @memberOf Hash
  12221. */
  12222. function hashClear() {
  12223. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12224. }
  12225. /**
  12226. * Removes `key` and its value from the hash.
  12227. *
  12228. * @private
  12229. * @name delete
  12230. * @memberOf Hash
  12231. * @param {Object} hash The hash to modify.
  12232. * @param {string} key The key of the value to remove.
  12233. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12234. */
  12235. function hashDelete(key) {
  12236. return this.has(key) && delete this.__data__[key];
  12237. }
  12238. /**
  12239. * Gets the hash value for `key`.
  12240. *
  12241. * @private
  12242. * @name get
  12243. * @memberOf Hash
  12244. * @param {string} key The key of the value to get.
  12245. * @returns {*} Returns the entry value.
  12246. */
  12247. function hashGet(key) {
  12248. var data = this.__data__;
  12249. if (nativeCreate) {
  12250. var result = data[key];
  12251. return result === HASH_UNDEFINED ? undefined : result;
  12252. }
  12253. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12254. }
  12255. /**
  12256. * Checks if a hash value for `key` exists.
  12257. *
  12258. * @private
  12259. * @name has
  12260. * @memberOf Hash
  12261. * @param {string} key The key of the entry to check.
  12262. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12263. */
  12264. function hashHas(key) {
  12265. var data = this.__data__;
  12266. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12267. }
  12268. /**
  12269. * Sets the hash `key` to `value`.
  12270. *
  12271. * @private
  12272. * @name set
  12273. * @memberOf Hash
  12274. * @param {string} key The key of the value to set.
  12275. * @param {*} value The value to set.
  12276. * @returns {Object} Returns the hash instance.
  12277. */
  12278. function hashSet(key, value) {
  12279. var data = this.__data__;
  12280. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12281. return this;
  12282. }
  12283. // Add methods to `Hash`.
  12284. Hash.prototype.clear = hashClear;
  12285. Hash.prototype['delete'] = hashDelete;
  12286. Hash.prototype.get = hashGet;
  12287. Hash.prototype.has = hashHas;
  12288. Hash.prototype.set = hashSet;
  12289. /**
  12290. * Creates an list cache object.
  12291. *
  12292. * @private
  12293. * @constructor
  12294. * @param {Array} [entries] The key-value pairs to cache.
  12295. */
  12296. function ListCache(entries) {
  12297. var index = -1,
  12298. length = entries ? entries.length : 0;
  12299. this.clear();
  12300. while (++index < length) {
  12301. var entry = entries[index];
  12302. this.set(entry[0], entry[1]);
  12303. }
  12304. }
  12305. /**
  12306. * Removes all key-value entries from the list cache.
  12307. *
  12308. * @private
  12309. * @name clear
  12310. * @memberOf ListCache
  12311. */
  12312. function listCacheClear() {
  12313. this.__data__ = [];
  12314. }
  12315. /**
  12316. * Removes `key` and its value from the list cache.
  12317. *
  12318. * @private
  12319. * @name delete
  12320. * @memberOf ListCache
  12321. * @param {string} key The key of the value to remove.
  12322. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12323. */
  12324. function listCacheDelete(key) {
  12325. var data = this.__data__,
  12326. index = assocIndexOf(data, key);
  12327. if (index < 0) {
  12328. return false;
  12329. }
  12330. var lastIndex = data.length - 1;
  12331. if (index == lastIndex) {
  12332. data.pop();
  12333. } else {
  12334. splice.call(data, index, 1);
  12335. }
  12336. return true;
  12337. }
  12338. /**
  12339. * Gets the list cache value for `key`.
  12340. *
  12341. * @private
  12342. * @name get
  12343. * @memberOf ListCache
  12344. * @param {string} key The key of the value to get.
  12345. * @returns {*} Returns the entry value.
  12346. */
  12347. function listCacheGet(key) {
  12348. var data = this.__data__,
  12349. index = assocIndexOf(data, key);
  12350. return index < 0 ? undefined : data[index][1];
  12351. }
  12352. /**
  12353. * Checks if a list cache value for `key` exists.
  12354. *
  12355. * @private
  12356. * @name has
  12357. * @memberOf ListCache
  12358. * @param {string} key The key of the entry to check.
  12359. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12360. */
  12361. function listCacheHas(key) {
  12362. return assocIndexOf(this.__data__, key) > -1;
  12363. }
  12364. /**
  12365. * Sets the list cache `key` to `value`.
  12366. *
  12367. * @private
  12368. * @name set
  12369. * @memberOf ListCache
  12370. * @param {string} key The key of the value to set.
  12371. * @param {*} value The value to set.
  12372. * @returns {Object} Returns the list cache instance.
  12373. */
  12374. function listCacheSet(key, value) {
  12375. var data = this.__data__,
  12376. index = assocIndexOf(data, key);
  12377. if (index < 0) {
  12378. data.push([key, value]);
  12379. } else {
  12380. data[index][1] = value;
  12381. }
  12382. return this;
  12383. }
  12384. // Add methods to `ListCache`.
  12385. ListCache.prototype.clear = listCacheClear;
  12386. ListCache.prototype['delete'] = listCacheDelete;
  12387. ListCache.prototype.get = listCacheGet;
  12388. ListCache.prototype.has = listCacheHas;
  12389. ListCache.prototype.set = listCacheSet;
  12390. /**
  12391. * Creates a map cache object to store key-value pairs.
  12392. *
  12393. * @private
  12394. * @constructor
  12395. * @param {Array} [entries] The key-value pairs to cache.
  12396. */
  12397. function MapCache(entries) {
  12398. var index = -1,
  12399. length = entries ? entries.length : 0;
  12400. this.clear();
  12401. while (++index < length) {
  12402. var entry = entries[index];
  12403. this.set(entry[0], entry[1]);
  12404. }
  12405. }
  12406. /**
  12407. * Removes all key-value entries from the map.
  12408. *
  12409. * @private
  12410. * @name clear
  12411. * @memberOf MapCache
  12412. */
  12413. function mapCacheClear() {
  12414. this.__data__ = {
  12415. 'hash': new Hash,
  12416. 'map': new (Map || ListCache),
  12417. 'string': new Hash
  12418. };
  12419. }
  12420. /**
  12421. * Removes `key` and its value from the map.
  12422. *
  12423. * @private
  12424. * @name delete
  12425. * @memberOf MapCache
  12426. * @param {string} key The key of the value to remove.
  12427. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12428. */
  12429. function mapCacheDelete(key) {
  12430. return getMapData(this, key)['delete'](key);
  12431. }
  12432. /**
  12433. * Gets the map value for `key`.
  12434. *
  12435. * @private
  12436. * @name get
  12437. * @memberOf MapCache
  12438. * @param {string} key The key of the value to get.
  12439. * @returns {*} Returns the entry value.
  12440. */
  12441. function mapCacheGet(key) {
  12442. return getMapData(this, key).get(key);
  12443. }
  12444. /**
  12445. * Checks if a map value for `key` exists.
  12446. *
  12447. * @private
  12448. * @name has
  12449. * @memberOf MapCache
  12450. * @param {string} key The key of the entry to check.
  12451. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12452. */
  12453. function mapCacheHas(key) {
  12454. return getMapData(this, key).has(key);
  12455. }
  12456. /**
  12457. * Sets the map `key` to `value`.
  12458. *
  12459. * @private
  12460. * @name set
  12461. * @memberOf MapCache
  12462. * @param {string} key The key of the value to set.
  12463. * @param {*} value The value to set.
  12464. * @returns {Object} Returns the map cache instance.
  12465. */
  12466. function mapCacheSet(key, value) {
  12467. getMapData(this, key).set(key, value);
  12468. return this;
  12469. }
  12470. // Add methods to `MapCache`.
  12471. MapCache.prototype.clear = mapCacheClear;
  12472. MapCache.prototype['delete'] = mapCacheDelete;
  12473. MapCache.prototype.get = mapCacheGet;
  12474. MapCache.prototype.has = mapCacheHas;
  12475. MapCache.prototype.set = mapCacheSet;
  12476. /**
  12477. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12478. *
  12479. * @private
  12480. * @param {Array} array The array to inspect.
  12481. * @param {*} key The key to search for.
  12482. * @returns {number} Returns the index of the matched value, else `-1`.
  12483. */
  12484. function assocIndexOf(array, key) {
  12485. var length = array.length;
  12486. while (length--) {
  12487. if (eq(array[length][0], key)) {
  12488. return length;
  12489. }
  12490. }
  12491. return -1;
  12492. }
  12493. /**
  12494. * The base implementation of `_.get` without support for default values.
  12495. *
  12496. * @private
  12497. * @param {Object} object The object to query.
  12498. * @param {Array|string} path The path of the property to get.
  12499. * @returns {*} Returns the resolved value.
  12500. */
  12501. function baseGet(object, path) {
  12502. path = isKey(path, object) ? [path] : castPath(path);
  12503. var index = 0,
  12504. length = path.length;
  12505. while (object != null && index < length) {
  12506. object = object[toKey(path[index++])];
  12507. }
  12508. return (index && index == length) ? object : undefined;
  12509. }
  12510. /**
  12511. * The base implementation of `_.isNative` without bad shim checks.
  12512. *
  12513. * @private
  12514. * @param {*} value The value to check.
  12515. * @returns {boolean} Returns `true` if `value` is a native function,
  12516. * else `false`.
  12517. */
  12518. function baseIsNative(value) {
  12519. if (!isObject(value) || isMasked(value)) {
  12520. return false;
  12521. }
  12522. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12523. return pattern.test(toSource(value));
  12524. }
  12525. /**
  12526. * The base implementation of `_.toString` which doesn't convert nullish
  12527. * values to empty strings.
  12528. *
  12529. * @private
  12530. * @param {*} value The value to process.
  12531. * @returns {string} Returns the string.
  12532. */
  12533. function baseToString(value) {
  12534. // Exit early for strings to avoid a performance hit in some environments.
  12535. if (typeof value == 'string') {
  12536. return value;
  12537. }
  12538. if (isSymbol(value)) {
  12539. return symbolToString ? symbolToString.call(value) : '';
  12540. }
  12541. var result = (value + '');
  12542. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12543. }
  12544. /**
  12545. * Casts `value` to a path array if it's not one.
  12546. *
  12547. * @private
  12548. * @param {*} value The value to inspect.
  12549. * @returns {Array} Returns the cast property path array.
  12550. */
  12551. function castPath(value) {
  12552. return isArray(value) ? value : stringToPath(value);
  12553. }
  12554. /**
  12555. * Gets the data for `map`.
  12556. *
  12557. * @private
  12558. * @param {Object} map The map to query.
  12559. * @param {string} key The reference key.
  12560. * @returns {*} Returns the map data.
  12561. */
  12562. function getMapData(map, key) {
  12563. var data = map.__data__;
  12564. return isKeyable(key)
  12565. ? data[typeof key == 'string' ? 'string' : 'hash']
  12566. : data.map;
  12567. }
  12568. /**
  12569. * Gets the native function at `key` of `object`.
  12570. *
  12571. * @private
  12572. * @param {Object} object The object to query.
  12573. * @param {string} key The key of the method to get.
  12574. * @returns {*} Returns the function if it's native, else `undefined`.
  12575. */
  12576. function getNative(object, key) {
  12577. var value = getValue(object, key);
  12578. return baseIsNative(value) ? value : undefined;
  12579. }
  12580. /**
  12581. * Checks if `value` is a property name and not a property path.
  12582. *
  12583. * @private
  12584. * @param {*} value The value to check.
  12585. * @param {Object} [object] The object to query keys on.
  12586. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12587. */
  12588. function isKey(value, object) {
  12589. if (isArray(value)) {
  12590. return false;
  12591. }
  12592. var type = typeof value;
  12593. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12594. value == null || isSymbol(value)) {
  12595. return true;
  12596. }
  12597. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12598. (object != null && value in Object(object));
  12599. }
  12600. /**
  12601. * Checks if `value` is suitable for use as unique object key.
  12602. *
  12603. * @private
  12604. * @param {*} value The value to check.
  12605. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12606. */
  12607. function isKeyable(value) {
  12608. var type = typeof value;
  12609. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12610. ? (value !== '__proto__')
  12611. : (value === null);
  12612. }
  12613. /**
  12614. * Checks if `func` has its source masked.
  12615. *
  12616. * @private
  12617. * @param {Function} func The function to check.
  12618. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12619. */
  12620. function isMasked(func) {
  12621. return !!maskSrcKey && (maskSrcKey in func);
  12622. }
  12623. /**
  12624. * Converts `string` to a property path array.
  12625. *
  12626. * @private
  12627. * @param {string} string The string to convert.
  12628. * @returns {Array} Returns the property path array.
  12629. */
  12630. var stringToPath = memoize(function(string) {
  12631. string = toString(string);
  12632. var result = [];
  12633. if (reLeadingDot.test(string)) {
  12634. result.push('');
  12635. }
  12636. string.replace(rePropName, function(match, number, quote, string) {
  12637. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  12638. });
  12639. return result;
  12640. });
  12641. /**
  12642. * Converts `value` to a string key if it's not a string or symbol.
  12643. *
  12644. * @private
  12645. * @param {*} value The value to inspect.
  12646. * @returns {string|symbol} Returns the key.
  12647. */
  12648. function toKey(value) {
  12649. if (typeof value == 'string' || isSymbol(value)) {
  12650. return value;
  12651. }
  12652. var result = (value + '');
  12653. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12654. }
  12655. /**
  12656. * Converts `func` to its source code.
  12657. *
  12658. * @private
  12659. * @param {Function} func The function to process.
  12660. * @returns {string} Returns the source code.
  12661. */
  12662. function toSource(func) {
  12663. if (func != null) {
  12664. try {
  12665. return funcToString.call(func);
  12666. } catch (e) {}
  12667. try {
  12668. return (func + '');
  12669. } catch (e) {}
  12670. }
  12671. return '';
  12672. }
  12673. /**
  12674. * Creates a function that memoizes the result of `func`. If `resolver` is
  12675. * provided, it determines the cache key for storing the result based on the
  12676. * arguments provided to the memoized function. By default, the first argument
  12677. * provided to the memoized function is used as the map cache key. The `func`
  12678. * is invoked with the `this` binding of the memoized function.
  12679. *
  12680. * **Note:** The cache is exposed as the `cache` property on the memoized
  12681. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  12682. * constructor with one whose instances implement the
  12683. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  12684. * method interface of `delete`, `get`, `has`, and `set`.
  12685. *
  12686. * @static
  12687. * @memberOf _
  12688. * @since 0.1.0
  12689. * @category Function
  12690. * @param {Function} func The function to have its output memoized.
  12691. * @param {Function} [resolver] The function to resolve the cache key.
  12692. * @returns {Function} Returns the new memoized function.
  12693. * @example
  12694. *
  12695. * var object = { 'a': 1, 'b': 2 };
  12696. * var other = { 'c': 3, 'd': 4 };
  12697. *
  12698. * var values = _.memoize(_.values);
  12699. * values(object);
  12700. * // => [1, 2]
  12701. *
  12702. * values(other);
  12703. * // => [3, 4]
  12704. *
  12705. * object.a = 2;
  12706. * values(object);
  12707. * // => [1, 2]
  12708. *
  12709. * // Modify the result cache.
  12710. * values.cache.set(object, ['a', 'b']);
  12711. * values(object);
  12712. * // => ['a', 'b']
  12713. *
  12714. * // Replace `_.memoize.Cache`.
  12715. * _.memoize.Cache = WeakMap;
  12716. */
  12717. function memoize(func, resolver) {
  12718. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  12719. throw new TypeError(FUNC_ERROR_TEXT);
  12720. }
  12721. var memoized = function() {
  12722. var args = arguments,
  12723. key = resolver ? resolver.apply(this, args) : args[0],
  12724. cache = memoized.cache;
  12725. if (cache.has(key)) {
  12726. return cache.get(key);
  12727. }
  12728. var result = func.apply(this, args);
  12729. memoized.cache = cache.set(key, result);
  12730. return result;
  12731. };
  12732. memoized.cache = new (memoize.Cache || MapCache);
  12733. return memoized;
  12734. }
  12735. // Assign cache to `_.memoize`.
  12736. memoize.Cache = MapCache;
  12737. /**
  12738. * Performs a
  12739. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12740. * comparison between two values to determine if they are equivalent.
  12741. *
  12742. * @static
  12743. * @memberOf _
  12744. * @since 4.0.0
  12745. * @category Lang
  12746. * @param {*} value The value to compare.
  12747. * @param {*} other The other value to compare.
  12748. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12749. * @example
  12750. *
  12751. * var object = { 'a': 1 };
  12752. * var other = { 'a': 1 };
  12753. *
  12754. * _.eq(object, object);
  12755. * // => true
  12756. *
  12757. * _.eq(object, other);
  12758. * // => false
  12759. *
  12760. * _.eq('a', 'a');
  12761. * // => true
  12762. *
  12763. * _.eq('a', Object('a'));
  12764. * // => false
  12765. *
  12766. * _.eq(NaN, NaN);
  12767. * // => true
  12768. */
  12769. function eq(value, other) {
  12770. return value === other || (value !== value && other !== other);
  12771. }
  12772. /**
  12773. * Checks if `value` is classified as an `Array` object.
  12774. *
  12775. * @static
  12776. * @memberOf _
  12777. * @since 0.1.0
  12778. * @category Lang
  12779. * @param {*} value The value to check.
  12780. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12781. * @example
  12782. *
  12783. * _.isArray([1, 2, 3]);
  12784. * // => true
  12785. *
  12786. * _.isArray(document.body.children);
  12787. * // => false
  12788. *
  12789. * _.isArray('abc');
  12790. * // => false
  12791. *
  12792. * _.isArray(_.noop);
  12793. * // => false
  12794. */
  12795. var isArray = Array.isArray;
  12796. /**
  12797. * Checks if `value` is classified as a `Function` object.
  12798. *
  12799. * @static
  12800. * @memberOf _
  12801. * @since 0.1.0
  12802. * @category Lang
  12803. * @param {*} value The value to check.
  12804. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12805. * @example
  12806. *
  12807. * _.isFunction(_);
  12808. * // => true
  12809. *
  12810. * _.isFunction(/abc/);
  12811. * // => false
  12812. */
  12813. function isFunction(value) {
  12814. // The use of `Object#toString` avoids issues with the `typeof` operator
  12815. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  12816. var tag = isObject(value) ? objectToString.call(value) : '';
  12817. return tag == funcTag || tag == genTag;
  12818. }
  12819. /**
  12820. * Checks if `value` is the
  12821. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12822. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12823. *
  12824. * @static
  12825. * @memberOf _
  12826. * @since 0.1.0
  12827. * @category Lang
  12828. * @param {*} value The value to check.
  12829. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12830. * @example
  12831. *
  12832. * _.isObject({});
  12833. * // => true
  12834. *
  12835. * _.isObject([1, 2, 3]);
  12836. * // => true
  12837. *
  12838. * _.isObject(_.noop);
  12839. * // => true
  12840. *
  12841. * _.isObject(null);
  12842. * // => false
  12843. */
  12844. function isObject(value) {
  12845. var type = typeof value;
  12846. return !!value && (type == 'object' || type == 'function');
  12847. }
  12848. /**
  12849. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12850. * and has a `typeof` result of "object".
  12851. *
  12852. * @static
  12853. * @memberOf _
  12854. * @since 4.0.0
  12855. * @category Lang
  12856. * @param {*} value The value to check.
  12857. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12858. * @example
  12859. *
  12860. * _.isObjectLike({});
  12861. * // => true
  12862. *
  12863. * _.isObjectLike([1, 2, 3]);
  12864. * // => true
  12865. *
  12866. * _.isObjectLike(_.noop);
  12867. * // => false
  12868. *
  12869. * _.isObjectLike(null);
  12870. * // => false
  12871. */
  12872. function isObjectLike(value) {
  12873. return !!value && typeof value == 'object';
  12874. }
  12875. /**
  12876. * Checks if `value` is classified as a `Symbol` primitive or object.
  12877. *
  12878. * @static
  12879. * @memberOf _
  12880. * @since 4.0.0
  12881. * @category Lang
  12882. * @param {*} value The value to check.
  12883. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12884. * @example
  12885. *
  12886. * _.isSymbol(Symbol.iterator);
  12887. * // => true
  12888. *
  12889. * _.isSymbol('abc');
  12890. * // => false
  12891. */
  12892. function isSymbol(value) {
  12893. return typeof value == 'symbol' ||
  12894. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  12895. }
  12896. /**
  12897. * Converts `value` to a string. An empty string is returned for `null`
  12898. * and `undefined` values. The sign of `-0` is preserved.
  12899. *
  12900. * @static
  12901. * @memberOf _
  12902. * @since 4.0.0
  12903. * @category Lang
  12904. * @param {*} value The value to process.
  12905. * @returns {string} Returns the string.
  12906. * @example
  12907. *
  12908. * _.toString(null);
  12909. * // => ''
  12910. *
  12911. * _.toString(-0);
  12912. * // => '-0'
  12913. *
  12914. * _.toString([1, 2, 3]);
  12915. * // => '1,2,3'
  12916. */
  12917. function toString(value) {
  12918. return value == null ? '' : baseToString(value);
  12919. }
  12920. /**
  12921. * Gets the value at `path` of `object`. If the resolved value is
  12922. * `undefined`, the `defaultValue` is returned in its place.
  12923. *
  12924. * @static
  12925. * @memberOf _
  12926. * @since 3.7.0
  12927. * @category Object
  12928. * @param {Object} object The object to query.
  12929. * @param {Array|string} path The path of the property to get.
  12930. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  12931. * @returns {*} Returns the resolved value.
  12932. * @example
  12933. *
  12934. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  12935. *
  12936. * _.get(object, 'a[0].b.c');
  12937. * // => 3
  12938. *
  12939. * _.get(object, ['a', '0', 'b', 'c']);
  12940. * // => 3
  12941. *
  12942. * _.get(object, 'a.b.c', 'default');
  12943. * // => 'default'
  12944. */
  12945. function get(object, path, defaultValue) {
  12946. var result = object == null ? undefined : baseGet(object, path);
  12947. return result === undefined ? defaultValue : result;
  12948. }
  12949. module.exports = get;
  12950. /***/ }),
  12951. /***/ 855:
  12952. /***/ (function(module, __unusedexports, __webpack_require__) {
  12953. module.exports = registerPlugin;
  12954. const factory = __webpack_require__(47);
  12955. function registerPlugin(plugins, pluginFunction) {
  12956. return factory(
  12957. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  12958. );
  12959. }
  12960. /***/ }),
  12961. /***/ 856:
  12962. /***/ (function(module, __unusedexports, __webpack_require__) {
  12963. module.exports = __webpack_require__(141);
  12964. /***/ }),
  12965. /***/ 863:
  12966. /***/ (function(module, __unusedexports, __webpack_require__) {
  12967. module.exports = authenticationBeforeRequest;
  12968. const btoa = __webpack_require__(675);
  12969. const withAuthorizationPrefix = __webpack_require__(143);
  12970. function authenticationBeforeRequest(state, options) {
  12971. if (typeof state.auth === "string") {
  12972. options.headers.authorization = withAuthorizationPrefix(state.auth);
  12973. return;
  12974. }
  12975. if (state.auth.username) {
  12976. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  12977. options.headers.authorization = `Basic ${hash}`;
  12978. if (state.otp) {
  12979. options.headers["x-github-otp"] = state.otp;
  12980. }
  12981. return;
  12982. }
  12983. if (state.auth.clientId) {
  12984. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  12985. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  12986. // URL though: `/applications/:client_id/tokens/:access_token`.
  12987. //
  12988. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  12989. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  12990. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  12991. //
  12992. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  12993. // as well as "/applications/123/tokens/token456"
  12994. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  12995. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  12996. options.headers.authorization = `Basic ${hash}`;
  12997. return;
  12998. }
  12999. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  13000. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  13001. return;
  13002. }
  13003. return Promise.resolve()
  13004. .then(() => {
  13005. return state.auth();
  13006. })
  13007. .then(authorization => {
  13008. options.headers.authorization = withAuthorizationPrefix(authorization);
  13009. });
  13010. }
  13011. /***/ }),
  13012. /***/ 866:
  13013. /***/ (function(module, __unusedexports, __webpack_require__) {
  13014. "use strict";
  13015. var shebangRegex = __webpack_require__(816);
  13016. module.exports = function (str) {
  13017. var match = str.match(shebangRegex);
  13018. if (!match) {
  13019. return null;
  13020. }
  13021. var arr = match[0].replace(/#! ?/, '').split(' ');
  13022. var bin = arr[0].split('/').pop();
  13023. var arg = arr[1];
  13024. return (bin === 'env' ?
  13025. arg :
  13026. bin + (arg ? ' ' + arg : '')
  13027. );
  13028. };
  13029. /***/ }),
  13030. /***/ 874:
  13031. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13032. "use strict";
  13033. // Copyright (c) Microsoft. All rights reserved.
  13034. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  13035. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13036. return new (P || (P = Promise))(function (resolve, reject) {
  13037. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13038. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13039. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  13040. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13041. });
  13042. };
  13043. Object.defineProperty(exports, "__esModule", { value: true });
  13044. const url = __webpack_require__(835);
  13045. const http = __webpack_require__(605);
  13046. const https = __webpack_require__(211);
  13047. let fs;
  13048. let tunnel;
  13049. var HttpCodes;
  13050. (function (HttpCodes) {
  13051. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  13052. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  13053. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  13054. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  13055. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  13056. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  13057. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  13058. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  13059. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  13060. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  13061. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  13062. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  13063. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  13064. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  13065. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  13066. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  13067. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  13068. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  13069. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  13070. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  13071. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  13072. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  13073. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  13074. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  13075. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  13076. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  13077. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  13078. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  13079. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  13080. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  13081. const ExponentialBackoffCeiling = 10;
  13082. const ExponentialBackoffTimeSlice = 5;
  13083. class HttpClientResponse {
  13084. constructor(message) {
  13085. this.message = message;
  13086. }
  13087. readBody() {
  13088. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  13089. let output = '';
  13090. this.message.on('data', (chunk) => {
  13091. output += chunk;
  13092. });
  13093. this.message.on('end', () => {
  13094. resolve(output);
  13095. });
  13096. }));
  13097. }
  13098. }
  13099. exports.HttpClientResponse = HttpClientResponse;
  13100. function isHttps(requestUrl) {
  13101. let parsedUrl = url.parse(requestUrl);
  13102. return parsedUrl.protocol === 'https:';
  13103. }
  13104. exports.isHttps = isHttps;
  13105. var EnvironmentVariables;
  13106. (function (EnvironmentVariables) {
  13107. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  13108. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  13109. })(EnvironmentVariables || (EnvironmentVariables = {}));
  13110. class HttpClient {
  13111. constructor(userAgent, handlers, requestOptions) {
  13112. this._ignoreSslError = false;
  13113. this._allowRedirects = true;
  13114. this._maxRedirects = 50;
  13115. this._allowRetries = false;
  13116. this._maxRetries = 1;
  13117. this._keepAlive = false;
  13118. this._disposed = false;
  13119. this.userAgent = userAgent;
  13120. this.handlers = handlers || [];
  13121. this.requestOptions = requestOptions;
  13122. if (requestOptions) {
  13123. if (requestOptions.ignoreSslError != null) {
  13124. this._ignoreSslError = requestOptions.ignoreSslError;
  13125. }
  13126. this._socketTimeout = requestOptions.socketTimeout;
  13127. this._httpProxy = requestOptions.proxy;
  13128. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  13129. this._httpProxyBypassHosts = [];
  13130. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  13131. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  13132. });
  13133. }
  13134. this._certConfig = requestOptions.cert;
  13135. if (this._certConfig) {
  13136. // If using cert, need fs
  13137. fs = __webpack_require__(747);
  13138. // cache the cert content into memory, so we don't have to read it from disk every time
  13139. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  13140. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  13141. }
  13142. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  13143. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  13144. }
  13145. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  13146. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  13147. }
  13148. }
  13149. if (requestOptions.allowRedirects != null) {
  13150. this._allowRedirects = requestOptions.allowRedirects;
  13151. }
  13152. if (requestOptions.maxRedirects != null) {
  13153. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  13154. }
  13155. if (requestOptions.keepAlive != null) {
  13156. this._keepAlive = requestOptions.keepAlive;
  13157. }
  13158. if (requestOptions.allowRetries != null) {
  13159. this._allowRetries = requestOptions.allowRetries;
  13160. }
  13161. if (requestOptions.maxRetries != null) {
  13162. this._maxRetries = requestOptions.maxRetries;
  13163. }
  13164. }
  13165. }
  13166. options(requestUrl, additionalHeaders) {
  13167. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  13168. }
  13169. get(requestUrl, additionalHeaders) {
  13170. return this.request('GET', requestUrl, null, additionalHeaders || {});
  13171. }
  13172. del(requestUrl, additionalHeaders) {
  13173. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  13174. }
  13175. post(requestUrl, data, additionalHeaders) {
  13176. return this.request('POST', requestUrl, data, additionalHeaders || {});
  13177. }
  13178. patch(requestUrl, data, additionalHeaders) {
  13179. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  13180. }
  13181. put(requestUrl, data, additionalHeaders) {
  13182. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  13183. }
  13184. head(requestUrl, additionalHeaders) {
  13185. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  13186. }
  13187. sendStream(verb, requestUrl, stream, additionalHeaders) {
  13188. return this.request(verb, requestUrl, stream, additionalHeaders);
  13189. }
  13190. /**
  13191. * Makes a raw http request.
  13192. * All other methods such as get, post, patch, and request ultimately call this.
  13193. * Prefer get, del, post and patch
  13194. */
  13195. request(verb, requestUrl, data, headers) {
  13196. return __awaiter(this, void 0, void 0, function* () {
  13197. if (this._disposed) {
  13198. throw new Error("Client has already been disposed.");
  13199. }
  13200. let info = this._prepareRequest(verb, requestUrl, headers);
  13201. // Only perform retries on reads since writes may not be idempotent.
  13202. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  13203. let numTries = 0;
  13204. let response;
  13205. while (numTries < maxTries) {
  13206. response = yield this.requestRaw(info, data);
  13207. // Check if it's an authentication challenge
  13208. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  13209. let authenticationHandler;
  13210. for (let i = 0; i < this.handlers.length; i++) {
  13211. if (this.handlers[i].canHandleAuthentication(response)) {
  13212. authenticationHandler = this.handlers[i];
  13213. break;
  13214. }
  13215. }
  13216. if (authenticationHandler) {
  13217. return authenticationHandler.handleAuthentication(this, info, data);
  13218. }
  13219. else {
  13220. // We have received an unauthorized response but have no handlers to handle it.
  13221. // Let the response return to the caller.
  13222. return response;
  13223. }
  13224. }
  13225. let redirectsRemaining = this._maxRedirects;
  13226. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  13227. && this._allowRedirects
  13228. && redirectsRemaining > 0) {
  13229. const redirectUrl = response.message.headers["location"];
  13230. if (!redirectUrl) {
  13231. // if there's no location to redirect to, we won't
  13232. break;
  13233. }
  13234. // we need to finish reading the response before reassigning response
  13235. // which will leak the open socket.
  13236. yield response.readBody();
  13237. // let's make the request with the new redirectUrl
  13238. info = this._prepareRequest(verb, redirectUrl, headers);
  13239. response = yield this.requestRaw(info, data);
  13240. redirectsRemaining--;
  13241. }
  13242. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  13243. // If not a retry code, return immediately instead of retrying
  13244. return response;
  13245. }
  13246. numTries += 1;
  13247. if (numTries < maxTries) {
  13248. yield response.readBody();
  13249. yield this._performExponentialBackoff(numTries);
  13250. }
  13251. }
  13252. return response;
  13253. });
  13254. }
  13255. /**
  13256. * Needs to be called if keepAlive is set to true in request options.
  13257. */
  13258. dispose() {
  13259. if (this._agent) {
  13260. this._agent.destroy();
  13261. }
  13262. this._disposed = true;
  13263. }
  13264. /**
  13265. * Raw request.
  13266. * @param info
  13267. * @param data
  13268. */
  13269. requestRaw(info, data) {
  13270. return new Promise((resolve, reject) => {
  13271. let callbackForResult = function (err, res) {
  13272. if (err) {
  13273. reject(err);
  13274. }
  13275. resolve(res);
  13276. };
  13277. this.requestRawWithCallback(info, data, callbackForResult);
  13278. });
  13279. }
  13280. /**
  13281. * Raw request with callback.
  13282. * @param info
  13283. * @param data
  13284. * @param onResult
  13285. */
  13286. requestRawWithCallback(info, data, onResult) {
  13287. let socket;
  13288. let isDataString = typeof (data) === 'string';
  13289. if (typeof (data) === 'string') {
  13290. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13291. }
  13292. let callbackCalled = false;
  13293. let handleResult = (err, res) => {
  13294. if (!callbackCalled) {
  13295. callbackCalled = true;
  13296. onResult(err, res);
  13297. }
  13298. };
  13299. let req = info.httpModule.request(info.options, (msg) => {
  13300. let res = new HttpClientResponse(msg);
  13301. handleResult(null, res);
  13302. });
  13303. req.on('socket', (sock) => {
  13304. socket = sock;
  13305. });
  13306. // If we ever get disconnected, we want the socket to timeout eventually
  13307. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13308. if (socket) {
  13309. socket.end();
  13310. }
  13311. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13312. });
  13313. req.on('error', function (err) {
  13314. // err has statusCode property
  13315. // res should have headers
  13316. handleResult(err, null);
  13317. });
  13318. if (data && typeof (data) === 'string') {
  13319. req.write(data, 'utf8');
  13320. }
  13321. if (data && typeof (data) !== 'string') {
  13322. data.on('close', function () {
  13323. req.end();
  13324. });
  13325. data.pipe(req);
  13326. }
  13327. else {
  13328. req.end();
  13329. }
  13330. }
  13331. _prepareRequest(method, requestUrl, headers) {
  13332. const info = {};
  13333. info.parsedUrl = url.parse(requestUrl);
  13334. const usingSsl = info.parsedUrl.protocol === 'https:';
  13335. info.httpModule = usingSsl ? https : http;
  13336. const defaultPort = usingSsl ? 443 : 80;
  13337. info.options = {};
  13338. info.options.host = info.parsedUrl.hostname;
  13339. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13340. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13341. info.options.method = method;
  13342. info.options.headers = this._mergeHeaders(headers);
  13343. info.options.headers["user-agent"] = this.userAgent;
  13344. info.options.agent = this._getAgent(requestUrl);
  13345. // gives handlers an opportunity to participate
  13346. if (this.handlers && !this._isPresigned(requestUrl)) {
  13347. this.handlers.forEach((handler) => {
  13348. handler.prepareRequest(info.options);
  13349. });
  13350. }
  13351. return info;
  13352. }
  13353. _isPresigned(requestUrl) {
  13354. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13355. const patterns = this.requestOptions.presignedUrlPatterns;
  13356. for (let i = 0; i < patterns.length; i++) {
  13357. if (requestUrl.match(patterns[i])) {
  13358. return true;
  13359. }
  13360. }
  13361. }
  13362. return false;
  13363. }
  13364. _mergeHeaders(headers) {
  13365. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13366. if (this.requestOptions && this.requestOptions.headers) {
  13367. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13368. }
  13369. return lowercaseKeys(headers || {});
  13370. }
  13371. _getAgent(requestUrl) {
  13372. let agent;
  13373. let proxy = this._getProxy(requestUrl);
  13374. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13375. if (this._keepAlive && useProxy) {
  13376. agent = this._proxyAgent;
  13377. }
  13378. if (this._keepAlive && !useProxy) {
  13379. agent = this._agent;
  13380. }
  13381. // if agent is already assigned use that agent.
  13382. if (!!agent) {
  13383. return agent;
  13384. }
  13385. let parsedUrl = url.parse(requestUrl);
  13386. const usingSsl = parsedUrl.protocol === 'https:';
  13387. let maxSockets = 100;
  13388. if (!!this.requestOptions) {
  13389. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13390. }
  13391. if (useProxy) {
  13392. // If using proxy, need tunnel
  13393. if (!tunnel) {
  13394. tunnel = __webpack_require__(856);
  13395. }
  13396. const agentOptions = {
  13397. maxSockets: maxSockets,
  13398. keepAlive: this._keepAlive,
  13399. proxy: {
  13400. proxyAuth: proxy.proxyAuth,
  13401. host: proxy.proxyUrl.hostname,
  13402. port: proxy.proxyUrl.port
  13403. },
  13404. };
  13405. let tunnelAgent;
  13406. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13407. if (usingSsl) {
  13408. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13409. }
  13410. else {
  13411. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13412. }
  13413. agent = tunnelAgent(agentOptions);
  13414. this._proxyAgent = agent;
  13415. }
  13416. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13417. if (this._keepAlive && !agent) {
  13418. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13419. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13420. this._agent = agent;
  13421. }
  13422. // if not using private agent and tunnel agent isn't setup then use global agent
  13423. if (!agent) {
  13424. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13425. }
  13426. if (usingSsl && this._ignoreSslError) {
  13427. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13428. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13429. // we have to cast it to any and change it directly
  13430. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13431. }
  13432. if (usingSsl && this._certConfig) {
  13433. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13434. }
  13435. return agent;
  13436. }
  13437. _getProxy(requestUrl) {
  13438. const parsedUrl = url.parse(requestUrl);
  13439. let usingSsl = parsedUrl.protocol === 'https:';
  13440. let proxyConfig = this._httpProxy;
  13441. // fallback to http_proxy and https_proxy env
  13442. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13443. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13444. if (!proxyConfig) {
  13445. if (https_proxy && usingSsl) {
  13446. proxyConfig = {
  13447. proxyUrl: https_proxy
  13448. };
  13449. }
  13450. else if (http_proxy) {
  13451. proxyConfig = {
  13452. proxyUrl: http_proxy
  13453. };
  13454. }
  13455. }
  13456. let proxyUrl;
  13457. let proxyAuth;
  13458. if (proxyConfig) {
  13459. if (proxyConfig.proxyUrl.length > 0) {
  13460. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13461. }
  13462. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13463. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13464. }
  13465. }
  13466. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13467. }
  13468. _isBypassProxy(requestUrl) {
  13469. if (!this._httpProxyBypassHosts) {
  13470. return false;
  13471. }
  13472. let bypass = false;
  13473. this._httpProxyBypassHosts.forEach(bypassHost => {
  13474. if (bypassHost.test(requestUrl)) {
  13475. bypass = true;
  13476. }
  13477. });
  13478. return bypass;
  13479. }
  13480. _performExponentialBackoff(retryNumber) {
  13481. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13482. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13483. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13484. }
  13485. }
  13486. exports.HttpClient = HttpClient;
  13487. /***/ }),
  13488. /***/ 881:
  13489. /***/ (function(module) {
  13490. "use strict";
  13491. const isWin = process.platform === 'win32';
  13492. function notFoundError(original, syscall) {
  13493. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13494. code: 'ENOENT',
  13495. errno: 'ENOENT',
  13496. syscall: `${syscall} ${original.command}`,
  13497. path: original.command,
  13498. spawnargs: original.args,
  13499. });
  13500. }
  13501. function hookChildProcess(cp, parsed) {
  13502. if (!isWin) {
  13503. return;
  13504. }
  13505. const originalEmit = cp.emit;
  13506. cp.emit = function (name, arg1) {
  13507. // If emitting "exit" event and exit code is 1, we need to check if
  13508. // the command exists and emit an "error" instead
  13509. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13510. if (name === 'exit') {
  13511. const err = verifyENOENT(arg1, parsed, 'spawn');
  13512. if (err) {
  13513. return originalEmit.call(cp, 'error', err);
  13514. }
  13515. }
  13516. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13517. };
  13518. }
  13519. function verifyENOENT(status, parsed) {
  13520. if (isWin && status === 1 && !parsed.file) {
  13521. return notFoundError(parsed.original, 'spawn');
  13522. }
  13523. return null;
  13524. }
  13525. function verifyENOENTSync(status, parsed) {
  13526. if (isWin && status === 1 && !parsed.file) {
  13527. return notFoundError(parsed.original, 'spawnSync');
  13528. }
  13529. return null;
  13530. }
  13531. module.exports = {
  13532. hookChildProcess,
  13533. verifyENOENT,
  13534. verifyENOENTSync,
  13535. notFoundError,
  13536. };
  13537. /***/ }),
  13538. /***/ 883:
  13539. /***/ (function(module) {
  13540. /**
  13541. * lodash (Custom Build) <https://lodash.com/>
  13542. * Build: `lodash modularize exports="npm" -o ./`
  13543. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13544. * Released under MIT license <https://lodash.com/license>
  13545. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13546. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13547. */
  13548. /** Used as the `TypeError` message for "Functions" methods. */
  13549. var FUNC_ERROR_TEXT = 'Expected a function';
  13550. /** Used to stand-in for `undefined` hash values. */
  13551. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13552. /** Used as references for various `Number` constants. */
  13553. var INFINITY = 1 / 0,
  13554. MAX_SAFE_INTEGER = 9007199254740991;
  13555. /** `Object#toString` result references. */
  13556. var funcTag = '[object Function]',
  13557. genTag = '[object GeneratorFunction]',
  13558. symbolTag = '[object Symbol]';
  13559. /** Used to match property names within property paths. */
  13560. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13561. reIsPlainProp = /^\w*$/,
  13562. reLeadingDot = /^\./,
  13563. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13564. /**
  13565. * Used to match `RegExp`
  13566. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13567. */
  13568. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13569. /** Used to match backslashes in property paths. */
  13570. var reEscapeChar = /\\(\\)?/g;
  13571. /** Used to detect host constructors (Safari). */
  13572. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13573. /** Used to detect unsigned integer values. */
  13574. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13575. /** Detect free variable `global` from Node.js. */
  13576. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13577. /** Detect free variable `self`. */
  13578. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13579. /** Used as a reference to the global object. */
  13580. var root = freeGlobal || freeSelf || Function('return this')();
  13581. /**
  13582. * Gets the value at `key` of `object`.
  13583. *
  13584. * @private
  13585. * @param {Object} [object] The object to query.
  13586. * @param {string} key The key of the property to get.
  13587. * @returns {*} Returns the property value.
  13588. */
  13589. function getValue(object, key) {
  13590. return object == null ? undefined : object[key];
  13591. }
  13592. /**
  13593. * Checks if `value` is a host object in IE < 9.
  13594. *
  13595. * @private
  13596. * @param {*} value The value to check.
  13597. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13598. */
  13599. function isHostObject(value) {
  13600. // Many host objects are `Object` objects that can coerce to strings
  13601. // despite having improperly defined `toString` methods.
  13602. var result = false;
  13603. if (value != null && typeof value.toString != 'function') {
  13604. try {
  13605. result = !!(value + '');
  13606. } catch (e) {}
  13607. }
  13608. return result;
  13609. }
  13610. /** Used for built-in method references. */
  13611. var arrayProto = Array.prototype,
  13612. funcProto = Function.prototype,
  13613. objectProto = Object.prototype;
  13614. /** Used to detect overreaching core-js shims. */
  13615. var coreJsData = root['__core-js_shared__'];
  13616. /** Used to detect methods masquerading as native. */
  13617. var maskSrcKey = (function() {
  13618. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  13619. return uid ? ('Symbol(src)_1.' + uid) : '';
  13620. }());
  13621. /** Used to resolve the decompiled source of functions. */
  13622. var funcToString = funcProto.toString;
  13623. /** Used to check objects for own properties. */
  13624. var hasOwnProperty = objectProto.hasOwnProperty;
  13625. /**
  13626. * Used to resolve the
  13627. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  13628. * of values.
  13629. */
  13630. var objectToString = objectProto.toString;
  13631. /** Used to detect if a method is native. */
  13632. var reIsNative = RegExp('^' +
  13633. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  13634. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  13635. );
  13636. /** Built-in value references. */
  13637. var Symbol = root.Symbol,
  13638. splice = arrayProto.splice;
  13639. /* Built-in method references that are verified to be native. */
  13640. var Map = getNative(root, 'Map'),
  13641. nativeCreate = getNative(Object, 'create');
  13642. /** Used to convert symbols to primitives and strings. */
  13643. var symbolProto = Symbol ? Symbol.prototype : undefined,
  13644. symbolToString = symbolProto ? symbolProto.toString : undefined;
  13645. /**
  13646. * Creates a hash object.
  13647. *
  13648. * @private
  13649. * @constructor
  13650. * @param {Array} [entries] The key-value pairs to cache.
  13651. */
  13652. function Hash(entries) {
  13653. var index = -1,
  13654. length = entries ? entries.length : 0;
  13655. this.clear();
  13656. while (++index < length) {
  13657. var entry = entries[index];
  13658. this.set(entry[0], entry[1]);
  13659. }
  13660. }
  13661. /**
  13662. * Removes all key-value entries from the hash.
  13663. *
  13664. * @private
  13665. * @name clear
  13666. * @memberOf Hash
  13667. */
  13668. function hashClear() {
  13669. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  13670. }
  13671. /**
  13672. * Removes `key` and its value from the hash.
  13673. *
  13674. * @private
  13675. * @name delete
  13676. * @memberOf Hash
  13677. * @param {Object} hash The hash to modify.
  13678. * @param {string} key The key of the value to remove.
  13679. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13680. */
  13681. function hashDelete(key) {
  13682. return this.has(key) && delete this.__data__[key];
  13683. }
  13684. /**
  13685. * Gets the hash value for `key`.
  13686. *
  13687. * @private
  13688. * @name get
  13689. * @memberOf Hash
  13690. * @param {string} key The key of the value to get.
  13691. * @returns {*} Returns the entry value.
  13692. */
  13693. function hashGet(key) {
  13694. var data = this.__data__;
  13695. if (nativeCreate) {
  13696. var result = data[key];
  13697. return result === HASH_UNDEFINED ? undefined : result;
  13698. }
  13699. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  13700. }
  13701. /**
  13702. * Checks if a hash value for `key` exists.
  13703. *
  13704. * @private
  13705. * @name has
  13706. * @memberOf Hash
  13707. * @param {string} key The key of the entry to check.
  13708. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13709. */
  13710. function hashHas(key) {
  13711. var data = this.__data__;
  13712. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  13713. }
  13714. /**
  13715. * Sets the hash `key` to `value`.
  13716. *
  13717. * @private
  13718. * @name set
  13719. * @memberOf Hash
  13720. * @param {string} key The key of the value to set.
  13721. * @param {*} value The value to set.
  13722. * @returns {Object} Returns the hash instance.
  13723. */
  13724. function hashSet(key, value) {
  13725. var data = this.__data__;
  13726. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  13727. return this;
  13728. }
  13729. // Add methods to `Hash`.
  13730. Hash.prototype.clear = hashClear;
  13731. Hash.prototype['delete'] = hashDelete;
  13732. Hash.prototype.get = hashGet;
  13733. Hash.prototype.has = hashHas;
  13734. Hash.prototype.set = hashSet;
  13735. /**
  13736. * Creates an list cache object.
  13737. *
  13738. * @private
  13739. * @constructor
  13740. * @param {Array} [entries] The key-value pairs to cache.
  13741. */
  13742. function ListCache(entries) {
  13743. var index = -1,
  13744. length = entries ? entries.length : 0;
  13745. this.clear();
  13746. while (++index < length) {
  13747. var entry = entries[index];
  13748. this.set(entry[0], entry[1]);
  13749. }
  13750. }
  13751. /**
  13752. * Removes all key-value entries from the list cache.
  13753. *
  13754. * @private
  13755. * @name clear
  13756. * @memberOf ListCache
  13757. */
  13758. function listCacheClear() {
  13759. this.__data__ = [];
  13760. }
  13761. /**
  13762. * Removes `key` and its value from the list cache.
  13763. *
  13764. * @private
  13765. * @name delete
  13766. * @memberOf ListCache
  13767. * @param {string} key The key of the value to remove.
  13768. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13769. */
  13770. function listCacheDelete(key) {
  13771. var data = this.__data__,
  13772. index = assocIndexOf(data, key);
  13773. if (index < 0) {
  13774. return false;
  13775. }
  13776. var lastIndex = data.length - 1;
  13777. if (index == lastIndex) {
  13778. data.pop();
  13779. } else {
  13780. splice.call(data, index, 1);
  13781. }
  13782. return true;
  13783. }
  13784. /**
  13785. * Gets the list cache value for `key`.
  13786. *
  13787. * @private
  13788. * @name get
  13789. * @memberOf ListCache
  13790. * @param {string} key The key of the value to get.
  13791. * @returns {*} Returns the entry value.
  13792. */
  13793. function listCacheGet(key) {
  13794. var data = this.__data__,
  13795. index = assocIndexOf(data, key);
  13796. return index < 0 ? undefined : data[index][1];
  13797. }
  13798. /**
  13799. * Checks if a list cache value for `key` exists.
  13800. *
  13801. * @private
  13802. * @name has
  13803. * @memberOf ListCache
  13804. * @param {string} key The key of the entry to check.
  13805. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13806. */
  13807. function listCacheHas(key) {
  13808. return assocIndexOf(this.__data__, key) > -1;
  13809. }
  13810. /**
  13811. * Sets the list cache `key` to `value`.
  13812. *
  13813. * @private
  13814. * @name set
  13815. * @memberOf ListCache
  13816. * @param {string} key The key of the value to set.
  13817. * @param {*} value The value to set.
  13818. * @returns {Object} Returns the list cache instance.
  13819. */
  13820. function listCacheSet(key, value) {
  13821. var data = this.__data__,
  13822. index = assocIndexOf(data, key);
  13823. if (index < 0) {
  13824. data.push([key, value]);
  13825. } else {
  13826. data[index][1] = value;
  13827. }
  13828. return this;
  13829. }
  13830. // Add methods to `ListCache`.
  13831. ListCache.prototype.clear = listCacheClear;
  13832. ListCache.prototype['delete'] = listCacheDelete;
  13833. ListCache.prototype.get = listCacheGet;
  13834. ListCache.prototype.has = listCacheHas;
  13835. ListCache.prototype.set = listCacheSet;
  13836. /**
  13837. * Creates a map cache object to store key-value pairs.
  13838. *
  13839. * @private
  13840. * @constructor
  13841. * @param {Array} [entries] The key-value pairs to cache.
  13842. */
  13843. function MapCache(entries) {
  13844. var index = -1,
  13845. length = entries ? entries.length : 0;
  13846. this.clear();
  13847. while (++index < length) {
  13848. var entry = entries[index];
  13849. this.set(entry[0], entry[1]);
  13850. }
  13851. }
  13852. /**
  13853. * Removes all key-value entries from the map.
  13854. *
  13855. * @private
  13856. * @name clear
  13857. * @memberOf MapCache
  13858. */
  13859. function mapCacheClear() {
  13860. this.__data__ = {
  13861. 'hash': new Hash,
  13862. 'map': new (Map || ListCache),
  13863. 'string': new Hash
  13864. };
  13865. }
  13866. /**
  13867. * Removes `key` and its value from the map.
  13868. *
  13869. * @private
  13870. * @name delete
  13871. * @memberOf MapCache
  13872. * @param {string} key The key of the value to remove.
  13873. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13874. */
  13875. function mapCacheDelete(key) {
  13876. return getMapData(this, key)['delete'](key);
  13877. }
  13878. /**
  13879. * Gets the map value for `key`.
  13880. *
  13881. * @private
  13882. * @name get
  13883. * @memberOf MapCache
  13884. * @param {string} key The key of the value to get.
  13885. * @returns {*} Returns the entry value.
  13886. */
  13887. function mapCacheGet(key) {
  13888. return getMapData(this, key).get(key);
  13889. }
  13890. /**
  13891. * Checks if a map value for `key` exists.
  13892. *
  13893. * @private
  13894. * @name has
  13895. * @memberOf MapCache
  13896. * @param {string} key The key of the entry to check.
  13897. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13898. */
  13899. function mapCacheHas(key) {
  13900. return getMapData(this, key).has(key);
  13901. }
  13902. /**
  13903. * Sets the map `key` to `value`.
  13904. *
  13905. * @private
  13906. * @name set
  13907. * @memberOf MapCache
  13908. * @param {string} key The key of the value to set.
  13909. * @param {*} value The value to set.
  13910. * @returns {Object} Returns the map cache instance.
  13911. */
  13912. function mapCacheSet(key, value) {
  13913. getMapData(this, key).set(key, value);
  13914. return this;
  13915. }
  13916. // Add methods to `MapCache`.
  13917. MapCache.prototype.clear = mapCacheClear;
  13918. MapCache.prototype['delete'] = mapCacheDelete;
  13919. MapCache.prototype.get = mapCacheGet;
  13920. MapCache.prototype.has = mapCacheHas;
  13921. MapCache.prototype.set = mapCacheSet;
  13922. /**
  13923. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  13924. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13925. * for equality comparisons.
  13926. *
  13927. * @private
  13928. * @param {Object} object The object to modify.
  13929. * @param {string} key The key of the property to assign.
  13930. * @param {*} value The value to assign.
  13931. */
  13932. function assignValue(object, key, value) {
  13933. var objValue = object[key];
  13934. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  13935. (value === undefined && !(key in object))) {
  13936. object[key] = value;
  13937. }
  13938. }
  13939. /**
  13940. * Gets the index at which the `key` is found in `array` of key-value pairs.
  13941. *
  13942. * @private
  13943. * @param {Array} array The array to inspect.
  13944. * @param {*} key The key to search for.
  13945. * @returns {number} Returns the index of the matched value, else `-1`.
  13946. */
  13947. function assocIndexOf(array, key) {
  13948. var length = array.length;
  13949. while (length--) {
  13950. if (eq(array[length][0], key)) {
  13951. return length;
  13952. }
  13953. }
  13954. return -1;
  13955. }
  13956. /**
  13957. * The base implementation of `_.isNative` without bad shim checks.
  13958. *
  13959. * @private
  13960. * @param {*} value The value to check.
  13961. * @returns {boolean} Returns `true` if `value` is a native function,
  13962. * else `false`.
  13963. */
  13964. function baseIsNative(value) {
  13965. if (!isObject(value) || isMasked(value)) {
  13966. return false;
  13967. }
  13968. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  13969. return pattern.test(toSource(value));
  13970. }
  13971. /**
  13972. * The base implementation of `_.set`.
  13973. *
  13974. * @private
  13975. * @param {Object} object The object to modify.
  13976. * @param {Array|string} path The path of the property to set.
  13977. * @param {*} value The value to set.
  13978. * @param {Function} [customizer] The function to customize path creation.
  13979. * @returns {Object} Returns `object`.
  13980. */
  13981. function baseSet(object, path, value, customizer) {
  13982. if (!isObject(object)) {
  13983. return object;
  13984. }
  13985. path = isKey(path, object) ? [path] : castPath(path);
  13986. var index = -1,
  13987. length = path.length,
  13988. lastIndex = length - 1,
  13989. nested = object;
  13990. while (nested != null && ++index < length) {
  13991. var key = toKey(path[index]),
  13992. newValue = value;
  13993. if (index != lastIndex) {
  13994. var objValue = nested[key];
  13995. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  13996. if (newValue === undefined) {
  13997. newValue = isObject(objValue)
  13998. ? objValue
  13999. : (isIndex(path[index + 1]) ? [] : {});
  14000. }
  14001. }
  14002. assignValue(nested, key, newValue);
  14003. nested = nested[key];
  14004. }
  14005. return object;
  14006. }
  14007. /**
  14008. * The base implementation of `_.toString` which doesn't convert nullish
  14009. * values to empty strings.
  14010. *
  14011. * @private
  14012. * @param {*} value The value to process.
  14013. * @returns {string} Returns the string.
  14014. */
  14015. function baseToString(value) {
  14016. // Exit early for strings to avoid a performance hit in some environments.
  14017. if (typeof value == 'string') {
  14018. return value;
  14019. }
  14020. if (isSymbol(value)) {
  14021. return symbolToString ? symbolToString.call(value) : '';
  14022. }
  14023. var result = (value + '');
  14024. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14025. }
  14026. /**
  14027. * Casts `value` to a path array if it's not one.
  14028. *
  14029. * @private
  14030. * @param {*} value The value to inspect.
  14031. * @returns {Array} Returns the cast property path array.
  14032. */
  14033. function castPath(value) {
  14034. return isArray(value) ? value : stringToPath(value);
  14035. }
  14036. /**
  14037. * Gets the data for `map`.
  14038. *
  14039. * @private
  14040. * @param {Object} map The map to query.
  14041. * @param {string} key The reference key.
  14042. * @returns {*} Returns the map data.
  14043. */
  14044. function getMapData(map, key) {
  14045. var data = map.__data__;
  14046. return isKeyable(key)
  14047. ? data[typeof key == 'string' ? 'string' : 'hash']
  14048. : data.map;
  14049. }
  14050. /**
  14051. * Gets the native function at `key` of `object`.
  14052. *
  14053. * @private
  14054. * @param {Object} object The object to query.
  14055. * @param {string} key The key of the method to get.
  14056. * @returns {*} Returns the function if it's native, else `undefined`.
  14057. */
  14058. function getNative(object, key) {
  14059. var value = getValue(object, key);
  14060. return baseIsNative(value) ? value : undefined;
  14061. }
  14062. /**
  14063. * Checks if `value` is a valid array-like index.
  14064. *
  14065. * @private
  14066. * @param {*} value The value to check.
  14067. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  14068. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  14069. */
  14070. function isIndex(value, length) {
  14071. length = length == null ? MAX_SAFE_INTEGER : length;
  14072. return !!length &&
  14073. (typeof value == 'number' || reIsUint.test(value)) &&
  14074. (value > -1 && value % 1 == 0 && value < length);
  14075. }
  14076. /**
  14077. * Checks if `value` is a property name and not a property path.
  14078. *
  14079. * @private
  14080. * @param {*} value The value to check.
  14081. * @param {Object} [object] The object to query keys on.
  14082. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  14083. */
  14084. function isKey(value, object) {
  14085. if (isArray(value)) {
  14086. return false;
  14087. }
  14088. var type = typeof value;
  14089. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  14090. value == null || isSymbol(value)) {
  14091. return true;
  14092. }
  14093. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  14094. (object != null && value in Object(object));
  14095. }
  14096. /**
  14097. * Checks if `value` is suitable for use as unique object key.
  14098. *
  14099. * @private
  14100. * @param {*} value The value to check.
  14101. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  14102. */
  14103. function isKeyable(value) {
  14104. var type = typeof value;
  14105. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  14106. ? (value !== '__proto__')
  14107. : (value === null);
  14108. }
  14109. /**
  14110. * Checks if `func` has its source masked.
  14111. *
  14112. * @private
  14113. * @param {Function} func The function to check.
  14114. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  14115. */
  14116. function isMasked(func) {
  14117. return !!maskSrcKey && (maskSrcKey in func);
  14118. }
  14119. /**
  14120. * Converts `string` to a property path array.
  14121. *
  14122. * @private
  14123. * @param {string} string The string to convert.
  14124. * @returns {Array} Returns the property path array.
  14125. */
  14126. var stringToPath = memoize(function(string) {
  14127. string = toString(string);
  14128. var result = [];
  14129. if (reLeadingDot.test(string)) {
  14130. result.push('');
  14131. }
  14132. string.replace(rePropName, function(match, number, quote, string) {
  14133. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  14134. });
  14135. return result;
  14136. });
  14137. /**
  14138. * Converts `value` to a string key if it's not a string or symbol.
  14139. *
  14140. * @private
  14141. * @param {*} value The value to inspect.
  14142. * @returns {string|symbol} Returns the key.
  14143. */
  14144. function toKey(value) {
  14145. if (typeof value == 'string' || isSymbol(value)) {
  14146. return value;
  14147. }
  14148. var result = (value + '');
  14149. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14150. }
  14151. /**
  14152. * Converts `func` to its source code.
  14153. *
  14154. * @private
  14155. * @param {Function} func The function to process.
  14156. * @returns {string} Returns the source code.
  14157. */
  14158. function toSource(func) {
  14159. if (func != null) {
  14160. try {
  14161. return funcToString.call(func);
  14162. } catch (e) {}
  14163. try {
  14164. return (func + '');
  14165. } catch (e) {}
  14166. }
  14167. return '';
  14168. }
  14169. /**
  14170. * Creates a function that memoizes the result of `func`. If `resolver` is
  14171. * provided, it determines the cache key for storing the result based on the
  14172. * arguments provided to the memoized function. By default, the first argument
  14173. * provided to the memoized function is used as the map cache key. The `func`
  14174. * is invoked with the `this` binding of the memoized function.
  14175. *
  14176. * **Note:** The cache is exposed as the `cache` property on the memoized
  14177. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  14178. * constructor with one whose instances implement the
  14179. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  14180. * method interface of `delete`, `get`, `has`, and `set`.
  14181. *
  14182. * @static
  14183. * @memberOf _
  14184. * @since 0.1.0
  14185. * @category Function
  14186. * @param {Function} func The function to have its output memoized.
  14187. * @param {Function} [resolver] The function to resolve the cache key.
  14188. * @returns {Function} Returns the new memoized function.
  14189. * @example
  14190. *
  14191. * var object = { 'a': 1, 'b': 2 };
  14192. * var other = { 'c': 3, 'd': 4 };
  14193. *
  14194. * var values = _.memoize(_.values);
  14195. * values(object);
  14196. * // => [1, 2]
  14197. *
  14198. * values(other);
  14199. * // => [3, 4]
  14200. *
  14201. * object.a = 2;
  14202. * values(object);
  14203. * // => [1, 2]
  14204. *
  14205. * // Modify the result cache.
  14206. * values.cache.set(object, ['a', 'b']);
  14207. * values(object);
  14208. * // => ['a', 'b']
  14209. *
  14210. * // Replace `_.memoize.Cache`.
  14211. * _.memoize.Cache = WeakMap;
  14212. */
  14213. function memoize(func, resolver) {
  14214. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  14215. throw new TypeError(FUNC_ERROR_TEXT);
  14216. }
  14217. var memoized = function() {
  14218. var args = arguments,
  14219. key = resolver ? resolver.apply(this, args) : args[0],
  14220. cache = memoized.cache;
  14221. if (cache.has(key)) {
  14222. return cache.get(key);
  14223. }
  14224. var result = func.apply(this, args);
  14225. memoized.cache = cache.set(key, result);
  14226. return result;
  14227. };
  14228. memoized.cache = new (memoize.Cache || MapCache);
  14229. return memoized;
  14230. }
  14231. // Assign cache to `_.memoize`.
  14232. memoize.Cache = MapCache;
  14233. /**
  14234. * Performs a
  14235. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14236. * comparison between two values to determine if they are equivalent.
  14237. *
  14238. * @static
  14239. * @memberOf _
  14240. * @since 4.0.0
  14241. * @category Lang
  14242. * @param {*} value The value to compare.
  14243. * @param {*} other The other value to compare.
  14244. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  14245. * @example
  14246. *
  14247. * var object = { 'a': 1 };
  14248. * var other = { 'a': 1 };
  14249. *
  14250. * _.eq(object, object);
  14251. * // => true
  14252. *
  14253. * _.eq(object, other);
  14254. * // => false
  14255. *
  14256. * _.eq('a', 'a');
  14257. * // => true
  14258. *
  14259. * _.eq('a', Object('a'));
  14260. * // => false
  14261. *
  14262. * _.eq(NaN, NaN);
  14263. * // => true
  14264. */
  14265. function eq(value, other) {
  14266. return value === other || (value !== value && other !== other);
  14267. }
  14268. /**
  14269. * Checks if `value` is classified as an `Array` object.
  14270. *
  14271. * @static
  14272. * @memberOf _
  14273. * @since 0.1.0
  14274. * @category Lang
  14275. * @param {*} value The value to check.
  14276. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14277. * @example
  14278. *
  14279. * _.isArray([1, 2, 3]);
  14280. * // => true
  14281. *
  14282. * _.isArray(document.body.children);
  14283. * // => false
  14284. *
  14285. * _.isArray('abc');
  14286. * // => false
  14287. *
  14288. * _.isArray(_.noop);
  14289. * // => false
  14290. */
  14291. var isArray = Array.isArray;
  14292. /**
  14293. * Checks if `value` is classified as a `Function` object.
  14294. *
  14295. * @static
  14296. * @memberOf _
  14297. * @since 0.1.0
  14298. * @category Lang
  14299. * @param {*} value The value to check.
  14300. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14301. * @example
  14302. *
  14303. * _.isFunction(_);
  14304. * // => true
  14305. *
  14306. * _.isFunction(/abc/);
  14307. * // => false
  14308. */
  14309. function isFunction(value) {
  14310. // The use of `Object#toString` avoids issues with the `typeof` operator
  14311. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14312. var tag = isObject(value) ? objectToString.call(value) : '';
  14313. return tag == funcTag || tag == genTag;
  14314. }
  14315. /**
  14316. * Checks if `value` is the
  14317. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14318. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14319. *
  14320. * @static
  14321. * @memberOf _
  14322. * @since 0.1.0
  14323. * @category Lang
  14324. * @param {*} value The value to check.
  14325. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14326. * @example
  14327. *
  14328. * _.isObject({});
  14329. * // => true
  14330. *
  14331. * _.isObject([1, 2, 3]);
  14332. * // => true
  14333. *
  14334. * _.isObject(_.noop);
  14335. * // => true
  14336. *
  14337. * _.isObject(null);
  14338. * // => false
  14339. */
  14340. function isObject(value) {
  14341. var type = typeof value;
  14342. return !!value && (type == 'object' || type == 'function');
  14343. }
  14344. /**
  14345. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14346. * and has a `typeof` result of "object".
  14347. *
  14348. * @static
  14349. * @memberOf _
  14350. * @since 4.0.0
  14351. * @category Lang
  14352. * @param {*} value The value to check.
  14353. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14354. * @example
  14355. *
  14356. * _.isObjectLike({});
  14357. * // => true
  14358. *
  14359. * _.isObjectLike([1, 2, 3]);
  14360. * // => true
  14361. *
  14362. * _.isObjectLike(_.noop);
  14363. * // => false
  14364. *
  14365. * _.isObjectLike(null);
  14366. * // => false
  14367. */
  14368. function isObjectLike(value) {
  14369. return !!value && typeof value == 'object';
  14370. }
  14371. /**
  14372. * Checks if `value` is classified as a `Symbol` primitive or object.
  14373. *
  14374. * @static
  14375. * @memberOf _
  14376. * @since 4.0.0
  14377. * @category Lang
  14378. * @param {*} value The value to check.
  14379. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14380. * @example
  14381. *
  14382. * _.isSymbol(Symbol.iterator);
  14383. * // => true
  14384. *
  14385. * _.isSymbol('abc');
  14386. * // => false
  14387. */
  14388. function isSymbol(value) {
  14389. return typeof value == 'symbol' ||
  14390. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14391. }
  14392. /**
  14393. * Converts `value` to a string. An empty string is returned for `null`
  14394. * and `undefined` values. The sign of `-0` is preserved.
  14395. *
  14396. * @static
  14397. * @memberOf _
  14398. * @since 4.0.0
  14399. * @category Lang
  14400. * @param {*} value The value to process.
  14401. * @returns {string} Returns the string.
  14402. * @example
  14403. *
  14404. * _.toString(null);
  14405. * // => ''
  14406. *
  14407. * _.toString(-0);
  14408. * // => '-0'
  14409. *
  14410. * _.toString([1, 2, 3]);
  14411. * // => '1,2,3'
  14412. */
  14413. function toString(value) {
  14414. return value == null ? '' : baseToString(value);
  14415. }
  14416. /**
  14417. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14418. * it's created. Arrays are created for missing index properties while objects
  14419. * are created for all other missing properties. Use `_.setWith` to customize
  14420. * `path` creation.
  14421. *
  14422. * **Note:** This method mutates `object`.
  14423. *
  14424. * @static
  14425. * @memberOf _
  14426. * @since 3.7.0
  14427. * @category Object
  14428. * @param {Object} object The object to modify.
  14429. * @param {Array|string} path The path of the property to set.
  14430. * @param {*} value The value to set.
  14431. * @returns {Object} Returns `object`.
  14432. * @example
  14433. *
  14434. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14435. *
  14436. * _.set(object, 'a[0].b.c', 4);
  14437. * console.log(object.a[0].b.c);
  14438. * // => 4
  14439. *
  14440. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14441. * console.log(object.x[0].y.z);
  14442. * // => 5
  14443. */
  14444. function set(object, path, value) {
  14445. return object == null ? object : baseSet(object, path, value);
  14446. }
  14447. module.exports = set;
  14448. /***/ }),
  14449. /***/ 898:
  14450. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14451. "use strict";
  14452. Object.defineProperty(exports, '__esModule', { value: true });
  14453. var request = __webpack_require__(753);
  14454. var universalUserAgent = __webpack_require__(796);
  14455. const VERSION = "4.3.1";
  14456. class GraphqlError extends Error {
  14457. constructor(request, response) {
  14458. const message = response.data.errors[0].message;
  14459. super(message);
  14460. Object.assign(this, response.data);
  14461. this.name = "GraphqlError";
  14462. this.request = request; // Maintains proper stack trace (only available on V8)
  14463. /* istanbul ignore next */
  14464. if (Error.captureStackTrace) {
  14465. Error.captureStackTrace(this, this.constructor);
  14466. }
  14467. }
  14468. }
  14469. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14470. function graphql(request, query, options) {
  14471. options = typeof query === "string" ? options = Object.assign({
  14472. query
  14473. }, options) : options = query;
  14474. const requestOptions = Object.keys(options).reduce((result, key) => {
  14475. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14476. result[key] = options[key];
  14477. return result;
  14478. }
  14479. if (!result.variables) {
  14480. result.variables = {};
  14481. }
  14482. result.variables[key] = options[key];
  14483. return result;
  14484. }, {});
  14485. return request(requestOptions).then(response => {
  14486. if (response.data.errors) {
  14487. throw new GraphqlError(requestOptions, {
  14488. data: response.data
  14489. });
  14490. }
  14491. return response.data.data;
  14492. });
  14493. }
  14494. function withDefaults(request$1, newDefaults) {
  14495. const newRequest = request$1.defaults(newDefaults);
  14496. const newApi = (query, options) => {
  14497. return graphql(newRequest, query, options);
  14498. };
  14499. return Object.assign(newApi, {
  14500. defaults: withDefaults.bind(null, newRequest),
  14501. endpoint: request.request.endpoint
  14502. });
  14503. }
  14504. const graphql$1 = withDefaults(request.request, {
  14505. headers: {
  14506. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14507. },
  14508. method: "POST",
  14509. url: "/graphql"
  14510. });
  14511. function withCustomRequest(customRequest) {
  14512. return withDefaults(customRequest, {
  14513. method: "POST",
  14514. url: "/graphql"
  14515. });
  14516. }
  14517. exports.graphql = graphql$1;
  14518. exports.withCustomRequest = withCustomRequest;
  14519. //# sourceMappingURL=index.js.map
  14520. /***/ }),
  14521. /***/ 899:
  14522. /***/ (function(module, __unusedexports, __webpack_require__) {
  14523. module.exports = registerEndpoints;
  14524. const { Deprecation } = __webpack_require__(692);
  14525. function registerEndpoints(octokit, routes) {
  14526. Object.keys(routes).forEach(namespaceName => {
  14527. if (!octokit[namespaceName]) {
  14528. octokit[namespaceName] = {};
  14529. }
  14530. Object.keys(routes[namespaceName]).forEach(apiName => {
  14531. const apiOptions = routes[namespaceName][apiName];
  14532. const endpointDefaults = ["method", "url", "headers"].reduce(
  14533. (map, key) => {
  14534. if (typeof apiOptions[key] !== "undefined") {
  14535. map[key] = apiOptions[key];
  14536. }
  14537. return map;
  14538. },
  14539. {}
  14540. );
  14541. endpointDefaults.request = {
  14542. validate: apiOptions.params
  14543. };
  14544. let request = octokit.request.defaults(endpointDefaults);
  14545. // patch request & endpoint methods to support deprecated parameters.
  14546. // Not the most elegant solution, but we don’t want to move deprecation
  14547. // logic into octokit/endpoint.js as it’s out of scope
  14548. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14549. key => apiOptions.params[key].deprecated
  14550. );
  14551. if (hasDeprecatedParam) {
  14552. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14553. request = patch(
  14554. octokit.request.defaults(endpointDefaults),
  14555. `.${namespaceName}.${apiName}()`
  14556. );
  14557. request.endpoint = patch(
  14558. request.endpoint,
  14559. `.${namespaceName}.${apiName}.endpoint()`
  14560. );
  14561. request.endpoint.merge = patch(
  14562. request.endpoint.merge,
  14563. `.${namespaceName}.${apiName}.endpoint.merge()`
  14564. );
  14565. }
  14566. if (apiOptions.deprecated) {
  14567. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14568. octokit.log.warn(
  14569. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14570. );
  14571. octokit[namespaceName][apiName] = request;
  14572. return request.apply(null, arguments);
  14573. };
  14574. return;
  14575. }
  14576. octokit[namespaceName][apiName] = request;
  14577. });
  14578. });
  14579. }
  14580. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14581. const patchedMethod = options => {
  14582. options = Object.assign({}, options);
  14583. Object.keys(options).forEach(key => {
  14584. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14585. const aliasKey = apiOptions.params[key].alias;
  14586. octokit.log.warn(
  14587. new Deprecation(
  14588. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14589. )
  14590. );
  14591. if (!(aliasKey in options)) {
  14592. options[aliasKey] = options[key];
  14593. }
  14594. delete options[key];
  14595. }
  14596. });
  14597. return method(options);
  14598. };
  14599. Object.keys(method).forEach(key => {
  14600. patchedMethod[key] = method[key];
  14601. });
  14602. return patchedMethod;
  14603. }
  14604. /***/ }),
  14605. /***/ 929:
  14606. /***/ (function(module, __unusedexports, __webpack_require__) {
  14607. module.exports = hasNextPage
  14608. const deprecate = __webpack_require__(370)
  14609. const getPageLinks = __webpack_require__(577)
  14610. function hasNextPage (link) {
  14611. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  14612. return getPageLinks(link).next
  14613. }
  14614. /***/ }),
  14615. /***/ 948:
  14616. /***/ (function(module) {
  14617. "use strict";
  14618. /**
  14619. * Tries to execute a function and discards any error that occurs.
  14620. * @param {Function} fn - Function that might or might not throw an error.
  14621. * @returns {?*} Return-value of the function when no error occurred.
  14622. */
  14623. module.exports = function(fn) {
  14624. try { return fn() } catch (e) {}
  14625. }
  14626. /***/ }),
  14627. /***/ 950:
  14628. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14629. "use strict";
  14630. Object.defineProperty(exports, "__esModule", { value: true });
  14631. const url = __webpack_require__(835);
  14632. function getProxyUrl(reqUrl) {
  14633. let usingSsl = reqUrl.protocol === 'https:';
  14634. let proxyUrl;
  14635. if (checkBypass(reqUrl)) {
  14636. return proxyUrl;
  14637. }
  14638. let proxyVar;
  14639. if (usingSsl) {
  14640. proxyVar = process.env["https_proxy"] ||
  14641. process.env["HTTPS_PROXY"];
  14642. }
  14643. else {
  14644. proxyVar = process.env["http_proxy"] ||
  14645. process.env["HTTP_PROXY"];
  14646. }
  14647. if (proxyVar) {
  14648. proxyUrl = url.parse(proxyVar);
  14649. }
  14650. return proxyUrl;
  14651. }
  14652. exports.getProxyUrl = getProxyUrl;
  14653. function checkBypass(reqUrl) {
  14654. if (!reqUrl.hostname) {
  14655. return false;
  14656. }
  14657. let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
  14658. if (!noProxy) {
  14659. return false;
  14660. }
  14661. // Determine the request port
  14662. let reqPort;
  14663. if (reqUrl.port) {
  14664. reqPort = Number(reqUrl.port);
  14665. }
  14666. else if (reqUrl.protocol === 'http:') {
  14667. reqPort = 80;
  14668. }
  14669. else if (reqUrl.protocol === 'https:') {
  14670. reqPort = 443;
  14671. }
  14672. // Format the request hostname and hostname with port
  14673. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  14674. if (typeof reqPort === 'number') {
  14675. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  14676. }
  14677. // Compare request host against noproxy
  14678. for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
  14679. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  14680. return true;
  14681. }
  14682. }
  14683. return false;
  14684. }
  14685. exports.checkBypass = checkBypass;
  14686. /***/ }),
  14687. /***/ 954:
  14688. /***/ (function(module) {
  14689. module.exports = validateAuth;
  14690. function validateAuth(auth) {
  14691. if (typeof auth === "string") {
  14692. return;
  14693. }
  14694. if (typeof auth === "function") {
  14695. return;
  14696. }
  14697. if (auth.username && auth.password) {
  14698. return;
  14699. }
  14700. if (auth.clientId && auth.clientSecret) {
  14701. return;
  14702. }
  14703. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  14704. }
  14705. /***/ }),
  14706. /***/ 955:
  14707. /***/ (function(module, __unusedexports, __webpack_require__) {
  14708. "use strict";
  14709. const path = __webpack_require__(622);
  14710. const childProcess = __webpack_require__(129);
  14711. const crossSpawn = __webpack_require__(20);
  14712. const stripEof = __webpack_require__(768);
  14713. const npmRunPath = __webpack_require__(621);
  14714. const isStream = __webpack_require__(323);
  14715. const _getStream = __webpack_require__(145);
  14716. const pFinally = __webpack_require__(697);
  14717. const onExit = __webpack_require__(260);
  14718. const errname = __webpack_require__(427);
  14719. const stdio = __webpack_require__(168);
  14720. const TEN_MEGABYTES = 1000 * 1000 * 10;
  14721. function handleArgs(cmd, args, opts) {
  14722. let parsed;
  14723. opts = Object.assign({
  14724. extendEnv: true,
  14725. env: {}
  14726. }, opts);
  14727. if (opts.extendEnv) {
  14728. opts.env = Object.assign({}, process.env, opts.env);
  14729. }
  14730. if (opts.__winShell === true) {
  14731. delete opts.__winShell;
  14732. parsed = {
  14733. command: cmd,
  14734. args,
  14735. options: opts,
  14736. file: cmd,
  14737. original: {
  14738. cmd,
  14739. args
  14740. }
  14741. };
  14742. } else {
  14743. parsed = crossSpawn._parse(cmd, args, opts);
  14744. }
  14745. opts = Object.assign({
  14746. maxBuffer: TEN_MEGABYTES,
  14747. buffer: true,
  14748. stripEof: true,
  14749. preferLocal: true,
  14750. localDir: parsed.options.cwd || process.cwd(),
  14751. encoding: 'utf8',
  14752. reject: true,
  14753. cleanup: true
  14754. }, parsed.options);
  14755. opts.stdio = stdio(opts);
  14756. if (opts.preferLocal) {
  14757. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  14758. }
  14759. if (opts.detached) {
  14760. // #115
  14761. opts.cleanup = false;
  14762. }
  14763. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  14764. // #116
  14765. parsed.args.unshift('/q');
  14766. }
  14767. return {
  14768. cmd: parsed.command,
  14769. args: parsed.args,
  14770. opts,
  14771. parsed
  14772. };
  14773. }
  14774. function handleInput(spawned, input) {
  14775. if (input === null || input === undefined) {
  14776. return;
  14777. }
  14778. if (isStream(input)) {
  14779. input.pipe(spawned.stdin);
  14780. } else {
  14781. spawned.stdin.end(input);
  14782. }
  14783. }
  14784. function handleOutput(opts, val) {
  14785. if (val && opts.stripEof) {
  14786. val = stripEof(val);
  14787. }
  14788. return val;
  14789. }
  14790. function handleShell(fn, cmd, opts) {
  14791. let file = '/bin/sh';
  14792. let args = ['-c', cmd];
  14793. opts = Object.assign({}, opts);
  14794. if (process.platform === 'win32') {
  14795. opts.__winShell = true;
  14796. file = process.env.comspec || 'cmd.exe';
  14797. args = ['/s', '/c', `"${cmd}"`];
  14798. opts.windowsVerbatimArguments = true;
  14799. }
  14800. if (opts.shell) {
  14801. file = opts.shell;
  14802. delete opts.shell;
  14803. }
  14804. return fn(file, args, opts);
  14805. }
  14806. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  14807. if (!process[stream]) {
  14808. return null;
  14809. }
  14810. let ret;
  14811. if (!buffer) {
  14812. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  14813. ret = new Promise((resolve, reject) => {
  14814. process[stream]
  14815. .once('end', resolve)
  14816. .once('error', reject);
  14817. });
  14818. } else if (encoding) {
  14819. ret = _getStream(process[stream], {
  14820. encoding,
  14821. maxBuffer
  14822. });
  14823. } else {
  14824. ret = _getStream.buffer(process[stream], {maxBuffer});
  14825. }
  14826. return ret.catch(err => {
  14827. err.stream = stream;
  14828. err.message = `${stream} ${err.message}`;
  14829. throw err;
  14830. });
  14831. }
  14832. function makeError(result, options) {
  14833. const {stdout, stderr} = result;
  14834. let err = result.error;
  14835. const {code, signal} = result;
  14836. const {parsed, joinedCmd} = options;
  14837. const timedOut = options.timedOut || false;
  14838. if (!err) {
  14839. let output = '';
  14840. if (Array.isArray(parsed.opts.stdio)) {
  14841. if (parsed.opts.stdio[2] !== 'inherit') {
  14842. output += output.length > 0 ? stderr : `\n${stderr}`;
  14843. }
  14844. if (parsed.opts.stdio[1] !== 'inherit') {
  14845. output += `\n${stdout}`;
  14846. }
  14847. } else if (parsed.opts.stdio !== 'inherit') {
  14848. output = `\n${stderr}${stdout}`;
  14849. }
  14850. err = new Error(`Command failed: ${joinedCmd}${output}`);
  14851. err.code = code < 0 ? errname(code) : code;
  14852. }
  14853. err.stdout = stdout;
  14854. err.stderr = stderr;
  14855. err.failed = true;
  14856. err.signal = signal || null;
  14857. err.cmd = joinedCmd;
  14858. err.timedOut = timedOut;
  14859. return err;
  14860. }
  14861. function joinCmd(cmd, args) {
  14862. let joinedCmd = cmd;
  14863. if (Array.isArray(args) && args.length > 0) {
  14864. joinedCmd += ' ' + args.join(' ');
  14865. }
  14866. return joinedCmd;
  14867. }
  14868. module.exports = (cmd, args, opts) => {
  14869. const parsed = handleArgs(cmd, args, opts);
  14870. const {encoding, buffer, maxBuffer} = parsed.opts;
  14871. const joinedCmd = joinCmd(cmd, args);
  14872. let spawned;
  14873. try {
  14874. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  14875. } catch (err) {
  14876. return Promise.reject(err);
  14877. }
  14878. let removeExitHandler;
  14879. if (parsed.opts.cleanup) {
  14880. removeExitHandler = onExit(() => {
  14881. spawned.kill();
  14882. });
  14883. }
  14884. let timeoutId = null;
  14885. let timedOut = false;
  14886. const cleanup = () => {
  14887. if (timeoutId) {
  14888. clearTimeout(timeoutId);
  14889. timeoutId = null;
  14890. }
  14891. if (removeExitHandler) {
  14892. removeExitHandler();
  14893. }
  14894. };
  14895. if (parsed.opts.timeout > 0) {
  14896. timeoutId = setTimeout(() => {
  14897. timeoutId = null;
  14898. timedOut = true;
  14899. spawned.kill(parsed.opts.killSignal);
  14900. }, parsed.opts.timeout);
  14901. }
  14902. const processDone = new Promise(resolve => {
  14903. spawned.on('exit', (code, signal) => {
  14904. cleanup();
  14905. resolve({code, signal});
  14906. });
  14907. spawned.on('error', err => {
  14908. cleanup();
  14909. resolve({error: err});
  14910. });
  14911. if (spawned.stdin) {
  14912. spawned.stdin.on('error', err => {
  14913. cleanup();
  14914. resolve({error: err});
  14915. });
  14916. }
  14917. });
  14918. function destroy() {
  14919. if (spawned.stdout) {
  14920. spawned.stdout.destroy();
  14921. }
  14922. if (spawned.stderr) {
  14923. spawned.stderr.destroy();
  14924. }
  14925. }
  14926. const handlePromise = () => pFinally(Promise.all([
  14927. processDone,
  14928. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  14929. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  14930. ]).then(arr => {
  14931. const result = arr[0];
  14932. result.stdout = arr[1];
  14933. result.stderr = arr[2];
  14934. if (result.error || result.code !== 0 || result.signal !== null) {
  14935. const err = makeError(result, {
  14936. joinedCmd,
  14937. parsed,
  14938. timedOut
  14939. });
  14940. // TODO: missing some timeout logic for killed
  14941. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  14942. // err.killed = spawned.killed || killed;
  14943. err.killed = err.killed || spawned.killed;
  14944. if (!parsed.opts.reject) {
  14945. return err;
  14946. }
  14947. throw err;
  14948. }
  14949. return {
  14950. stdout: handleOutput(parsed.opts, result.stdout),
  14951. stderr: handleOutput(parsed.opts, result.stderr),
  14952. code: 0,
  14953. failed: false,
  14954. killed: false,
  14955. signal: null,
  14956. cmd: joinedCmd,
  14957. timedOut: false
  14958. };
  14959. }), destroy);
  14960. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  14961. handleInput(spawned, parsed.opts.input);
  14962. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  14963. spawned.catch = onrejected => handlePromise().catch(onrejected);
  14964. return spawned;
  14965. };
  14966. // TODO: set `stderr: 'ignore'` when that option is implemented
  14967. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  14968. // TODO: set `stdout: 'ignore'` when that option is implemented
  14969. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  14970. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  14971. module.exports.sync = (cmd, args, opts) => {
  14972. const parsed = handleArgs(cmd, args, opts);
  14973. const joinedCmd = joinCmd(cmd, args);
  14974. if (isStream(parsed.opts.input)) {
  14975. throw new TypeError('The `input` option cannot be a stream in sync mode');
  14976. }
  14977. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  14978. result.code = result.status;
  14979. if (result.error || result.status !== 0 || result.signal !== null) {
  14980. const err = makeError(result, {
  14981. joinedCmd,
  14982. parsed
  14983. });
  14984. if (!parsed.opts.reject) {
  14985. return err;
  14986. }
  14987. throw err;
  14988. }
  14989. return {
  14990. stdout: handleOutput(parsed.opts, result.stdout),
  14991. stderr: handleOutput(parsed.opts, result.stderr),
  14992. code: 0,
  14993. failed: false,
  14994. signal: null,
  14995. cmd: joinedCmd,
  14996. timedOut: false
  14997. };
  14998. };
  14999. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  15000. /***/ }),
  15001. /***/ 966:
  15002. /***/ (function(module, __unusedexports, __webpack_require__) {
  15003. "use strict";
  15004. const {PassThrough} = __webpack_require__(413);
  15005. module.exports = options => {
  15006. options = Object.assign({}, options);
  15007. const {array} = options;
  15008. let {encoding} = options;
  15009. const buffer = encoding === 'buffer';
  15010. let objectMode = false;
  15011. if (array) {
  15012. objectMode = !(encoding || buffer);
  15013. } else {
  15014. encoding = encoding || 'utf8';
  15015. }
  15016. if (buffer) {
  15017. encoding = null;
  15018. }
  15019. let len = 0;
  15020. const ret = [];
  15021. const stream = new PassThrough({objectMode});
  15022. if (encoding) {
  15023. stream.setEncoding(encoding);
  15024. }
  15025. stream.on('data', chunk => {
  15026. ret.push(chunk);
  15027. if (objectMode) {
  15028. len = ret.length;
  15029. } else {
  15030. len += chunk.length;
  15031. }
  15032. });
  15033. stream.getBufferedValue = () => {
  15034. if (array) {
  15035. return ret;
  15036. }
  15037. return buffer ? Buffer.concat(ret, len) : ret.join('');
  15038. };
  15039. stream.getBufferedLength = () => len;
  15040. return stream;
  15041. };
  15042. /***/ }),
  15043. /***/ 969:
  15044. /***/ (function(module, __unusedexports, __webpack_require__) {
  15045. var wrappy = __webpack_require__(11)
  15046. module.exports = wrappy(once)
  15047. module.exports.strict = wrappy(onceStrict)
  15048. once.proto = once(function () {
  15049. Object.defineProperty(Function.prototype, 'once', {
  15050. value: function () {
  15051. return once(this)
  15052. },
  15053. configurable: true
  15054. })
  15055. Object.defineProperty(Function.prototype, 'onceStrict', {
  15056. value: function () {
  15057. return onceStrict(this)
  15058. },
  15059. configurable: true
  15060. })
  15061. })
  15062. function once (fn) {
  15063. var f = function () {
  15064. if (f.called) return f.value
  15065. f.called = true
  15066. return f.value = fn.apply(this, arguments)
  15067. }
  15068. f.called = false
  15069. return f
  15070. }
  15071. function onceStrict (fn) {
  15072. var f = function () {
  15073. if (f.called)
  15074. throw new Error(f.onceError)
  15075. f.called = true
  15076. return f.value = fn.apply(this, arguments)
  15077. }
  15078. var name = fn.name || 'Function wrapped with `once`'
  15079. f.onceError = name + " shouldn't be called more than once"
  15080. f.called = false
  15081. return f
  15082. }
  15083. /***/ }),
  15084. /***/ 986:
  15085. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  15086. "use strict";
  15087. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  15088. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  15089. return new (P || (P = Promise))(function (resolve, reject) {
  15090. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  15091. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  15092. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  15093. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15094. });
  15095. };
  15096. Object.defineProperty(exports, "__esModule", { value: true });
  15097. const tr = __webpack_require__(9);
  15098. /**
  15099. * Exec a command.
  15100. * Output will be streamed to the live console.
  15101. * Returns promise with return code
  15102. *
  15103. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  15104. * @param args optional arguments for tool. Escaping is handled by the lib.
  15105. * @param options optional exec options. See ExecOptions
  15106. * @returns Promise<number> exit code
  15107. */
  15108. function exec(commandLine, args, options) {
  15109. return __awaiter(this, void 0, void 0, function* () {
  15110. const commandArgs = tr.argStringToArray(commandLine);
  15111. if (commandArgs.length === 0) {
  15112. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  15113. }
  15114. // Path to tool to execute should be first arg
  15115. const toolPath = commandArgs[0];
  15116. args = commandArgs.slice(1).concat(args || []);
  15117. const runner = new tr.ToolRunner(toolPath, args, options);
  15118. return runner.exec();
  15119. });
  15120. }
  15121. exports.exec = exec;
  15122. //# sourceMappingURL=exec.js.map
  15123. /***/ }),
  15124. /***/ 991:
  15125. /***/ (function(module, __unusedexports, __webpack_require__) {
  15126. module.exports = authenticationRequestError;
  15127. const { RequestError } = __webpack_require__(463);
  15128. function authenticationRequestError(state, error, options) {
  15129. if (!error.headers) throw error;
  15130. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  15131. // handle "2FA required" error only
  15132. if (error.status !== 401 || !otpRequired) {
  15133. throw error;
  15134. }
  15135. if (
  15136. error.status === 401 &&
  15137. otpRequired &&
  15138. error.request &&
  15139. error.request.headers["x-github-otp"]
  15140. ) {
  15141. if (state.otp) {
  15142. delete state.otp; // no longer valid, request again
  15143. } else {
  15144. throw new RequestError(
  15145. "Invalid one-time password for two-factor authentication",
  15146. 401,
  15147. {
  15148. headers: error.headers,
  15149. request: options
  15150. }
  15151. );
  15152. }
  15153. }
  15154. if (typeof state.auth.on2fa !== "function") {
  15155. throw new RequestError(
  15156. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  15157. 401,
  15158. {
  15159. headers: error.headers,
  15160. request: options
  15161. }
  15162. );
  15163. }
  15164. return Promise.resolve()
  15165. .then(() => {
  15166. return state.auth.on2fa();
  15167. })
  15168. .then(oneTimePassword => {
  15169. const newOptions = Object.assign(options, {
  15170. headers: Object.assign(options.headers, {
  15171. "x-github-otp": oneTimePassword
  15172. })
  15173. });
  15174. return state.octokit.request(newOptions).then(response => {
  15175. // If OTP still valid, then persist it for following requests
  15176. state.otp = oneTimePassword;
  15177. return response;
  15178. });
  15179. });
  15180. }
  15181. /***/ })
  15182. /******/ });