index.js 667 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372537353745375537653775378537953805381538253835384538553865387538853895390539153925393539453955396539753985399540054015402540354045405540654075408540954105411541254135414541554165417541854195420542154225423542454255426542754285429543054315432543354345435543654375438543954405441544254435444544554465447544854495450545154525453545454555456545754585459546054615462546354645465546654675468546954705471547254735474547554765477547854795480548154825483548454855486548754885489549054915492549354945495549654975498549955005501550255035504550555065507550855095510551155125513551455155516551755185519552055215522552355245525552655275528552955305531553255335534553555365537553855395540554155425543554455455546554755485549555055515552555355545555555655575558555955605561556255635564556555665567556855695570557155725573557455755576557755785579558055815582558355845585558655875588558955905591559255935594559555965597559855995600560156025603560456055606560756085609561056115612561356145615561656175618561956205621562256235624562556265627562856295630563156325633563456355636563756385639564056415642564356445645564656475648564956505651565256535654565556565657565856595660566156625663566456655666566756685669567056715672567356745675567656775678567956805681568256835684568556865687568856895690569156925693569456955696569756985699570057015702570357045705570657075708570957105711571257135714571557165717571857195720572157225723572457255726572757285729573057315732573357345735573657375738573957405741574257435744574557465747574857495750575157525753575457555756575757585759576057615762576357645765576657675768576957705771577257735774577557765777577857795780578157825783578457855786578757885789579057915792579357945795579657975798579958005801580258035804580558065807580858095810581158125813581458155816581758185819582058215822582358245825582658275828582958305831583258335834583558365837583858395840584158425843584458455846584758485849585058515852585358545855585658575858585958605861586258635864586558665867586858695870587158725873587458755876587758785879588058815882588358845885588658875888588958905891589258935894589558965897589858995900590159025903590459055906590759085909591059115912591359145915591659175918591959205921592259235924592559265927592859295930593159325933593459355936593759385939594059415942594359445945594659475948594959505951595259535954595559565957595859595960596159625963596459655966596759685969597059715972597359745975597659775978597959805981598259835984598559865987598859895990599159925993599459955996599759985999600060016002600360046005600660076008600960106011601260136014601560166017601860196020602160226023602460256026602760286029603060316032603360346035603660376038603960406041604260436044604560466047604860496050605160526053605460556056605760586059606060616062606360646065606660676068606960706071607260736074607560766077607860796080608160826083608460856086608760886089609060916092609360946095609660976098609961006101610261036104610561066107610861096110611161126113611461156116611761186119612061216122612361246125612661276128612961306131613261336134613561366137613861396140614161426143614461456146614761486149615061516152615361546155615661576158615961606161616261636164616561666167616861696170617161726173617461756176617761786179618061816182618361846185618661876188618961906191619261936194619561966197619861996200620162026203620462056206620762086209621062116212621362146215621662176218621962206221622262236224622562266227622862296230623162326233623462356236623762386239624062416242624362446245624662476248624962506251625262536254625562566257625862596260626162626263626462656266626762686269627062716272627362746275627662776278627962806281628262836284628562866287628862896290629162926293629462956296629762986299630063016302630363046305630663076308630963106311631263136314631563166317631863196320632163226323632463256326632763286329633063316332633363346335633663376338633963406341634263436344634563466347634863496350635163526353635463556356635763586359636063616362636363646365636663676368636963706371637263736374637563766377637863796380638163826383638463856386638763886389639063916392639363946395639663976398639964006401640264036404640564066407640864096410641164126413641464156416641764186419642064216422642364246425642664276428642964306431643264336434643564366437643864396440644164426443644464456446644764486449645064516452645364546455645664576458645964606461646264636464646564666467646864696470647164726473647464756476647764786479648064816482648364846485648664876488648964906491649264936494649564966497649864996500650165026503650465056506650765086509651065116512651365146515651665176518651965206521652265236524652565266527652865296530653165326533653465356536653765386539654065416542654365446545654665476548654965506551655265536554655565566557655865596560656165626563656465656566656765686569657065716572657365746575657665776578657965806581658265836584658565866587658865896590659165926593659465956596659765986599660066016602660366046605660666076608660966106611661266136614661566166617661866196620662166226623662466256626662766286629663066316632663366346635663666376638663966406641664266436644664566466647664866496650665166526653665466556656665766586659666066616662666366646665666666676668666966706671667266736674667566766677667866796680668166826683668466856686668766886689669066916692669366946695669666976698669967006701670267036704670567066707670867096710671167126713671467156716671767186719672067216722672367246725672667276728672967306731673267336734673567366737673867396740674167426743674467456746674767486749675067516752675367546755675667576758675967606761676267636764676567666767676867696770677167726773677467756776677767786779678067816782678367846785678667876788678967906791679267936794679567966797679867996800680168026803680468056806680768086809681068116812681368146815681668176818681968206821682268236824682568266827682868296830683168326833683468356836683768386839684068416842684368446845684668476848684968506851685268536854685568566857685868596860686168626863686468656866686768686869687068716872687368746875687668776878687968806881688268836884688568866887688868896890689168926893689468956896689768986899690069016902690369046905690669076908690969106911691269136914691569166917691869196920692169226923692469256926692769286929693069316932693369346935693669376938693969406941694269436944694569466947694869496950695169526953695469556956695769586959696069616962696369646965696669676968696969706971697269736974697569766977697869796980698169826983698469856986698769886989699069916992699369946995699669976998699970007001700270037004700570067007700870097010701170127013701470157016701770187019702070217022702370247025702670277028702970307031703270337034703570367037703870397040704170427043704470457046704770487049705070517052705370547055705670577058705970607061706270637064706570667067706870697070707170727073707470757076707770787079708070817082708370847085708670877088708970907091709270937094709570967097709870997100710171027103710471057106710771087109711071117112711371147115711671177118711971207121712271237124712571267127712871297130713171327133713471357136713771387139714071417142714371447145714671477148714971507151715271537154715571567157715871597160716171627163716471657166716771687169717071717172717371747175717671777178717971807181718271837184718571867187718871897190719171927193719471957196719771987199720072017202720372047205720672077208720972107211721272137214721572167217721872197220722172227223722472257226722772287229723072317232723372347235723672377238723972407241724272437244724572467247724872497250725172527253725472557256725772587259726072617262726372647265726672677268726972707271727272737274727572767277727872797280728172827283728472857286728772887289729072917292729372947295729672977298729973007301730273037304730573067307730873097310731173127313731473157316731773187319732073217322732373247325732673277328732973307331733273337334733573367337733873397340734173427343734473457346734773487349735073517352735373547355735673577358735973607361736273637364736573667367736873697370737173727373737473757376737773787379738073817382738373847385738673877388738973907391739273937394739573967397739873997400740174027403740474057406740774087409741074117412741374147415741674177418741974207421742274237424742574267427742874297430743174327433743474357436743774387439744074417442744374447445744674477448744974507451745274537454745574567457745874597460746174627463746474657466746774687469747074717472747374747475747674777478747974807481748274837484748574867487748874897490749174927493749474957496749774987499750075017502750375047505750675077508750975107511751275137514751575167517751875197520752175227523752475257526752775287529753075317532753375347535753675377538753975407541754275437544754575467547754875497550755175527553755475557556755775587559756075617562756375647565756675677568756975707571757275737574757575767577757875797580758175827583758475857586758775887589759075917592759375947595759675977598759976007601760276037604760576067607760876097610761176127613761476157616761776187619762076217622762376247625762676277628762976307631763276337634763576367637763876397640764176427643764476457646764776487649765076517652765376547655765676577658765976607661766276637664766576667667766876697670767176727673767476757676767776787679768076817682768376847685768676877688768976907691769276937694769576967697769876997700770177027703770477057706770777087709771077117712771377147715771677177718771977207721772277237724772577267727772877297730773177327733773477357736773777387739774077417742774377447745774677477748774977507751775277537754775577567757775877597760776177627763776477657766776777687769777077717772777377747775777677777778777977807781778277837784778577867787778877897790779177927793779477957796779777987799780078017802780378047805780678077808780978107811781278137814781578167817781878197820782178227823782478257826782778287829783078317832783378347835783678377838783978407841784278437844784578467847784878497850785178527853785478557856785778587859786078617862786378647865786678677868786978707871787278737874787578767877787878797880788178827883788478857886788778887889789078917892789378947895789678977898789979007901790279037904790579067907790879097910791179127913791479157916791779187919792079217922792379247925792679277928792979307931793279337934793579367937793879397940794179427943794479457946794779487949795079517952795379547955795679577958795979607961796279637964796579667967796879697970797179727973797479757976797779787979798079817982798379847985798679877988798979907991799279937994799579967997799879998000800180028003800480058006800780088009801080118012801380148015801680178018801980208021802280238024802580268027802880298030803180328033803480358036803780388039804080418042804380448045804680478048804980508051805280538054805580568057805880598060806180628063806480658066806780688069807080718072807380748075807680778078807980808081808280838084808580868087808880898090809180928093809480958096809780988099810081018102810381048105810681078108810981108111811281138114811581168117811881198120812181228123812481258126812781288129813081318132813381348135813681378138813981408141814281438144814581468147814881498150815181528153815481558156815781588159816081618162816381648165816681678168816981708171817281738174817581768177817881798180818181828183818481858186818781888189819081918192819381948195819681978198819982008201820282038204820582068207820882098210821182128213821482158216821782188219822082218222822382248225822682278228822982308231823282338234823582368237823882398240824182428243824482458246824782488249825082518252825382548255825682578258825982608261826282638264826582668267826882698270827182728273827482758276827782788279828082818282828382848285828682878288828982908291829282938294829582968297829882998300830183028303830483058306830783088309831083118312831383148315831683178318831983208321832283238324832583268327832883298330833183328333833483358336833783388339834083418342834383448345834683478348834983508351835283538354835583568357835883598360836183628363836483658366836783688369837083718372837383748375837683778378837983808381838283838384838583868387838883898390839183928393839483958396839783988399840084018402840384048405840684078408840984108411841284138414841584168417841884198420842184228423842484258426842784288429843084318432843384348435843684378438843984408441844284438444844584468447844884498450845184528453845484558456845784588459846084618462846384648465846684678468846984708471847284738474847584768477847884798480848184828483848484858486848784888489849084918492849384948495849684978498849985008501850285038504850585068507850885098510851185128513851485158516851785188519852085218522852385248525852685278528852985308531853285338534853585368537853885398540854185428543854485458546854785488549855085518552855385548555855685578558855985608561856285638564856585668567856885698570857185728573857485758576857785788579858085818582858385848585858685878588858985908591859285938594859585968597859885998600860186028603860486058606860786088609861086118612861386148615861686178618861986208621862286238624862586268627862886298630863186328633863486358636863786388639864086418642864386448645864686478648864986508651865286538654865586568657865886598660866186628663866486658666866786688669867086718672867386748675867686778678867986808681868286838684868586868687868886898690869186928693869486958696869786988699870087018702870387048705870687078708870987108711871287138714871587168717871887198720872187228723872487258726872787288729873087318732873387348735873687378738873987408741874287438744874587468747874887498750875187528753875487558756875787588759876087618762876387648765876687678768876987708771877287738774877587768777877887798780878187828783878487858786878787888789879087918792879387948795879687978798879988008801880288038804880588068807880888098810881188128813881488158816881788188819882088218822882388248825882688278828882988308831883288338834883588368837883888398840884188428843884488458846884788488849885088518852885388548855885688578858885988608861886288638864886588668867886888698870887188728873887488758876887788788879888088818882888388848885888688878888888988908891889288938894889588968897889888998900890189028903890489058906890789088909891089118912891389148915891689178918891989208921892289238924892589268927892889298930893189328933893489358936893789388939894089418942894389448945894689478948894989508951895289538954895589568957895889598960896189628963896489658966896789688969897089718972897389748975897689778978897989808981898289838984898589868987898889898990899189928993899489958996899789988999900090019002900390049005900690079008900990109011901290139014901590169017901890199020902190229023902490259026902790289029903090319032903390349035903690379038903990409041904290439044904590469047904890499050905190529053905490559056905790589059906090619062906390649065906690679068906990709071907290739074907590769077907890799080908190829083908490859086908790889089909090919092909390949095909690979098909991009101910291039104910591069107910891099110911191129113911491159116911791189119912091219122912391249125912691279128912991309131913291339134913591369137913891399140914191429143914491459146914791489149915091519152915391549155915691579158915991609161916291639164916591669167916891699170917191729173917491759176917791789179918091819182918391849185918691879188918991909191919291939194919591969197919891999200920192029203920492059206920792089209921092119212921392149215921692179218921992209221922292239224922592269227922892299230923192329233923492359236923792389239924092419242924392449245924692479248924992509251925292539254925592569257925892599260926192629263926492659266926792689269927092719272927392749275927692779278927992809281928292839284928592869287928892899290929192929293929492959296929792989299930093019302930393049305930693079308930993109311931293139314931593169317931893199320932193229323932493259326932793289329933093319332933393349335933693379338933993409341934293439344934593469347934893499350935193529353935493559356935793589359936093619362936393649365936693679368936993709371937293739374937593769377937893799380938193829383938493859386938793889389939093919392939393949395939693979398939994009401940294039404940594069407940894099410941194129413941494159416941794189419942094219422942394249425942694279428942994309431943294339434943594369437943894399440944194429443944494459446944794489449945094519452945394549455945694579458945994609461946294639464946594669467946894699470947194729473947494759476947794789479948094819482948394849485948694879488948994909491949294939494949594969497949894999500950195029503950495059506950795089509951095119512951395149515951695179518951995209521952295239524952595269527952895299530953195329533953495359536953795389539954095419542954395449545954695479548954995509551955295539554955595569557955895599560956195629563956495659566956795689569957095719572957395749575957695779578957995809581958295839584958595869587958895899590959195929593959495959596959795989599960096019602960396049605960696079608960996109611961296139614961596169617961896199620962196229623962496259626962796289629963096319632963396349635963696379638963996409641964296439644964596469647964896499650965196529653965496559656965796589659966096619662966396649665966696679668966996709671967296739674967596769677967896799680968196829683968496859686968796889689969096919692969396949695969696979698969997009701970297039704970597069707970897099710971197129713971497159716971797189719972097219722972397249725972697279728972997309731973297339734973597369737973897399740974197429743974497459746974797489749975097519752975397549755975697579758975997609761976297639764976597669767976897699770977197729773977497759776977797789779978097819782978397849785978697879788978997909791979297939794979597969797979897999800980198029803980498059806980798089809981098119812981398149815981698179818981998209821982298239824982598269827982898299830983198329833983498359836983798389839984098419842984398449845984698479848984998509851985298539854985598569857985898599860986198629863986498659866986798689869987098719872987398749875987698779878987998809881988298839884988598869887988898899890989198929893989498959896989798989899990099019902990399049905990699079908990999109911991299139914991599169917991899199920992199229923992499259926992799289929993099319932993399349935993699379938993999409941994299439944994599469947994899499950995199529953995499559956995799589959996099619962996399649965996699679968996999709971997299739974997599769977997899799980998199829983998499859986998799889989999099919992999399949995999699979998999910000100011000210003100041000510006100071000810009100101001110012100131001410015100161001710018100191002010021100221002310024100251002610027100281002910030100311003210033100341003510036100371003810039100401004110042100431004410045100461004710048100491005010051100521005310054100551005610057100581005910060100611006210063100641006510066100671006810069100701007110072100731007410075100761007710078100791008010081100821008310084100851008610087100881008910090100911009210093100941009510096100971009810099101001010110102101031010410105101061010710108101091011010111101121011310114101151011610117101181011910120101211012210123101241012510126101271012810129101301013110132101331013410135101361013710138101391014010141101421014310144101451014610147101481014910150101511015210153101541015510156101571015810159101601016110162101631016410165101661016710168101691017010171101721017310174101751017610177101781017910180101811018210183101841018510186101871018810189101901019110192101931019410195101961019710198101991020010201102021020310204102051020610207102081020910210102111021210213102141021510216102171021810219102201022110222102231022410225102261022710228102291023010231102321023310234102351023610237102381023910240102411024210243102441024510246102471024810249102501025110252102531025410255102561025710258102591026010261102621026310264102651026610267102681026910270102711027210273102741027510276102771027810279102801028110282102831028410285102861028710288102891029010291102921029310294102951029610297102981029910300103011030210303103041030510306103071030810309103101031110312103131031410315103161031710318103191032010321103221032310324103251032610327103281032910330103311033210333103341033510336103371033810339103401034110342103431034410345103461034710348103491035010351103521035310354103551035610357103581035910360103611036210363103641036510366103671036810369103701037110372103731037410375103761037710378103791038010381103821038310384103851038610387103881038910390103911039210393103941039510396103971039810399104001040110402104031040410405104061040710408104091041010411104121041310414104151041610417104181041910420104211042210423104241042510426104271042810429104301043110432104331043410435104361043710438104391044010441104421044310444104451044610447104481044910450104511045210453104541045510456104571045810459104601046110462104631046410465104661046710468104691047010471104721047310474104751047610477104781047910480104811048210483104841048510486104871048810489104901049110492104931049410495104961049710498104991050010501105021050310504105051050610507105081050910510105111051210513105141051510516105171051810519105201052110522105231052410525105261052710528105291053010531105321053310534105351053610537105381053910540105411054210543105441054510546105471054810549105501055110552105531055410555105561055710558105591056010561105621056310564105651056610567105681056910570105711057210573105741057510576105771057810579105801058110582105831058410585105861058710588105891059010591105921059310594105951059610597105981059910600106011060210603106041060510606106071060810609106101061110612106131061410615106161061710618106191062010621106221062310624106251062610627106281062910630106311063210633106341063510636106371063810639106401064110642106431064410645106461064710648106491065010651106521065310654106551065610657106581065910660106611066210663106641066510666106671066810669106701067110672106731067410675106761067710678106791068010681106821068310684106851068610687106881068910690106911069210693106941069510696106971069810699107001070110702107031070410705107061070710708107091071010711107121071310714107151071610717107181071910720107211072210723107241072510726107271072810729107301073110732107331073410735107361073710738107391074010741107421074310744107451074610747107481074910750107511075210753107541075510756107571075810759107601076110762107631076410765107661076710768107691077010771107721077310774107751077610777107781077910780107811078210783107841078510786107871078810789107901079110792107931079410795107961079710798107991080010801108021080310804108051080610807108081080910810108111081210813108141081510816108171081810819108201082110822108231082410825108261082710828108291083010831108321083310834108351083610837108381083910840108411084210843108441084510846108471084810849108501085110852108531085410855108561085710858108591086010861108621086310864108651086610867108681086910870108711087210873108741087510876108771087810879108801088110882108831088410885108861088710888108891089010891108921089310894108951089610897108981089910900109011090210903109041090510906109071090810909109101091110912109131091410915109161091710918109191092010921109221092310924109251092610927109281092910930109311093210933109341093510936109371093810939109401094110942109431094410945109461094710948109491095010951109521095310954109551095610957109581095910960109611096210963109641096510966109671096810969109701097110972109731097410975109761097710978109791098010981109821098310984109851098610987109881098910990109911099210993109941099510996109971099810999110001100111002110031100411005110061100711008110091101011011110121101311014110151101611017110181101911020110211102211023110241102511026110271102811029110301103111032110331103411035110361103711038110391104011041110421104311044110451104611047110481104911050110511105211053110541105511056110571105811059110601106111062110631106411065110661106711068110691107011071110721107311074110751107611077110781107911080110811108211083110841108511086110871108811089110901109111092110931109411095110961109711098110991110011101111021110311104111051110611107111081110911110111111111211113111141111511116111171111811119111201112111122111231112411125111261112711128111291113011131111321113311134111351113611137111381113911140111411114211143111441114511146111471114811149111501115111152111531115411155111561115711158111591116011161111621116311164111651116611167111681116911170111711117211173111741117511176111771117811179111801118111182111831118411185111861118711188111891119011191111921119311194111951119611197111981119911200112011120211203112041120511206112071120811209112101121111212112131121411215112161121711218112191122011221112221122311224112251122611227112281122911230112311123211233112341123511236112371123811239112401124111242112431124411245112461124711248112491125011251112521125311254112551125611257112581125911260112611126211263112641126511266112671126811269112701127111272112731127411275112761127711278112791128011281112821128311284112851128611287112881128911290112911129211293112941129511296112971129811299113001130111302113031130411305113061130711308113091131011311113121131311314113151131611317113181131911320113211132211323113241132511326113271132811329113301133111332113331133411335113361133711338113391134011341113421134311344113451134611347113481134911350113511135211353113541135511356113571135811359113601136111362113631136411365113661136711368113691137011371113721137311374113751137611377113781137911380113811138211383113841138511386113871138811389113901139111392113931139411395113961139711398113991140011401114021140311404114051140611407114081140911410114111141211413114141141511416114171141811419114201142111422114231142411425114261142711428114291143011431114321143311434114351143611437114381143911440114411144211443114441144511446114471144811449114501145111452114531145411455114561145711458114591146011461114621146311464114651146611467114681146911470114711147211473114741147511476114771147811479114801148111482114831148411485114861148711488114891149011491114921149311494114951149611497114981149911500115011150211503115041150511506115071150811509115101151111512115131151411515115161151711518115191152011521115221152311524115251152611527115281152911530115311153211533115341153511536115371153811539115401154111542115431154411545115461154711548115491155011551115521155311554115551155611557115581155911560115611156211563115641156511566115671156811569115701157111572115731157411575115761157711578115791158011581115821158311584115851158611587115881158911590115911159211593115941159511596115971159811599116001160111602116031160411605116061160711608116091161011611116121161311614116151161611617116181161911620116211162211623116241162511626116271162811629116301163111632116331163411635116361163711638116391164011641116421164311644116451164611647116481164911650116511165211653116541165511656116571165811659116601166111662116631166411665116661166711668116691167011671116721167311674116751167611677116781167911680116811168211683116841168511686116871168811689116901169111692116931169411695116961169711698116991170011701117021170311704117051170611707117081170911710117111171211713117141171511716117171171811719117201172111722117231172411725117261172711728117291173011731117321173311734117351173611737117381173911740117411174211743117441174511746117471174811749117501175111752117531175411755117561175711758117591176011761117621176311764117651176611767117681176911770117711177211773117741177511776117771177811779117801178111782117831178411785117861178711788117891179011791117921179311794117951179611797117981179911800118011180211803118041180511806118071180811809118101181111812118131181411815118161181711818118191182011821118221182311824118251182611827118281182911830118311183211833118341183511836118371183811839118401184111842118431184411845118461184711848118491185011851118521185311854118551185611857118581185911860118611186211863118641186511866118671186811869118701187111872118731187411875118761187711878118791188011881118821188311884118851188611887118881188911890118911189211893118941189511896118971189811899119001190111902119031190411905119061190711908119091191011911119121191311914119151191611917119181191911920119211192211923119241192511926119271192811929119301193111932119331193411935119361193711938119391194011941119421194311944119451194611947119481194911950119511195211953119541195511956119571195811959119601196111962119631196411965119661196711968119691197011971119721197311974119751197611977119781197911980119811198211983119841198511986119871198811989119901199111992119931199411995119961199711998119991200012001120021200312004120051200612007120081200912010120111201212013120141201512016120171201812019120201202112022120231202412025120261202712028120291203012031120321203312034120351203612037120381203912040120411204212043120441204512046120471204812049120501205112052120531205412055120561205712058120591206012061120621206312064120651206612067120681206912070120711207212073120741207512076120771207812079120801208112082120831208412085120861208712088120891209012091120921209312094120951209612097120981209912100121011210212103121041210512106121071210812109121101211112112121131211412115121161211712118121191212012121121221212312124121251212612127121281212912130121311213212133121341213512136121371213812139121401214112142121431214412145121461214712148121491215012151121521215312154121551215612157121581215912160121611216212163121641216512166121671216812169121701217112172121731217412175121761217712178121791218012181121821218312184121851218612187121881218912190121911219212193121941219512196121971219812199122001220112202122031220412205122061220712208122091221012211122121221312214122151221612217122181221912220122211222212223122241222512226122271222812229122301223112232122331223412235122361223712238122391224012241122421224312244122451224612247122481224912250122511225212253122541225512256122571225812259122601226112262122631226412265122661226712268122691227012271122721227312274122751227612277122781227912280122811228212283122841228512286122871228812289122901229112292122931229412295122961229712298122991230012301123021230312304123051230612307123081230912310123111231212313123141231512316123171231812319123201232112322123231232412325123261232712328123291233012331123321233312334123351233612337123381233912340123411234212343123441234512346123471234812349123501235112352123531235412355123561235712358123591236012361123621236312364123651236612367123681236912370123711237212373123741237512376123771237812379123801238112382123831238412385123861238712388123891239012391123921239312394123951239612397123981239912400124011240212403124041240512406124071240812409124101241112412124131241412415124161241712418124191242012421124221242312424124251242612427124281242912430124311243212433124341243512436124371243812439124401244112442124431244412445124461244712448124491245012451124521245312454124551245612457124581245912460124611246212463124641246512466124671246812469124701247112472124731247412475124761247712478124791248012481124821248312484124851248612487124881248912490124911249212493124941249512496124971249812499125001250112502125031250412505125061250712508125091251012511125121251312514125151251612517125181251912520125211252212523125241252512526125271252812529125301253112532125331253412535125361253712538125391254012541125421254312544125451254612547125481254912550125511255212553125541255512556125571255812559125601256112562125631256412565125661256712568125691257012571125721257312574125751257612577125781257912580125811258212583125841258512586125871258812589125901259112592125931259412595125961259712598125991260012601126021260312604126051260612607126081260912610126111261212613126141261512616126171261812619126201262112622126231262412625126261262712628126291263012631126321263312634126351263612637126381263912640126411264212643126441264512646126471264812649126501265112652126531265412655126561265712658126591266012661126621266312664126651266612667126681266912670126711267212673126741267512676126771267812679126801268112682126831268412685126861268712688126891269012691126921269312694126951269612697126981269912700127011270212703127041270512706127071270812709127101271112712127131271412715127161271712718127191272012721127221272312724127251272612727127281272912730127311273212733127341273512736127371273812739127401274112742127431274412745127461274712748127491275012751127521275312754127551275612757127581275912760127611276212763127641276512766127671276812769127701277112772127731277412775127761277712778127791278012781127821278312784127851278612787127881278912790127911279212793127941279512796127971279812799128001280112802128031280412805128061280712808128091281012811128121281312814128151281612817128181281912820128211282212823128241282512826128271282812829128301283112832128331283412835128361283712838128391284012841128421284312844128451284612847128481284912850128511285212853128541285512856128571285812859128601286112862128631286412865128661286712868128691287012871128721287312874128751287612877128781287912880128811288212883128841288512886128871288812889128901289112892128931289412895128961289712898128991290012901129021290312904129051290612907129081290912910129111291212913129141291512916129171291812919129201292112922129231292412925129261292712928129291293012931129321293312934129351293612937129381293912940129411294212943129441294512946129471294812949129501295112952129531295412955129561295712958129591296012961129621296312964129651296612967129681296912970129711297212973129741297512976129771297812979129801298112982129831298412985129861298712988129891299012991129921299312994129951299612997129981299913000130011300213003130041300513006130071300813009130101301113012130131301413015130161301713018130191302013021130221302313024130251302613027130281302913030130311303213033130341303513036130371303813039130401304113042130431304413045130461304713048130491305013051130521305313054130551305613057130581305913060130611306213063130641306513066130671306813069130701307113072130731307413075130761307713078130791308013081130821308313084130851308613087130881308913090130911309213093130941309513096130971309813099131001310113102131031310413105131061310713108131091311013111131121311313114131151311613117131181311913120131211312213123131241312513126131271312813129131301313113132131331313413135131361313713138131391314013141131421314313144131451314613147131481314913150131511315213153131541315513156131571315813159131601316113162131631316413165131661316713168131691317013171131721317313174131751317613177131781317913180131811318213183131841318513186131871318813189131901319113192131931319413195131961319713198131991320013201132021320313204132051320613207132081320913210132111321213213132141321513216132171321813219132201322113222132231322413225132261322713228132291323013231132321323313234132351323613237132381323913240132411324213243132441324513246132471324813249132501325113252132531325413255132561325713258132591326013261132621326313264132651326613267132681326913270132711327213273132741327513276132771327813279132801328113282132831328413285132861328713288132891329013291132921329313294132951329613297132981329913300133011330213303133041330513306133071330813309133101331113312133131331413315133161331713318133191332013321133221332313324133251332613327133281332913330133311333213333133341333513336133371333813339133401334113342133431334413345133461334713348133491335013351133521335313354133551335613357133581335913360133611336213363133641336513366133671336813369133701337113372133731337413375133761337713378133791338013381133821338313384133851338613387133881338913390133911339213393133941339513396133971339813399134001340113402134031340413405134061340713408134091341013411134121341313414134151341613417134181341913420134211342213423134241342513426134271342813429134301343113432134331343413435134361343713438134391344013441134421344313444134451344613447134481344913450134511345213453134541345513456134571345813459134601346113462134631346413465134661346713468134691347013471134721347313474134751347613477134781347913480134811348213483134841348513486134871348813489134901349113492134931349413495134961349713498134991350013501135021350313504135051350613507135081350913510135111351213513135141351513516135171351813519135201352113522135231352413525135261352713528135291353013531135321353313534135351353613537135381353913540135411354213543135441354513546135471354813549135501355113552135531355413555135561355713558135591356013561135621356313564135651356613567135681356913570135711357213573135741357513576135771357813579135801358113582135831358413585135861358713588135891359013591135921359313594135951359613597135981359913600136011360213603136041360513606136071360813609136101361113612136131361413615136161361713618136191362013621136221362313624136251362613627136281362913630136311363213633136341363513636136371363813639136401364113642136431364413645136461364713648136491365013651136521365313654136551365613657136581365913660136611366213663136641366513666136671366813669136701367113672136731367413675136761367713678136791368013681136821368313684136851368613687136881368913690136911369213693136941369513696136971369813699137001370113702137031370413705137061370713708137091371013711137121371313714137151371613717137181371913720137211372213723137241372513726137271372813729137301373113732137331373413735137361373713738137391374013741137421374313744137451374613747137481374913750137511375213753137541375513756137571375813759137601376113762137631376413765137661376713768137691377013771137721377313774137751377613777137781377913780137811378213783137841378513786137871378813789137901379113792137931379413795137961379713798137991380013801138021380313804138051380613807138081380913810138111381213813138141381513816138171381813819138201382113822138231382413825138261382713828138291383013831138321383313834138351383613837138381383913840138411384213843138441384513846138471384813849138501385113852138531385413855138561385713858138591386013861138621386313864138651386613867138681386913870138711387213873138741387513876138771387813879138801388113882138831388413885138861388713888138891389013891138921389313894138951389613897138981389913900139011390213903139041390513906139071390813909139101391113912139131391413915139161391713918139191392013921139221392313924139251392613927139281392913930139311393213933139341393513936139371393813939139401394113942139431394413945139461394713948139491395013951139521395313954139551395613957139581395913960139611396213963139641396513966139671396813969139701397113972139731397413975139761397713978139791398013981139821398313984139851398613987139881398913990139911399213993139941399513996139971399813999140001400114002140031400414005140061400714008140091401014011140121401314014140151401614017140181401914020140211402214023140241402514026140271402814029140301403114032140331403414035140361403714038140391404014041140421404314044140451404614047140481404914050140511405214053140541405514056140571405814059140601406114062140631406414065140661406714068140691407014071140721407314074140751407614077140781407914080140811408214083140841408514086140871408814089140901409114092140931409414095140961409714098140991410014101141021410314104141051410614107141081410914110141111411214113141141411514116141171411814119141201412114122141231412414125141261412714128141291413014131141321413314134141351413614137141381413914140141411414214143141441414514146141471414814149141501415114152141531415414155141561415714158141591416014161141621416314164141651416614167141681416914170141711417214173141741417514176141771417814179141801418114182141831418414185141861418714188141891419014191141921419314194141951419614197141981419914200142011420214203142041420514206142071420814209142101421114212142131421414215142161421714218142191422014221142221422314224142251422614227142281422914230142311423214233142341423514236142371423814239142401424114242142431424414245142461424714248142491425014251142521425314254142551425614257142581425914260142611426214263142641426514266142671426814269142701427114272142731427414275142761427714278142791428014281142821428314284142851428614287142881428914290142911429214293142941429514296142971429814299143001430114302143031430414305143061430714308143091431014311143121431314314143151431614317143181431914320143211432214323143241432514326143271432814329143301433114332143331433414335143361433714338143391434014341143421434314344143451434614347143481434914350143511435214353143541435514356143571435814359143601436114362143631436414365143661436714368143691437014371143721437314374143751437614377143781437914380143811438214383143841438514386143871438814389143901439114392143931439414395143961439714398143991440014401144021440314404144051440614407144081440914410144111441214413144141441514416144171441814419144201442114422144231442414425144261442714428144291443014431144321443314434144351443614437144381443914440144411444214443144441444514446144471444814449144501445114452144531445414455144561445714458144591446014461144621446314464144651446614467144681446914470144711447214473144741447514476144771447814479144801448114482144831448414485144861448714488144891449014491144921449314494144951449614497144981449914500145011450214503145041450514506145071450814509145101451114512145131451414515145161451714518145191452014521145221452314524145251452614527145281452914530145311453214533145341453514536145371453814539145401454114542145431454414545145461454714548145491455014551145521455314554145551455614557145581455914560145611456214563145641456514566145671456814569145701457114572145731457414575145761457714578145791458014581145821458314584145851458614587145881458914590145911459214593145941459514596145971459814599146001460114602146031460414605146061460714608146091461014611146121461314614146151461614617146181461914620146211462214623146241462514626146271462814629146301463114632146331463414635146361463714638146391464014641146421464314644146451464614647146481464914650146511465214653146541465514656146571465814659146601466114662146631466414665146661466714668146691467014671146721467314674146751467614677146781467914680146811468214683146841468514686146871468814689146901469114692146931469414695146961469714698146991470014701147021470314704147051470614707147081470914710147111471214713147141471514716147171471814719147201472114722147231472414725147261472714728147291473014731147321473314734147351473614737147381473914740147411474214743147441474514746147471474814749147501475114752147531475414755147561475714758147591476014761147621476314764147651476614767147681476914770147711477214773147741477514776147771477814779147801478114782147831478414785147861478714788147891479014791147921479314794147951479614797147981479914800148011480214803148041480514806148071480814809148101481114812148131481414815148161481714818148191482014821148221482314824148251482614827148281482914830148311483214833148341483514836148371483814839148401484114842148431484414845148461484714848148491485014851148521485314854148551485614857148581485914860148611486214863148641486514866148671486814869148701487114872148731487414875148761487714878148791488014881148821488314884148851488614887148881488914890148911489214893148941489514896148971489814899149001490114902149031490414905149061490714908149091491014911149121491314914149151491614917149181491914920149211492214923149241492514926149271492814929149301493114932149331493414935149361493714938149391494014941149421494314944149451494614947149481494914950149511495214953149541495514956149571495814959149601496114962149631496414965149661496714968149691497014971149721497314974149751497614977149781497914980149811498214983149841498514986149871498814989149901499114992149931499414995149961499714998149991500015001150021500315004150051500615007150081500915010150111501215013150141501515016150171501815019150201502115022150231502415025150261502715028150291503015031150321503315034150351503615037150381503915040150411504215043150441504515046150471504815049150501505115052150531505415055150561505715058150591506015061150621506315064150651506615067150681506915070150711507215073150741507515076150771507815079150801508115082150831508415085150861508715088150891509015091150921509315094150951509615097150981509915100151011510215103151041510515106151071510815109151101511115112151131511415115151161511715118151191512015121151221512315124151251512615127151281512915130151311513215133151341513515136151371513815139151401514115142151431514415145151461514715148151491515015151151521515315154151551515615157151581515915160151611516215163151641516515166151671516815169151701517115172151731517415175151761517715178151791518015181151821518315184151851518615187151881518915190151911519215193151941519515196151971519815199152001520115202152031520415205152061520715208152091521015211152121521315214152151521615217152181521915220152211522215223152241522515226152271522815229152301523115232152331523415235152361523715238152391524015241152421524315244152451524615247152481524915250152511525215253152541525515256152571525815259152601526115262152631526415265152661526715268152691527015271152721527315274152751527615277152781527915280152811528215283152841528515286152871528815289152901529115292152931529415295152961529715298152991530015301153021530315304153051530615307153081530915310153111531215313153141531515316153171531815319153201532115322153231532415325153261532715328153291533015331153321533315334153351533615337153381533915340153411534215343153441534515346153471534815349153501535115352153531535415355153561535715358153591536015361153621536315364153651536615367153681536915370153711537215373153741537515376153771537815379153801538115382153831538415385153861538715388153891539015391153921539315394153951539615397153981539915400154011540215403154041540515406154071540815409154101541115412154131541415415154161541715418154191542015421154221542315424154251542615427154281542915430154311543215433154341543515436154371543815439154401544115442154431544415445154461544715448154491545015451154521545315454154551545615457154581545915460154611546215463154641546515466154671546815469154701547115472154731547415475154761547715478154791548015481154821548315484154851548615487154881548915490154911549215493154941549515496154971549815499155001550115502155031550415505155061550715508155091551015511155121551315514155151551615517155181551915520155211552215523155241552515526155271552815529155301553115532155331553415535155361553715538155391554015541155421554315544155451554615547155481554915550155511555215553155541555515556155571555815559155601556115562155631556415565155661556715568155691557015571155721557315574155751557615577155781557915580155811558215583155841558515586155871558815589155901559115592155931559415595155961559715598155991560015601156021560315604156051560615607156081560915610156111561215613156141561515616156171561815619156201562115622156231562415625156261562715628156291563015631156321563315634156351563615637156381563915640156411564215643156441564515646156471564815649156501565115652156531565415655156561565715658156591566015661156621566315664156651566615667156681566915670156711567215673156741567515676156771567815679156801568115682156831568415685156861568715688156891569015691156921569315694156951569615697156981569915700157011570215703157041570515706157071570815709157101571115712157131571415715157161571715718157191572015721157221572315724157251572615727157281572915730157311573215733157341573515736157371573815739157401574115742157431574415745157461574715748157491575015751157521575315754157551575615757157581575915760157611576215763157641576515766157671576815769157701577115772157731577415775157761577715778157791578015781157821578315784157851578615787157881578915790157911579215793157941579515796157971579815799158001580115802158031580415805158061580715808158091581015811158121581315814158151581615817158181581915820158211582215823158241582515826158271582815829158301583115832158331583415835158361583715838158391584015841158421584315844158451584615847158481584915850158511585215853158541585515856158571585815859158601586115862158631586415865158661586715868158691587015871158721587315874158751587615877158781587915880158811588215883158841588515886158871588815889158901589115892158931589415895158961589715898158991590015901159021590315904159051590615907159081590915910159111591215913159141591515916159171591815919159201592115922159231592415925159261592715928159291593015931159321593315934159351593615937159381593915940159411594215943159441594515946159471594815949159501595115952159531595415955159561595715958159591596015961159621596315964159651596615967159681596915970159711597215973159741597515976159771597815979159801598115982159831598415985159861598715988159891599015991159921599315994159951599615997159981599916000160011600216003160041600516006160071600816009160101601116012160131601416015160161601716018160191602016021160221602316024160251602616027160281602916030160311603216033160341603516036160371603816039160401604116042160431604416045160461604716048160491605016051160521605316054160551605616057160581605916060160611606216063160641606516066160671606816069160701607116072160731607416075160761607716078160791608016081160821608316084160851608616087160881608916090160911609216093160941609516096160971609816099161001610116102161031610416105161061610716108161091611016111161121611316114161151611616117161181611916120161211612216123161241612516126161271612816129161301613116132161331613416135161361613716138161391614016141161421614316144161451614616147161481614916150161511615216153161541615516156161571615816159161601616116162161631616416165161661616716168161691617016171161721617316174161751617616177161781617916180161811618216183161841618516186161871618816189161901619116192161931619416195161961619716198161991620016201162021620316204162051620616207162081620916210162111621216213162141621516216162171621816219162201622116222162231622416225162261622716228162291623016231162321623316234162351623616237162381623916240162411624216243162441624516246162471624816249162501625116252162531625416255162561625716258162591626016261162621626316264162651626616267162681626916270162711627216273162741627516276162771627816279162801628116282162831628416285162861628716288162891629016291162921629316294162951629616297162981629916300163011630216303163041630516306163071630816309163101631116312163131631416315163161631716318163191632016321163221632316324163251632616327163281632916330163311633216333163341633516336163371633816339163401634116342163431634416345163461634716348163491635016351163521635316354163551635616357163581635916360163611636216363163641636516366163671636816369163701637116372163731637416375163761637716378163791638016381163821638316384163851638616387163881638916390163911639216393163941639516396163971639816399164001640116402164031640416405164061640716408164091641016411164121641316414164151641616417164181641916420164211642216423164241642516426164271642816429164301643116432164331643416435164361643716438164391644016441164421644316444164451644616447164481644916450164511645216453164541645516456164571645816459164601646116462164631646416465164661646716468164691647016471164721647316474164751647616477164781647916480164811648216483164841648516486164871648816489164901649116492164931649416495164961649716498164991650016501165021650316504165051650616507165081650916510165111651216513165141651516516165171651816519165201652116522165231652416525165261652716528165291653016531165321653316534165351653616537165381653916540165411654216543165441654516546165471654816549165501655116552165531655416555165561655716558165591656016561165621656316564165651656616567165681656916570165711657216573165741657516576165771657816579165801658116582165831658416585165861658716588165891659016591165921659316594165951659616597165981659916600166011660216603166041660516606166071660816609166101661116612166131661416615166161661716618166191662016621166221662316624166251662616627166281662916630166311663216633166341663516636166371663816639166401664116642166431664416645166461664716648166491665016651166521665316654166551665616657166581665916660166611666216663166641666516666166671666816669166701667116672166731667416675166761667716678166791668016681166821668316684166851668616687166881668916690166911669216693166941669516696166971669816699167001670116702167031670416705167061670716708167091671016711167121671316714167151671616717167181671916720167211672216723167241672516726167271672816729167301673116732167331673416735167361673716738167391674016741167421674316744167451674616747167481674916750167511675216753167541675516756167571675816759167601676116762167631676416765167661676716768167691677016771167721677316774167751677616777167781677916780167811678216783167841678516786167871678816789167901679116792167931679416795167961679716798167991680016801168021680316804168051680616807168081680916810168111681216813168141681516816168171681816819168201682116822168231682416825168261682716828168291683016831168321683316834168351683616837168381683916840168411684216843168441684516846168471684816849168501685116852168531685416855168561685716858168591686016861168621686316864168651686616867168681686916870168711687216873168741687516876168771687816879168801688116882168831688416885168861688716888168891689016891168921689316894168951689616897168981689916900169011690216903169041690516906169071690816909169101691116912169131691416915169161691716918169191692016921169221692316924169251692616927169281692916930169311693216933169341693516936169371693816939169401694116942169431694416945169461694716948169491695016951169521695316954169551695616957169581695916960169611696216963169641696516966169671696816969169701697116972169731697416975169761697716978169791698016981169821698316984169851698616987169881698916990169911699216993169941699516996169971699816999170001700117002170031700417005170061700717008170091701017011170121701317014170151701617017170181701917020170211702217023170241702517026170271702817029170301703117032170331703417035170361703717038170391704017041170421704317044170451704617047170481704917050170511705217053170541705517056170571705817059170601706117062170631706417065170661706717068170691707017071170721707317074170751707617077170781707917080170811708217083170841708517086170871708817089170901709117092170931709417095170961709717098170991710017101171021710317104171051710617107171081710917110171111711217113171141711517116171171711817119171201712117122171231712417125171261712717128171291713017131171321713317134171351713617137171381713917140171411714217143171441714517146171471714817149171501715117152171531715417155171561715717158171591716017161171621716317164171651716617167171681716917170171711717217173171741717517176171771717817179171801718117182171831718417185171861718717188171891719017191171921719317194171951719617197171981719917200172011720217203172041720517206172071720817209172101721117212172131721417215172161721717218172191722017221172221722317224172251722617227172281722917230172311723217233172341723517236172371723817239172401724117242172431724417245172461724717248172491725017251172521725317254172551725617257172581725917260172611726217263172641726517266172671726817269172701727117272172731727417275172761727717278172791728017281172821728317284172851728617287172881728917290172911729217293172941729517296172971729817299173001730117302173031730417305173061730717308173091731017311173121731317314173151731617317173181731917320173211732217323173241732517326173271732817329173301733117332173331733417335173361733717338173391734017341173421734317344173451734617347173481734917350173511735217353173541735517356173571735817359173601736117362173631736417365173661736717368173691737017371173721737317374173751737617377173781737917380173811738217383173841738517386173871738817389173901739117392173931739417395173961739717398173991740017401174021740317404174051740617407174081740917410174111741217413174141741517416174171741817419174201742117422174231742417425174261742717428174291743017431174321743317434174351743617437174381743917440174411744217443174441744517446174471744817449174501745117452174531745417455174561745717458174591746017461174621746317464174651746617467174681746917470174711747217473174741747517476174771747817479174801748117482174831748417485174861748717488174891749017491174921749317494174951749617497174981749917500175011750217503175041750517506
  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.insteadOfKey = `url.https://${HOSTNAME}/.insteadOf`;
  4446. this.insteadOfValue = `git@${HOSTNAME}:`;
  4447. this.temporaryHomePath = '';
  4448. this.git = gitCommandManager;
  4449. this.settings = gitSourceSettings || {};
  4450. // Token auth header
  4451. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4452. core.setSecret(basicCredential);
  4453. this.tokenPlaceholderConfigValue = `AUTHORIZATION: basic ***`;
  4454. this.tokenConfigValue = `AUTHORIZATION: basic ${basicCredential}`;
  4455. }
  4456. configureAuth() {
  4457. return __awaiter(this, void 0, void 0, function* () {
  4458. // Remove possible previous values
  4459. yield this.removeAuth();
  4460. // Configure new values
  4461. yield this.configureToken();
  4462. });
  4463. }
  4464. configureGlobalAuth() {
  4465. return __awaiter(this, void 0, void 0, function* () {
  4466. // Create a temp home directory
  4467. const runnerTemp = process.env['RUNNER_TEMP'] || '';
  4468. assert.ok(runnerTemp, 'RUNNER_TEMP is not defined');
  4469. const uniqueId = v4_1.default();
  4470. this.temporaryHomePath = path.join(runnerTemp, uniqueId);
  4471. yield fs.promises.mkdir(this.temporaryHomePath, { recursive: true });
  4472. // Copy the global git config
  4473. const gitConfigPath = path.join(process.env['HOME'] || os.homedir(), '.gitconfig');
  4474. const newGitConfigPath = path.join(this.temporaryHomePath, '.gitconfig');
  4475. let configExists = false;
  4476. try {
  4477. yield fs.promises.stat(gitConfigPath);
  4478. configExists = true;
  4479. }
  4480. catch (err) {
  4481. if (err.code !== 'ENOENT') {
  4482. throw err;
  4483. }
  4484. }
  4485. if (configExists) {
  4486. core.info(`Copying '${gitConfigPath}' to '${newGitConfigPath}'`);
  4487. yield io.cp(gitConfigPath, newGitConfigPath);
  4488. }
  4489. else {
  4490. yield fs.promises.writeFile(newGitConfigPath, '');
  4491. }
  4492. try {
  4493. // Override HOME
  4494. core.info(`Temporarily overriding HOME='${this.temporaryHomePath}' before making global git config changes`);
  4495. this.git.setEnvironmentVariable('HOME', this.temporaryHomePath);
  4496. // Configure the token
  4497. yield this.configureToken(newGitConfigPath, true);
  4498. // Configure HTTPS instead of SSH
  4499. yield this.git.tryConfigUnset(this.insteadOfKey, true);
  4500. yield this.git.config(this.insteadOfKey, this.insteadOfValue, true);
  4501. }
  4502. catch (err) {
  4503. // Unset in case somehow written to the real global config
  4504. core.info('Encountered an error when attempting to configure token. Attempting unconfigure.');
  4505. yield this.git.tryConfigUnset(this.tokenConfigKey, true);
  4506. throw err;
  4507. }
  4508. });
  4509. }
  4510. configureSubmoduleAuth() {
  4511. return __awaiter(this, void 0, void 0, function* () {
  4512. if (this.settings.persistCredentials) {
  4513. // Configure a placeholder value. This approach avoids the credential being captured
  4514. // by process creation audit events, which are commonly logged. For more information,
  4515. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4516. const commands = [
  4517. `git config --local "${this.tokenConfigKey}" "${this.tokenPlaceholderConfigValue}"`,
  4518. `git config --local "${this.insteadOfKey}" "${this.insteadOfValue}"`,
  4519. `git config --local --show-origin --name-only --get-regexp remote.origin.url`
  4520. ];
  4521. const output = yield this.git.submoduleForeach(commands.join(' && '), this.settings.nestedSubmodules);
  4522. // Replace the placeholder
  4523. const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
  4524. for (const configPath of configPaths) {
  4525. core.debug(`Replacing token placeholder in '${configPath}'`);
  4526. this.replaceTokenPlaceholder(configPath);
  4527. }
  4528. }
  4529. });
  4530. }
  4531. removeAuth() {
  4532. return __awaiter(this, void 0, void 0, function* () {
  4533. yield this.removeToken();
  4534. });
  4535. }
  4536. removeGlobalAuth() {
  4537. return __awaiter(this, void 0, void 0, function* () {
  4538. core.info(`Unsetting HOME override`);
  4539. this.git.removeEnvironmentVariable('HOME');
  4540. yield io.rmRF(this.temporaryHomePath);
  4541. });
  4542. }
  4543. configureToken(configPath, globalConfig) {
  4544. return __awaiter(this, void 0, void 0, function* () {
  4545. // Validate args
  4546. assert.ok((configPath && globalConfig) || (!configPath && !globalConfig), 'Unexpected configureToken parameter combinations');
  4547. // Default config path
  4548. if (!configPath && !globalConfig) {
  4549. configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4550. }
  4551. // Configure a placeholder value. This approach avoids the credential being captured
  4552. // by process creation audit events, which are commonly logged. For more information,
  4553. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4554. yield this.git.config(this.tokenConfigKey, this.tokenPlaceholderConfigValue, globalConfig);
  4555. // Replace the placeholder
  4556. yield this.replaceTokenPlaceholder(configPath || '');
  4557. });
  4558. }
  4559. replaceTokenPlaceholder(configPath) {
  4560. return __awaiter(this, void 0, void 0, function* () {
  4561. assert.ok(configPath, 'configPath is not defined');
  4562. let content = (yield fs.promises.readFile(configPath)).toString();
  4563. const placeholderIndex = content.indexOf(this.tokenPlaceholderConfigValue);
  4564. if (placeholderIndex < 0 ||
  4565. placeholderIndex != content.lastIndexOf(this.tokenPlaceholderConfigValue)) {
  4566. throw new Error(`Unable to replace auth placeholder in ${configPath}`);
  4567. }
  4568. assert.ok(this.tokenConfigValue, 'tokenConfigValue is not defined');
  4569. content = content.replace(this.tokenPlaceholderConfigValue, this.tokenConfigValue);
  4570. yield fs.promises.writeFile(configPath, content);
  4571. });
  4572. }
  4573. removeToken() {
  4574. return __awaiter(this, void 0, void 0, function* () {
  4575. // HTTP extra header
  4576. yield this.removeGitConfig(this.tokenConfigKey);
  4577. });
  4578. }
  4579. removeGitConfig(configKey) {
  4580. return __awaiter(this, void 0, void 0, function* () {
  4581. if ((yield this.git.configExists(configKey)) &&
  4582. !(yield this.git.tryConfigUnset(configKey))) {
  4583. // Load the config contents
  4584. core.warning(`Failed to remove '${configKey}' from the git config`);
  4585. }
  4586. const pattern = regexpHelper.escape(configKey);
  4587. yield this.git.submoduleForeach(`git config --local --name-only --get-regexp ${pattern} && git config --local --unset-all ${configKey} || :`, true);
  4588. });
  4589. }
  4590. }
  4591. /***/ }),
  4592. /***/ 289:
  4593. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4594. "use strict";
  4595. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4596. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4597. return new (P || (P = Promise))(function (resolve, reject) {
  4598. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4599. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4600. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4601. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4602. });
  4603. };
  4604. var __importStar = (this && this.__importStar) || function (mod) {
  4605. if (mod && mod.__esModule) return mod;
  4606. var result = {};
  4607. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4608. result["default"] = mod;
  4609. return result;
  4610. };
  4611. Object.defineProperty(exports, "__esModule", { value: true });
  4612. const core = __importStar(__webpack_require__(470));
  4613. const exec = __importStar(__webpack_require__(986));
  4614. const fshelper = __importStar(__webpack_require__(618));
  4615. const io = __importStar(__webpack_require__(1));
  4616. const path = __importStar(__webpack_require__(622));
  4617. const regexpHelper = __importStar(__webpack_require__(528));
  4618. const retryHelper = __importStar(__webpack_require__(587));
  4619. const git_version_1 = __webpack_require__(559);
  4620. // Auth header not supported before 2.9
  4621. // Wire protocol v2 not supported before 2.18
  4622. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4623. function createCommandManager(workingDirectory, lfs) {
  4624. return __awaiter(this, void 0, void 0, function* () {
  4625. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4626. });
  4627. }
  4628. exports.createCommandManager = createCommandManager;
  4629. class GitCommandManager {
  4630. // Private constructor; use createCommandManager()
  4631. constructor() {
  4632. this.gitEnv = {
  4633. GIT_TERMINAL_PROMPT: '0',
  4634. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4635. };
  4636. this.gitPath = '';
  4637. this.lfs = false;
  4638. this.workingDirectory = '';
  4639. }
  4640. branchDelete(remote, branch) {
  4641. return __awaiter(this, void 0, void 0, function* () {
  4642. const args = ['branch', '--delete', '--force'];
  4643. if (remote) {
  4644. args.push('--remote');
  4645. }
  4646. args.push(branch);
  4647. yield this.execGit(args);
  4648. });
  4649. }
  4650. branchExists(remote, pattern) {
  4651. return __awaiter(this, void 0, void 0, function* () {
  4652. const args = ['branch', '--list'];
  4653. if (remote) {
  4654. args.push('--remote');
  4655. }
  4656. args.push(pattern);
  4657. const output = yield this.execGit(args);
  4658. return !!output.stdout.trim();
  4659. });
  4660. }
  4661. branchList(remote) {
  4662. return __awaiter(this, void 0, void 0, function* () {
  4663. const result = [];
  4664. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4665. // "branch --list" is more difficult when in a detached HEAD state.
  4666. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4667. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4668. const args = ['rev-parse', '--symbolic-full-name'];
  4669. if (remote) {
  4670. args.push('--remotes=origin');
  4671. }
  4672. else {
  4673. args.push('--branches');
  4674. }
  4675. const output = yield this.execGit(args);
  4676. for (let branch of output.stdout.trim().split('\n')) {
  4677. branch = branch.trim();
  4678. if (branch) {
  4679. if (branch.startsWith('refs/heads/')) {
  4680. branch = branch.substr('refs/heads/'.length);
  4681. }
  4682. else if (branch.startsWith('refs/remotes/')) {
  4683. branch = branch.substr('refs/remotes/'.length);
  4684. }
  4685. result.push(branch);
  4686. }
  4687. }
  4688. return result;
  4689. });
  4690. }
  4691. checkout(ref, startPoint) {
  4692. return __awaiter(this, void 0, void 0, function* () {
  4693. const args = ['checkout', '--progress', '--force'];
  4694. if (startPoint) {
  4695. args.push('-B', ref, startPoint);
  4696. }
  4697. else {
  4698. args.push(ref);
  4699. }
  4700. yield this.execGit(args);
  4701. });
  4702. }
  4703. checkoutDetach() {
  4704. return __awaiter(this, void 0, void 0, function* () {
  4705. const args = ['checkout', '--detach'];
  4706. yield this.execGit(args);
  4707. });
  4708. }
  4709. config(configKey, configValue, globalConfig) {
  4710. return __awaiter(this, void 0, void 0, function* () {
  4711. yield this.execGit([
  4712. 'config',
  4713. globalConfig ? '--global' : '--local',
  4714. configKey,
  4715. configValue
  4716. ]);
  4717. });
  4718. }
  4719. configExists(configKey, globalConfig) {
  4720. return __awaiter(this, void 0, void 0, function* () {
  4721. const pattern = regexpHelper.escape(configKey);
  4722. const output = yield this.execGit([
  4723. 'config',
  4724. globalConfig ? '--global' : '--local',
  4725. '--name-only',
  4726. '--get-regexp',
  4727. pattern
  4728. ], true);
  4729. return output.exitCode === 0;
  4730. });
  4731. }
  4732. fetch(fetchDepth, refSpec) {
  4733. return __awaiter(this, void 0, void 0, function* () {
  4734. const args = [
  4735. '-c',
  4736. 'protocol.version=2',
  4737. 'fetch',
  4738. '--no-tags',
  4739. '--prune',
  4740. '--progress',
  4741. '--no-recurse-submodules'
  4742. ];
  4743. if (fetchDepth > 0) {
  4744. args.push(`--depth=${fetchDepth}`);
  4745. }
  4746. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4747. args.push('--unshallow');
  4748. }
  4749. args.push('origin');
  4750. for (const arg of refSpec) {
  4751. args.push(arg);
  4752. }
  4753. const that = this;
  4754. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4755. yield that.execGit(args);
  4756. }));
  4757. });
  4758. }
  4759. getWorkingDirectory() {
  4760. return this.workingDirectory;
  4761. }
  4762. init() {
  4763. return __awaiter(this, void 0, void 0, function* () {
  4764. yield this.execGit(['init', this.workingDirectory]);
  4765. });
  4766. }
  4767. isDetached() {
  4768. return __awaiter(this, void 0, void 0, function* () {
  4769. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  4770. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  4771. return !output.stdout.trim().startsWith('refs/heads/');
  4772. });
  4773. }
  4774. lfsFetch(ref) {
  4775. return __awaiter(this, void 0, void 0, function* () {
  4776. const args = ['lfs', 'fetch', 'origin', ref];
  4777. const that = this;
  4778. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4779. yield that.execGit(args);
  4780. }));
  4781. });
  4782. }
  4783. lfsInstall() {
  4784. return __awaiter(this, void 0, void 0, function* () {
  4785. yield this.execGit(['lfs', 'install', '--local']);
  4786. });
  4787. }
  4788. log1() {
  4789. return __awaiter(this, void 0, void 0, function* () {
  4790. yield this.execGit(['log', '-1']);
  4791. });
  4792. }
  4793. remoteAdd(remoteName, remoteUrl) {
  4794. return __awaiter(this, void 0, void 0, function* () {
  4795. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4796. });
  4797. }
  4798. removeEnvironmentVariable(name) {
  4799. delete this.gitEnv[name];
  4800. }
  4801. setEnvironmentVariable(name, value) {
  4802. this.gitEnv[name] = value;
  4803. }
  4804. submoduleForeach(command, recursive) {
  4805. return __awaiter(this, void 0, void 0, function* () {
  4806. const args = ['submodule', 'foreach'];
  4807. if (recursive) {
  4808. args.push('--recursive');
  4809. }
  4810. args.push(command);
  4811. const output = yield this.execGit(args);
  4812. return output.stdout;
  4813. });
  4814. }
  4815. submoduleSync(recursive) {
  4816. return __awaiter(this, void 0, void 0, function* () {
  4817. const args = ['submodule', 'sync'];
  4818. if (recursive) {
  4819. args.push('--recursive');
  4820. }
  4821. yield this.execGit(args);
  4822. });
  4823. }
  4824. submoduleUpdate(fetchDepth, recursive) {
  4825. return __awaiter(this, void 0, void 0, function* () {
  4826. const args = ['-c', 'protocol.version=2'];
  4827. args.push('submodule', 'update', '--init', '--force');
  4828. if (fetchDepth > 0) {
  4829. args.push(`--depth=${fetchDepth}`);
  4830. }
  4831. if (recursive) {
  4832. args.push('--recursive');
  4833. }
  4834. yield this.execGit(args);
  4835. });
  4836. }
  4837. tagExists(pattern) {
  4838. return __awaiter(this, void 0, void 0, function* () {
  4839. const output = yield this.execGit(['tag', '--list', pattern]);
  4840. return !!output.stdout.trim();
  4841. });
  4842. }
  4843. tryClean() {
  4844. return __awaiter(this, void 0, void 0, function* () {
  4845. const output = yield this.execGit(['clean', '-ffdx'], true);
  4846. return output.exitCode === 0;
  4847. });
  4848. }
  4849. tryConfigUnset(configKey, globalConfig) {
  4850. return __awaiter(this, void 0, void 0, function* () {
  4851. const output = yield this.execGit([
  4852. 'config',
  4853. globalConfig ? '--global' : '--local',
  4854. '--unset-all',
  4855. configKey
  4856. ], true);
  4857. return output.exitCode === 0;
  4858. });
  4859. }
  4860. tryDisableAutomaticGarbageCollection() {
  4861. return __awaiter(this, void 0, void 0, function* () {
  4862. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  4863. return output.exitCode === 0;
  4864. });
  4865. }
  4866. tryGetFetchUrl() {
  4867. return __awaiter(this, void 0, void 0, function* () {
  4868. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  4869. if (output.exitCode !== 0) {
  4870. return '';
  4871. }
  4872. const stdout = output.stdout.trim();
  4873. if (stdout.includes('\n')) {
  4874. return '';
  4875. }
  4876. return stdout;
  4877. });
  4878. }
  4879. tryReset() {
  4880. return __awaiter(this, void 0, void 0, function* () {
  4881. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4882. return output.exitCode === 0;
  4883. });
  4884. }
  4885. static createCommandManager(workingDirectory, lfs) {
  4886. return __awaiter(this, void 0, void 0, function* () {
  4887. const result = new GitCommandManager();
  4888. yield result.initializeCommandManager(workingDirectory, lfs);
  4889. return result;
  4890. });
  4891. }
  4892. execGit(args, allowAllExitCodes = false) {
  4893. return __awaiter(this, void 0, void 0, function* () {
  4894. fshelper.directoryExistsSync(this.workingDirectory, true);
  4895. const result = new GitOutput();
  4896. const env = {};
  4897. for (const key of Object.keys(process.env)) {
  4898. env[key] = process.env[key];
  4899. }
  4900. for (const key of Object.keys(this.gitEnv)) {
  4901. env[key] = this.gitEnv[key];
  4902. }
  4903. const stdout = [];
  4904. const options = {
  4905. cwd: this.workingDirectory,
  4906. env,
  4907. ignoreReturnCode: allowAllExitCodes,
  4908. listeners: {
  4909. stdout: (data) => {
  4910. stdout.push(data.toString());
  4911. }
  4912. }
  4913. };
  4914. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4915. result.stdout = stdout.join('');
  4916. return result;
  4917. });
  4918. }
  4919. initializeCommandManager(workingDirectory, lfs) {
  4920. return __awaiter(this, void 0, void 0, function* () {
  4921. this.workingDirectory = workingDirectory;
  4922. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4923. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4924. this.lfs = lfs;
  4925. if (!this.lfs) {
  4926. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4927. }
  4928. this.gitPath = yield io.which('git', true);
  4929. // Git version
  4930. core.debug('Getting git version');
  4931. let gitVersion = new git_version_1.GitVersion();
  4932. let gitOutput = yield this.execGit(['version']);
  4933. let stdout = gitOutput.stdout.trim();
  4934. if (!stdout.includes('\n')) {
  4935. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4936. if (match) {
  4937. gitVersion = new git_version_1.GitVersion(match[0]);
  4938. }
  4939. }
  4940. if (!gitVersion.isValid()) {
  4941. throw new Error('Unable to determine git version');
  4942. }
  4943. // Minimum git version
  4944. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  4945. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4946. }
  4947. if (this.lfs) {
  4948. // Git-lfs version
  4949. core.debug('Getting git-lfs version');
  4950. let gitLfsVersion = new git_version_1.GitVersion();
  4951. const gitLfsPath = yield io.which('git-lfs', true);
  4952. gitOutput = yield this.execGit(['lfs', 'version']);
  4953. stdout = gitOutput.stdout.trim();
  4954. if (!stdout.includes('\n')) {
  4955. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4956. if (match) {
  4957. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4958. }
  4959. }
  4960. if (!gitLfsVersion.isValid()) {
  4961. throw new Error('Unable to determine git-lfs version');
  4962. }
  4963. // Minimum git-lfs version
  4964. // Note:
  4965. // - Auth header not supported before 2.1
  4966. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4967. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4968. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4969. }
  4970. }
  4971. // Set the user agent
  4972. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4973. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4974. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4975. });
  4976. }
  4977. }
  4978. class GitOutput {
  4979. constructor() {
  4980. this.stdout = '';
  4981. this.exitCode = 0;
  4982. }
  4983. }
  4984. /***/ }),
  4985. /***/ 293:
  4986. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4987. "use strict";
  4988. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4989. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4990. return new (P || (P = Promise))(function (resolve, reject) {
  4991. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4992. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4993. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4994. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4995. });
  4996. };
  4997. var __importStar = (this && this.__importStar) || function (mod) {
  4998. if (mod && mod.__esModule) return mod;
  4999. var result = {};
  5000. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5001. result["default"] = mod;
  5002. return result;
  5003. };
  5004. Object.defineProperty(exports, "__esModule", { value: true });
  5005. const core = __importStar(__webpack_require__(470));
  5006. const fsHelper = __importStar(__webpack_require__(618));
  5007. const gitAuthHelper = __importStar(__webpack_require__(287));
  5008. const gitCommandManager = __importStar(__webpack_require__(289));
  5009. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  5010. const githubApiHelper = __importStar(__webpack_require__(464));
  5011. const io = __importStar(__webpack_require__(1));
  5012. const path = __importStar(__webpack_require__(622));
  5013. const refHelper = __importStar(__webpack_require__(227));
  5014. const stateHelper = __importStar(__webpack_require__(153));
  5015. const hostname = 'github.com';
  5016. function getSource(settings) {
  5017. return __awaiter(this, void 0, void 0, function* () {
  5018. // Repository URL
  5019. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  5020. const repositoryUrl = `https://${hostname}/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  5021. // Remove conflicting file path
  5022. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  5023. yield io.rmRF(settings.repositoryPath);
  5024. }
  5025. // Create directory
  5026. let isExisting = true;
  5027. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  5028. isExisting = false;
  5029. yield io.mkdirP(settings.repositoryPath);
  5030. }
  5031. // Git command manager
  5032. const git = yield getGitCommandManager(settings);
  5033. // Prepare existing directory, otherwise recreate
  5034. if (isExisting) {
  5035. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  5036. }
  5037. if (!git) {
  5038. // Downloading using REST API
  5039. core.info(`The repository will be downloaded using the GitHub REST API`);
  5040. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  5041. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  5042. return;
  5043. }
  5044. // Save state for POST action
  5045. stateHelper.setRepositoryPath(settings.repositoryPath);
  5046. // Initialize the repository
  5047. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  5048. yield git.init();
  5049. yield git.remoteAdd('origin', repositoryUrl);
  5050. }
  5051. // Disable automatic garbage collection
  5052. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  5053. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  5054. }
  5055. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  5056. try {
  5057. // Configure auth
  5058. yield authHelper.configureAuth();
  5059. // LFS install
  5060. if (settings.lfs) {
  5061. yield git.lfsInstall();
  5062. }
  5063. // Fetch
  5064. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  5065. yield git.fetch(settings.fetchDepth, refSpec);
  5066. // Checkout info
  5067. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  5068. // LFS fetch
  5069. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  5070. // Explicit lfs fetch will fetch lfs objects in parallel.
  5071. if (settings.lfs) {
  5072. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  5073. }
  5074. // Checkout
  5075. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  5076. // Submodules
  5077. if (settings.submodules) {
  5078. try {
  5079. // Temporarily override global config
  5080. yield authHelper.configureGlobalAuth();
  5081. // Checkout submodules
  5082. yield git.submoduleSync(settings.nestedSubmodules);
  5083. yield git.submoduleUpdate(settings.fetchDepth, settings.nestedSubmodules);
  5084. yield git.submoduleForeach('git config --local gc.auto 0', settings.nestedSubmodules);
  5085. // Persist credentials
  5086. if (settings.persistCredentials) {
  5087. yield authHelper.configureSubmoduleAuth();
  5088. }
  5089. }
  5090. finally {
  5091. // Remove temporary global config override
  5092. yield authHelper.removeGlobalAuth();
  5093. }
  5094. }
  5095. // Dump some info about the checked out commit
  5096. yield git.log1();
  5097. }
  5098. finally {
  5099. // Remove auth
  5100. if (!settings.persistCredentials) {
  5101. yield authHelper.removeAuth();
  5102. }
  5103. }
  5104. });
  5105. }
  5106. exports.getSource = getSource;
  5107. function cleanup(repositoryPath) {
  5108. return __awaiter(this, void 0, void 0, function* () {
  5109. // Repo exists?
  5110. if (!repositoryPath ||
  5111. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  5112. return;
  5113. }
  5114. let git;
  5115. try {
  5116. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  5117. }
  5118. catch (_a) {
  5119. return;
  5120. }
  5121. // Remove auth
  5122. const authHelper = gitAuthHelper.createAuthHelper(git);
  5123. yield authHelper.removeAuth();
  5124. });
  5125. }
  5126. exports.cleanup = cleanup;
  5127. function getGitCommandManager(settings) {
  5128. return __awaiter(this, void 0, void 0, function* () {
  5129. core.info(`Working directory is '${settings.repositoryPath}'`);
  5130. try {
  5131. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  5132. }
  5133. catch (err) {
  5134. // Git is required for LFS
  5135. if (settings.lfs) {
  5136. throw err;
  5137. }
  5138. // Otherwise fallback to REST API
  5139. return undefined;
  5140. }
  5141. });
  5142. }
  5143. /***/ }),
  5144. /***/ 294:
  5145. /***/ (function(module, __unusedexports, __webpack_require__) {
  5146. module.exports = parseOptions;
  5147. const { Deprecation } = __webpack_require__(692);
  5148. const { getUserAgent } = __webpack_require__(796);
  5149. const once = __webpack_require__(969);
  5150. const pkg = __webpack_require__(215);
  5151. const deprecateOptionsTimeout = once((log, deprecation) =>
  5152. log.warn(deprecation)
  5153. );
  5154. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  5155. const deprecateOptionsHeaders = once((log, deprecation) =>
  5156. log.warn(deprecation)
  5157. );
  5158. function parseOptions(options, log, hook) {
  5159. if (options.headers) {
  5160. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  5161. newObj[key.toLowerCase()] = options.headers[key];
  5162. return newObj;
  5163. }, {});
  5164. }
  5165. const clientDefaults = {
  5166. headers: options.headers || {},
  5167. request: options.request || {},
  5168. mediaType: {
  5169. previews: [],
  5170. format: ""
  5171. }
  5172. };
  5173. if (options.baseUrl) {
  5174. clientDefaults.baseUrl = options.baseUrl;
  5175. }
  5176. if (options.userAgent) {
  5177. clientDefaults.headers["user-agent"] = options.userAgent;
  5178. }
  5179. if (options.previews) {
  5180. clientDefaults.mediaType.previews = options.previews;
  5181. }
  5182. if (options.timeZone) {
  5183. clientDefaults.headers["time-zone"] = options.timeZone;
  5184. }
  5185. if (options.timeout) {
  5186. deprecateOptionsTimeout(
  5187. log,
  5188. new Deprecation(
  5189. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5190. )
  5191. );
  5192. clientDefaults.request.timeout = options.timeout;
  5193. }
  5194. if (options.agent) {
  5195. deprecateOptionsAgent(
  5196. log,
  5197. new Deprecation(
  5198. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5199. )
  5200. );
  5201. clientDefaults.request.agent = options.agent;
  5202. }
  5203. if (options.headers) {
  5204. deprecateOptionsHeaders(
  5205. log,
  5206. new Deprecation(
  5207. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5208. )
  5209. );
  5210. }
  5211. const userAgentOption = clientDefaults.headers["user-agent"];
  5212. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5213. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5214. .filter(Boolean)
  5215. .join(" ");
  5216. clientDefaults.request.hook = hook.bind(null, "request");
  5217. return clientDefaults;
  5218. }
  5219. /***/ }),
  5220. /***/ 297:
  5221. /***/ (function(module) {
  5222. module.exports = class HttpError extends Error {
  5223. constructor (message, code, headers) {
  5224. super(message)
  5225. // Maintains proper stack trace (only available on V8)
  5226. /* istanbul ignore next */
  5227. if (Error.captureStackTrace) {
  5228. Error.captureStackTrace(this, this.constructor)
  5229. }
  5230. this.name = 'HttpError'
  5231. this.code = code
  5232. this.headers = headers
  5233. }
  5234. }
  5235. /***/ }),
  5236. /***/ 301:
  5237. /***/ (function(module, __unusedexports, __webpack_require__) {
  5238. /**
  5239. * Some “list” response that can be paginated have a different response structure
  5240. *
  5241. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5242. * /installation/repositories also has `repository_selection`), as well as a key with
  5243. * the list of the items which name varies from endpoint to endpoint:
  5244. *
  5245. * - https://developer.github.com/v3/search/#example (key `items`)
  5246. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5247. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5248. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5249. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5250. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5251. *
  5252. * Octokit normalizes these responses so that paginated results are always returned following
  5253. * the same structure. One challenge is that if the list response has only one page, no Link
  5254. * header is provided, so this header alone is not sufficient to check wether a response is
  5255. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5256. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5257. * property because it also exists in the response of Get the combined status for a specific ref.
  5258. */
  5259. module.exports = normalizePaginatedListResponse;
  5260. const { Deprecation } = __webpack_require__(692);
  5261. const once = __webpack_require__(969);
  5262. const deprecateIncompleteResults = once((log, deprecation) =>
  5263. log.warn(deprecation)
  5264. );
  5265. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5266. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5267. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5268. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5269. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5270. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5271. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5272. function normalizePaginatedListResponse(octokit, url, response) {
  5273. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5274. if (
  5275. !REGEX_IS_SEARCH_PATH.test(path) &&
  5276. !REGEX_IS_CHECKS_PATH.test(path) &&
  5277. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5278. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5279. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5280. ) {
  5281. return;
  5282. }
  5283. // keep the additional properties intact to avoid a breaking change,
  5284. // but log a deprecation warning when accessed
  5285. const incompleteResults = response.data.incomplete_results;
  5286. const repositorySelection = response.data.repository_selection;
  5287. const totalCount = response.data.total_count;
  5288. delete response.data.incomplete_results;
  5289. delete response.data.repository_selection;
  5290. delete response.data.total_count;
  5291. const namespaceKey = Object.keys(response.data)[0];
  5292. response.data = response.data[namespaceKey];
  5293. Object.defineProperty(response.data, namespaceKey, {
  5294. get() {
  5295. deprecateNamespace(
  5296. octokit.log,
  5297. new Deprecation(
  5298. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5299. )
  5300. );
  5301. return response.data;
  5302. }
  5303. });
  5304. if (typeof incompleteResults !== "undefined") {
  5305. Object.defineProperty(response.data, "incomplete_results", {
  5306. get() {
  5307. deprecateIncompleteResults(
  5308. octokit.log,
  5309. new Deprecation(
  5310. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5311. )
  5312. );
  5313. return incompleteResults;
  5314. }
  5315. });
  5316. }
  5317. if (typeof repositorySelection !== "undefined") {
  5318. Object.defineProperty(response.data, "repository_selection", {
  5319. get() {
  5320. deprecateTotalCount(
  5321. octokit.log,
  5322. new Deprecation(
  5323. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5324. )
  5325. );
  5326. return repositorySelection;
  5327. }
  5328. });
  5329. }
  5330. Object.defineProperty(response.data, "total_count", {
  5331. get() {
  5332. deprecateTotalCount(
  5333. octokit.log,
  5334. new Deprecation(
  5335. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5336. )
  5337. );
  5338. return totalCount;
  5339. }
  5340. });
  5341. }
  5342. /***/ }),
  5343. /***/ 323:
  5344. /***/ (function(module) {
  5345. "use strict";
  5346. var isStream = module.exports = function (stream) {
  5347. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5348. };
  5349. isStream.writable = function (stream) {
  5350. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5351. };
  5352. isStream.readable = function (stream) {
  5353. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5354. };
  5355. isStream.duplex = function (stream) {
  5356. return isStream.writable(stream) && isStream.readable(stream);
  5357. };
  5358. isStream.transform = function (stream) {
  5359. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5360. };
  5361. /***/ }),
  5362. /***/ 335:
  5363. /***/ (function(module, __unusedexports, __webpack_require__) {
  5364. module.exports = __webpack_require__(179);
  5365. /***/ }),
  5366. /***/ 336:
  5367. /***/ (function(module, __unusedexports, __webpack_require__) {
  5368. module.exports = hasLastPage
  5369. const deprecate = __webpack_require__(370)
  5370. const getPageLinks = __webpack_require__(577)
  5371. function hasLastPage (link) {
  5372. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5373. return getPageLinks(link).last
  5374. }
  5375. /***/ }),
  5376. /***/ 348:
  5377. /***/ (function(module, __unusedexports, __webpack_require__) {
  5378. "use strict";
  5379. module.exports = validate;
  5380. const { RequestError } = __webpack_require__(463);
  5381. const get = __webpack_require__(854);
  5382. const set = __webpack_require__(883);
  5383. function validate(octokit, options) {
  5384. if (!options.request.validate) {
  5385. return;
  5386. }
  5387. const { validate: params } = options.request;
  5388. Object.keys(params).forEach(parameterName => {
  5389. const parameter = get(params, parameterName);
  5390. const expectedType = parameter.type;
  5391. let parentParameterName;
  5392. let parentValue;
  5393. let parentParamIsPresent = true;
  5394. let parentParameterIsArray = false;
  5395. if (/\./.test(parameterName)) {
  5396. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5397. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5398. if (parentParameterIsArray) {
  5399. parentParameterName = parentParameterName.slice(0, -2);
  5400. }
  5401. parentValue = get(options, parentParameterName);
  5402. parentParamIsPresent =
  5403. parentParameterName === "headers" ||
  5404. (typeof parentValue === "object" && parentValue !== null);
  5405. }
  5406. const values = parentParameterIsArray
  5407. ? (get(options, parentParameterName) || []).map(
  5408. value => value[parameterName.split(/\./).pop()]
  5409. )
  5410. : [get(options, parameterName)];
  5411. values.forEach((value, i) => {
  5412. const valueIsPresent = typeof value !== "undefined";
  5413. const valueIsNull = value === null;
  5414. const currentParameterName = parentParameterIsArray
  5415. ? parameterName.replace(/\[\]/, `[${i}]`)
  5416. : parameterName;
  5417. if (!parameter.required && !valueIsPresent) {
  5418. return;
  5419. }
  5420. // if the parent parameter is of type object but allows null
  5421. // then the child parameters can be ignored
  5422. if (!parentParamIsPresent) {
  5423. return;
  5424. }
  5425. if (parameter.allowNull && valueIsNull) {
  5426. return;
  5427. }
  5428. if (!parameter.allowNull && valueIsNull) {
  5429. throw new RequestError(
  5430. `'${currentParameterName}' cannot be null`,
  5431. 400,
  5432. {
  5433. request: options
  5434. }
  5435. );
  5436. }
  5437. if (parameter.required && !valueIsPresent) {
  5438. throw new RequestError(
  5439. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5440. value
  5441. )}`,
  5442. 400,
  5443. {
  5444. request: options
  5445. }
  5446. );
  5447. }
  5448. // parse to integer before checking for enum
  5449. // so that string "1" will match enum with number 1
  5450. if (expectedType === "integer") {
  5451. const unparsedValue = value;
  5452. value = parseInt(value, 10);
  5453. if (isNaN(value)) {
  5454. throw new RequestError(
  5455. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5456. unparsedValue
  5457. )} is NaN`,
  5458. 400,
  5459. {
  5460. request: options
  5461. }
  5462. );
  5463. }
  5464. }
  5465. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5466. throw new RequestError(
  5467. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5468. value
  5469. )}`,
  5470. 400,
  5471. {
  5472. request: options
  5473. }
  5474. );
  5475. }
  5476. if (parameter.validation) {
  5477. const regex = new RegExp(parameter.validation);
  5478. if (!regex.test(value)) {
  5479. throw new RequestError(
  5480. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5481. value
  5482. )}`,
  5483. 400,
  5484. {
  5485. request: options
  5486. }
  5487. );
  5488. }
  5489. }
  5490. if (expectedType === "object" && typeof value === "string") {
  5491. try {
  5492. value = JSON.parse(value);
  5493. } catch (exception) {
  5494. throw new RequestError(
  5495. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5496. value
  5497. )}`,
  5498. 400,
  5499. {
  5500. request: options
  5501. }
  5502. );
  5503. }
  5504. }
  5505. set(options, parameter.mapTo || currentParameterName, value);
  5506. });
  5507. });
  5508. return options;
  5509. }
  5510. /***/ }),
  5511. /***/ 349:
  5512. /***/ (function(module, __unusedexports, __webpack_require__) {
  5513. module.exports = authenticationRequestError;
  5514. const { RequestError } = __webpack_require__(463);
  5515. function authenticationRequestError(state, error, options) {
  5516. /* istanbul ignore next */
  5517. if (!error.headers) throw error;
  5518. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5519. // handle "2FA required" error only
  5520. if (error.status !== 401 || !otpRequired) {
  5521. throw error;
  5522. }
  5523. if (
  5524. error.status === 401 &&
  5525. otpRequired &&
  5526. error.request &&
  5527. error.request.headers["x-github-otp"]
  5528. ) {
  5529. throw new RequestError(
  5530. "Invalid one-time password for two-factor authentication",
  5531. 401,
  5532. {
  5533. headers: error.headers,
  5534. request: options
  5535. }
  5536. );
  5537. }
  5538. if (typeof state.auth.on2fa !== "function") {
  5539. throw new RequestError(
  5540. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5541. 401,
  5542. {
  5543. headers: error.headers,
  5544. request: options
  5545. }
  5546. );
  5547. }
  5548. return Promise.resolve()
  5549. .then(() => {
  5550. return state.auth.on2fa();
  5551. })
  5552. .then(oneTimePassword => {
  5553. const newOptions = Object.assign(options, {
  5554. headers: Object.assign(
  5555. { "x-github-otp": oneTimePassword },
  5556. options.headers
  5557. )
  5558. });
  5559. return state.octokit.request(newOptions);
  5560. });
  5561. }
  5562. /***/ }),
  5563. /***/ 357:
  5564. /***/ (function(module) {
  5565. module.exports = require("assert");
  5566. /***/ }),
  5567. /***/ 363:
  5568. /***/ (function(module) {
  5569. module.exports = register
  5570. function register (state, name, method, options) {
  5571. if (typeof method !== 'function') {
  5572. throw new Error('method for before hook must be a function')
  5573. }
  5574. if (!options) {
  5575. options = {}
  5576. }
  5577. if (Array.isArray(name)) {
  5578. return name.reverse().reduce(function (callback, name) {
  5579. return register.bind(null, state, name, callback, options)
  5580. }, method)()
  5581. }
  5582. return Promise.resolve()
  5583. .then(function () {
  5584. if (!state.registry[name]) {
  5585. return method(options)
  5586. }
  5587. return (state.registry[name]).reduce(function (method, registered) {
  5588. return registered.hook.bind(null, method, options)
  5589. }, method)()
  5590. })
  5591. }
  5592. /***/ }),
  5593. /***/ 368:
  5594. /***/ (function(module) {
  5595. module.exports = function atob(str) {
  5596. return Buffer.from(str, 'base64').toString('binary')
  5597. }
  5598. /***/ }),
  5599. /***/ 370:
  5600. /***/ (function(module) {
  5601. module.exports = deprecate
  5602. const loggedMessages = {}
  5603. function deprecate (message) {
  5604. if (loggedMessages[message]) {
  5605. return
  5606. }
  5607. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5608. loggedMessages[message] = 1
  5609. }
  5610. /***/ }),
  5611. /***/ 372:
  5612. /***/ (function(module) {
  5613. module.exports = octokitDebug;
  5614. function octokitDebug(octokit) {
  5615. octokit.hook.wrap("request", (request, options) => {
  5616. octokit.log.debug("request", options);
  5617. const start = Date.now();
  5618. const requestOptions = octokit.request.endpoint.parse(options);
  5619. const path = requestOptions.url.replace(options.baseUrl, "");
  5620. return request(options)
  5621. .then(response => {
  5622. octokit.log.info(
  5623. `${requestOptions.method} ${path} - ${
  5624. response.status
  5625. } in ${Date.now() - start}ms`
  5626. );
  5627. return response;
  5628. })
  5629. .catch(error => {
  5630. octokit.log.info(
  5631. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5632. start}ms`
  5633. );
  5634. throw error;
  5635. });
  5636. });
  5637. }
  5638. /***/ }),
  5639. /***/ 385:
  5640. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5641. "use strict";
  5642. Object.defineProperty(exports, '__esModule', { value: true });
  5643. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5644. var isPlainObject = _interopDefault(__webpack_require__(696));
  5645. var universalUserAgent = __webpack_require__(796);
  5646. function lowercaseKeys(object) {
  5647. if (!object) {
  5648. return {};
  5649. }
  5650. return Object.keys(object).reduce((newObj, key) => {
  5651. newObj[key.toLowerCase()] = object[key];
  5652. return newObj;
  5653. }, {});
  5654. }
  5655. function mergeDeep(defaults, options) {
  5656. const result = Object.assign({}, defaults);
  5657. Object.keys(options).forEach(key => {
  5658. if (isPlainObject(options[key])) {
  5659. if (!(key in defaults)) Object.assign(result, {
  5660. [key]: options[key]
  5661. });else result[key] = mergeDeep(defaults[key], options[key]);
  5662. } else {
  5663. Object.assign(result, {
  5664. [key]: options[key]
  5665. });
  5666. }
  5667. });
  5668. return result;
  5669. }
  5670. function merge(defaults, route, options) {
  5671. if (typeof route === "string") {
  5672. let [method, url] = route.split(" ");
  5673. options = Object.assign(url ? {
  5674. method,
  5675. url
  5676. } : {
  5677. url: method
  5678. }, options);
  5679. } else {
  5680. options = Object.assign({}, route);
  5681. } // lowercase header names before merging with defaults to avoid duplicates
  5682. options.headers = lowercaseKeys(options.headers);
  5683. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5684. if (defaults && defaults.mediaType.previews.length) {
  5685. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5686. }
  5687. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5688. return mergedOptions;
  5689. }
  5690. function addQueryParameters(url, parameters) {
  5691. const separator = /\?/.test(url) ? "&" : "?";
  5692. const names = Object.keys(parameters);
  5693. if (names.length === 0) {
  5694. return url;
  5695. }
  5696. return url + separator + names.map(name => {
  5697. if (name === "q") {
  5698. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5699. }
  5700. return `${name}=${encodeURIComponent(parameters[name])}`;
  5701. }).join("&");
  5702. }
  5703. const urlVariableRegex = /\{[^}]+\}/g;
  5704. function removeNonChars(variableName) {
  5705. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5706. }
  5707. function extractUrlVariableNames(url) {
  5708. const matches = url.match(urlVariableRegex);
  5709. if (!matches) {
  5710. return [];
  5711. }
  5712. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5713. }
  5714. function omit(object, keysToOmit) {
  5715. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5716. obj[key] = object[key];
  5717. return obj;
  5718. }, {});
  5719. }
  5720. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5721. // TODO: create separate package.
  5722. //
  5723. // Copyright (c) 2012-2014, Bram Stein
  5724. // All rights reserved.
  5725. // Redistribution and use in source and binary forms, with or without
  5726. // modification, are permitted provided that the following conditions
  5727. // are met:
  5728. // 1. Redistributions of source code must retain the above copyright
  5729. // notice, this list of conditions and the following disclaimer.
  5730. // 2. Redistributions in binary form must reproduce the above copyright
  5731. // notice, this list of conditions and the following disclaimer in the
  5732. // documentation and/or other materials provided with the distribution.
  5733. // 3. The name of the author may not be used to endorse or promote products
  5734. // derived from this software without specific prior written permission.
  5735. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5736. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5737. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5738. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5739. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5740. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5741. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5742. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5743. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5744. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5745. /* istanbul ignore file */
  5746. function encodeReserved(str) {
  5747. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5748. if (!/%[0-9A-Fa-f]/.test(part)) {
  5749. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5750. }
  5751. return part;
  5752. }).join("");
  5753. }
  5754. function encodeUnreserved(str) {
  5755. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5756. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5757. });
  5758. }
  5759. function encodeValue(operator, value, key) {
  5760. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5761. if (key) {
  5762. return encodeUnreserved(key) + "=" + value;
  5763. } else {
  5764. return value;
  5765. }
  5766. }
  5767. function isDefined(value) {
  5768. return value !== undefined && value !== null;
  5769. }
  5770. function isKeyOperator(operator) {
  5771. return operator === ";" || operator === "&" || operator === "?";
  5772. }
  5773. function getValues(context, operator, key, modifier) {
  5774. var value = context[key],
  5775. result = [];
  5776. if (isDefined(value) && value !== "") {
  5777. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5778. value = value.toString();
  5779. if (modifier && modifier !== "*") {
  5780. value = value.substring(0, parseInt(modifier, 10));
  5781. }
  5782. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5783. } else {
  5784. if (modifier === "*") {
  5785. if (Array.isArray(value)) {
  5786. value.filter(isDefined).forEach(function (value) {
  5787. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5788. });
  5789. } else {
  5790. Object.keys(value).forEach(function (k) {
  5791. if (isDefined(value[k])) {
  5792. result.push(encodeValue(operator, value[k], k));
  5793. }
  5794. });
  5795. }
  5796. } else {
  5797. const tmp = [];
  5798. if (Array.isArray(value)) {
  5799. value.filter(isDefined).forEach(function (value) {
  5800. tmp.push(encodeValue(operator, value));
  5801. });
  5802. } else {
  5803. Object.keys(value).forEach(function (k) {
  5804. if (isDefined(value[k])) {
  5805. tmp.push(encodeUnreserved(k));
  5806. tmp.push(encodeValue(operator, value[k].toString()));
  5807. }
  5808. });
  5809. }
  5810. if (isKeyOperator(operator)) {
  5811. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5812. } else if (tmp.length !== 0) {
  5813. result.push(tmp.join(","));
  5814. }
  5815. }
  5816. }
  5817. } else {
  5818. if (operator === ";") {
  5819. if (isDefined(value)) {
  5820. result.push(encodeUnreserved(key));
  5821. }
  5822. } else if (value === "" && (operator === "&" || operator === "?")) {
  5823. result.push(encodeUnreserved(key) + "=");
  5824. } else if (value === "") {
  5825. result.push("");
  5826. }
  5827. }
  5828. return result;
  5829. }
  5830. function parseUrl(template) {
  5831. return {
  5832. expand: expand.bind(null, template)
  5833. };
  5834. }
  5835. function expand(template, context) {
  5836. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5837. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5838. if (expression) {
  5839. let operator = "";
  5840. const values = [];
  5841. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5842. operator = expression.charAt(0);
  5843. expression = expression.substr(1);
  5844. }
  5845. expression.split(/,/g).forEach(function (variable) {
  5846. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5847. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5848. });
  5849. if (operator && operator !== "+") {
  5850. var separator = ",";
  5851. if (operator === "?") {
  5852. separator = "&";
  5853. } else if (operator !== "#") {
  5854. separator = operator;
  5855. }
  5856. return (values.length !== 0 ? operator : "") + values.join(separator);
  5857. } else {
  5858. return values.join(",");
  5859. }
  5860. } else {
  5861. return encodeReserved(literal);
  5862. }
  5863. });
  5864. }
  5865. function parse(options) {
  5866. // https://fetch.spec.whatwg.org/#methods
  5867. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5868. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5869. let headers = Object.assign({}, options.headers);
  5870. let body;
  5871. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5872. const urlVariableNames = extractUrlVariableNames(url);
  5873. url = parseUrl(url).expand(parameters);
  5874. if (!/^http/.test(url)) {
  5875. url = options.baseUrl + url;
  5876. }
  5877. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5878. const remainingParameters = omit(parameters, omittedParameters);
  5879. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5880. if (!isBinaryRequset) {
  5881. if (options.mediaType.format) {
  5882. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5883. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5884. }
  5885. if (options.mediaType.previews.length) {
  5886. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5887. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5888. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5889. return `application/vnd.github.${preview}-preview${format}`;
  5890. }).join(",");
  5891. }
  5892. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5893. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5894. if (["GET", "HEAD"].includes(method)) {
  5895. url = addQueryParameters(url, remainingParameters);
  5896. } else {
  5897. if ("data" in remainingParameters) {
  5898. body = remainingParameters.data;
  5899. } else {
  5900. if (Object.keys(remainingParameters).length) {
  5901. body = remainingParameters;
  5902. } else {
  5903. headers["content-length"] = 0;
  5904. }
  5905. }
  5906. } // default content-type for JSON if body is set
  5907. if (!headers["content-type"] && typeof body !== "undefined") {
  5908. headers["content-type"] = "application/json; charset=utf-8";
  5909. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5910. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5911. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5912. body = "";
  5913. } // Only return body/request keys if present
  5914. return Object.assign({
  5915. method,
  5916. url,
  5917. headers
  5918. }, typeof body !== "undefined" ? {
  5919. body
  5920. } : null, options.request ? {
  5921. request: options.request
  5922. } : null);
  5923. }
  5924. function endpointWithDefaults(defaults, route, options) {
  5925. return parse(merge(defaults, route, options));
  5926. }
  5927. function withDefaults(oldDefaults, newDefaults) {
  5928. const DEFAULTS = merge(oldDefaults, newDefaults);
  5929. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5930. return Object.assign(endpoint, {
  5931. DEFAULTS,
  5932. defaults: withDefaults.bind(null, DEFAULTS),
  5933. merge: merge.bind(null, DEFAULTS),
  5934. parse
  5935. });
  5936. }
  5937. const VERSION = "5.5.1";
  5938. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  5939. // So we use RequestParameters and add method as additional required property.
  5940. const DEFAULTS = {
  5941. method: "GET",
  5942. baseUrl: "https://api.github.com",
  5943. headers: {
  5944. accept: "application/vnd.github.v3+json",
  5945. "user-agent": userAgent
  5946. },
  5947. mediaType: {
  5948. format: "",
  5949. previews: []
  5950. }
  5951. };
  5952. const endpoint = withDefaults(null, DEFAULTS);
  5953. exports.endpoint = endpoint;
  5954. //# sourceMappingURL=index.js.map
  5955. /***/ }),
  5956. /***/ 389:
  5957. /***/ (function(module, __unusedexports, __webpack_require__) {
  5958. "use strict";
  5959. const fs = __webpack_require__(747);
  5960. const shebangCommand = __webpack_require__(866);
  5961. function readShebang(command) {
  5962. // Read the first 150 bytes from the file
  5963. const size = 150;
  5964. let buffer;
  5965. if (Buffer.alloc) {
  5966. // Node.js v4.5+ / v5.10+
  5967. buffer = Buffer.alloc(size);
  5968. } else {
  5969. // Old Node.js API
  5970. buffer = new Buffer(size);
  5971. buffer.fill(0); // zero-fill
  5972. }
  5973. let fd;
  5974. try {
  5975. fd = fs.openSync(command, 'r');
  5976. fs.readSync(fd, buffer, 0, size, 0);
  5977. fs.closeSync(fd);
  5978. } catch (e) { /* Empty */ }
  5979. // Attempt to extract shebang (null is returned if not a shebang)
  5980. return shebangCommand(buffer.toString());
  5981. }
  5982. module.exports = readShebang;
  5983. /***/ }),
  5984. /***/ 402:
  5985. /***/ (function(module, __unusedexports, __webpack_require__) {
  5986. module.exports = Octokit;
  5987. const { request } = __webpack_require__(753);
  5988. const Hook = __webpack_require__(523);
  5989. const parseClientOptions = __webpack_require__(294);
  5990. function Octokit(plugins, options) {
  5991. options = options || {};
  5992. const hook = new Hook.Collection();
  5993. const log = Object.assign(
  5994. {
  5995. debug: () => {},
  5996. info: () => {},
  5997. warn: console.warn,
  5998. error: console.error
  5999. },
  6000. options && options.log
  6001. );
  6002. const api = {
  6003. hook,
  6004. log,
  6005. request: request.defaults(parseClientOptions(options, log, hook))
  6006. };
  6007. plugins.forEach(pluginFunction => pluginFunction(api, options));
  6008. return api;
  6009. }
  6010. /***/ }),
  6011. /***/ 413:
  6012. /***/ (function(module) {
  6013. module.exports = require("stream");
  6014. /***/ }),
  6015. /***/ 417:
  6016. /***/ (function(module) {
  6017. module.exports = require("crypto");
  6018. /***/ }),
  6019. /***/ 427:
  6020. /***/ (function(module, __unusedexports, __webpack_require__) {
  6021. "use strict";
  6022. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  6023. // In that case, fall back to a deprecated internal.
  6024. const util = __webpack_require__(669);
  6025. let uv;
  6026. if (typeof util.getSystemErrorName === 'function') {
  6027. module.exports = util.getSystemErrorName;
  6028. } else {
  6029. try {
  6030. uv = process.binding('uv');
  6031. if (typeof uv.errname !== 'function') {
  6032. throw new TypeError('uv.errname is not a function');
  6033. }
  6034. } catch (err) {
  6035. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  6036. uv = null;
  6037. }
  6038. module.exports = code => errname(uv, code);
  6039. }
  6040. // Used for testing the fallback behavior
  6041. module.exports.__test__ = errname;
  6042. function errname(uv, code) {
  6043. if (uv) {
  6044. return uv.errname(code);
  6045. }
  6046. if (!(code < 0)) {
  6047. throw new Error('err >= 0');
  6048. }
  6049. return `Unknown system error ${code}`;
  6050. }
  6051. /***/ }),
  6052. /***/ 430:
  6053. /***/ (function(module, __unusedexports, __webpack_require__) {
  6054. module.exports = octokitValidate;
  6055. const validate = __webpack_require__(348);
  6056. function octokitValidate(octokit) {
  6057. octokit.hook.before("request", validate.bind(null, octokit));
  6058. }
  6059. /***/ }),
  6060. /***/ 431:
  6061. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6062. "use strict";
  6063. Object.defineProperty(exports, "__esModule", { value: true });
  6064. const os = __webpack_require__(87);
  6065. /**
  6066. * Commands
  6067. *
  6068. * Command Format:
  6069. * ##[name key=value;key=value]message
  6070. *
  6071. * Examples:
  6072. * ##[warning]This is the user warning message
  6073. * ##[set-secret name=mypassword]definitelyNotAPassword!
  6074. */
  6075. function issueCommand(command, properties, message) {
  6076. const cmd = new Command(command, properties, message);
  6077. process.stdout.write(cmd.toString() + os.EOL);
  6078. }
  6079. exports.issueCommand = issueCommand;
  6080. function issue(name, message = '') {
  6081. issueCommand(name, {}, message);
  6082. }
  6083. exports.issue = issue;
  6084. const CMD_STRING = '::';
  6085. class Command {
  6086. constructor(command, properties, message) {
  6087. if (!command) {
  6088. command = 'missing.command';
  6089. }
  6090. this.command = command;
  6091. this.properties = properties;
  6092. this.message = message;
  6093. }
  6094. toString() {
  6095. let cmdStr = CMD_STRING + this.command;
  6096. if (this.properties && Object.keys(this.properties).length > 0) {
  6097. cmdStr += ' ';
  6098. for (const key in this.properties) {
  6099. if (this.properties.hasOwnProperty(key)) {
  6100. const val = this.properties[key];
  6101. if (val) {
  6102. // safely append the val - avoid blowing up when attempting to
  6103. // call .replace() if message is not a string for some reason
  6104. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  6105. }
  6106. }
  6107. }
  6108. }
  6109. cmdStr += CMD_STRING;
  6110. // safely append the message - avoid blowing up when attempting to
  6111. // call .replace() if message is not a string for some reason
  6112. const message = `${this.message || ''}`;
  6113. cmdStr += escapeData(message);
  6114. return cmdStr;
  6115. }
  6116. }
  6117. function escapeData(s) {
  6118. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  6119. }
  6120. function escape(s) {
  6121. return s
  6122. .replace(/\r/g, '%0D')
  6123. .replace(/\n/g, '%0A')
  6124. .replace(/]/g, '%5D')
  6125. .replace(/;/g, '%3B');
  6126. }
  6127. //# sourceMappingURL=command.js.map
  6128. /***/ }),
  6129. /***/ 438:
  6130. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  6131. "use strict";
  6132. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  6133. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  6134. return new (P || (P = Promise))(function (resolve, reject) {
  6135. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  6136. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  6137. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  6138. step((generator = generator.apply(thisArg, _arguments || [])).next());
  6139. });
  6140. };
  6141. var __importStar = (this && this.__importStar) || function (mod) {
  6142. if (mod && mod.__esModule) return mod;
  6143. var result = {};
  6144. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  6145. result["default"] = mod;
  6146. return result;
  6147. };
  6148. Object.defineProperty(exports, "__esModule", { value: true });
  6149. const core = __importStar(__webpack_require__(470));
  6150. const fs = __importStar(__webpack_require__(747));
  6151. const fsHelper = __importStar(__webpack_require__(618));
  6152. const io = __importStar(__webpack_require__(1));
  6153. const path = __importStar(__webpack_require__(622));
  6154. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  6155. return __awaiter(this, void 0, void 0, function* () {
  6156. let remove = false;
  6157. // Check whether using git or REST API
  6158. if (!git) {
  6159. remove = true;
  6160. }
  6161. // Fetch URL does not match
  6162. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  6163. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  6164. remove = true;
  6165. }
  6166. else {
  6167. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  6168. const lockPaths = [
  6169. path.join(repositoryPath, '.git', 'index.lock'),
  6170. path.join(repositoryPath, '.git', 'shallow.lock')
  6171. ];
  6172. for (const lockPath of lockPaths) {
  6173. try {
  6174. yield io.rmRF(lockPath);
  6175. }
  6176. catch (error) {
  6177. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6178. }
  6179. }
  6180. try {
  6181. // Checkout detached HEAD
  6182. if (!(yield git.isDetached())) {
  6183. yield git.checkoutDetach();
  6184. }
  6185. // Remove all refs/heads/*
  6186. let branches = yield git.branchList(false);
  6187. for (const branch of branches) {
  6188. yield git.branchDelete(false, branch);
  6189. }
  6190. // Remove all refs/remotes/origin/* to avoid conflicts
  6191. branches = yield git.branchList(true);
  6192. for (const branch of branches) {
  6193. yield git.branchDelete(true, branch);
  6194. }
  6195. // Clean
  6196. if (clean) {
  6197. if (!(yield git.tryClean())) {
  6198. 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}'.`);
  6199. remove = true;
  6200. }
  6201. else if (!(yield git.tryReset())) {
  6202. remove = true;
  6203. }
  6204. if (remove) {
  6205. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6206. }
  6207. }
  6208. }
  6209. catch (error) {
  6210. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6211. remove = true;
  6212. }
  6213. }
  6214. if (remove) {
  6215. // Delete the contents of the directory. Don't delete the directory itself
  6216. // since it might be the current working directory.
  6217. core.info(`Deleting the contents of '${repositoryPath}'`);
  6218. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6219. yield io.rmRF(path.join(repositoryPath, file));
  6220. }
  6221. }
  6222. });
  6223. }
  6224. exports.prepareExistingDirectory = prepareExistingDirectory;
  6225. /***/ }),
  6226. /***/ 453:
  6227. /***/ (function(module, __unusedexports, __webpack_require__) {
  6228. var once = __webpack_require__(969)
  6229. var eos = __webpack_require__(562)
  6230. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6231. var noop = function () {}
  6232. var ancient = /^v?\.0/.test(process.version)
  6233. var isFn = function (fn) {
  6234. return typeof fn === 'function'
  6235. }
  6236. var isFS = function (stream) {
  6237. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6238. if (!fs) return false // browser
  6239. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6240. }
  6241. var isRequest = function (stream) {
  6242. return stream.setHeader && isFn(stream.abort)
  6243. }
  6244. var destroyer = function (stream, reading, writing, callback) {
  6245. callback = once(callback)
  6246. var closed = false
  6247. stream.on('close', function () {
  6248. closed = true
  6249. })
  6250. eos(stream, {readable: reading, writable: writing}, function (err) {
  6251. if (err) return callback(err)
  6252. closed = true
  6253. callback()
  6254. })
  6255. var destroyed = false
  6256. return function (err) {
  6257. if (closed) return
  6258. if (destroyed) return
  6259. destroyed = true
  6260. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6261. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6262. if (isFn(stream.destroy)) return stream.destroy()
  6263. callback(err || new Error('stream was destroyed'))
  6264. }
  6265. }
  6266. var call = function (fn) {
  6267. fn()
  6268. }
  6269. var pipe = function (from, to) {
  6270. return from.pipe(to)
  6271. }
  6272. var pump = function () {
  6273. var streams = Array.prototype.slice.call(arguments)
  6274. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6275. if (Array.isArray(streams[0])) streams = streams[0]
  6276. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6277. var error
  6278. var destroys = streams.map(function (stream, i) {
  6279. var reading = i < streams.length - 1
  6280. var writing = i > 0
  6281. return destroyer(stream, reading, writing, function (err) {
  6282. if (!error) error = err
  6283. if (err) destroys.forEach(call)
  6284. if (reading) return
  6285. destroys.forEach(call)
  6286. callback(error)
  6287. })
  6288. })
  6289. return streams.reduce(pipe)
  6290. }
  6291. module.exports = pump
  6292. /***/ }),
  6293. /***/ 454:
  6294. /***/ (function(module, exports, __webpack_require__) {
  6295. "use strict";
  6296. Object.defineProperty(exports, '__esModule', { value: true });
  6297. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6298. var Stream = _interopDefault(__webpack_require__(413));
  6299. var http = _interopDefault(__webpack_require__(605));
  6300. var Url = _interopDefault(__webpack_require__(835));
  6301. var https = _interopDefault(__webpack_require__(211));
  6302. var zlib = _interopDefault(__webpack_require__(761));
  6303. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6304. // fix for "Readable" isn't a named export issue
  6305. const Readable = Stream.Readable;
  6306. const BUFFER = Symbol('buffer');
  6307. const TYPE = Symbol('type');
  6308. class Blob {
  6309. constructor() {
  6310. this[TYPE] = '';
  6311. const blobParts = arguments[0];
  6312. const options = arguments[1];
  6313. const buffers = [];
  6314. let size = 0;
  6315. if (blobParts) {
  6316. const a = blobParts;
  6317. const length = Number(a.length);
  6318. for (let i = 0; i < length; i++) {
  6319. const element = a[i];
  6320. let buffer;
  6321. if (element instanceof Buffer) {
  6322. buffer = element;
  6323. } else if (ArrayBuffer.isView(element)) {
  6324. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6325. } else if (element instanceof ArrayBuffer) {
  6326. buffer = Buffer.from(element);
  6327. } else if (element instanceof Blob) {
  6328. buffer = element[BUFFER];
  6329. } else {
  6330. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6331. }
  6332. size += buffer.length;
  6333. buffers.push(buffer);
  6334. }
  6335. }
  6336. this[BUFFER] = Buffer.concat(buffers);
  6337. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6338. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6339. this[TYPE] = type;
  6340. }
  6341. }
  6342. get size() {
  6343. return this[BUFFER].length;
  6344. }
  6345. get type() {
  6346. return this[TYPE];
  6347. }
  6348. text() {
  6349. return Promise.resolve(this[BUFFER].toString());
  6350. }
  6351. arrayBuffer() {
  6352. const buf = this[BUFFER];
  6353. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6354. return Promise.resolve(ab);
  6355. }
  6356. stream() {
  6357. const readable = new Readable();
  6358. readable._read = function () {};
  6359. readable.push(this[BUFFER]);
  6360. readable.push(null);
  6361. return readable;
  6362. }
  6363. toString() {
  6364. return '[object Blob]';
  6365. }
  6366. slice() {
  6367. const size = this.size;
  6368. const start = arguments[0];
  6369. const end = arguments[1];
  6370. let relativeStart, relativeEnd;
  6371. if (start === undefined) {
  6372. relativeStart = 0;
  6373. } else if (start < 0) {
  6374. relativeStart = Math.max(size + start, 0);
  6375. } else {
  6376. relativeStart = Math.min(start, size);
  6377. }
  6378. if (end === undefined) {
  6379. relativeEnd = size;
  6380. } else if (end < 0) {
  6381. relativeEnd = Math.max(size + end, 0);
  6382. } else {
  6383. relativeEnd = Math.min(end, size);
  6384. }
  6385. const span = Math.max(relativeEnd - relativeStart, 0);
  6386. const buffer = this[BUFFER];
  6387. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6388. const blob = new Blob([], { type: arguments[2] });
  6389. blob[BUFFER] = slicedBuffer;
  6390. return blob;
  6391. }
  6392. }
  6393. Object.defineProperties(Blob.prototype, {
  6394. size: { enumerable: true },
  6395. type: { enumerable: true },
  6396. slice: { enumerable: true }
  6397. });
  6398. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6399. value: 'Blob',
  6400. writable: false,
  6401. enumerable: false,
  6402. configurable: true
  6403. });
  6404. /**
  6405. * fetch-error.js
  6406. *
  6407. * FetchError interface for operational errors
  6408. */
  6409. /**
  6410. * Create FetchError instance
  6411. *
  6412. * @param String message Error message for human
  6413. * @param String type Error type for machine
  6414. * @param String systemError For Node.js system error
  6415. * @return FetchError
  6416. */
  6417. function FetchError(message, type, systemError) {
  6418. Error.call(this, message);
  6419. this.message = message;
  6420. this.type = type;
  6421. // when err.type is `system`, err.code contains system error code
  6422. if (systemError) {
  6423. this.code = this.errno = systemError.code;
  6424. }
  6425. // hide custom error implementation details from end-users
  6426. Error.captureStackTrace(this, this.constructor);
  6427. }
  6428. FetchError.prototype = Object.create(Error.prototype);
  6429. FetchError.prototype.constructor = FetchError;
  6430. FetchError.prototype.name = 'FetchError';
  6431. let convert;
  6432. try {
  6433. convert = __webpack_require__(18).convert;
  6434. } catch (e) {}
  6435. const INTERNALS = Symbol('Body internals');
  6436. // fix an issue where "PassThrough" isn't a named export for node <10
  6437. const PassThrough = Stream.PassThrough;
  6438. /**
  6439. * Body mixin
  6440. *
  6441. * Ref: https://fetch.spec.whatwg.org/#body
  6442. *
  6443. * @param Stream body Readable stream
  6444. * @param Object opts Response options
  6445. * @return Void
  6446. */
  6447. function Body(body) {
  6448. var _this = this;
  6449. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6450. _ref$size = _ref.size;
  6451. let size = _ref$size === undefined ? 0 : _ref$size;
  6452. var _ref$timeout = _ref.timeout;
  6453. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6454. if (body == null) {
  6455. // body is undefined or null
  6456. body = null;
  6457. } else if (isURLSearchParams(body)) {
  6458. // body is a URLSearchParams
  6459. body = Buffer.from(body.toString());
  6460. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6461. // body is ArrayBuffer
  6462. body = Buffer.from(body);
  6463. } else if (ArrayBuffer.isView(body)) {
  6464. // body is ArrayBufferView
  6465. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6466. } else if (body instanceof Stream) ; else {
  6467. // none of the above
  6468. // coerce to string then buffer
  6469. body = Buffer.from(String(body));
  6470. }
  6471. this[INTERNALS] = {
  6472. body,
  6473. disturbed: false,
  6474. error: null
  6475. };
  6476. this.size = size;
  6477. this.timeout = timeout;
  6478. if (body instanceof Stream) {
  6479. body.on('error', function (err) {
  6480. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6481. _this[INTERNALS].error = error;
  6482. });
  6483. }
  6484. }
  6485. Body.prototype = {
  6486. get body() {
  6487. return this[INTERNALS].body;
  6488. },
  6489. get bodyUsed() {
  6490. return this[INTERNALS].disturbed;
  6491. },
  6492. /**
  6493. * Decode response as ArrayBuffer
  6494. *
  6495. * @return Promise
  6496. */
  6497. arrayBuffer() {
  6498. return consumeBody.call(this).then(function (buf) {
  6499. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6500. });
  6501. },
  6502. /**
  6503. * Return raw response as Blob
  6504. *
  6505. * @return Promise
  6506. */
  6507. blob() {
  6508. let ct = this.headers && this.headers.get('content-type') || '';
  6509. return consumeBody.call(this).then(function (buf) {
  6510. return Object.assign(
  6511. // Prevent copying
  6512. new Blob([], {
  6513. type: ct.toLowerCase()
  6514. }), {
  6515. [BUFFER]: buf
  6516. });
  6517. });
  6518. },
  6519. /**
  6520. * Decode response as json
  6521. *
  6522. * @return Promise
  6523. */
  6524. json() {
  6525. var _this2 = this;
  6526. return consumeBody.call(this).then(function (buffer) {
  6527. try {
  6528. return JSON.parse(buffer.toString());
  6529. } catch (err) {
  6530. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6531. }
  6532. });
  6533. },
  6534. /**
  6535. * Decode response as text
  6536. *
  6537. * @return Promise
  6538. */
  6539. text() {
  6540. return consumeBody.call(this).then(function (buffer) {
  6541. return buffer.toString();
  6542. });
  6543. },
  6544. /**
  6545. * Decode response as buffer (non-spec api)
  6546. *
  6547. * @return Promise
  6548. */
  6549. buffer() {
  6550. return consumeBody.call(this);
  6551. },
  6552. /**
  6553. * Decode response as text, while automatically detecting the encoding and
  6554. * trying to decode to UTF-8 (non-spec api)
  6555. *
  6556. * @return Promise
  6557. */
  6558. textConverted() {
  6559. var _this3 = this;
  6560. return consumeBody.call(this).then(function (buffer) {
  6561. return convertBody(buffer, _this3.headers);
  6562. });
  6563. }
  6564. };
  6565. // In browsers, all properties are enumerable.
  6566. Object.defineProperties(Body.prototype, {
  6567. body: { enumerable: true },
  6568. bodyUsed: { enumerable: true },
  6569. arrayBuffer: { enumerable: true },
  6570. blob: { enumerable: true },
  6571. json: { enumerable: true },
  6572. text: { enumerable: true }
  6573. });
  6574. Body.mixIn = function (proto) {
  6575. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6576. // istanbul ignore else: future proof
  6577. if (!(name in proto)) {
  6578. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6579. Object.defineProperty(proto, name, desc);
  6580. }
  6581. }
  6582. };
  6583. /**
  6584. * Consume and convert an entire Body to a Buffer.
  6585. *
  6586. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6587. *
  6588. * @return Promise
  6589. */
  6590. function consumeBody() {
  6591. var _this4 = this;
  6592. if (this[INTERNALS].disturbed) {
  6593. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6594. }
  6595. this[INTERNALS].disturbed = true;
  6596. if (this[INTERNALS].error) {
  6597. return Body.Promise.reject(this[INTERNALS].error);
  6598. }
  6599. let body = this.body;
  6600. // body is null
  6601. if (body === null) {
  6602. return Body.Promise.resolve(Buffer.alloc(0));
  6603. }
  6604. // body is blob
  6605. if (isBlob(body)) {
  6606. body = body.stream();
  6607. }
  6608. // body is buffer
  6609. if (Buffer.isBuffer(body)) {
  6610. return Body.Promise.resolve(body);
  6611. }
  6612. // istanbul ignore if: should never happen
  6613. if (!(body instanceof Stream)) {
  6614. return Body.Promise.resolve(Buffer.alloc(0));
  6615. }
  6616. // body is stream
  6617. // get ready to actually consume the body
  6618. let accum = [];
  6619. let accumBytes = 0;
  6620. let abort = false;
  6621. return new Body.Promise(function (resolve, reject) {
  6622. let resTimeout;
  6623. // allow timeout on slow response body
  6624. if (_this4.timeout) {
  6625. resTimeout = setTimeout(function () {
  6626. abort = true;
  6627. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6628. }, _this4.timeout);
  6629. }
  6630. // handle stream errors
  6631. body.on('error', function (err) {
  6632. if (err.name === 'AbortError') {
  6633. // if the request was aborted, reject with this Error
  6634. abort = true;
  6635. reject(err);
  6636. } else {
  6637. // other errors, such as incorrect content-encoding
  6638. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6639. }
  6640. });
  6641. body.on('data', function (chunk) {
  6642. if (abort || chunk === null) {
  6643. return;
  6644. }
  6645. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6646. abort = true;
  6647. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6648. return;
  6649. }
  6650. accumBytes += chunk.length;
  6651. accum.push(chunk);
  6652. });
  6653. body.on('end', function () {
  6654. if (abort) {
  6655. return;
  6656. }
  6657. clearTimeout(resTimeout);
  6658. try {
  6659. resolve(Buffer.concat(accum, accumBytes));
  6660. } catch (err) {
  6661. // handle streams that have accumulated too much data (issue #414)
  6662. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6663. }
  6664. });
  6665. });
  6666. }
  6667. /**
  6668. * Detect buffer encoding and convert to target encoding
  6669. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6670. *
  6671. * @param Buffer buffer Incoming buffer
  6672. * @param String encoding Target encoding
  6673. * @return String
  6674. */
  6675. function convertBody(buffer, headers) {
  6676. if (typeof convert !== 'function') {
  6677. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6678. }
  6679. const ct = headers.get('content-type');
  6680. let charset = 'utf-8';
  6681. let res, str;
  6682. // header
  6683. if (ct) {
  6684. res = /charset=([^;]*)/i.exec(ct);
  6685. }
  6686. // no charset in content type, peek at response body for at most 1024 bytes
  6687. str = buffer.slice(0, 1024).toString();
  6688. // html5
  6689. if (!res && str) {
  6690. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6691. }
  6692. // html4
  6693. if (!res && str) {
  6694. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6695. if (res) {
  6696. res = /charset=(.*)/i.exec(res.pop());
  6697. }
  6698. }
  6699. // xml
  6700. if (!res && str) {
  6701. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6702. }
  6703. // found charset
  6704. if (res) {
  6705. charset = res.pop();
  6706. // prevent decode issues when sites use incorrect encoding
  6707. // ref: https://hsivonen.fi/encoding-menu/
  6708. if (charset === 'gb2312' || charset === 'gbk') {
  6709. charset = 'gb18030';
  6710. }
  6711. }
  6712. // turn raw buffers into a single utf-8 buffer
  6713. return convert(buffer, 'UTF-8', charset).toString();
  6714. }
  6715. /**
  6716. * Detect a URLSearchParams object
  6717. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6718. *
  6719. * @param Object obj Object to detect by type or brand
  6720. * @return String
  6721. */
  6722. function isURLSearchParams(obj) {
  6723. // Duck-typing as a necessary condition.
  6724. 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') {
  6725. return false;
  6726. }
  6727. // Brand-checking and more duck-typing as optional condition.
  6728. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6729. }
  6730. /**
  6731. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6732. * @param {*} obj
  6733. * @return {boolean}
  6734. */
  6735. function isBlob(obj) {
  6736. 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]);
  6737. }
  6738. /**
  6739. * Clone body given Res/Req instance
  6740. *
  6741. * @param Mixed instance Response or Request instance
  6742. * @return Mixed
  6743. */
  6744. function clone(instance) {
  6745. let p1, p2;
  6746. let body = instance.body;
  6747. // don't allow cloning a used body
  6748. if (instance.bodyUsed) {
  6749. throw new Error('cannot clone body after it is used');
  6750. }
  6751. // check that body is a stream and not form-data object
  6752. // note: we can't clone the form-data object without having it as a dependency
  6753. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6754. // tee instance body
  6755. p1 = new PassThrough();
  6756. p2 = new PassThrough();
  6757. body.pipe(p1);
  6758. body.pipe(p2);
  6759. // set instance body to teed body and return the other teed body
  6760. instance[INTERNALS].body = p1;
  6761. body = p2;
  6762. }
  6763. return body;
  6764. }
  6765. /**
  6766. * Performs the operation "extract a `Content-Type` value from |object|" as
  6767. * specified in the specification:
  6768. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6769. *
  6770. * This function assumes that instance.body is present.
  6771. *
  6772. * @param Mixed instance Any options.body input
  6773. */
  6774. function extractContentType(body) {
  6775. if (body === null) {
  6776. // body is null
  6777. return null;
  6778. } else if (typeof body === 'string') {
  6779. // body is string
  6780. return 'text/plain;charset=UTF-8';
  6781. } else if (isURLSearchParams(body)) {
  6782. // body is a URLSearchParams
  6783. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6784. } else if (isBlob(body)) {
  6785. // body is blob
  6786. return body.type || null;
  6787. } else if (Buffer.isBuffer(body)) {
  6788. // body is buffer
  6789. return null;
  6790. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6791. // body is ArrayBuffer
  6792. return null;
  6793. } else if (ArrayBuffer.isView(body)) {
  6794. // body is ArrayBufferView
  6795. return null;
  6796. } else if (typeof body.getBoundary === 'function') {
  6797. // detect form data input from form-data module
  6798. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6799. } else if (body instanceof Stream) {
  6800. // body is stream
  6801. // can't really do much about this
  6802. return null;
  6803. } else {
  6804. // Body constructor defaults other things to string
  6805. return 'text/plain;charset=UTF-8';
  6806. }
  6807. }
  6808. /**
  6809. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6810. * For us, we have to explicitly get it with a function.
  6811. *
  6812. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6813. *
  6814. * @param Body instance Instance of Body
  6815. * @return Number? Number of bytes, or null if not possible
  6816. */
  6817. function getTotalBytes(instance) {
  6818. const body = instance.body;
  6819. if (body === null) {
  6820. // body is null
  6821. return 0;
  6822. } else if (isBlob(body)) {
  6823. return body.size;
  6824. } else if (Buffer.isBuffer(body)) {
  6825. // body is buffer
  6826. return body.length;
  6827. } else if (body && typeof body.getLengthSync === 'function') {
  6828. // detect form data input from form-data module
  6829. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6830. body.hasKnownLength && body.hasKnownLength()) {
  6831. // 2.x
  6832. return body.getLengthSync();
  6833. }
  6834. return null;
  6835. } else {
  6836. // body is stream
  6837. return null;
  6838. }
  6839. }
  6840. /**
  6841. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6842. *
  6843. * @param Body instance Instance of Body
  6844. * @return Void
  6845. */
  6846. function writeToStream(dest, instance) {
  6847. const body = instance.body;
  6848. if (body === null) {
  6849. // body is null
  6850. dest.end();
  6851. } else if (isBlob(body)) {
  6852. body.stream().pipe(dest);
  6853. } else if (Buffer.isBuffer(body)) {
  6854. // body is buffer
  6855. dest.write(body);
  6856. dest.end();
  6857. } else {
  6858. // body is stream
  6859. body.pipe(dest);
  6860. }
  6861. }
  6862. // expose Promise
  6863. Body.Promise = global.Promise;
  6864. /**
  6865. * headers.js
  6866. *
  6867. * Headers class offers convenient helpers
  6868. */
  6869. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6870. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6871. function validateName(name) {
  6872. name = `${name}`;
  6873. if (invalidTokenRegex.test(name) || name === '') {
  6874. throw new TypeError(`${name} is not a legal HTTP header name`);
  6875. }
  6876. }
  6877. function validateValue(value) {
  6878. value = `${value}`;
  6879. if (invalidHeaderCharRegex.test(value)) {
  6880. throw new TypeError(`${value} is not a legal HTTP header value`);
  6881. }
  6882. }
  6883. /**
  6884. * Find the key in the map object given a header name.
  6885. *
  6886. * Returns undefined if not found.
  6887. *
  6888. * @param String name Header name
  6889. * @return String|Undefined
  6890. */
  6891. function find(map, name) {
  6892. name = name.toLowerCase();
  6893. for (const key in map) {
  6894. if (key.toLowerCase() === name) {
  6895. return key;
  6896. }
  6897. }
  6898. return undefined;
  6899. }
  6900. const MAP = Symbol('map');
  6901. class Headers {
  6902. /**
  6903. * Headers class
  6904. *
  6905. * @param Object headers Response headers
  6906. * @return Void
  6907. */
  6908. constructor() {
  6909. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6910. this[MAP] = Object.create(null);
  6911. if (init instanceof Headers) {
  6912. const rawHeaders = init.raw();
  6913. const headerNames = Object.keys(rawHeaders);
  6914. for (const headerName of headerNames) {
  6915. for (const value of rawHeaders[headerName]) {
  6916. this.append(headerName, value);
  6917. }
  6918. }
  6919. return;
  6920. }
  6921. // We don't worry about converting prop to ByteString here as append()
  6922. // will handle it.
  6923. if (init == null) ; else if (typeof init === 'object') {
  6924. const method = init[Symbol.iterator];
  6925. if (method != null) {
  6926. if (typeof method !== 'function') {
  6927. throw new TypeError('Header pairs must be iterable');
  6928. }
  6929. // sequence<sequence<ByteString>>
  6930. // Note: per spec we have to first exhaust the lists then process them
  6931. const pairs = [];
  6932. for (const pair of init) {
  6933. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  6934. throw new TypeError('Each header pair must be iterable');
  6935. }
  6936. pairs.push(Array.from(pair));
  6937. }
  6938. for (const pair of pairs) {
  6939. if (pair.length !== 2) {
  6940. throw new TypeError('Each header pair must be a name/value tuple');
  6941. }
  6942. this.append(pair[0], pair[1]);
  6943. }
  6944. } else {
  6945. // record<ByteString, ByteString>
  6946. for (const key of Object.keys(init)) {
  6947. const value = init[key];
  6948. this.append(key, value);
  6949. }
  6950. }
  6951. } else {
  6952. throw new TypeError('Provided initializer must be an object');
  6953. }
  6954. }
  6955. /**
  6956. * Return combined header value given name
  6957. *
  6958. * @param String name Header name
  6959. * @return Mixed
  6960. */
  6961. get(name) {
  6962. name = `${name}`;
  6963. validateName(name);
  6964. const key = find(this[MAP], name);
  6965. if (key === undefined) {
  6966. return null;
  6967. }
  6968. return this[MAP][key].join(', ');
  6969. }
  6970. /**
  6971. * Iterate over all headers
  6972. *
  6973. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  6974. * @param Boolean thisArg `this` context for callback function
  6975. * @return Void
  6976. */
  6977. forEach(callback) {
  6978. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  6979. let pairs = getHeaders(this);
  6980. let i = 0;
  6981. while (i < pairs.length) {
  6982. var _pairs$i = pairs[i];
  6983. const name = _pairs$i[0],
  6984. value = _pairs$i[1];
  6985. callback.call(thisArg, value, name, this);
  6986. pairs = getHeaders(this);
  6987. i++;
  6988. }
  6989. }
  6990. /**
  6991. * Overwrite header values given name
  6992. *
  6993. * @param String name Header name
  6994. * @param String value Header value
  6995. * @return Void
  6996. */
  6997. set(name, value) {
  6998. name = `${name}`;
  6999. value = `${value}`;
  7000. validateName(name);
  7001. validateValue(value);
  7002. const key = find(this[MAP], name);
  7003. this[MAP][key !== undefined ? key : name] = [value];
  7004. }
  7005. /**
  7006. * Append a value onto existing header
  7007. *
  7008. * @param String name Header name
  7009. * @param String value Header value
  7010. * @return Void
  7011. */
  7012. append(name, value) {
  7013. name = `${name}`;
  7014. value = `${value}`;
  7015. validateName(name);
  7016. validateValue(value);
  7017. const key = find(this[MAP], name);
  7018. if (key !== undefined) {
  7019. this[MAP][key].push(value);
  7020. } else {
  7021. this[MAP][name] = [value];
  7022. }
  7023. }
  7024. /**
  7025. * Check for header name existence
  7026. *
  7027. * @param String name Header name
  7028. * @return Boolean
  7029. */
  7030. has(name) {
  7031. name = `${name}`;
  7032. validateName(name);
  7033. return find(this[MAP], name) !== undefined;
  7034. }
  7035. /**
  7036. * Delete all header values given name
  7037. *
  7038. * @param String name Header name
  7039. * @return Void
  7040. */
  7041. delete(name) {
  7042. name = `${name}`;
  7043. validateName(name);
  7044. const key = find(this[MAP], name);
  7045. if (key !== undefined) {
  7046. delete this[MAP][key];
  7047. }
  7048. }
  7049. /**
  7050. * Return raw headers (non-spec api)
  7051. *
  7052. * @return Object
  7053. */
  7054. raw() {
  7055. return this[MAP];
  7056. }
  7057. /**
  7058. * Get an iterator on keys.
  7059. *
  7060. * @return Iterator
  7061. */
  7062. keys() {
  7063. return createHeadersIterator(this, 'key');
  7064. }
  7065. /**
  7066. * Get an iterator on values.
  7067. *
  7068. * @return Iterator
  7069. */
  7070. values() {
  7071. return createHeadersIterator(this, 'value');
  7072. }
  7073. /**
  7074. * Get an iterator on entries.
  7075. *
  7076. * This is the default iterator of the Headers object.
  7077. *
  7078. * @return Iterator
  7079. */
  7080. [Symbol.iterator]() {
  7081. return createHeadersIterator(this, 'key+value');
  7082. }
  7083. }
  7084. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  7085. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  7086. value: 'Headers',
  7087. writable: false,
  7088. enumerable: false,
  7089. configurable: true
  7090. });
  7091. Object.defineProperties(Headers.prototype, {
  7092. get: { enumerable: true },
  7093. forEach: { enumerable: true },
  7094. set: { enumerable: true },
  7095. append: { enumerable: true },
  7096. has: { enumerable: true },
  7097. delete: { enumerable: true },
  7098. keys: { enumerable: true },
  7099. values: { enumerable: true },
  7100. entries: { enumerable: true }
  7101. });
  7102. function getHeaders(headers) {
  7103. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  7104. const keys = Object.keys(headers[MAP]).sort();
  7105. return keys.map(kind === 'key' ? function (k) {
  7106. return k.toLowerCase();
  7107. } : kind === 'value' ? function (k) {
  7108. return headers[MAP][k].join(', ');
  7109. } : function (k) {
  7110. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  7111. });
  7112. }
  7113. const INTERNAL = Symbol('internal');
  7114. function createHeadersIterator(target, kind) {
  7115. const iterator = Object.create(HeadersIteratorPrototype);
  7116. iterator[INTERNAL] = {
  7117. target,
  7118. kind,
  7119. index: 0
  7120. };
  7121. return iterator;
  7122. }
  7123. const HeadersIteratorPrototype = Object.setPrototypeOf({
  7124. next() {
  7125. // istanbul ignore if
  7126. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  7127. throw new TypeError('Value of `this` is not a HeadersIterator');
  7128. }
  7129. var _INTERNAL = this[INTERNAL];
  7130. const target = _INTERNAL.target,
  7131. kind = _INTERNAL.kind,
  7132. index = _INTERNAL.index;
  7133. const values = getHeaders(target, kind);
  7134. const len = values.length;
  7135. if (index >= len) {
  7136. return {
  7137. value: undefined,
  7138. done: true
  7139. };
  7140. }
  7141. this[INTERNAL].index = index + 1;
  7142. return {
  7143. value: values[index],
  7144. done: false
  7145. };
  7146. }
  7147. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  7148. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  7149. value: 'HeadersIterator',
  7150. writable: false,
  7151. enumerable: false,
  7152. configurable: true
  7153. });
  7154. /**
  7155. * Export the Headers object in a form that Node.js can consume.
  7156. *
  7157. * @param Headers headers
  7158. * @return Object
  7159. */
  7160. function exportNodeCompatibleHeaders(headers) {
  7161. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  7162. // http.request() only supports string as Host header. This hack makes
  7163. // specifying custom Host header possible.
  7164. const hostHeaderKey = find(headers[MAP], 'Host');
  7165. if (hostHeaderKey !== undefined) {
  7166. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  7167. }
  7168. return obj;
  7169. }
  7170. /**
  7171. * Create a Headers object from an object of headers, ignoring those that do
  7172. * not conform to HTTP grammar productions.
  7173. *
  7174. * @param Object obj Object of headers
  7175. * @return Headers
  7176. */
  7177. function createHeadersLenient(obj) {
  7178. const headers = new Headers();
  7179. for (const name of Object.keys(obj)) {
  7180. if (invalidTokenRegex.test(name)) {
  7181. continue;
  7182. }
  7183. if (Array.isArray(obj[name])) {
  7184. for (const val of obj[name]) {
  7185. if (invalidHeaderCharRegex.test(val)) {
  7186. continue;
  7187. }
  7188. if (headers[MAP][name] === undefined) {
  7189. headers[MAP][name] = [val];
  7190. } else {
  7191. headers[MAP][name].push(val);
  7192. }
  7193. }
  7194. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7195. headers[MAP][name] = [obj[name]];
  7196. }
  7197. }
  7198. return headers;
  7199. }
  7200. const INTERNALS$1 = Symbol('Response internals');
  7201. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7202. const STATUS_CODES = http.STATUS_CODES;
  7203. /**
  7204. * Response class
  7205. *
  7206. * @param Stream body Readable stream
  7207. * @param Object opts Response options
  7208. * @return Void
  7209. */
  7210. class Response {
  7211. constructor() {
  7212. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7213. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7214. Body.call(this, body, opts);
  7215. const status = opts.status || 200;
  7216. const headers = new Headers(opts.headers);
  7217. if (body != null && !headers.has('Content-Type')) {
  7218. const contentType = extractContentType(body);
  7219. if (contentType) {
  7220. headers.append('Content-Type', contentType);
  7221. }
  7222. }
  7223. this[INTERNALS$1] = {
  7224. url: opts.url,
  7225. status,
  7226. statusText: opts.statusText || STATUS_CODES[status],
  7227. headers,
  7228. counter: opts.counter
  7229. };
  7230. }
  7231. get url() {
  7232. return this[INTERNALS$1].url || '';
  7233. }
  7234. get status() {
  7235. return this[INTERNALS$1].status;
  7236. }
  7237. /**
  7238. * Convenience property representing if the request ended normally
  7239. */
  7240. get ok() {
  7241. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7242. }
  7243. get redirected() {
  7244. return this[INTERNALS$1].counter > 0;
  7245. }
  7246. get statusText() {
  7247. return this[INTERNALS$1].statusText;
  7248. }
  7249. get headers() {
  7250. return this[INTERNALS$1].headers;
  7251. }
  7252. /**
  7253. * Clone this response
  7254. *
  7255. * @return Response
  7256. */
  7257. clone() {
  7258. return new Response(clone(this), {
  7259. url: this.url,
  7260. status: this.status,
  7261. statusText: this.statusText,
  7262. headers: this.headers,
  7263. ok: this.ok,
  7264. redirected: this.redirected
  7265. });
  7266. }
  7267. }
  7268. Body.mixIn(Response.prototype);
  7269. Object.defineProperties(Response.prototype, {
  7270. url: { enumerable: true },
  7271. status: { enumerable: true },
  7272. ok: { enumerable: true },
  7273. redirected: { enumerable: true },
  7274. statusText: { enumerable: true },
  7275. headers: { enumerable: true },
  7276. clone: { enumerable: true }
  7277. });
  7278. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7279. value: 'Response',
  7280. writable: false,
  7281. enumerable: false,
  7282. configurable: true
  7283. });
  7284. const INTERNALS$2 = Symbol('Request internals');
  7285. // fix an issue where "format", "parse" aren't a named export for node <10
  7286. const parse_url = Url.parse;
  7287. const format_url = Url.format;
  7288. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7289. /**
  7290. * Check if a value is an instance of Request.
  7291. *
  7292. * @param Mixed input
  7293. * @return Boolean
  7294. */
  7295. function isRequest(input) {
  7296. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7297. }
  7298. function isAbortSignal(signal) {
  7299. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7300. return !!(proto && proto.constructor.name === 'AbortSignal');
  7301. }
  7302. /**
  7303. * Request class
  7304. *
  7305. * @param Mixed input Url or Request instance
  7306. * @param Object init Custom options
  7307. * @return Void
  7308. */
  7309. class Request {
  7310. constructor(input) {
  7311. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7312. let parsedURL;
  7313. // normalize input
  7314. if (!isRequest(input)) {
  7315. if (input && input.href) {
  7316. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7317. // will fall into this branch also (since their `toString()` will return
  7318. // `href` property anyway)
  7319. parsedURL = parse_url(input.href);
  7320. } else {
  7321. // coerce input to a string before attempting to parse
  7322. parsedURL = parse_url(`${input}`);
  7323. }
  7324. input = {};
  7325. } else {
  7326. parsedURL = parse_url(input.url);
  7327. }
  7328. let method = init.method || input.method || 'GET';
  7329. method = method.toUpperCase();
  7330. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7331. throw new TypeError('Request with GET/HEAD method cannot have body');
  7332. }
  7333. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7334. Body.call(this, inputBody, {
  7335. timeout: init.timeout || input.timeout || 0,
  7336. size: init.size || input.size || 0
  7337. });
  7338. const headers = new Headers(init.headers || input.headers || {});
  7339. if (inputBody != null && !headers.has('Content-Type')) {
  7340. const contentType = extractContentType(inputBody);
  7341. if (contentType) {
  7342. headers.append('Content-Type', contentType);
  7343. }
  7344. }
  7345. let signal = isRequest(input) ? input.signal : null;
  7346. if ('signal' in init) signal = init.signal;
  7347. if (signal != null && !isAbortSignal(signal)) {
  7348. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7349. }
  7350. this[INTERNALS$2] = {
  7351. method,
  7352. redirect: init.redirect || input.redirect || 'follow',
  7353. headers,
  7354. parsedURL,
  7355. signal
  7356. };
  7357. // node-fetch-only options
  7358. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7359. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7360. this.counter = init.counter || input.counter || 0;
  7361. this.agent = init.agent || input.agent;
  7362. }
  7363. get method() {
  7364. return this[INTERNALS$2].method;
  7365. }
  7366. get url() {
  7367. return format_url(this[INTERNALS$2].parsedURL);
  7368. }
  7369. get headers() {
  7370. return this[INTERNALS$2].headers;
  7371. }
  7372. get redirect() {
  7373. return this[INTERNALS$2].redirect;
  7374. }
  7375. get signal() {
  7376. return this[INTERNALS$2].signal;
  7377. }
  7378. /**
  7379. * Clone this request
  7380. *
  7381. * @return Request
  7382. */
  7383. clone() {
  7384. return new Request(this);
  7385. }
  7386. }
  7387. Body.mixIn(Request.prototype);
  7388. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7389. value: 'Request',
  7390. writable: false,
  7391. enumerable: false,
  7392. configurable: true
  7393. });
  7394. Object.defineProperties(Request.prototype, {
  7395. method: { enumerable: true },
  7396. url: { enumerable: true },
  7397. headers: { enumerable: true },
  7398. redirect: { enumerable: true },
  7399. clone: { enumerable: true },
  7400. signal: { enumerable: true }
  7401. });
  7402. /**
  7403. * Convert a Request to Node.js http request options.
  7404. *
  7405. * @param Request A Request instance
  7406. * @return Object The options object to be passed to http.request
  7407. */
  7408. function getNodeRequestOptions(request) {
  7409. const parsedURL = request[INTERNALS$2].parsedURL;
  7410. const headers = new Headers(request[INTERNALS$2].headers);
  7411. // fetch step 1.3
  7412. if (!headers.has('Accept')) {
  7413. headers.set('Accept', '*/*');
  7414. }
  7415. // Basic fetch
  7416. if (!parsedURL.protocol || !parsedURL.hostname) {
  7417. throw new TypeError('Only absolute URLs are supported');
  7418. }
  7419. if (!/^https?:$/.test(parsedURL.protocol)) {
  7420. throw new TypeError('Only HTTP(S) protocols are supported');
  7421. }
  7422. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7423. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7424. }
  7425. // HTTP-network-or-cache fetch steps 2.4-2.7
  7426. let contentLengthValue = null;
  7427. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7428. contentLengthValue = '0';
  7429. }
  7430. if (request.body != null) {
  7431. const totalBytes = getTotalBytes(request);
  7432. if (typeof totalBytes === 'number') {
  7433. contentLengthValue = String(totalBytes);
  7434. }
  7435. }
  7436. if (contentLengthValue) {
  7437. headers.set('Content-Length', contentLengthValue);
  7438. }
  7439. // HTTP-network-or-cache fetch step 2.11
  7440. if (!headers.has('User-Agent')) {
  7441. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7442. }
  7443. // HTTP-network-or-cache fetch step 2.15
  7444. if (request.compress && !headers.has('Accept-Encoding')) {
  7445. headers.set('Accept-Encoding', 'gzip,deflate');
  7446. }
  7447. let agent = request.agent;
  7448. if (typeof agent === 'function') {
  7449. agent = agent(parsedURL);
  7450. }
  7451. if (!headers.has('Connection') && !agent) {
  7452. headers.set('Connection', 'close');
  7453. }
  7454. // HTTP-network fetch step 4.2
  7455. // chunked encoding is handled by Node.js
  7456. return Object.assign({}, parsedURL, {
  7457. method: request.method,
  7458. headers: exportNodeCompatibleHeaders(headers),
  7459. agent
  7460. });
  7461. }
  7462. /**
  7463. * abort-error.js
  7464. *
  7465. * AbortError interface for cancelled requests
  7466. */
  7467. /**
  7468. * Create AbortError instance
  7469. *
  7470. * @param String message Error message for human
  7471. * @return AbortError
  7472. */
  7473. function AbortError(message) {
  7474. Error.call(this, message);
  7475. this.type = 'aborted';
  7476. this.message = message;
  7477. // hide custom error implementation details from end-users
  7478. Error.captureStackTrace(this, this.constructor);
  7479. }
  7480. AbortError.prototype = Object.create(Error.prototype);
  7481. AbortError.prototype.constructor = AbortError;
  7482. AbortError.prototype.name = 'AbortError';
  7483. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7484. const PassThrough$1 = Stream.PassThrough;
  7485. const resolve_url = Url.resolve;
  7486. /**
  7487. * Fetch function
  7488. *
  7489. * @param Mixed url Absolute url or Request instance
  7490. * @param Object opts Fetch options
  7491. * @return Promise
  7492. */
  7493. function fetch(url, opts) {
  7494. // allow custom promise
  7495. if (!fetch.Promise) {
  7496. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7497. }
  7498. Body.Promise = fetch.Promise;
  7499. // wrap http.request into fetch
  7500. return new fetch.Promise(function (resolve, reject) {
  7501. // build request object
  7502. const request = new Request(url, opts);
  7503. const options = getNodeRequestOptions(request);
  7504. const send = (options.protocol === 'https:' ? https : http).request;
  7505. const signal = request.signal;
  7506. let response = null;
  7507. const abort = function abort() {
  7508. let error = new AbortError('The user aborted a request.');
  7509. reject(error);
  7510. if (request.body && request.body instanceof Stream.Readable) {
  7511. request.body.destroy(error);
  7512. }
  7513. if (!response || !response.body) return;
  7514. response.body.emit('error', error);
  7515. };
  7516. if (signal && signal.aborted) {
  7517. abort();
  7518. return;
  7519. }
  7520. const abortAndFinalize = function abortAndFinalize() {
  7521. abort();
  7522. finalize();
  7523. };
  7524. // send request
  7525. const req = send(options);
  7526. let reqTimeout;
  7527. if (signal) {
  7528. signal.addEventListener('abort', abortAndFinalize);
  7529. }
  7530. function finalize() {
  7531. req.abort();
  7532. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7533. clearTimeout(reqTimeout);
  7534. }
  7535. if (request.timeout) {
  7536. req.once('socket', function (socket) {
  7537. reqTimeout = setTimeout(function () {
  7538. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7539. finalize();
  7540. }, request.timeout);
  7541. });
  7542. }
  7543. req.on('error', function (err) {
  7544. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7545. finalize();
  7546. });
  7547. req.on('response', function (res) {
  7548. clearTimeout(reqTimeout);
  7549. const headers = createHeadersLenient(res.headers);
  7550. // HTTP fetch step 5
  7551. if (fetch.isRedirect(res.statusCode)) {
  7552. // HTTP fetch step 5.2
  7553. const location = headers.get('Location');
  7554. // HTTP fetch step 5.3
  7555. const locationURL = location === null ? null : resolve_url(request.url, location);
  7556. // HTTP fetch step 5.5
  7557. switch (request.redirect) {
  7558. case 'error':
  7559. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7560. finalize();
  7561. return;
  7562. case 'manual':
  7563. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7564. if (locationURL !== null) {
  7565. // handle corrupted header
  7566. try {
  7567. headers.set('Location', locationURL);
  7568. } catch (err) {
  7569. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7570. reject(err);
  7571. }
  7572. }
  7573. break;
  7574. case 'follow':
  7575. // HTTP-redirect fetch step 2
  7576. if (locationURL === null) {
  7577. break;
  7578. }
  7579. // HTTP-redirect fetch step 5
  7580. if (request.counter >= request.follow) {
  7581. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7582. finalize();
  7583. return;
  7584. }
  7585. // HTTP-redirect fetch step 6 (counter increment)
  7586. // Create a new Request object.
  7587. const requestOpts = {
  7588. headers: new Headers(request.headers),
  7589. follow: request.follow,
  7590. counter: request.counter + 1,
  7591. agent: request.agent,
  7592. compress: request.compress,
  7593. method: request.method,
  7594. body: request.body,
  7595. signal: request.signal,
  7596. timeout: request.timeout
  7597. };
  7598. // HTTP-redirect fetch step 9
  7599. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7600. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7601. finalize();
  7602. return;
  7603. }
  7604. // HTTP-redirect fetch step 11
  7605. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7606. requestOpts.method = 'GET';
  7607. requestOpts.body = undefined;
  7608. requestOpts.headers.delete('content-length');
  7609. }
  7610. // HTTP-redirect fetch step 15
  7611. resolve(fetch(new Request(locationURL, requestOpts)));
  7612. finalize();
  7613. return;
  7614. }
  7615. }
  7616. // prepare response
  7617. res.once('end', function () {
  7618. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7619. });
  7620. let body = res.pipe(new PassThrough$1());
  7621. const response_options = {
  7622. url: request.url,
  7623. status: res.statusCode,
  7624. statusText: res.statusMessage,
  7625. headers: headers,
  7626. size: request.size,
  7627. timeout: request.timeout,
  7628. counter: request.counter
  7629. };
  7630. // HTTP-network fetch step 12.1.1.3
  7631. const codings = headers.get('Content-Encoding');
  7632. // HTTP-network fetch step 12.1.1.4: handle content codings
  7633. // in following scenarios we ignore compression support
  7634. // 1. compression support is disabled
  7635. // 2. HEAD request
  7636. // 3. no Content-Encoding header
  7637. // 4. no content response (204)
  7638. // 5. content not modified response (304)
  7639. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7640. response = new Response(body, response_options);
  7641. resolve(response);
  7642. return;
  7643. }
  7644. // For Node v6+
  7645. // Be less strict when decoding compressed responses, since sometimes
  7646. // servers send slightly invalid responses that are still accepted
  7647. // by common browsers.
  7648. // Always using Z_SYNC_FLUSH is what cURL does.
  7649. const zlibOptions = {
  7650. flush: zlib.Z_SYNC_FLUSH,
  7651. finishFlush: zlib.Z_SYNC_FLUSH
  7652. };
  7653. // for gzip
  7654. if (codings == 'gzip' || codings == 'x-gzip') {
  7655. body = body.pipe(zlib.createGunzip(zlibOptions));
  7656. response = new Response(body, response_options);
  7657. resolve(response);
  7658. return;
  7659. }
  7660. // for deflate
  7661. if (codings == 'deflate' || codings == 'x-deflate') {
  7662. // handle the infamous raw deflate response from old servers
  7663. // a hack for old IIS and Apache servers
  7664. const raw = res.pipe(new PassThrough$1());
  7665. raw.once('data', function (chunk) {
  7666. // see http://stackoverflow.com/questions/37519828
  7667. if ((chunk[0] & 0x0F) === 0x08) {
  7668. body = body.pipe(zlib.createInflate());
  7669. } else {
  7670. body = body.pipe(zlib.createInflateRaw());
  7671. }
  7672. response = new Response(body, response_options);
  7673. resolve(response);
  7674. });
  7675. return;
  7676. }
  7677. // for br
  7678. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7679. body = body.pipe(zlib.createBrotliDecompress());
  7680. response = new Response(body, response_options);
  7681. resolve(response);
  7682. return;
  7683. }
  7684. // otherwise, use response as-is
  7685. response = new Response(body, response_options);
  7686. resolve(response);
  7687. });
  7688. writeToStream(req, request);
  7689. });
  7690. }
  7691. /**
  7692. * Redirect code matching
  7693. *
  7694. * @param Number code Status code
  7695. * @return Boolean
  7696. */
  7697. fetch.isRedirect = function (code) {
  7698. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7699. };
  7700. // expose Promise
  7701. fetch.Promise = global.Promise;
  7702. module.exports = exports = fetch;
  7703. Object.defineProperty(exports, "__esModule", { value: true });
  7704. exports.default = exports;
  7705. exports.Headers = Headers;
  7706. exports.Request = Request;
  7707. exports.Response = Response;
  7708. exports.FetchError = FetchError;
  7709. /***/ }),
  7710. /***/ 462:
  7711. /***/ (function(module) {
  7712. "use strict";
  7713. // See http://www.robvanderwoude.com/escapechars.php
  7714. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7715. function escapeCommand(arg) {
  7716. // Escape meta chars
  7717. arg = arg.replace(metaCharsRegExp, '^$1');
  7718. return arg;
  7719. }
  7720. function escapeArgument(arg, doubleEscapeMetaChars) {
  7721. // Convert to string
  7722. arg = `${arg}`;
  7723. // Algorithm below is based on https://qntm.org/cmd
  7724. // Sequence of backslashes followed by a double quote:
  7725. // double up all the backslashes and escape the double quote
  7726. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7727. // Sequence of backslashes followed by the end of the string
  7728. // (which will become a double quote later):
  7729. // double up all the backslashes
  7730. arg = arg.replace(/(\\*)$/, '$1$1');
  7731. // All other backslashes occur literally
  7732. // Quote the whole thing:
  7733. arg = `"${arg}"`;
  7734. // Escape meta chars
  7735. arg = arg.replace(metaCharsRegExp, '^$1');
  7736. // Double escape meta chars if necessary
  7737. if (doubleEscapeMetaChars) {
  7738. arg = arg.replace(metaCharsRegExp, '^$1');
  7739. }
  7740. return arg;
  7741. }
  7742. module.exports.command = escapeCommand;
  7743. module.exports.argument = escapeArgument;
  7744. /***/ }),
  7745. /***/ 463:
  7746. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7747. "use strict";
  7748. Object.defineProperty(exports, '__esModule', { value: true });
  7749. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7750. var deprecation = __webpack_require__(692);
  7751. var once = _interopDefault(__webpack_require__(969));
  7752. const logOnce = once(deprecation => console.warn(deprecation));
  7753. /**
  7754. * Error with extra properties to help with debugging
  7755. */
  7756. class RequestError extends Error {
  7757. constructor(message, statusCode, options) {
  7758. super(message); // Maintains proper stack trace (only available on V8)
  7759. /* istanbul ignore next */
  7760. if (Error.captureStackTrace) {
  7761. Error.captureStackTrace(this, this.constructor);
  7762. }
  7763. this.name = "HttpError";
  7764. this.status = statusCode;
  7765. Object.defineProperty(this, "code", {
  7766. get() {
  7767. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7768. return statusCode;
  7769. }
  7770. });
  7771. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7772. const requestCopy = Object.assign({}, options.request);
  7773. if (options.request.headers.authorization) {
  7774. requestCopy.headers = Object.assign({}, options.request.headers, {
  7775. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7776. });
  7777. }
  7778. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7779. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7780. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7781. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7782. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7783. this.request = requestCopy;
  7784. }
  7785. }
  7786. exports.RequestError = RequestError;
  7787. //# sourceMappingURL=index.js.map
  7788. /***/ }),
  7789. /***/ 464:
  7790. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7791. "use strict";
  7792. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7793. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7794. return new (P || (P = Promise))(function (resolve, reject) {
  7795. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7796. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7797. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7798. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7799. });
  7800. };
  7801. var __importStar = (this && this.__importStar) || function (mod) {
  7802. if (mod && mod.__esModule) return mod;
  7803. var result = {};
  7804. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7805. result["default"] = mod;
  7806. return result;
  7807. };
  7808. var __importDefault = (this && this.__importDefault) || function (mod) {
  7809. return (mod && mod.__esModule) ? mod : { "default": mod };
  7810. };
  7811. Object.defineProperty(exports, "__esModule", { value: true });
  7812. const assert = __importStar(__webpack_require__(357));
  7813. const core = __importStar(__webpack_require__(470));
  7814. const fs = __importStar(__webpack_require__(747));
  7815. const github = __importStar(__webpack_require__(469));
  7816. const io = __importStar(__webpack_require__(1));
  7817. const path = __importStar(__webpack_require__(622));
  7818. const retryHelper = __importStar(__webpack_require__(587));
  7819. const toolCache = __importStar(__webpack_require__(533));
  7820. const v4_1 = __importDefault(__webpack_require__(826));
  7821. const IS_WINDOWS = process.platform === 'win32';
  7822. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  7823. return __awaiter(this, void 0, void 0, function* () {
  7824. // Download the archive
  7825. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7826. core.info('Downloading the archive');
  7827. return yield downloadArchive(authToken, owner, repo, ref, commit);
  7828. }));
  7829. // Write archive to disk
  7830. core.info('Writing archive to disk');
  7831. const uniqueId = v4_1.default();
  7832. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  7833. yield fs.promises.writeFile(archivePath, archiveData);
  7834. archiveData = Buffer.from(''); // Free memory
  7835. // Extract archive
  7836. core.info('Extracting the archive');
  7837. const extractPath = path.join(repositoryPath, uniqueId);
  7838. yield io.mkdirP(extractPath);
  7839. if (IS_WINDOWS) {
  7840. yield toolCache.extractZip(archivePath, extractPath);
  7841. }
  7842. else {
  7843. yield toolCache.extractTar(archivePath, extractPath);
  7844. }
  7845. io.rmRF(archivePath);
  7846. // Determine the path of the repository content. The archive contains
  7847. // a top-level folder and the repository content is inside.
  7848. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7849. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7850. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  7851. core.info(`Resolved version ${archiveVersion}`);
  7852. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  7853. // Move the files
  7854. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  7855. const sourcePath = path.join(tempRepositoryPath, fileName);
  7856. const targetPath = path.join(repositoryPath, fileName);
  7857. if (IS_WINDOWS) {
  7858. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  7859. }
  7860. else {
  7861. yield io.mv(sourcePath, targetPath);
  7862. }
  7863. }
  7864. io.rmRF(extractPath);
  7865. });
  7866. }
  7867. exports.downloadRepository = downloadRepository;
  7868. function downloadArchive(authToken, owner, repo, ref, commit) {
  7869. return __awaiter(this, void 0, void 0, function* () {
  7870. const octokit = new github.GitHub(authToken);
  7871. const params = {
  7872. owner: owner,
  7873. repo: repo,
  7874. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7875. ref: commit || ref
  7876. };
  7877. const response = yield octokit.repos.getArchiveLink(params);
  7878. if (response.status != 200) {
  7879. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  7880. }
  7881. return Buffer.from(response.data); // response.data is ArrayBuffer
  7882. });
  7883. }
  7884. /***/ }),
  7885. /***/ 469:
  7886. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7887. "use strict";
  7888. var __importDefault = (this && this.__importDefault) || function (mod) {
  7889. return (mod && mod.__esModule) ? mod : { "default": mod };
  7890. };
  7891. var __importStar = (this && this.__importStar) || function (mod) {
  7892. if (mod && mod.__esModule) return mod;
  7893. var result = {};
  7894. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7895. result["default"] = mod;
  7896. return result;
  7897. };
  7898. Object.defineProperty(exports, "__esModule", { value: true });
  7899. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7900. const graphql_1 = __webpack_require__(898);
  7901. const rest_1 = __importDefault(__webpack_require__(0));
  7902. const Context = __importStar(__webpack_require__(262));
  7903. const httpClient = __importStar(__webpack_require__(539));
  7904. // We need this in order to extend Octokit
  7905. rest_1.default.prototype = new rest_1.default();
  7906. exports.context = new Context.Context();
  7907. class GitHub extends rest_1.default {
  7908. constructor(token, opts) {
  7909. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  7910. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  7911. }
  7912. /**
  7913. * Disambiguates the constructor overload parameters
  7914. */
  7915. static disambiguate(token, opts) {
  7916. return [
  7917. typeof token === 'string' ? token : '',
  7918. typeof token === 'object' ? token : opts || {}
  7919. ];
  7920. }
  7921. static getOctokitOptions(args) {
  7922. const token = args[0];
  7923. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  7924. // Auth
  7925. const auth = GitHub.getAuthString(token, options);
  7926. if (auth) {
  7927. options.auth = auth;
  7928. }
  7929. // Proxy
  7930. const agent = GitHub.getProxyAgent(options);
  7931. if (agent) {
  7932. // Shallow clone - don't mutate the object provided by the caller
  7933. options.request = options.request ? Object.assign({}, options.request) : {};
  7934. // Set the agent
  7935. options.request.agent = agent;
  7936. }
  7937. return options;
  7938. }
  7939. static getGraphQL(args) {
  7940. const defaults = {};
  7941. const token = args[0];
  7942. const options = args[1];
  7943. // Authorization
  7944. const auth = this.getAuthString(token, options);
  7945. if (auth) {
  7946. defaults.headers = {
  7947. authorization: auth
  7948. };
  7949. }
  7950. // Proxy
  7951. const agent = GitHub.getProxyAgent(options);
  7952. if (agent) {
  7953. defaults.request = { agent };
  7954. }
  7955. return graphql_1.graphql.defaults(defaults);
  7956. }
  7957. static getAuthString(token, options) {
  7958. // Validate args
  7959. if (!token && !options.auth) {
  7960. throw new Error('Parameter token or opts.auth is required');
  7961. }
  7962. else if (token && options.auth) {
  7963. throw new Error('Parameters token and opts.auth may not both be specified');
  7964. }
  7965. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  7966. }
  7967. static getProxyAgent(options) {
  7968. var _a;
  7969. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  7970. const serverUrl = 'https://api.github.com';
  7971. if (httpClient.getProxyUrl(serverUrl)) {
  7972. const hc = new httpClient.HttpClient();
  7973. return hc.getAgent(serverUrl);
  7974. }
  7975. }
  7976. return undefined;
  7977. }
  7978. }
  7979. exports.GitHub = GitHub;
  7980. //# sourceMappingURL=github.js.map
  7981. /***/ }),
  7982. /***/ 470:
  7983. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7984. "use strict";
  7985. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7986. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7987. return new (P || (P = Promise))(function (resolve, reject) {
  7988. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7989. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7990. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7991. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7992. });
  7993. };
  7994. Object.defineProperty(exports, "__esModule", { value: true });
  7995. const command_1 = __webpack_require__(431);
  7996. const os = __webpack_require__(87);
  7997. const path = __webpack_require__(622);
  7998. /**
  7999. * The code to exit an action
  8000. */
  8001. var ExitCode;
  8002. (function (ExitCode) {
  8003. /**
  8004. * A code indicating that the action was successful
  8005. */
  8006. ExitCode[ExitCode["Success"] = 0] = "Success";
  8007. /**
  8008. * A code indicating that the action was a failure
  8009. */
  8010. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  8011. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  8012. //-----------------------------------------------------------------------
  8013. // Variables
  8014. //-----------------------------------------------------------------------
  8015. /**
  8016. * Sets env variable for this action and future actions in the job
  8017. * @param name the name of the variable to set
  8018. * @param val the value of the variable
  8019. */
  8020. function exportVariable(name, val) {
  8021. process.env[name] = val;
  8022. command_1.issueCommand('set-env', { name }, val);
  8023. }
  8024. exports.exportVariable = exportVariable;
  8025. /**
  8026. * Registers a secret which will get masked from logs
  8027. * @param secret value of the secret
  8028. */
  8029. function setSecret(secret) {
  8030. command_1.issueCommand('add-mask', {}, secret);
  8031. }
  8032. exports.setSecret = setSecret;
  8033. /**
  8034. * Prepends inputPath to the PATH (for this action and future actions)
  8035. * @param inputPath
  8036. */
  8037. function addPath(inputPath) {
  8038. command_1.issueCommand('add-path', {}, inputPath);
  8039. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  8040. }
  8041. exports.addPath = addPath;
  8042. /**
  8043. * Gets the value of an input. The value is also trimmed.
  8044. *
  8045. * @param name name of the input to get
  8046. * @param options optional. See InputOptions.
  8047. * @returns string
  8048. */
  8049. function getInput(name, options) {
  8050. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  8051. if (options && options.required && !val) {
  8052. throw new Error(`Input required and not supplied: ${name}`);
  8053. }
  8054. return val.trim();
  8055. }
  8056. exports.getInput = getInput;
  8057. /**
  8058. * Sets the value of an output.
  8059. *
  8060. * @param name name of the output to set
  8061. * @param value value to store
  8062. */
  8063. function setOutput(name, value) {
  8064. command_1.issueCommand('set-output', { name }, value);
  8065. }
  8066. exports.setOutput = setOutput;
  8067. //-----------------------------------------------------------------------
  8068. // Results
  8069. //-----------------------------------------------------------------------
  8070. /**
  8071. * Sets the action status to failed.
  8072. * When the action exits it will be with an exit code of 1
  8073. * @param message add error issue message
  8074. */
  8075. function setFailed(message) {
  8076. process.exitCode = ExitCode.Failure;
  8077. error(message);
  8078. }
  8079. exports.setFailed = setFailed;
  8080. //-----------------------------------------------------------------------
  8081. // Logging Commands
  8082. //-----------------------------------------------------------------------
  8083. /**
  8084. * Writes debug message to user log
  8085. * @param message debug message
  8086. */
  8087. function debug(message) {
  8088. command_1.issueCommand('debug', {}, message);
  8089. }
  8090. exports.debug = debug;
  8091. /**
  8092. * Adds an error issue
  8093. * @param message error issue message
  8094. */
  8095. function error(message) {
  8096. command_1.issue('error', message);
  8097. }
  8098. exports.error = error;
  8099. /**
  8100. * Adds an warning issue
  8101. * @param message warning issue message
  8102. */
  8103. function warning(message) {
  8104. command_1.issue('warning', message);
  8105. }
  8106. exports.warning = warning;
  8107. /**
  8108. * Writes info to log with console.log.
  8109. * @param message info message
  8110. */
  8111. function info(message) {
  8112. process.stdout.write(message + os.EOL);
  8113. }
  8114. exports.info = info;
  8115. /**
  8116. * Begin an output group.
  8117. *
  8118. * Output until the next `groupEnd` will be foldable in this group
  8119. *
  8120. * @param name The name of the output group
  8121. */
  8122. function startGroup(name) {
  8123. command_1.issue('group', name);
  8124. }
  8125. exports.startGroup = startGroup;
  8126. /**
  8127. * End an output group.
  8128. */
  8129. function endGroup() {
  8130. command_1.issue('endgroup');
  8131. }
  8132. exports.endGroup = endGroup;
  8133. /**
  8134. * Wrap an asynchronous function call in a group.
  8135. *
  8136. * Returns the same type as the function itself.
  8137. *
  8138. * @param name The name of the group
  8139. * @param fn The function to wrap in the group
  8140. */
  8141. function group(name, fn) {
  8142. return __awaiter(this, void 0, void 0, function* () {
  8143. startGroup(name);
  8144. let result;
  8145. try {
  8146. result = yield fn();
  8147. }
  8148. finally {
  8149. endGroup();
  8150. }
  8151. return result;
  8152. });
  8153. }
  8154. exports.group = group;
  8155. //# sourceMappingURL=core.js.map
  8156. /***/ }),
  8157. /***/ 471:
  8158. /***/ (function(module, __unusedexports, __webpack_require__) {
  8159. module.exports = authenticationBeforeRequest;
  8160. const btoa = __webpack_require__(675);
  8161. const uniq = __webpack_require__(126);
  8162. function authenticationBeforeRequest(state, options) {
  8163. if (!state.auth.type) {
  8164. return;
  8165. }
  8166. if (state.auth.type === "basic") {
  8167. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  8168. options.headers.authorization = `Basic ${hash}`;
  8169. return;
  8170. }
  8171. if (state.auth.type === "token") {
  8172. options.headers.authorization = `token ${state.auth.token}`;
  8173. return;
  8174. }
  8175. if (state.auth.type === "app") {
  8176. options.headers.authorization = `Bearer ${state.auth.token}`;
  8177. const acceptHeaders = options.headers.accept
  8178. .split(",")
  8179. .concat("application/vnd.github.machine-man-preview+json");
  8180. options.headers.accept = uniq(acceptHeaders)
  8181. .filter(Boolean)
  8182. .join(",");
  8183. return;
  8184. }
  8185. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8186. if (state.auth.token) {
  8187. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8188. return;
  8189. }
  8190. const key = encodeURIComponent(state.auth.key);
  8191. const secret = encodeURIComponent(state.auth.secret);
  8192. options.url += `client_id=${key}&client_secret=${secret}`;
  8193. }
  8194. /***/ }),
  8195. /***/ 489:
  8196. /***/ (function(module, __unusedexports, __webpack_require__) {
  8197. "use strict";
  8198. const path = __webpack_require__(622);
  8199. const which = __webpack_require__(814);
  8200. const pathKey = __webpack_require__(39)();
  8201. function resolveCommandAttempt(parsed, withoutPathExt) {
  8202. const cwd = process.cwd();
  8203. const hasCustomCwd = parsed.options.cwd != null;
  8204. // If a custom `cwd` was specified, we need to change the process cwd
  8205. // because `which` will do stat calls but does not support a custom cwd
  8206. if (hasCustomCwd) {
  8207. try {
  8208. process.chdir(parsed.options.cwd);
  8209. } catch (err) {
  8210. /* Empty */
  8211. }
  8212. }
  8213. let resolved;
  8214. try {
  8215. resolved = which.sync(parsed.command, {
  8216. path: (parsed.options.env || process.env)[pathKey],
  8217. pathExt: withoutPathExt ? path.delimiter : undefined,
  8218. });
  8219. } catch (e) {
  8220. /* Empty */
  8221. } finally {
  8222. process.chdir(cwd);
  8223. }
  8224. // If we successfully resolved, ensure that an absolute path is returned
  8225. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8226. if (resolved) {
  8227. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8228. }
  8229. return resolved;
  8230. }
  8231. function resolveCommand(parsed) {
  8232. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8233. }
  8234. module.exports = resolveCommand;
  8235. /***/ }),
  8236. /***/ 510:
  8237. /***/ (function(module) {
  8238. module.exports = addHook
  8239. function addHook (state, kind, name, hook) {
  8240. var orig = hook
  8241. if (!state.registry[name]) {
  8242. state.registry[name] = []
  8243. }
  8244. if (kind === 'before') {
  8245. hook = function (method, options) {
  8246. return Promise.resolve()
  8247. .then(orig.bind(null, options))
  8248. .then(method.bind(null, options))
  8249. }
  8250. }
  8251. if (kind === 'after') {
  8252. hook = function (method, options) {
  8253. var result
  8254. return Promise.resolve()
  8255. .then(method.bind(null, options))
  8256. .then(function (result_) {
  8257. result = result_
  8258. return orig(result, options)
  8259. })
  8260. .then(function () {
  8261. return result
  8262. })
  8263. }
  8264. }
  8265. if (kind === 'error') {
  8266. hook = function (method, options) {
  8267. return Promise.resolve()
  8268. .then(method.bind(null, options))
  8269. .catch(function (error) {
  8270. return orig(error, options)
  8271. })
  8272. }
  8273. }
  8274. state.registry[name].push({
  8275. hook: hook,
  8276. orig: orig
  8277. })
  8278. }
  8279. /***/ }),
  8280. /***/ 523:
  8281. /***/ (function(module, __unusedexports, __webpack_require__) {
  8282. var register = __webpack_require__(363)
  8283. var addHook = __webpack_require__(510)
  8284. var removeHook = __webpack_require__(763)
  8285. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8286. var bind = Function.bind
  8287. var bindable = bind.bind(bind)
  8288. function bindApi (hook, state, name) {
  8289. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8290. hook.api = { remove: removeHookRef }
  8291. hook.remove = removeHookRef
  8292. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8293. var args = name ? [state, kind, name] : [state, kind]
  8294. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8295. })
  8296. }
  8297. function HookSingular () {
  8298. var singularHookName = 'h'
  8299. var singularHookState = {
  8300. registry: {}
  8301. }
  8302. var singularHook = register.bind(null, singularHookState, singularHookName)
  8303. bindApi(singularHook, singularHookState, singularHookName)
  8304. return singularHook
  8305. }
  8306. function HookCollection () {
  8307. var state = {
  8308. registry: {}
  8309. }
  8310. var hook = register.bind(null, state)
  8311. bindApi(hook, state)
  8312. return hook
  8313. }
  8314. var collectionHookDeprecationMessageDisplayed = false
  8315. function Hook () {
  8316. if (!collectionHookDeprecationMessageDisplayed) {
  8317. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8318. collectionHookDeprecationMessageDisplayed = true
  8319. }
  8320. return HookCollection()
  8321. }
  8322. Hook.Singular = HookSingular.bind()
  8323. Hook.Collection = HookCollection.bind()
  8324. module.exports = Hook
  8325. // expose constructors as a named property for TypeScript
  8326. module.exports.Hook = Hook
  8327. module.exports.Singular = Hook.Singular
  8328. module.exports.Collection = Hook.Collection
  8329. /***/ }),
  8330. /***/ 528:
  8331. /***/ (function(__unusedmodule, exports) {
  8332. "use strict";
  8333. Object.defineProperty(exports, "__esModule", { value: true });
  8334. function escape(value) {
  8335. return value.replace(/[^a-zA-Z0-9_]/g, x => {
  8336. return `\\${x}`;
  8337. });
  8338. }
  8339. exports.escape = escape;
  8340. /***/ }),
  8341. /***/ 529:
  8342. /***/ (function(module, __unusedexports, __webpack_require__) {
  8343. const factory = __webpack_require__(47);
  8344. module.exports = factory();
  8345. /***/ }),
  8346. /***/ 533:
  8347. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8348. "use strict";
  8349. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8350. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8351. return new (P || (P = Promise))(function (resolve, reject) {
  8352. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8353. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8354. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8355. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8356. });
  8357. };
  8358. Object.defineProperty(exports, "__esModule", { value: true });
  8359. const core = __webpack_require__(470);
  8360. const io = __webpack_require__(1);
  8361. const fs = __webpack_require__(747);
  8362. const os = __webpack_require__(87);
  8363. const path = __webpack_require__(622);
  8364. const httpm = __webpack_require__(874);
  8365. const semver = __webpack_require__(656);
  8366. const uuidV4 = __webpack_require__(826);
  8367. const exec_1 = __webpack_require__(986);
  8368. const assert_1 = __webpack_require__(357);
  8369. class HTTPError extends Error {
  8370. constructor(httpStatusCode) {
  8371. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8372. this.httpStatusCode = httpStatusCode;
  8373. Object.setPrototypeOf(this, new.target.prototype);
  8374. }
  8375. }
  8376. exports.HTTPError = HTTPError;
  8377. const IS_WINDOWS = process.platform === 'win32';
  8378. const userAgent = 'actions/tool-cache';
  8379. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8380. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8381. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8382. // If directories not found, place them in common temp locations
  8383. if (!tempDirectory || !cacheRoot) {
  8384. let baseLocation;
  8385. if (IS_WINDOWS) {
  8386. // On windows use the USERPROFILE env variable
  8387. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8388. }
  8389. else {
  8390. if (process.platform === 'darwin') {
  8391. baseLocation = '/Users';
  8392. }
  8393. else {
  8394. baseLocation = '/home';
  8395. }
  8396. }
  8397. if (!tempDirectory) {
  8398. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8399. }
  8400. if (!cacheRoot) {
  8401. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8402. }
  8403. }
  8404. /**
  8405. * Download a tool from an url and stream it into a file
  8406. *
  8407. * @param url url of tool to download
  8408. * @returns path to downloaded tool
  8409. */
  8410. function downloadTool(url) {
  8411. return __awaiter(this, void 0, void 0, function* () {
  8412. // Wrap in a promise so that we can resolve from within stream callbacks
  8413. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8414. try {
  8415. const http = new httpm.HttpClient(userAgent, [], {
  8416. allowRetries: true,
  8417. maxRetries: 3
  8418. });
  8419. const destPath = path.join(tempDirectory, uuidV4());
  8420. yield io.mkdirP(tempDirectory);
  8421. core.debug(`Downloading ${url}`);
  8422. core.debug(`Downloading ${destPath}`);
  8423. if (fs.existsSync(destPath)) {
  8424. throw new Error(`Destination file path ${destPath} already exists`);
  8425. }
  8426. const response = yield http.get(url);
  8427. if (response.message.statusCode !== 200) {
  8428. const err = new HTTPError(response.message.statusCode);
  8429. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8430. throw err;
  8431. }
  8432. const file = fs.createWriteStream(destPath);
  8433. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8434. try {
  8435. const stream = response.message.pipe(file);
  8436. stream.on('close', () => {
  8437. core.debug('download complete');
  8438. resolve(destPath);
  8439. });
  8440. }
  8441. catch (err) {
  8442. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8443. reject(err);
  8444. }
  8445. }));
  8446. file.on('error', err => {
  8447. file.end();
  8448. reject(err);
  8449. });
  8450. }
  8451. catch (err) {
  8452. reject(err);
  8453. }
  8454. }));
  8455. });
  8456. }
  8457. exports.downloadTool = downloadTool;
  8458. /**
  8459. * Extract a .7z file
  8460. *
  8461. * @param file path to the .7z file
  8462. * @param dest destination directory. Optional.
  8463. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8464. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8465. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8466. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8467. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8468. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8469. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8470. * to 7zr.exe can be pass to this function.
  8471. * @returns path to the destination directory
  8472. */
  8473. function extract7z(file, dest, _7zPath) {
  8474. return __awaiter(this, void 0, void 0, function* () {
  8475. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8476. assert_1.ok(file, 'parameter "file" is required');
  8477. dest = dest || (yield _createExtractFolder(dest));
  8478. const originalCwd = process.cwd();
  8479. process.chdir(dest);
  8480. if (_7zPath) {
  8481. try {
  8482. const args = [
  8483. 'x',
  8484. '-bb1',
  8485. '-bd',
  8486. '-sccUTF-8',
  8487. file
  8488. ];
  8489. const options = {
  8490. silent: true
  8491. };
  8492. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8493. }
  8494. finally {
  8495. process.chdir(originalCwd);
  8496. }
  8497. }
  8498. else {
  8499. const escapedScript = path
  8500. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8501. .replace(/'/g, "''")
  8502. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8503. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8504. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8505. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8506. const args = [
  8507. '-NoLogo',
  8508. '-Sta',
  8509. '-NoProfile',
  8510. '-NonInteractive',
  8511. '-ExecutionPolicy',
  8512. 'Unrestricted',
  8513. '-Command',
  8514. command
  8515. ];
  8516. const options = {
  8517. silent: true
  8518. };
  8519. try {
  8520. const powershellPath = yield io.which('powershell', true);
  8521. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8522. }
  8523. finally {
  8524. process.chdir(originalCwd);
  8525. }
  8526. }
  8527. return dest;
  8528. });
  8529. }
  8530. exports.extract7z = extract7z;
  8531. /**
  8532. * Extract a tar
  8533. *
  8534. * @param file path to the tar
  8535. * @param dest destination directory. Optional.
  8536. * @param flags flags for the tar. Optional.
  8537. * @returns path to the destination directory
  8538. */
  8539. function extractTar(file, dest, flags = 'xz') {
  8540. return __awaiter(this, void 0, void 0, function* () {
  8541. if (!file) {
  8542. throw new Error("parameter 'file' is required");
  8543. }
  8544. dest = dest || (yield _createExtractFolder(dest));
  8545. const tarPath = yield io.which('tar', true);
  8546. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8547. return dest;
  8548. });
  8549. }
  8550. exports.extractTar = extractTar;
  8551. /**
  8552. * Extract a zip
  8553. *
  8554. * @param file path to the zip
  8555. * @param dest destination directory. Optional.
  8556. * @returns path to the destination directory
  8557. */
  8558. function extractZip(file, dest) {
  8559. return __awaiter(this, void 0, void 0, function* () {
  8560. if (!file) {
  8561. throw new Error("parameter 'file' is required");
  8562. }
  8563. dest = dest || (yield _createExtractFolder(dest));
  8564. if (IS_WINDOWS) {
  8565. yield extractZipWin(file, dest);
  8566. }
  8567. else {
  8568. yield extractZipNix(file, dest);
  8569. }
  8570. return dest;
  8571. });
  8572. }
  8573. exports.extractZip = extractZip;
  8574. function extractZipWin(file, dest) {
  8575. return __awaiter(this, void 0, void 0, function* () {
  8576. // build the powershell command
  8577. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8578. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8579. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8580. // run powershell
  8581. const powershellPath = yield io.which('powershell');
  8582. const args = [
  8583. '-NoLogo',
  8584. '-Sta',
  8585. '-NoProfile',
  8586. '-NonInteractive',
  8587. '-ExecutionPolicy',
  8588. 'Unrestricted',
  8589. '-Command',
  8590. command
  8591. ];
  8592. yield exec_1.exec(`"${powershellPath}"`, args);
  8593. });
  8594. }
  8595. function extractZipNix(file, dest) {
  8596. return __awaiter(this, void 0, void 0, function* () {
  8597. const unzipPath = yield io.which('unzip');
  8598. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8599. });
  8600. }
  8601. /**
  8602. * Caches a directory and installs it into the tool cacheDir
  8603. *
  8604. * @param sourceDir the directory to cache into tools
  8605. * @param tool tool name
  8606. * @param version version of the tool. semver format
  8607. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8608. */
  8609. function cacheDir(sourceDir, tool, version, arch) {
  8610. return __awaiter(this, void 0, void 0, function* () {
  8611. version = semver.clean(version) || version;
  8612. arch = arch || os.arch();
  8613. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8614. core.debug(`source dir: ${sourceDir}`);
  8615. if (!fs.statSync(sourceDir).isDirectory()) {
  8616. throw new Error('sourceDir is not a directory');
  8617. }
  8618. // Create the tool dir
  8619. const destPath = yield _createToolPath(tool, version, arch);
  8620. // copy each child item. do not move. move can fail on Windows
  8621. // due to anti-virus software having an open handle on a file.
  8622. for (const itemName of fs.readdirSync(sourceDir)) {
  8623. const s = path.join(sourceDir, itemName);
  8624. yield io.cp(s, destPath, { recursive: true });
  8625. }
  8626. // write .complete
  8627. _completeToolPath(tool, version, arch);
  8628. return destPath;
  8629. });
  8630. }
  8631. exports.cacheDir = cacheDir;
  8632. /**
  8633. * Caches a downloaded file (GUID) and installs it
  8634. * into the tool cache with a given targetName
  8635. *
  8636. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8637. * @param targetFile the name of the file name in the tools directory
  8638. * @param tool tool name
  8639. * @param version version of the tool. semver format
  8640. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8641. */
  8642. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8643. return __awaiter(this, void 0, void 0, function* () {
  8644. version = semver.clean(version) || version;
  8645. arch = arch || os.arch();
  8646. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8647. core.debug(`source file: ${sourceFile}`);
  8648. if (!fs.statSync(sourceFile).isFile()) {
  8649. throw new Error('sourceFile is not a file');
  8650. }
  8651. // create the tool dir
  8652. const destFolder = yield _createToolPath(tool, version, arch);
  8653. // copy instead of move. move can fail on Windows due to
  8654. // anti-virus software having an open handle on a file.
  8655. const destPath = path.join(destFolder, targetFile);
  8656. core.debug(`destination file ${destPath}`);
  8657. yield io.cp(sourceFile, destPath);
  8658. // write .complete
  8659. _completeToolPath(tool, version, arch);
  8660. return destFolder;
  8661. });
  8662. }
  8663. exports.cacheFile = cacheFile;
  8664. /**
  8665. * Finds the path to a tool version in the local installed tool cache
  8666. *
  8667. * @param toolName name of the tool
  8668. * @param versionSpec version of the tool
  8669. * @param arch optional arch. defaults to arch of computer
  8670. */
  8671. function find(toolName, versionSpec, arch) {
  8672. if (!toolName) {
  8673. throw new Error('toolName parameter is required');
  8674. }
  8675. if (!versionSpec) {
  8676. throw new Error('versionSpec parameter is required');
  8677. }
  8678. arch = arch || os.arch();
  8679. // attempt to resolve an explicit version
  8680. if (!_isExplicitVersion(versionSpec)) {
  8681. const localVersions = findAllVersions(toolName, arch);
  8682. const match = _evaluateVersions(localVersions, versionSpec);
  8683. versionSpec = match;
  8684. }
  8685. // check for the explicit version in the cache
  8686. let toolPath = '';
  8687. if (versionSpec) {
  8688. versionSpec = semver.clean(versionSpec) || '';
  8689. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8690. core.debug(`checking cache: ${cachePath}`);
  8691. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8692. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8693. toolPath = cachePath;
  8694. }
  8695. else {
  8696. core.debug('not found');
  8697. }
  8698. }
  8699. return toolPath;
  8700. }
  8701. exports.find = find;
  8702. /**
  8703. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8704. *
  8705. * @param toolName name of the tool
  8706. * @param arch optional arch. defaults to arch of computer
  8707. */
  8708. function findAllVersions(toolName, arch) {
  8709. const versions = [];
  8710. arch = arch || os.arch();
  8711. const toolPath = path.join(cacheRoot, toolName);
  8712. if (fs.existsSync(toolPath)) {
  8713. const children = fs.readdirSync(toolPath);
  8714. for (const child of children) {
  8715. if (_isExplicitVersion(child)) {
  8716. const fullPath = path.join(toolPath, child, arch || '');
  8717. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8718. versions.push(child);
  8719. }
  8720. }
  8721. }
  8722. }
  8723. return versions;
  8724. }
  8725. exports.findAllVersions = findAllVersions;
  8726. function _createExtractFolder(dest) {
  8727. return __awaiter(this, void 0, void 0, function* () {
  8728. if (!dest) {
  8729. // create a temp dir
  8730. dest = path.join(tempDirectory, uuidV4());
  8731. }
  8732. yield io.mkdirP(dest);
  8733. return dest;
  8734. });
  8735. }
  8736. function _createToolPath(tool, version, arch) {
  8737. return __awaiter(this, void 0, void 0, function* () {
  8738. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8739. core.debug(`destination ${folderPath}`);
  8740. const markerPath = `${folderPath}.complete`;
  8741. yield io.rmRF(folderPath);
  8742. yield io.rmRF(markerPath);
  8743. yield io.mkdirP(folderPath);
  8744. return folderPath;
  8745. });
  8746. }
  8747. function _completeToolPath(tool, version, arch) {
  8748. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8749. const markerPath = `${folderPath}.complete`;
  8750. fs.writeFileSync(markerPath, '');
  8751. core.debug('finished caching tool');
  8752. }
  8753. function _isExplicitVersion(versionSpec) {
  8754. const c = semver.clean(versionSpec) || '';
  8755. core.debug(`isExplicit: ${c}`);
  8756. const valid = semver.valid(c) != null;
  8757. core.debug(`explicit? ${valid}`);
  8758. return valid;
  8759. }
  8760. function _evaluateVersions(versions, versionSpec) {
  8761. let version = '';
  8762. core.debug(`evaluating ${versions.length} versions`);
  8763. versions = versions.sort((a, b) => {
  8764. if (semver.gt(a, b)) {
  8765. return 1;
  8766. }
  8767. return -1;
  8768. });
  8769. for (let i = versions.length - 1; i >= 0; i--) {
  8770. const potential = versions[i];
  8771. const satisfied = semver.satisfies(potential, versionSpec);
  8772. if (satisfied) {
  8773. version = potential;
  8774. break;
  8775. }
  8776. }
  8777. if (version) {
  8778. core.debug(`matched: ${version}`);
  8779. }
  8780. else {
  8781. core.debug('match not found');
  8782. }
  8783. return version;
  8784. }
  8785. //# sourceMappingURL=tool-cache.js.map
  8786. /***/ }),
  8787. /***/ 536:
  8788. /***/ (function(module, __unusedexports, __webpack_require__) {
  8789. module.exports = hasFirstPage
  8790. const deprecate = __webpack_require__(370)
  8791. const getPageLinks = __webpack_require__(577)
  8792. function hasFirstPage (link) {
  8793. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8794. return getPageLinks(link).first
  8795. }
  8796. /***/ }),
  8797. /***/ 539:
  8798. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8799. "use strict";
  8800. Object.defineProperty(exports, "__esModule", { value: true });
  8801. const url = __webpack_require__(835);
  8802. const http = __webpack_require__(605);
  8803. const https = __webpack_require__(211);
  8804. const pm = __webpack_require__(950);
  8805. let tunnel;
  8806. var HttpCodes;
  8807. (function (HttpCodes) {
  8808. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  8809. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  8810. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  8811. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  8812. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  8813. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  8814. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  8815. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  8816. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  8817. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  8818. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  8819. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  8820. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  8821. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  8822. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  8823. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  8824. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  8825. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  8826. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  8827. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  8828. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  8829. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  8830. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  8831. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  8832. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  8833. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  8834. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  8835. /**
  8836. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  8837. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  8838. */
  8839. function getProxyUrl(serverUrl) {
  8840. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  8841. return proxyUrl ? proxyUrl.href : '';
  8842. }
  8843. exports.getProxyUrl = getProxyUrl;
  8844. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  8845. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  8846. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  8847. const ExponentialBackoffCeiling = 10;
  8848. const ExponentialBackoffTimeSlice = 5;
  8849. class HttpClientResponse {
  8850. constructor(message) {
  8851. this.message = message;
  8852. }
  8853. readBody() {
  8854. return new Promise(async (resolve, reject) => {
  8855. let output = Buffer.alloc(0);
  8856. this.message.on('data', (chunk) => {
  8857. output = Buffer.concat([output, chunk]);
  8858. });
  8859. this.message.on('end', () => {
  8860. resolve(output.toString());
  8861. });
  8862. });
  8863. }
  8864. }
  8865. exports.HttpClientResponse = HttpClientResponse;
  8866. function isHttps(requestUrl) {
  8867. let parsedUrl = url.parse(requestUrl);
  8868. return parsedUrl.protocol === 'https:';
  8869. }
  8870. exports.isHttps = isHttps;
  8871. class HttpClient {
  8872. constructor(userAgent, handlers, requestOptions) {
  8873. this._ignoreSslError = false;
  8874. this._allowRedirects = true;
  8875. this._allowRedirectDowngrade = false;
  8876. this._maxRedirects = 50;
  8877. this._allowRetries = false;
  8878. this._maxRetries = 1;
  8879. this._keepAlive = false;
  8880. this._disposed = false;
  8881. this.userAgent = userAgent;
  8882. this.handlers = handlers || [];
  8883. this.requestOptions = requestOptions;
  8884. if (requestOptions) {
  8885. if (requestOptions.ignoreSslError != null) {
  8886. this._ignoreSslError = requestOptions.ignoreSslError;
  8887. }
  8888. this._socketTimeout = requestOptions.socketTimeout;
  8889. if (requestOptions.allowRedirects != null) {
  8890. this._allowRedirects = requestOptions.allowRedirects;
  8891. }
  8892. if (requestOptions.allowRedirectDowngrade != null) {
  8893. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  8894. }
  8895. if (requestOptions.maxRedirects != null) {
  8896. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  8897. }
  8898. if (requestOptions.keepAlive != null) {
  8899. this._keepAlive = requestOptions.keepAlive;
  8900. }
  8901. if (requestOptions.allowRetries != null) {
  8902. this._allowRetries = requestOptions.allowRetries;
  8903. }
  8904. if (requestOptions.maxRetries != null) {
  8905. this._maxRetries = requestOptions.maxRetries;
  8906. }
  8907. }
  8908. }
  8909. options(requestUrl, additionalHeaders) {
  8910. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  8911. }
  8912. get(requestUrl, additionalHeaders) {
  8913. return this.request('GET', requestUrl, null, additionalHeaders || {});
  8914. }
  8915. del(requestUrl, additionalHeaders) {
  8916. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  8917. }
  8918. post(requestUrl, data, additionalHeaders) {
  8919. return this.request('POST', requestUrl, data, additionalHeaders || {});
  8920. }
  8921. patch(requestUrl, data, additionalHeaders) {
  8922. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  8923. }
  8924. put(requestUrl, data, additionalHeaders) {
  8925. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  8926. }
  8927. head(requestUrl, additionalHeaders) {
  8928. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  8929. }
  8930. sendStream(verb, requestUrl, stream, additionalHeaders) {
  8931. return this.request(verb, requestUrl, stream, additionalHeaders);
  8932. }
  8933. /**
  8934. * Makes a raw http request.
  8935. * All other methods such as get, post, patch, and request ultimately call this.
  8936. * Prefer get, del, post and patch
  8937. */
  8938. async request(verb, requestUrl, data, headers) {
  8939. if (this._disposed) {
  8940. throw new Error("Client has already been disposed.");
  8941. }
  8942. let parsedUrl = url.parse(requestUrl);
  8943. let info = this._prepareRequest(verb, parsedUrl, headers);
  8944. // Only perform retries on reads since writes may not be idempotent.
  8945. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  8946. let numTries = 0;
  8947. let response;
  8948. while (numTries < maxTries) {
  8949. response = await this.requestRaw(info, data);
  8950. // Check if it's an authentication challenge
  8951. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  8952. let authenticationHandler;
  8953. for (let i = 0; i < this.handlers.length; i++) {
  8954. if (this.handlers[i].canHandleAuthentication(response)) {
  8955. authenticationHandler = this.handlers[i];
  8956. break;
  8957. }
  8958. }
  8959. if (authenticationHandler) {
  8960. return authenticationHandler.handleAuthentication(this, info, data);
  8961. }
  8962. else {
  8963. // We have received an unauthorized response but have no handlers to handle it.
  8964. // Let the response return to the caller.
  8965. return response;
  8966. }
  8967. }
  8968. let redirectsRemaining = this._maxRedirects;
  8969. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  8970. && this._allowRedirects
  8971. && redirectsRemaining > 0) {
  8972. const redirectUrl = response.message.headers["location"];
  8973. if (!redirectUrl) {
  8974. // if there's no location to redirect to, we won't
  8975. break;
  8976. }
  8977. let parsedRedirectUrl = url.parse(redirectUrl);
  8978. if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
  8979. 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.");
  8980. }
  8981. // we need to finish reading the response before reassigning response
  8982. // which will leak the open socket.
  8983. await response.readBody();
  8984. // let's make the request with the new redirectUrl
  8985. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  8986. response = await this.requestRaw(info, data);
  8987. redirectsRemaining--;
  8988. }
  8989. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  8990. // If not a retry code, return immediately instead of retrying
  8991. return response;
  8992. }
  8993. numTries += 1;
  8994. if (numTries < maxTries) {
  8995. await response.readBody();
  8996. await this._performExponentialBackoff(numTries);
  8997. }
  8998. }
  8999. return response;
  9000. }
  9001. /**
  9002. * Needs to be called if keepAlive is set to true in request options.
  9003. */
  9004. dispose() {
  9005. if (this._agent) {
  9006. this._agent.destroy();
  9007. }
  9008. this._disposed = true;
  9009. }
  9010. /**
  9011. * Raw request.
  9012. * @param info
  9013. * @param data
  9014. */
  9015. requestRaw(info, data) {
  9016. return new Promise((resolve, reject) => {
  9017. let callbackForResult = function (err, res) {
  9018. if (err) {
  9019. reject(err);
  9020. }
  9021. resolve(res);
  9022. };
  9023. this.requestRawWithCallback(info, data, callbackForResult);
  9024. });
  9025. }
  9026. /**
  9027. * Raw request with callback.
  9028. * @param info
  9029. * @param data
  9030. * @param onResult
  9031. */
  9032. requestRawWithCallback(info, data, onResult) {
  9033. let socket;
  9034. if (typeof (data) === 'string') {
  9035. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  9036. }
  9037. let callbackCalled = false;
  9038. let handleResult = (err, res) => {
  9039. if (!callbackCalled) {
  9040. callbackCalled = true;
  9041. onResult(err, res);
  9042. }
  9043. };
  9044. let req = info.httpModule.request(info.options, (msg) => {
  9045. let res = new HttpClientResponse(msg);
  9046. handleResult(null, res);
  9047. });
  9048. req.on('socket', (sock) => {
  9049. socket = sock;
  9050. });
  9051. // If we ever get disconnected, we want the socket to timeout eventually
  9052. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  9053. if (socket) {
  9054. socket.end();
  9055. }
  9056. handleResult(new Error('Request timeout: ' + info.options.path), null);
  9057. });
  9058. req.on('error', function (err) {
  9059. // err has statusCode property
  9060. // res should have headers
  9061. handleResult(err, null);
  9062. });
  9063. if (data && typeof (data) === 'string') {
  9064. req.write(data, 'utf8');
  9065. }
  9066. if (data && typeof (data) !== 'string') {
  9067. data.on('close', function () {
  9068. req.end();
  9069. });
  9070. data.pipe(req);
  9071. }
  9072. else {
  9073. req.end();
  9074. }
  9075. }
  9076. /**
  9077. * Gets an http agent. This function is useful when you need an http agent that handles
  9078. * routing through a proxy server - depending upon the url and proxy environment variables.
  9079. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  9080. */
  9081. getAgent(serverUrl) {
  9082. let parsedUrl = url.parse(serverUrl);
  9083. return this._getAgent(parsedUrl);
  9084. }
  9085. _prepareRequest(method, requestUrl, headers) {
  9086. const info = {};
  9087. info.parsedUrl = requestUrl;
  9088. const usingSsl = info.parsedUrl.protocol === 'https:';
  9089. info.httpModule = usingSsl ? https : http;
  9090. const defaultPort = usingSsl ? 443 : 80;
  9091. info.options = {};
  9092. info.options.host = info.parsedUrl.hostname;
  9093. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  9094. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  9095. info.options.method = method;
  9096. info.options.headers = this._mergeHeaders(headers);
  9097. if (this.userAgent != null) {
  9098. info.options.headers["user-agent"] = this.userAgent;
  9099. }
  9100. info.options.agent = this._getAgent(info.parsedUrl);
  9101. // gives handlers an opportunity to participate
  9102. if (this.handlers) {
  9103. this.handlers.forEach((handler) => {
  9104. handler.prepareRequest(info.options);
  9105. });
  9106. }
  9107. return info;
  9108. }
  9109. _mergeHeaders(headers) {
  9110. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  9111. if (this.requestOptions && this.requestOptions.headers) {
  9112. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  9113. }
  9114. return lowercaseKeys(headers || {});
  9115. }
  9116. _getAgent(parsedUrl) {
  9117. let agent;
  9118. let proxyUrl = pm.getProxyUrl(parsedUrl);
  9119. let useProxy = proxyUrl && proxyUrl.hostname;
  9120. if (this._keepAlive && useProxy) {
  9121. agent = this._proxyAgent;
  9122. }
  9123. if (this._keepAlive && !useProxy) {
  9124. agent = this._agent;
  9125. }
  9126. // if agent is already assigned use that agent.
  9127. if (!!agent) {
  9128. return agent;
  9129. }
  9130. const usingSsl = parsedUrl.protocol === 'https:';
  9131. let maxSockets = 100;
  9132. if (!!this.requestOptions) {
  9133. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  9134. }
  9135. if (useProxy) {
  9136. // If using proxy, need tunnel
  9137. if (!tunnel) {
  9138. tunnel = __webpack_require__(335);
  9139. }
  9140. const agentOptions = {
  9141. maxSockets: maxSockets,
  9142. keepAlive: this._keepAlive,
  9143. proxy: {
  9144. proxyAuth: proxyUrl.auth,
  9145. host: proxyUrl.hostname,
  9146. port: proxyUrl.port
  9147. },
  9148. };
  9149. let tunnelAgent;
  9150. const overHttps = proxyUrl.protocol === 'https:';
  9151. if (usingSsl) {
  9152. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  9153. }
  9154. else {
  9155. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  9156. }
  9157. agent = tunnelAgent(agentOptions);
  9158. this._proxyAgent = agent;
  9159. }
  9160. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  9161. if (this._keepAlive && !agent) {
  9162. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  9163. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  9164. this._agent = agent;
  9165. }
  9166. // if not using private agent and tunnel agent isn't setup then use global agent
  9167. if (!agent) {
  9168. agent = usingSsl ? https.globalAgent : http.globalAgent;
  9169. }
  9170. if (usingSsl && this._ignoreSslError) {
  9171. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  9172. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  9173. // we have to cast it to any and change it directly
  9174. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  9175. }
  9176. return agent;
  9177. }
  9178. _performExponentialBackoff(retryNumber) {
  9179. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9180. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9181. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9182. }
  9183. }
  9184. exports.HttpClient = HttpClient;
  9185. /***/ }),
  9186. /***/ 550:
  9187. /***/ (function(module, __unusedexports, __webpack_require__) {
  9188. module.exports = getNextPage
  9189. const getPage = __webpack_require__(265)
  9190. function getNextPage (octokit, link, headers) {
  9191. return getPage(octokit, link, 'next', headers)
  9192. }
  9193. /***/ }),
  9194. /***/ 558:
  9195. /***/ (function(module, __unusedexports, __webpack_require__) {
  9196. module.exports = hasPreviousPage
  9197. const deprecate = __webpack_require__(370)
  9198. const getPageLinks = __webpack_require__(577)
  9199. function hasPreviousPage (link) {
  9200. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9201. return getPageLinks(link).prev
  9202. }
  9203. /***/ }),
  9204. /***/ 559:
  9205. /***/ (function(__unusedmodule, exports) {
  9206. "use strict";
  9207. Object.defineProperty(exports, "__esModule", { value: true });
  9208. class GitVersion {
  9209. /**
  9210. * Used for comparing the version of git and git-lfs against the minimum required version
  9211. * @param version the version string, e.g. 1.2 or 1.2.3
  9212. */
  9213. constructor(version) {
  9214. this.major = NaN;
  9215. this.minor = NaN;
  9216. this.patch = NaN;
  9217. if (version) {
  9218. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9219. if (match) {
  9220. this.major = Number(match[1]);
  9221. this.minor = Number(match[2]);
  9222. if (match[4]) {
  9223. this.patch = Number(match[4]);
  9224. }
  9225. }
  9226. }
  9227. }
  9228. /**
  9229. * Compares the instance against a minimum required version
  9230. * @param minimum Minimum version
  9231. */
  9232. checkMinimum(minimum) {
  9233. if (!minimum.isValid()) {
  9234. throw new Error('Arg minimum is not a valid version');
  9235. }
  9236. // Major is insufficient
  9237. if (this.major < minimum.major) {
  9238. return false;
  9239. }
  9240. // Major is equal
  9241. if (this.major === minimum.major) {
  9242. // Minor is insufficient
  9243. if (this.minor < minimum.minor) {
  9244. return false;
  9245. }
  9246. // Minor is equal
  9247. if (this.minor === minimum.minor) {
  9248. // Patch is insufficient
  9249. if (this.patch && this.patch < (minimum.patch || 0)) {
  9250. return false;
  9251. }
  9252. }
  9253. }
  9254. return true;
  9255. }
  9256. /**
  9257. * Indicates whether the instance was constructed from a valid version string
  9258. */
  9259. isValid() {
  9260. return !isNaN(this.major);
  9261. }
  9262. /**
  9263. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9264. */
  9265. toString() {
  9266. let result = '';
  9267. if (this.isValid()) {
  9268. result = `${this.major}.${this.minor}`;
  9269. if (!isNaN(this.patch)) {
  9270. result += `.${this.patch}`;
  9271. }
  9272. }
  9273. return result;
  9274. }
  9275. }
  9276. exports.GitVersion = GitVersion;
  9277. /***/ }),
  9278. /***/ 562:
  9279. /***/ (function(module, __unusedexports, __webpack_require__) {
  9280. var once = __webpack_require__(969);
  9281. var noop = function() {};
  9282. var isRequest = function(stream) {
  9283. return stream.setHeader && typeof stream.abort === 'function';
  9284. };
  9285. var isChildProcess = function(stream) {
  9286. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9287. };
  9288. var eos = function(stream, opts, callback) {
  9289. if (typeof opts === 'function') return eos(stream, null, opts);
  9290. if (!opts) opts = {};
  9291. callback = once(callback || noop);
  9292. var ws = stream._writableState;
  9293. var rs = stream._readableState;
  9294. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9295. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9296. var cancelled = false;
  9297. var onlegacyfinish = function() {
  9298. if (!stream.writable) onfinish();
  9299. };
  9300. var onfinish = function() {
  9301. writable = false;
  9302. if (!readable) callback.call(stream);
  9303. };
  9304. var onend = function() {
  9305. readable = false;
  9306. if (!writable) callback.call(stream);
  9307. };
  9308. var onexit = function(exitCode) {
  9309. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9310. };
  9311. var onerror = function(err) {
  9312. callback.call(stream, err);
  9313. };
  9314. var onclose = function() {
  9315. process.nextTick(onclosenexttick);
  9316. };
  9317. var onclosenexttick = function() {
  9318. if (cancelled) return;
  9319. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9320. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9321. };
  9322. var onrequest = function() {
  9323. stream.req.on('finish', onfinish);
  9324. };
  9325. if (isRequest(stream)) {
  9326. stream.on('complete', onfinish);
  9327. stream.on('abort', onclose);
  9328. if (stream.req) onrequest();
  9329. else stream.on('request', onrequest);
  9330. } else if (writable && !ws) { // legacy streams
  9331. stream.on('end', onlegacyfinish);
  9332. stream.on('close', onlegacyfinish);
  9333. }
  9334. if (isChildProcess(stream)) stream.on('exit', onexit);
  9335. stream.on('end', onend);
  9336. stream.on('finish', onfinish);
  9337. if (opts.error !== false) stream.on('error', onerror);
  9338. stream.on('close', onclose);
  9339. return function() {
  9340. cancelled = true;
  9341. stream.removeListener('complete', onfinish);
  9342. stream.removeListener('abort', onclose);
  9343. stream.removeListener('request', onrequest);
  9344. if (stream.req) stream.req.removeListener('finish', onfinish);
  9345. stream.removeListener('end', onlegacyfinish);
  9346. stream.removeListener('close', onlegacyfinish);
  9347. stream.removeListener('finish', onfinish);
  9348. stream.removeListener('exit', onexit);
  9349. stream.removeListener('end', onend);
  9350. stream.removeListener('error', onerror);
  9351. stream.removeListener('close', onclose);
  9352. };
  9353. };
  9354. module.exports = eos;
  9355. /***/ }),
  9356. /***/ 563:
  9357. /***/ (function(module, __unusedexports, __webpack_require__) {
  9358. module.exports = getPreviousPage
  9359. const getPage = __webpack_require__(265)
  9360. function getPreviousPage (octokit, link, headers) {
  9361. return getPage(octokit, link, 'prev', headers)
  9362. }
  9363. /***/ }),
  9364. /***/ 568:
  9365. /***/ (function(module, __unusedexports, __webpack_require__) {
  9366. "use strict";
  9367. const path = __webpack_require__(622);
  9368. const niceTry = __webpack_require__(948);
  9369. const resolveCommand = __webpack_require__(489);
  9370. const escape = __webpack_require__(462);
  9371. const readShebang = __webpack_require__(389);
  9372. const semver = __webpack_require__(280);
  9373. const isWin = process.platform === 'win32';
  9374. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9375. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9376. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9377. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9378. function detectShebang(parsed) {
  9379. parsed.file = resolveCommand(parsed);
  9380. const shebang = parsed.file && readShebang(parsed.file);
  9381. if (shebang) {
  9382. parsed.args.unshift(parsed.file);
  9383. parsed.command = shebang;
  9384. return resolveCommand(parsed);
  9385. }
  9386. return parsed.file;
  9387. }
  9388. function parseNonShell(parsed) {
  9389. if (!isWin) {
  9390. return parsed;
  9391. }
  9392. // Detect & add support for shebangs
  9393. const commandFile = detectShebang(parsed);
  9394. // We don't need a shell if the command filename is an executable
  9395. const needsShell = !isExecutableRegExp.test(commandFile);
  9396. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9397. // Note that `forceShell` is an hidden option used only in tests
  9398. if (parsed.options.forceShell || needsShell) {
  9399. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9400. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9401. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9402. // we need to double escape them
  9403. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9404. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9405. // This is necessary otherwise it will always fail with ENOENT in those cases
  9406. parsed.command = path.normalize(parsed.command);
  9407. // Escape command & arguments
  9408. parsed.command = escape.command(parsed.command);
  9409. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9410. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9411. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9412. parsed.command = process.env.comspec || 'cmd.exe';
  9413. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9414. }
  9415. return parsed;
  9416. }
  9417. function parseShell(parsed) {
  9418. // If node supports the shell option, there's no need to mimic its behavior
  9419. if (supportsShellOption) {
  9420. return parsed;
  9421. }
  9422. // Mimic node shell option
  9423. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9424. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9425. if (isWin) {
  9426. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9427. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9428. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9429. } else {
  9430. if (typeof parsed.options.shell === 'string') {
  9431. parsed.command = parsed.options.shell;
  9432. } else if (process.platform === 'android') {
  9433. parsed.command = '/system/bin/sh';
  9434. } else {
  9435. parsed.command = '/bin/sh';
  9436. }
  9437. parsed.args = ['-c', shellCommand];
  9438. }
  9439. return parsed;
  9440. }
  9441. function parse(command, args, options) {
  9442. // Normalize arguments, similar to nodejs
  9443. if (args && !Array.isArray(args)) {
  9444. options = args;
  9445. args = null;
  9446. }
  9447. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9448. options = Object.assign({}, options); // Clone object to avoid changing the original
  9449. // Build our parsed object
  9450. const parsed = {
  9451. command,
  9452. args,
  9453. options,
  9454. file: undefined,
  9455. original: {
  9456. command,
  9457. args,
  9458. },
  9459. };
  9460. // Delegate further parsing to shell or non-shell
  9461. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9462. }
  9463. module.exports = parse;
  9464. /***/ }),
  9465. /***/ 577:
  9466. /***/ (function(module) {
  9467. module.exports = getPageLinks
  9468. function getPageLinks (link) {
  9469. link = link.link || link.headers.link || ''
  9470. const links = {}
  9471. // link format:
  9472. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9473. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9474. links[type] = uri
  9475. })
  9476. return links
  9477. }
  9478. /***/ }),
  9479. /***/ 586:
  9480. /***/ (function(module, __unusedexports, __webpack_require__) {
  9481. module.exports = octokitRestApiEndpoints;
  9482. const ROUTES = __webpack_require__(705);
  9483. function octokitRestApiEndpoints(octokit) {
  9484. // Aliasing scopes for backward compatibility
  9485. // See https://github.com/octokit/rest.js/pull/1134
  9486. ROUTES.gitdata = ROUTES.git;
  9487. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9488. ROUTES.pullRequests = ROUTES.pulls;
  9489. octokit.registerEndpoints(ROUTES);
  9490. }
  9491. /***/ }),
  9492. /***/ 587:
  9493. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9494. "use strict";
  9495. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9496. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9497. return new (P || (P = Promise))(function (resolve, reject) {
  9498. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9499. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9500. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9501. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9502. });
  9503. };
  9504. var __importStar = (this && this.__importStar) || function (mod) {
  9505. if (mod && mod.__esModule) return mod;
  9506. var result = {};
  9507. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9508. result["default"] = mod;
  9509. return result;
  9510. };
  9511. Object.defineProperty(exports, "__esModule", { value: true });
  9512. const core = __importStar(__webpack_require__(470));
  9513. const defaultMaxAttempts = 3;
  9514. const defaultMinSeconds = 10;
  9515. const defaultMaxSeconds = 20;
  9516. class RetryHelper {
  9517. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9518. this.maxAttempts = maxAttempts;
  9519. this.minSeconds = Math.floor(minSeconds);
  9520. this.maxSeconds = Math.floor(maxSeconds);
  9521. if (this.minSeconds > this.maxSeconds) {
  9522. throw new Error('min seconds should be less than or equal to max seconds');
  9523. }
  9524. }
  9525. execute(action) {
  9526. return __awaiter(this, void 0, void 0, function* () {
  9527. let attempt = 1;
  9528. while (attempt < this.maxAttempts) {
  9529. // Try
  9530. try {
  9531. return yield action();
  9532. }
  9533. catch (err) {
  9534. core.info(err.message);
  9535. }
  9536. // Sleep
  9537. const seconds = this.getSleepAmount();
  9538. core.info(`Waiting ${seconds} seconds before trying again`);
  9539. yield this.sleep(seconds);
  9540. attempt++;
  9541. }
  9542. // Last attempt
  9543. return yield action();
  9544. });
  9545. }
  9546. getSleepAmount() {
  9547. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9548. this.minSeconds);
  9549. }
  9550. sleep(seconds) {
  9551. return __awaiter(this, void 0, void 0, function* () {
  9552. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9553. });
  9554. }
  9555. }
  9556. exports.RetryHelper = RetryHelper;
  9557. function execute(action) {
  9558. return __awaiter(this, void 0, void 0, function* () {
  9559. const retryHelper = new RetryHelper();
  9560. return yield retryHelper.execute(action);
  9561. });
  9562. }
  9563. exports.execute = execute;
  9564. /***/ }),
  9565. /***/ 605:
  9566. /***/ (function(module) {
  9567. module.exports = require("http");
  9568. /***/ }),
  9569. /***/ 614:
  9570. /***/ (function(module) {
  9571. module.exports = require("events");
  9572. /***/ }),
  9573. /***/ 618:
  9574. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9575. "use strict";
  9576. var __importStar = (this && this.__importStar) || function (mod) {
  9577. if (mod && mod.__esModule) return mod;
  9578. var result = {};
  9579. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9580. result["default"] = mod;
  9581. return result;
  9582. };
  9583. Object.defineProperty(exports, "__esModule", { value: true });
  9584. const fs = __importStar(__webpack_require__(747));
  9585. function directoryExistsSync(path, required) {
  9586. if (!path) {
  9587. throw new Error("Arg 'path' must not be empty");
  9588. }
  9589. let stats;
  9590. try {
  9591. stats = fs.statSync(path);
  9592. }
  9593. catch (error) {
  9594. if (error.code === 'ENOENT') {
  9595. if (!required) {
  9596. return false;
  9597. }
  9598. throw new Error(`Directory '${path}' does not exist`);
  9599. }
  9600. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9601. }
  9602. if (stats.isDirectory()) {
  9603. return true;
  9604. }
  9605. else if (!required) {
  9606. return false;
  9607. }
  9608. throw new Error(`Directory '${path}' does not exist`);
  9609. }
  9610. exports.directoryExistsSync = directoryExistsSync;
  9611. function existsSync(path) {
  9612. if (!path) {
  9613. throw new Error("Arg 'path' must not be empty");
  9614. }
  9615. try {
  9616. fs.statSync(path);
  9617. }
  9618. catch (error) {
  9619. if (error.code === 'ENOENT') {
  9620. return false;
  9621. }
  9622. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9623. }
  9624. return true;
  9625. }
  9626. exports.existsSync = existsSync;
  9627. function fileExistsSync(path) {
  9628. if (!path) {
  9629. throw new Error("Arg 'path' must not be empty");
  9630. }
  9631. let stats;
  9632. try {
  9633. stats = fs.statSync(path);
  9634. }
  9635. catch (error) {
  9636. if (error.code === 'ENOENT') {
  9637. return false;
  9638. }
  9639. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9640. }
  9641. if (!stats.isDirectory()) {
  9642. return true;
  9643. }
  9644. return false;
  9645. }
  9646. exports.fileExistsSync = fileExistsSync;
  9647. /***/ }),
  9648. /***/ 621:
  9649. /***/ (function(module, __unusedexports, __webpack_require__) {
  9650. "use strict";
  9651. const path = __webpack_require__(622);
  9652. const pathKey = __webpack_require__(39);
  9653. module.exports = opts => {
  9654. opts = Object.assign({
  9655. cwd: process.cwd(),
  9656. path: process.env[pathKey()]
  9657. }, opts);
  9658. let prev;
  9659. let pth = path.resolve(opts.cwd);
  9660. const ret = [];
  9661. while (prev !== pth) {
  9662. ret.push(path.join(pth, 'node_modules/.bin'));
  9663. prev = pth;
  9664. pth = path.resolve(pth, '..');
  9665. }
  9666. // ensure the running `node` binary is used
  9667. ret.push(path.dirname(process.execPath));
  9668. return ret.concat(opts.path).join(path.delimiter);
  9669. };
  9670. module.exports.env = opts => {
  9671. opts = Object.assign({
  9672. env: process.env
  9673. }, opts);
  9674. const env = Object.assign({}, opts.env);
  9675. const path = pathKey({env});
  9676. opts.path = env[path];
  9677. env[path] = module.exports(opts);
  9678. return env;
  9679. };
  9680. /***/ }),
  9681. /***/ 622:
  9682. /***/ (function(module) {
  9683. module.exports = require("path");
  9684. /***/ }),
  9685. /***/ 631:
  9686. /***/ (function(module) {
  9687. module.exports = require("net");
  9688. /***/ }),
  9689. /***/ 649:
  9690. /***/ (function(module, __unusedexports, __webpack_require__) {
  9691. module.exports = getLastPage
  9692. const getPage = __webpack_require__(265)
  9693. function getLastPage (octokit, link, headers) {
  9694. return getPage(octokit, link, 'last', headers)
  9695. }
  9696. /***/ }),
  9697. /***/ 654:
  9698. /***/ (function(module) {
  9699. // This is not the set of all possible signals.
  9700. //
  9701. // It IS, however, the set of all signals that trigger
  9702. // an exit on either Linux or BSD systems. Linux is a
  9703. // superset of the signal names supported on BSD, and
  9704. // the unknown signals just fail to register, so we can
  9705. // catch that easily enough.
  9706. //
  9707. // Don't bother with SIGKILL. It's uncatchable, which
  9708. // means that we can't fire any callbacks anyway.
  9709. //
  9710. // If a user does happen to register a handler on a non-
  9711. // fatal signal like SIGWINCH or something, and then
  9712. // exit, it'll end up firing `process.emit('exit')`, so
  9713. // the handler will be fired anyway.
  9714. //
  9715. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9716. // artificially, inherently leave the process in a
  9717. // state from which it is not safe to try and enter JS
  9718. // listeners.
  9719. module.exports = [
  9720. 'SIGABRT',
  9721. 'SIGALRM',
  9722. 'SIGHUP',
  9723. 'SIGINT',
  9724. 'SIGTERM'
  9725. ]
  9726. if (process.platform !== 'win32') {
  9727. module.exports.push(
  9728. 'SIGVTALRM',
  9729. 'SIGXCPU',
  9730. 'SIGXFSZ',
  9731. 'SIGUSR2',
  9732. 'SIGTRAP',
  9733. 'SIGSYS',
  9734. 'SIGQUIT',
  9735. 'SIGIOT'
  9736. // should detect profiler and enable/disable accordingly.
  9737. // see #21
  9738. // 'SIGPROF'
  9739. )
  9740. }
  9741. if (process.platform === 'linux') {
  9742. module.exports.push(
  9743. 'SIGIO',
  9744. 'SIGPOLL',
  9745. 'SIGPWR',
  9746. 'SIGSTKFLT',
  9747. 'SIGUNUSED'
  9748. )
  9749. }
  9750. /***/ }),
  9751. /***/ 656:
  9752. /***/ (function(module, exports) {
  9753. exports = module.exports = SemVer
  9754. var debug
  9755. /* istanbul ignore next */
  9756. if (typeof process === 'object' &&
  9757. process.env &&
  9758. process.env.NODE_DEBUG &&
  9759. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9760. debug = function () {
  9761. var args = Array.prototype.slice.call(arguments, 0)
  9762. args.unshift('SEMVER')
  9763. console.log.apply(console, args)
  9764. }
  9765. } else {
  9766. debug = function () {}
  9767. }
  9768. // Note: this is the semver.org version of the spec that it implements
  9769. // Not necessarily the package version of this code.
  9770. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9771. var MAX_LENGTH = 256
  9772. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9773. /* istanbul ignore next */ 9007199254740991
  9774. // Max safe segment length for coercion.
  9775. var MAX_SAFE_COMPONENT_LENGTH = 16
  9776. // The actual regexps go on exports.re
  9777. var re = exports.re = []
  9778. var src = exports.src = []
  9779. var t = exports.tokens = {}
  9780. var R = 0
  9781. function tok (n) {
  9782. t[n] = R++
  9783. }
  9784. // The following Regular Expressions can be used for tokenizing,
  9785. // validating, and parsing SemVer version strings.
  9786. // ## Numeric Identifier
  9787. // A single `0`, or a non-zero digit followed by zero or more digits.
  9788. tok('NUMERICIDENTIFIER')
  9789. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9790. tok('NUMERICIDENTIFIERLOOSE')
  9791. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9792. // ## Non-numeric Identifier
  9793. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9794. // more letters, digits, or hyphens.
  9795. tok('NONNUMERICIDENTIFIER')
  9796. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9797. // ## Main Version
  9798. // Three dot-separated numeric identifiers.
  9799. tok('MAINVERSION')
  9800. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9801. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9802. '(' + src[t.NUMERICIDENTIFIER] + ')'
  9803. tok('MAINVERSIONLOOSE')
  9804. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9805. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9806. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  9807. // ## Pre-release Version Identifier
  9808. // A numeric identifier, or a non-numeric identifier.
  9809. tok('PRERELEASEIDENTIFIER')
  9810. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  9811. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9812. tok('PRERELEASEIDENTIFIERLOOSE')
  9813. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  9814. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9815. // ## Pre-release Version
  9816. // Hyphen, followed by one or more dot-separated pre-release version
  9817. // identifiers.
  9818. tok('PRERELEASE')
  9819. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  9820. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  9821. tok('PRERELEASELOOSE')
  9822. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  9823. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  9824. // ## Build Metadata Identifier
  9825. // Any combination of digits, letters, or hyphens.
  9826. tok('BUILDIDENTIFIER')
  9827. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  9828. // ## Build Metadata
  9829. // Plus sign, followed by one or more period-separated build metadata
  9830. // identifiers.
  9831. tok('BUILD')
  9832. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  9833. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  9834. // ## Full Version String
  9835. // A main version, followed optionally by a pre-release version and
  9836. // build metadata.
  9837. // Note that the only major, minor, patch, and pre-release sections of
  9838. // the version string are capturing groups. The build metadata is not a
  9839. // capturing group, because it should not ever be used in version
  9840. // comparison.
  9841. tok('FULL')
  9842. tok('FULLPLAIN')
  9843. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  9844. src[t.PRERELEASE] + '?' +
  9845. src[t.BUILD] + '?'
  9846. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  9847. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  9848. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  9849. // common in the npm registry.
  9850. tok('LOOSEPLAIN')
  9851. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  9852. src[t.PRERELEASELOOSE] + '?' +
  9853. src[t.BUILD] + '?'
  9854. tok('LOOSE')
  9855. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  9856. tok('GTLT')
  9857. src[t.GTLT] = '((?:<|>)?=?)'
  9858. // Something like "2.*" or "1.2.x".
  9859. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  9860. // Only the first item is strictly required.
  9861. tok('XRANGEIDENTIFIERLOOSE')
  9862. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  9863. tok('XRANGEIDENTIFIER')
  9864. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  9865. tok('XRANGEPLAIN')
  9866. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  9867. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9868. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9869. '(?:' + src[t.PRERELEASE] + ')?' +
  9870. src[t.BUILD] + '?' +
  9871. ')?)?'
  9872. tok('XRANGEPLAINLOOSE')
  9873. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9874. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9875. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9876. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  9877. src[t.BUILD] + '?' +
  9878. ')?)?'
  9879. tok('XRANGE')
  9880. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  9881. tok('XRANGELOOSE')
  9882. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  9883. // Coercion.
  9884. // Extract anything that could conceivably be a part of a valid semver
  9885. tok('COERCE')
  9886. src[t.COERCE] = '(^|[^\\d])' +
  9887. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  9888. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  9889. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  9890. '(?:$|[^\\d])'
  9891. tok('COERCERTL')
  9892. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  9893. // Tilde ranges.
  9894. // Meaning is "reasonably at or greater than"
  9895. tok('LONETILDE')
  9896. src[t.LONETILDE] = '(?:~>?)'
  9897. tok('TILDETRIM')
  9898. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  9899. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  9900. var tildeTrimReplace = '$1~'
  9901. tok('TILDE')
  9902. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  9903. tok('TILDELOOSE')
  9904. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  9905. // Caret ranges.
  9906. // Meaning is "at least and backwards compatible with"
  9907. tok('LONECARET')
  9908. src[t.LONECARET] = '(?:\\^)'
  9909. tok('CARETTRIM')
  9910. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  9911. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  9912. var caretTrimReplace = '$1^'
  9913. tok('CARET')
  9914. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  9915. tok('CARETLOOSE')
  9916. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  9917. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  9918. tok('COMPARATORLOOSE')
  9919. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  9920. tok('COMPARATOR')
  9921. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  9922. // An expression to strip any whitespace between the gtlt and the thing
  9923. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  9924. tok('COMPARATORTRIM')
  9925. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  9926. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  9927. // this one has to use the /g flag
  9928. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  9929. var comparatorTrimReplace = '$1$2$3'
  9930. // Something like `1.2.3 - 1.2.4`
  9931. // Note that these all use the loose form, because they'll be
  9932. // checked against either the strict or loose comparator form
  9933. // later.
  9934. tok('HYPHENRANGE')
  9935. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  9936. '\\s+-\\s+' +
  9937. '(' + src[t.XRANGEPLAIN] + ')' +
  9938. '\\s*$'
  9939. tok('HYPHENRANGELOOSE')
  9940. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  9941. '\\s+-\\s+' +
  9942. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  9943. '\\s*$'
  9944. // Star ranges basically just allow anything at all.
  9945. tok('STAR')
  9946. src[t.STAR] = '(<|>)?=?\\s*\\*'
  9947. // Compile to actual regexp objects.
  9948. // All are flag-free, unless they were created above with a flag.
  9949. for (var i = 0; i < R; i++) {
  9950. debug(i, src[i])
  9951. if (!re[i]) {
  9952. re[i] = new RegExp(src[i])
  9953. }
  9954. }
  9955. exports.parse = parse
  9956. function parse (version, options) {
  9957. if (!options || typeof options !== 'object') {
  9958. options = {
  9959. loose: !!options,
  9960. includePrerelease: false
  9961. }
  9962. }
  9963. if (version instanceof SemVer) {
  9964. return version
  9965. }
  9966. if (typeof version !== 'string') {
  9967. return null
  9968. }
  9969. if (version.length > MAX_LENGTH) {
  9970. return null
  9971. }
  9972. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  9973. if (!r.test(version)) {
  9974. return null
  9975. }
  9976. try {
  9977. return new SemVer(version, options)
  9978. } catch (er) {
  9979. return null
  9980. }
  9981. }
  9982. exports.valid = valid
  9983. function valid (version, options) {
  9984. var v = parse(version, options)
  9985. return v ? v.version : null
  9986. }
  9987. exports.clean = clean
  9988. function clean (version, options) {
  9989. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  9990. return s ? s.version : null
  9991. }
  9992. exports.SemVer = SemVer
  9993. function SemVer (version, options) {
  9994. if (!options || typeof options !== 'object') {
  9995. options = {
  9996. loose: !!options,
  9997. includePrerelease: false
  9998. }
  9999. }
  10000. if (version instanceof SemVer) {
  10001. if (version.loose === options.loose) {
  10002. return version
  10003. } else {
  10004. version = version.version
  10005. }
  10006. } else if (typeof version !== 'string') {
  10007. throw new TypeError('Invalid Version: ' + version)
  10008. }
  10009. if (version.length > MAX_LENGTH) {
  10010. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  10011. }
  10012. if (!(this instanceof SemVer)) {
  10013. return new SemVer(version, options)
  10014. }
  10015. debug('SemVer', version, options)
  10016. this.options = options
  10017. this.loose = !!options.loose
  10018. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  10019. if (!m) {
  10020. throw new TypeError('Invalid Version: ' + version)
  10021. }
  10022. this.raw = version
  10023. // these are actually numbers
  10024. this.major = +m[1]
  10025. this.minor = +m[2]
  10026. this.patch = +m[3]
  10027. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  10028. throw new TypeError('Invalid major version')
  10029. }
  10030. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  10031. throw new TypeError('Invalid minor version')
  10032. }
  10033. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  10034. throw new TypeError('Invalid patch version')
  10035. }
  10036. // numberify any prerelease numeric ids
  10037. if (!m[4]) {
  10038. this.prerelease = []
  10039. } else {
  10040. this.prerelease = m[4].split('.').map(function (id) {
  10041. if (/^[0-9]+$/.test(id)) {
  10042. var num = +id
  10043. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  10044. return num
  10045. }
  10046. }
  10047. return id
  10048. })
  10049. }
  10050. this.build = m[5] ? m[5].split('.') : []
  10051. this.format()
  10052. }
  10053. SemVer.prototype.format = function () {
  10054. this.version = this.major + '.' + this.minor + '.' + this.patch
  10055. if (this.prerelease.length) {
  10056. this.version += '-' + this.prerelease.join('.')
  10057. }
  10058. return this.version
  10059. }
  10060. SemVer.prototype.toString = function () {
  10061. return this.version
  10062. }
  10063. SemVer.prototype.compare = function (other) {
  10064. debug('SemVer.compare', this.version, this.options, other)
  10065. if (!(other instanceof SemVer)) {
  10066. other = new SemVer(other, this.options)
  10067. }
  10068. return this.compareMain(other) || this.comparePre(other)
  10069. }
  10070. SemVer.prototype.compareMain = function (other) {
  10071. if (!(other instanceof SemVer)) {
  10072. other = new SemVer(other, this.options)
  10073. }
  10074. return compareIdentifiers(this.major, other.major) ||
  10075. compareIdentifiers(this.minor, other.minor) ||
  10076. compareIdentifiers(this.patch, other.patch)
  10077. }
  10078. SemVer.prototype.comparePre = function (other) {
  10079. if (!(other instanceof SemVer)) {
  10080. other = new SemVer(other, this.options)
  10081. }
  10082. // NOT having a prerelease is > having one
  10083. if (this.prerelease.length && !other.prerelease.length) {
  10084. return -1
  10085. } else if (!this.prerelease.length && other.prerelease.length) {
  10086. return 1
  10087. } else if (!this.prerelease.length && !other.prerelease.length) {
  10088. return 0
  10089. }
  10090. var i = 0
  10091. do {
  10092. var a = this.prerelease[i]
  10093. var b = other.prerelease[i]
  10094. debug('prerelease compare', i, a, b)
  10095. if (a === undefined && b === undefined) {
  10096. return 0
  10097. } else if (b === undefined) {
  10098. return 1
  10099. } else if (a === undefined) {
  10100. return -1
  10101. } else if (a === b) {
  10102. continue
  10103. } else {
  10104. return compareIdentifiers(a, b)
  10105. }
  10106. } while (++i)
  10107. }
  10108. SemVer.prototype.compareBuild = function (other) {
  10109. if (!(other instanceof SemVer)) {
  10110. other = new SemVer(other, this.options)
  10111. }
  10112. var i = 0
  10113. do {
  10114. var a = this.build[i]
  10115. var b = other.build[i]
  10116. debug('prerelease compare', i, a, b)
  10117. if (a === undefined && b === undefined) {
  10118. return 0
  10119. } else if (b === undefined) {
  10120. return 1
  10121. } else if (a === undefined) {
  10122. return -1
  10123. } else if (a === b) {
  10124. continue
  10125. } else {
  10126. return compareIdentifiers(a, b)
  10127. }
  10128. } while (++i)
  10129. }
  10130. // preminor will bump the version up to the next minor release, and immediately
  10131. // down to pre-release. premajor and prepatch work the same way.
  10132. SemVer.prototype.inc = function (release, identifier) {
  10133. switch (release) {
  10134. case 'premajor':
  10135. this.prerelease.length = 0
  10136. this.patch = 0
  10137. this.minor = 0
  10138. this.major++
  10139. this.inc('pre', identifier)
  10140. break
  10141. case 'preminor':
  10142. this.prerelease.length = 0
  10143. this.patch = 0
  10144. this.minor++
  10145. this.inc('pre', identifier)
  10146. break
  10147. case 'prepatch':
  10148. // If this is already a prerelease, it will bump to the next version
  10149. // drop any prereleases that might already exist, since they are not
  10150. // relevant at this point.
  10151. this.prerelease.length = 0
  10152. this.inc('patch', identifier)
  10153. this.inc('pre', identifier)
  10154. break
  10155. // If the input is a non-prerelease version, this acts the same as
  10156. // prepatch.
  10157. case 'prerelease':
  10158. if (this.prerelease.length === 0) {
  10159. this.inc('patch', identifier)
  10160. }
  10161. this.inc('pre', identifier)
  10162. break
  10163. case 'major':
  10164. // If this is a pre-major version, bump up to the same major version.
  10165. // Otherwise increment major.
  10166. // 1.0.0-5 bumps to 1.0.0
  10167. // 1.1.0 bumps to 2.0.0
  10168. if (this.minor !== 0 ||
  10169. this.patch !== 0 ||
  10170. this.prerelease.length === 0) {
  10171. this.major++
  10172. }
  10173. this.minor = 0
  10174. this.patch = 0
  10175. this.prerelease = []
  10176. break
  10177. case 'minor':
  10178. // If this is a pre-minor version, bump up to the same minor version.
  10179. // Otherwise increment minor.
  10180. // 1.2.0-5 bumps to 1.2.0
  10181. // 1.2.1 bumps to 1.3.0
  10182. if (this.patch !== 0 || this.prerelease.length === 0) {
  10183. this.minor++
  10184. }
  10185. this.patch = 0
  10186. this.prerelease = []
  10187. break
  10188. case 'patch':
  10189. // If this is not a pre-release version, it will increment the patch.
  10190. // If it is a pre-release it will bump up to the same patch version.
  10191. // 1.2.0-5 patches to 1.2.0
  10192. // 1.2.0 patches to 1.2.1
  10193. if (this.prerelease.length === 0) {
  10194. this.patch++
  10195. }
  10196. this.prerelease = []
  10197. break
  10198. // This probably shouldn't be used publicly.
  10199. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10200. case 'pre':
  10201. if (this.prerelease.length === 0) {
  10202. this.prerelease = [0]
  10203. } else {
  10204. var i = this.prerelease.length
  10205. while (--i >= 0) {
  10206. if (typeof this.prerelease[i] === 'number') {
  10207. this.prerelease[i]++
  10208. i = -2
  10209. }
  10210. }
  10211. if (i === -1) {
  10212. // didn't increment anything
  10213. this.prerelease.push(0)
  10214. }
  10215. }
  10216. if (identifier) {
  10217. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10218. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10219. if (this.prerelease[0] === identifier) {
  10220. if (isNaN(this.prerelease[1])) {
  10221. this.prerelease = [identifier, 0]
  10222. }
  10223. } else {
  10224. this.prerelease = [identifier, 0]
  10225. }
  10226. }
  10227. break
  10228. default:
  10229. throw new Error('invalid increment argument: ' + release)
  10230. }
  10231. this.format()
  10232. this.raw = this.version
  10233. return this
  10234. }
  10235. exports.inc = inc
  10236. function inc (version, release, loose, identifier) {
  10237. if (typeof (loose) === 'string') {
  10238. identifier = loose
  10239. loose = undefined
  10240. }
  10241. try {
  10242. return new SemVer(version, loose).inc(release, identifier).version
  10243. } catch (er) {
  10244. return null
  10245. }
  10246. }
  10247. exports.diff = diff
  10248. function diff (version1, version2) {
  10249. if (eq(version1, version2)) {
  10250. return null
  10251. } else {
  10252. var v1 = parse(version1)
  10253. var v2 = parse(version2)
  10254. var prefix = ''
  10255. if (v1.prerelease.length || v2.prerelease.length) {
  10256. prefix = 'pre'
  10257. var defaultResult = 'prerelease'
  10258. }
  10259. for (var key in v1) {
  10260. if (key === 'major' || key === 'minor' || key === 'patch') {
  10261. if (v1[key] !== v2[key]) {
  10262. return prefix + key
  10263. }
  10264. }
  10265. }
  10266. return defaultResult // may be undefined
  10267. }
  10268. }
  10269. exports.compareIdentifiers = compareIdentifiers
  10270. var numeric = /^[0-9]+$/
  10271. function compareIdentifiers (a, b) {
  10272. var anum = numeric.test(a)
  10273. var bnum = numeric.test(b)
  10274. if (anum && bnum) {
  10275. a = +a
  10276. b = +b
  10277. }
  10278. return a === b ? 0
  10279. : (anum && !bnum) ? -1
  10280. : (bnum && !anum) ? 1
  10281. : a < b ? -1
  10282. : 1
  10283. }
  10284. exports.rcompareIdentifiers = rcompareIdentifiers
  10285. function rcompareIdentifiers (a, b) {
  10286. return compareIdentifiers(b, a)
  10287. }
  10288. exports.major = major
  10289. function major (a, loose) {
  10290. return new SemVer(a, loose).major
  10291. }
  10292. exports.minor = minor
  10293. function minor (a, loose) {
  10294. return new SemVer(a, loose).minor
  10295. }
  10296. exports.patch = patch
  10297. function patch (a, loose) {
  10298. return new SemVer(a, loose).patch
  10299. }
  10300. exports.compare = compare
  10301. function compare (a, b, loose) {
  10302. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10303. }
  10304. exports.compareLoose = compareLoose
  10305. function compareLoose (a, b) {
  10306. return compare(a, b, true)
  10307. }
  10308. exports.compareBuild = compareBuild
  10309. function compareBuild (a, b, loose) {
  10310. var versionA = new SemVer(a, loose)
  10311. var versionB = new SemVer(b, loose)
  10312. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10313. }
  10314. exports.rcompare = rcompare
  10315. function rcompare (a, b, loose) {
  10316. return compare(b, a, loose)
  10317. }
  10318. exports.sort = sort
  10319. function sort (list, loose) {
  10320. return list.sort(function (a, b) {
  10321. return exports.compareBuild(a, b, loose)
  10322. })
  10323. }
  10324. exports.rsort = rsort
  10325. function rsort (list, loose) {
  10326. return list.sort(function (a, b) {
  10327. return exports.compareBuild(b, a, loose)
  10328. })
  10329. }
  10330. exports.gt = gt
  10331. function gt (a, b, loose) {
  10332. return compare(a, b, loose) > 0
  10333. }
  10334. exports.lt = lt
  10335. function lt (a, b, loose) {
  10336. return compare(a, b, loose) < 0
  10337. }
  10338. exports.eq = eq
  10339. function eq (a, b, loose) {
  10340. return compare(a, b, loose) === 0
  10341. }
  10342. exports.neq = neq
  10343. function neq (a, b, loose) {
  10344. return compare(a, b, loose) !== 0
  10345. }
  10346. exports.gte = gte
  10347. function gte (a, b, loose) {
  10348. return compare(a, b, loose) >= 0
  10349. }
  10350. exports.lte = lte
  10351. function lte (a, b, loose) {
  10352. return compare(a, b, loose) <= 0
  10353. }
  10354. exports.cmp = cmp
  10355. function cmp (a, op, b, loose) {
  10356. switch (op) {
  10357. case '===':
  10358. if (typeof a === 'object')
  10359. a = a.version
  10360. if (typeof b === 'object')
  10361. b = b.version
  10362. return a === b
  10363. case '!==':
  10364. if (typeof a === 'object')
  10365. a = a.version
  10366. if (typeof b === 'object')
  10367. b = b.version
  10368. return a !== b
  10369. case '':
  10370. case '=':
  10371. case '==':
  10372. return eq(a, b, loose)
  10373. case '!=':
  10374. return neq(a, b, loose)
  10375. case '>':
  10376. return gt(a, b, loose)
  10377. case '>=':
  10378. return gte(a, b, loose)
  10379. case '<':
  10380. return lt(a, b, loose)
  10381. case '<=':
  10382. return lte(a, b, loose)
  10383. default:
  10384. throw new TypeError('Invalid operator: ' + op)
  10385. }
  10386. }
  10387. exports.Comparator = Comparator
  10388. function Comparator (comp, options) {
  10389. if (!options || typeof options !== 'object') {
  10390. options = {
  10391. loose: !!options,
  10392. includePrerelease: false
  10393. }
  10394. }
  10395. if (comp instanceof Comparator) {
  10396. if (comp.loose === !!options.loose) {
  10397. return comp
  10398. } else {
  10399. comp = comp.value
  10400. }
  10401. }
  10402. if (!(this instanceof Comparator)) {
  10403. return new Comparator(comp, options)
  10404. }
  10405. debug('comparator', comp, options)
  10406. this.options = options
  10407. this.loose = !!options.loose
  10408. this.parse(comp)
  10409. if (this.semver === ANY) {
  10410. this.value = ''
  10411. } else {
  10412. this.value = this.operator + this.semver.version
  10413. }
  10414. debug('comp', this)
  10415. }
  10416. var ANY = {}
  10417. Comparator.prototype.parse = function (comp) {
  10418. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10419. var m = comp.match(r)
  10420. if (!m) {
  10421. throw new TypeError('Invalid comparator: ' + comp)
  10422. }
  10423. this.operator = m[1] !== undefined ? m[1] : ''
  10424. if (this.operator === '=') {
  10425. this.operator = ''
  10426. }
  10427. // if it literally is just '>' or '' then allow anything.
  10428. if (!m[2]) {
  10429. this.semver = ANY
  10430. } else {
  10431. this.semver = new SemVer(m[2], this.options.loose)
  10432. }
  10433. }
  10434. Comparator.prototype.toString = function () {
  10435. return this.value
  10436. }
  10437. Comparator.prototype.test = function (version) {
  10438. debug('Comparator.test', version, this.options.loose)
  10439. if (this.semver === ANY || version === ANY) {
  10440. return true
  10441. }
  10442. if (typeof version === 'string') {
  10443. try {
  10444. version = new SemVer(version, this.options)
  10445. } catch (er) {
  10446. return false
  10447. }
  10448. }
  10449. return cmp(version, this.operator, this.semver, this.options)
  10450. }
  10451. Comparator.prototype.intersects = function (comp, options) {
  10452. if (!(comp instanceof Comparator)) {
  10453. throw new TypeError('a Comparator is required')
  10454. }
  10455. if (!options || typeof options !== 'object') {
  10456. options = {
  10457. loose: !!options,
  10458. includePrerelease: false
  10459. }
  10460. }
  10461. var rangeTmp
  10462. if (this.operator === '') {
  10463. if (this.value === '') {
  10464. return true
  10465. }
  10466. rangeTmp = new Range(comp.value, options)
  10467. return satisfies(this.value, rangeTmp, options)
  10468. } else if (comp.operator === '') {
  10469. if (comp.value === '') {
  10470. return true
  10471. }
  10472. rangeTmp = new Range(this.value, options)
  10473. return satisfies(comp.semver, rangeTmp, options)
  10474. }
  10475. var sameDirectionIncreasing =
  10476. (this.operator === '>=' || this.operator === '>') &&
  10477. (comp.operator === '>=' || comp.operator === '>')
  10478. var sameDirectionDecreasing =
  10479. (this.operator === '<=' || this.operator === '<') &&
  10480. (comp.operator === '<=' || comp.operator === '<')
  10481. var sameSemVer = this.semver.version === comp.semver.version
  10482. var differentDirectionsInclusive =
  10483. (this.operator === '>=' || this.operator === '<=') &&
  10484. (comp.operator === '>=' || comp.operator === '<=')
  10485. var oppositeDirectionsLessThan =
  10486. cmp(this.semver, '<', comp.semver, options) &&
  10487. ((this.operator === '>=' || this.operator === '>') &&
  10488. (comp.operator === '<=' || comp.operator === '<'))
  10489. var oppositeDirectionsGreaterThan =
  10490. cmp(this.semver, '>', comp.semver, options) &&
  10491. ((this.operator === '<=' || this.operator === '<') &&
  10492. (comp.operator === '>=' || comp.operator === '>'))
  10493. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10494. (sameSemVer && differentDirectionsInclusive) ||
  10495. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10496. }
  10497. exports.Range = Range
  10498. function Range (range, options) {
  10499. if (!options || typeof options !== 'object') {
  10500. options = {
  10501. loose: !!options,
  10502. includePrerelease: false
  10503. }
  10504. }
  10505. if (range instanceof Range) {
  10506. if (range.loose === !!options.loose &&
  10507. range.includePrerelease === !!options.includePrerelease) {
  10508. return range
  10509. } else {
  10510. return new Range(range.raw, options)
  10511. }
  10512. }
  10513. if (range instanceof Comparator) {
  10514. return new Range(range.value, options)
  10515. }
  10516. if (!(this instanceof Range)) {
  10517. return new Range(range, options)
  10518. }
  10519. this.options = options
  10520. this.loose = !!options.loose
  10521. this.includePrerelease = !!options.includePrerelease
  10522. // First, split based on boolean or ||
  10523. this.raw = range
  10524. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10525. return this.parseRange(range.trim())
  10526. }, this).filter(function (c) {
  10527. // throw out any that are not relevant for whatever reason
  10528. return c.length
  10529. })
  10530. if (!this.set.length) {
  10531. throw new TypeError('Invalid SemVer Range: ' + range)
  10532. }
  10533. this.format()
  10534. }
  10535. Range.prototype.format = function () {
  10536. this.range = this.set.map(function (comps) {
  10537. return comps.join(' ').trim()
  10538. }).join('||').trim()
  10539. return this.range
  10540. }
  10541. Range.prototype.toString = function () {
  10542. return this.range
  10543. }
  10544. Range.prototype.parseRange = function (range) {
  10545. var loose = this.options.loose
  10546. range = range.trim()
  10547. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10548. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10549. range = range.replace(hr, hyphenReplace)
  10550. debug('hyphen replace', range)
  10551. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10552. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10553. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10554. // `~ 1.2.3` => `~1.2.3`
  10555. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10556. // `^ 1.2.3` => `^1.2.3`
  10557. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10558. // normalize spaces
  10559. range = range.split(/\s+/).join(' ')
  10560. // At this point, the range is completely trimmed and
  10561. // ready to be split into comparators.
  10562. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10563. var set = range.split(' ').map(function (comp) {
  10564. return parseComparator(comp, this.options)
  10565. }, this).join(' ').split(/\s+/)
  10566. if (this.options.loose) {
  10567. // in loose mode, throw out any that are not valid comparators
  10568. set = set.filter(function (comp) {
  10569. return !!comp.match(compRe)
  10570. })
  10571. }
  10572. set = set.map(function (comp) {
  10573. return new Comparator(comp, this.options)
  10574. }, this)
  10575. return set
  10576. }
  10577. Range.prototype.intersects = function (range, options) {
  10578. if (!(range instanceof Range)) {
  10579. throw new TypeError('a Range is required')
  10580. }
  10581. return this.set.some(function (thisComparators) {
  10582. return (
  10583. isSatisfiable(thisComparators, options) &&
  10584. range.set.some(function (rangeComparators) {
  10585. return (
  10586. isSatisfiable(rangeComparators, options) &&
  10587. thisComparators.every(function (thisComparator) {
  10588. return rangeComparators.every(function (rangeComparator) {
  10589. return thisComparator.intersects(rangeComparator, options)
  10590. })
  10591. })
  10592. )
  10593. })
  10594. )
  10595. })
  10596. }
  10597. // take a set of comparators and determine whether there
  10598. // exists a version which can satisfy it
  10599. function isSatisfiable (comparators, options) {
  10600. var result = true
  10601. var remainingComparators = comparators.slice()
  10602. var testComparator = remainingComparators.pop()
  10603. while (result && remainingComparators.length) {
  10604. result = remainingComparators.every(function (otherComparator) {
  10605. return testComparator.intersects(otherComparator, options)
  10606. })
  10607. testComparator = remainingComparators.pop()
  10608. }
  10609. return result
  10610. }
  10611. // Mostly just for testing and legacy API reasons
  10612. exports.toComparators = toComparators
  10613. function toComparators (range, options) {
  10614. return new Range(range, options).set.map(function (comp) {
  10615. return comp.map(function (c) {
  10616. return c.value
  10617. }).join(' ').trim().split(' ')
  10618. })
  10619. }
  10620. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10621. // already replaced the hyphen ranges
  10622. // turn into a set of JUST comparators.
  10623. function parseComparator (comp, options) {
  10624. debug('comp', comp, options)
  10625. comp = replaceCarets(comp, options)
  10626. debug('caret', comp)
  10627. comp = replaceTildes(comp, options)
  10628. debug('tildes', comp)
  10629. comp = replaceXRanges(comp, options)
  10630. debug('xrange', comp)
  10631. comp = replaceStars(comp, options)
  10632. debug('stars', comp)
  10633. return comp
  10634. }
  10635. function isX (id) {
  10636. return !id || id.toLowerCase() === 'x' || id === '*'
  10637. }
  10638. // ~, ~> --> * (any, kinda silly)
  10639. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10640. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10641. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10642. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10643. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10644. function replaceTildes (comp, options) {
  10645. return comp.trim().split(/\s+/).map(function (comp) {
  10646. return replaceTilde(comp, options)
  10647. }).join(' ')
  10648. }
  10649. function replaceTilde (comp, options) {
  10650. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10651. return comp.replace(r, function (_, M, m, p, pr) {
  10652. debug('tilde', comp, _, M, m, p, pr)
  10653. var ret
  10654. if (isX(M)) {
  10655. ret = ''
  10656. } else if (isX(m)) {
  10657. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10658. } else if (isX(p)) {
  10659. // ~1.2 == >=1.2.0 <1.3.0
  10660. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10661. } else if (pr) {
  10662. debug('replaceTilde pr', pr)
  10663. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10664. ' <' + M + '.' + (+m + 1) + '.0'
  10665. } else {
  10666. // ~1.2.3 == >=1.2.3 <1.3.0
  10667. ret = '>=' + M + '.' + m + '.' + p +
  10668. ' <' + M + '.' + (+m + 1) + '.0'
  10669. }
  10670. debug('tilde return', ret)
  10671. return ret
  10672. })
  10673. }
  10674. // ^ --> * (any, kinda silly)
  10675. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10676. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10677. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10678. // ^1.2.3 --> >=1.2.3 <2.0.0
  10679. // ^1.2.0 --> >=1.2.0 <2.0.0
  10680. function replaceCarets (comp, options) {
  10681. return comp.trim().split(/\s+/).map(function (comp) {
  10682. return replaceCaret(comp, options)
  10683. }).join(' ')
  10684. }
  10685. function replaceCaret (comp, options) {
  10686. debug('caret', comp, options)
  10687. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10688. return comp.replace(r, function (_, M, m, p, pr) {
  10689. debug('caret', comp, _, M, m, p, pr)
  10690. var ret
  10691. if (isX(M)) {
  10692. ret = ''
  10693. } else if (isX(m)) {
  10694. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10695. } else if (isX(p)) {
  10696. if (M === '0') {
  10697. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10698. } else {
  10699. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10700. }
  10701. } else if (pr) {
  10702. debug('replaceCaret pr', pr)
  10703. if (M === '0') {
  10704. if (m === '0') {
  10705. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10706. ' <' + M + '.' + m + '.' + (+p + 1)
  10707. } else {
  10708. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10709. ' <' + M + '.' + (+m + 1) + '.0'
  10710. }
  10711. } else {
  10712. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10713. ' <' + (+M + 1) + '.0.0'
  10714. }
  10715. } else {
  10716. debug('no pr')
  10717. if (M === '0') {
  10718. if (m === '0') {
  10719. ret = '>=' + M + '.' + m + '.' + p +
  10720. ' <' + M + '.' + m + '.' + (+p + 1)
  10721. } else {
  10722. ret = '>=' + M + '.' + m + '.' + p +
  10723. ' <' + M + '.' + (+m + 1) + '.0'
  10724. }
  10725. } else {
  10726. ret = '>=' + M + '.' + m + '.' + p +
  10727. ' <' + (+M + 1) + '.0.0'
  10728. }
  10729. }
  10730. debug('caret return', ret)
  10731. return ret
  10732. })
  10733. }
  10734. function replaceXRanges (comp, options) {
  10735. debug('replaceXRanges', comp, options)
  10736. return comp.split(/\s+/).map(function (comp) {
  10737. return replaceXRange(comp, options)
  10738. }).join(' ')
  10739. }
  10740. function replaceXRange (comp, options) {
  10741. comp = comp.trim()
  10742. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10743. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10744. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10745. var xM = isX(M)
  10746. var xm = xM || isX(m)
  10747. var xp = xm || isX(p)
  10748. var anyX = xp
  10749. if (gtlt === '=' && anyX) {
  10750. gtlt = ''
  10751. }
  10752. // if we're including prereleases in the match, then we need
  10753. // to fix this to -0, the lowest possible prerelease value
  10754. pr = options.includePrerelease ? '-0' : ''
  10755. if (xM) {
  10756. if (gtlt === '>' || gtlt === '<') {
  10757. // nothing is allowed
  10758. ret = '<0.0.0-0'
  10759. } else {
  10760. // nothing is forbidden
  10761. ret = '*'
  10762. }
  10763. } else if (gtlt && anyX) {
  10764. // we know patch is an x, because we have any x at all.
  10765. // replace X with 0
  10766. if (xm) {
  10767. m = 0
  10768. }
  10769. p = 0
  10770. if (gtlt === '>') {
  10771. // >1 => >=2.0.0
  10772. // >1.2 => >=1.3.0
  10773. // >1.2.3 => >= 1.2.4
  10774. gtlt = '>='
  10775. if (xm) {
  10776. M = +M + 1
  10777. m = 0
  10778. p = 0
  10779. } else {
  10780. m = +m + 1
  10781. p = 0
  10782. }
  10783. } else if (gtlt === '<=') {
  10784. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10785. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10786. gtlt = '<'
  10787. if (xm) {
  10788. M = +M + 1
  10789. } else {
  10790. m = +m + 1
  10791. }
  10792. }
  10793. ret = gtlt + M + '.' + m + '.' + p + pr
  10794. } else if (xm) {
  10795. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10796. } else if (xp) {
  10797. ret = '>=' + M + '.' + m + '.0' + pr +
  10798. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10799. }
  10800. debug('xRange return', ret)
  10801. return ret
  10802. })
  10803. }
  10804. // Because * is AND-ed with everything else in the comparator,
  10805. // and '' means "any version", just remove the *s entirely.
  10806. function replaceStars (comp, options) {
  10807. debug('replaceStars', comp, options)
  10808. // Looseness is ignored here. star is always as loose as it gets!
  10809. return comp.trim().replace(re[t.STAR], '')
  10810. }
  10811. // This function is passed to string.replace(re[t.HYPHENRANGE])
  10812. // M, m, patch, prerelease, build
  10813. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  10814. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  10815. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  10816. function hyphenReplace ($0,
  10817. from, fM, fm, fp, fpr, fb,
  10818. to, tM, tm, tp, tpr, tb) {
  10819. if (isX(fM)) {
  10820. from = ''
  10821. } else if (isX(fm)) {
  10822. from = '>=' + fM + '.0.0'
  10823. } else if (isX(fp)) {
  10824. from = '>=' + fM + '.' + fm + '.0'
  10825. } else {
  10826. from = '>=' + from
  10827. }
  10828. if (isX(tM)) {
  10829. to = ''
  10830. } else if (isX(tm)) {
  10831. to = '<' + (+tM + 1) + '.0.0'
  10832. } else if (isX(tp)) {
  10833. to = '<' + tM + '.' + (+tm + 1) + '.0'
  10834. } else if (tpr) {
  10835. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  10836. } else {
  10837. to = '<=' + to
  10838. }
  10839. return (from + ' ' + to).trim()
  10840. }
  10841. // if ANY of the sets match ALL of its comparators, then pass
  10842. Range.prototype.test = function (version) {
  10843. if (!version) {
  10844. return false
  10845. }
  10846. if (typeof version === 'string') {
  10847. try {
  10848. version = new SemVer(version, this.options)
  10849. } catch (er) {
  10850. return false
  10851. }
  10852. }
  10853. for (var i = 0; i < this.set.length; i++) {
  10854. if (testSet(this.set[i], version, this.options)) {
  10855. return true
  10856. }
  10857. }
  10858. return false
  10859. }
  10860. function testSet (set, version, options) {
  10861. for (var i = 0; i < set.length; i++) {
  10862. if (!set[i].test(version)) {
  10863. return false
  10864. }
  10865. }
  10866. if (version.prerelease.length && !options.includePrerelease) {
  10867. // Find the set of versions that are allowed to have prereleases
  10868. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  10869. // That should allow `1.2.3-pr.2` to pass.
  10870. // However, `1.2.4-alpha.notready` should NOT be allowed,
  10871. // even though it's within the range set by the comparators.
  10872. for (i = 0; i < set.length; i++) {
  10873. debug(set[i].semver)
  10874. if (set[i].semver === ANY) {
  10875. continue
  10876. }
  10877. if (set[i].semver.prerelease.length > 0) {
  10878. var allowed = set[i].semver
  10879. if (allowed.major === version.major &&
  10880. allowed.minor === version.minor &&
  10881. allowed.patch === version.patch) {
  10882. return true
  10883. }
  10884. }
  10885. }
  10886. // Version has a -pre, but it's not one of the ones we like.
  10887. return false
  10888. }
  10889. return true
  10890. }
  10891. exports.satisfies = satisfies
  10892. function satisfies (version, range, options) {
  10893. try {
  10894. range = new Range(range, options)
  10895. } catch (er) {
  10896. return false
  10897. }
  10898. return range.test(version)
  10899. }
  10900. exports.maxSatisfying = maxSatisfying
  10901. function maxSatisfying (versions, range, options) {
  10902. var max = null
  10903. var maxSV = null
  10904. try {
  10905. var rangeObj = new Range(range, options)
  10906. } catch (er) {
  10907. return null
  10908. }
  10909. versions.forEach(function (v) {
  10910. if (rangeObj.test(v)) {
  10911. // satisfies(v, range, options)
  10912. if (!max || maxSV.compare(v) === -1) {
  10913. // compare(max, v, true)
  10914. max = v
  10915. maxSV = new SemVer(max, options)
  10916. }
  10917. }
  10918. })
  10919. return max
  10920. }
  10921. exports.minSatisfying = minSatisfying
  10922. function minSatisfying (versions, range, options) {
  10923. var min = null
  10924. var minSV = null
  10925. try {
  10926. var rangeObj = new Range(range, options)
  10927. } catch (er) {
  10928. return null
  10929. }
  10930. versions.forEach(function (v) {
  10931. if (rangeObj.test(v)) {
  10932. // satisfies(v, range, options)
  10933. if (!min || minSV.compare(v) === 1) {
  10934. // compare(min, v, true)
  10935. min = v
  10936. minSV = new SemVer(min, options)
  10937. }
  10938. }
  10939. })
  10940. return min
  10941. }
  10942. exports.minVersion = minVersion
  10943. function minVersion (range, loose) {
  10944. range = new Range(range, loose)
  10945. var minver = new SemVer('0.0.0')
  10946. if (range.test(minver)) {
  10947. return minver
  10948. }
  10949. minver = new SemVer('0.0.0-0')
  10950. if (range.test(minver)) {
  10951. return minver
  10952. }
  10953. minver = null
  10954. for (var i = 0; i < range.set.length; ++i) {
  10955. var comparators = range.set[i]
  10956. comparators.forEach(function (comparator) {
  10957. // Clone to avoid manipulating the comparator's semver object.
  10958. var compver = new SemVer(comparator.semver.version)
  10959. switch (comparator.operator) {
  10960. case '>':
  10961. if (compver.prerelease.length === 0) {
  10962. compver.patch++
  10963. } else {
  10964. compver.prerelease.push(0)
  10965. }
  10966. compver.raw = compver.format()
  10967. /* fallthrough */
  10968. case '':
  10969. case '>=':
  10970. if (!minver || gt(minver, compver)) {
  10971. minver = compver
  10972. }
  10973. break
  10974. case '<':
  10975. case '<=':
  10976. /* Ignore maximum versions */
  10977. break
  10978. /* istanbul ignore next */
  10979. default:
  10980. throw new Error('Unexpected operation: ' + comparator.operator)
  10981. }
  10982. })
  10983. }
  10984. if (minver && range.test(minver)) {
  10985. return minver
  10986. }
  10987. return null
  10988. }
  10989. exports.validRange = validRange
  10990. function validRange (range, options) {
  10991. try {
  10992. // Return '*' instead of '' so that truthiness works.
  10993. // This will throw if it's invalid anyway
  10994. return new Range(range, options).range || '*'
  10995. } catch (er) {
  10996. return null
  10997. }
  10998. }
  10999. // Determine if version is less than all the versions possible in the range
  11000. exports.ltr = ltr
  11001. function ltr (version, range, options) {
  11002. return outside(version, range, '<', options)
  11003. }
  11004. // Determine if version is greater than all the versions possible in the range.
  11005. exports.gtr = gtr
  11006. function gtr (version, range, options) {
  11007. return outside(version, range, '>', options)
  11008. }
  11009. exports.outside = outside
  11010. function outside (version, range, hilo, options) {
  11011. version = new SemVer(version, options)
  11012. range = new Range(range, options)
  11013. var gtfn, ltefn, ltfn, comp, ecomp
  11014. switch (hilo) {
  11015. case '>':
  11016. gtfn = gt
  11017. ltefn = lte
  11018. ltfn = lt
  11019. comp = '>'
  11020. ecomp = '>='
  11021. break
  11022. case '<':
  11023. gtfn = lt
  11024. ltefn = gte
  11025. ltfn = gt
  11026. comp = '<'
  11027. ecomp = '<='
  11028. break
  11029. default:
  11030. throw new TypeError('Must provide a hilo val of "<" or ">"')
  11031. }
  11032. // If it satisifes the range it is not outside
  11033. if (satisfies(version, range, options)) {
  11034. return false
  11035. }
  11036. // From now on, variable terms are as if we're in "gtr" mode.
  11037. // but note that everything is flipped for the "ltr" function.
  11038. for (var i = 0; i < range.set.length; ++i) {
  11039. var comparators = range.set[i]
  11040. var high = null
  11041. var low = null
  11042. comparators.forEach(function (comparator) {
  11043. if (comparator.semver === ANY) {
  11044. comparator = new Comparator('>=0.0.0')
  11045. }
  11046. high = high || comparator
  11047. low = low || comparator
  11048. if (gtfn(comparator.semver, high.semver, options)) {
  11049. high = comparator
  11050. } else if (ltfn(comparator.semver, low.semver, options)) {
  11051. low = comparator
  11052. }
  11053. })
  11054. // If the edge version comparator has a operator then our version
  11055. // isn't outside it
  11056. if (high.operator === comp || high.operator === ecomp) {
  11057. return false
  11058. }
  11059. // If the lowest version comparator has an operator and our version
  11060. // is less than it then it isn't higher than the range
  11061. if ((!low.operator || low.operator === comp) &&
  11062. ltefn(version, low.semver)) {
  11063. return false
  11064. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  11065. return false
  11066. }
  11067. }
  11068. return true
  11069. }
  11070. exports.prerelease = prerelease
  11071. function prerelease (version, options) {
  11072. var parsed = parse(version, options)
  11073. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  11074. }
  11075. exports.intersects = intersects
  11076. function intersects (r1, r2, options) {
  11077. r1 = new Range(r1, options)
  11078. r2 = new Range(r2, options)
  11079. return r1.intersects(r2)
  11080. }
  11081. exports.coerce = coerce
  11082. function coerce (version, options) {
  11083. if (version instanceof SemVer) {
  11084. return version
  11085. }
  11086. if (typeof version === 'number') {
  11087. version = String(version)
  11088. }
  11089. if (typeof version !== 'string') {
  11090. return null
  11091. }
  11092. options = options || {}
  11093. var match = null
  11094. if (!options.rtl) {
  11095. match = version.match(re[t.COERCE])
  11096. } else {
  11097. // Find the right-most coercible string that does not share
  11098. // a terminus with a more left-ward coercible string.
  11099. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  11100. //
  11101. // Walk through the string checking with a /g regexp
  11102. // Manually set the index so as to pick up overlapping matches.
  11103. // Stop when we get a match that ends at the string end, since no
  11104. // coercible string can be more right-ward without the same terminus.
  11105. var next
  11106. while ((next = re[t.COERCERTL].exec(version)) &&
  11107. (!match || match.index + match[0].length !== version.length)
  11108. ) {
  11109. if (!match ||
  11110. next.index + next[0].length !== match.index + match[0].length) {
  11111. match = next
  11112. }
  11113. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  11114. }
  11115. // leave it in a clean state
  11116. re[t.COERCERTL].lastIndex = -1
  11117. }
  11118. if (match === null) {
  11119. return null
  11120. }
  11121. return parse(match[2] +
  11122. '.' + (match[3] || '0') +
  11123. '.' + (match[4] || '0'), options)
  11124. }
  11125. /***/ }),
  11126. /***/ 669:
  11127. /***/ (function(module) {
  11128. module.exports = require("util");
  11129. /***/ }),
  11130. /***/ 672:
  11131. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11132. "use strict";
  11133. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  11134. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  11135. return new (P || (P = Promise))(function (resolve, reject) {
  11136. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  11137. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  11138. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  11139. step((generator = generator.apply(thisArg, _arguments || [])).next());
  11140. });
  11141. };
  11142. var _a;
  11143. Object.defineProperty(exports, "__esModule", { value: true });
  11144. const assert_1 = __webpack_require__(357);
  11145. const fs = __webpack_require__(747);
  11146. const path = __webpack_require__(622);
  11147. _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;
  11148. exports.IS_WINDOWS = process.platform === 'win32';
  11149. function exists(fsPath) {
  11150. return __awaiter(this, void 0, void 0, function* () {
  11151. try {
  11152. yield exports.stat(fsPath);
  11153. }
  11154. catch (err) {
  11155. if (err.code === 'ENOENT') {
  11156. return false;
  11157. }
  11158. throw err;
  11159. }
  11160. return true;
  11161. });
  11162. }
  11163. exports.exists = exists;
  11164. function isDirectory(fsPath, useStat = false) {
  11165. return __awaiter(this, void 0, void 0, function* () {
  11166. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  11167. return stats.isDirectory();
  11168. });
  11169. }
  11170. exports.isDirectory = isDirectory;
  11171. /**
  11172. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  11173. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  11174. */
  11175. function isRooted(p) {
  11176. p = normalizeSeparators(p);
  11177. if (!p) {
  11178. throw new Error('isRooted() parameter "p" cannot be empty');
  11179. }
  11180. if (exports.IS_WINDOWS) {
  11181. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11182. ); // e.g. C: or C:\hello
  11183. }
  11184. return p.startsWith('/');
  11185. }
  11186. exports.isRooted = isRooted;
  11187. /**
  11188. * Recursively create a directory at `fsPath`.
  11189. *
  11190. * This implementation is optimistic, meaning it attempts to create the full
  11191. * path first, and backs up the path stack from there.
  11192. *
  11193. * @param fsPath The path to create
  11194. * @param maxDepth The maximum recursion depth
  11195. * @param depth The current recursion depth
  11196. */
  11197. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11198. return __awaiter(this, void 0, void 0, function* () {
  11199. assert_1.ok(fsPath, 'a path argument must be provided');
  11200. fsPath = path.resolve(fsPath);
  11201. if (depth >= maxDepth)
  11202. return exports.mkdir(fsPath);
  11203. try {
  11204. yield exports.mkdir(fsPath);
  11205. return;
  11206. }
  11207. catch (err) {
  11208. switch (err.code) {
  11209. case 'ENOENT': {
  11210. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11211. yield exports.mkdir(fsPath);
  11212. return;
  11213. }
  11214. default: {
  11215. let stats;
  11216. try {
  11217. stats = yield exports.stat(fsPath);
  11218. }
  11219. catch (err2) {
  11220. throw err;
  11221. }
  11222. if (!stats.isDirectory())
  11223. throw err;
  11224. }
  11225. }
  11226. }
  11227. });
  11228. }
  11229. exports.mkdirP = mkdirP;
  11230. /**
  11231. * Best effort attempt to determine whether a file exists and is executable.
  11232. * @param filePath file path to check
  11233. * @param extensions additional file extensions to try
  11234. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11235. */
  11236. function tryGetExecutablePath(filePath, extensions) {
  11237. return __awaiter(this, void 0, void 0, function* () {
  11238. let stats = undefined;
  11239. try {
  11240. // test file exists
  11241. stats = yield exports.stat(filePath);
  11242. }
  11243. catch (err) {
  11244. if (err.code !== 'ENOENT') {
  11245. // eslint-disable-next-line no-console
  11246. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11247. }
  11248. }
  11249. if (stats && stats.isFile()) {
  11250. if (exports.IS_WINDOWS) {
  11251. // on Windows, test for valid extension
  11252. const upperExt = path.extname(filePath).toUpperCase();
  11253. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11254. return filePath;
  11255. }
  11256. }
  11257. else {
  11258. if (isUnixExecutable(stats)) {
  11259. return filePath;
  11260. }
  11261. }
  11262. }
  11263. // try each extension
  11264. const originalFilePath = filePath;
  11265. for (const extension of extensions) {
  11266. filePath = originalFilePath + extension;
  11267. stats = undefined;
  11268. try {
  11269. stats = yield exports.stat(filePath);
  11270. }
  11271. catch (err) {
  11272. if (err.code !== 'ENOENT') {
  11273. // eslint-disable-next-line no-console
  11274. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11275. }
  11276. }
  11277. if (stats && stats.isFile()) {
  11278. if (exports.IS_WINDOWS) {
  11279. // preserve the case of the actual file (since an extension was appended)
  11280. try {
  11281. const directory = path.dirname(filePath);
  11282. const upperName = path.basename(filePath).toUpperCase();
  11283. for (const actualName of yield exports.readdir(directory)) {
  11284. if (upperName === actualName.toUpperCase()) {
  11285. filePath = path.join(directory, actualName);
  11286. break;
  11287. }
  11288. }
  11289. }
  11290. catch (err) {
  11291. // eslint-disable-next-line no-console
  11292. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11293. }
  11294. return filePath;
  11295. }
  11296. else {
  11297. if (isUnixExecutable(stats)) {
  11298. return filePath;
  11299. }
  11300. }
  11301. }
  11302. }
  11303. return '';
  11304. });
  11305. }
  11306. exports.tryGetExecutablePath = tryGetExecutablePath;
  11307. function normalizeSeparators(p) {
  11308. p = p || '';
  11309. if (exports.IS_WINDOWS) {
  11310. // convert slashes on Windows
  11311. p = p.replace(/\//g, '\\');
  11312. // remove redundant slashes
  11313. return p.replace(/\\\\+/g, '\\');
  11314. }
  11315. // remove redundant slashes
  11316. return p.replace(/\/\/+/g, '/');
  11317. }
  11318. // on Mac/Linux, test the execute bit
  11319. // R W X R W X R W X
  11320. // 256 128 64 32 16 8 4 2 1
  11321. function isUnixExecutable(stats) {
  11322. return ((stats.mode & 1) > 0 ||
  11323. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11324. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11325. }
  11326. //# sourceMappingURL=io-util.js.map
  11327. /***/ }),
  11328. /***/ 674:
  11329. /***/ (function(module, __unusedexports, __webpack_require__) {
  11330. module.exports = authenticate;
  11331. const { Deprecation } = __webpack_require__(692);
  11332. const once = __webpack_require__(969);
  11333. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11334. function authenticate(state, options) {
  11335. deprecateAuthenticate(
  11336. state.octokit.log,
  11337. new Deprecation(
  11338. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11339. )
  11340. );
  11341. if (!options) {
  11342. state.auth = false;
  11343. return;
  11344. }
  11345. switch (options.type) {
  11346. case "basic":
  11347. if (!options.username || !options.password) {
  11348. throw new Error(
  11349. "Basic authentication requires both a username and password to be set"
  11350. );
  11351. }
  11352. break;
  11353. case "oauth":
  11354. if (!options.token && !(options.key && options.secret)) {
  11355. throw new Error(
  11356. "OAuth2 authentication requires a token or key & secret to be set"
  11357. );
  11358. }
  11359. break;
  11360. case "token":
  11361. case "app":
  11362. if (!options.token) {
  11363. throw new Error("Token authentication requires a token to be set");
  11364. }
  11365. break;
  11366. default:
  11367. throw new Error(
  11368. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11369. );
  11370. }
  11371. state.auth = options;
  11372. }
  11373. /***/ }),
  11374. /***/ 675:
  11375. /***/ (function(module) {
  11376. module.exports = function btoa(str) {
  11377. return new Buffer(str).toString('base64')
  11378. }
  11379. /***/ }),
  11380. /***/ 692:
  11381. /***/ (function(__unusedmodule, exports) {
  11382. "use strict";
  11383. Object.defineProperty(exports, '__esModule', { value: true });
  11384. class Deprecation extends Error {
  11385. constructor(message) {
  11386. super(message); // Maintains proper stack trace (only available on V8)
  11387. /* istanbul ignore next */
  11388. if (Error.captureStackTrace) {
  11389. Error.captureStackTrace(this, this.constructor);
  11390. }
  11391. this.name = 'Deprecation';
  11392. }
  11393. }
  11394. exports.Deprecation = Deprecation;
  11395. /***/ }),
  11396. /***/ 696:
  11397. /***/ (function(module) {
  11398. "use strict";
  11399. /*!
  11400. * isobject <https://github.com/jonschlinkert/isobject>
  11401. *
  11402. * Copyright (c) 2014-2017, Jon Schlinkert.
  11403. * Released under the MIT License.
  11404. */
  11405. function isObject(val) {
  11406. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11407. }
  11408. /*!
  11409. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11410. *
  11411. * Copyright (c) 2014-2017, Jon Schlinkert.
  11412. * Released under the MIT License.
  11413. */
  11414. function isObjectObject(o) {
  11415. return isObject(o) === true
  11416. && Object.prototype.toString.call(o) === '[object Object]';
  11417. }
  11418. function isPlainObject(o) {
  11419. var ctor,prot;
  11420. if (isObjectObject(o) === false) return false;
  11421. // If has modified constructor
  11422. ctor = o.constructor;
  11423. if (typeof ctor !== 'function') return false;
  11424. // If has modified prototype
  11425. prot = ctor.prototype;
  11426. if (isObjectObject(prot) === false) return false;
  11427. // If constructor does not have an Object-specific method
  11428. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11429. return false;
  11430. }
  11431. // Most likely a plain Object
  11432. return true;
  11433. }
  11434. module.exports = isPlainObject;
  11435. /***/ }),
  11436. /***/ 697:
  11437. /***/ (function(module) {
  11438. "use strict";
  11439. module.exports = (promise, onFinally) => {
  11440. onFinally = onFinally || (() => {});
  11441. return promise.then(
  11442. val => new Promise(resolve => {
  11443. resolve(onFinally());
  11444. }).then(() => val),
  11445. err => new Promise(resolve => {
  11446. resolve(onFinally());
  11447. }).then(() => {
  11448. throw err;
  11449. })
  11450. );
  11451. };
  11452. /***/ }),
  11453. /***/ 705:
  11454. /***/ (function(module) {
  11455. 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"}}};
  11456. /***/ }),
  11457. /***/ 722:
  11458. /***/ (function(module) {
  11459. /**
  11460. * Convert array of 16 byte values to UUID string format of the form:
  11461. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11462. */
  11463. var byteToHex = [];
  11464. for (var i = 0; i < 256; ++i) {
  11465. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11466. }
  11467. function bytesToUuid(buf, offset) {
  11468. var i = offset || 0;
  11469. var bth = byteToHex;
  11470. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11471. return ([bth[buf[i++]], bth[buf[i++]],
  11472. bth[buf[i++]], bth[buf[i++]], '-',
  11473. bth[buf[i++]], bth[buf[i++]], '-',
  11474. bth[buf[i++]], bth[buf[i++]], '-',
  11475. bth[buf[i++]], bth[buf[i++]], '-',
  11476. bth[buf[i++]], bth[buf[i++]],
  11477. bth[buf[i++]], bth[buf[i++]],
  11478. bth[buf[i++]], bth[buf[i++]]]).join('');
  11479. }
  11480. module.exports = bytesToUuid;
  11481. /***/ }),
  11482. /***/ 742:
  11483. /***/ (function(module, __unusedexports, __webpack_require__) {
  11484. var fs = __webpack_require__(747)
  11485. var core
  11486. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11487. core = __webpack_require__(818)
  11488. } else {
  11489. core = __webpack_require__(197)
  11490. }
  11491. module.exports = isexe
  11492. isexe.sync = sync
  11493. function isexe (path, options, cb) {
  11494. if (typeof options === 'function') {
  11495. cb = options
  11496. options = {}
  11497. }
  11498. if (!cb) {
  11499. if (typeof Promise !== 'function') {
  11500. throw new TypeError('callback not provided')
  11501. }
  11502. return new Promise(function (resolve, reject) {
  11503. isexe(path, options || {}, function (er, is) {
  11504. if (er) {
  11505. reject(er)
  11506. } else {
  11507. resolve(is)
  11508. }
  11509. })
  11510. })
  11511. }
  11512. core(path, options || {}, function (er, is) {
  11513. // ignore EACCES because that just means we aren't allowed to run it
  11514. if (er) {
  11515. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11516. er = null
  11517. is = false
  11518. }
  11519. }
  11520. cb(er, is)
  11521. })
  11522. }
  11523. function sync (path, options) {
  11524. // my kingdom for a filtered catch
  11525. try {
  11526. return core.sync(path, options || {})
  11527. } catch (er) {
  11528. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11529. return false
  11530. } else {
  11531. throw er
  11532. }
  11533. }
  11534. }
  11535. /***/ }),
  11536. /***/ 747:
  11537. /***/ (function(module) {
  11538. module.exports = require("fs");
  11539. /***/ }),
  11540. /***/ 753:
  11541. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11542. "use strict";
  11543. Object.defineProperty(exports, '__esModule', { value: true });
  11544. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11545. var endpoint = __webpack_require__(385);
  11546. var universalUserAgent = __webpack_require__(796);
  11547. var isPlainObject = _interopDefault(__webpack_require__(696));
  11548. var nodeFetch = _interopDefault(__webpack_require__(454));
  11549. var requestError = __webpack_require__(463);
  11550. const VERSION = "5.3.1";
  11551. function getBufferResponse(response) {
  11552. return response.arrayBuffer();
  11553. }
  11554. function fetchWrapper(requestOptions) {
  11555. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11556. requestOptions.body = JSON.stringify(requestOptions.body);
  11557. }
  11558. let headers = {};
  11559. let status;
  11560. let url;
  11561. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11562. return fetch(requestOptions.url, Object.assign({
  11563. method: requestOptions.method,
  11564. body: requestOptions.body,
  11565. headers: requestOptions.headers,
  11566. redirect: requestOptions.redirect
  11567. }, requestOptions.request)).then(response => {
  11568. url = response.url;
  11569. status = response.status;
  11570. for (const keyAndValue of response.headers) {
  11571. headers[keyAndValue[0]] = keyAndValue[1];
  11572. }
  11573. if (status === 204 || status === 205) {
  11574. return;
  11575. } // GitHub API returns 200 for HEAD requsets
  11576. if (requestOptions.method === "HEAD") {
  11577. if (status < 400) {
  11578. return;
  11579. }
  11580. throw new requestError.RequestError(response.statusText, status, {
  11581. headers,
  11582. request: requestOptions
  11583. });
  11584. }
  11585. if (status === 304) {
  11586. throw new requestError.RequestError("Not modified", status, {
  11587. headers,
  11588. request: requestOptions
  11589. });
  11590. }
  11591. if (status >= 400) {
  11592. return response.text().then(message => {
  11593. const error = new requestError.RequestError(message, status, {
  11594. headers,
  11595. request: requestOptions
  11596. });
  11597. try {
  11598. let responseBody = JSON.parse(error.message);
  11599. Object.assign(error, responseBody);
  11600. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11601. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11602. } catch (e) {// ignore, see octokit/rest.js#684
  11603. }
  11604. throw error;
  11605. });
  11606. }
  11607. const contentType = response.headers.get("content-type");
  11608. if (/application\/json/.test(contentType)) {
  11609. return response.json();
  11610. }
  11611. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11612. return response.text();
  11613. }
  11614. return getBufferResponse(response);
  11615. }).then(data => {
  11616. return {
  11617. status,
  11618. url,
  11619. headers,
  11620. data
  11621. };
  11622. }).catch(error => {
  11623. if (error instanceof requestError.RequestError) {
  11624. throw error;
  11625. }
  11626. throw new requestError.RequestError(error.message, 500, {
  11627. headers,
  11628. request: requestOptions
  11629. });
  11630. });
  11631. }
  11632. function withDefaults(oldEndpoint, newDefaults) {
  11633. const endpoint = oldEndpoint.defaults(newDefaults);
  11634. const newApi = function (route, parameters) {
  11635. const endpointOptions = endpoint.merge(route, parameters);
  11636. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11637. return fetchWrapper(endpoint.parse(endpointOptions));
  11638. }
  11639. const request = (route, parameters) => {
  11640. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11641. };
  11642. Object.assign(request, {
  11643. endpoint,
  11644. defaults: withDefaults.bind(null, endpoint)
  11645. });
  11646. return endpointOptions.request.hook(request, endpointOptions);
  11647. };
  11648. return Object.assign(newApi, {
  11649. endpoint,
  11650. defaults: withDefaults.bind(null, endpoint)
  11651. });
  11652. }
  11653. const request = withDefaults(endpoint.endpoint, {
  11654. headers: {
  11655. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11656. }
  11657. });
  11658. exports.request = request;
  11659. //# sourceMappingURL=index.js.map
  11660. /***/ }),
  11661. /***/ 761:
  11662. /***/ (function(module) {
  11663. module.exports = require("zlib");
  11664. /***/ }),
  11665. /***/ 763:
  11666. /***/ (function(module) {
  11667. module.exports = removeHook
  11668. function removeHook (state, name, method) {
  11669. if (!state.registry[name]) {
  11670. return
  11671. }
  11672. var index = state.registry[name]
  11673. .map(function (registered) { return registered.orig })
  11674. .indexOf(method)
  11675. if (index === -1) {
  11676. return
  11677. }
  11678. state.registry[name].splice(index, 1)
  11679. }
  11680. /***/ }),
  11681. /***/ 768:
  11682. /***/ (function(module) {
  11683. "use strict";
  11684. module.exports = function (x) {
  11685. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11686. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11687. if (x[x.length - 1] === lf) {
  11688. x = x.slice(0, x.length - 1);
  11689. }
  11690. if (x[x.length - 1] === cr) {
  11691. x = x.slice(0, x.length - 1);
  11692. }
  11693. return x;
  11694. };
  11695. /***/ }),
  11696. /***/ 777:
  11697. /***/ (function(module, __unusedexports, __webpack_require__) {
  11698. module.exports = getFirstPage
  11699. const getPage = __webpack_require__(265)
  11700. function getFirstPage (octokit, link, headers) {
  11701. return getPage(octokit, link, 'first', headers)
  11702. }
  11703. /***/ }),
  11704. /***/ 796:
  11705. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11706. "use strict";
  11707. Object.defineProperty(exports, '__esModule', { value: true });
  11708. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11709. var osName = _interopDefault(__webpack_require__(2));
  11710. function getUserAgent() {
  11711. try {
  11712. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  11713. } catch (error) {
  11714. if (/wmic os get Caption/.test(error.message)) {
  11715. return "Windows <version undetectable>";
  11716. }
  11717. throw error;
  11718. }
  11719. }
  11720. exports.getUserAgent = getUserAgent;
  11721. //# sourceMappingURL=index.js.map
  11722. /***/ }),
  11723. /***/ 807:
  11724. /***/ (function(module, __unusedexports, __webpack_require__) {
  11725. module.exports = paginate;
  11726. const iterator = __webpack_require__(8);
  11727. function paginate(octokit, route, options, mapFn) {
  11728. if (typeof options === "function") {
  11729. mapFn = options;
  11730. options = undefined;
  11731. }
  11732. options = octokit.request.endpoint.merge(route, options);
  11733. return gather(
  11734. octokit,
  11735. [],
  11736. iterator(octokit, options)[Symbol.asyncIterator](),
  11737. mapFn
  11738. );
  11739. }
  11740. function gather(octokit, results, iterator, mapFn) {
  11741. return iterator.next().then(result => {
  11742. if (result.done) {
  11743. return results;
  11744. }
  11745. let earlyExit = false;
  11746. function done() {
  11747. earlyExit = true;
  11748. }
  11749. results = results.concat(
  11750. mapFn ? mapFn(result.value, done) : result.value.data
  11751. );
  11752. if (earlyExit) {
  11753. return results;
  11754. }
  11755. return gather(octokit, results, iterator, mapFn);
  11756. });
  11757. }
  11758. /***/ }),
  11759. /***/ 813:
  11760. /***/ (function(__unusedmodule, exports) {
  11761. "use strict";
  11762. Object.defineProperty(exports, '__esModule', { value: true });
  11763. async function auth(token) {
  11764. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  11765. return {
  11766. type: "token",
  11767. token: token,
  11768. tokenType
  11769. };
  11770. }
  11771. /**
  11772. * Prefix token for usage in the Authorization header
  11773. *
  11774. * @param token OAuth token or JSON Web Token
  11775. */
  11776. function withAuthorizationPrefix(token) {
  11777. if (token.split(/\./).length === 3) {
  11778. return `bearer ${token}`;
  11779. }
  11780. return `token ${token}`;
  11781. }
  11782. async function hook(token, request, route, parameters) {
  11783. const endpoint = request.endpoint.merge(route, parameters);
  11784. endpoint.headers.authorization = withAuthorizationPrefix(token);
  11785. return request(endpoint);
  11786. }
  11787. const createTokenAuth = function createTokenAuth(token) {
  11788. if (!token) {
  11789. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  11790. }
  11791. if (typeof token !== "string") {
  11792. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  11793. }
  11794. token = token.replace(/^(token|bearer) +/i, "");
  11795. return Object.assign(auth.bind(null, token), {
  11796. hook: hook.bind(null, token)
  11797. });
  11798. };
  11799. exports.createTokenAuth = createTokenAuth;
  11800. //# sourceMappingURL=index.js.map
  11801. /***/ }),
  11802. /***/ 814:
  11803. /***/ (function(module, __unusedexports, __webpack_require__) {
  11804. module.exports = which
  11805. which.sync = whichSync
  11806. var isWindows = process.platform === 'win32' ||
  11807. process.env.OSTYPE === 'cygwin' ||
  11808. process.env.OSTYPE === 'msys'
  11809. var path = __webpack_require__(622)
  11810. var COLON = isWindows ? ';' : ':'
  11811. var isexe = __webpack_require__(742)
  11812. function getNotFoundError (cmd) {
  11813. var er = new Error('not found: ' + cmd)
  11814. er.code = 'ENOENT'
  11815. return er
  11816. }
  11817. function getPathInfo (cmd, opt) {
  11818. var colon = opt.colon || COLON
  11819. var pathEnv = opt.path || process.env.PATH || ''
  11820. var pathExt = ['']
  11821. pathEnv = pathEnv.split(colon)
  11822. var pathExtExe = ''
  11823. if (isWindows) {
  11824. pathEnv.unshift(process.cwd())
  11825. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  11826. pathExt = pathExtExe.split(colon)
  11827. // Always test the cmd itself first. isexe will check to make sure
  11828. // it's found in the pathExt set.
  11829. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  11830. pathExt.unshift('')
  11831. }
  11832. // If it has a slash, then we don't bother searching the pathenv.
  11833. // just check the file itself, and that's it.
  11834. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  11835. pathEnv = ['']
  11836. return {
  11837. env: pathEnv,
  11838. ext: pathExt,
  11839. extExe: pathExtExe
  11840. }
  11841. }
  11842. function which (cmd, opt, cb) {
  11843. if (typeof opt === 'function') {
  11844. cb = opt
  11845. opt = {}
  11846. }
  11847. var info = getPathInfo(cmd, opt)
  11848. var pathEnv = info.env
  11849. var pathExt = info.ext
  11850. var pathExtExe = info.extExe
  11851. var found = []
  11852. ;(function F (i, l) {
  11853. if (i === l) {
  11854. if (opt.all && found.length)
  11855. return cb(null, found)
  11856. else
  11857. return cb(getNotFoundError(cmd))
  11858. }
  11859. var pathPart = pathEnv[i]
  11860. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  11861. pathPart = pathPart.slice(1, -1)
  11862. var p = path.join(pathPart, cmd)
  11863. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  11864. p = cmd.slice(0, 2) + p
  11865. }
  11866. ;(function E (ii, ll) {
  11867. if (ii === ll) return F(i + 1, l)
  11868. var ext = pathExt[ii]
  11869. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  11870. if (!er && is) {
  11871. if (opt.all)
  11872. found.push(p + ext)
  11873. else
  11874. return cb(null, p + ext)
  11875. }
  11876. return E(ii + 1, ll)
  11877. })
  11878. })(0, pathExt.length)
  11879. })(0, pathEnv.length)
  11880. }
  11881. function whichSync (cmd, opt) {
  11882. opt = opt || {}
  11883. var info = getPathInfo(cmd, opt)
  11884. var pathEnv = info.env
  11885. var pathExt = info.ext
  11886. var pathExtExe = info.extExe
  11887. var found = []
  11888. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  11889. var pathPart = pathEnv[i]
  11890. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  11891. pathPart = pathPart.slice(1, -1)
  11892. var p = path.join(pathPart, cmd)
  11893. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  11894. p = cmd.slice(0, 2) + p
  11895. }
  11896. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  11897. var cur = p + pathExt[j]
  11898. var is
  11899. try {
  11900. is = isexe.sync(cur, { pathExt: pathExtExe })
  11901. if (is) {
  11902. if (opt.all)
  11903. found.push(cur)
  11904. else
  11905. return cur
  11906. }
  11907. } catch (ex) {}
  11908. }
  11909. }
  11910. if (opt.all && found.length)
  11911. return found
  11912. if (opt.nothrow)
  11913. return null
  11914. throw getNotFoundError(cmd)
  11915. }
  11916. /***/ }),
  11917. /***/ 816:
  11918. /***/ (function(module) {
  11919. "use strict";
  11920. module.exports = /^#!.*/;
  11921. /***/ }),
  11922. /***/ 818:
  11923. /***/ (function(module, __unusedexports, __webpack_require__) {
  11924. module.exports = isexe
  11925. isexe.sync = sync
  11926. var fs = __webpack_require__(747)
  11927. function checkPathExt (path, options) {
  11928. var pathext = options.pathExt !== undefined ?
  11929. options.pathExt : process.env.PATHEXT
  11930. if (!pathext) {
  11931. return true
  11932. }
  11933. pathext = pathext.split(';')
  11934. if (pathext.indexOf('') !== -1) {
  11935. return true
  11936. }
  11937. for (var i = 0; i < pathext.length; i++) {
  11938. var p = pathext[i].toLowerCase()
  11939. if (p && path.substr(-p.length).toLowerCase() === p) {
  11940. return true
  11941. }
  11942. }
  11943. return false
  11944. }
  11945. function checkStat (stat, path, options) {
  11946. if (!stat.isSymbolicLink() && !stat.isFile()) {
  11947. return false
  11948. }
  11949. return checkPathExt(path, options)
  11950. }
  11951. function isexe (path, options, cb) {
  11952. fs.stat(path, function (er, stat) {
  11953. cb(er, er ? false : checkStat(stat, path, options))
  11954. })
  11955. }
  11956. function sync (path, options) {
  11957. return checkStat(fs.statSync(path), path, options)
  11958. }
  11959. /***/ }),
  11960. /***/ 821:
  11961. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11962. "use strict";
  11963. var __importStar = (this && this.__importStar) || function (mod) {
  11964. if (mod && mod.__esModule) return mod;
  11965. var result = {};
  11966. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  11967. result["default"] = mod;
  11968. return result;
  11969. };
  11970. Object.defineProperty(exports, "__esModule", { value: true });
  11971. const core = __importStar(__webpack_require__(470));
  11972. const fsHelper = __importStar(__webpack_require__(618));
  11973. const github = __importStar(__webpack_require__(469));
  11974. const path = __importStar(__webpack_require__(622));
  11975. function getInputs() {
  11976. const result = {};
  11977. // GitHub workspace
  11978. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  11979. if (!githubWorkspacePath) {
  11980. throw new Error('GITHUB_WORKSPACE not defined');
  11981. }
  11982. githubWorkspacePath = path.resolve(githubWorkspacePath);
  11983. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  11984. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  11985. // Qualified repository
  11986. const qualifiedRepository = core.getInput('repository') ||
  11987. `${github.context.repo.owner}/${github.context.repo.repo}`;
  11988. core.debug(`qualified repository = '${qualifiedRepository}'`);
  11989. const splitRepository = qualifiedRepository.split('/');
  11990. if (splitRepository.length !== 2 ||
  11991. !splitRepository[0] ||
  11992. !splitRepository[1]) {
  11993. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  11994. }
  11995. result.repositoryOwner = splitRepository[0];
  11996. result.repositoryName = splitRepository[1];
  11997. // Repository path
  11998. result.repositoryPath = core.getInput('path') || '.';
  11999. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  12000. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  12001. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  12002. }
  12003. // Workflow repository?
  12004. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  12005. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  12006. // Source branch, source version
  12007. result.ref = core.getInput('ref');
  12008. if (!result.ref) {
  12009. if (isWorkflowRepository) {
  12010. result.ref = github.context.ref;
  12011. result.commit = github.context.sha;
  12012. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  12013. // the ref is unqualifed like "master" instead of "refs/heads/master".
  12014. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  12015. result.ref = `refs/heads/${result.ref}`;
  12016. }
  12017. }
  12018. if (!result.ref && !result.commit) {
  12019. result.ref = 'refs/heads/master';
  12020. }
  12021. }
  12022. // SHA?
  12023. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  12024. result.commit = result.ref;
  12025. result.ref = '';
  12026. }
  12027. core.debug(`ref = '${result.ref}'`);
  12028. core.debug(`commit = '${result.commit}'`);
  12029. // Clean
  12030. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  12031. core.debug(`clean = ${result.clean}`);
  12032. // Fetch depth
  12033. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  12034. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  12035. result.fetchDepth = 0;
  12036. }
  12037. core.debug(`fetch depth = ${result.fetchDepth}`);
  12038. // LFS
  12039. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  12040. core.debug(`lfs = ${result.lfs}`);
  12041. // Submodules
  12042. result.submodules = false;
  12043. result.nestedSubmodules = false;
  12044. const submodulesString = (core.getInput('submodules') || '').toUpperCase();
  12045. if (submodulesString == 'RECURSIVE') {
  12046. result.submodules = true;
  12047. result.nestedSubmodules = true;
  12048. }
  12049. else if (submodulesString == 'TRUE') {
  12050. result.submodules = true;
  12051. }
  12052. core.debug(`submodules = ${result.submodules}`);
  12053. core.debug(`recursive submodules = ${result.nestedSubmodules}`);
  12054. // Auth token
  12055. result.authToken = core.getInput('token');
  12056. // Persist credentials
  12057. result.persistCredentials =
  12058. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  12059. return result;
  12060. }
  12061. exports.getInputs = getInputs;
  12062. /***/ }),
  12063. /***/ 826:
  12064. /***/ (function(module, __unusedexports, __webpack_require__) {
  12065. var rng = __webpack_require__(139);
  12066. var bytesToUuid = __webpack_require__(722);
  12067. function v4(options, buf, offset) {
  12068. var i = buf && offset || 0;
  12069. if (typeof(options) == 'string') {
  12070. buf = options === 'binary' ? new Array(16) : null;
  12071. options = null;
  12072. }
  12073. options = options || {};
  12074. var rnds = options.random || (options.rng || rng)();
  12075. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  12076. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  12077. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  12078. // Copy bytes to buffer, if provided
  12079. if (buf) {
  12080. for (var ii = 0; ii < 16; ++ii) {
  12081. buf[i + ii] = rnds[ii];
  12082. }
  12083. }
  12084. return buf || bytesToUuid(rnds);
  12085. }
  12086. module.exports = v4;
  12087. /***/ }),
  12088. /***/ 835:
  12089. /***/ (function(module) {
  12090. module.exports = require("url");
  12091. /***/ }),
  12092. /***/ 850:
  12093. /***/ (function(module, __unusedexports, __webpack_require__) {
  12094. module.exports = paginationMethodsPlugin
  12095. function paginationMethodsPlugin (octokit) {
  12096. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  12097. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  12098. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  12099. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  12100. octokit.hasFirstPage = __webpack_require__(536)
  12101. octokit.hasLastPage = __webpack_require__(336)
  12102. octokit.hasNextPage = __webpack_require__(929)
  12103. octokit.hasPreviousPage = __webpack_require__(558)
  12104. }
  12105. /***/ }),
  12106. /***/ 854:
  12107. /***/ (function(module) {
  12108. /**
  12109. * lodash (Custom Build) <https://lodash.com/>
  12110. * Build: `lodash modularize exports="npm" -o ./`
  12111. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  12112. * Released under MIT license <https://lodash.com/license>
  12113. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  12114. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  12115. */
  12116. /** Used as the `TypeError` message for "Functions" methods. */
  12117. var FUNC_ERROR_TEXT = 'Expected a function';
  12118. /** Used to stand-in for `undefined` hash values. */
  12119. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  12120. /** Used as references for various `Number` constants. */
  12121. var INFINITY = 1 / 0;
  12122. /** `Object#toString` result references. */
  12123. var funcTag = '[object Function]',
  12124. genTag = '[object GeneratorFunction]',
  12125. symbolTag = '[object Symbol]';
  12126. /** Used to match property names within property paths. */
  12127. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  12128. reIsPlainProp = /^\w*$/,
  12129. reLeadingDot = /^\./,
  12130. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  12131. /**
  12132. * Used to match `RegExp`
  12133. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  12134. */
  12135. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  12136. /** Used to match backslashes in property paths. */
  12137. var reEscapeChar = /\\(\\)?/g;
  12138. /** Used to detect host constructors (Safari). */
  12139. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  12140. /** Detect free variable `global` from Node.js. */
  12141. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  12142. /** Detect free variable `self`. */
  12143. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  12144. /** Used as a reference to the global object. */
  12145. var root = freeGlobal || freeSelf || Function('return this')();
  12146. /**
  12147. * Gets the value at `key` of `object`.
  12148. *
  12149. * @private
  12150. * @param {Object} [object] The object to query.
  12151. * @param {string} key The key of the property to get.
  12152. * @returns {*} Returns the property value.
  12153. */
  12154. function getValue(object, key) {
  12155. return object == null ? undefined : object[key];
  12156. }
  12157. /**
  12158. * Checks if `value` is a host object in IE < 9.
  12159. *
  12160. * @private
  12161. * @param {*} value The value to check.
  12162. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  12163. */
  12164. function isHostObject(value) {
  12165. // Many host objects are `Object` objects that can coerce to strings
  12166. // despite having improperly defined `toString` methods.
  12167. var result = false;
  12168. if (value != null && typeof value.toString != 'function') {
  12169. try {
  12170. result = !!(value + '');
  12171. } catch (e) {}
  12172. }
  12173. return result;
  12174. }
  12175. /** Used for built-in method references. */
  12176. var arrayProto = Array.prototype,
  12177. funcProto = Function.prototype,
  12178. objectProto = Object.prototype;
  12179. /** Used to detect overreaching core-js shims. */
  12180. var coreJsData = root['__core-js_shared__'];
  12181. /** Used to detect methods masquerading as native. */
  12182. var maskSrcKey = (function() {
  12183. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  12184. return uid ? ('Symbol(src)_1.' + uid) : '';
  12185. }());
  12186. /** Used to resolve the decompiled source of functions. */
  12187. var funcToString = funcProto.toString;
  12188. /** Used to check objects for own properties. */
  12189. var hasOwnProperty = objectProto.hasOwnProperty;
  12190. /**
  12191. * Used to resolve the
  12192. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12193. * of values.
  12194. */
  12195. var objectToString = objectProto.toString;
  12196. /** Used to detect if a method is native. */
  12197. var reIsNative = RegExp('^' +
  12198. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12199. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12200. );
  12201. /** Built-in value references. */
  12202. var Symbol = root.Symbol,
  12203. splice = arrayProto.splice;
  12204. /* Built-in method references that are verified to be native. */
  12205. var Map = getNative(root, 'Map'),
  12206. nativeCreate = getNative(Object, 'create');
  12207. /** Used to convert symbols to primitives and strings. */
  12208. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12209. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12210. /**
  12211. * Creates a hash object.
  12212. *
  12213. * @private
  12214. * @constructor
  12215. * @param {Array} [entries] The key-value pairs to cache.
  12216. */
  12217. function Hash(entries) {
  12218. var index = -1,
  12219. length = entries ? entries.length : 0;
  12220. this.clear();
  12221. while (++index < length) {
  12222. var entry = entries[index];
  12223. this.set(entry[0], entry[1]);
  12224. }
  12225. }
  12226. /**
  12227. * Removes all key-value entries from the hash.
  12228. *
  12229. * @private
  12230. * @name clear
  12231. * @memberOf Hash
  12232. */
  12233. function hashClear() {
  12234. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12235. }
  12236. /**
  12237. * Removes `key` and its value from the hash.
  12238. *
  12239. * @private
  12240. * @name delete
  12241. * @memberOf Hash
  12242. * @param {Object} hash The hash to modify.
  12243. * @param {string} key The key of the value to remove.
  12244. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12245. */
  12246. function hashDelete(key) {
  12247. return this.has(key) && delete this.__data__[key];
  12248. }
  12249. /**
  12250. * Gets the hash value for `key`.
  12251. *
  12252. * @private
  12253. * @name get
  12254. * @memberOf Hash
  12255. * @param {string} key The key of the value to get.
  12256. * @returns {*} Returns the entry value.
  12257. */
  12258. function hashGet(key) {
  12259. var data = this.__data__;
  12260. if (nativeCreate) {
  12261. var result = data[key];
  12262. return result === HASH_UNDEFINED ? undefined : result;
  12263. }
  12264. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12265. }
  12266. /**
  12267. * Checks if a hash value for `key` exists.
  12268. *
  12269. * @private
  12270. * @name has
  12271. * @memberOf Hash
  12272. * @param {string} key The key of the entry to check.
  12273. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12274. */
  12275. function hashHas(key) {
  12276. var data = this.__data__;
  12277. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12278. }
  12279. /**
  12280. * Sets the hash `key` to `value`.
  12281. *
  12282. * @private
  12283. * @name set
  12284. * @memberOf Hash
  12285. * @param {string} key The key of the value to set.
  12286. * @param {*} value The value to set.
  12287. * @returns {Object} Returns the hash instance.
  12288. */
  12289. function hashSet(key, value) {
  12290. var data = this.__data__;
  12291. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12292. return this;
  12293. }
  12294. // Add methods to `Hash`.
  12295. Hash.prototype.clear = hashClear;
  12296. Hash.prototype['delete'] = hashDelete;
  12297. Hash.prototype.get = hashGet;
  12298. Hash.prototype.has = hashHas;
  12299. Hash.prototype.set = hashSet;
  12300. /**
  12301. * Creates an list cache object.
  12302. *
  12303. * @private
  12304. * @constructor
  12305. * @param {Array} [entries] The key-value pairs to cache.
  12306. */
  12307. function ListCache(entries) {
  12308. var index = -1,
  12309. length = entries ? entries.length : 0;
  12310. this.clear();
  12311. while (++index < length) {
  12312. var entry = entries[index];
  12313. this.set(entry[0], entry[1]);
  12314. }
  12315. }
  12316. /**
  12317. * Removes all key-value entries from the list cache.
  12318. *
  12319. * @private
  12320. * @name clear
  12321. * @memberOf ListCache
  12322. */
  12323. function listCacheClear() {
  12324. this.__data__ = [];
  12325. }
  12326. /**
  12327. * Removes `key` and its value from the list cache.
  12328. *
  12329. * @private
  12330. * @name delete
  12331. * @memberOf ListCache
  12332. * @param {string} key The key of the value to remove.
  12333. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12334. */
  12335. function listCacheDelete(key) {
  12336. var data = this.__data__,
  12337. index = assocIndexOf(data, key);
  12338. if (index < 0) {
  12339. return false;
  12340. }
  12341. var lastIndex = data.length - 1;
  12342. if (index == lastIndex) {
  12343. data.pop();
  12344. } else {
  12345. splice.call(data, index, 1);
  12346. }
  12347. return true;
  12348. }
  12349. /**
  12350. * Gets the list cache value for `key`.
  12351. *
  12352. * @private
  12353. * @name get
  12354. * @memberOf ListCache
  12355. * @param {string} key The key of the value to get.
  12356. * @returns {*} Returns the entry value.
  12357. */
  12358. function listCacheGet(key) {
  12359. var data = this.__data__,
  12360. index = assocIndexOf(data, key);
  12361. return index < 0 ? undefined : data[index][1];
  12362. }
  12363. /**
  12364. * Checks if a list cache value for `key` exists.
  12365. *
  12366. * @private
  12367. * @name has
  12368. * @memberOf ListCache
  12369. * @param {string} key The key of the entry to check.
  12370. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12371. */
  12372. function listCacheHas(key) {
  12373. return assocIndexOf(this.__data__, key) > -1;
  12374. }
  12375. /**
  12376. * Sets the list cache `key` to `value`.
  12377. *
  12378. * @private
  12379. * @name set
  12380. * @memberOf ListCache
  12381. * @param {string} key The key of the value to set.
  12382. * @param {*} value The value to set.
  12383. * @returns {Object} Returns the list cache instance.
  12384. */
  12385. function listCacheSet(key, value) {
  12386. var data = this.__data__,
  12387. index = assocIndexOf(data, key);
  12388. if (index < 0) {
  12389. data.push([key, value]);
  12390. } else {
  12391. data[index][1] = value;
  12392. }
  12393. return this;
  12394. }
  12395. // Add methods to `ListCache`.
  12396. ListCache.prototype.clear = listCacheClear;
  12397. ListCache.prototype['delete'] = listCacheDelete;
  12398. ListCache.prototype.get = listCacheGet;
  12399. ListCache.prototype.has = listCacheHas;
  12400. ListCache.prototype.set = listCacheSet;
  12401. /**
  12402. * Creates a map cache object to store key-value pairs.
  12403. *
  12404. * @private
  12405. * @constructor
  12406. * @param {Array} [entries] The key-value pairs to cache.
  12407. */
  12408. function MapCache(entries) {
  12409. var index = -1,
  12410. length = entries ? entries.length : 0;
  12411. this.clear();
  12412. while (++index < length) {
  12413. var entry = entries[index];
  12414. this.set(entry[0], entry[1]);
  12415. }
  12416. }
  12417. /**
  12418. * Removes all key-value entries from the map.
  12419. *
  12420. * @private
  12421. * @name clear
  12422. * @memberOf MapCache
  12423. */
  12424. function mapCacheClear() {
  12425. this.__data__ = {
  12426. 'hash': new Hash,
  12427. 'map': new (Map || ListCache),
  12428. 'string': new Hash
  12429. };
  12430. }
  12431. /**
  12432. * Removes `key` and its value from the map.
  12433. *
  12434. * @private
  12435. * @name delete
  12436. * @memberOf MapCache
  12437. * @param {string} key The key of the value to remove.
  12438. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12439. */
  12440. function mapCacheDelete(key) {
  12441. return getMapData(this, key)['delete'](key);
  12442. }
  12443. /**
  12444. * Gets the map value for `key`.
  12445. *
  12446. * @private
  12447. * @name get
  12448. * @memberOf MapCache
  12449. * @param {string} key The key of the value to get.
  12450. * @returns {*} Returns the entry value.
  12451. */
  12452. function mapCacheGet(key) {
  12453. return getMapData(this, key).get(key);
  12454. }
  12455. /**
  12456. * Checks if a map value for `key` exists.
  12457. *
  12458. * @private
  12459. * @name has
  12460. * @memberOf MapCache
  12461. * @param {string} key The key of the entry to check.
  12462. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12463. */
  12464. function mapCacheHas(key) {
  12465. return getMapData(this, key).has(key);
  12466. }
  12467. /**
  12468. * Sets the map `key` to `value`.
  12469. *
  12470. * @private
  12471. * @name set
  12472. * @memberOf MapCache
  12473. * @param {string} key The key of the value to set.
  12474. * @param {*} value The value to set.
  12475. * @returns {Object} Returns the map cache instance.
  12476. */
  12477. function mapCacheSet(key, value) {
  12478. getMapData(this, key).set(key, value);
  12479. return this;
  12480. }
  12481. // Add methods to `MapCache`.
  12482. MapCache.prototype.clear = mapCacheClear;
  12483. MapCache.prototype['delete'] = mapCacheDelete;
  12484. MapCache.prototype.get = mapCacheGet;
  12485. MapCache.prototype.has = mapCacheHas;
  12486. MapCache.prototype.set = mapCacheSet;
  12487. /**
  12488. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12489. *
  12490. * @private
  12491. * @param {Array} array The array to inspect.
  12492. * @param {*} key The key to search for.
  12493. * @returns {number} Returns the index of the matched value, else `-1`.
  12494. */
  12495. function assocIndexOf(array, key) {
  12496. var length = array.length;
  12497. while (length--) {
  12498. if (eq(array[length][0], key)) {
  12499. return length;
  12500. }
  12501. }
  12502. return -1;
  12503. }
  12504. /**
  12505. * The base implementation of `_.get` without support for default values.
  12506. *
  12507. * @private
  12508. * @param {Object} object The object to query.
  12509. * @param {Array|string} path The path of the property to get.
  12510. * @returns {*} Returns the resolved value.
  12511. */
  12512. function baseGet(object, path) {
  12513. path = isKey(path, object) ? [path] : castPath(path);
  12514. var index = 0,
  12515. length = path.length;
  12516. while (object != null && index < length) {
  12517. object = object[toKey(path[index++])];
  12518. }
  12519. return (index && index == length) ? object : undefined;
  12520. }
  12521. /**
  12522. * The base implementation of `_.isNative` without bad shim checks.
  12523. *
  12524. * @private
  12525. * @param {*} value The value to check.
  12526. * @returns {boolean} Returns `true` if `value` is a native function,
  12527. * else `false`.
  12528. */
  12529. function baseIsNative(value) {
  12530. if (!isObject(value) || isMasked(value)) {
  12531. return false;
  12532. }
  12533. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12534. return pattern.test(toSource(value));
  12535. }
  12536. /**
  12537. * The base implementation of `_.toString` which doesn't convert nullish
  12538. * values to empty strings.
  12539. *
  12540. * @private
  12541. * @param {*} value The value to process.
  12542. * @returns {string} Returns the string.
  12543. */
  12544. function baseToString(value) {
  12545. // Exit early for strings to avoid a performance hit in some environments.
  12546. if (typeof value == 'string') {
  12547. return value;
  12548. }
  12549. if (isSymbol(value)) {
  12550. return symbolToString ? symbolToString.call(value) : '';
  12551. }
  12552. var result = (value + '');
  12553. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12554. }
  12555. /**
  12556. * Casts `value` to a path array if it's not one.
  12557. *
  12558. * @private
  12559. * @param {*} value The value to inspect.
  12560. * @returns {Array} Returns the cast property path array.
  12561. */
  12562. function castPath(value) {
  12563. return isArray(value) ? value : stringToPath(value);
  12564. }
  12565. /**
  12566. * Gets the data for `map`.
  12567. *
  12568. * @private
  12569. * @param {Object} map The map to query.
  12570. * @param {string} key The reference key.
  12571. * @returns {*} Returns the map data.
  12572. */
  12573. function getMapData(map, key) {
  12574. var data = map.__data__;
  12575. return isKeyable(key)
  12576. ? data[typeof key == 'string' ? 'string' : 'hash']
  12577. : data.map;
  12578. }
  12579. /**
  12580. * Gets the native function at `key` of `object`.
  12581. *
  12582. * @private
  12583. * @param {Object} object The object to query.
  12584. * @param {string} key The key of the method to get.
  12585. * @returns {*} Returns the function if it's native, else `undefined`.
  12586. */
  12587. function getNative(object, key) {
  12588. var value = getValue(object, key);
  12589. return baseIsNative(value) ? value : undefined;
  12590. }
  12591. /**
  12592. * Checks if `value` is a property name and not a property path.
  12593. *
  12594. * @private
  12595. * @param {*} value The value to check.
  12596. * @param {Object} [object] The object to query keys on.
  12597. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12598. */
  12599. function isKey(value, object) {
  12600. if (isArray(value)) {
  12601. return false;
  12602. }
  12603. var type = typeof value;
  12604. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12605. value == null || isSymbol(value)) {
  12606. return true;
  12607. }
  12608. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12609. (object != null && value in Object(object));
  12610. }
  12611. /**
  12612. * Checks if `value` is suitable for use as unique object key.
  12613. *
  12614. * @private
  12615. * @param {*} value The value to check.
  12616. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12617. */
  12618. function isKeyable(value) {
  12619. var type = typeof value;
  12620. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12621. ? (value !== '__proto__')
  12622. : (value === null);
  12623. }
  12624. /**
  12625. * Checks if `func` has its source masked.
  12626. *
  12627. * @private
  12628. * @param {Function} func The function to check.
  12629. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12630. */
  12631. function isMasked(func) {
  12632. return !!maskSrcKey && (maskSrcKey in func);
  12633. }
  12634. /**
  12635. * Converts `string` to a property path array.
  12636. *
  12637. * @private
  12638. * @param {string} string The string to convert.
  12639. * @returns {Array} Returns the property path array.
  12640. */
  12641. var stringToPath = memoize(function(string) {
  12642. string = toString(string);
  12643. var result = [];
  12644. if (reLeadingDot.test(string)) {
  12645. result.push('');
  12646. }
  12647. string.replace(rePropName, function(match, number, quote, string) {
  12648. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  12649. });
  12650. return result;
  12651. });
  12652. /**
  12653. * Converts `value` to a string key if it's not a string or symbol.
  12654. *
  12655. * @private
  12656. * @param {*} value The value to inspect.
  12657. * @returns {string|symbol} Returns the key.
  12658. */
  12659. function toKey(value) {
  12660. if (typeof value == 'string' || isSymbol(value)) {
  12661. return value;
  12662. }
  12663. var result = (value + '');
  12664. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12665. }
  12666. /**
  12667. * Converts `func` to its source code.
  12668. *
  12669. * @private
  12670. * @param {Function} func The function to process.
  12671. * @returns {string} Returns the source code.
  12672. */
  12673. function toSource(func) {
  12674. if (func != null) {
  12675. try {
  12676. return funcToString.call(func);
  12677. } catch (e) {}
  12678. try {
  12679. return (func + '');
  12680. } catch (e) {}
  12681. }
  12682. return '';
  12683. }
  12684. /**
  12685. * Creates a function that memoizes the result of `func`. If `resolver` is
  12686. * provided, it determines the cache key for storing the result based on the
  12687. * arguments provided to the memoized function. By default, the first argument
  12688. * provided to the memoized function is used as the map cache key. The `func`
  12689. * is invoked with the `this` binding of the memoized function.
  12690. *
  12691. * **Note:** The cache is exposed as the `cache` property on the memoized
  12692. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  12693. * constructor with one whose instances implement the
  12694. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  12695. * method interface of `delete`, `get`, `has`, and `set`.
  12696. *
  12697. * @static
  12698. * @memberOf _
  12699. * @since 0.1.0
  12700. * @category Function
  12701. * @param {Function} func The function to have its output memoized.
  12702. * @param {Function} [resolver] The function to resolve the cache key.
  12703. * @returns {Function} Returns the new memoized function.
  12704. * @example
  12705. *
  12706. * var object = { 'a': 1, 'b': 2 };
  12707. * var other = { 'c': 3, 'd': 4 };
  12708. *
  12709. * var values = _.memoize(_.values);
  12710. * values(object);
  12711. * // => [1, 2]
  12712. *
  12713. * values(other);
  12714. * // => [3, 4]
  12715. *
  12716. * object.a = 2;
  12717. * values(object);
  12718. * // => [1, 2]
  12719. *
  12720. * // Modify the result cache.
  12721. * values.cache.set(object, ['a', 'b']);
  12722. * values(object);
  12723. * // => ['a', 'b']
  12724. *
  12725. * // Replace `_.memoize.Cache`.
  12726. * _.memoize.Cache = WeakMap;
  12727. */
  12728. function memoize(func, resolver) {
  12729. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  12730. throw new TypeError(FUNC_ERROR_TEXT);
  12731. }
  12732. var memoized = function() {
  12733. var args = arguments,
  12734. key = resolver ? resolver.apply(this, args) : args[0],
  12735. cache = memoized.cache;
  12736. if (cache.has(key)) {
  12737. return cache.get(key);
  12738. }
  12739. var result = func.apply(this, args);
  12740. memoized.cache = cache.set(key, result);
  12741. return result;
  12742. };
  12743. memoized.cache = new (memoize.Cache || MapCache);
  12744. return memoized;
  12745. }
  12746. // Assign cache to `_.memoize`.
  12747. memoize.Cache = MapCache;
  12748. /**
  12749. * Performs a
  12750. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12751. * comparison between two values to determine if they are equivalent.
  12752. *
  12753. * @static
  12754. * @memberOf _
  12755. * @since 4.0.0
  12756. * @category Lang
  12757. * @param {*} value The value to compare.
  12758. * @param {*} other The other value to compare.
  12759. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12760. * @example
  12761. *
  12762. * var object = { 'a': 1 };
  12763. * var other = { 'a': 1 };
  12764. *
  12765. * _.eq(object, object);
  12766. * // => true
  12767. *
  12768. * _.eq(object, other);
  12769. * // => false
  12770. *
  12771. * _.eq('a', 'a');
  12772. * // => true
  12773. *
  12774. * _.eq('a', Object('a'));
  12775. * // => false
  12776. *
  12777. * _.eq(NaN, NaN);
  12778. * // => true
  12779. */
  12780. function eq(value, other) {
  12781. return value === other || (value !== value && other !== other);
  12782. }
  12783. /**
  12784. * Checks if `value` is classified as an `Array` object.
  12785. *
  12786. * @static
  12787. * @memberOf _
  12788. * @since 0.1.0
  12789. * @category Lang
  12790. * @param {*} value The value to check.
  12791. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12792. * @example
  12793. *
  12794. * _.isArray([1, 2, 3]);
  12795. * // => true
  12796. *
  12797. * _.isArray(document.body.children);
  12798. * // => false
  12799. *
  12800. * _.isArray('abc');
  12801. * // => false
  12802. *
  12803. * _.isArray(_.noop);
  12804. * // => false
  12805. */
  12806. var isArray = Array.isArray;
  12807. /**
  12808. * Checks if `value` is classified as a `Function` object.
  12809. *
  12810. * @static
  12811. * @memberOf _
  12812. * @since 0.1.0
  12813. * @category Lang
  12814. * @param {*} value The value to check.
  12815. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12816. * @example
  12817. *
  12818. * _.isFunction(_);
  12819. * // => true
  12820. *
  12821. * _.isFunction(/abc/);
  12822. * // => false
  12823. */
  12824. function isFunction(value) {
  12825. // The use of `Object#toString` avoids issues with the `typeof` operator
  12826. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  12827. var tag = isObject(value) ? objectToString.call(value) : '';
  12828. return tag == funcTag || tag == genTag;
  12829. }
  12830. /**
  12831. * Checks if `value` is the
  12832. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12833. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12834. *
  12835. * @static
  12836. * @memberOf _
  12837. * @since 0.1.0
  12838. * @category Lang
  12839. * @param {*} value The value to check.
  12840. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12841. * @example
  12842. *
  12843. * _.isObject({});
  12844. * // => true
  12845. *
  12846. * _.isObject([1, 2, 3]);
  12847. * // => true
  12848. *
  12849. * _.isObject(_.noop);
  12850. * // => true
  12851. *
  12852. * _.isObject(null);
  12853. * // => false
  12854. */
  12855. function isObject(value) {
  12856. var type = typeof value;
  12857. return !!value && (type == 'object' || type == 'function');
  12858. }
  12859. /**
  12860. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12861. * and has a `typeof` result of "object".
  12862. *
  12863. * @static
  12864. * @memberOf _
  12865. * @since 4.0.0
  12866. * @category Lang
  12867. * @param {*} value The value to check.
  12868. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12869. * @example
  12870. *
  12871. * _.isObjectLike({});
  12872. * // => true
  12873. *
  12874. * _.isObjectLike([1, 2, 3]);
  12875. * // => true
  12876. *
  12877. * _.isObjectLike(_.noop);
  12878. * // => false
  12879. *
  12880. * _.isObjectLike(null);
  12881. * // => false
  12882. */
  12883. function isObjectLike(value) {
  12884. return !!value && typeof value == 'object';
  12885. }
  12886. /**
  12887. * Checks if `value` is classified as a `Symbol` primitive or object.
  12888. *
  12889. * @static
  12890. * @memberOf _
  12891. * @since 4.0.0
  12892. * @category Lang
  12893. * @param {*} value The value to check.
  12894. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12895. * @example
  12896. *
  12897. * _.isSymbol(Symbol.iterator);
  12898. * // => true
  12899. *
  12900. * _.isSymbol('abc');
  12901. * // => false
  12902. */
  12903. function isSymbol(value) {
  12904. return typeof value == 'symbol' ||
  12905. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  12906. }
  12907. /**
  12908. * Converts `value` to a string. An empty string is returned for `null`
  12909. * and `undefined` values. The sign of `-0` is preserved.
  12910. *
  12911. * @static
  12912. * @memberOf _
  12913. * @since 4.0.0
  12914. * @category Lang
  12915. * @param {*} value The value to process.
  12916. * @returns {string} Returns the string.
  12917. * @example
  12918. *
  12919. * _.toString(null);
  12920. * // => ''
  12921. *
  12922. * _.toString(-0);
  12923. * // => '-0'
  12924. *
  12925. * _.toString([1, 2, 3]);
  12926. * // => '1,2,3'
  12927. */
  12928. function toString(value) {
  12929. return value == null ? '' : baseToString(value);
  12930. }
  12931. /**
  12932. * Gets the value at `path` of `object`. If the resolved value is
  12933. * `undefined`, the `defaultValue` is returned in its place.
  12934. *
  12935. * @static
  12936. * @memberOf _
  12937. * @since 3.7.0
  12938. * @category Object
  12939. * @param {Object} object The object to query.
  12940. * @param {Array|string} path The path of the property to get.
  12941. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  12942. * @returns {*} Returns the resolved value.
  12943. * @example
  12944. *
  12945. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  12946. *
  12947. * _.get(object, 'a[0].b.c');
  12948. * // => 3
  12949. *
  12950. * _.get(object, ['a', '0', 'b', 'c']);
  12951. * // => 3
  12952. *
  12953. * _.get(object, 'a.b.c', 'default');
  12954. * // => 'default'
  12955. */
  12956. function get(object, path, defaultValue) {
  12957. var result = object == null ? undefined : baseGet(object, path);
  12958. return result === undefined ? defaultValue : result;
  12959. }
  12960. module.exports = get;
  12961. /***/ }),
  12962. /***/ 855:
  12963. /***/ (function(module, __unusedexports, __webpack_require__) {
  12964. module.exports = registerPlugin;
  12965. const factory = __webpack_require__(47);
  12966. function registerPlugin(plugins, pluginFunction) {
  12967. return factory(
  12968. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  12969. );
  12970. }
  12971. /***/ }),
  12972. /***/ 856:
  12973. /***/ (function(module, __unusedexports, __webpack_require__) {
  12974. module.exports = __webpack_require__(141);
  12975. /***/ }),
  12976. /***/ 863:
  12977. /***/ (function(module, __unusedexports, __webpack_require__) {
  12978. module.exports = authenticationBeforeRequest;
  12979. const btoa = __webpack_require__(675);
  12980. const withAuthorizationPrefix = __webpack_require__(143);
  12981. function authenticationBeforeRequest(state, options) {
  12982. if (typeof state.auth === "string") {
  12983. options.headers.authorization = withAuthorizationPrefix(state.auth);
  12984. return;
  12985. }
  12986. if (state.auth.username) {
  12987. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  12988. options.headers.authorization = `Basic ${hash}`;
  12989. if (state.otp) {
  12990. options.headers["x-github-otp"] = state.otp;
  12991. }
  12992. return;
  12993. }
  12994. if (state.auth.clientId) {
  12995. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  12996. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  12997. // URL though: `/applications/:client_id/tokens/:access_token`.
  12998. //
  12999. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  13000. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  13001. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  13002. //
  13003. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  13004. // as well as "/applications/123/tokens/token456"
  13005. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  13006. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  13007. options.headers.authorization = `Basic ${hash}`;
  13008. return;
  13009. }
  13010. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  13011. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  13012. return;
  13013. }
  13014. return Promise.resolve()
  13015. .then(() => {
  13016. return state.auth();
  13017. })
  13018. .then(authorization => {
  13019. options.headers.authorization = withAuthorizationPrefix(authorization);
  13020. });
  13021. }
  13022. /***/ }),
  13023. /***/ 866:
  13024. /***/ (function(module, __unusedexports, __webpack_require__) {
  13025. "use strict";
  13026. var shebangRegex = __webpack_require__(816);
  13027. module.exports = function (str) {
  13028. var match = str.match(shebangRegex);
  13029. if (!match) {
  13030. return null;
  13031. }
  13032. var arr = match[0].replace(/#! ?/, '').split(' ');
  13033. var bin = arr[0].split('/').pop();
  13034. var arg = arr[1];
  13035. return (bin === 'env' ?
  13036. arg :
  13037. bin + (arg ? ' ' + arg : '')
  13038. );
  13039. };
  13040. /***/ }),
  13041. /***/ 874:
  13042. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  13043. "use strict";
  13044. // Copyright (c) Microsoft. All rights reserved.
  13045. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  13046. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  13047. return new (P || (P = Promise))(function (resolve, reject) {
  13048. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  13049. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  13050. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  13051. step((generator = generator.apply(thisArg, _arguments || [])).next());
  13052. });
  13053. };
  13054. Object.defineProperty(exports, "__esModule", { value: true });
  13055. const url = __webpack_require__(835);
  13056. const http = __webpack_require__(605);
  13057. const https = __webpack_require__(211);
  13058. let fs;
  13059. let tunnel;
  13060. var HttpCodes;
  13061. (function (HttpCodes) {
  13062. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  13063. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  13064. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  13065. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  13066. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  13067. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  13068. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  13069. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  13070. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  13071. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  13072. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  13073. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  13074. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  13075. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  13076. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  13077. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  13078. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  13079. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  13080. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  13081. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  13082. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  13083. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  13084. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  13085. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  13086. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  13087. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  13088. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  13089. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  13090. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  13091. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  13092. const ExponentialBackoffCeiling = 10;
  13093. const ExponentialBackoffTimeSlice = 5;
  13094. class HttpClientResponse {
  13095. constructor(message) {
  13096. this.message = message;
  13097. }
  13098. readBody() {
  13099. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  13100. let output = '';
  13101. this.message.on('data', (chunk) => {
  13102. output += chunk;
  13103. });
  13104. this.message.on('end', () => {
  13105. resolve(output);
  13106. });
  13107. }));
  13108. }
  13109. }
  13110. exports.HttpClientResponse = HttpClientResponse;
  13111. function isHttps(requestUrl) {
  13112. let parsedUrl = url.parse(requestUrl);
  13113. return parsedUrl.protocol === 'https:';
  13114. }
  13115. exports.isHttps = isHttps;
  13116. var EnvironmentVariables;
  13117. (function (EnvironmentVariables) {
  13118. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  13119. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  13120. })(EnvironmentVariables || (EnvironmentVariables = {}));
  13121. class HttpClient {
  13122. constructor(userAgent, handlers, requestOptions) {
  13123. this._ignoreSslError = false;
  13124. this._allowRedirects = true;
  13125. this._maxRedirects = 50;
  13126. this._allowRetries = false;
  13127. this._maxRetries = 1;
  13128. this._keepAlive = false;
  13129. this._disposed = false;
  13130. this.userAgent = userAgent;
  13131. this.handlers = handlers || [];
  13132. this.requestOptions = requestOptions;
  13133. if (requestOptions) {
  13134. if (requestOptions.ignoreSslError != null) {
  13135. this._ignoreSslError = requestOptions.ignoreSslError;
  13136. }
  13137. this._socketTimeout = requestOptions.socketTimeout;
  13138. this._httpProxy = requestOptions.proxy;
  13139. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  13140. this._httpProxyBypassHosts = [];
  13141. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  13142. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  13143. });
  13144. }
  13145. this._certConfig = requestOptions.cert;
  13146. if (this._certConfig) {
  13147. // If using cert, need fs
  13148. fs = __webpack_require__(747);
  13149. // cache the cert content into memory, so we don't have to read it from disk every time
  13150. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  13151. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  13152. }
  13153. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  13154. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  13155. }
  13156. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  13157. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  13158. }
  13159. }
  13160. if (requestOptions.allowRedirects != null) {
  13161. this._allowRedirects = requestOptions.allowRedirects;
  13162. }
  13163. if (requestOptions.maxRedirects != null) {
  13164. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  13165. }
  13166. if (requestOptions.keepAlive != null) {
  13167. this._keepAlive = requestOptions.keepAlive;
  13168. }
  13169. if (requestOptions.allowRetries != null) {
  13170. this._allowRetries = requestOptions.allowRetries;
  13171. }
  13172. if (requestOptions.maxRetries != null) {
  13173. this._maxRetries = requestOptions.maxRetries;
  13174. }
  13175. }
  13176. }
  13177. options(requestUrl, additionalHeaders) {
  13178. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  13179. }
  13180. get(requestUrl, additionalHeaders) {
  13181. return this.request('GET', requestUrl, null, additionalHeaders || {});
  13182. }
  13183. del(requestUrl, additionalHeaders) {
  13184. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  13185. }
  13186. post(requestUrl, data, additionalHeaders) {
  13187. return this.request('POST', requestUrl, data, additionalHeaders || {});
  13188. }
  13189. patch(requestUrl, data, additionalHeaders) {
  13190. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  13191. }
  13192. put(requestUrl, data, additionalHeaders) {
  13193. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  13194. }
  13195. head(requestUrl, additionalHeaders) {
  13196. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  13197. }
  13198. sendStream(verb, requestUrl, stream, additionalHeaders) {
  13199. return this.request(verb, requestUrl, stream, additionalHeaders);
  13200. }
  13201. /**
  13202. * Makes a raw http request.
  13203. * All other methods such as get, post, patch, and request ultimately call this.
  13204. * Prefer get, del, post and patch
  13205. */
  13206. request(verb, requestUrl, data, headers) {
  13207. return __awaiter(this, void 0, void 0, function* () {
  13208. if (this._disposed) {
  13209. throw new Error("Client has already been disposed.");
  13210. }
  13211. let info = this._prepareRequest(verb, requestUrl, headers);
  13212. // Only perform retries on reads since writes may not be idempotent.
  13213. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  13214. let numTries = 0;
  13215. let response;
  13216. while (numTries < maxTries) {
  13217. response = yield this.requestRaw(info, data);
  13218. // Check if it's an authentication challenge
  13219. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  13220. let authenticationHandler;
  13221. for (let i = 0; i < this.handlers.length; i++) {
  13222. if (this.handlers[i].canHandleAuthentication(response)) {
  13223. authenticationHandler = this.handlers[i];
  13224. break;
  13225. }
  13226. }
  13227. if (authenticationHandler) {
  13228. return authenticationHandler.handleAuthentication(this, info, data);
  13229. }
  13230. else {
  13231. // We have received an unauthorized response but have no handlers to handle it.
  13232. // Let the response return to the caller.
  13233. return response;
  13234. }
  13235. }
  13236. let redirectsRemaining = this._maxRedirects;
  13237. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  13238. && this._allowRedirects
  13239. && redirectsRemaining > 0) {
  13240. const redirectUrl = response.message.headers["location"];
  13241. if (!redirectUrl) {
  13242. // if there's no location to redirect to, we won't
  13243. break;
  13244. }
  13245. // we need to finish reading the response before reassigning response
  13246. // which will leak the open socket.
  13247. yield response.readBody();
  13248. // let's make the request with the new redirectUrl
  13249. info = this._prepareRequest(verb, redirectUrl, headers);
  13250. response = yield this.requestRaw(info, data);
  13251. redirectsRemaining--;
  13252. }
  13253. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  13254. // If not a retry code, return immediately instead of retrying
  13255. return response;
  13256. }
  13257. numTries += 1;
  13258. if (numTries < maxTries) {
  13259. yield response.readBody();
  13260. yield this._performExponentialBackoff(numTries);
  13261. }
  13262. }
  13263. return response;
  13264. });
  13265. }
  13266. /**
  13267. * Needs to be called if keepAlive is set to true in request options.
  13268. */
  13269. dispose() {
  13270. if (this._agent) {
  13271. this._agent.destroy();
  13272. }
  13273. this._disposed = true;
  13274. }
  13275. /**
  13276. * Raw request.
  13277. * @param info
  13278. * @param data
  13279. */
  13280. requestRaw(info, data) {
  13281. return new Promise((resolve, reject) => {
  13282. let callbackForResult = function (err, res) {
  13283. if (err) {
  13284. reject(err);
  13285. }
  13286. resolve(res);
  13287. };
  13288. this.requestRawWithCallback(info, data, callbackForResult);
  13289. });
  13290. }
  13291. /**
  13292. * Raw request with callback.
  13293. * @param info
  13294. * @param data
  13295. * @param onResult
  13296. */
  13297. requestRawWithCallback(info, data, onResult) {
  13298. let socket;
  13299. let isDataString = typeof (data) === 'string';
  13300. if (typeof (data) === 'string') {
  13301. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13302. }
  13303. let callbackCalled = false;
  13304. let handleResult = (err, res) => {
  13305. if (!callbackCalled) {
  13306. callbackCalled = true;
  13307. onResult(err, res);
  13308. }
  13309. };
  13310. let req = info.httpModule.request(info.options, (msg) => {
  13311. let res = new HttpClientResponse(msg);
  13312. handleResult(null, res);
  13313. });
  13314. req.on('socket', (sock) => {
  13315. socket = sock;
  13316. });
  13317. // If we ever get disconnected, we want the socket to timeout eventually
  13318. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13319. if (socket) {
  13320. socket.end();
  13321. }
  13322. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13323. });
  13324. req.on('error', function (err) {
  13325. // err has statusCode property
  13326. // res should have headers
  13327. handleResult(err, null);
  13328. });
  13329. if (data && typeof (data) === 'string') {
  13330. req.write(data, 'utf8');
  13331. }
  13332. if (data && typeof (data) !== 'string') {
  13333. data.on('close', function () {
  13334. req.end();
  13335. });
  13336. data.pipe(req);
  13337. }
  13338. else {
  13339. req.end();
  13340. }
  13341. }
  13342. _prepareRequest(method, requestUrl, headers) {
  13343. const info = {};
  13344. info.parsedUrl = url.parse(requestUrl);
  13345. const usingSsl = info.parsedUrl.protocol === 'https:';
  13346. info.httpModule = usingSsl ? https : http;
  13347. const defaultPort = usingSsl ? 443 : 80;
  13348. info.options = {};
  13349. info.options.host = info.parsedUrl.hostname;
  13350. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13351. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13352. info.options.method = method;
  13353. info.options.headers = this._mergeHeaders(headers);
  13354. info.options.headers["user-agent"] = this.userAgent;
  13355. info.options.agent = this._getAgent(requestUrl);
  13356. // gives handlers an opportunity to participate
  13357. if (this.handlers && !this._isPresigned(requestUrl)) {
  13358. this.handlers.forEach((handler) => {
  13359. handler.prepareRequest(info.options);
  13360. });
  13361. }
  13362. return info;
  13363. }
  13364. _isPresigned(requestUrl) {
  13365. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13366. const patterns = this.requestOptions.presignedUrlPatterns;
  13367. for (let i = 0; i < patterns.length; i++) {
  13368. if (requestUrl.match(patterns[i])) {
  13369. return true;
  13370. }
  13371. }
  13372. }
  13373. return false;
  13374. }
  13375. _mergeHeaders(headers) {
  13376. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13377. if (this.requestOptions && this.requestOptions.headers) {
  13378. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13379. }
  13380. return lowercaseKeys(headers || {});
  13381. }
  13382. _getAgent(requestUrl) {
  13383. let agent;
  13384. let proxy = this._getProxy(requestUrl);
  13385. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13386. if (this._keepAlive && useProxy) {
  13387. agent = this._proxyAgent;
  13388. }
  13389. if (this._keepAlive && !useProxy) {
  13390. agent = this._agent;
  13391. }
  13392. // if agent is already assigned use that agent.
  13393. if (!!agent) {
  13394. return agent;
  13395. }
  13396. let parsedUrl = url.parse(requestUrl);
  13397. const usingSsl = parsedUrl.protocol === 'https:';
  13398. let maxSockets = 100;
  13399. if (!!this.requestOptions) {
  13400. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13401. }
  13402. if (useProxy) {
  13403. // If using proxy, need tunnel
  13404. if (!tunnel) {
  13405. tunnel = __webpack_require__(856);
  13406. }
  13407. const agentOptions = {
  13408. maxSockets: maxSockets,
  13409. keepAlive: this._keepAlive,
  13410. proxy: {
  13411. proxyAuth: proxy.proxyAuth,
  13412. host: proxy.proxyUrl.hostname,
  13413. port: proxy.proxyUrl.port
  13414. },
  13415. };
  13416. let tunnelAgent;
  13417. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13418. if (usingSsl) {
  13419. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13420. }
  13421. else {
  13422. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13423. }
  13424. agent = tunnelAgent(agentOptions);
  13425. this._proxyAgent = agent;
  13426. }
  13427. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13428. if (this._keepAlive && !agent) {
  13429. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13430. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13431. this._agent = agent;
  13432. }
  13433. // if not using private agent and tunnel agent isn't setup then use global agent
  13434. if (!agent) {
  13435. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13436. }
  13437. if (usingSsl && this._ignoreSslError) {
  13438. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13439. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13440. // we have to cast it to any and change it directly
  13441. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13442. }
  13443. if (usingSsl && this._certConfig) {
  13444. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13445. }
  13446. return agent;
  13447. }
  13448. _getProxy(requestUrl) {
  13449. const parsedUrl = url.parse(requestUrl);
  13450. let usingSsl = parsedUrl.protocol === 'https:';
  13451. let proxyConfig = this._httpProxy;
  13452. // fallback to http_proxy and https_proxy env
  13453. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13454. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13455. if (!proxyConfig) {
  13456. if (https_proxy && usingSsl) {
  13457. proxyConfig = {
  13458. proxyUrl: https_proxy
  13459. };
  13460. }
  13461. else if (http_proxy) {
  13462. proxyConfig = {
  13463. proxyUrl: http_proxy
  13464. };
  13465. }
  13466. }
  13467. let proxyUrl;
  13468. let proxyAuth;
  13469. if (proxyConfig) {
  13470. if (proxyConfig.proxyUrl.length > 0) {
  13471. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13472. }
  13473. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13474. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13475. }
  13476. }
  13477. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13478. }
  13479. _isBypassProxy(requestUrl) {
  13480. if (!this._httpProxyBypassHosts) {
  13481. return false;
  13482. }
  13483. let bypass = false;
  13484. this._httpProxyBypassHosts.forEach(bypassHost => {
  13485. if (bypassHost.test(requestUrl)) {
  13486. bypass = true;
  13487. }
  13488. });
  13489. return bypass;
  13490. }
  13491. _performExponentialBackoff(retryNumber) {
  13492. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13493. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13494. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13495. }
  13496. }
  13497. exports.HttpClient = HttpClient;
  13498. /***/ }),
  13499. /***/ 881:
  13500. /***/ (function(module) {
  13501. "use strict";
  13502. const isWin = process.platform === 'win32';
  13503. function notFoundError(original, syscall) {
  13504. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13505. code: 'ENOENT',
  13506. errno: 'ENOENT',
  13507. syscall: `${syscall} ${original.command}`,
  13508. path: original.command,
  13509. spawnargs: original.args,
  13510. });
  13511. }
  13512. function hookChildProcess(cp, parsed) {
  13513. if (!isWin) {
  13514. return;
  13515. }
  13516. const originalEmit = cp.emit;
  13517. cp.emit = function (name, arg1) {
  13518. // If emitting "exit" event and exit code is 1, we need to check if
  13519. // the command exists and emit an "error" instead
  13520. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13521. if (name === 'exit') {
  13522. const err = verifyENOENT(arg1, parsed, 'spawn');
  13523. if (err) {
  13524. return originalEmit.call(cp, 'error', err);
  13525. }
  13526. }
  13527. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13528. };
  13529. }
  13530. function verifyENOENT(status, parsed) {
  13531. if (isWin && status === 1 && !parsed.file) {
  13532. return notFoundError(parsed.original, 'spawn');
  13533. }
  13534. return null;
  13535. }
  13536. function verifyENOENTSync(status, parsed) {
  13537. if (isWin && status === 1 && !parsed.file) {
  13538. return notFoundError(parsed.original, 'spawnSync');
  13539. }
  13540. return null;
  13541. }
  13542. module.exports = {
  13543. hookChildProcess,
  13544. verifyENOENT,
  13545. verifyENOENTSync,
  13546. notFoundError,
  13547. };
  13548. /***/ }),
  13549. /***/ 883:
  13550. /***/ (function(module) {
  13551. /**
  13552. * lodash (Custom Build) <https://lodash.com/>
  13553. * Build: `lodash modularize exports="npm" -o ./`
  13554. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13555. * Released under MIT license <https://lodash.com/license>
  13556. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13557. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13558. */
  13559. /** Used as the `TypeError` message for "Functions" methods. */
  13560. var FUNC_ERROR_TEXT = 'Expected a function';
  13561. /** Used to stand-in for `undefined` hash values. */
  13562. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13563. /** Used as references for various `Number` constants. */
  13564. var INFINITY = 1 / 0,
  13565. MAX_SAFE_INTEGER = 9007199254740991;
  13566. /** `Object#toString` result references. */
  13567. var funcTag = '[object Function]',
  13568. genTag = '[object GeneratorFunction]',
  13569. symbolTag = '[object Symbol]';
  13570. /** Used to match property names within property paths. */
  13571. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13572. reIsPlainProp = /^\w*$/,
  13573. reLeadingDot = /^\./,
  13574. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13575. /**
  13576. * Used to match `RegExp`
  13577. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13578. */
  13579. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13580. /** Used to match backslashes in property paths. */
  13581. var reEscapeChar = /\\(\\)?/g;
  13582. /** Used to detect host constructors (Safari). */
  13583. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13584. /** Used to detect unsigned integer values. */
  13585. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13586. /** Detect free variable `global` from Node.js. */
  13587. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13588. /** Detect free variable `self`. */
  13589. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13590. /** Used as a reference to the global object. */
  13591. var root = freeGlobal || freeSelf || Function('return this')();
  13592. /**
  13593. * Gets the value at `key` of `object`.
  13594. *
  13595. * @private
  13596. * @param {Object} [object] The object to query.
  13597. * @param {string} key The key of the property to get.
  13598. * @returns {*} Returns the property value.
  13599. */
  13600. function getValue(object, key) {
  13601. return object == null ? undefined : object[key];
  13602. }
  13603. /**
  13604. * Checks if `value` is a host object in IE < 9.
  13605. *
  13606. * @private
  13607. * @param {*} value The value to check.
  13608. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13609. */
  13610. function isHostObject(value) {
  13611. // Many host objects are `Object` objects that can coerce to strings
  13612. // despite having improperly defined `toString` methods.
  13613. var result = false;
  13614. if (value != null && typeof value.toString != 'function') {
  13615. try {
  13616. result = !!(value + '');
  13617. } catch (e) {}
  13618. }
  13619. return result;
  13620. }
  13621. /** Used for built-in method references. */
  13622. var arrayProto = Array.prototype,
  13623. funcProto = Function.prototype,
  13624. objectProto = Object.prototype;
  13625. /** Used to detect overreaching core-js shims. */
  13626. var coreJsData = root['__core-js_shared__'];
  13627. /** Used to detect methods masquerading as native. */
  13628. var maskSrcKey = (function() {
  13629. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  13630. return uid ? ('Symbol(src)_1.' + uid) : '';
  13631. }());
  13632. /** Used to resolve the decompiled source of functions. */
  13633. var funcToString = funcProto.toString;
  13634. /** Used to check objects for own properties. */
  13635. var hasOwnProperty = objectProto.hasOwnProperty;
  13636. /**
  13637. * Used to resolve the
  13638. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  13639. * of values.
  13640. */
  13641. var objectToString = objectProto.toString;
  13642. /** Used to detect if a method is native. */
  13643. var reIsNative = RegExp('^' +
  13644. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  13645. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  13646. );
  13647. /** Built-in value references. */
  13648. var Symbol = root.Symbol,
  13649. splice = arrayProto.splice;
  13650. /* Built-in method references that are verified to be native. */
  13651. var Map = getNative(root, 'Map'),
  13652. nativeCreate = getNative(Object, 'create');
  13653. /** Used to convert symbols to primitives and strings. */
  13654. var symbolProto = Symbol ? Symbol.prototype : undefined,
  13655. symbolToString = symbolProto ? symbolProto.toString : undefined;
  13656. /**
  13657. * Creates a hash object.
  13658. *
  13659. * @private
  13660. * @constructor
  13661. * @param {Array} [entries] The key-value pairs to cache.
  13662. */
  13663. function Hash(entries) {
  13664. var index = -1,
  13665. length = entries ? entries.length : 0;
  13666. this.clear();
  13667. while (++index < length) {
  13668. var entry = entries[index];
  13669. this.set(entry[0], entry[1]);
  13670. }
  13671. }
  13672. /**
  13673. * Removes all key-value entries from the hash.
  13674. *
  13675. * @private
  13676. * @name clear
  13677. * @memberOf Hash
  13678. */
  13679. function hashClear() {
  13680. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  13681. }
  13682. /**
  13683. * Removes `key` and its value from the hash.
  13684. *
  13685. * @private
  13686. * @name delete
  13687. * @memberOf Hash
  13688. * @param {Object} hash The hash to modify.
  13689. * @param {string} key The key of the value to remove.
  13690. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13691. */
  13692. function hashDelete(key) {
  13693. return this.has(key) && delete this.__data__[key];
  13694. }
  13695. /**
  13696. * Gets the hash value for `key`.
  13697. *
  13698. * @private
  13699. * @name get
  13700. * @memberOf Hash
  13701. * @param {string} key The key of the value to get.
  13702. * @returns {*} Returns the entry value.
  13703. */
  13704. function hashGet(key) {
  13705. var data = this.__data__;
  13706. if (nativeCreate) {
  13707. var result = data[key];
  13708. return result === HASH_UNDEFINED ? undefined : result;
  13709. }
  13710. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  13711. }
  13712. /**
  13713. * Checks if a hash value for `key` exists.
  13714. *
  13715. * @private
  13716. * @name has
  13717. * @memberOf Hash
  13718. * @param {string} key The key of the entry to check.
  13719. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13720. */
  13721. function hashHas(key) {
  13722. var data = this.__data__;
  13723. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  13724. }
  13725. /**
  13726. * Sets the hash `key` to `value`.
  13727. *
  13728. * @private
  13729. * @name set
  13730. * @memberOf Hash
  13731. * @param {string} key The key of the value to set.
  13732. * @param {*} value The value to set.
  13733. * @returns {Object} Returns the hash instance.
  13734. */
  13735. function hashSet(key, value) {
  13736. var data = this.__data__;
  13737. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  13738. return this;
  13739. }
  13740. // Add methods to `Hash`.
  13741. Hash.prototype.clear = hashClear;
  13742. Hash.prototype['delete'] = hashDelete;
  13743. Hash.prototype.get = hashGet;
  13744. Hash.prototype.has = hashHas;
  13745. Hash.prototype.set = hashSet;
  13746. /**
  13747. * Creates an list cache object.
  13748. *
  13749. * @private
  13750. * @constructor
  13751. * @param {Array} [entries] The key-value pairs to cache.
  13752. */
  13753. function ListCache(entries) {
  13754. var index = -1,
  13755. length = entries ? entries.length : 0;
  13756. this.clear();
  13757. while (++index < length) {
  13758. var entry = entries[index];
  13759. this.set(entry[0], entry[1]);
  13760. }
  13761. }
  13762. /**
  13763. * Removes all key-value entries from the list cache.
  13764. *
  13765. * @private
  13766. * @name clear
  13767. * @memberOf ListCache
  13768. */
  13769. function listCacheClear() {
  13770. this.__data__ = [];
  13771. }
  13772. /**
  13773. * Removes `key` and its value from the list cache.
  13774. *
  13775. * @private
  13776. * @name delete
  13777. * @memberOf ListCache
  13778. * @param {string} key The key of the value to remove.
  13779. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13780. */
  13781. function listCacheDelete(key) {
  13782. var data = this.__data__,
  13783. index = assocIndexOf(data, key);
  13784. if (index < 0) {
  13785. return false;
  13786. }
  13787. var lastIndex = data.length - 1;
  13788. if (index == lastIndex) {
  13789. data.pop();
  13790. } else {
  13791. splice.call(data, index, 1);
  13792. }
  13793. return true;
  13794. }
  13795. /**
  13796. * Gets the list cache value for `key`.
  13797. *
  13798. * @private
  13799. * @name get
  13800. * @memberOf ListCache
  13801. * @param {string} key The key of the value to get.
  13802. * @returns {*} Returns the entry value.
  13803. */
  13804. function listCacheGet(key) {
  13805. var data = this.__data__,
  13806. index = assocIndexOf(data, key);
  13807. return index < 0 ? undefined : data[index][1];
  13808. }
  13809. /**
  13810. * Checks if a list cache value for `key` exists.
  13811. *
  13812. * @private
  13813. * @name has
  13814. * @memberOf ListCache
  13815. * @param {string} key The key of the entry to check.
  13816. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13817. */
  13818. function listCacheHas(key) {
  13819. return assocIndexOf(this.__data__, key) > -1;
  13820. }
  13821. /**
  13822. * Sets the list cache `key` to `value`.
  13823. *
  13824. * @private
  13825. * @name set
  13826. * @memberOf ListCache
  13827. * @param {string} key The key of the value to set.
  13828. * @param {*} value The value to set.
  13829. * @returns {Object} Returns the list cache instance.
  13830. */
  13831. function listCacheSet(key, value) {
  13832. var data = this.__data__,
  13833. index = assocIndexOf(data, key);
  13834. if (index < 0) {
  13835. data.push([key, value]);
  13836. } else {
  13837. data[index][1] = value;
  13838. }
  13839. return this;
  13840. }
  13841. // Add methods to `ListCache`.
  13842. ListCache.prototype.clear = listCacheClear;
  13843. ListCache.prototype['delete'] = listCacheDelete;
  13844. ListCache.prototype.get = listCacheGet;
  13845. ListCache.prototype.has = listCacheHas;
  13846. ListCache.prototype.set = listCacheSet;
  13847. /**
  13848. * Creates a map cache object to store key-value pairs.
  13849. *
  13850. * @private
  13851. * @constructor
  13852. * @param {Array} [entries] The key-value pairs to cache.
  13853. */
  13854. function MapCache(entries) {
  13855. var index = -1,
  13856. length = entries ? entries.length : 0;
  13857. this.clear();
  13858. while (++index < length) {
  13859. var entry = entries[index];
  13860. this.set(entry[0], entry[1]);
  13861. }
  13862. }
  13863. /**
  13864. * Removes all key-value entries from the map.
  13865. *
  13866. * @private
  13867. * @name clear
  13868. * @memberOf MapCache
  13869. */
  13870. function mapCacheClear() {
  13871. this.__data__ = {
  13872. 'hash': new Hash,
  13873. 'map': new (Map || ListCache),
  13874. 'string': new Hash
  13875. };
  13876. }
  13877. /**
  13878. * Removes `key` and its value from the map.
  13879. *
  13880. * @private
  13881. * @name delete
  13882. * @memberOf MapCache
  13883. * @param {string} key The key of the value to remove.
  13884. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13885. */
  13886. function mapCacheDelete(key) {
  13887. return getMapData(this, key)['delete'](key);
  13888. }
  13889. /**
  13890. * Gets the map value for `key`.
  13891. *
  13892. * @private
  13893. * @name get
  13894. * @memberOf MapCache
  13895. * @param {string} key The key of the value to get.
  13896. * @returns {*} Returns the entry value.
  13897. */
  13898. function mapCacheGet(key) {
  13899. return getMapData(this, key).get(key);
  13900. }
  13901. /**
  13902. * Checks if a map value for `key` exists.
  13903. *
  13904. * @private
  13905. * @name has
  13906. * @memberOf MapCache
  13907. * @param {string} key The key of the entry to check.
  13908. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13909. */
  13910. function mapCacheHas(key) {
  13911. return getMapData(this, key).has(key);
  13912. }
  13913. /**
  13914. * Sets the map `key` to `value`.
  13915. *
  13916. * @private
  13917. * @name set
  13918. * @memberOf MapCache
  13919. * @param {string} key The key of the value to set.
  13920. * @param {*} value The value to set.
  13921. * @returns {Object} Returns the map cache instance.
  13922. */
  13923. function mapCacheSet(key, value) {
  13924. getMapData(this, key).set(key, value);
  13925. return this;
  13926. }
  13927. // Add methods to `MapCache`.
  13928. MapCache.prototype.clear = mapCacheClear;
  13929. MapCache.prototype['delete'] = mapCacheDelete;
  13930. MapCache.prototype.get = mapCacheGet;
  13931. MapCache.prototype.has = mapCacheHas;
  13932. MapCache.prototype.set = mapCacheSet;
  13933. /**
  13934. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  13935. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13936. * for equality comparisons.
  13937. *
  13938. * @private
  13939. * @param {Object} object The object to modify.
  13940. * @param {string} key The key of the property to assign.
  13941. * @param {*} value The value to assign.
  13942. */
  13943. function assignValue(object, key, value) {
  13944. var objValue = object[key];
  13945. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  13946. (value === undefined && !(key in object))) {
  13947. object[key] = value;
  13948. }
  13949. }
  13950. /**
  13951. * Gets the index at which the `key` is found in `array` of key-value pairs.
  13952. *
  13953. * @private
  13954. * @param {Array} array The array to inspect.
  13955. * @param {*} key The key to search for.
  13956. * @returns {number} Returns the index of the matched value, else `-1`.
  13957. */
  13958. function assocIndexOf(array, key) {
  13959. var length = array.length;
  13960. while (length--) {
  13961. if (eq(array[length][0], key)) {
  13962. return length;
  13963. }
  13964. }
  13965. return -1;
  13966. }
  13967. /**
  13968. * The base implementation of `_.isNative` without bad shim checks.
  13969. *
  13970. * @private
  13971. * @param {*} value The value to check.
  13972. * @returns {boolean} Returns `true` if `value` is a native function,
  13973. * else `false`.
  13974. */
  13975. function baseIsNative(value) {
  13976. if (!isObject(value) || isMasked(value)) {
  13977. return false;
  13978. }
  13979. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  13980. return pattern.test(toSource(value));
  13981. }
  13982. /**
  13983. * The base implementation of `_.set`.
  13984. *
  13985. * @private
  13986. * @param {Object} object The object to modify.
  13987. * @param {Array|string} path The path of the property to set.
  13988. * @param {*} value The value to set.
  13989. * @param {Function} [customizer] The function to customize path creation.
  13990. * @returns {Object} Returns `object`.
  13991. */
  13992. function baseSet(object, path, value, customizer) {
  13993. if (!isObject(object)) {
  13994. return object;
  13995. }
  13996. path = isKey(path, object) ? [path] : castPath(path);
  13997. var index = -1,
  13998. length = path.length,
  13999. lastIndex = length - 1,
  14000. nested = object;
  14001. while (nested != null && ++index < length) {
  14002. var key = toKey(path[index]),
  14003. newValue = value;
  14004. if (index != lastIndex) {
  14005. var objValue = nested[key];
  14006. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  14007. if (newValue === undefined) {
  14008. newValue = isObject(objValue)
  14009. ? objValue
  14010. : (isIndex(path[index + 1]) ? [] : {});
  14011. }
  14012. }
  14013. assignValue(nested, key, newValue);
  14014. nested = nested[key];
  14015. }
  14016. return object;
  14017. }
  14018. /**
  14019. * The base implementation of `_.toString` which doesn't convert nullish
  14020. * values to empty strings.
  14021. *
  14022. * @private
  14023. * @param {*} value The value to process.
  14024. * @returns {string} Returns the string.
  14025. */
  14026. function baseToString(value) {
  14027. // Exit early for strings to avoid a performance hit in some environments.
  14028. if (typeof value == 'string') {
  14029. return value;
  14030. }
  14031. if (isSymbol(value)) {
  14032. return symbolToString ? symbolToString.call(value) : '';
  14033. }
  14034. var result = (value + '');
  14035. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14036. }
  14037. /**
  14038. * Casts `value` to a path array if it's not one.
  14039. *
  14040. * @private
  14041. * @param {*} value The value to inspect.
  14042. * @returns {Array} Returns the cast property path array.
  14043. */
  14044. function castPath(value) {
  14045. return isArray(value) ? value : stringToPath(value);
  14046. }
  14047. /**
  14048. * Gets the data for `map`.
  14049. *
  14050. * @private
  14051. * @param {Object} map The map to query.
  14052. * @param {string} key The reference key.
  14053. * @returns {*} Returns the map data.
  14054. */
  14055. function getMapData(map, key) {
  14056. var data = map.__data__;
  14057. return isKeyable(key)
  14058. ? data[typeof key == 'string' ? 'string' : 'hash']
  14059. : data.map;
  14060. }
  14061. /**
  14062. * Gets the native function at `key` of `object`.
  14063. *
  14064. * @private
  14065. * @param {Object} object The object to query.
  14066. * @param {string} key The key of the method to get.
  14067. * @returns {*} Returns the function if it's native, else `undefined`.
  14068. */
  14069. function getNative(object, key) {
  14070. var value = getValue(object, key);
  14071. return baseIsNative(value) ? value : undefined;
  14072. }
  14073. /**
  14074. * Checks if `value` is a valid array-like index.
  14075. *
  14076. * @private
  14077. * @param {*} value The value to check.
  14078. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  14079. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  14080. */
  14081. function isIndex(value, length) {
  14082. length = length == null ? MAX_SAFE_INTEGER : length;
  14083. return !!length &&
  14084. (typeof value == 'number' || reIsUint.test(value)) &&
  14085. (value > -1 && value % 1 == 0 && value < length);
  14086. }
  14087. /**
  14088. * Checks if `value` is a property name and not a property path.
  14089. *
  14090. * @private
  14091. * @param {*} value The value to check.
  14092. * @param {Object} [object] The object to query keys on.
  14093. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  14094. */
  14095. function isKey(value, object) {
  14096. if (isArray(value)) {
  14097. return false;
  14098. }
  14099. var type = typeof value;
  14100. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  14101. value == null || isSymbol(value)) {
  14102. return true;
  14103. }
  14104. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  14105. (object != null && value in Object(object));
  14106. }
  14107. /**
  14108. * Checks if `value` is suitable for use as unique object key.
  14109. *
  14110. * @private
  14111. * @param {*} value The value to check.
  14112. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  14113. */
  14114. function isKeyable(value) {
  14115. var type = typeof value;
  14116. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  14117. ? (value !== '__proto__')
  14118. : (value === null);
  14119. }
  14120. /**
  14121. * Checks if `func` has its source masked.
  14122. *
  14123. * @private
  14124. * @param {Function} func The function to check.
  14125. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  14126. */
  14127. function isMasked(func) {
  14128. return !!maskSrcKey && (maskSrcKey in func);
  14129. }
  14130. /**
  14131. * Converts `string` to a property path array.
  14132. *
  14133. * @private
  14134. * @param {string} string The string to convert.
  14135. * @returns {Array} Returns the property path array.
  14136. */
  14137. var stringToPath = memoize(function(string) {
  14138. string = toString(string);
  14139. var result = [];
  14140. if (reLeadingDot.test(string)) {
  14141. result.push('');
  14142. }
  14143. string.replace(rePropName, function(match, number, quote, string) {
  14144. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  14145. });
  14146. return result;
  14147. });
  14148. /**
  14149. * Converts `value` to a string key if it's not a string or symbol.
  14150. *
  14151. * @private
  14152. * @param {*} value The value to inspect.
  14153. * @returns {string|symbol} Returns the key.
  14154. */
  14155. function toKey(value) {
  14156. if (typeof value == 'string' || isSymbol(value)) {
  14157. return value;
  14158. }
  14159. var result = (value + '');
  14160. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  14161. }
  14162. /**
  14163. * Converts `func` to its source code.
  14164. *
  14165. * @private
  14166. * @param {Function} func The function to process.
  14167. * @returns {string} Returns the source code.
  14168. */
  14169. function toSource(func) {
  14170. if (func != null) {
  14171. try {
  14172. return funcToString.call(func);
  14173. } catch (e) {}
  14174. try {
  14175. return (func + '');
  14176. } catch (e) {}
  14177. }
  14178. return '';
  14179. }
  14180. /**
  14181. * Creates a function that memoizes the result of `func`. If `resolver` is
  14182. * provided, it determines the cache key for storing the result based on the
  14183. * arguments provided to the memoized function. By default, the first argument
  14184. * provided to the memoized function is used as the map cache key. The `func`
  14185. * is invoked with the `this` binding of the memoized function.
  14186. *
  14187. * **Note:** The cache is exposed as the `cache` property on the memoized
  14188. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  14189. * constructor with one whose instances implement the
  14190. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  14191. * method interface of `delete`, `get`, `has`, and `set`.
  14192. *
  14193. * @static
  14194. * @memberOf _
  14195. * @since 0.1.0
  14196. * @category Function
  14197. * @param {Function} func The function to have its output memoized.
  14198. * @param {Function} [resolver] The function to resolve the cache key.
  14199. * @returns {Function} Returns the new memoized function.
  14200. * @example
  14201. *
  14202. * var object = { 'a': 1, 'b': 2 };
  14203. * var other = { 'c': 3, 'd': 4 };
  14204. *
  14205. * var values = _.memoize(_.values);
  14206. * values(object);
  14207. * // => [1, 2]
  14208. *
  14209. * values(other);
  14210. * // => [3, 4]
  14211. *
  14212. * object.a = 2;
  14213. * values(object);
  14214. * // => [1, 2]
  14215. *
  14216. * // Modify the result cache.
  14217. * values.cache.set(object, ['a', 'b']);
  14218. * values(object);
  14219. * // => ['a', 'b']
  14220. *
  14221. * // Replace `_.memoize.Cache`.
  14222. * _.memoize.Cache = WeakMap;
  14223. */
  14224. function memoize(func, resolver) {
  14225. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  14226. throw new TypeError(FUNC_ERROR_TEXT);
  14227. }
  14228. var memoized = function() {
  14229. var args = arguments,
  14230. key = resolver ? resolver.apply(this, args) : args[0],
  14231. cache = memoized.cache;
  14232. if (cache.has(key)) {
  14233. return cache.get(key);
  14234. }
  14235. var result = func.apply(this, args);
  14236. memoized.cache = cache.set(key, result);
  14237. return result;
  14238. };
  14239. memoized.cache = new (memoize.Cache || MapCache);
  14240. return memoized;
  14241. }
  14242. // Assign cache to `_.memoize`.
  14243. memoize.Cache = MapCache;
  14244. /**
  14245. * Performs a
  14246. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14247. * comparison between two values to determine if they are equivalent.
  14248. *
  14249. * @static
  14250. * @memberOf _
  14251. * @since 4.0.0
  14252. * @category Lang
  14253. * @param {*} value The value to compare.
  14254. * @param {*} other The other value to compare.
  14255. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  14256. * @example
  14257. *
  14258. * var object = { 'a': 1 };
  14259. * var other = { 'a': 1 };
  14260. *
  14261. * _.eq(object, object);
  14262. * // => true
  14263. *
  14264. * _.eq(object, other);
  14265. * // => false
  14266. *
  14267. * _.eq('a', 'a');
  14268. * // => true
  14269. *
  14270. * _.eq('a', Object('a'));
  14271. * // => false
  14272. *
  14273. * _.eq(NaN, NaN);
  14274. * // => true
  14275. */
  14276. function eq(value, other) {
  14277. return value === other || (value !== value && other !== other);
  14278. }
  14279. /**
  14280. * Checks if `value` is classified as an `Array` object.
  14281. *
  14282. * @static
  14283. * @memberOf _
  14284. * @since 0.1.0
  14285. * @category Lang
  14286. * @param {*} value The value to check.
  14287. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14288. * @example
  14289. *
  14290. * _.isArray([1, 2, 3]);
  14291. * // => true
  14292. *
  14293. * _.isArray(document.body.children);
  14294. * // => false
  14295. *
  14296. * _.isArray('abc');
  14297. * // => false
  14298. *
  14299. * _.isArray(_.noop);
  14300. * // => false
  14301. */
  14302. var isArray = Array.isArray;
  14303. /**
  14304. * Checks if `value` is classified as a `Function` object.
  14305. *
  14306. * @static
  14307. * @memberOf _
  14308. * @since 0.1.0
  14309. * @category Lang
  14310. * @param {*} value The value to check.
  14311. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14312. * @example
  14313. *
  14314. * _.isFunction(_);
  14315. * // => true
  14316. *
  14317. * _.isFunction(/abc/);
  14318. * // => false
  14319. */
  14320. function isFunction(value) {
  14321. // The use of `Object#toString` avoids issues with the `typeof` operator
  14322. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14323. var tag = isObject(value) ? objectToString.call(value) : '';
  14324. return tag == funcTag || tag == genTag;
  14325. }
  14326. /**
  14327. * Checks if `value` is the
  14328. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14329. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14330. *
  14331. * @static
  14332. * @memberOf _
  14333. * @since 0.1.0
  14334. * @category Lang
  14335. * @param {*} value The value to check.
  14336. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14337. * @example
  14338. *
  14339. * _.isObject({});
  14340. * // => true
  14341. *
  14342. * _.isObject([1, 2, 3]);
  14343. * // => true
  14344. *
  14345. * _.isObject(_.noop);
  14346. * // => true
  14347. *
  14348. * _.isObject(null);
  14349. * // => false
  14350. */
  14351. function isObject(value) {
  14352. var type = typeof value;
  14353. return !!value && (type == 'object' || type == 'function');
  14354. }
  14355. /**
  14356. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14357. * and has a `typeof` result of "object".
  14358. *
  14359. * @static
  14360. * @memberOf _
  14361. * @since 4.0.0
  14362. * @category Lang
  14363. * @param {*} value The value to check.
  14364. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14365. * @example
  14366. *
  14367. * _.isObjectLike({});
  14368. * // => true
  14369. *
  14370. * _.isObjectLike([1, 2, 3]);
  14371. * // => true
  14372. *
  14373. * _.isObjectLike(_.noop);
  14374. * // => false
  14375. *
  14376. * _.isObjectLike(null);
  14377. * // => false
  14378. */
  14379. function isObjectLike(value) {
  14380. return !!value && typeof value == 'object';
  14381. }
  14382. /**
  14383. * Checks if `value` is classified as a `Symbol` primitive or object.
  14384. *
  14385. * @static
  14386. * @memberOf _
  14387. * @since 4.0.0
  14388. * @category Lang
  14389. * @param {*} value The value to check.
  14390. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14391. * @example
  14392. *
  14393. * _.isSymbol(Symbol.iterator);
  14394. * // => true
  14395. *
  14396. * _.isSymbol('abc');
  14397. * // => false
  14398. */
  14399. function isSymbol(value) {
  14400. return typeof value == 'symbol' ||
  14401. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14402. }
  14403. /**
  14404. * Converts `value` to a string. An empty string is returned for `null`
  14405. * and `undefined` values. The sign of `-0` is preserved.
  14406. *
  14407. * @static
  14408. * @memberOf _
  14409. * @since 4.0.0
  14410. * @category Lang
  14411. * @param {*} value The value to process.
  14412. * @returns {string} Returns the string.
  14413. * @example
  14414. *
  14415. * _.toString(null);
  14416. * // => ''
  14417. *
  14418. * _.toString(-0);
  14419. * // => '-0'
  14420. *
  14421. * _.toString([1, 2, 3]);
  14422. * // => '1,2,3'
  14423. */
  14424. function toString(value) {
  14425. return value == null ? '' : baseToString(value);
  14426. }
  14427. /**
  14428. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14429. * it's created. Arrays are created for missing index properties while objects
  14430. * are created for all other missing properties. Use `_.setWith` to customize
  14431. * `path` creation.
  14432. *
  14433. * **Note:** This method mutates `object`.
  14434. *
  14435. * @static
  14436. * @memberOf _
  14437. * @since 3.7.0
  14438. * @category Object
  14439. * @param {Object} object The object to modify.
  14440. * @param {Array|string} path The path of the property to set.
  14441. * @param {*} value The value to set.
  14442. * @returns {Object} Returns `object`.
  14443. * @example
  14444. *
  14445. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14446. *
  14447. * _.set(object, 'a[0].b.c', 4);
  14448. * console.log(object.a[0].b.c);
  14449. * // => 4
  14450. *
  14451. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14452. * console.log(object.x[0].y.z);
  14453. * // => 5
  14454. */
  14455. function set(object, path, value) {
  14456. return object == null ? object : baseSet(object, path, value);
  14457. }
  14458. module.exports = set;
  14459. /***/ }),
  14460. /***/ 898:
  14461. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14462. "use strict";
  14463. Object.defineProperty(exports, '__esModule', { value: true });
  14464. var request = __webpack_require__(753);
  14465. var universalUserAgent = __webpack_require__(796);
  14466. const VERSION = "4.3.1";
  14467. class GraphqlError extends Error {
  14468. constructor(request, response) {
  14469. const message = response.data.errors[0].message;
  14470. super(message);
  14471. Object.assign(this, response.data);
  14472. this.name = "GraphqlError";
  14473. this.request = request; // Maintains proper stack trace (only available on V8)
  14474. /* istanbul ignore next */
  14475. if (Error.captureStackTrace) {
  14476. Error.captureStackTrace(this, this.constructor);
  14477. }
  14478. }
  14479. }
  14480. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14481. function graphql(request, query, options) {
  14482. options = typeof query === "string" ? options = Object.assign({
  14483. query
  14484. }, options) : options = query;
  14485. const requestOptions = Object.keys(options).reduce((result, key) => {
  14486. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14487. result[key] = options[key];
  14488. return result;
  14489. }
  14490. if (!result.variables) {
  14491. result.variables = {};
  14492. }
  14493. result.variables[key] = options[key];
  14494. return result;
  14495. }, {});
  14496. return request(requestOptions).then(response => {
  14497. if (response.data.errors) {
  14498. throw new GraphqlError(requestOptions, {
  14499. data: response.data
  14500. });
  14501. }
  14502. return response.data.data;
  14503. });
  14504. }
  14505. function withDefaults(request$1, newDefaults) {
  14506. const newRequest = request$1.defaults(newDefaults);
  14507. const newApi = (query, options) => {
  14508. return graphql(newRequest, query, options);
  14509. };
  14510. return Object.assign(newApi, {
  14511. defaults: withDefaults.bind(null, newRequest),
  14512. endpoint: request.request.endpoint
  14513. });
  14514. }
  14515. const graphql$1 = withDefaults(request.request, {
  14516. headers: {
  14517. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14518. },
  14519. method: "POST",
  14520. url: "/graphql"
  14521. });
  14522. function withCustomRequest(customRequest) {
  14523. return withDefaults(customRequest, {
  14524. method: "POST",
  14525. url: "/graphql"
  14526. });
  14527. }
  14528. exports.graphql = graphql$1;
  14529. exports.withCustomRequest = withCustomRequest;
  14530. //# sourceMappingURL=index.js.map
  14531. /***/ }),
  14532. /***/ 899:
  14533. /***/ (function(module, __unusedexports, __webpack_require__) {
  14534. module.exports = registerEndpoints;
  14535. const { Deprecation } = __webpack_require__(692);
  14536. function registerEndpoints(octokit, routes) {
  14537. Object.keys(routes).forEach(namespaceName => {
  14538. if (!octokit[namespaceName]) {
  14539. octokit[namespaceName] = {};
  14540. }
  14541. Object.keys(routes[namespaceName]).forEach(apiName => {
  14542. const apiOptions = routes[namespaceName][apiName];
  14543. const endpointDefaults = ["method", "url", "headers"].reduce(
  14544. (map, key) => {
  14545. if (typeof apiOptions[key] !== "undefined") {
  14546. map[key] = apiOptions[key];
  14547. }
  14548. return map;
  14549. },
  14550. {}
  14551. );
  14552. endpointDefaults.request = {
  14553. validate: apiOptions.params
  14554. };
  14555. let request = octokit.request.defaults(endpointDefaults);
  14556. // patch request & endpoint methods to support deprecated parameters.
  14557. // Not the most elegant solution, but we don’t want to move deprecation
  14558. // logic into octokit/endpoint.js as it’s out of scope
  14559. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14560. key => apiOptions.params[key].deprecated
  14561. );
  14562. if (hasDeprecatedParam) {
  14563. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14564. request = patch(
  14565. octokit.request.defaults(endpointDefaults),
  14566. `.${namespaceName}.${apiName}()`
  14567. );
  14568. request.endpoint = patch(
  14569. request.endpoint,
  14570. `.${namespaceName}.${apiName}.endpoint()`
  14571. );
  14572. request.endpoint.merge = patch(
  14573. request.endpoint.merge,
  14574. `.${namespaceName}.${apiName}.endpoint.merge()`
  14575. );
  14576. }
  14577. if (apiOptions.deprecated) {
  14578. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14579. octokit.log.warn(
  14580. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14581. );
  14582. octokit[namespaceName][apiName] = request;
  14583. return request.apply(null, arguments);
  14584. };
  14585. return;
  14586. }
  14587. octokit[namespaceName][apiName] = request;
  14588. });
  14589. });
  14590. }
  14591. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14592. const patchedMethod = options => {
  14593. options = Object.assign({}, options);
  14594. Object.keys(options).forEach(key => {
  14595. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14596. const aliasKey = apiOptions.params[key].alias;
  14597. octokit.log.warn(
  14598. new Deprecation(
  14599. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14600. )
  14601. );
  14602. if (!(aliasKey in options)) {
  14603. options[aliasKey] = options[key];
  14604. }
  14605. delete options[key];
  14606. }
  14607. });
  14608. return method(options);
  14609. };
  14610. Object.keys(method).forEach(key => {
  14611. patchedMethod[key] = method[key];
  14612. });
  14613. return patchedMethod;
  14614. }
  14615. /***/ }),
  14616. /***/ 929:
  14617. /***/ (function(module, __unusedexports, __webpack_require__) {
  14618. module.exports = hasNextPage
  14619. const deprecate = __webpack_require__(370)
  14620. const getPageLinks = __webpack_require__(577)
  14621. function hasNextPage (link) {
  14622. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  14623. return getPageLinks(link).next
  14624. }
  14625. /***/ }),
  14626. /***/ 948:
  14627. /***/ (function(module) {
  14628. "use strict";
  14629. /**
  14630. * Tries to execute a function and discards any error that occurs.
  14631. * @param {Function} fn - Function that might or might not throw an error.
  14632. * @returns {?*} Return-value of the function when no error occurred.
  14633. */
  14634. module.exports = function(fn) {
  14635. try { return fn() } catch (e) {}
  14636. }
  14637. /***/ }),
  14638. /***/ 950:
  14639. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14640. "use strict";
  14641. Object.defineProperty(exports, "__esModule", { value: true });
  14642. const url = __webpack_require__(835);
  14643. function getProxyUrl(reqUrl) {
  14644. let usingSsl = reqUrl.protocol === 'https:';
  14645. let proxyUrl;
  14646. if (checkBypass(reqUrl)) {
  14647. return proxyUrl;
  14648. }
  14649. let proxyVar;
  14650. if (usingSsl) {
  14651. proxyVar = process.env["https_proxy"] ||
  14652. process.env["HTTPS_PROXY"];
  14653. }
  14654. else {
  14655. proxyVar = process.env["http_proxy"] ||
  14656. process.env["HTTP_PROXY"];
  14657. }
  14658. if (proxyVar) {
  14659. proxyUrl = url.parse(proxyVar);
  14660. }
  14661. return proxyUrl;
  14662. }
  14663. exports.getProxyUrl = getProxyUrl;
  14664. function checkBypass(reqUrl) {
  14665. if (!reqUrl.hostname) {
  14666. return false;
  14667. }
  14668. let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
  14669. if (!noProxy) {
  14670. return false;
  14671. }
  14672. // Determine the request port
  14673. let reqPort;
  14674. if (reqUrl.port) {
  14675. reqPort = Number(reqUrl.port);
  14676. }
  14677. else if (reqUrl.protocol === 'http:') {
  14678. reqPort = 80;
  14679. }
  14680. else if (reqUrl.protocol === 'https:') {
  14681. reqPort = 443;
  14682. }
  14683. // Format the request hostname and hostname with port
  14684. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  14685. if (typeof reqPort === 'number') {
  14686. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  14687. }
  14688. // Compare request host against noproxy
  14689. for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
  14690. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  14691. return true;
  14692. }
  14693. }
  14694. return false;
  14695. }
  14696. exports.checkBypass = checkBypass;
  14697. /***/ }),
  14698. /***/ 954:
  14699. /***/ (function(module) {
  14700. module.exports = validateAuth;
  14701. function validateAuth(auth) {
  14702. if (typeof auth === "string") {
  14703. return;
  14704. }
  14705. if (typeof auth === "function") {
  14706. return;
  14707. }
  14708. if (auth.username && auth.password) {
  14709. return;
  14710. }
  14711. if (auth.clientId && auth.clientSecret) {
  14712. return;
  14713. }
  14714. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  14715. }
  14716. /***/ }),
  14717. /***/ 955:
  14718. /***/ (function(module, __unusedexports, __webpack_require__) {
  14719. "use strict";
  14720. const path = __webpack_require__(622);
  14721. const childProcess = __webpack_require__(129);
  14722. const crossSpawn = __webpack_require__(20);
  14723. const stripEof = __webpack_require__(768);
  14724. const npmRunPath = __webpack_require__(621);
  14725. const isStream = __webpack_require__(323);
  14726. const _getStream = __webpack_require__(145);
  14727. const pFinally = __webpack_require__(697);
  14728. const onExit = __webpack_require__(260);
  14729. const errname = __webpack_require__(427);
  14730. const stdio = __webpack_require__(168);
  14731. const TEN_MEGABYTES = 1000 * 1000 * 10;
  14732. function handleArgs(cmd, args, opts) {
  14733. let parsed;
  14734. opts = Object.assign({
  14735. extendEnv: true,
  14736. env: {}
  14737. }, opts);
  14738. if (opts.extendEnv) {
  14739. opts.env = Object.assign({}, process.env, opts.env);
  14740. }
  14741. if (opts.__winShell === true) {
  14742. delete opts.__winShell;
  14743. parsed = {
  14744. command: cmd,
  14745. args,
  14746. options: opts,
  14747. file: cmd,
  14748. original: {
  14749. cmd,
  14750. args
  14751. }
  14752. };
  14753. } else {
  14754. parsed = crossSpawn._parse(cmd, args, opts);
  14755. }
  14756. opts = Object.assign({
  14757. maxBuffer: TEN_MEGABYTES,
  14758. buffer: true,
  14759. stripEof: true,
  14760. preferLocal: true,
  14761. localDir: parsed.options.cwd || process.cwd(),
  14762. encoding: 'utf8',
  14763. reject: true,
  14764. cleanup: true
  14765. }, parsed.options);
  14766. opts.stdio = stdio(opts);
  14767. if (opts.preferLocal) {
  14768. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  14769. }
  14770. if (opts.detached) {
  14771. // #115
  14772. opts.cleanup = false;
  14773. }
  14774. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  14775. // #116
  14776. parsed.args.unshift('/q');
  14777. }
  14778. return {
  14779. cmd: parsed.command,
  14780. args: parsed.args,
  14781. opts,
  14782. parsed
  14783. };
  14784. }
  14785. function handleInput(spawned, input) {
  14786. if (input === null || input === undefined) {
  14787. return;
  14788. }
  14789. if (isStream(input)) {
  14790. input.pipe(spawned.stdin);
  14791. } else {
  14792. spawned.stdin.end(input);
  14793. }
  14794. }
  14795. function handleOutput(opts, val) {
  14796. if (val && opts.stripEof) {
  14797. val = stripEof(val);
  14798. }
  14799. return val;
  14800. }
  14801. function handleShell(fn, cmd, opts) {
  14802. let file = '/bin/sh';
  14803. let args = ['-c', cmd];
  14804. opts = Object.assign({}, opts);
  14805. if (process.platform === 'win32') {
  14806. opts.__winShell = true;
  14807. file = process.env.comspec || 'cmd.exe';
  14808. args = ['/s', '/c', `"${cmd}"`];
  14809. opts.windowsVerbatimArguments = true;
  14810. }
  14811. if (opts.shell) {
  14812. file = opts.shell;
  14813. delete opts.shell;
  14814. }
  14815. return fn(file, args, opts);
  14816. }
  14817. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  14818. if (!process[stream]) {
  14819. return null;
  14820. }
  14821. let ret;
  14822. if (!buffer) {
  14823. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  14824. ret = new Promise((resolve, reject) => {
  14825. process[stream]
  14826. .once('end', resolve)
  14827. .once('error', reject);
  14828. });
  14829. } else if (encoding) {
  14830. ret = _getStream(process[stream], {
  14831. encoding,
  14832. maxBuffer
  14833. });
  14834. } else {
  14835. ret = _getStream.buffer(process[stream], {maxBuffer});
  14836. }
  14837. return ret.catch(err => {
  14838. err.stream = stream;
  14839. err.message = `${stream} ${err.message}`;
  14840. throw err;
  14841. });
  14842. }
  14843. function makeError(result, options) {
  14844. const {stdout, stderr} = result;
  14845. let err = result.error;
  14846. const {code, signal} = result;
  14847. const {parsed, joinedCmd} = options;
  14848. const timedOut = options.timedOut || false;
  14849. if (!err) {
  14850. let output = '';
  14851. if (Array.isArray(parsed.opts.stdio)) {
  14852. if (parsed.opts.stdio[2] !== 'inherit') {
  14853. output += output.length > 0 ? stderr : `\n${stderr}`;
  14854. }
  14855. if (parsed.opts.stdio[1] !== 'inherit') {
  14856. output += `\n${stdout}`;
  14857. }
  14858. } else if (parsed.opts.stdio !== 'inherit') {
  14859. output = `\n${stderr}${stdout}`;
  14860. }
  14861. err = new Error(`Command failed: ${joinedCmd}${output}`);
  14862. err.code = code < 0 ? errname(code) : code;
  14863. }
  14864. err.stdout = stdout;
  14865. err.stderr = stderr;
  14866. err.failed = true;
  14867. err.signal = signal || null;
  14868. err.cmd = joinedCmd;
  14869. err.timedOut = timedOut;
  14870. return err;
  14871. }
  14872. function joinCmd(cmd, args) {
  14873. let joinedCmd = cmd;
  14874. if (Array.isArray(args) && args.length > 0) {
  14875. joinedCmd += ' ' + args.join(' ');
  14876. }
  14877. return joinedCmd;
  14878. }
  14879. module.exports = (cmd, args, opts) => {
  14880. const parsed = handleArgs(cmd, args, opts);
  14881. const {encoding, buffer, maxBuffer} = parsed.opts;
  14882. const joinedCmd = joinCmd(cmd, args);
  14883. let spawned;
  14884. try {
  14885. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  14886. } catch (err) {
  14887. return Promise.reject(err);
  14888. }
  14889. let removeExitHandler;
  14890. if (parsed.opts.cleanup) {
  14891. removeExitHandler = onExit(() => {
  14892. spawned.kill();
  14893. });
  14894. }
  14895. let timeoutId = null;
  14896. let timedOut = false;
  14897. const cleanup = () => {
  14898. if (timeoutId) {
  14899. clearTimeout(timeoutId);
  14900. timeoutId = null;
  14901. }
  14902. if (removeExitHandler) {
  14903. removeExitHandler();
  14904. }
  14905. };
  14906. if (parsed.opts.timeout > 0) {
  14907. timeoutId = setTimeout(() => {
  14908. timeoutId = null;
  14909. timedOut = true;
  14910. spawned.kill(parsed.opts.killSignal);
  14911. }, parsed.opts.timeout);
  14912. }
  14913. const processDone = new Promise(resolve => {
  14914. spawned.on('exit', (code, signal) => {
  14915. cleanup();
  14916. resolve({code, signal});
  14917. });
  14918. spawned.on('error', err => {
  14919. cleanup();
  14920. resolve({error: err});
  14921. });
  14922. if (spawned.stdin) {
  14923. spawned.stdin.on('error', err => {
  14924. cleanup();
  14925. resolve({error: err});
  14926. });
  14927. }
  14928. });
  14929. function destroy() {
  14930. if (spawned.stdout) {
  14931. spawned.stdout.destroy();
  14932. }
  14933. if (spawned.stderr) {
  14934. spawned.stderr.destroy();
  14935. }
  14936. }
  14937. const handlePromise = () => pFinally(Promise.all([
  14938. processDone,
  14939. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  14940. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  14941. ]).then(arr => {
  14942. const result = arr[0];
  14943. result.stdout = arr[1];
  14944. result.stderr = arr[2];
  14945. if (result.error || result.code !== 0 || result.signal !== null) {
  14946. const err = makeError(result, {
  14947. joinedCmd,
  14948. parsed,
  14949. timedOut
  14950. });
  14951. // TODO: missing some timeout logic for killed
  14952. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  14953. // err.killed = spawned.killed || killed;
  14954. err.killed = err.killed || spawned.killed;
  14955. if (!parsed.opts.reject) {
  14956. return err;
  14957. }
  14958. throw err;
  14959. }
  14960. return {
  14961. stdout: handleOutput(parsed.opts, result.stdout),
  14962. stderr: handleOutput(parsed.opts, result.stderr),
  14963. code: 0,
  14964. failed: false,
  14965. killed: false,
  14966. signal: null,
  14967. cmd: joinedCmd,
  14968. timedOut: false
  14969. };
  14970. }), destroy);
  14971. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  14972. handleInput(spawned, parsed.opts.input);
  14973. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  14974. spawned.catch = onrejected => handlePromise().catch(onrejected);
  14975. return spawned;
  14976. };
  14977. // TODO: set `stderr: 'ignore'` when that option is implemented
  14978. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  14979. // TODO: set `stdout: 'ignore'` when that option is implemented
  14980. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  14981. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  14982. module.exports.sync = (cmd, args, opts) => {
  14983. const parsed = handleArgs(cmd, args, opts);
  14984. const joinedCmd = joinCmd(cmd, args);
  14985. if (isStream(parsed.opts.input)) {
  14986. throw new TypeError('The `input` option cannot be a stream in sync mode');
  14987. }
  14988. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  14989. result.code = result.status;
  14990. if (result.error || result.status !== 0 || result.signal !== null) {
  14991. const err = makeError(result, {
  14992. joinedCmd,
  14993. parsed
  14994. });
  14995. if (!parsed.opts.reject) {
  14996. return err;
  14997. }
  14998. throw err;
  14999. }
  15000. return {
  15001. stdout: handleOutput(parsed.opts, result.stdout),
  15002. stderr: handleOutput(parsed.opts, result.stderr),
  15003. code: 0,
  15004. failed: false,
  15005. signal: null,
  15006. cmd: joinedCmd,
  15007. timedOut: false
  15008. };
  15009. };
  15010. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  15011. /***/ }),
  15012. /***/ 966:
  15013. /***/ (function(module, __unusedexports, __webpack_require__) {
  15014. "use strict";
  15015. const {PassThrough} = __webpack_require__(413);
  15016. module.exports = options => {
  15017. options = Object.assign({}, options);
  15018. const {array} = options;
  15019. let {encoding} = options;
  15020. const buffer = encoding === 'buffer';
  15021. let objectMode = false;
  15022. if (array) {
  15023. objectMode = !(encoding || buffer);
  15024. } else {
  15025. encoding = encoding || 'utf8';
  15026. }
  15027. if (buffer) {
  15028. encoding = null;
  15029. }
  15030. let len = 0;
  15031. const ret = [];
  15032. const stream = new PassThrough({objectMode});
  15033. if (encoding) {
  15034. stream.setEncoding(encoding);
  15035. }
  15036. stream.on('data', chunk => {
  15037. ret.push(chunk);
  15038. if (objectMode) {
  15039. len = ret.length;
  15040. } else {
  15041. len += chunk.length;
  15042. }
  15043. });
  15044. stream.getBufferedValue = () => {
  15045. if (array) {
  15046. return ret;
  15047. }
  15048. return buffer ? Buffer.concat(ret, len) : ret.join('');
  15049. };
  15050. stream.getBufferedLength = () => len;
  15051. return stream;
  15052. };
  15053. /***/ }),
  15054. /***/ 969:
  15055. /***/ (function(module, __unusedexports, __webpack_require__) {
  15056. var wrappy = __webpack_require__(11)
  15057. module.exports = wrappy(once)
  15058. module.exports.strict = wrappy(onceStrict)
  15059. once.proto = once(function () {
  15060. Object.defineProperty(Function.prototype, 'once', {
  15061. value: function () {
  15062. return once(this)
  15063. },
  15064. configurable: true
  15065. })
  15066. Object.defineProperty(Function.prototype, 'onceStrict', {
  15067. value: function () {
  15068. return onceStrict(this)
  15069. },
  15070. configurable: true
  15071. })
  15072. })
  15073. function once (fn) {
  15074. var f = function () {
  15075. if (f.called) return f.value
  15076. f.called = true
  15077. return f.value = fn.apply(this, arguments)
  15078. }
  15079. f.called = false
  15080. return f
  15081. }
  15082. function onceStrict (fn) {
  15083. var f = function () {
  15084. if (f.called)
  15085. throw new Error(f.onceError)
  15086. f.called = true
  15087. return f.value = fn.apply(this, arguments)
  15088. }
  15089. var name = fn.name || 'Function wrapped with `once`'
  15090. f.onceError = name + " shouldn't be called more than once"
  15091. f.called = false
  15092. return f
  15093. }
  15094. /***/ }),
  15095. /***/ 986:
  15096. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  15097. "use strict";
  15098. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  15099. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  15100. return new (P || (P = Promise))(function (resolve, reject) {
  15101. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  15102. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  15103. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  15104. step((generator = generator.apply(thisArg, _arguments || [])).next());
  15105. });
  15106. };
  15107. Object.defineProperty(exports, "__esModule", { value: true });
  15108. const tr = __webpack_require__(9);
  15109. /**
  15110. * Exec a command.
  15111. * Output will be streamed to the live console.
  15112. * Returns promise with return code
  15113. *
  15114. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  15115. * @param args optional arguments for tool. Escaping is handled by the lib.
  15116. * @param options optional exec options. See ExecOptions
  15117. * @returns Promise<number> exit code
  15118. */
  15119. function exec(commandLine, args, options) {
  15120. return __awaiter(this, void 0, void 0, function* () {
  15121. const commandArgs = tr.argStringToArray(commandLine);
  15122. if (commandArgs.length === 0) {
  15123. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  15124. }
  15125. // Path to tool to execute should be first arg
  15126. const toolPath = commandArgs[0];
  15127. args = commandArgs.slice(1).concat(args || []);
  15128. const runner = new tr.ToolRunner(toolPath, args, options);
  15129. return runner.exec();
  15130. });
  15131. }
  15132. exports.exec = exec;
  15133. //# sourceMappingURL=exec.js.map
  15134. /***/ }),
  15135. /***/ 991:
  15136. /***/ (function(module, __unusedexports, __webpack_require__) {
  15137. module.exports = authenticationRequestError;
  15138. const { RequestError } = __webpack_require__(463);
  15139. function authenticationRequestError(state, error, options) {
  15140. if (!error.headers) throw error;
  15141. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  15142. // handle "2FA required" error only
  15143. if (error.status !== 401 || !otpRequired) {
  15144. throw error;
  15145. }
  15146. if (
  15147. error.status === 401 &&
  15148. otpRequired &&
  15149. error.request &&
  15150. error.request.headers["x-github-otp"]
  15151. ) {
  15152. if (state.otp) {
  15153. delete state.otp; // no longer valid, request again
  15154. } else {
  15155. throw new RequestError(
  15156. "Invalid one-time password for two-factor authentication",
  15157. 401,
  15158. {
  15159. headers: error.headers,
  15160. request: options
  15161. }
  15162. );
  15163. }
  15164. }
  15165. if (typeof state.auth.on2fa !== "function") {
  15166. throw new RequestError(
  15167. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  15168. 401,
  15169. {
  15170. headers: error.headers,
  15171. request: options
  15172. }
  15173. );
  15174. }
  15175. return Promise.resolve()
  15176. .then(() => {
  15177. return state.auth.on2fa();
  15178. })
  15179. .then(oneTimePassword => {
  15180. const newOptions = Object.assign(options, {
  15181. headers: Object.assign(options.headers, {
  15182. "x-github-otp": oneTimePassword
  15183. })
  15184. });
  15185. return state.octokit.request(newOptions).then(response => {
  15186. // If OTP still valid, then persist it for following requests
  15187. state.otp = oneTimePassword;
  15188. return response;
  15189. });
  15190. });
  15191. }
  15192. /***/ })
  15193. /******/ });