index.js 659 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655665666576658665966606661666266636664666566666667666866696670667166726673667466756676667766786679668066816682668366846685668666876688668966906691669266936694669566966697669866996700670167026703670467056706670767086709671067116712671367146715671667176718671967206721672267236724672567266727672867296730673167326733673467356736673767386739674067416742674367446745674667476748674967506751675267536754675567566757675867596760676167626763676467656766676767686769677067716772677367746775677667776778677967806781678267836784678567866787678867896790679167926793679467956796679767986799680068016802680368046805680668076808680968106811681268136814681568166817681868196820682168226823682468256826682768286829683068316832683368346835683668376838683968406841684268436844684568466847684868496850685168526853685468556856685768586859686068616862686368646865686668676868686968706871687268736874687568766877687868796880688168826883688468856886688768886889689068916892689368946895689668976898689969006901690269036904690569066907690869096910691169126913691469156916691769186919692069216922692369246925692669276928692969306931693269336934693569366937693869396940694169426943694469456946694769486949695069516952695369546955695669576958695969606961696269636964696569666967696869696970697169726973697469756976697769786979698069816982698369846985698669876988698969906991699269936994699569966997699869997000700170027003700470057006700770087009701070117012701370147015701670177018701970207021702270237024702570267027702870297030703170327033703470357036703770387039704070417042704370447045704670477048704970507051705270537054705570567057705870597060706170627063706470657066706770687069707070717072707370747075707670777078707970807081708270837084708570867087708870897090709170927093709470957096709770987099710071017102710371047105710671077108710971107111711271137114711571167117711871197120712171227123712471257126712771287129713071317132713371347135713671377138713971407141714271437144714571467147714871497150715171527153715471557156715771587159716071617162716371647165716671677168716971707171717271737174717571767177717871797180718171827183718471857186718771887189719071917192719371947195719671977198719972007201720272037204720572067207720872097210721172127213721472157216721772187219722072217222722372247225722672277228722972307231723272337234723572367237723872397240724172427243724472457246724772487249725072517252725372547255725672577258725972607261726272637264726572667267726872697270727172727273727472757276727772787279728072817282728372847285728672877288728972907291729272937294729572967297729872997300730173027303730473057306730773087309731073117312731373147315731673177318731973207321732273237324732573267327732873297330733173327333733473357336733773387339734073417342734373447345734673477348734973507351735273537354735573567357735873597360736173627363736473657366736773687369737073717372737373747375737673777378737973807381738273837384738573867387738873897390739173927393739473957396739773987399740074017402740374047405740674077408740974107411741274137414741574167417741874197420742174227423742474257426742774287429743074317432743374347435743674377438743974407441744274437444744574467447744874497450745174527453745474557456745774587459746074617462746374647465746674677468746974707471747274737474747574767477747874797480748174827483748474857486748774887489749074917492749374947495749674977498749975007501750275037504750575067507750875097510751175127513751475157516751775187519752075217522752375247525752675277528752975307531753275337534753575367537753875397540754175427543754475457546754775487549755075517552755375547555755675577558755975607561756275637564756575667567756875697570757175727573757475757576757775787579758075817582758375847585758675877588758975907591759275937594759575967597759875997600760176027603760476057606760776087609761076117612761376147615761676177618761976207621762276237624762576267627762876297630763176327633763476357636763776387639764076417642764376447645764676477648764976507651765276537654765576567657765876597660766176627663766476657666766776687669767076717672767376747675767676777678767976807681768276837684768576867687768876897690769176927693769476957696769776987699770077017702770377047705770677077708770977107711771277137714771577167717771877197720772177227723772477257726772777287729773077317732773377347735773677377738773977407741774277437744774577467747774877497750775177527753775477557756775777587759776077617762776377647765776677677768776977707771777277737774777577767777777877797780778177827783778477857786778777887789779077917792779377947795779677977798779978007801780278037804780578067807780878097810781178127813781478157816781778187819782078217822782378247825782678277828782978307831783278337834783578367837783878397840784178427843784478457846784778487849785078517852785378547855785678577858785978607861786278637864786578667867786878697870787178727873787478757876787778787879788078817882788378847885788678877888788978907891789278937894789578967897789878997900790179027903790479057906790779087909791079117912791379147915791679177918791979207921792279237924792579267927792879297930793179327933793479357936793779387939794079417942794379447945794679477948794979507951795279537954795579567957795879597960796179627963796479657966796779687969797079717972797379747975797679777978797979807981798279837984798579867987798879897990799179927993799479957996799779987999800080018002800380048005800680078008800980108011801280138014801580168017801880198020802180228023802480258026802780288029803080318032803380348035803680378038803980408041804280438044804580468047804880498050805180528053805480558056805780588059806080618062806380648065806680678068806980708071807280738074807580768077807880798080808180828083808480858086808780888089809080918092809380948095809680978098809981008101810281038104810581068107810881098110811181128113811481158116811781188119812081218122812381248125812681278128812981308131813281338134813581368137813881398140814181428143814481458146814781488149815081518152815381548155815681578158815981608161816281638164816581668167816881698170817181728173817481758176817781788179818081818182818381848185818681878188818981908191819281938194819581968197819881998200820182028203820482058206820782088209821082118212821382148215821682178218821982208221822282238224822582268227822882298230823182328233823482358236823782388239824082418242824382448245824682478248824982508251825282538254825582568257825882598260826182628263826482658266826782688269827082718272827382748275827682778278827982808281828282838284828582868287828882898290829182928293829482958296829782988299830083018302830383048305830683078308830983108311831283138314831583168317831883198320832183228323832483258326832783288329833083318332833383348335833683378338833983408341834283438344834583468347834883498350835183528353835483558356835783588359836083618362836383648365836683678368836983708371837283738374837583768377837883798380838183828383838483858386838783888389839083918392839383948395839683978398839984008401840284038404840584068407840884098410841184128413841484158416841784188419842084218422842384248425842684278428842984308431843284338434843584368437843884398440844184428443844484458446844784488449845084518452845384548455845684578458845984608461846284638464846584668467846884698470847184728473847484758476847784788479848084818482848384848485848684878488848984908491849284938494849584968497849884998500850185028503850485058506850785088509851085118512851385148515851685178518851985208521852285238524852585268527852885298530853185328533853485358536853785388539854085418542854385448545854685478548854985508551855285538554855585568557855885598560856185628563856485658566856785688569857085718572857385748575857685778578857985808581858285838584858585868587858885898590859185928593859485958596859785988599860086018602860386048605860686078608860986108611861286138614861586168617861886198620862186228623862486258626862786288629863086318632863386348635863686378638863986408641864286438644864586468647864886498650865186528653865486558656865786588659866086618662866386648665866686678668866986708671867286738674867586768677867886798680868186828683868486858686868786888689869086918692869386948695869686978698869987008701870287038704870587068707870887098710871187128713871487158716871787188719872087218722872387248725872687278728872987308731873287338734873587368737873887398740874187428743874487458746874787488749875087518752875387548755875687578758875987608761876287638764876587668767876887698770877187728773877487758776877787788779878087818782878387848785878687878788878987908791879287938794879587968797879887998800880188028803880488058806880788088809881088118812881388148815881688178818881988208821882288238824882588268827882888298830883188328833883488358836883788388839884088418842884388448845884688478848884988508851885288538854885588568857885888598860886188628863886488658866886788688869887088718872887388748875887688778878887988808881888288838884888588868887888888898890889188928893889488958896889788988899890089018902890389048905890689078908890989108911891289138914891589168917891889198920892189228923892489258926892789288929893089318932893389348935893689378938893989408941894289438944894589468947894889498950895189528953895489558956895789588959896089618962896389648965896689678968896989708971897289738974897589768977897889798980898189828983898489858986898789888989899089918992899389948995899689978998899990009001900290039004900590069007900890099010901190129013901490159016901790189019902090219022902390249025902690279028902990309031903290339034903590369037903890399040904190429043904490459046904790489049905090519052905390549055905690579058905990609061906290639064906590669067906890699070907190729073907490759076907790789079908090819082908390849085908690879088908990909091909290939094909590969097909890999100910191029103910491059106910791089109911091119112911391149115911691179118911991209121912291239124912591269127912891299130913191329133913491359136913791389139914091419142914391449145914691479148914991509151915291539154915591569157915891599160916191629163916491659166916791689169917091719172917391749175917691779178917991809181918291839184918591869187918891899190919191929193919491959196919791989199920092019202920392049205920692079208920992109211921292139214921592169217921892199220922192229223922492259226922792289229923092319232923392349235923692379238923992409241924292439244924592469247924892499250925192529253925492559256925792589259926092619262926392649265926692679268926992709271927292739274927592769277927892799280928192829283928492859286928792889289929092919292929392949295929692979298929993009301930293039304930593069307930893099310931193129313931493159316931793189319932093219322932393249325932693279328932993309331933293339334933593369337933893399340934193429343934493459346934793489349935093519352935393549355935693579358935993609361936293639364936593669367936893699370937193729373937493759376937793789379938093819382938393849385938693879388938993909391939293939394939593969397939893999400940194029403940494059406940794089409941094119412941394149415941694179418941994209421942294239424942594269427942894299430943194329433943494359436943794389439944094419442944394449445944694479448944994509451945294539454945594569457945894599460946194629463946494659466946794689469947094719472947394749475947694779478947994809481948294839484948594869487948894899490949194929493949494959496949794989499950095019502950395049505950695079508950995109511951295139514951595169517951895199520952195229523952495259526952795289529953095319532953395349535953695379538953995409541954295439544954595469547954895499550955195529553955495559556955795589559956095619562956395649565956695679568956995709571957295739574957595769577957895799580958195829583958495859586958795889589959095919592959395949595959695979598959996009601960296039604960596069607960896099610961196129613961496159616961796189619962096219622962396249625962696279628962996309631963296339634963596369637963896399640964196429643964496459646964796489649965096519652965396549655965696579658965996609661966296639664966596669667966896699670967196729673967496759676967796789679968096819682968396849685968696879688968996909691969296939694969596969697969896999700970197029703970497059706970797089709971097119712971397149715971697179718971997209721972297239724972597269727972897299730973197329733973497359736973797389739974097419742974397449745974697479748974997509751975297539754975597569757975897599760976197629763976497659766976797689769977097719772977397749775977697779778977997809781978297839784978597869787978897899790979197929793979497959796979797989799980098019802980398049805980698079808980998109811981298139814981598169817981898199820982198229823982498259826982798289829983098319832983398349835983698379838983998409841984298439844984598469847984898499850985198529853985498559856985798589859986098619862986398649865986698679868986998709871987298739874987598769877987898799880988198829883988498859886988798889889989098919892989398949895989698979898989999009901990299039904990599069907990899099910991199129913991499159916991799189919992099219922992399249925992699279928992999309931993299339934993599369937993899399940994199429943994499459946994799489949995099519952995399549955995699579958995999609961996299639964996599669967996899699970997199729973997499759976997799789979998099819982998399849985998699879988998999909991999299939994999599969997999899991000010001100021000310004100051000610007100081000910010100111001210013100141001510016100171001810019100201002110022100231002410025100261002710028100291003010031100321003310034100351003610037100381003910040100411004210043100441004510046100471004810049100501005110052100531005410055100561005710058100591006010061100621006310064100651006610067100681006910070100711007210073100741007510076100771007810079100801008110082100831008410085100861008710088100891009010091100921009310094100951009610097100981009910100101011010210103101041010510106101071010810109101101011110112101131011410115101161011710118101191012010121101221012310124101251012610127101281012910130101311013210133101341013510136101371013810139101401014110142101431014410145101461014710148101491015010151101521015310154101551015610157101581015910160101611016210163101641016510166101671016810169101701017110172101731017410175101761017710178101791018010181101821018310184101851018610187101881018910190101911019210193101941019510196101971019810199102001020110202102031020410205102061020710208102091021010211102121021310214102151021610217102181021910220102211022210223102241022510226102271022810229102301023110232102331023410235102361023710238102391024010241102421024310244102451024610247102481024910250102511025210253102541025510256102571025810259102601026110262102631026410265102661026710268102691027010271102721027310274102751027610277102781027910280102811028210283102841028510286102871028810289102901029110292102931029410295102961029710298102991030010301103021030310304103051030610307103081030910310103111031210313103141031510316103171031810319103201032110322103231032410325103261032710328103291033010331103321033310334103351033610337103381033910340103411034210343103441034510346103471034810349103501035110352103531035410355103561035710358103591036010361103621036310364103651036610367103681036910370103711037210373103741037510376103771037810379103801038110382103831038410385103861038710388103891039010391103921039310394103951039610397103981039910400104011040210403104041040510406104071040810409104101041110412104131041410415104161041710418104191042010421104221042310424104251042610427104281042910430104311043210433104341043510436104371043810439104401044110442104431044410445104461044710448104491045010451104521045310454104551045610457104581045910460104611046210463104641046510466104671046810469104701047110472104731047410475104761047710478104791048010481104821048310484104851048610487104881048910490104911049210493104941049510496104971049810499105001050110502105031050410505105061050710508105091051010511105121051310514105151051610517105181051910520105211052210523105241052510526105271052810529105301053110532105331053410535105361053710538105391054010541105421054310544105451054610547105481054910550105511055210553105541055510556105571055810559105601056110562105631056410565105661056710568105691057010571105721057310574105751057610577105781057910580105811058210583105841058510586105871058810589105901059110592105931059410595105961059710598105991060010601106021060310604106051060610607106081060910610106111061210613106141061510616106171061810619106201062110622106231062410625106261062710628106291063010631106321063310634106351063610637106381063910640106411064210643106441064510646106471064810649106501065110652106531065410655106561065710658106591066010661106621066310664106651066610667106681066910670106711067210673106741067510676106771067810679106801068110682106831068410685106861068710688106891069010691106921069310694106951069610697106981069910700107011070210703107041070510706107071070810709107101071110712107131071410715107161071710718107191072010721107221072310724107251072610727107281072910730107311073210733107341073510736107371073810739107401074110742107431074410745107461074710748107491075010751107521075310754107551075610757107581075910760107611076210763107641076510766107671076810769107701077110772107731077410775107761077710778107791078010781107821078310784107851078610787107881078910790107911079210793107941079510796107971079810799108001080110802108031080410805108061080710808108091081010811108121081310814108151081610817108181081910820108211082210823108241082510826108271082810829108301083110832108331083410835108361083710838108391084010841108421084310844108451084610847108481084910850108511085210853108541085510856108571085810859108601086110862108631086410865108661086710868108691087010871108721087310874108751087610877108781087910880108811088210883108841088510886108871088810889108901089110892108931089410895108961089710898108991090010901109021090310904109051090610907109081090910910109111091210913109141091510916109171091810919109201092110922109231092410925109261092710928109291093010931109321093310934109351093610937109381093910940109411094210943109441094510946109471094810949109501095110952109531095410955109561095710958109591096010961109621096310964109651096610967109681096910970109711097210973109741097510976109771097810979109801098110982109831098410985109861098710988109891099010991109921099310994109951099610997109981099911000110011100211003110041100511006110071100811009110101101111012110131101411015110161101711018110191102011021110221102311024110251102611027110281102911030110311103211033110341103511036110371103811039110401104111042110431104411045110461104711048110491105011051110521105311054110551105611057110581105911060110611106211063110641106511066110671106811069110701107111072110731107411075110761107711078110791108011081110821108311084110851108611087110881108911090110911109211093110941109511096110971109811099111001110111102111031110411105111061110711108111091111011111111121111311114111151111611117111181111911120111211112211123111241112511126111271112811129111301113111132111331113411135111361113711138111391114011141111421114311144111451114611147111481114911150111511115211153111541115511156111571115811159111601116111162111631116411165111661116711168111691117011171111721117311174111751117611177111781117911180111811118211183111841118511186111871118811189111901119111192111931119411195111961119711198111991120011201112021120311204112051120611207112081120911210112111121211213112141121511216112171121811219112201122111222112231122411225112261122711228112291123011231112321123311234112351123611237112381123911240112411124211243112441124511246112471124811249112501125111252112531125411255112561125711258112591126011261112621126311264112651126611267112681126911270112711127211273112741127511276112771127811279112801128111282112831128411285112861128711288112891129011291112921129311294112951129611297112981129911300113011130211303113041130511306113071130811309113101131111312113131131411315113161131711318113191132011321113221132311324113251132611327113281132911330113311133211333113341133511336113371133811339113401134111342113431134411345113461134711348113491135011351113521135311354113551135611357113581135911360113611136211363113641136511366113671136811369113701137111372113731137411375113761137711378113791138011381113821138311384113851138611387113881138911390113911139211393113941139511396113971139811399114001140111402114031140411405114061140711408114091141011411114121141311414114151141611417114181141911420114211142211423114241142511426114271142811429114301143111432114331143411435114361143711438114391144011441114421144311444114451144611447114481144911450114511145211453114541145511456114571145811459114601146111462114631146411465114661146711468114691147011471114721147311474114751147611477114781147911480114811148211483114841148511486114871148811489114901149111492114931149411495114961149711498114991150011501115021150311504115051150611507115081150911510115111151211513115141151511516115171151811519115201152111522115231152411525115261152711528115291153011531115321153311534115351153611537115381153911540115411154211543115441154511546115471154811549115501155111552115531155411555115561155711558115591156011561115621156311564115651156611567115681156911570115711157211573115741157511576115771157811579115801158111582115831158411585115861158711588115891159011591115921159311594115951159611597115981159911600116011160211603116041160511606116071160811609116101161111612116131161411615116161161711618116191162011621116221162311624116251162611627116281162911630116311163211633116341163511636116371163811639116401164111642116431164411645116461164711648116491165011651116521165311654116551165611657116581165911660116611166211663116641166511666116671166811669116701167111672116731167411675116761167711678116791168011681116821168311684116851168611687116881168911690116911169211693116941169511696116971169811699117001170111702117031170411705117061170711708117091171011711117121171311714117151171611717117181171911720117211172211723117241172511726117271172811729117301173111732117331173411735117361173711738117391174011741117421174311744117451174611747117481174911750117511175211753117541175511756117571175811759117601176111762117631176411765117661176711768117691177011771117721177311774117751177611777117781177911780117811178211783117841178511786117871178811789117901179111792117931179411795117961179711798117991180011801118021180311804118051180611807118081180911810118111181211813118141181511816118171181811819118201182111822118231182411825118261182711828118291183011831118321183311834118351183611837118381183911840118411184211843118441184511846118471184811849118501185111852118531185411855118561185711858118591186011861118621186311864118651186611867118681186911870118711187211873118741187511876118771187811879118801188111882118831188411885118861188711888118891189011891118921189311894118951189611897118981189911900119011190211903119041190511906119071190811909119101191111912119131191411915119161191711918119191192011921119221192311924119251192611927119281192911930119311193211933119341193511936119371193811939119401194111942119431194411945119461194711948119491195011951119521195311954119551195611957119581195911960119611196211963119641196511966119671196811969119701197111972119731197411975119761197711978119791198011981119821198311984119851198611987119881198911990119911199211993119941199511996119971199811999120001200112002120031200412005120061200712008120091201012011120121201312014120151201612017120181201912020120211202212023120241202512026120271202812029120301203112032120331203412035120361203712038120391204012041120421204312044120451204612047120481204912050120511205212053120541205512056120571205812059120601206112062120631206412065120661206712068120691207012071120721207312074120751207612077120781207912080120811208212083120841208512086120871208812089120901209112092120931209412095120961209712098120991210012101121021210312104121051210612107121081210912110121111211212113121141211512116121171211812119121201212112122121231212412125121261212712128121291213012131121321213312134121351213612137121381213912140121411214212143121441214512146121471214812149121501215112152121531215412155121561215712158121591216012161121621216312164121651216612167121681216912170121711217212173121741217512176121771217812179121801218112182121831218412185121861218712188121891219012191121921219312194121951219612197121981219912200122011220212203122041220512206122071220812209122101221112212122131221412215122161221712218122191222012221122221222312224122251222612227122281222912230122311223212233122341223512236122371223812239122401224112242122431224412245122461224712248122491225012251122521225312254122551225612257122581225912260122611226212263122641226512266122671226812269122701227112272122731227412275122761227712278122791228012281122821228312284122851228612287122881228912290122911229212293122941229512296122971229812299123001230112302123031230412305123061230712308123091231012311123121231312314123151231612317123181231912320123211232212323123241232512326123271232812329123301233112332123331233412335123361233712338123391234012341123421234312344123451234612347123481234912350123511235212353123541235512356123571235812359123601236112362123631236412365123661236712368123691237012371123721237312374123751237612377123781237912380123811238212383123841238512386123871238812389123901239112392123931239412395123961239712398123991240012401124021240312404124051240612407124081240912410124111241212413124141241512416124171241812419124201242112422124231242412425124261242712428124291243012431124321243312434124351243612437124381243912440124411244212443124441244512446124471244812449124501245112452124531245412455124561245712458124591246012461124621246312464124651246612467124681246912470124711247212473124741247512476124771247812479124801248112482124831248412485124861248712488124891249012491124921249312494124951249612497124981249912500125011250212503125041250512506125071250812509125101251112512125131251412515125161251712518125191252012521125221252312524125251252612527125281252912530125311253212533125341253512536125371253812539125401254112542125431254412545125461254712548125491255012551125521255312554125551255612557125581255912560125611256212563125641256512566125671256812569125701257112572125731257412575125761257712578125791258012581125821258312584125851258612587125881258912590125911259212593125941259512596125971259812599126001260112602126031260412605126061260712608126091261012611126121261312614126151261612617126181261912620126211262212623126241262512626126271262812629126301263112632126331263412635126361263712638126391264012641126421264312644126451264612647126481264912650126511265212653126541265512656126571265812659126601266112662126631266412665126661266712668126691267012671126721267312674126751267612677126781267912680126811268212683126841268512686126871268812689126901269112692126931269412695126961269712698126991270012701127021270312704127051270612707127081270912710127111271212713127141271512716127171271812719127201272112722127231272412725127261272712728127291273012731127321273312734127351273612737127381273912740127411274212743127441274512746127471274812749127501275112752127531275412755127561275712758127591276012761127621276312764127651276612767127681276912770127711277212773127741277512776127771277812779127801278112782127831278412785127861278712788127891279012791127921279312794127951279612797127981279912800128011280212803128041280512806128071280812809128101281112812128131281412815128161281712818128191282012821128221282312824128251282612827128281282912830128311283212833128341283512836128371283812839128401284112842128431284412845128461284712848128491285012851128521285312854128551285612857128581285912860128611286212863128641286512866128671286812869128701287112872128731287412875128761287712878128791288012881128821288312884128851288612887128881288912890128911289212893128941289512896128971289812899129001290112902129031290412905129061290712908129091291012911129121291312914129151291612917129181291912920129211292212923129241292512926129271292812929129301293112932129331293412935129361293712938129391294012941129421294312944129451294612947129481294912950129511295212953129541295512956129571295812959129601296112962129631296412965129661296712968129691297012971129721297312974129751297612977129781297912980129811298212983129841298512986129871298812989129901299112992129931299412995129961299712998129991300013001130021300313004130051300613007130081300913010130111301213013130141301513016130171301813019130201302113022130231302413025130261302713028130291303013031130321303313034130351303613037130381303913040130411304213043130441304513046130471304813049130501305113052130531305413055130561305713058130591306013061130621306313064130651306613067130681306913070130711307213073130741307513076130771307813079130801308113082130831308413085130861308713088130891309013091130921309313094130951309613097130981309913100131011310213103131041310513106131071310813109131101311113112131131311413115131161311713118131191312013121131221312313124131251312613127131281312913130131311313213133131341313513136131371313813139131401314113142131431314413145131461314713148131491315013151131521315313154131551315613157131581315913160131611316213163131641316513166131671316813169131701317113172131731317413175131761317713178131791318013181131821318313184131851318613187131881318913190131911319213193131941319513196131971319813199132001320113202132031320413205132061320713208132091321013211132121321313214132151321613217132181321913220132211322213223132241322513226132271322813229132301323113232132331323413235132361323713238132391324013241132421324313244132451324613247132481324913250132511325213253132541325513256132571325813259132601326113262132631326413265132661326713268132691327013271132721327313274132751327613277132781327913280132811328213283132841328513286132871328813289132901329113292132931329413295132961329713298132991330013301133021330313304133051330613307133081330913310133111331213313133141331513316133171331813319133201332113322133231332413325133261332713328133291333013331133321333313334133351333613337133381333913340133411334213343133441334513346133471334813349133501335113352133531335413355133561335713358133591336013361133621336313364133651336613367133681336913370133711337213373133741337513376133771337813379133801338113382133831338413385133861338713388133891339013391133921339313394133951339613397133981339913400134011340213403134041340513406134071340813409134101341113412134131341413415134161341713418134191342013421134221342313424134251342613427134281342913430134311343213433134341343513436134371343813439134401344113442134431344413445134461344713448134491345013451134521345313454134551345613457134581345913460134611346213463134641346513466134671346813469134701347113472134731347413475134761347713478134791348013481134821348313484134851348613487134881348913490134911349213493134941349513496134971349813499135001350113502135031350413505135061350713508135091351013511135121351313514135151351613517135181351913520135211352213523135241352513526135271352813529135301353113532135331353413535135361353713538135391354013541135421354313544135451354613547135481354913550135511355213553135541355513556135571355813559135601356113562135631356413565135661356713568135691357013571135721357313574135751357613577135781357913580135811358213583135841358513586135871358813589135901359113592135931359413595135961359713598135991360013601136021360313604136051360613607136081360913610136111361213613136141361513616136171361813619136201362113622136231362413625136261362713628136291363013631136321363313634136351363613637136381363913640136411364213643136441364513646136471364813649136501365113652136531365413655136561365713658136591366013661136621366313664136651366613667136681366913670136711367213673136741367513676136771367813679136801368113682136831368413685136861368713688136891369013691136921369313694136951369613697136981369913700137011370213703137041370513706137071370813709137101371113712137131371413715137161371713718137191372013721137221372313724137251372613727137281372913730137311373213733137341373513736137371373813739137401374113742137431374413745137461374713748137491375013751137521375313754137551375613757137581375913760137611376213763137641376513766137671376813769137701377113772137731377413775137761377713778137791378013781137821378313784137851378613787137881378913790137911379213793137941379513796137971379813799138001380113802138031380413805138061380713808138091381013811138121381313814138151381613817138181381913820138211382213823138241382513826138271382813829138301383113832138331383413835138361383713838138391384013841138421384313844138451384613847138481384913850138511385213853138541385513856138571385813859138601386113862138631386413865138661386713868138691387013871138721387313874138751387613877138781387913880138811388213883138841388513886138871388813889138901389113892138931389413895138961389713898138991390013901139021390313904139051390613907139081390913910139111391213913139141391513916139171391813919139201392113922139231392413925139261392713928139291393013931139321393313934139351393613937139381393913940139411394213943139441394513946139471394813949139501395113952139531395413955139561395713958139591396013961139621396313964139651396613967139681396913970139711397213973139741397513976139771397813979139801398113982139831398413985139861398713988139891399013991139921399313994139951399613997139981399914000140011400214003140041400514006140071400814009140101401114012140131401414015140161401714018140191402014021140221402314024140251402614027140281402914030140311403214033140341403514036140371403814039140401404114042140431404414045140461404714048140491405014051140521405314054140551405614057140581405914060140611406214063140641406514066140671406814069140701407114072140731407414075140761407714078140791408014081140821408314084140851408614087140881408914090140911409214093140941409514096140971409814099141001410114102141031410414105141061410714108141091411014111141121411314114141151411614117141181411914120141211412214123141241412514126141271412814129141301413114132141331413414135141361413714138141391414014141141421414314144141451414614147141481414914150141511415214153141541415514156141571415814159141601416114162141631416414165141661416714168141691417014171141721417314174141751417614177141781417914180141811418214183141841418514186141871418814189141901419114192141931419414195141961419714198141991420014201142021420314204142051420614207142081420914210142111421214213142141421514216142171421814219142201422114222142231422414225142261422714228142291423014231142321423314234142351423614237142381423914240142411424214243142441424514246142471424814249142501425114252142531425414255142561425714258142591426014261142621426314264142651426614267142681426914270142711427214273142741427514276142771427814279142801428114282142831428414285142861428714288142891429014291142921429314294142951429614297142981429914300143011430214303143041430514306143071430814309143101431114312143131431414315143161431714318143191432014321143221432314324143251432614327143281432914330143311433214333143341433514336143371433814339143401434114342143431434414345143461434714348143491435014351143521435314354143551435614357143581435914360143611436214363143641436514366143671436814369143701437114372143731437414375143761437714378143791438014381143821438314384143851438614387143881438914390143911439214393143941439514396143971439814399144001440114402144031440414405144061440714408144091441014411144121441314414144151441614417144181441914420144211442214423144241442514426144271442814429144301443114432144331443414435144361443714438144391444014441144421444314444144451444614447144481444914450144511445214453144541445514456144571445814459144601446114462144631446414465144661446714468144691447014471144721447314474144751447614477144781447914480144811448214483144841448514486144871448814489144901449114492144931449414495144961449714498144991450014501145021450314504145051450614507145081450914510145111451214513145141451514516145171451814519145201452114522145231452414525145261452714528145291453014531145321453314534145351453614537145381453914540145411454214543145441454514546145471454814549145501455114552145531455414555145561455714558145591456014561145621456314564145651456614567145681456914570145711457214573145741457514576145771457814579145801458114582145831458414585145861458714588145891459014591145921459314594145951459614597145981459914600146011460214603146041460514606146071460814609146101461114612146131461414615146161461714618146191462014621146221462314624146251462614627146281462914630146311463214633146341463514636146371463814639146401464114642146431464414645146461464714648146491465014651146521465314654146551465614657146581465914660146611466214663146641466514666146671466814669146701467114672146731467414675146761467714678146791468014681146821468314684146851468614687146881468914690146911469214693146941469514696146971469814699147001470114702147031470414705147061470714708147091471014711147121471314714147151471614717147181471914720147211472214723147241472514726147271472814729147301473114732147331473414735147361473714738147391474014741147421474314744147451474614747147481474914750147511475214753147541475514756147571475814759147601476114762147631476414765147661476714768147691477014771147721477314774147751477614777147781477914780147811478214783147841478514786147871478814789147901479114792147931479414795147961479714798147991480014801148021480314804148051480614807148081480914810148111481214813148141481514816148171481814819148201482114822148231482414825148261482714828148291483014831148321483314834148351483614837148381483914840148411484214843148441484514846148471484814849148501485114852148531485414855148561485714858148591486014861148621486314864148651486614867148681486914870148711487214873148741487514876148771487814879148801488114882148831488414885148861488714888148891489014891148921489314894148951489614897148981489914900149011490214903149041490514906149071490814909149101491114912149131491414915149161491714918149191492014921149221492314924149251492614927149281492914930149311493214933149341493514936149371493814939149401494114942149431494414945149461494714948149491495014951149521495314954149551495614957149581495914960149611496214963149641496514966149671496814969149701497114972149731497414975149761497714978149791498014981149821498314984149851498614987149881498914990149911499214993149941499514996149971499814999150001500115002150031500415005150061500715008150091501015011150121501315014150151501615017150181501915020150211502215023150241502515026150271502815029150301503115032150331503415035150361503715038150391504015041150421504315044150451504615047150481504915050150511505215053150541505515056150571505815059150601506115062150631506415065150661506715068150691507015071150721507315074150751507615077150781507915080150811508215083150841508515086150871508815089150901509115092150931509415095150961509715098150991510015101151021510315104151051510615107151081510915110151111511215113151141511515116151171511815119151201512115122151231512415125151261512715128151291513015131151321513315134151351513615137151381513915140151411514215143151441514515146151471514815149151501515115152151531515415155151561515715158151591516015161151621516315164151651516615167151681516915170151711517215173151741517515176151771517815179151801518115182151831518415185151861518715188151891519015191151921519315194151951519615197151981519915200152011520215203152041520515206152071520815209152101521115212152131521415215152161521715218152191522015221152221522315224152251522615227152281522915230152311523215233152341523515236152371523815239152401524115242152431524415245152461524715248152491525015251152521525315254152551525615257152581525915260152611526215263152641526515266152671526815269152701527115272152731527415275152761527715278152791528015281152821528315284152851528615287152881528915290152911529215293152941529515296152971529815299153001530115302153031530415305153061530715308153091531015311153121531315314153151531615317153181531915320153211532215323153241532515326153271532815329153301533115332153331533415335153361533715338153391534015341153421534315344153451534615347153481534915350153511535215353153541535515356153571535815359153601536115362153631536415365153661536715368153691537015371153721537315374153751537615377153781537915380153811538215383153841538515386153871538815389153901539115392153931539415395153961539715398153991540015401154021540315404154051540615407154081540915410154111541215413154141541515416154171541815419154201542115422154231542415425154261542715428154291543015431154321543315434154351543615437154381543915440154411544215443154441544515446154471544815449154501545115452154531545415455154561545715458154591546015461154621546315464154651546615467154681546915470154711547215473154741547515476154771547815479154801548115482154831548415485154861548715488154891549015491154921549315494154951549615497154981549915500155011550215503155041550515506155071550815509155101551115512155131551415515155161551715518155191552015521155221552315524155251552615527155281552915530155311553215533155341553515536155371553815539155401554115542155431554415545155461554715548155491555015551155521555315554155551555615557155581555915560155611556215563155641556515566155671556815569155701557115572155731557415575155761557715578155791558015581155821558315584155851558615587155881558915590155911559215593155941559515596155971559815599156001560115602156031560415605156061560715608156091561015611156121561315614156151561615617156181561915620156211562215623156241562515626156271562815629156301563115632156331563415635156361563715638156391564015641156421564315644156451564615647156481564915650156511565215653156541565515656156571565815659156601566115662156631566415665156661566715668156691567015671156721567315674156751567615677156781567915680156811568215683156841568515686156871568815689156901569115692156931569415695156961569715698156991570015701157021570315704157051570615707157081570915710157111571215713157141571515716157171571815719157201572115722157231572415725157261572715728157291573015731157321573315734157351573615737157381573915740157411574215743157441574515746157471574815749157501575115752157531575415755157561575715758157591576015761157621576315764157651576615767157681576915770157711577215773157741577515776157771577815779157801578115782157831578415785157861578715788157891579015791157921579315794157951579615797157981579915800158011580215803158041580515806158071580815809158101581115812158131581415815158161581715818158191582015821158221582315824158251582615827158281582915830158311583215833158341583515836158371583815839158401584115842158431584415845158461584715848158491585015851158521585315854158551585615857158581585915860158611586215863158641586515866158671586815869158701587115872158731587415875158761587715878158791588015881158821588315884158851588615887158881588915890158911589215893158941589515896158971589815899159001590115902159031590415905159061590715908159091591015911159121591315914159151591615917159181591915920159211592215923159241592515926159271592815929159301593115932159331593415935159361593715938159391594015941159421594315944159451594615947159481594915950159511595215953159541595515956159571595815959159601596115962159631596415965159661596715968159691597015971159721597315974159751597615977159781597915980159811598215983159841598515986159871598815989159901599115992159931599415995159961599715998159991600016001160021600316004160051600616007160081600916010160111601216013160141601516016160171601816019160201602116022160231602416025160261602716028160291603016031160321603316034160351603616037160381603916040160411604216043160441604516046160471604816049160501605116052160531605416055160561605716058160591606016061160621606316064160651606616067160681606916070160711607216073160741607516076160771607816079160801608116082160831608416085160861608716088160891609016091160921609316094160951609616097160981609916100161011610216103161041610516106161071610816109161101611116112161131611416115161161611716118161191612016121161221612316124161251612616127161281612916130161311613216133161341613516136161371613816139161401614116142161431614416145161461614716148161491615016151161521615316154161551615616157161581615916160161611616216163161641616516166161671616816169161701617116172161731617416175161761617716178161791618016181161821618316184161851618616187161881618916190161911619216193161941619516196161971619816199162001620116202162031620416205162061620716208162091621016211162121621316214162151621616217162181621916220162211622216223162241622516226162271622816229162301623116232162331623416235162361623716238162391624016241162421624316244162451624616247162481624916250162511625216253162541625516256162571625816259162601626116262162631626416265162661626716268162691627016271162721627316274162751627616277162781627916280162811628216283162841628516286162871628816289162901629116292162931629416295162961629716298162991630016301163021630316304163051630616307163081630916310163111631216313163141631516316163171631816319163201632116322163231632416325163261632716328163291633016331163321633316334163351633616337163381633916340163411634216343163441634516346163471634816349163501635116352163531635416355163561635716358163591636016361163621636316364163651636616367163681636916370163711637216373163741637516376163771637816379163801638116382163831638416385163861638716388163891639016391163921639316394163951639616397163981639916400164011640216403164041640516406164071640816409164101641116412164131641416415164161641716418164191642016421164221642316424164251642616427164281642916430164311643216433164341643516436164371643816439164401644116442164431644416445164461644716448164491645016451164521645316454164551645616457164581645916460164611646216463164641646516466164671646816469164701647116472164731647416475164761647716478164791648016481164821648316484164851648616487164881648916490164911649216493164941649516496164971649816499165001650116502165031650416505165061650716508165091651016511165121651316514165151651616517165181651916520165211652216523165241652516526165271652816529165301653116532165331653416535165361653716538165391654016541165421654316544165451654616547165481654916550165511655216553165541655516556165571655816559165601656116562165631656416565165661656716568165691657016571165721657316574165751657616577165781657916580165811658216583165841658516586165871658816589165901659116592165931659416595165961659716598165991660016601166021660316604166051660616607166081660916610166111661216613166141661516616166171661816619166201662116622166231662416625166261662716628166291663016631166321663316634166351663616637166381663916640166411664216643166441664516646166471664816649166501665116652166531665416655166561665716658166591666016661166621666316664166651666616667166681666916670166711667216673166741667516676166771667816679166801668116682166831668416685166861668716688166891669016691166921669316694166951669616697166981669916700167011670216703167041670516706167071670816709167101671116712167131671416715167161671716718167191672016721167221672316724167251672616727167281672916730167311673216733167341673516736167371673816739167401674116742167431674416745167461674716748167491675016751167521675316754167551675616757167581675916760167611676216763167641676516766167671676816769167701677116772167731677416775167761677716778167791678016781167821678316784167851678616787167881678916790167911679216793167941679516796167971679816799168001680116802168031680416805168061680716808168091681016811168121681316814168151681616817168181681916820168211682216823168241682516826168271682816829168301683116832168331683416835168361683716838168391684016841168421684316844168451684616847168481684916850168511685216853168541685516856168571685816859168601686116862168631686416865168661686716868168691687016871168721687316874168751687616877168781687916880168811688216883168841688516886168871688816889168901689116892168931689416895168961689716898168991690016901169021690316904169051690616907169081690916910169111691216913169141691516916169171691816919169201692116922169231692416925169261692716928169291693016931169321693316934169351693616937169381693916940169411694216943169441694516946169471694816949169501695116952169531695416955169561695716958169591696016961169621696316964169651696616967169681696916970169711697216973169741697516976169771697816979169801698116982169831698416985169861698716988169891699016991169921699316994169951699616997169981699917000170011700217003170041700517006170071700817009170101701117012170131701417015170161701717018170191702017021170221702317024170251702617027170281702917030170311703217033170341703517036170371703817039170401704117042170431704417045170461704717048170491705017051170521705317054170551705617057170581705917060170611706217063170641706517066170671706817069170701707117072170731707417075170761707717078170791708017081170821708317084170851708617087170881708917090170911709217093170941709517096170971709817099171001710117102171031710417105171061710717108171091711017111171121711317114171151711617117171181711917120171211712217123171241712517126171271712817129171301713117132171331713417135171361713717138171391714017141171421714317144171451714617147171481714917150171511715217153171541715517156171571715817159171601716117162171631716417165171661716717168171691717017171171721717317174171751717617177171781717917180171811718217183171841718517186171871718817189171901719117192171931719417195171961719717198171991720017201172021720317204172051720617207172081720917210172111721217213172141721517216172171721817219172201722117222172231722417225172261722717228172291723017231172321723317234172351723617237172381723917240172411724217243172441724517246172471724817249172501725117252172531725417255172561725717258172591726017261172621726317264172651726617267172681726917270172711727217273172741727517276172771727817279172801728117282172831728417285172861728717288172891729017291172921729317294172951729617297172981729917300173011730217303173041730517306173071730817309173101731117312
  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. Object.defineProperty(exports, "__esModule", { value: true });
  4425. const core = __importStar(__webpack_require__(470));
  4426. const fs = __importStar(__webpack_require__(747));
  4427. const path = __importStar(__webpack_require__(622));
  4428. const IS_WINDOWS = process.platform === 'win32';
  4429. const HOSTNAME = 'github.com';
  4430. const EXTRA_HEADER_KEY = `http.https://${HOSTNAME}/.extraheader`;
  4431. function createAuthHelper(git, settings) {
  4432. return new GitAuthHelper(git, settings);
  4433. }
  4434. exports.createAuthHelper = createAuthHelper;
  4435. class GitAuthHelper {
  4436. constructor(gitCommandManager, gitSourceSettings) {
  4437. this.git = gitCommandManager;
  4438. this.settings = gitSourceSettings || {};
  4439. }
  4440. configureAuth() {
  4441. return __awaiter(this, void 0, void 0, function* () {
  4442. // Remove possible previous values
  4443. yield this.removeAuth();
  4444. // Configure new values
  4445. yield this.configureToken();
  4446. });
  4447. }
  4448. removeAuth() {
  4449. return __awaiter(this, void 0, void 0, function* () {
  4450. yield this.removeToken();
  4451. });
  4452. }
  4453. configureToken() {
  4454. return __awaiter(this, void 0, void 0, function* () {
  4455. // Configure a placeholder value. This approach avoids the credential being captured
  4456. // by process creation audit events, which are commonly logged. For more information,
  4457. // refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
  4458. const placeholder = `AUTHORIZATION: basic ***`;
  4459. yield this.git.config(EXTRA_HEADER_KEY, placeholder);
  4460. // Determine the basic credential value
  4461. const basicCredential = Buffer.from(`x-access-token:${this.settings.authToken}`, 'utf8').toString('base64');
  4462. core.setSecret(basicCredential);
  4463. // Replace the value in the config file
  4464. const configPath = path.join(this.git.getWorkingDirectory(), '.git', 'config');
  4465. let content = (yield fs.promises.readFile(configPath)).toString();
  4466. const placeholderIndex = content.indexOf(placeholder);
  4467. if (placeholderIndex < 0 ||
  4468. placeholderIndex != content.lastIndexOf(placeholder)) {
  4469. throw new Error('Unable to replace auth placeholder in .git/config');
  4470. }
  4471. content = content.replace(placeholder, `AUTHORIZATION: basic ${basicCredential}`);
  4472. yield fs.promises.writeFile(configPath, content);
  4473. });
  4474. }
  4475. removeToken() {
  4476. return __awaiter(this, void 0, void 0, function* () {
  4477. // HTTP extra header
  4478. yield this.removeGitConfig(EXTRA_HEADER_KEY);
  4479. });
  4480. }
  4481. removeGitConfig(configKey) {
  4482. return __awaiter(this, void 0, void 0, function* () {
  4483. if ((yield this.git.configExists(configKey)) &&
  4484. !(yield this.git.tryConfigUnset(configKey))) {
  4485. // Load the config contents
  4486. core.warning(`Failed to remove '${configKey}' from the git config`);
  4487. }
  4488. });
  4489. }
  4490. }
  4491. /***/ }),
  4492. /***/ 289:
  4493. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4494. "use strict";
  4495. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4496. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4497. return new (P || (P = Promise))(function (resolve, reject) {
  4498. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4499. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4500. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4501. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4502. });
  4503. };
  4504. var __importStar = (this && this.__importStar) || function (mod) {
  4505. if (mod && mod.__esModule) return mod;
  4506. var result = {};
  4507. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4508. result["default"] = mod;
  4509. return result;
  4510. };
  4511. Object.defineProperty(exports, "__esModule", { value: true });
  4512. const core = __importStar(__webpack_require__(470));
  4513. const exec = __importStar(__webpack_require__(986));
  4514. const fshelper = __importStar(__webpack_require__(618));
  4515. const io = __importStar(__webpack_require__(1));
  4516. const path = __importStar(__webpack_require__(622));
  4517. const retryHelper = __importStar(__webpack_require__(587));
  4518. const git_version_1 = __webpack_require__(559);
  4519. // Auth header not supported before 2.9
  4520. // Wire protocol v2 not supported before 2.18
  4521. exports.MinimumGitVersion = new git_version_1.GitVersion('2.18');
  4522. function createCommandManager(workingDirectory, lfs) {
  4523. return __awaiter(this, void 0, void 0, function* () {
  4524. return yield GitCommandManager.createCommandManager(workingDirectory, lfs);
  4525. });
  4526. }
  4527. exports.createCommandManager = createCommandManager;
  4528. class GitCommandManager {
  4529. // Private constructor; use createCommandManager()
  4530. constructor() {
  4531. this.gitEnv = {
  4532. GIT_TERMINAL_PROMPT: '0',
  4533. GCM_INTERACTIVE: 'Never' // Disable prompting for git credential manager
  4534. };
  4535. this.gitPath = '';
  4536. this.lfs = false;
  4537. this.workingDirectory = '';
  4538. }
  4539. branchDelete(remote, branch) {
  4540. return __awaiter(this, void 0, void 0, function* () {
  4541. const args = ['branch', '--delete', '--force'];
  4542. if (remote) {
  4543. args.push('--remote');
  4544. }
  4545. args.push(branch);
  4546. yield this.execGit(args);
  4547. });
  4548. }
  4549. branchExists(remote, pattern) {
  4550. return __awaiter(this, void 0, void 0, function* () {
  4551. const args = ['branch', '--list'];
  4552. if (remote) {
  4553. args.push('--remote');
  4554. }
  4555. args.push(pattern);
  4556. const output = yield this.execGit(args);
  4557. return !!output.stdout.trim();
  4558. });
  4559. }
  4560. branchList(remote) {
  4561. return __awaiter(this, void 0, void 0, function* () {
  4562. const result = [];
  4563. // Note, this implementation uses "rev-parse --symbolic-full-name" because the output from
  4564. // "branch --list" is more difficult when in a detached HEAD state.
  4565. // Note, this implementation uses "rev-parse --symbolic-full-name" because there is a bug
  4566. // in Git 2.18 that causes "rev-parse --symbolic" to output symbolic full names.
  4567. const args = ['rev-parse', '--symbolic-full-name'];
  4568. if (remote) {
  4569. args.push('--remotes=origin');
  4570. }
  4571. else {
  4572. args.push('--branches');
  4573. }
  4574. const output = yield this.execGit(args);
  4575. for (let branch of output.stdout.trim().split('\n')) {
  4576. branch = branch.trim();
  4577. if (branch) {
  4578. if (branch.startsWith('refs/heads/')) {
  4579. branch = branch.substr('refs/heads/'.length);
  4580. }
  4581. else if (branch.startsWith('refs/remotes/')) {
  4582. branch = branch.substr('refs/remotes/'.length);
  4583. }
  4584. result.push(branch);
  4585. }
  4586. }
  4587. return result;
  4588. });
  4589. }
  4590. checkout(ref, startPoint) {
  4591. return __awaiter(this, void 0, void 0, function* () {
  4592. const args = ['checkout', '--progress', '--force'];
  4593. if (startPoint) {
  4594. args.push('-B', ref, startPoint);
  4595. }
  4596. else {
  4597. args.push(ref);
  4598. }
  4599. yield this.execGit(args);
  4600. });
  4601. }
  4602. checkoutDetach() {
  4603. return __awaiter(this, void 0, void 0, function* () {
  4604. const args = ['checkout', '--detach'];
  4605. yield this.execGit(args);
  4606. });
  4607. }
  4608. config(configKey, configValue) {
  4609. return __awaiter(this, void 0, void 0, function* () {
  4610. yield this.execGit(['config', '--local', configKey, configValue]);
  4611. });
  4612. }
  4613. configExists(configKey) {
  4614. return __awaiter(this, void 0, void 0, function* () {
  4615. const pattern = configKey.replace(/[^a-zA-Z0-9_]/g, x => {
  4616. return `\\${x}`;
  4617. });
  4618. const output = yield this.execGit(['config', '--local', '--name-only', '--get-regexp', pattern], true);
  4619. return output.exitCode === 0;
  4620. });
  4621. }
  4622. fetch(fetchDepth, refSpec) {
  4623. return __awaiter(this, void 0, void 0, function* () {
  4624. const args = [
  4625. '-c',
  4626. 'protocol.version=2',
  4627. 'fetch',
  4628. '--no-tags',
  4629. '--prune',
  4630. '--progress',
  4631. '--no-recurse-submodules'
  4632. ];
  4633. if (fetchDepth > 0) {
  4634. args.push(`--depth=${fetchDepth}`);
  4635. }
  4636. else if (fshelper.fileExistsSync(path.join(this.workingDirectory, '.git', 'shallow'))) {
  4637. args.push('--unshallow');
  4638. }
  4639. args.push('origin');
  4640. for (const arg of refSpec) {
  4641. args.push(arg);
  4642. }
  4643. const that = this;
  4644. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4645. yield that.execGit(args);
  4646. }));
  4647. });
  4648. }
  4649. getWorkingDirectory() {
  4650. return this.workingDirectory;
  4651. }
  4652. init() {
  4653. return __awaiter(this, void 0, void 0, function* () {
  4654. yield this.execGit(['init', this.workingDirectory]);
  4655. });
  4656. }
  4657. isDetached() {
  4658. return __awaiter(this, void 0, void 0, function* () {
  4659. // Note, "branch --show-current" would be simpler but isn't available until Git 2.22
  4660. const output = yield this.execGit(['rev-parse', '--symbolic-full-name', '--verify', '--quiet', 'HEAD'], true);
  4661. return !output.stdout.trim().startsWith('refs/heads/');
  4662. });
  4663. }
  4664. lfsFetch(ref) {
  4665. return __awaiter(this, void 0, void 0, function* () {
  4666. const args = ['lfs', 'fetch', 'origin', ref];
  4667. const that = this;
  4668. yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  4669. yield that.execGit(args);
  4670. }));
  4671. });
  4672. }
  4673. lfsInstall() {
  4674. return __awaiter(this, void 0, void 0, function* () {
  4675. yield this.execGit(['lfs', 'install', '--local']);
  4676. });
  4677. }
  4678. log1() {
  4679. return __awaiter(this, void 0, void 0, function* () {
  4680. yield this.execGit(['log', '-1']);
  4681. });
  4682. }
  4683. remoteAdd(remoteName, remoteUrl) {
  4684. return __awaiter(this, void 0, void 0, function* () {
  4685. yield this.execGit(['remote', 'add', remoteName, remoteUrl]);
  4686. });
  4687. }
  4688. setEnvironmentVariable(name, value) {
  4689. this.gitEnv[name] = value;
  4690. }
  4691. tagExists(pattern) {
  4692. return __awaiter(this, void 0, void 0, function* () {
  4693. const output = yield this.execGit(['tag', '--list', pattern]);
  4694. return !!output.stdout.trim();
  4695. });
  4696. }
  4697. tryClean() {
  4698. return __awaiter(this, void 0, void 0, function* () {
  4699. const output = yield this.execGit(['clean', '-ffdx'], true);
  4700. return output.exitCode === 0;
  4701. });
  4702. }
  4703. tryConfigUnset(configKey) {
  4704. return __awaiter(this, void 0, void 0, function* () {
  4705. const output = yield this.execGit(['config', '--local', '--unset-all', configKey], true);
  4706. return output.exitCode === 0;
  4707. });
  4708. }
  4709. tryDisableAutomaticGarbageCollection() {
  4710. return __awaiter(this, void 0, void 0, function* () {
  4711. const output = yield this.execGit(['config', '--local', 'gc.auto', '0'], true);
  4712. return output.exitCode === 0;
  4713. });
  4714. }
  4715. tryGetFetchUrl() {
  4716. return __awaiter(this, void 0, void 0, function* () {
  4717. const output = yield this.execGit(['config', '--local', '--get', 'remote.origin.url'], true);
  4718. if (output.exitCode !== 0) {
  4719. return '';
  4720. }
  4721. const stdout = output.stdout.trim();
  4722. if (stdout.includes('\n')) {
  4723. return '';
  4724. }
  4725. return stdout;
  4726. });
  4727. }
  4728. tryReset() {
  4729. return __awaiter(this, void 0, void 0, function* () {
  4730. const output = yield this.execGit(['reset', '--hard', 'HEAD'], true);
  4731. return output.exitCode === 0;
  4732. });
  4733. }
  4734. static createCommandManager(workingDirectory, lfs) {
  4735. return __awaiter(this, void 0, void 0, function* () {
  4736. const result = new GitCommandManager();
  4737. yield result.initializeCommandManager(workingDirectory, lfs);
  4738. return result;
  4739. });
  4740. }
  4741. execGit(args, allowAllExitCodes = false) {
  4742. return __awaiter(this, void 0, void 0, function* () {
  4743. fshelper.directoryExistsSync(this.workingDirectory, true);
  4744. const result = new GitOutput();
  4745. const env = {};
  4746. for (const key of Object.keys(process.env)) {
  4747. env[key] = process.env[key];
  4748. }
  4749. for (const key of Object.keys(this.gitEnv)) {
  4750. env[key] = this.gitEnv[key];
  4751. }
  4752. const stdout = [];
  4753. const options = {
  4754. cwd: this.workingDirectory,
  4755. env,
  4756. ignoreReturnCode: allowAllExitCodes,
  4757. listeners: {
  4758. stdout: (data) => {
  4759. stdout.push(data.toString());
  4760. }
  4761. }
  4762. };
  4763. result.exitCode = yield exec.exec(`"${this.gitPath}"`, args, options);
  4764. result.stdout = stdout.join('');
  4765. return result;
  4766. });
  4767. }
  4768. initializeCommandManager(workingDirectory, lfs) {
  4769. return __awaiter(this, void 0, void 0, function* () {
  4770. this.workingDirectory = workingDirectory;
  4771. // Git-lfs will try to pull down assets if any of the local/user/system setting exist.
  4772. // If the user didn't enable `LFS` in their pipeline definition, disable LFS fetch/checkout.
  4773. this.lfs = lfs;
  4774. if (!this.lfs) {
  4775. this.gitEnv['GIT_LFS_SKIP_SMUDGE'] = '1';
  4776. }
  4777. this.gitPath = yield io.which('git', true);
  4778. // Git version
  4779. core.debug('Getting git version');
  4780. let gitVersion = new git_version_1.GitVersion();
  4781. let gitOutput = yield this.execGit(['version']);
  4782. let stdout = gitOutput.stdout.trim();
  4783. if (!stdout.includes('\n')) {
  4784. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4785. if (match) {
  4786. gitVersion = new git_version_1.GitVersion(match[0]);
  4787. }
  4788. }
  4789. if (!gitVersion.isValid()) {
  4790. throw new Error('Unable to determine git version');
  4791. }
  4792. // Minimum git version
  4793. if (!gitVersion.checkMinimum(exports.MinimumGitVersion)) {
  4794. throw new Error(`Minimum required git version is ${exports.MinimumGitVersion}. Your git ('${this.gitPath}') is ${gitVersion}`);
  4795. }
  4796. if (this.lfs) {
  4797. // Git-lfs version
  4798. core.debug('Getting git-lfs version');
  4799. let gitLfsVersion = new git_version_1.GitVersion();
  4800. const gitLfsPath = yield io.which('git-lfs', true);
  4801. gitOutput = yield this.execGit(['lfs', 'version']);
  4802. stdout = gitOutput.stdout.trim();
  4803. if (!stdout.includes('\n')) {
  4804. const match = stdout.match(/\d+\.\d+(\.\d+)?/);
  4805. if (match) {
  4806. gitLfsVersion = new git_version_1.GitVersion(match[0]);
  4807. }
  4808. }
  4809. if (!gitLfsVersion.isValid()) {
  4810. throw new Error('Unable to determine git-lfs version');
  4811. }
  4812. // Minimum git-lfs version
  4813. // Note:
  4814. // - Auth header not supported before 2.1
  4815. const minimumGitLfsVersion = new git_version_1.GitVersion('2.1');
  4816. if (!gitLfsVersion.checkMinimum(minimumGitLfsVersion)) {
  4817. throw new Error(`Minimum required git-lfs version is ${minimumGitLfsVersion}. Your git-lfs ('${gitLfsPath}') is ${gitLfsVersion}`);
  4818. }
  4819. }
  4820. // Set the user agent
  4821. const gitHttpUserAgent = `git/${gitVersion} (github-actions-checkout)`;
  4822. core.debug(`Set git useragent to: ${gitHttpUserAgent}`);
  4823. this.gitEnv['GIT_HTTP_USER_AGENT'] = gitHttpUserAgent;
  4824. });
  4825. }
  4826. }
  4827. class GitOutput {
  4828. constructor() {
  4829. this.stdout = '';
  4830. this.exitCode = 0;
  4831. }
  4832. }
  4833. /***/ }),
  4834. /***/ 293:
  4835. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  4836. "use strict";
  4837. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  4838. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  4839. return new (P || (P = Promise))(function (resolve, reject) {
  4840. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  4841. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  4842. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  4843. step((generator = generator.apply(thisArg, _arguments || [])).next());
  4844. });
  4845. };
  4846. var __importStar = (this && this.__importStar) || function (mod) {
  4847. if (mod && mod.__esModule) return mod;
  4848. var result = {};
  4849. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  4850. result["default"] = mod;
  4851. return result;
  4852. };
  4853. Object.defineProperty(exports, "__esModule", { value: true });
  4854. const core = __importStar(__webpack_require__(470));
  4855. const fsHelper = __importStar(__webpack_require__(618));
  4856. const gitAuthHelper = __importStar(__webpack_require__(287));
  4857. const gitCommandManager = __importStar(__webpack_require__(289));
  4858. const gitDirectoryHelper = __importStar(__webpack_require__(438));
  4859. const githubApiHelper = __importStar(__webpack_require__(464));
  4860. const io = __importStar(__webpack_require__(1));
  4861. const path = __importStar(__webpack_require__(622));
  4862. const refHelper = __importStar(__webpack_require__(227));
  4863. const stateHelper = __importStar(__webpack_require__(153));
  4864. const hostname = 'github.com';
  4865. function getSource(settings) {
  4866. return __awaiter(this, void 0, void 0, function* () {
  4867. // Repository URL
  4868. core.info(`Syncing repository: ${settings.repositoryOwner}/${settings.repositoryName}`);
  4869. const repositoryUrl = `https://${hostname}/${encodeURIComponent(settings.repositoryOwner)}/${encodeURIComponent(settings.repositoryName)}`;
  4870. // Remove conflicting file path
  4871. if (fsHelper.fileExistsSync(settings.repositoryPath)) {
  4872. yield io.rmRF(settings.repositoryPath);
  4873. }
  4874. // Create directory
  4875. let isExisting = true;
  4876. if (!fsHelper.directoryExistsSync(settings.repositoryPath)) {
  4877. isExisting = false;
  4878. yield io.mkdirP(settings.repositoryPath);
  4879. }
  4880. // Git command manager
  4881. const git = yield getGitCommandManager(settings);
  4882. // Prepare existing directory, otherwise recreate
  4883. if (isExisting) {
  4884. yield gitDirectoryHelper.prepareExistingDirectory(git, settings.repositoryPath, repositoryUrl, settings.clean);
  4885. }
  4886. if (!git) {
  4887. // Downloading using REST API
  4888. core.info(`The repository will be downloaded using the GitHub REST API`);
  4889. core.info(`To create a local Git repository instead, add Git ${gitCommandManager.MinimumGitVersion} or higher to the PATH`);
  4890. yield githubApiHelper.downloadRepository(settings.authToken, settings.repositoryOwner, settings.repositoryName, settings.ref, settings.commit, settings.repositoryPath);
  4891. }
  4892. else {
  4893. // Save state for POST action
  4894. stateHelper.setRepositoryPath(settings.repositoryPath);
  4895. // Initialize the repository
  4896. if (!fsHelper.directoryExistsSync(path.join(settings.repositoryPath, '.git'))) {
  4897. yield git.init();
  4898. yield git.remoteAdd('origin', repositoryUrl);
  4899. }
  4900. // Disable automatic garbage collection
  4901. if (!(yield git.tryDisableAutomaticGarbageCollection())) {
  4902. core.warning(`Unable to turn off git automatic garbage collection. The git fetch operation may trigger garbage collection and cause a delay.`);
  4903. }
  4904. const authHelper = gitAuthHelper.createAuthHelper(git, settings);
  4905. try {
  4906. // Configure auth
  4907. yield authHelper.configureAuth();
  4908. // LFS install
  4909. if (settings.lfs) {
  4910. yield git.lfsInstall();
  4911. }
  4912. // Fetch
  4913. const refSpec = refHelper.getRefSpec(settings.ref, settings.commit);
  4914. yield git.fetch(settings.fetchDepth, refSpec);
  4915. // Checkout info
  4916. const checkoutInfo = yield refHelper.getCheckoutInfo(git, settings.ref, settings.commit);
  4917. // LFS fetch
  4918. // Explicit lfs-fetch to avoid slow checkout (fetches one lfs object at a time).
  4919. // Explicit lfs fetch will fetch lfs objects in parallel.
  4920. if (settings.lfs) {
  4921. yield git.lfsFetch(checkoutInfo.startPoint || checkoutInfo.ref);
  4922. }
  4923. // Checkout
  4924. yield git.checkout(checkoutInfo.ref, checkoutInfo.startPoint);
  4925. // Dump some info about the checked out commit
  4926. yield git.log1();
  4927. }
  4928. finally {
  4929. // Remove auth
  4930. if (!settings.persistCredentials) {
  4931. yield authHelper.removeAuth();
  4932. }
  4933. }
  4934. }
  4935. });
  4936. }
  4937. exports.getSource = getSource;
  4938. function cleanup(repositoryPath) {
  4939. return __awaiter(this, void 0, void 0, function* () {
  4940. // Repo exists?
  4941. if (!repositoryPath ||
  4942. !fsHelper.fileExistsSync(path.join(repositoryPath, '.git', 'config'))) {
  4943. return;
  4944. }
  4945. let git;
  4946. try {
  4947. git = yield gitCommandManager.createCommandManager(repositoryPath, false);
  4948. }
  4949. catch (_a) {
  4950. return;
  4951. }
  4952. // Remove auth
  4953. const authHelper = gitAuthHelper.createAuthHelper(git);
  4954. yield authHelper.removeAuth();
  4955. });
  4956. }
  4957. exports.cleanup = cleanup;
  4958. function getGitCommandManager(settings) {
  4959. return __awaiter(this, void 0, void 0, function* () {
  4960. core.info(`Working directory is '${settings.repositoryPath}'`);
  4961. try {
  4962. return yield gitCommandManager.createCommandManager(settings.repositoryPath, settings.lfs);
  4963. }
  4964. catch (err) {
  4965. // Git is required for LFS
  4966. if (settings.lfs) {
  4967. throw err;
  4968. }
  4969. // Otherwise fallback to REST API
  4970. return undefined;
  4971. }
  4972. });
  4973. }
  4974. /***/ }),
  4975. /***/ 294:
  4976. /***/ (function(module, __unusedexports, __webpack_require__) {
  4977. module.exports = parseOptions;
  4978. const { Deprecation } = __webpack_require__(692);
  4979. const { getUserAgent } = __webpack_require__(796);
  4980. const once = __webpack_require__(969);
  4981. const pkg = __webpack_require__(215);
  4982. const deprecateOptionsTimeout = once((log, deprecation) =>
  4983. log.warn(deprecation)
  4984. );
  4985. const deprecateOptionsAgent = once((log, deprecation) => log.warn(deprecation));
  4986. const deprecateOptionsHeaders = once((log, deprecation) =>
  4987. log.warn(deprecation)
  4988. );
  4989. function parseOptions(options, log, hook) {
  4990. if (options.headers) {
  4991. options.headers = Object.keys(options.headers).reduce((newObj, key) => {
  4992. newObj[key.toLowerCase()] = options.headers[key];
  4993. return newObj;
  4994. }, {});
  4995. }
  4996. const clientDefaults = {
  4997. headers: options.headers || {},
  4998. request: options.request || {},
  4999. mediaType: {
  5000. previews: [],
  5001. format: ""
  5002. }
  5003. };
  5004. if (options.baseUrl) {
  5005. clientDefaults.baseUrl = options.baseUrl;
  5006. }
  5007. if (options.userAgent) {
  5008. clientDefaults.headers["user-agent"] = options.userAgent;
  5009. }
  5010. if (options.previews) {
  5011. clientDefaults.mediaType.previews = options.previews;
  5012. }
  5013. if (options.timeZone) {
  5014. clientDefaults.headers["time-zone"] = options.timeZone;
  5015. }
  5016. if (options.timeout) {
  5017. deprecateOptionsTimeout(
  5018. log,
  5019. new Deprecation(
  5020. "[@octokit/rest] new Octokit({timeout}) is deprecated. Use {request: {timeout}} instead. See https://github.com/octokit/request.js#request"
  5021. )
  5022. );
  5023. clientDefaults.request.timeout = options.timeout;
  5024. }
  5025. if (options.agent) {
  5026. deprecateOptionsAgent(
  5027. log,
  5028. new Deprecation(
  5029. "[@octokit/rest] new Octokit({agent}) is deprecated. Use {request: {agent}} instead. See https://github.com/octokit/request.js#request"
  5030. )
  5031. );
  5032. clientDefaults.request.agent = options.agent;
  5033. }
  5034. if (options.headers) {
  5035. deprecateOptionsHeaders(
  5036. log,
  5037. new Deprecation(
  5038. "[@octokit/rest] new Octokit({headers}) is deprecated. Use {userAgent, previews} instead. See https://github.com/octokit/request.js#request"
  5039. )
  5040. );
  5041. }
  5042. const userAgentOption = clientDefaults.headers["user-agent"];
  5043. const defaultUserAgent = `octokit.js/${pkg.version} ${getUserAgent()}`;
  5044. clientDefaults.headers["user-agent"] = [userAgentOption, defaultUserAgent]
  5045. .filter(Boolean)
  5046. .join(" ");
  5047. clientDefaults.request.hook = hook.bind(null, "request");
  5048. return clientDefaults;
  5049. }
  5050. /***/ }),
  5051. /***/ 297:
  5052. /***/ (function(module) {
  5053. module.exports = class HttpError extends Error {
  5054. constructor (message, code, headers) {
  5055. super(message)
  5056. // Maintains proper stack trace (only available on V8)
  5057. /* istanbul ignore next */
  5058. if (Error.captureStackTrace) {
  5059. Error.captureStackTrace(this, this.constructor)
  5060. }
  5061. this.name = 'HttpError'
  5062. this.code = code
  5063. this.headers = headers
  5064. }
  5065. }
  5066. /***/ }),
  5067. /***/ 301:
  5068. /***/ (function(module, __unusedexports, __webpack_require__) {
  5069. /**
  5070. * Some “list” response that can be paginated have a different response structure
  5071. *
  5072. * They have a `total_count` key in the response (search also has `incomplete_results`,
  5073. * /installation/repositories also has `repository_selection`), as well as a key with
  5074. * the list of the items which name varies from endpoint to endpoint:
  5075. *
  5076. * - https://developer.github.com/v3/search/#example (key `items`)
  5077. * - https://developer.github.com/v3/checks/runs/#response-3 (key: `check_runs`)
  5078. * - https://developer.github.com/v3/checks/suites/#response-1 (key: `check_suites`)
  5079. * - https://developer.github.com/v3/apps/installations/#list-repositories (key: `repositories`)
  5080. * - https://developer.github.com/v3/apps/installations/#list-installations-for-a-user (key `installations`)
  5081. * - https://developer.github.com/v3/orgs/#list-installations-for-an-organization (key `installations`)
  5082. *
  5083. * Octokit normalizes these responses so that paginated results are always returned following
  5084. * the same structure. One challenge is that if the list response has only one page, no Link
  5085. * header is provided, so this header alone is not sufficient to check wether a response is
  5086. * paginated or not. For the exceptions with the namespace, a fallback check for the route
  5087. * paths has to be added in order to normalize the response. We cannot check for the total_count
  5088. * property because it also exists in the response of Get the combined status for a specific ref.
  5089. */
  5090. module.exports = normalizePaginatedListResponse;
  5091. const { Deprecation } = __webpack_require__(692);
  5092. const once = __webpack_require__(969);
  5093. const deprecateIncompleteResults = once((log, deprecation) =>
  5094. log.warn(deprecation)
  5095. );
  5096. const deprecateTotalCount = once((log, deprecation) => log.warn(deprecation));
  5097. const deprecateNamespace = once((log, deprecation) => log.warn(deprecation));
  5098. const REGEX_IS_SEARCH_PATH = /^\/search\//;
  5099. const REGEX_IS_CHECKS_PATH = /^\/repos\/[^/]+\/[^/]+\/commits\/[^/]+\/(check-runs|check-suites)/;
  5100. const REGEX_IS_INSTALLATION_REPOSITORIES_PATH = /^\/installation\/repositories/;
  5101. const REGEX_IS_USER_INSTALLATIONS_PATH = /^\/user\/installations/;
  5102. const REGEX_IS_ORG_INSTALLATIONS_PATH = /^\/orgs\/[^/]+\/installations/;
  5103. function normalizePaginatedListResponse(octokit, url, response) {
  5104. const path = url.replace(octokit.request.endpoint.DEFAULTS.baseUrl, "");
  5105. if (
  5106. !REGEX_IS_SEARCH_PATH.test(path) &&
  5107. !REGEX_IS_CHECKS_PATH.test(path) &&
  5108. !REGEX_IS_INSTALLATION_REPOSITORIES_PATH.test(path) &&
  5109. !REGEX_IS_USER_INSTALLATIONS_PATH.test(path) &&
  5110. !REGEX_IS_ORG_INSTALLATIONS_PATH.test(path)
  5111. ) {
  5112. return;
  5113. }
  5114. // keep the additional properties intact to avoid a breaking change,
  5115. // but log a deprecation warning when accessed
  5116. const incompleteResults = response.data.incomplete_results;
  5117. const repositorySelection = response.data.repository_selection;
  5118. const totalCount = response.data.total_count;
  5119. delete response.data.incomplete_results;
  5120. delete response.data.repository_selection;
  5121. delete response.data.total_count;
  5122. const namespaceKey = Object.keys(response.data)[0];
  5123. response.data = response.data[namespaceKey];
  5124. Object.defineProperty(response.data, namespaceKey, {
  5125. get() {
  5126. deprecateNamespace(
  5127. octokit.log,
  5128. new Deprecation(
  5129. `[@octokit/rest] "result.data.${namespaceKey}" is deprecated. Use "result.data" instead`
  5130. )
  5131. );
  5132. return response.data;
  5133. }
  5134. });
  5135. if (typeof incompleteResults !== "undefined") {
  5136. Object.defineProperty(response.data, "incomplete_results", {
  5137. get() {
  5138. deprecateIncompleteResults(
  5139. octokit.log,
  5140. new Deprecation(
  5141. '[@octokit/rest] "result.data.incomplete_results" is deprecated.'
  5142. )
  5143. );
  5144. return incompleteResults;
  5145. }
  5146. });
  5147. }
  5148. if (typeof repositorySelection !== "undefined") {
  5149. Object.defineProperty(response.data, "repository_selection", {
  5150. get() {
  5151. deprecateTotalCount(
  5152. octokit.log,
  5153. new Deprecation(
  5154. '[@octokit/rest] "result.data.repository_selection" is deprecated.'
  5155. )
  5156. );
  5157. return repositorySelection;
  5158. }
  5159. });
  5160. }
  5161. Object.defineProperty(response.data, "total_count", {
  5162. get() {
  5163. deprecateTotalCount(
  5164. octokit.log,
  5165. new Deprecation(
  5166. '[@octokit/rest] "result.data.total_count" is deprecated.'
  5167. )
  5168. );
  5169. return totalCount;
  5170. }
  5171. });
  5172. }
  5173. /***/ }),
  5174. /***/ 323:
  5175. /***/ (function(module) {
  5176. "use strict";
  5177. var isStream = module.exports = function (stream) {
  5178. return stream !== null && typeof stream === 'object' && typeof stream.pipe === 'function';
  5179. };
  5180. isStream.writable = function (stream) {
  5181. return isStream(stream) && stream.writable !== false && typeof stream._write === 'function' && typeof stream._writableState === 'object';
  5182. };
  5183. isStream.readable = function (stream) {
  5184. return isStream(stream) && stream.readable !== false && typeof stream._read === 'function' && typeof stream._readableState === 'object';
  5185. };
  5186. isStream.duplex = function (stream) {
  5187. return isStream.writable(stream) && isStream.readable(stream);
  5188. };
  5189. isStream.transform = function (stream) {
  5190. return isStream.duplex(stream) && typeof stream._transform === 'function' && typeof stream._transformState === 'object';
  5191. };
  5192. /***/ }),
  5193. /***/ 335:
  5194. /***/ (function(module, __unusedexports, __webpack_require__) {
  5195. module.exports = __webpack_require__(179);
  5196. /***/ }),
  5197. /***/ 336:
  5198. /***/ (function(module, __unusedexports, __webpack_require__) {
  5199. module.exports = hasLastPage
  5200. const deprecate = __webpack_require__(370)
  5201. const getPageLinks = __webpack_require__(577)
  5202. function hasLastPage (link) {
  5203. deprecate(`octokit.hasLastPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  5204. return getPageLinks(link).last
  5205. }
  5206. /***/ }),
  5207. /***/ 348:
  5208. /***/ (function(module, __unusedexports, __webpack_require__) {
  5209. "use strict";
  5210. module.exports = validate;
  5211. const { RequestError } = __webpack_require__(463);
  5212. const get = __webpack_require__(854);
  5213. const set = __webpack_require__(883);
  5214. function validate(octokit, options) {
  5215. if (!options.request.validate) {
  5216. return;
  5217. }
  5218. const { validate: params } = options.request;
  5219. Object.keys(params).forEach(parameterName => {
  5220. const parameter = get(params, parameterName);
  5221. const expectedType = parameter.type;
  5222. let parentParameterName;
  5223. let parentValue;
  5224. let parentParamIsPresent = true;
  5225. let parentParameterIsArray = false;
  5226. if (/\./.test(parameterName)) {
  5227. parentParameterName = parameterName.replace(/\.[^.]+$/, "");
  5228. parentParameterIsArray = parentParameterName.slice(-2) === "[]";
  5229. if (parentParameterIsArray) {
  5230. parentParameterName = parentParameterName.slice(0, -2);
  5231. }
  5232. parentValue = get(options, parentParameterName);
  5233. parentParamIsPresent =
  5234. parentParameterName === "headers" ||
  5235. (typeof parentValue === "object" && parentValue !== null);
  5236. }
  5237. const values = parentParameterIsArray
  5238. ? (get(options, parentParameterName) || []).map(
  5239. value => value[parameterName.split(/\./).pop()]
  5240. )
  5241. : [get(options, parameterName)];
  5242. values.forEach((value, i) => {
  5243. const valueIsPresent = typeof value !== "undefined";
  5244. const valueIsNull = value === null;
  5245. const currentParameterName = parentParameterIsArray
  5246. ? parameterName.replace(/\[\]/, `[${i}]`)
  5247. : parameterName;
  5248. if (!parameter.required && !valueIsPresent) {
  5249. return;
  5250. }
  5251. // if the parent parameter is of type object but allows null
  5252. // then the child parameters can be ignored
  5253. if (!parentParamIsPresent) {
  5254. return;
  5255. }
  5256. if (parameter.allowNull && valueIsNull) {
  5257. return;
  5258. }
  5259. if (!parameter.allowNull && valueIsNull) {
  5260. throw new RequestError(
  5261. `'${currentParameterName}' cannot be null`,
  5262. 400,
  5263. {
  5264. request: options
  5265. }
  5266. );
  5267. }
  5268. if (parameter.required && !valueIsPresent) {
  5269. throw new RequestError(
  5270. `Empty value for parameter '${currentParameterName}': ${JSON.stringify(
  5271. value
  5272. )}`,
  5273. 400,
  5274. {
  5275. request: options
  5276. }
  5277. );
  5278. }
  5279. // parse to integer before checking for enum
  5280. // so that string "1" will match enum with number 1
  5281. if (expectedType === "integer") {
  5282. const unparsedValue = value;
  5283. value = parseInt(value, 10);
  5284. if (isNaN(value)) {
  5285. throw new RequestError(
  5286. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5287. unparsedValue
  5288. )} is NaN`,
  5289. 400,
  5290. {
  5291. request: options
  5292. }
  5293. );
  5294. }
  5295. }
  5296. if (parameter.enum && parameter.enum.indexOf(String(value)) === -1) {
  5297. throw new RequestError(
  5298. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5299. value
  5300. )}`,
  5301. 400,
  5302. {
  5303. request: options
  5304. }
  5305. );
  5306. }
  5307. if (parameter.validation) {
  5308. const regex = new RegExp(parameter.validation);
  5309. if (!regex.test(value)) {
  5310. throw new RequestError(
  5311. `Invalid value for parameter '${currentParameterName}': ${JSON.stringify(
  5312. value
  5313. )}`,
  5314. 400,
  5315. {
  5316. request: options
  5317. }
  5318. );
  5319. }
  5320. }
  5321. if (expectedType === "object" && typeof value === "string") {
  5322. try {
  5323. value = JSON.parse(value);
  5324. } catch (exception) {
  5325. throw new RequestError(
  5326. `JSON parse error of value for parameter '${currentParameterName}': ${JSON.stringify(
  5327. value
  5328. )}`,
  5329. 400,
  5330. {
  5331. request: options
  5332. }
  5333. );
  5334. }
  5335. }
  5336. set(options, parameter.mapTo || currentParameterName, value);
  5337. });
  5338. });
  5339. return options;
  5340. }
  5341. /***/ }),
  5342. /***/ 349:
  5343. /***/ (function(module, __unusedexports, __webpack_require__) {
  5344. module.exports = authenticationRequestError;
  5345. const { RequestError } = __webpack_require__(463);
  5346. function authenticationRequestError(state, error, options) {
  5347. /* istanbul ignore next */
  5348. if (!error.headers) throw error;
  5349. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  5350. // handle "2FA required" error only
  5351. if (error.status !== 401 || !otpRequired) {
  5352. throw error;
  5353. }
  5354. if (
  5355. error.status === 401 &&
  5356. otpRequired &&
  5357. error.request &&
  5358. error.request.headers["x-github-otp"]
  5359. ) {
  5360. throw new RequestError(
  5361. "Invalid one-time password for two-factor authentication",
  5362. 401,
  5363. {
  5364. headers: error.headers,
  5365. request: options
  5366. }
  5367. );
  5368. }
  5369. if (typeof state.auth.on2fa !== "function") {
  5370. throw new RequestError(
  5371. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  5372. 401,
  5373. {
  5374. headers: error.headers,
  5375. request: options
  5376. }
  5377. );
  5378. }
  5379. return Promise.resolve()
  5380. .then(() => {
  5381. return state.auth.on2fa();
  5382. })
  5383. .then(oneTimePassword => {
  5384. const newOptions = Object.assign(options, {
  5385. headers: Object.assign(
  5386. { "x-github-otp": oneTimePassword },
  5387. options.headers
  5388. )
  5389. });
  5390. return state.octokit.request(newOptions);
  5391. });
  5392. }
  5393. /***/ }),
  5394. /***/ 357:
  5395. /***/ (function(module) {
  5396. module.exports = require("assert");
  5397. /***/ }),
  5398. /***/ 363:
  5399. /***/ (function(module) {
  5400. module.exports = register
  5401. function register (state, name, method, options) {
  5402. if (typeof method !== 'function') {
  5403. throw new Error('method for before hook must be a function')
  5404. }
  5405. if (!options) {
  5406. options = {}
  5407. }
  5408. if (Array.isArray(name)) {
  5409. return name.reverse().reduce(function (callback, name) {
  5410. return register.bind(null, state, name, callback, options)
  5411. }, method)()
  5412. }
  5413. return Promise.resolve()
  5414. .then(function () {
  5415. if (!state.registry[name]) {
  5416. return method(options)
  5417. }
  5418. return (state.registry[name]).reduce(function (method, registered) {
  5419. return registered.hook.bind(null, method, options)
  5420. }, method)()
  5421. })
  5422. }
  5423. /***/ }),
  5424. /***/ 368:
  5425. /***/ (function(module) {
  5426. module.exports = function atob(str) {
  5427. return Buffer.from(str, 'base64').toString('binary')
  5428. }
  5429. /***/ }),
  5430. /***/ 370:
  5431. /***/ (function(module) {
  5432. module.exports = deprecate
  5433. const loggedMessages = {}
  5434. function deprecate (message) {
  5435. if (loggedMessages[message]) {
  5436. return
  5437. }
  5438. console.warn(`DEPRECATED (@octokit/rest): ${message}`)
  5439. loggedMessages[message] = 1
  5440. }
  5441. /***/ }),
  5442. /***/ 372:
  5443. /***/ (function(module) {
  5444. module.exports = octokitDebug;
  5445. function octokitDebug(octokit) {
  5446. octokit.hook.wrap("request", (request, options) => {
  5447. octokit.log.debug("request", options);
  5448. const start = Date.now();
  5449. const requestOptions = octokit.request.endpoint.parse(options);
  5450. const path = requestOptions.url.replace(options.baseUrl, "");
  5451. return request(options)
  5452. .then(response => {
  5453. octokit.log.info(
  5454. `${requestOptions.method} ${path} - ${
  5455. response.status
  5456. } in ${Date.now() - start}ms`
  5457. );
  5458. return response;
  5459. })
  5460. .catch(error => {
  5461. octokit.log.info(
  5462. `${requestOptions.method} ${path} - ${error.status} in ${Date.now() -
  5463. start}ms`
  5464. );
  5465. throw error;
  5466. });
  5467. });
  5468. }
  5469. /***/ }),
  5470. /***/ 385:
  5471. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5472. "use strict";
  5473. Object.defineProperty(exports, '__esModule', { value: true });
  5474. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  5475. var isPlainObject = _interopDefault(__webpack_require__(696));
  5476. var universalUserAgent = __webpack_require__(796);
  5477. function lowercaseKeys(object) {
  5478. if (!object) {
  5479. return {};
  5480. }
  5481. return Object.keys(object).reduce((newObj, key) => {
  5482. newObj[key.toLowerCase()] = object[key];
  5483. return newObj;
  5484. }, {});
  5485. }
  5486. function mergeDeep(defaults, options) {
  5487. const result = Object.assign({}, defaults);
  5488. Object.keys(options).forEach(key => {
  5489. if (isPlainObject(options[key])) {
  5490. if (!(key in defaults)) Object.assign(result, {
  5491. [key]: options[key]
  5492. });else result[key] = mergeDeep(defaults[key], options[key]);
  5493. } else {
  5494. Object.assign(result, {
  5495. [key]: options[key]
  5496. });
  5497. }
  5498. });
  5499. return result;
  5500. }
  5501. function merge(defaults, route, options) {
  5502. if (typeof route === "string") {
  5503. let [method, url] = route.split(" ");
  5504. options = Object.assign(url ? {
  5505. method,
  5506. url
  5507. } : {
  5508. url: method
  5509. }, options);
  5510. } else {
  5511. options = Object.assign({}, route);
  5512. } // lowercase header names before merging with defaults to avoid duplicates
  5513. options.headers = lowercaseKeys(options.headers);
  5514. const mergedOptions = mergeDeep(defaults || {}, options); // mediaType.previews arrays are merged, instead of overwritten
  5515. if (defaults && defaults.mediaType.previews.length) {
  5516. mergedOptions.mediaType.previews = defaults.mediaType.previews.filter(preview => !mergedOptions.mediaType.previews.includes(preview)).concat(mergedOptions.mediaType.previews);
  5517. }
  5518. mergedOptions.mediaType.previews = mergedOptions.mediaType.previews.map(preview => preview.replace(/-preview/, ""));
  5519. return mergedOptions;
  5520. }
  5521. function addQueryParameters(url, parameters) {
  5522. const separator = /\?/.test(url) ? "&" : "?";
  5523. const names = Object.keys(parameters);
  5524. if (names.length === 0) {
  5525. return url;
  5526. }
  5527. return url + separator + names.map(name => {
  5528. if (name === "q") {
  5529. return "q=" + parameters.q.split("+").map(encodeURIComponent).join("+");
  5530. }
  5531. return `${name}=${encodeURIComponent(parameters[name])}`;
  5532. }).join("&");
  5533. }
  5534. const urlVariableRegex = /\{[^}]+\}/g;
  5535. function removeNonChars(variableName) {
  5536. return variableName.replace(/^\W+|\W+$/g, "").split(/,/);
  5537. }
  5538. function extractUrlVariableNames(url) {
  5539. const matches = url.match(urlVariableRegex);
  5540. if (!matches) {
  5541. return [];
  5542. }
  5543. return matches.map(removeNonChars).reduce((a, b) => a.concat(b), []);
  5544. }
  5545. function omit(object, keysToOmit) {
  5546. return Object.keys(object).filter(option => !keysToOmit.includes(option)).reduce((obj, key) => {
  5547. obj[key] = object[key];
  5548. return obj;
  5549. }, {});
  5550. }
  5551. // Based on https://github.com/bramstein/url-template, licensed under BSD
  5552. // TODO: create separate package.
  5553. //
  5554. // Copyright (c) 2012-2014, Bram Stein
  5555. // All rights reserved.
  5556. // Redistribution and use in source and binary forms, with or without
  5557. // modification, are permitted provided that the following conditions
  5558. // are met:
  5559. // 1. Redistributions of source code must retain the above copyright
  5560. // notice, this list of conditions and the following disclaimer.
  5561. // 2. Redistributions in binary form must reproduce the above copyright
  5562. // notice, this list of conditions and the following disclaimer in the
  5563. // documentation and/or other materials provided with the distribution.
  5564. // 3. The name of the author may not be used to endorse or promote products
  5565. // derived from this software without specific prior written permission.
  5566. // THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
  5567. // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  5568. // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
  5569. // EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
  5570. // INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
  5571. // BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  5572. // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
  5573. // OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
  5574. // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  5575. // EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  5576. /* istanbul ignore file */
  5577. function encodeReserved(str) {
  5578. return str.split(/(%[0-9A-Fa-f]{2})/g).map(function (part) {
  5579. if (!/%[0-9A-Fa-f]/.test(part)) {
  5580. part = encodeURI(part).replace(/%5B/g, "[").replace(/%5D/g, "]");
  5581. }
  5582. return part;
  5583. }).join("");
  5584. }
  5585. function encodeUnreserved(str) {
  5586. return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
  5587. return "%" + c.charCodeAt(0).toString(16).toUpperCase();
  5588. });
  5589. }
  5590. function encodeValue(operator, value, key) {
  5591. value = operator === "+" || operator === "#" ? encodeReserved(value) : encodeUnreserved(value);
  5592. if (key) {
  5593. return encodeUnreserved(key) + "=" + value;
  5594. } else {
  5595. return value;
  5596. }
  5597. }
  5598. function isDefined(value) {
  5599. return value !== undefined && value !== null;
  5600. }
  5601. function isKeyOperator(operator) {
  5602. return operator === ";" || operator === "&" || operator === "?";
  5603. }
  5604. function getValues(context, operator, key, modifier) {
  5605. var value = context[key],
  5606. result = [];
  5607. if (isDefined(value) && value !== "") {
  5608. if (typeof value === "string" || typeof value === "number" || typeof value === "boolean") {
  5609. value = value.toString();
  5610. if (modifier && modifier !== "*") {
  5611. value = value.substring(0, parseInt(modifier, 10));
  5612. }
  5613. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5614. } else {
  5615. if (modifier === "*") {
  5616. if (Array.isArray(value)) {
  5617. value.filter(isDefined).forEach(function (value) {
  5618. result.push(encodeValue(operator, value, isKeyOperator(operator) ? key : ""));
  5619. });
  5620. } else {
  5621. Object.keys(value).forEach(function (k) {
  5622. if (isDefined(value[k])) {
  5623. result.push(encodeValue(operator, value[k], k));
  5624. }
  5625. });
  5626. }
  5627. } else {
  5628. const tmp = [];
  5629. if (Array.isArray(value)) {
  5630. value.filter(isDefined).forEach(function (value) {
  5631. tmp.push(encodeValue(operator, value));
  5632. });
  5633. } else {
  5634. Object.keys(value).forEach(function (k) {
  5635. if (isDefined(value[k])) {
  5636. tmp.push(encodeUnreserved(k));
  5637. tmp.push(encodeValue(operator, value[k].toString()));
  5638. }
  5639. });
  5640. }
  5641. if (isKeyOperator(operator)) {
  5642. result.push(encodeUnreserved(key) + "=" + tmp.join(","));
  5643. } else if (tmp.length !== 0) {
  5644. result.push(tmp.join(","));
  5645. }
  5646. }
  5647. }
  5648. } else {
  5649. if (operator === ";") {
  5650. if (isDefined(value)) {
  5651. result.push(encodeUnreserved(key));
  5652. }
  5653. } else if (value === "" && (operator === "&" || operator === "?")) {
  5654. result.push(encodeUnreserved(key) + "=");
  5655. } else if (value === "") {
  5656. result.push("");
  5657. }
  5658. }
  5659. return result;
  5660. }
  5661. function parseUrl(template) {
  5662. return {
  5663. expand: expand.bind(null, template)
  5664. };
  5665. }
  5666. function expand(template, context) {
  5667. var operators = ["+", "#", ".", "/", ";", "?", "&"];
  5668. return template.replace(/\{([^\{\}]+)\}|([^\{\}]+)/g, function (_, expression, literal) {
  5669. if (expression) {
  5670. let operator = "";
  5671. const values = [];
  5672. if (operators.indexOf(expression.charAt(0)) !== -1) {
  5673. operator = expression.charAt(0);
  5674. expression = expression.substr(1);
  5675. }
  5676. expression.split(/,/g).forEach(function (variable) {
  5677. var tmp = /([^:\*]*)(?::(\d+)|(\*))?/.exec(variable);
  5678. values.push(getValues(context, operator, tmp[1], tmp[2] || tmp[3]));
  5679. });
  5680. if (operator && operator !== "+") {
  5681. var separator = ",";
  5682. if (operator === "?") {
  5683. separator = "&";
  5684. } else if (operator !== "#") {
  5685. separator = operator;
  5686. }
  5687. return (values.length !== 0 ? operator : "") + values.join(separator);
  5688. } else {
  5689. return values.join(",");
  5690. }
  5691. } else {
  5692. return encodeReserved(literal);
  5693. }
  5694. });
  5695. }
  5696. function parse(options) {
  5697. // https://fetch.spec.whatwg.org/#methods
  5698. let method = options.method.toUpperCase(); // replace :varname with {varname} to make it RFC 6570 compatible
  5699. let url = (options.url || "/").replace(/:([a-z]\w+)/g, "{+$1}");
  5700. let headers = Object.assign({}, options.headers);
  5701. let body;
  5702. let parameters = omit(options, ["method", "baseUrl", "url", "headers", "request", "mediaType"]); // extract variable names from URL to calculate remaining variables later
  5703. const urlVariableNames = extractUrlVariableNames(url);
  5704. url = parseUrl(url).expand(parameters);
  5705. if (!/^http/.test(url)) {
  5706. url = options.baseUrl + url;
  5707. }
  5708. const omittedParameters = Object.keys(options).filter(option => urlVariableNames.includes(option)).concat("baseUrl");
  5709. const remainingParameters = omit(parameters, omittedParameters);
  5710. const isBinaryRequset = /application\/octet-stream/i.test(headers.accept);
  5711. if (!isBinaryRequset) {
  5712. if (options.mediaType.format) {
  5713. // e.g. application/vnd.github.v3+json => application/vnd.github.v3.raw
  5714. headers.accept = headers.accept.split(/,/).map(preview => preview.replace(/application\/vnd(\.\w+)(\.v3)?(\.\w+)?(\+json)?$/, `application/vnd$1$2.${options.mediaType.format}`)).join(",");
  5715. }
  5716. if (options.mediaType.previews.length) {
  5717. const previewsFromAcceptHeader = headers.accept.match(/[\w-]+(?=-preview)/g) || [];
  5718. headers.accept = previewsFromAcceptHeader.concat(options.mediaType.previews).map(preview => {
  5719. const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json";
  5720. return `application/vnd.github.${preview}-preview${format}`;
  5721. }).join(",");
  5722. }
  5723. } // for GET/HEAD requests, set URL query parameters from remaining parameters
  5724. // for PATCH/POST/PUT/DELETE requests, set request body from remaining parameters
  5725. if (["GET", "HEAD"].includes(method)) {
  5726. url = addQueryParameters(url, remainingParameters);
  5727. } else {
  5728. if ("data" in remainingParameters) {
  5729. body = remainingParameters.data;
  5730. } else {
  5731. if (Object.keys(remainingParameters).length) {
  5732. body = remainingParameters;
  5733. } else {
  5734. headers["content-length"] = 0;
  5735. }
  5736. }
  5737. } // default content-type for JSON if body is set
  5738. if (!headers["content-type"] && typeof body !== "undefined") {
  5739. headers["content-type"] = "application/json; charset=utf-8";
  5740. } // GitHub expects 'content-length: 0' header for PUT/PATCH requests without body.
  5741. // fetch does not allow to set `content-length` header, but we can set body to an empty string
  5742. if (["PATCH", "PUT"].includes(method) && typeof body === "undefined") {
  5743. body = "";
  5744. } // Only return body/request keys if present
  5745. return Object.assign({
  5746. method,
  5747. url,
  5748. headers
  5749. }, typeof body !== "undefined" ? {
  5750. body
  5751. } : null, options.request ? {
  5752. request: options.request
  5753. } : null);
  5754. }
  5755. function endpointWithDefaults(defaults, route, options) {
  5756. return parse(merge(defaults, route, options));
  5757. }
  5758. function withDefaults(oldDefaults, newDefaults) {
  5759. const DEFAULTS = merge(oldDefaults, newDefaults);
  5760. const endpoint = endpointWithDefaults.bind(null, DEFAULTS);
  5761. return Object.assign(endpoint, {
  5762. DEFAULTS,
  5763. defaults: withDefaults.bind(null, DEFAULTS),
  5764. merge: merge.bind(null, DEFAULTS),
  5765. parse
  5766. });
  5767. }
  5768. const VERSION = "5.5.1";
  5769. const userAgent = `octokit-endpoint.js/${VERSION} ${universalUserAgent.getUserAgent()}`; // DEFAULTS has all properties set that EndpointOptions has, except url.
  5770. // So we use RequestParameters and add method as additional required property.
  5771. const DEFAULTS = {
  5772. method: "GET",
  5773. baseUrl: "https://api.github.com",
  5774. headers: {
  5775. accept: "application/vnd.github.v3+json",
  5776. "user-agent": userAgent
  5777. },
  5778. mediaType: {
  5779. format: "",
  5780. previews: []
  5781. }
  5782. };
  5783. const endpoint = withDefaults(null, DEFAULTS);
  5784. exports.endpoint = endpoint;
  5785. //# sourceMappingURL=index.js.map
  5786. /***/ }),
  5787. /***/ 389:
  5788. /***/ (function(module, __unusedexports, __webpack_require__) {
  5789. "use strict";
  5790. const fs = __webpack_require__(747);
  5791. const shebangCommand = __webpack_require__(866);
  5792. function readShebang(command) {
  5793. // Read the first 150 bytes from the file
  5794. const size = 150;
  5795. let buffer;
  5796. if (Buffer.alloc) {
  5797. // Node.js v4.5+ / v5.10+
  5798. buffer = Buffer.alloc(size);
  5799. } else {
  5800. // Old Node.js API
  5801. buffer = new Buffer(size);
  5802. buffer.fill(0); // zero-fill
  5803. }
  5804. let fd;
  5805. try {
  5806. fd = fs.openSync(command, 'r');
  5807. fs.readSync(fd, buffer, 0, size, 0);
  5808. fs.closeSync(fd);
  5809. } catch (e) { /* Empty */ }
  5810. // Attempt to extract shebang (null is returned if not a shebang)
  5811. return shebangCommand(buffer.toString());
  5812. }
  5813. module.exports = readShebang;
  5814. /***/ }),
  5815. /***/ 402:
  5816. /***/ (function(module, __unusedexports, __webpack_require__) {
  5817. module.exports = Octokit;
  5818. const { request } = __webpack_require__(753);
  5819. const Hook = __webpack_require__(523);
  5820. const parseClientOptions = __webpack_require__(294);
  5821. function Octokit(plugins, options) {
  5822. options = options || {};
  5823. const hook = new Hook.Collection();
  5824. const log = Object.assign(
  5825. {
  5826. debug: () => {},
  5827. info: () => {},
  5828. warn: console.warn,
  5829. error: console.error
  5830. },
  5831. options && options.log
  5832. );
  5833. const api = {
  5834. hook,
  5835. log,
  5836. request: request.defaults(parseClientOptions(options, log, hook))
  5837. };
  5838. plugins.forEach(pluginFunction => pluginFunction(api, options));
  5839. return api;
  5840. }
  5841. /***/ }),
  5842. /***/ 413:
  5843. /***/ (function(module) {
  5844. module.exports = require("stream");
  5845. /***/ }),
  5846. /***/ 417:
  5847. /***/ (function(module) {
  5848. module.exports = require("crypto");
  5849. /***/ }),
  5850. /***/ 427:
  5851. /***/ (function(module, __unusedexports, __webpack_require__) {
  5852. "use strict";
  5853. // Older verions of Node.js might not have `util.getSystemErrorName()`.
  5854. // In that case, fall back to a deprecated internal.
  5855. const util = __webpack_require__(669);
  5856. let uv;
  5857. if (typeof util.getSystemErrorName === 'function') {
  5858. module.exports = util.getSystemErrorName;
  5859. } else {
  5860. try {
  5861. uv = process.binding('uv');
  5862. if (typeof uv.errname !== 'function') {
  5863. throw new TypeError('uv.errname is not a function');
  5864. }
  5865. } catch (err) {
  5866. console.error('execa/lib/errname: unable to establish process.binding(\'uv\')', err);
  5867. uv = null;
  5868. }
  5869. module.exports = code => errname(uv, code);
  5870. }
  5871. // Used for testing the fallback behavior
  5872. module.exports.__test__ = errname;
  5873. function errname(uv, code) {
  5874. if (uv) {
  5875. return uv.errname(code);
  5876. }
  5877. if (!(code < 0)) {
  5878. throw new Error('err >= 0');
  5879. }
  5880. return `Unknown system error ${code}`;
  5881. }
  5882. /***/ }),
  5883. /***/ 430:
  5884. /***/ (function(module, __unusedexports, __webpack_require__) {
  5885. module.exports = octokitValidate;
  5886. const validate = __webpack_require__(348);
  5887. function octokitValidate(octokit) {
  5888. octokit.hook.before("request", validate.bind(null, octokit));
  5889. }
  5890. /***/ }),
  5891. /***/ 431:
  5892. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5893. "use strict";
  5894. Object.defineProperty(exports, "__esModule", { value: true });
  5895. const os = __webpack_require__(87);
  5896. /**
  5897. * Commands
  5898. *
  5899. * Command Format:
  5900. * ##[name key=value;key=value]message
  5901. *
  5902. * Examples:
  5903. * ##[warning]This is the user warning message
  5904. * ##[set-secret name=mypassword]definitelyNotAPassword!
  5905. */
  5906. function issueCommand(command, properties, message) {
  5907. const cmd = new Command(command, properties, message);
  5908. process.stdout.write(cmd.toString() + os.EOL);
  5909. }
  5910. exports.issueCommand = issueCommand;
  5911. function issue(name, message = '') {
  5912. issueCommand(name, {}, message);
  5913. }
  5914. exports.issue = issue;
  5915. const CMD_STRING = '::';
  5916. class Command {
  5917. constructor(command, properties, message) {
  5918. if (!command) {
  5919. command = 'missing.command';
  5920. }
  5921. this.command = command;
  5922. this.properties = properties;
  5923. this.message = message;
  5924. }
  5925. toString() {
  5926. let cmdStr = CMD_STRING + this.command;
  5927. if (this.properties && Object.keys(this.properties).length > 0) {
  5928. cmdStr += ' ';
  5929. for (const key in this.properties) {
  5930. if (this.properties.hasOwnProperty(key)) {
  5931. const val = this.properties[key];
  5932. if (val) {
  5933. // safely append the val - avoid blowing up when attempting to
  5934. // call .replace() if message is not a string for some reason
  5935. cmdStr += `${key}=${escape(`${val || ''}`)},`;
  5936. }
  5937. }
  5938. }
  5939. }
  5940. cmdStr += CMD_STRING;
  5941. // safely append the message - avoid blowing up when attempting to
  5942. // call .replace() if message is not a string for some reason
  5943. const message = `${this.message || ''}`;
  5944. cmdStr += escapeData(message);
  5945. return cmdStr;
  5946. }
  5947. }
  5948. function escapeData(s) {
  5949. return s.replace(/\r/g, '%0D').replace(/\n/g, '%0A');
  5950. }
  5951. function escape(s) {
  5952. return s
  5953. .replace(/\r/g, '%0D')
  5954. .replace(/\n/g, '%0A')
  5955. .replace(/]/g, '%5D')
  5956. .replace(/;/g, '%3B');
  5957. }
  5958. //# sourceMappingURL=command.js.map
  5959. /***/ }),
  5960. /***/ 438:
  5961. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  5962. "use strict";
  5963. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  5964. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  5965. return new (P || (P = Promise))(function (resolve, reject) {
  5966. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  5967. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  5968. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  5969. step((generator = generator.apply(thisArg, _arguments || [])).next());
  5970. });
  5971. };
  5972. var __importStar = (this && this.__importStar) || function (mod) {
  5973. if (mod && mod.__esModule) return mod;
  5974. var result = {};
  5975. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  5976. result["default"] = mod;
  5977. return result;
  5978. };
  5979. Object.defineProperty(exports, "__esModule", { value: true });
  5980. const core = __importStar(__webpack_require__(470));
  5981. const fs = __importStar(__webpack_require__(747));
  5982. const fsHelper = __importStar(__webpack_require__(618));
  5983. const io = __importStar(__webpack_require__(1));
  5984. const path = __importStar(__webpack_require__(622));
  5985. function prepareExistingDirectory(git, repositoryPath, repositoryUrl, clean) {
  5986. return __awaiter(this, void 0, void 0, function* () {
  5987. let remove = false;
  5988. // Check whether using git or REST API
  5989. if (!git) {
  5990. remove = true;
  5991. }
  5992. // Fetch URL does not match
  5993. else if (!fsHelper.directoryExistsSync(path.join(repositoryPath, '.git')) ||
  5994. repositoryUrl !== (yield git.tryGetFetchUrl())) {
  5995. remove = true;
  5996. }
  5997. else {
  5998. // Delete any index.lock and shallow.lock left by a previously canceled run or crashed git process
  5999. const lockPaths = [
  6000. path.join(repositoryPath, '.git', 'index.lock'),
  6001. path.join(repositoryPath, '.git', 'shallow.lock')
  6002. ];
  6003. for (const lockPath of lockPaths) {
  6004. try {
  6005. yield io.rmRF(lockPath);
  6006. }
  6007. catch (error) {
  6008. core.debug(`Unable to delete '${lockPath}'. ${error.message}`);
  6009. }
  6010. }
  6011. try {
  6012. // Checkout detached HEAD
  6013. if (!(yield git.isDetached())) {
  6014. yield git.checkoutDetach();
  6015. }
  6016. // Remove all refs/heads/*
  6017. let branches = yield git.branchList(false);
  6018. for (const branch of branches) {
  6019. yield git.branchDelete(false, branch);
  6020. }
  6021. // Remove all refs/remotes/origin/* to avoid conflicts
  6022. branches = yield git.branchList(true);
  6023. for (const branch of branches) {
  6024. yield git.branchDelete(true, branch);
  6025. }
  6026. // Clean
  6027. if (clean) {
  6028. if (!(yield git.tryClean())) {
  6029. 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}'.`);
  6030. remove = true;
  6031. }
  6032. else if (!(yield git.tryReset())) {
  6033. remove = true;
  6034. }
  6035. if (remove) {
  6036. core.warning(`Unable to clean or reset the repository. The repository will be recreated instead.`);
  6037. }
  6038. }
  6039. }
  6040. catch (error) {
  6041. core.warning(`Unable to prepare the existing repository. The repository will be recreated instead.`);
  6042. remove = true;
  6043. }
  6044. }
  6045. if (remove) {
  6046. // Delete the contents of the directory. Don't delete the directory itself
  6047. // since it might be the current working directory.
  6048. core.info(`Deleting the contents of '${repositoryPath}'`);
  6049. for (const file of yield fs.promises.readdir(repositoryPath)) {
  6050. yield io.rmRF(path.join(repositoryPath, file));
  6051. }
  6052. }
  6053. });
  6054. }
  6055. exports.prepareExistingDirectory = prepareExistingDirectory;
  6056. /***/ }),
  6057. /***/ 453:
  6058. /***/ (function(module, __unusedexports, __webpack_require__) {
  6059. var once = __webpack_require__(969)
  6060. var eos = __webpack_require__(562)
  6061. var fs = __webpack_require__(747) // we only need fs to get the ReadStream and WriteStream prototypes
  6062. var noop = function () {}
  6063. var ancient = /^v?\.0/.test(process.version)
  6064. var isFn = function (fn) {
  6065. return typeof fn === 'function'
  6066. }
  6067. var isFS = function (stream) {
  6068. if (!ancient) return false // newer node version do not need to care about fs is a special way
  6069. if (!fs) return false // browser
  6070. return (stream instanceof (fs.ReadStream || noop) || stream instanceof (fs.WriteStream || noop)) && isFn(stream.close)
  6071. }
  6072. var isRequest = function (stream) {
  6073. return stream.setHeader && isFn(stream.abort)
  6074. }
  6075. var destroyer = function (stream, reading, writing, callback) {
  6076. callback = once(callback)
  6077. var closed = false
  6078. stream.on('close', function () {
  6079. closed = true
  6080. })
  6081. eos(stream, {readable: reading, writable: writing}, function (err) {
  6082. if (err) return callback(err)
  6083. closed = true
  6084. callback()
  6085. })
  6086. var destroyed = false
  6087. return function (err) {
  6088. if (closed) return
  6089. if (destroyed) return
  6090. destroyed = true
  6091. if (isFS(stream)) return stream.close(noop) // use close for fs streams to avoid fd leaks
  6092. if (isRequest(stream)) return stream.abort() // request.destroy just do .end - .abort is what we want
  6093. if (isFn(stream.destroy)) return stream.destroy()
  6094. callback(err || new Error('stream was destroyed'))
  6095. }
  6096. }
  6097. var call = function (fn) {
  6098. fn()
  6099. }
  6100. var pipe = function (from, to) {
  6101. return from.pipe(to)
  6102. }
  6103. var pump = function () {
  6104. var streams = Array.prototype.slice.call(arguments)
  6105. var callback = isFn(streams[streams.length - 1] || noop) && streams.pop() || noop
  6106. if (Array.isArray(streams[0])) streams = streams[0]
  6107. if (streams.length < 2) throw new Error('pump requires two streams per minimum')
  6108. var error
  6109. var destroys = streams.map(function (stream, i) {
  6110. var reading = i < streams.length - 1
  6111. var writing = i > 0
  6112. return destroyer(stream, reading, writing, function (err) {
  6113. if (!error) error = err
  6114. if (err) destroys.forEach(call)
  6115. if (reading) return
  6116. destroys.forEach(call)
  6117. callback(error)
  6118. })
  6119. })
  6120. return streams.reduce(pipe)
  6121. }
  6122. module.exports = pump
  6123. /***/ }),
  6124. /***/ 454:
  6125. /***/ (function(module, exports, __webpack_require__) {
  6126. "use strict";
  6127. Object.defineProperty(exports, '__esModule', { value: true });
  6128. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  6129. var Stream = _interopDefault(__webpack_require__(413));
  6130. var http = _interopDefault(__webpack_require__(605));
  6131. var Url = _interopDefault(__webpack_require__(835));
  6132. var https = _interopDefault(__webpack_require__(211));
  6133. var zlib = _interopDefault(__webpack_require__(761));
  6134. // Based on https://github.com/tmpvar/jsdom/blob/aa85b2abf07766ff7bf5c1f6daafb3726f2f2db5/lib/jsdom/living/blob.js
  6135. // fix for "Readable" isn't a named export issue
  6136. const Readable = Stream.Readable;
  6137. const BUFFER = Symbol('buffer');
  6138. const TYPE = Symbol('type');
  6139. class Blob {
  6140. constructor() {
  6141. this[TYPE] = '';
  6142. const blobParts = arguments[0];
  6143. const options = arguments[1];
  6144. const buffers = [];
  6145. let size = 0;
  6146. if (blobParts) {
  6147. const a = blobParts;
  6148. const length = Number(a.length);
  6149. for (let i = 0; i < length; i++) {
  6150. const element = a[i];
  6151. let buffer;
  6152. if (element instanceof Buffer) {
  6153. buffer = element;
  6154. } else if (ArrayBuffer.isView(element)) {
  6155. buffer = Buffer.from(element.buffer, element.byteOffset, element.byteLength);
  6156. } else if (element instanceof ArrayBuffer) {
  6157. buffer = Buffer.from(element);
  6158. } else if (element instanceof Blob) {
  6159. buffer = element[BUFFER];
  6160. } else {
  6161. buffer = Buffer.from(typeof element === 'string' ? element : String(element));
  6162. }
  6163. size += buffer.length;
  6164. buffers.push(buffer);
  6165. }
  6166. }
  6167. this[BUFFER] = Buffer.concat(buffers);
  6168. let type = options && options.type !== undefined && String(options.type).toLowerCase();
  6169. if (type && !/[^\u0020-\u007E]/.test(type)) {
  6170. this[TYPE] = type;
  6171. }
  6172. }
  6173. get size() {
  6174. return this[BUFFER].length;
  6175. }
  6176. get type() {
  6177. return this[TYPE];
  6178. }
  6179. text() {
  6180. return Promise.resolve(this[BUFFER].toString());
  6181. }
  6182. arrayBuffer() {
  6183. const buf = this[BUFFER];
  6184. const ab = buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6185. return Promise.resolve(ab);
  6186. }
  6187. stream() {
  6188. const readable = new Readable();
  6189. readable._read = function () {};
  6190. readable.push(this[BUFFER]);
  6191. readable.push(null);
  6192. return readable;
  6193. }
  6194. toString() {
  6195. return '[object Blob]';
  6196. }
  6197. slice() {
  6198. const size = this.size;
  6199. const start = arguments[0];
  6200. const end = arguments[1];
  6201. let relativeStart, relativeEnd;
  6202. if (start === undefined) {
  6203. relativeStart = 0;
  6204. } else if (start < 0) {
  6205. relativeStart = Math.max(size + start, 0);
  6206. } else {
  6207. relativeStart = Math.min(start, size);
  6208. }
  6209. if (end === undefined) {
  6210. relativeEnd = size;
  6211. } else if (end < 0) {
  6212. relativeEnd = Math.max(size + end, 0);
  6213. } else {
  6214. relativeEnd = Math.min(end, size);
  6215. }
  6216. const span = Math.max(relativeEnd - relativeStart, 0);
  6217. const buffer = this[BUFFER];
  6218. const slicedBuffer = buffer.slice(relativeStart, relativeStart + span);
  6219. const blob = new Blob([], { type: arguments[2] });
  6220. blob[BUFFER] = slicedBuffer;
  6221. return blob;
  6222. }
  6223. }
  6224. Object.defineProperties(Blob.prototype, {
  6225. size: { enumerable: true },
  6226. type: { enumerable: true },
  6227. slice: { enumerable: true }
  6228. });
  6229. Object.defineProperty(Blob.prototype, Symbol.toStringTag, {
  6230. value: 'Blob',
  6231. writable: false,
  6232. enumerable: false,
  6233. configurable: true
  6234. });
  6235. /**
  6236. * fetch-error.js
  6237. *
  6238. * FetchError interface for operational errors
  6239. */
  6240. /**
  6241. * Create FetchError instance
  6242. *
  6243. * @param String message Error message for human
  6244. * @param String type Error type for machine
  6245. * @param String systemError For Node.js system error
  6246. * @return FetchError
  6247. */
  6248. function FetchError(message, type, systemError) {
  6249. Error.call(this, message);
  6250. this.message = message;
  6251. this.type = type;
  6252. // when err.type is `system`, err.code contains system error code
  6253. if (systemError) {
  6254. this.code = this.errno = systemError.code;
  6255. }
  6256. // hide custom error implementation details from end-users
  6257. Error.captureStackTrace(this, this.constructor);
  6258. }
  6259. FetchError.prototype = Object.create(Error.prototype);
  6260. FetchError.prototype.constructor = FetchError;
  6261. FetchError.prototype.name = 'FetchError';
  6262. let convert;
  6263. try {
  6264. convert = __webpack_require__(18).convert;
  6265. } catch (e) {}
  6266. const INTERNALS = Symbol('Body internals');
  6267. // fix an issue where "PassThrough" isn't a named export for node <10
  6268. const PassThrough = Stream.PassThrough;
  6269. /**
  6270. * Body mixin
  6271. *
  6272. * Ref: https://fetch.spec.whatwg.org/#body
  6273. *
  6274. * @param Stream body Readable stream
  6275. * @param Object opts Response options
  6276. * @return Void
  6277. */
  6278. function Body(body) {
  6279. var _this = this;
  6280. var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
  6281. _ref$size = _ref.size;
  6282. let size = _ref$size === undefined ? 0 : _ref$size;
  6283. var _ref$timeout = _ref.timeout;
  6284. let timeout = _ref$timeout === undefined ? 0 : _ref$timeout;
  6285. if (body == null) {
  6286. // body is undefined or null
  6287. body = null;
  6288. } else if (isURLSearchParams(body)) {
  6289. // body is a URLSearchParams
  6290. body = Buffer.from(body.toString());
  6291. } else if (isBlob(body)) ; else if (Buffer.isBuffer(body)) ; else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6292. // body is ArrayBuffer
  6293. body = Buffer.from(body);
  6294. } else if (ArrayBuffer.isView(body)) {
  6295. // body is ArrayBufferView
  6296. body = Buffer.from(body.buffer, body.byteOffset, body.byteLength);
  6297. } else if (body instanceof Stream) ; else {
  6298. // none of the above
  6299. // coerce to string then buffer
  6300. body = Buffer.from(String(body));
  6301. }
  6302. this[INTERNALS] = {
  6303. body,
  6304. disturbed: false,
  6305. error: null
  6306. };
  6307. this.size = size;
  6308. this.timeout = timeout;
  6309. if (body instanceof Stream) {
  6310. body.on('error', function (err) {
  6311. const error = err.name === 'AbortError' ? err : new FetchError(`Invalid response body while trying to fetch ${_this.url}: ${err.message}`, 'system', err);
  6312. _this[INTERNALS].error = error;
  6313. });
  6314. }
  6315. }
  6316. Body.prototype = {
  6317. get body() {
  6318. return this[INTERNALS].body;
  6319. },
  6320. get bodyUsed() {
  6321. return this[INTERNALS].disturbed;
  6322. },
  6323. /**
  6324. * Decode response as ArrayBuffer
  6325. *
  6326. * @return Promise
  6327. */
  6328. arrayBuffer() {
  6329. return consumeBody.call(this).then(function (buf) {
  6330. return buf.buffer.slice(buf.byteOffset, buf.byteOffset + buf.byteLength);
  6331. });
  6332. },
  6333. /**
  6334. * Return raw response as Blob
  6335. *
  6336. * @return Promise
  6337. */
  6338. blob() {
  6339. let ct = this.headers && this.headers.get('content-type') || '';
  6340. return consumeBody.call(this).then(function (buf) {
  6341. return Object.assign(
  6342. // Prevent copying
  6343. new Blob([], {
  6344. type: ct.toLowerCase()
  6345. }), {
  6346. [BUFFER]: buf
  6347. });
  6348. });
  6349. },
  6350. /**
  6351. * Decode response as json
  6352. *
  6353. * @return Promise
  6354. */
  6355. json() {
  6356. var _this2 = this;
  6357. return consumeBody.call(this).then(function (buffer) {
  6358. try {
  6359. return JSON.parse(buffer.toString());
  6360. } catch (err) {
  6361. return Body.Promise.reject(new FetchError(`invalid json response body at ${_this2.url} reason: ${err.message}`, 'invalid-json'));
  6362. }
  6363. });
  6364. },
  6365. /**
  6366. * Decode response as text
  6367. *
  6368. * @return Promise
  6369. */
  6370. text() {
  6371. return consumeBody.call(this).then(function (buffer) {
  6372. return buffer.toString();
  6373. });
  6374. },
  6375. /**
  6376. * Decode response as buffer (non-spec api)
  6377. *
  6378. * @return Promise
  6379. */
  6380. buffer() {
  6381. return consumeBody.call(this);
  6382. },
  6383. /**
  6384. * Decode response as text, while automatically detecting the encoding and
  6385. * trying to decode to UTF-8 (non-spec api)
  6386. *
  6387. * @return Promise
  6388. */
  6389. textConverted() {
  6390. var _this3 = this;
  6391. return consumeBody.call(this).then(function (buffer) {
  6392. return convertBody(buffer, _this3.headers);
  6393. });
  6394. }
  6395. };
  6396. // In browsers, all properties are enumerable.
  6397. Object.defineProperties(Body.prototype, {
  6398. body: { enumerable: true },
  6399. bodyUsed: { enumerable: true },
  6400. arrayBuffer: { enumerable: true },
  6401. blob: { enumerable: true },
  6402. json: { enumerable: true },
  6403. text: { enumerable: true }
  6404. });
  6405. Body.mixIn = function (proto) {
  6406. for (const name of Object.getOwnPropertyNames(Body.prototype)) {
  6407. // istanbul ignore else: future proof
  6408. if (!(name in proto)) {
  6409. const desc = Object.getOwnPropertyDescriptor(Body.prototype, name);
  6410. Object.defineProperty(proto, name, desc);
  6411. }
  6412. }
  6413. };
  6414. /**
  6415. * Consume and convert an entire Body to a Buffer.
  6416. *
  6417. * Ref: https://fetch.spec.whatwg.org/#concept-body-consume-body
  6418. *
  6419. * @return Promise
  6420. */
  6421. function consumeBody() {
  6422. var _this4 = this;
  6423. if (this[INTERNALS].disturbed) {
  6424. return Body.Promise.reject(new TypeError(`body used already for: ${this.url}`));
  6425. }
  6426. this[INTERNALS].disturbed = true;
  6427. if (this[INTERNALS].error) {
  6428. return Body.Promise.reject(this[INTERNALS].error);
  6429. }
  6430. let body = this.body;
  6431. // body is null
  6432. if (body === null) {
  6433. return Body.Promise.resolve(Buffer.alloc(0));
  6434. }
  6435. // body is blob
  6436. if (isBlob(body)) {
  6437. body = body.stream();
  6438. }
  6439. // body is buffer
  6440. if (Buffer.isBuffer(body)) {
  6441. return Body.Promise.resolve(body);
  6442. }
  6443. // istanbul ignore if: should never happen
  6444. if (!(body instanceof Stream)) {
  6445. return Body.Promise.resolve(Buffer.alloc(0));
  6446. }
  6447. // body is stream
  6448. // get ready to actually consume the body
  6449. let accum = [];
  6450. let accumBytes = 0;
  6451. let abort = false;
  6452. return new Body.Promise(function (resolve, reject) {
  6453. let resTimeout;
  6454. // allow timeout on slow response body
  6455. if (_this4.timeout) {
  6456. resTimeout = setTimeout(function () {
  6457. abort = true;
  6458. reject(new FetchError(`Response timeout while trying to fetch ${_this4.url} (over ${_this4.timeout}ms)`, 'body-timeout'));
  6459. }, _this4.timeout);
  6460. }
  6461. // handle stream errors
  6462. body.on('error', function (err) {
  6463. if (err.name === 'AbortError') {
  6464. // if the request was aborted, reject with this Error
  6465. abort = true;
  6466. reject(err);
  6467. } else {
  6468. // other errors, such as incorrect content-encoding
  6469. reject(new FetchError(`Invalid response body while trying to fetch ${_this4.url}: ${err.message}`, 'system', err));
  6470. }
  6471. });
  6472. body.on('data', function (chunk) {
  6473. if (abort || chunk === null) {
  6474. return;
  6475. }
  6476. if (_this4.size && accumBytes + chunk.length > _this4.size) {
  6477. abort = true;
  6478. reject(new FetchError(`content size at ${_this4.url} over limit: ${_this4.size}`, 'max-size'));
  6479. return;
  6480. }
  6481. accumBytes += chunk.length;
  6482. accum.push(chunk);
  6483. });
  6484. body.on('end', function () {
  6485. if (abort) {
  6486. return;
  6487. }
  6488. clearTimeout(resTimeout);
  6489. try {
  6490. resolve(Buffer.concat(accum, accumBytes));
  6491. } catch (err) {
  6492. // handle streams that have accumulated too much data (issue #414)
  6493. reject(new FetchError(`Could not create Buffer from response body for ${_this4.url}: ${err.message}`, 'system', err));
  6494. }
  6495. });
  6496. });
  6497. }
  6498. /**
  6499. * Detect buffer encoding and convert to target encoding
  6500. * ref: http://www.w3.org/TR/2011/WD-html5-20110113/parsing.html#determining-the-character-encoding
  6501. *
  6502. * @param Buffer buffer Incoming buffer
  6503. * @param String encoding Target encoding
  6504. * @return String
  6505. */
  6506. function convertBody(buffer, headers) {
  6507. if (typeof convert !== 'function') {
  6508. throw new Error('The package `encoding` must be installed to use the textConverted() function');
  6509. }
  6510. const ct = headers.get('content-type');
  6511. let charset = 'utf-8';
  6512. let res, str;
  6513. // header
  6514. if (ct) {
  6515. res = /charset=([^;]*)/i.exec(ct);
  6516. }
  6517. // no charset in content type, peek at response body for at most 1024 bytes
  6518. str = buffer.slice(0, 1024).toString();
  6519. // html5
  6520. if (!res && str) {
  6521. res = /<meta.+?charset=(['"])(.+?)\1/i.exec(str);
  6522. }
  6523. // html4
  6524. if (!res && str) {
  6525. res = /<meta[\s]+?http-equiv=(['"])content-type\1[\s]+?content=(['"])(.+?)\2/i.exec(str);
  6526. if (res) {
  6527. res = /charset=(.*)/i.exec(res.pop());
  6528. }
  6529. }
  6530. // xml
  6531. if (!res && str) {
  6532. res = /<\?xml.+?encoding=(['"])(.+?)\1/i.exec(str);
  6533. }
  6534. // found charset
  6535. if (res) {
  6536. charset = res.pop();
  6537. // prevent decode issues when sites use incorrect encoding
  6538. // ref: https://hsivonen.fi/encoding-menu/
  6539. if (charset === 'gb2312' || charset === 'gbk') {
  6540. charset = 'gb18030';
  6541. }
  6542. }
  6543. // turn raw buffers into a single utf-8 buffer
  6544. return convert(buffer, 'UTF-8', charset).toString();
  6545. }
  6546. /**
  6547. * Detect a URLSearchParams object
  6548. * ref: https://github.com/bitinn/node-fetch/issues/296#issuecomment-307598143
  6549. *
  6550. * @param Object obj Object to detect by type or brand
  6551. * @return String
  6552. */
  6553. function isURLSearchParams(obj) {
  6554. // Duck-typing as a necessary condition.
  6555. 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') {
  6556. return false;
  6557. }
  6558. // Brand-checking and more duck-typing as optional condition.
  6559. return obj.constructor.name === 'URLSearchParams' || Object.prototype.toString.call(obj) === '[object URLSearchParams]' || typeof obj.sort === 'function';
  6560. }
  6561. /**
  6562. * Check if `obj` is a W3C `Blob` object (which `File` inherits from)
  6563. * @param {*} obj
  6564. * @return {boolean}
  6565. */
  6566. function isBlob(obj) {
  6567. 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]);
  6568. }
  6569. /**
  6570. * Clone body given Res/Req instance
  6571. *
  6572. * @param Mixed instance Response or Request instance
  6573. * @return Mixed
  6574. */
  6575. function clone(instance) {
  6576. let p1, p2;
  6577. let body = instance.body;
  6578. // don't allow cloning a used body
  6579. if (instance.bodyUsed) {
  6580. throw new Error('cannot clone body after it is used');
  6581. }
  6582. // check that body is a stream and not form-data object
  6583. // note: we can't clone the form-data object without having it as a dependency
  6584. if (body instanceof Stream && typeof body.getBoundary !== 'function') {
  6585. // tee instance body
  6586. p1 = new PassThrough();
  6587. p2 = new PassThrough();
  6588. body.pipe(p1);
  6589. body.pipe(p2);
  6590. // set instance body to teed body and return the other teed body
  6591. instance[INTERNALS].body = p1;
  6592. body = p2;
  6593. }
  6594. return body;
  6595. }
  6596. /**
  6597. * Performs the operation "extract a `Content-Type` value from |object|" as
  6598. * specified in the specification:
  6599. * https://fetch.spec.whatwg.org/#concept-bodyinit-extract
  6600. *
  6601. * This function assumes that instance.body is present.
  6602. *
  6603. * @param Mixed instance Any options.body input
  6604. */
  6605. function extractContentType(body) {
  6606. if (body === null) {
  6607. // body is null
  6608. return null;
  6609. } else if (typeof body === 'string') {
  6610. // body is string
  6611. return 'text/plain;charset=UTF-8';
  6612. } else if (isURLSearchParams(body)) {
  6613. // body is a URLSearchParams
  6614. return 'application/x-www-form-urlencoded;charset=UTF-8';
  6615. } else if (isBlob(body)) {
  6616. // body is blob
  6617. return body.type || null;
  6618. } else if (Buffer.isBuffer(body)) {
  6619. // body is buffer
  6620. return null;
  6621. } else if (Object.prototype.toString.call(body) === '[object ArrayBuffer]') {
  6622. // body is ArrayBuffer
  6623. return null;
  6624. } else if (ArrayBuffer.isView(body)) {
  6625. // body is ArrayBufferView
  6626. return null;
  6627. } else if (typeof body.getBoundary === 'function') {
  6628. // detect form data input from form-data module
  6629. return `multipart/form-data;boundary=${body.getBoundary()}`;
  6630. } else if (body instanceof Stream) {
  6631. // body is stream
  6632. // can't really do much about this
  6633. return null;
  6634. } else {
  6635. // Body constructor defaults other things to string
  6636. return 'text/plain;charset=UTF-8';
  6637. }
  6638. }
  6639. /**
  6640. * The Fetch Standard treats this as if "total bytes" is a property on the body.
  6641. * For us, we have to explicitly get it with a function.
  6642. *
  6643. * ref: https://fetch.spec.whatwg.org/#concept-body-total-bytes
  6644. *
  6645. * @param Body instance Instance of Body
  6646. * @return Number? Number of bytes, or null if not possible
  6647. */
  6648. function getTotalBytes(instance) {
  6649. const body = instance.body;
  6650. if (body === null) {
  6651. // body is null
  6652. return 0;
  6653. } else if (isBlob(body)) {
  6654. return body.size;
  6655. } else if (Buffer.isBuffer(body)) {
  6656. // body is buffer
  6657. return body.length;
  6658. } else if (body && typeof body.getLengthSync === 'function') {
  6659. // detect form data input from form-data module
  6660. if (body._lengthRetrievers && body._lengthRetrievers.length == 0 || // 1.x
  6661. body.hasKnownLength && body.hasKnownLength()) {
  6662. // 2.x
  6663. return body.getLengthSync();
  6664. }
  6665. return null;
  6666. } else {
  6667. // body is stream
  6668. return null;
  6669. }
  6670. }
  6671. /**
  6672. * Write a Body to a Node.js WritableStream (e.g. http.Request) object.
  6673. *
  6674. * @param Body instance Instance of Body
  6675. * @return Void
  6676. */
  6677. function writeToStream(dest, instance) {
  6678. const body = instance.body;
  6679. if (body === null) {
  6680. // body is null
  6681. dest.end();
  6682. } else if (isBlob(body)) {
  6683. body.stream().pipe(dest);
  6684. } else if (Buffer.isBuffer(body)) {
  6685. // body is buffer
  6686. dest.write(body);
  6687. dest.end();
  6688. } else {
  6689. // body is stream
  6690. body.pipe(dest);
  6691. }
  6692. }
  6693. // expose Promise
  6694. Body.Promise = global.Promise;
  6695. /**
  6696. * headers.js
  6697. *
  6698. * Headers class offers convenient helpers
  6699. */
  6700. const invalidTokenRegex = /[^\^_`a-zA-Z\-0-9!#$%&'*+.|~]/;
  6701. const invalidHeaderCharRegex = /[^\t\x20-\x7e\x80-\xff]/;
  6702. function validateName(name) {
  6703. name = `${name}`;
  6704. if (invalidTokenRegex.test(name) || name === '') {
  6705. throw new TypeError(`${name} is not a legal HTTP header name`);
  6706. }
  6707. }
  6708. function validateValue(value) {
  6709. value = `${value}`;
  6710. if (invalidHeaderCharRegex.test(value)) {
  6711. throw new TypeError(`${value} is not a legal HTTP header value`);
  6712. }
  6713. }
  6714. /**
  6715. * Find the key in the map object given a header name.
  6716. *
  6717. * Returns undefined if not found.
  6718. *
  6719. * @param String name Header name
  6720. * @return String|Undefined
  6721. */
  6722. function find(map, name) {
  6723. name = name.toLowerCase();
  6724. for (const key in map) {
  6725. if (key.toLowerCase() === name) {
  6726. return key;
  6727. }
  6728. }
  6729. return undefined;
  6730. }
  6731. const MAP = Symbol('map');
  6732. class Headers {
  6733. /**
  6734. * Headers class
  6735. *
  6736. * @param Object headers Response headers
  6737. * @return Void
  6738. */
  6739. constructor() {
  6740. let init = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : undefined;
  6741. this[MAP] = Object.create(null);
  6742. if (init instanceof Headers) {
  6743. const rawHeaders = init.raw();
  6744. const headerNames = Object.keys(rawHeaders);
  6745. for (const headerName of headerNames) {
  6746. for (const value of rawHeaders[headerName]) {
  6747. this.append(headerName, value);
  6748. }
  6749. }
  6750. return;
  6751. }
  6752. // We don't worry about converting prop to ByteString here as append()
  6753. // will handle it.
  6754. if (init == null) ; else if (typeof init === 'object') {
  6755. const method = init[Symbol.iterator];
  6756. if (method != null) {
  6757. if (typeof method !== 'function') {
  6758. throw new TypeError('Header pairs must be iterable');
  6759. }
  6760. // sequence<sequence<ByteString>>
  6761. // Note: per spec we have to first exhaust the lists then process them
  6762. const pairs = [];
  6763. for (const pair of init) {
  6764. if (typeof pair !== 'object' || typeof pair[Symbol.iterator] !== 'function') {
  6765. throw new TypeError('Each header pair must be iterable');
  6766. }
  6767. pairs.push(Array.from(pair));
  6768. }
  6769. for (const pair of pairs) {
  6770. if (pair.length !== 2) {
  6771. throw new TypeError('Each header pair must be a name/value tuple');
  6772. }
  6773. this.append(pair[0], pair[1]);
  6774. }
  6775. } else {
  6776. // record<ByteString, ByteString>
  6777. for (const key of Object.keys(init)) {
  6778. const value = init[key];
  6779. this.append(key, value);
  6780. }
  6781. }
  6782. } else {
  6783. throw new TypeError('Provided initializer must be an object');
  6784. }
  6785. }
  6786. /**
  6787. * Return combined header value given name
  6788. *
  6789. * @param String name Header name
  6790. * @return Mixed
  6791. */
  6792. get(name) {
  6793. name = `${name}`;
  6794. validateName(name);
  6795. const key = find(this[MAP], name);
  6796. if (key === undefined) {
  6797. return null;
  6798. }
  6799. return this[MAP][key].join(', ');
  6800. }
  6801. /**
  6802. * Iterate over all headers
  6803. *
  6804. * @param Function callback Executed for each item with parameters (value, name, thisArg)
  6805. * @param Boolean thisArg `this` context for callback function
  6806. * @return Void
  6807. */
  6808. forEach(callback) {
  6809. let thisArg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : undefined;
  6810. let pairs = getHeaders(this);
  6811. let i = 0;
  6812. while (i < pairs.length) {
  6813. var _pairs$i = pairs[i];
  6814. const name = _pairs$i[0],
  6815. value = _pairs$i[1];
  6816. callback.call(thisArg, value, name, this);
  6817. pairs = getHeaders(this);
  6818. i++;
  6819. }
  6820. }
  6821. /**
  6822. * Overwrite header values given name
  6823. *
  6824. * @param String name Header name
  6825. * @param String value Header value
  6826. * @return Void
  6827. */
  6828. set(name, value) {
  6829. name = `${name}`;
  6830. value = `${value}`;
  6831. validateName(name);
  6832. validateValue(value);
  6833. const key = find(this[MAP], name);
  6834. this[MAP][key !== undefined ? key : name] = [value];
  6835. }
  6836. /**
  6837. * Append a value onto existing header
  6838. *
  6839. * @param String name Header name
  6840. * @param String value Header value
  6841. * @return Void
  6842. */
  6843. append(name, value) {
  6844. name = `${name}`;
  6845. value = `${value}`;
  6846. validateName(name);
  6847. validateValue(value);
  6848. const key = find(this[MAP], name);
  6849. if (key !== undefined) {
  6850. this[MAP][key].push(value);
  6851. } else {
  6852. this[MAP][name] = [value];
  6853. }
  6854. }
  6855. /**
  6856. * Check for header name existence
  6857. *
  6858. * @param String name Header name
  6859. * @return Boolean
  6860. */
  6861. has(name) {
  6862. name = `${name}`;
  6863. validateName(name);
  6864. return find(this[MAP], name) !== undefined;
  6865. }
  6866. /**
  6867. * Delete all header values given name
  6868. *
  6869. * @param String name Header name
  6870. * @return Void
  6871. */
  6872. delete(name) {
  6873. name = `${name}`;
  6874. validateName(name);
  6875. const key = find(this[MAP], name);
  6876. if (key !== undefined) {
  6877. delete this[MAP][key];
  6878. }
  6879. }
  6880. /**
  6881. * Return raw headers (non-spec api)
  6882. *
  6883. * @return Object
  6884. */
  6885. raw() {
  6886. return this[MAP];
  6887. }
  6888. /**
  6889. * Get an iterator on keys.
  6890. *
  6891. * @return Iterator
  6892. */
  6893. keys() {
  6894. return createHeadersIterator(this, 'key');
  6895. }
  6896. /**
  6897. * Get an iterator on values.
  6898. *
  6899. * @return Iterator
  6900. */
  6901. values() {
  6902. return createHeadersIterator(this, 'value');
  6903. }
  6904. /**
  6905. * Get an iterator on entries.
  6906. *
  6907. * This is the default iterator of the Headers object.
  6908. *
  6909. * @return Iterator
  6910. */
  6911. [Symbol.iterator]() {
  6912. return createHeadersIterator(this, 'key+value');
  6913. }
  6914. }
  6915. Headers.prototype.entries = Headers.prototype[Symbol.iterator];
  6916. Object.defineProperty(Headers.prototype, Symbol.toStringTag, {
  6917. value: 'Headers',
  6918. writable: false,
  6919. enumerable: false,
  6920. configurable: true
  6921. });
  6922. Object.defineProperties(Headers.prototype, {
  6923. get: { enumerable: true },
  6924. forEach: { enumerable: true },
  6925. set: { enumerable: true },
  6926. append: { enumerable: true },
  6927. has: { enumerable: true },
  6928. delete: { enumerable: true },
  6929. keys: { enumerable: true },
  6930. values: { enumerable: true },
  6931. entries: { enumerable: true }
  6932. });
  6933. function getHeaders(headers) {
  6934. let kind = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'key+value';
  6935. const keys = Object.keys(headers[MAP]).sort();
  6936. return keys.map(kind === 'key' ? function (k) {
  6937. return k.toLowerCase();
  6938. } : kind === 'value' ? function (k) {
  6939. return headers[MAP][k].join(', ');
  6940. } : function (k) {
  6941. return [k.toLowerCase(), headers[MAP][k].join(', ')];
  6942. });
  6943. }
  6944. const INTERNAL = Symbol('internal');
  6945. function createHeadersIterator(target, kind) {
  6946. const iterator = Object.create(HeadersIteratorPrototype);
  6947. iterator[INTERNAL] = {
  6948. target,
  6949. kind,
  6950. index: 0
  6951. };
  6952. return iterator;
  6953. }
  6954. const HeadersIteratorPrototype = Object.setPrototypeOf({
  6955. next() {
  6956. // istanbul ignore if
  6957. if (!this || Object.getPrototypeOf(this) !== HeadersIteratorPrototype) {
  6958. throw new TypeError('Value of `this` is not a HeadersIterator');
  6959. }
  6960. var _INTERNAL = this[INTERNAL];
  6961. const target = _INTERNAL.target,
  6962. kind = _INTERNAL.kind,
  6963. index = _INTERNAL.index;
  6964. const values = getHeaders(target, kind);
  6965. const len = values.length;
  6966. if (index >= len) {
  6967. return {
  6968. value: undefined,
  6969. done: true
  6970. };
  6971. }
  6972. this[INTERNAL].index = index + 1;
  6973. return {
  6974. value: values[index],
  6975. done: false
  6976. };
  6977. }
  6978. }, Object.getPrototypeOf(Object.getPrototypeOf([][Symbol.iterator]())));
  6979. Object.defineProperty(HeadersIteratorPrototype, Symbol.toStringTag, {
  6980. value: 'HeadersIterator',
  6981. writable: false,
  6982. enumerable: false,
  6983. configurable: true
  6984. });
  6985. /**
  6986. * Export the Headers object in a form that Node.js can consume.
  6987. *
  6988. * @param Headers headers
  6989. * @return Object
  6990. */
  6991. function exportNodeCompatibleHeaders(headers) {
  6992. const obj = Object.assign({ __proto__: null }, headers[MAP]);
  6993. // http.request() only supports string as Host header. This hack makes
  6994. // specifying custom Host header possible.
  6995. const hostHeaderKey = find(headers[MAP], 'Host');
  6996. if (hostHeaderKey !== undefined) {
  6997. obj[hostHeaderKey] = obj[hostHeaderKey][0];
  6998. }
  6999. return obj;
  7000. }
  7001. /**
  7002. * Create a Headers object from an object of headers, ignoring those that do
  7003. * not conform to HTTP grammar productions.
  7004. *
  7005. * @param Object obj Object of headers
  7006. * @return Headers
  7007. */
  7008. function createHeadersLenient(obj) {
  7009. const headers = new Headers();
  7010. for (const name of Object.keys(obj)) {
  7011. if (invalidTokenRegex.test(name)) {
  7012. continue;
  7013. }
  7014. if (Array.isArray(obj[name])) {
  7015. for (const val of obj[name]) {
  7016. if (invalidHeaderCharRegex.test(val)) {
  7017. continue;
  7018. }
  7019. if (headers[MAP][name] === undefined) {
  7020. headers[MAP][name] = [val];
  7021. } else {
  7022. headers[MAP][name].push(val);
  7023. }
  7024. }
  7025. } else if (!invalidHeaderCharRegex.test(obj[name])) {
  7026. headers[MAP][name] = [obj[name]];
  7027. }
  7028. }
  7029. return headers;
  7030. }
  7031. const INTERNALS$1 = Symbol('Response internals');
  7032. // fix an issue where "STATUS_CODES" aren't a named export for node <10
  7033. const STATUS_CODES = http.STATUS_CODES;
  7034. /**
  7035. * Response class
  7036. *
  7037. * @param Stream body Readable stream
  7038. * @param Object opts Response options
  7039. * @return Void
  7040. */
  7041. class Response {
  7042. constructor() {
  7043. let body = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
  7044. let opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7045. Body.call(this, body, opts);
  7046. const status = opts.status || 200;
  7047. const headers = new Headers(opts.headers);
  7048. if (body != null && !headers.has('Content-Type')) {
  7049. const contentType = extractContentType(body);
  7050. if (contentType) {
  7051. headers.append('Content-Type', contentType);
  7052. }
  7053. }
  7054. this[INTERNALS$1] = {
  7055. url: opts.url,
  7056. status,
  7057. statusText: opts.statusText || STATUS_CODES[status],
  7058. headers,
  7059. counter: opts.counter
  7060. };
  7061. }
  7062. get url() {
  7063. return this[INTERNALS$1].url || '';
  7064. }
  7065. get status() {
  7066. return this[INTERNALS$1].status;
  7067. }
  7068. /**
  7069. * Convenience property representing if the request ended normally
  7070. */
  7071. get ok() {
  7072. return this[INTERNALS$1].status >= 200 && this[INTERNALS$1].status < 300;
  7073. }
  7074. get redirected() {
  7075. return this[INTERNALS$1].counter > 0;
  7076. }
  7077. get statusText() {
  7078. return this[INTERNALS$1].statusText;
  7079. }
  7080. get headers() {
  7081. return this[INTERNALS$1].headers;
  7082. }
  7083. /**
  7084. * Clone this response
  7085. *
  7086. * @return Response
  7087. */
  7088. clone() {
  7089. return new Response(clone(this), {
  7090. url: this.url,
  7091. status: this.status,
  7092. statusText: this.statusText,
  7093. headers: this.headers,
  7094. ok: this.ok,
  7095. redirected: this.redirected
  7096. });
  7097. }
  7098. }
  7099. Body.mixIn(Response.prototype);
  7100. Object.defineProperties(Response.prototype, {
  7101. url: { enumerable: true },
  7102. status: { enumerable: true },
  7103. ok: { enumerable: true },
  7104. redirected: { enumerable: true },
  7105. statusText: { enumerable: true },
  7106. headers: { enumerable: true },
  7107. clone: { enumerable: true }
  7108. });
  7109. Object.defineProperty(Response.prototype, Symbol.toStringTag, {
  7110. value: 'Response',
  7111. writable: false,
  7112. enumerable: false,
  7113. configurable: true
  7114. });
  7115. const INTERNALS$2 = Symbol('Request internals');
  7116. // fix an issue where "format", "parse" aren't a named export for node <10
  7117. const parse_url = Url.parse;
  7118. const format_url = Url.format;
  7119. const streamDestructionSupported = 'destroy' in Stream.Readable.prototype;
  7120. /**
  7121. * Check if a value is an instance of Request.
  7122. *
  7123. * @param Mixed input
  7124. * @return Boolean
  7125. */
  7126. function isRequest(input) {
  7127. return typeof input === 'object' && typeof input[INTERNALS$2] === 'object';
  7128. }
  7129. function isAbortSignal(signal) {
  7130. const proto = signal && typeof signal === 'object' && Object.getPrototypeOf(signal);
  7131. return !!(proto && proto.constructor.name === 'AbortSignal');
  7132. }
  7133. /**
  7134. * Request class
  7135. *
  7136. * @param Mixed input Url or Request instance
  7137. * @param Object init Custom options
  7138. * @return Void
  7139. */
  7140. class Request {
  7141. constructor(input) {
  7142. let init = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
  7143. let parsedURL;
  7144. // normalize input
  7145. if (!isRequest(input)) {
  7146. if (input && input.href) {
  7147. // in order to support Node.js' Url objects; though WHATWG's URL objects
  7148. // will fall into this branch also (since their `toString()` will return
  7149. // `href` property anyway)
  7150. parsedURL = parse_url(input.href);
  7151. } else {
  7152. // coerce input to a string before attempting to parse
  7153. parsedURL = parse_url(`${input}`);
  7154. }
  7155. input = {};
  7156. } else {
  7157. parsedURL = parse_url(input.url);
  7158. }
  7159. let method = init.method || input.method || 'GET';
  7160. method = method.toUpperCase();
  7161. if ((init.body != null || isRequest(input) && input.body !== null) && (method === 'GET' || method === 'HEAD')) {
  7162. throw new TypeError('Request with GET/HEAD method cannot have body');
  7163. }
  7164. let inputBody = init.body != null ? init.body : isRequest(input) && input.body !== null ? clone(input) : null;
  7165. Body.call(this, inputBody, {
  7166. timeout: init.timeout || input.timeout || 0,
  7167. size: init.size || input.size || 0
  7168. });
  7169. const headers = new Headers(init.headers || input.headers || {});
  7170. if (inputBody != null && !headers.has('Content-Type')) {
  7171. const contentType = extractContentType(inputBody);
  7172. if (contentType) {
  7173. headers.append('Content-Type', contentType);
  7174. }
  7175. }
  7176. let signal = isRequest(input) ? input.signal : null;
  7177. if ('signal' in init) signal = init.signal;
  7178. if (signal != null && !isAbortSignal(signal)) {
  7179. throw new TypeError('Expected signal to be an instanceof AbortSignal');
  7180. }
  7181. this[INTERNALS$2] = {
  7182. method,
  7183. redirect: init.redirect || input.redirect || 'follow',
  7184. headers,
  7185. parsedURL,
  7186. signal
  7187. };
  7188. // node-fetch-only options
  7189. this.follow = init.follow !== undefined ? init.follow : input.follow !== undefined ? input.follow : 20;
  7190. this.compress = init.compress !== undefined ? init.compress : input.compress !== undefined ? input.compress : true;
  7191. this.counter = init.counter || input.counter || 0;
  7192. this.agent = init.agent || input.agent;
  7193. }
  7194. get method() {
  7195. return this[INTERNALS$2].method;
  7196. }
  7197. get url() {
  7198. return format_url(this[INTERNALS$2].parsedURL);
  7199. }
  7200. get headers() {
  7201. return this[INTERNALS$2].headers;
  7202. }
  7203. get redirect() {
  7204. return this[INTERNALS$2].redirect;
  7205. }
  7206. get signal() {
  7207. return this[INTERNALS$2].signal;
  7208. }
  7209. /**
  7210. * Clone this request
  7211. *
  7212. * @return Request
  7213. */
  7214. clone() {
  7215. return new Request(this);
  7216. }
  7217. }
  7218. Body.mixIn(Request.prototype);
  7219. Object.defineProperty(Request.prototype, Symbol.toStringTag, {
  7220. value: 'Request',
  7221. writable: false,
  7222. enumerable: false,
  7223. configurable: true
  7224. });
  7225. Object.defineProperties(Request.prototype, {
  7226. method: { enumerable: true },
  7227. url: { enumerable: true },
  7228. headers: { enumerable: true },
  7229. redirect: { enumerable: true },
  7230. clone: { enumerable: true },
  7231. signal: { enumerable: true }
  7232. });
  7233. /**
  7234. * Convert a Request to Node.js http request options.
  7235. *
  7236. * @param Request A Request instance
  7237. * @return Object The options object to be passed to http.request
  7238. */
  7239. function getNodeRequestOptions(request) {
  7240. const parsedURL = request[INTERNALS$2].parsedURL;
  7241. const headers = new Headers(request[INTERNALS$2].headers);
  7242. // fetch step 1.3
  7243. if (!headers.has('Accept')) {
  7244. headers.set('Accept', '*/*');
  7245. }
  7246. // Basic fetch
  7247. if (!parsedURL.protocol || !parsedURL.hostname) {
  7248. throw new TypeError('Only absolute URLs are supported');
  7249. }
  7250. if (!/^https?:$/.test(parsedURL.protocol)) {
  7251. throw new TypeError('Only HTTP(S) protocols are supported');
  7252. }
  7253. if (request.signal && request.body instanceof Stream.Readable && !streamDestructionSupported) {
  7254. throw new Error('Cancellation of streamed requests with AbortSignal is not supported in node < 8');
  7255. }
  7256. // HTTP-network-or-cache fetch steps 2.4-2.7
  7257. let contentLengthValue = null;
  7258. if (request.body == null && /^(POST|PUT)$/i.test(request.method)) {
  7259. contentLengthValue = '0';
  7260. }
  7261. if (request.body != null) {
  7262. const totalBytes = getTotalBytes(request);
  7263. if (typeof totalBytes === 'number') {
  7264. contentLengthValue = String(totalBytes);
  7265. }
  7266. }
  7267. if (contentLengthValue) {
  7268. headers.set('Content-Length', contentLengthValue);
  7269. }
  7270. // HTTP-network-or-cache fetch step 2.11
  7271. if (!headers.has('User-Agent')) {
  7272. headers.set('User-Agent', 'node-fetch/1.0 (+https://github.com/bitinn/node-fetch)');
  7273. }
  7274. // HTTP-network-or-cache fetch step 2.15
  7275. if (request.compress && !headers.has('Accept-Encoding')) {
  7276. headers.set('Accept-Encoding', 'gzip,deflate');
  7277. }
  7278. let agent = request.agent;
  7279. if (typeof agent === 'function') {
  7280. agent = agent(parsedURL);
  7281. }
  7282. if (!headers.has('Connection') && !agent) {
  7283. headers.set('Connection', 'close');
  7284. }
  7285. // HTTP-network fetch step 4.2
  7286. // chunked encoding is handled by Node.js
  7287. return Object.assign({}, parsedURL, {
  7288. method: request.method,
  7289. headers: exportNodeCompatibleHeaders(headers),
  7290. agent
  7291. });
  7292. }
  7293. /**
  7294. * abort-error.js
  7295. *
  7296. * AbortError interface for cancelled requests
  7297. */
  7298. /**
  7299. * Create AbortError instance
  7300. *
  7301. * @param String message Error message for human
  7302. * @return AbortError
  7303. */
  7304. function AbortError(message) {
  7305. Error.call(this, message);
  7306. this.type = 'aborted';
  7307. this.message = message;
  7308. // hide custom error implementation details from end-users
  7309. Error.captureStackTrace(this, this.constructor);
  7310. }
  7311. AbortError.prototype = Object.create(Error.prototype);
  7312. AbortError.prototype.constructor = AbortError;
  7313. AbortError.prototype.name = 'AbortError';
  7314. // fix an issue where "PassThrough", "resolve" aren't a named export for node <10
  7315. const PassThrough$1 = Stream.PassThrough;
  7316. const resolve_url = Url.resolve;
  7317. /**
  7318. * Fetch function
  7319. *
  7320. * @param Mixed url Absolute url or Request instance
  7321. * @param Object opts Fetch options
  7322. * @return Promise
  7323. */
  7324. function fetch(url, opts) {
  7325. // allow custom promise
  7326. if (!fetch.Promise) {
  7327. throw new Error('native promise missing, set fetch.Promise to your favorite alternative');
  7328. }
  7329. Body.Promise = fetch.Promise;
  7330. // wrap http.request into fetch
  7331. return new fetch.Promise(function (resolve, reject) {
  7332. // build request object
  7333. const request = new Request(url, opts);
  7334. const options = getNodeRequestOptions(request);
  7335. const send = (options.protocol === 'https:' ? https : http).request;
  7336. const signal = request.signal;
  7337. let response = null;
  7338. const abort = function abort() {
  7339. let error = new AbortError('The user aborted a request.');
  7340. reject(error);
  7341. if (request.body && request.body instanceof Stream.Readable) {
  7342. request.body.destroy(error);
  7343. }
  7344. if (!response || !response.body) return;
  7345. response.body.emit('error', error);
  7346. };
  7347. if (signal && signal.aborted) {
  7348. abort();
  7349. return;
  7350. }
  7351. const abortAndFinalize = function abortAndFinalize() {
  7352. abort();
  7353. finalize();
  7354. };
  7355. // send request
  7356. const req = send(options);
  7357. let reqTimeout;
  7358. if (signal) {
  7359. signal.addEventListener('abort', abortAndFinalize);
  7360. }
  7361. function finalize() {
  7362. req.abort();
  7363. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7364. clearTimeout(reqTimeout);
  7365. }
  7366. if (request.timeout) {
  7367. req.once('socket', function (socket) {
  7368. reqTimeout = setTimeout(function () {
  7369. reject(new FetchError(`network timeout at: ${request.url}`, 'request-timeout'));
  7370. finalize();
  7371. }, request.timeout);
  7372. });
  7373. }
  7374. req.on('error', function (err) {
  7375. reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
  7376. finalize();
  7377. });
  7378. req.on('response', function (res) {
  7379. clearTimeout(reqTimeout);
  7380. const headers = createHeadersLenient(res.headers);
  7381. // HTTP fetch step 5
  7382. if (fetch.isRedirect(res.statusCode)) {
  7383. // HTTP fetch step 5.2
  7384. const location = headers.get('Location');
  7385. // HTTP fetch step 5.3
  7386. const locationURL = location === null ? null : resolve_url(request.url, location);
  7387. // HTTP fetch step 5.5
  7388. switch (request.redirect) {
  7389. case 'error':
  7390. reject(new FetchError(`redirect mode is set to error: ${request.url}`, 'no-redirect'));
  7391. finalize();
  7392. return;
  7393. case 'manual':
  7394. // node-fetch-specific step: make manual redirect a bit easier to use by setting the Location header value to the resolved URL.
  7395. if (locationURL !== null) {
  7396. // handle corrupted header
  7397. try {
  7398. headers.set('Location', locationURL);
  7399. } catch (err) {
  7400. // istanbul ignore next: nodejs server prevent invalid response headers, we can't test this through normal request
  7401. reject(err);
  7402. }
  7403. }
  7404. break;
  7405. case 'follow':
  7406. // HTTP-redirect fetch step 2
  7407. if (locationURL === null) {
  7408. break;
  7409. }
  7410. // HTTP-redirect fetch step 5
  7411. if (request.counter >= request.follow) {
  7412. reject(new FetchError(`maximum redirect reached at: ${request.url}`, 'max-redirect'));
  7413. finalize();
  7414. return;
  7415. }
  7416. // HTTP-redirect fetch step 6 (counter increment)
  7417. // Create a new Request object.
  7418. const requestOpts = {
  7419. headers: new Headers(request.headers),
  7420. follow: request.follow,
  7421. counter: request.counter + 1,
  7422. agent: request.agent,
  7423. compress: request.compress,
  7424. method: request.method,
  7425. body: request.body,
  7426. signal: request.signal,
  7427. timeout: request.timeout
  7428. };
  7429. // HTTP-redirect fetch step 9
  7430. if (res.statusCode !== 303 && request.body && getTotalBytes(request) === null) {
  7431. reject(new FetchError('Cannot follow redirect with body being a readable stream', 'unsupported-redirect'));
  7432. finalize();
  7433. return;
  7434. }
  7435. // HTTP-redirect fetch step 11
  7436. if (res.statusCode === 303 || (res.statusCode === 301 || res.statusCode === 302) && request.method === 'POST') {
  7437. requestOpts.method = 'GET';
  7438. requestOpts.body = undefined;
  7439. requestOpts.headers.delete('content-length');
  7440. }
  7441. // HTTP-redirect fetch step 15
  7442. resolve(fetch(new Request(locationURL, requestOpts)));
  7443. finalize();
  7444. return;
  7445. }
  7446. }
  7447. // prepare response
  7448. res.once('end', function () {
  7449. if (signal) signal.removeEventListener('abort', abortAndFinalize);
  7450. });
  7451. let body = res.pipe(new PassThrough$1());
  7452. const response_options = {
  7453. url: request.url,
  7454. status: res.statusCode,
  7455. statusText: res.statusMessage,
  7456. headers: headers,
  7457. size: request.size,
  7458. timeout: request.timeout,
  7459. counter: request.counter
  7460. };
  7461. // HTTP-network fetch step 12.1.1.3
  7462. const codings = headers.get('Content-Encoding');
  7463. // HTTP-network fetch step 12.1.1.4: handle content codings
  7464. // in following scenarios we ignore compression support
  7465. // 1. compression support is disabled
  7466. // 2. HEAD request
  7467. // 3. no Content-Encoding header
  7468. // 4. no content response (204)
  7469. // 5. content not modified response (304)
  7470. if (!request.compress || request.method === 'HEAD' || codings === null || res.statusCode === 204 || res.statusCode === 304) {
  7471. response = new Response(body, response_options);
  7472. resolve(response);
  7473. return;
  7474. }
  7475. // For Node v6+
  7476. // Be less strict when decoding compressed responses, since sometimes
  7477. // servers send slightly invalid responses that are still accepted
  7478. // by common browsers.
  7479. // Always using Z_SYNC_FLUSH is what cURL does.
  7480. const zlibOptions = {
  7481. flush: zlib.Z_SYNC_FLUSH,
  7482. finishFlush: zlib.Z_SYNC_FLUSH
  7483. };
  7484. // for gzip
  7485. if (codings == 'gzip' || codings == 'x-gzip') {
  7486. body = body.pipe(zlib.createGunzip(zlibOptions));
  7487. response = new Response(body, response_options);
  7488. resolve(response);
  7489. return;
  7490. }
  7491. // for deflate
  7492. if (codings == 'deflate' || codings == 'x-deflate') {
  7493. // handle the infamous raw deflate response from old servers
  7494. // a hack for old IIS and Apache servers
  7495. const raw = res.pipe(new PassThrough$1());
  7496. raw.once('data', function (chunk) {
  7497. // see http://stackoverflow.com/questions/37519828
  7498. if ((chunk[0] & 0x0F) === 0x08) {
  7499. body = body.pipe(zlib.createInflate());
  7500. } else {
  7501. body = body.pipe(zlib.createInflateRaw());
  7502. }
  7503. response = new Response(body, response_options);
  7504. resolve(response);
  7505. });
  7506. return;
  7507. }
  7508. // for br
  7509. if (codings == 'br' && typeof zlib.createBrotliDecompress === 'function') {
  7510. body = body.pipe(zlib.createBrotliDecompress());
  7511. response = new Response(body, response_options);
  7512. resolve(response);
  7513. return;
  7514. }
  7515. // otherwise, use response as-is
  7516. response = new Response(body, response_options);
  7517. resolve(response);
  7518. });
  7519. writeToStream(req, request);
  7520. });
  7521. }
  7522. /**
  7523. * Redirect code matching
  7524. *
  7525. * @param Number code Status code
  7526. * @return Boolean
  7527. */
  7528. fetch.isRedirect = function (code) {
  7529. return code === 301 || code === 302 || code === 303 || code === 307 || code === 308;
  7530. };
  7531. // expose Promise
  7532. fetch.Promise = global.Promise;
  7533. module.exports = exports = fetch;
  7534. Object.defineProperty(exports, "__esModule", { value: true });
  7535. exports.default = exports;
  7536. exports.Headers = Headers;
  7537. exports.Request = Request;
  7538. exports.Response = Response;
  7539. exports.FetchError = FetchError;
  7540. /***/ }),
  7541. /***/ 462:
  7542. /***/ (function(module) {
  7543. "use strict";
  7544. // See http://www.robvanderwoude.com/escapechars.php
  7545. const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
  7546. function escapeCommand(arg) {
  7547. // Escape meta chars
  7548. arg = arg.replace(metaCharsRegExp, '^$1');
  7549. return arg;
  7550. }
  7551. function escapeArgument(arg, doubleEscapeMetaChars) {
  7552. // Convert to string
  7553. arg = `${arg}`;
  7554. // Algorithm below is based on https://qntm.org/cmd
  7555. // Sequence of backslashes followed by a double quote:
  7556. // double up all the backslashes and escape the double quote
  7557. arg = arg.replace(/(\\*)"/g, '$1$1\\"');
  7558. // Sequence of backslashes followed by the end of the string
  7559. // (which will become a double quote later):
  7560. // double up all the backslashes
  7561. arg = arg.replace(/(\\*)$/, '$1$1');
  7562. // All other backslashes occur literally
  7563. // Quote the whole thing:
  7564. arg = `"${arg}"`;
  7565. // Escape meta chars
  7566. arg = arg.replace(metaCharsRegExp, '^$1');
  7567. // Double escape meta chars if necessary
  7568. if (doubleEscapeMetaChars) {
  7569. arg = arg.replace(metaCharsRegExp, '^$1');
  7570. }
  7571. return arg;
  7572. }
  7573. module.exports.command = escapeCommand;
  7574. module.exports.argument = escapeArgument;
  7575. /***/ }),
  7576. /***/ 463:
  7577. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7578. "use strict";
  7579. Object.defineProperty(exports, '__esModule', { value: true });
  7580. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  7581. var deprecation = __webpack_require__(692);
  7582. var once = _interopDefault(__webpack_require__(969));
  7583. const logOnce = once(deprecation => console.warn(deprecation));
  7584. /**
  7585. * Error with extra properties to help with debugging
  7586. */
  7587. class RequestError extends Error {
  7588. constructor(message, statusCode, options) {
  7589. super(message); // Maintains proper stack trace (only available on V8)
  7590. /* istanbul ignore next */
  7591. if (Error.captureStackTrace) {
  7592. Error.captureStackTrace(this, this.constructor);
  7593. }
  7594. this.name = "HttpError";
  7595. this.status = statusCode;
  7596. Object.defineProperty(this, "code", {
  7597. get() {
  7598. logOnce(new deprecation.Deprecation("[@octokit/request-error] `error.code` is deprecated, use `error.status`."));
  7599. return statusCode;
  7600. }
  7601. });
  7602. this.headers = options.headers || {}; // redact request credentials without mutating original request options
  7603. const requestCopy = Object.assign({}, options.request);
  7604. if (options.request.headers.authorization) {
  7605. requestCopy.headers = Object.assign({}, options.request.headers, {
  7606. authorization: options.request.headers.authorization.replace(/ .*$/, " [REDACTED]")
  7607. });
  7608. }
  7609. requestCopy.url = requestCopy.url // client_id & client_secret can be passed as URL query parameters to increase rate limit
  7610. // see https://developer.github.com/v3/#increasing-the-unauthenticated-rate-limit-for-oauth-applications
  7611. .replace(/\bclient_secret=\w+/g, "client_secret=[REDACTED]") // OAuth tokens can be passed as URL query parameters, although it is not recommended
  7612. // see https://developer.github.com/v3/#oauth2-token-sent-in-a-header
  7613. .replace(/\baccess_token=\w+/g, "access_token=[REDACTED]");
  7614. this.request = requestCopy;
  7615. }
  7616. }
  7617. exports.RequestError = RequestError;
  7618. //# sourceMappingURL=index.js.map
  7619. /***/ }),
  7620. /***/ 464:
  7621. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7622. "use strict";
  7623. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7624. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7625. return new (P || (P = Promise))(function (resolve, reject) {
  7626. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7627. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7628. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7629. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7630. });
  7631. };
  7632. var __importStar = (this && this.__importStar) || function (mod) {
  7633. if (mod && mod.__esModule) return mod;
  7634. var result = {};
  7635. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7636. result["default"] = mod;
  7637. return result;
  7638. };
  7639. var __importDefault = (this && this.__importDefault) || function (mod) {
  7640. return (mod && mod.__esModule) ? mod : { "default": mod };
  7641. };
  7642. Object.defineProperty(exports, "__esModule", { value: true });
  7643. const assert = __importStar(__webpack_require__(357));
  7644. const core = __importStar(__webpack_require__(470));
  7645. const fs = __importStar(__webpack_require__(747));
  7646. const github = __importStar(__webpack_require__(469));
  7647. const io = __importStar(__webpack_require__(1));
  7648. const path = __importStar(__webpack_require__(622));
  7649. const retryHelper = __importStar(__webpack_require__(587));
  7650. const toolCache = __importStar(__webpack_require__(533));
  7651. const v4_1 = __importDefault(__webpack_require__(826));
  7652. const IS_WINDOWS = process.platform === 'win32';
  7653. function downloadRepository(authToken, owner, repo, ref, commit, repositoryPath) {
  7654. return __awaiter(this, void 0, void 0, function* () {
  7655. // Download the archive
  7656. let archiveData = yield retryHelper.execute(() => __awaiter(this, void 0, void 0, function* () {
  7657. core.info('Downloading the archive');
  7658. return yield downloadArchive(authToken, owner, repo, ref, commit);
  7659. }));
  7660. // Write archive to disk
  7661. core.info('Writing archive to disk');
  7662. const uniqueId = v4_1.default();
  7663. const archivePath = path.join(repositoryPath, `${uniqueId}.tar.gz`);
  7664. yield fs.promises.writeFile(archivePath, archiveData);
  7665. archiveData = Buffer.from(''); // Free memory
  7666. // Extract archive
  7667. core.info('Extracting the archive');
  7668. const extractPath = path.join(repositoryPath, uniqueId);
  7669. yield io.mkdirP(extractPath);
  7670. if (IS_WINDOWS) {
  7671. yield toolCache.extractZip(archivePath, extractPath);
  7672. }
  7673. else {
  7674. yield toolCache.extractTar(archivePath, extractPath);
  7675. }
  7676. io.rmRF(archivePath);
  7677. // Determine the path of the repository content. The archive contains
  7678. // a top-level folder and the repository content is inside.
  7679. const archiveFileNames = yield fs.promises.readdir(extractPath);
  7680. assert.ok(archiveFileNames.length == 1, 'Expected exactly one directory inside archive');
  7681. const archiveVersion = archiveFileNames[0]; // The top-level folder name includes the short SHA
  7682. core.info(`Resolved version ${archiveVersion}`);
  7683. const tempRepositoryPath = path.join(extractPath, archiveVersion);
  7684. // Move the files
  7685. for (const fileName of yield fs.promises.readdir(tempRepositoryPath)) {
  7686. const sourcePath = path.join(tempRepositoryPath, fileName);
  7687. const targetPath = path.join(repositoryPath, fileName);
  7688. if (IS_WINDOWS) {
  7689. yield io.cp(sourcePath, targetPath, { recursive: true }); // Copy on Windows (Windows Defender may have a lock)
  7690. }
  7691. else {
  7692. yield io.mv(sourcePath, targetPath);
  7693. }
  7694. }
  7695. io.rmRF(extractPath);
  7696. });
  7697. }
  7698. exports.downloadRepository = downloadRepository;
  7699. function downloadArchive(authToken, owner, repo, ref, commit) {
  7700. return __awaiter(this, void 0, void 0, function* () {
  7701. const octokit = new github.GitHub(authToken);
  7702. const params = {
  7703. owner: owner,
  7704. repo: repo,
  7705. archive_format: IS_WINDOWS ? 'zipball' : 'tarball',
  7706. ref: commit || ref
  7707. };
  7708. const response = yield octokit.repos.getArchiveLink(params);
  7709. if (response.status != 200) {
  7710. throw new Error(`Unexpected response from GitHub API. Status: ${response.status}, Data: ${response.data}`);
  7711. }
  7712. return Buffer.from(response.data); // response.data is ArrayBuffer
  7713. });
  7714. }
  7715. /***/ }),
  7716. /***/ 469:
  7717. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7718. "use strict";
  7719. var __importDefault = (this && this.__importDefault) || function (mod) {
  7720. return (mod && mod.__esModule) ? mod : { "default": mod };
  7721. };
  7722. var __importStar = (this && this.__importStar) || function (mod) {
  7723. if (mod && mod.__esModule) return mod;
  7724. var result = {};
  7725. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  7726. result["default"] = mod;
  7727. return result;
  7728. };
  7729. Object.defineProperty(exports, "__esModule", { value: true });
  7730. // Originally pulled from https://github.com/JasonEtco/actions-toolkit/blob/master/src/github.ts
  7731. const graphql_1 = __webpack_require__(898);
  7732. const rest_1 = __importDefault(__webpack_require__(0));
  7733. const Context = __importStar(__webpack_require__(262));
  7734. const httpClient = __importStar(__webpack_require__(539));
  7735. // We need this in order to extend Octokit
  7736. rest_1.default.prototype = new rest_1.default();
  7737. exports.context = new Context.Context();
  7738. class GitHub extends rest_1.default {
  7739. constructor(token, opts) {
  7740. super(GitHub.getOctokitOptions(GitHub.disambiguate(token, opts)));
  7741. this.graphql = GitHub.getGraphQL(GitHub.disambiguate(token, opts));
  7742. }
  7743. /**
  7744. * Disambiguates the constructor overload parameters
  7745. */
  7746. static disambiguate(token, opts) {
  7747. return [
  7748. typeof token === 'string' ? token : '',
  7749. typeof token === 'object' ? token : opts || {}
  7750. ];
  7751. }
  7752. static getOctokitOptions(args) {
  7753. const token = args[0];
  7754. const options = Object.assign({}, args[1]); // Shallow clone - don't mutate the object provided by the caller
  7755. // Auth
  7756. const auth = GitHub.getAuthString(token, options);
  7757. if (auth) {
  7758. options.auth = auth;
  7759. }
  7760. // Proxy
  7761. const agent = GitHub.getProxyAgent(options);
  7762. if (agent) {
  7763. // Shallow clone - don't mutate the object provided by the caller
  7764. options.request = options.request ? Object.assign({}, options.request) : {};
  7765. // Set the agent
  7766. options.request.agent = agent;
  7767. }
  7768. return options;
  7769. }
  7770. static getGraphQL(args) {
  7771. const defaults = {};
  7772. const token = args[0];
  7773. const options = args[1];
  7774. // Authorization
  7775. const auth = this.getAuthString(token, options);
  7776. if (auth) {
  7777. defaults.headers = {
  7778. authorization: auth
  7779. };
  7780. }
  7781. // Proxy
  7782. const agent = GitHub.getProxyAgent(options);
  7783. if (agent) {
  7784. defaults.request = { agent };
  7785. }
  7786. return graphql_1.graphql.defaults(defaults);
  7787. }
  7788. static getAuthString(token, options) {
  7789. // Validate args
  7790. if (!token && !options.auth) {
  7791. throw new Error('Parameter token or opts.auth is required');
  7792. }
  7793. else if (token && options.auth) {
  7794. throw new Error('Parameters token and opts.auth may not both be specified');
  7795. }
  7796. return typeof options.auth === 'string' ? options.auth : `token ${token}`;
  7797. }
  7798. static getProxyAgent(options) {
  7799. var _a;
  7800. if (!((_a = options.request) === null || _a === void 0 ? void 0 : _a.agent)) {
  7801. const serverUrl = 'https://api.github.com';
  7802. if (httpClient.getProxyUrl(serverUrl)) {
  7803. const hc = new httpClient.HttpClient();
  7804. return hc.getAgent(serverUrl);
  7805. }
  7806. }
  7807. return undefined;
  7808. }
  7809. }
  7810. exports.GitHub = GitHub;
  7811. //# sourceMappingURL=github.js.map
  7812. /***/ }),
  7813. /***/ 470:
  7814. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  7815. "use strict";
  7816. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  7817. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  7818. return new (P || (P = Promise))(function (resolve, reject) {
  7819. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  7820. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  7821. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  7822. step((generator = generator.apply(thisArg, _arguments || [])).next());
  7823. });
  7824. };
  7825. Object.defineProperty(exports, "__esModule", { value: true });
  7826. const command_1 = __webpack_require__(431);
  7827. const os = __webpack_require__(87);
  7828. const path = __webpack_require__(622);
  7829. /**
  7830. * The code to exit an action
  7831. */
  7832. var ExitCode;
  7833. (function (ExitCode) {
  7834. /**
  7835. * A code indicating that the action was successful
  7836. */
  7837. ExitCode[ExitCode["Success"] = 0] = "Success";
  7838. /**
  7839. * A code indicating that the action was a failure
  7840. */
  7841. ExitCode[ExitCode["Failure"] = 1] = "Failure";
  7842. })(ExitCode = exports.ExitCode || (exports.ExitCode = {}));
  7843. //-----------------------------------------------------------------------
  7844. // Variables
  7845. //-----------------------------------------------------------------------
  7846. /**
  7847. * Sets env variable for this action and future actions in the job
  7848. * @param name the name of the variable to set
  7849. * @param val the value of the variable
  7850. */
  7851. function exportVariable(name, val) {
  7852. process.env[name] = val;
  7853. command_1.issueCommand('set-env', { name }, val);
  7854. }
  7855. exports.exportVariable = exportVariable;
  7856. /**
  7857. * Registers a secret which will get masked from logs
  7858. * @param secret value of the secret
  7859. */
  7860. function setSecret(secret) {
  7861. command_1.issueCommand('add-mask', {}, secret);
  7862. }
  7863. exports.setSecret = setSecret;
  7864. /**
  7865. * Prepends inputPath to the PATH (for this action and future actions)
  7866. * @param inputPath
  7867. */
  7868. function addPath(inputPath) {
  7869. command_1.issueCommand('add-path', {}, inputPath);
  7870. process.env['PATH'] = `${inputPath}${path.delimiter}${process.env['PATH']}`;
  7871. }
  7872. exports.addPath = addPath;
  7873. /**
  7874. * Gets the value of an input. The value is also trimmed.
  7875. *
  7876. * @param name name of the input to get
  7877. * @param options optional. See InputOptions.
  7878. * @returns string
  7879. */
  7880. function getInput(name, options) {
  7881. const val = process.env[`INPUT_${name.replace(/ /g, '_').toUpperCase()}`] || '';
  7882. if (options && options.required && !val) {
  7883. throw new Error(`Input required and not supplied: ${name}`);
  7884. }
  7885. return val.trim();
  7886. }
  7887. exports.getInput = getInput;
  7888. /**
  7889. * Sets the value of an output.
  7890. *
  7891. * @param name name of the output to set
  7892. * @param value value to store
  7893. */
  7894. function setOutput(name, value) {
  7895. command_1.issueCommand('set-output', { name }, value);
  7896. }
  7897. exports.setOutput = setOutput;
  7898. //-----------------------------------------------------------------------
  7899. // Results
  7900. //-----------------------------------------------------------------------
  7901. /**
  7902. * Sets the action status to failed.
  7903. * When the action exits it will be with an exit code of 1
  7904. * @param message add error issue message
  7905. */
  7906. function setFailed(message) {
  7907. process.exitCode = ExitCode.Failure;
  7908. error(message);
  7909. }
  7910. exports.setFailed = setFailed;
  7911. //-----------------------------------------------------------------------
  7912. // Logging Commands
  7913. //-----------------------------------------------------------------------
  7914. /**
  7915. * Writes debug message to user log
  7916. * @param message debug message
  7917. */
  7918. function debug(message) {
  7919. command_1.issueCommand('debug', {}, message);
  7920. }
  7921. exports.debug = debug;
  7922. /**
  7923. * Adds an error issue
  7924. * @param message error issue message
  7925. */
  7926. function error(message) {
  7927. command_1.issue('error', message);
  7928. }
  7929. exports.error = error;
  7930. /**
  7931. * Adds an warning issue
  7932. * @param message warning issue message
  7933. */
  7934. function warning(message) {
  7935. command_1.issue('warning', message);
  7936. }
  7937. exports.warning = warning;
  7938. /**
  7939. * Writes info to log with console.log.
  7940. * @param message info message
  7941. */
  7942. function info(message) {
  7943. process.stdout.write(message + os.EOL);
  7944. }
  7945. exports.info = info;
  7946. /**
  7947. * Begin an output group.
  7948. *
  7949. * Output until the next `groupEnd` will be foldable in this group
  7950. *
  7951. * @param name The name of the output group
  7952. */
  7953. function startGroup(name) {
  7954. command_1.issue('group', name);
  7955. }
  7956. exports.startGroup = startGroup;
  7957. /**
  7958. * End an output group.
  7959. */
  7960. function endGroup() {
  7961. command_1.issue('endgroup');
  7962. }
  7963. exports.endGroup = endGroup;
  7964. /**
  7965. * Wrap an asynchronous function call in a group.
  7966. *
  7967. * Returns the same type as the function itself.
  7968. *
  7969. * @param name The name of the group
  7970. * @param fn The function to wrap in the group
  7971. */
  7972. function group(name, fn) {
  7973. return __awaiter(this, void 0, void 0, function* () {
  7974. startGroup(name);
  7975. let result;
  7976. try {
  7977. result = yield fn();
  7978. }
  7979. finally {
  7980. endGroup();
  7981. }
  7982. return result;
  7983. });
  7984. }
  7985. exports.group = group;
  7986. //# sourceMappingURL=core.js.map
  7987. /***/ }),
  7988. /***/ 471:
  7989. /***/ (function(module, __unusedexports, __webpack_require__) {
  7990. module.exports = authenticationBeforeRequest;
  7991. const btoa = __webpack_require__(675);
  7992. const uniq = __webpack_require__(126);
  7993. function authenticationBeforeRequest(state, options) {
  7994. if (!state.auth.type) {
  7995. return;
  7996. }
  7997. if (state.auth.type === "basic") {
  7998. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  7999. options.headers.authorization = `Basic ${hash}`;
  8000. return;
  8001. }
  8002. if (state.auth.type === "token") {
  8003. options.headers.authorization = `token ${state.auth.token}`;
  8004. return;
  8005. }
  8006. if (state.auth.type === "app") {
  8007. options.headers.authorization = `Bearer ${state.auth.token}`;
  8008. const acceptHeaders = options.headers.accept
  8009. .split(",")
  8010. .concat("application/vnd.github.machine-man-preview+json");
  8011. options.headers.accept = uniq(acceptHeaders)
  8012. .filter(Boolean)
  8013. .join(",");
  8014. return;
  8015. }
  8016. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  8017. if (state.auth.token) {
  8018. options.url += `access_token=${encodeURIComponent(state.auth.token)}`;
  8019. return;
  8020. }
  8021. const key = encodeURIComponent(state.auth.key);
  8022. const secret = encodeURIComponent(state.auth.secret);
  8023. options.url += `client_id=${key}&client_secret=${secret}`;
  8024. }
  8025. /***/ }),
  8026. /***/ 489:
  8027. /***/ (function(module, __unusedexports, __webpack_require__) {
  8028. "use strict";
  8029. const path = __webpack_require__(622);
  8030. const which = __webpack_require__(814);
  8031. const pathKey = __webpack_require__(39)();
  8032. function resolveCommandAttempt(parsed, withoutPathExt) {
  8033. const cwd = process.cwd();
  8034. const hasCustomCwd = parsed.options.cwd != null;
  8035. // If a custom `cwd` was specified, we need to change the process cwd
  8036. // because `which` will do stat calls but does not support a custom cwd
  8037. if (hasCustomCwd) {
  8038. try {
  8039. process.chdir(parsed.options.cwd);
  8040. } catch (err) {
  8041. /* Empty */
  8042. }
  8043. }
  8044. let resolved;
  8045. try {
  8046. resolved = which.sync(parsed.command, {
  8047. path: (parsed.options.env || process.env)[pathKey],
  8048. pathExt: withoutPathExt ? path.delimiter : undefined,
  8049. });
  8050. } catch (e) {
  8051. /* Empty */
  8052. } finally {
  8053. process.chdir(cwd);
  8054. }
  8055. // If we successfully resolved, ensure that an absolute path is returned
  8056. // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
  8057. if (resolved) {
  8058. resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
  8059. }
  8060. return resolved;
  8061. }
  8062. function resolveCommand(parsed) {
  8063. return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
  8064. }
  8065. module.exports = resolveCommand;
  8066. /***/ }),
  8067. /***/ 510:
  8068. /***/ (function(module) {
  8069. module.exports = addHook
  8070. function addHook (state, kind, name, hook) {
  8071. var orig = hook
  8072. if (!state.registry[name]) {
  8073. state.registry[name] = []
  8074. }
  8075. if (kind === 'before') {
  8076. hook = function (method, options) {
  8077. return Promise.resolve()
  8078. .then(orig.bind(null, options))
  8079. .then(method.bind(null, options))
  8080. }
  8081. }
  8082. if (kind === 'after') {
  8083. hook = function (method, options) {
  8084. var result
  8085. return Promise.resolve()
  8086. .then(method.bind(null, options))
  8087. .then(function (result_) {
  8088. result = result_
  8089. return orig(result, options)
  8090. })
  8091. .then(function () {
  8092. return result
  8093. })
  8094. }
  8095. }
  8096. if (kind === 'error') {
  8097. hook = function (method, options) {
  8098. return Promise.resolve()
  8099. .then(method.bind(null, options))
  8100. .catch(function (error) {
  8101. return orig(error, options)
  8102. })
  8103. }
  8104. }
  8105. state.registry[name].push({
  8106. hook: hook,
  8107. orig: orig
  8108. })
  8109. }
  8110. /***/ }),
  8111. /***/ 523:
  8112. /***/ (function(module, __unusedexports, __webpack_require__) {
  8113. var register = __webpack_require__(363)
  8114. var addHook = __webpack_require__(510)
  8115. var removeHook = __webpack_require__(763)
  8116. // bind with array of arguments: https://stackoverflow.com/a/21792913
  8117. var bind = Function.bind
  8118. var bindable = bind.bind(bind)
  8119. function bindApi (hook, state, name) {
  8120. var removeHookRef = bindable(removeHook, null).apply(null, name ? [state, name] : [state])
  8121. hook.api = { remove: removeHookRef }
  8122. hook.remove = removeHookRef
  8123. ;['before', 'error', 'after', 'wrap'].forEach(function (kind) {
  8124. var args = name ? [state, kind, name] : [state, kind]
  8125. hook[kind] = hook.api[kind] = bindable(addHook, null).apply(null, args)
  8126. })
  8127. }
  8128. function HookSingular () {
  8129. var singularHookName = 'h'
  8130. var singularHookState = {
  8131. registry: {}
  8132. }
  8133. var singularHook = register.bind(null, singularHookState, singularHookName)
  8134. bindApi(singularHook, singularHookState, singularHookName)
  8135. return singularHook
  8136. }
  8137. function HookCollection () {
  8138. var state = {
  8139. registry: {}
  8140. }
  8141. var hook = register.bind(null, state)
  8142. bindApi(hook, state)
  8143. return hook
  8144. }
  8145. var collectionHookDeprecationMessageDisplayed = false
  8146. function Hook () {
  8147. if (!collectionHookDeprecationMessageDisplayed) {
  8148. console.warn('[before-after-hook]: "Hook()" repurposing warning, use "Hook.Collection()". Read more: https://git.io/upgrade-before-after-hook-to-1.4')
  8149. collectionHookDeprecationMessageDisplayed = true
  8150. }
  8151. return HookCollection()
  8152. }
  8153. Hook.Singular = HookSingular.bind()
  8154. Hook.Collection = HookCollection.bind()
  8155. module.exports = Hook
  8156. // expose constructors as a named property for TypeScript
  8157. module.exports.Hook = Hook
  8158. module.exports.Singular = Hook.Singular
  8159. module.exports.Collection = Hook.Collection
  8160. /***/ }),
  8161. /***/ 529:
  8162. /***/ (function(module, __unusedexports, __webpack_require__) {
  8163. const factory = __webpack_require__(47);
  8164. module.exports = factory();
  8165. /***/ }),
  8166. /***/ 533:
  8167. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8168. "use strict";
  8169. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  8170. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  8171. return new (P || (P = Promise))(function (resolve, reject) {
  8172. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  8173. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  8174. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  8175. step((generator = generator.apply(thisArg, _arguments || [])).next());
  8176. });
  8177. };
  8178. Object.defineProperty(exports, "__esModule", { value: true });
  8179. const core = __webpack_require__(470);
  8180. const io = __webpack_require__(1);
  8181. const fs = __webpack_require__(747);
  8182. const os = __webpack_require__(87);
  8183. const path = __webpack_require__(622);
  8184. const httpm = __webpack_require__(874);
  8185. const semver = __webpack_require__(656);
  8186. const uuidV4 = __webpack_require__(826);
  8187. const exec_1 = __webpack_require__(986);
  8188. const assert_1 = __webpack_require__(357);
  8189. class HTTPError extends Error {
  8190. constructor(httpStatusCode) {
  8191. super(`Unexpected HTTP response: ${httpStatusCode}`);
  8192. this.httpStatusCode = httpStatusCode;
  8193. Object.setPrototypeOf(this, new.target.prototype);
  8194. }
  8195. }
  8196. exports.HTTPError = HTTPError;
  8197. const IS_WINDOWS = process.platform === 'win32';
  8198. const userAgent = 'actions/tool-cache';
  8199. // On load grab temp directory and cache directory and remove them from env (currently don't want to expose this)
  8200. let tempDirectory = process.env['RUNNER_TEMP'] || '';
  8201. let cacheRoot = process.env['RUNNER_TOOL_CACHE'] || '';
  8202. // If directories not found, place them in common temp locations
  8203. if (!tempDirectory || !cacheRoot) {
  8204. let baseLocation;
  8205. if (IS_WINDOWS) {
  8206. // On windows use the USERPROFILE env variable
  8207. baseLocation = process.env['USERPROFILE'] || 'C:\\';
  8208. }
  8209. else {
  8210. if (process.platform === 'darwin') {
  8211. baseLocation = '/Users';
  8212. }
  8213. else {
  8214. baseLocation = '/home';
  8215. }
  8216. }
  8217. if (!tempDirectory) {
  8218. tempDirectory = path.join(baseLocation, 'actions', 'temp');
  8219. }
  8220. if (!cacheRoot) {
  8221. cacheRoot = path.join(baseLocation, 'actions', 'cache');
  8222. }
  8223. }
  8224. /**
  8225. * Download a tool from an url and stream it into a file
  8226. *
  8227. * @param url url of tool to download
  8228. * @returns path to downloaded tool
  8229. */
  8230. function downloadTool(url) {
  8231. return __awaiter(this, void 0, void 0, function* () {
  8232. // Wrap in a promise so that we can resolve from within stream callbacks
  8233. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  8234. try {
  8235. const http = new httpm.HttpClient(userAgent, [], {
  8236. allowRetries: true,
  8237. maxRetries: 3
  8238. });
  8239. const destPath = path.join(tempDirectory, uuidV4());
  8240. yield io.mkdirP(tempDirectory);
  8241. core.debug(`Downloading ${url}`);
  8242. core.debug(`Downloading ${destPath}`);
  8243. if (fs.existsSync(destPath)) {
  8244. throw new Error(`Destination file path ${destPath} already exists`);
  8245. }
  8246. const response = yield http.get(url);
  8247. if (response.message.statusCode !== 200) {
  8248. const err = new HTTPError(response.message.statusCode);
  8249. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8250. throw err;
  8251. }
  8252. const file = fs.createWriteStream(destPath);
  8253. file.on('open', () => __awaiter(this, void 0, void 0, function* () {
  8254. try {
  8255. const stream = response.message.pipe(file);
  8256. stream.on('close', () => {
  8257. core.debug('download complete');
  8258. resolve(destPath);
  8259. });
  8260. }
  8261. catch (err) {
  8262. core.debug(`Failed to download from "${url}". Code(${response.message.statusCode}) Message(${response.message.statusMessage})`);
  8263. reject(err);
  8264. }
  8265. }));
  8266. file.on('error', err => {
  8267. file.end();
  8268. reject(err);
  8269. });
  8270. }
  8271. catch (err) {
  8272. reject(err);
  8273. }
  8274. }));
  8275. });
  8276. }
  8277. exports.downloadTool = downloadTool;
  8278. /**
  8279. * Extract a .7z file
  8280. *
  8281. * @param file path to the .7z file
  8282. * @param dest destination directory. Optional.
  8283. * @param _7zPath path to 7zr.exe. Optional, for long path support. Most .7z archives do not have this
  8284. * problem. If your .7z archive contains very long paths, you can pass the path to 7zr.exe which will
  8285. * gracefully handle long paths. By default 7zdec.exe is used because it is a very small program and is
  8286. * bundled with the tool lib. However it does not support long paths. 7zr.exe is the reduced command line
  8287. * interface, it is smaller than the full command line interface, and it does support long paths. At the
  8288. * time of this writing, it is freely available from the LZMA SDK that is available on the 7zip website.
  8289. * Be sure to check the current license agreement. If 7zr.exe is bundled with your action, then the path
  8290. * to 7zr.exe can be pass to this function.
  8291. * @returns path to the destination directory
  8292. */
  8293. function extract7z(file, dest, _7zPath) {
  8294. return __awaiter(this, void 0, void 0, function* () {
  8295. assert_1.ok(IS_WINDOWS, 'extract7z() not supported on current OS');
  8296. assert_1.ok(file, 'parameter "file" is required');
  8297. dest = dest || (yield _createExtractFolder(dest));
  8298. const originalCwd = process.cwd();
  8299. process.chdir(dest);
  8300. if (_7zPath) {
  8301. try {
  8302. const args = [
  8303. 'x',
  8304. '-bb1',
  8305. '-bd',
  8306. '-sccUTF-8',
  8307. file
  8308. ];
  8309. const options = {
  8310. silent: true
  8311. };
  8312. yield exec_1.exec(`"${_7zPath}"`, args, options);
  8313. }
  8314. finally {
  8315. process.chdir(originalCwd);
  8316. }
  8317. }
  8318. else {
  8319. const escapedScript = path
  8320. .join(__dirname, '..', 'scripts', 'Invoke-7zdec.ps1')
  8321. .replace(/'/g, "''")
  8322. .replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8323. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8324. const escapedTarget = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8325. const command = `& '${escapedScript}' -Source '${escapedFile}' -Target '${escapedTarget}'`;
  8326. const args = [
  8327. '-NoLogo',
  8328. '-Sta',
  8329. '-NoProfile',
  8330. '-NonInteractive',
  8331. '-ExecutionPolicy',
  8332. 'Unrestricted',
  8333. '-Command',
  8334. command
  8335. ];
  8336. const options = {
  8337. silent: true
  8338. };
  8339. try {
  8340. const powershellPath = yield io.which('powershell', true);
  8341. yield exec_1.exec(`"${powershellPath}"`, args, options);
  8342. }
  8343. finally {
  8344. process.chdir(originalCwd);
  8345. }
  8346. }
  8347. return dest;
  8348. });
  8349. }
  8350. exports.extract7z = extract7z;
  8351. /**
  8352. * Extract a tar
  8353. *
  8354. * @param file path to the tar
  8355. * @param dest destination directory. Optional.
  8356. * @param flags flags for the tar. Optional.
  8357. * @returns path to the destination directory
  8358. */
  8359. function extractTar(file, dest, flags = 'xz') {
  8360. return __awaiter(this, void 0, void 0, function* () {
  8361. if (!file) {
  8362. throw new Error("parameter 'file' is required");
  8363. }
  8364. dest = dest || (yield _createExtractFolder(dest));
  8365. const tarPath = yield io.which('tar', true);
  8366. yield exec_1.exec(`"${tarPath}"`, [flags, '-C', dest, '-f', file]);
  8367. return dest;
  8368. });
  8369. }
  8370. exports.extractTar = extractTar;
  8371. /**
  8372. * Extract a zip
  8373. *
  8374. * @param file path to the zip
  8375. * @param dest destination directory. Optional.
  8376. * @returns path to the destination directory
  8377. */
  8378. function extractZip(file, dest) {
  8379. return __awaiter(this, void 0, void 0, function* () {
  8380. if (!file) {
  8381. throw new Error("parameter 'file' is required");
  8382. }
  8383. dest = dest || (yield _createExtractFolder(dest));
  8384. if (IS_WINDOWS) {
  8385. yield extractZipWin(file, dest);
  8386. }
  8387. else {
  8388. yield extractZipNix(file, dest);
  8389. }
  8390. return dest;
  8391. });
  8392. }
  8393. exports.extractZip = extractZip;
  8394. function extractZipWin(file, dest) {
  8395. return __awaiter(this, void 0, void 0, function* () {
  8396. // build the powershell command
  8397. const escapedFile = file.replace(/'/g, "''").replace(/"|\n|\r/g, ''); // double-up single quotes, remove double quotes and newlines
  8398. const escapedDest = dest.replace(/'/g, "''").replace(/"|\n|\r/g, '');
  8399. const command = `$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.FileSystem } catch { } ; [System.IO.Compression.ZipFile]::ExtractToDirectory('${escapedFile}', '${escapedDest}')`;
  8400. // run powershell
  8401. const powershellPath = yield io.which('powershell');
  8402. const args = [
  8403. '-NoLogo',
  8404. '-Sta',
  8405. '-NoProfile',
  8406. '-NonInteractive',
  8407. '-ExecutionPolicy',
  8408. 'Unrestricted',
  8409. '-Command',
  8410. command
  8411. ];
  8412. yield exec_1.exec(`"${powershellPath}"`, args);
  8413. });
  8414. }
  8415. function extractZipNix(file, dest) {
  8416. return __awaiter(this, void 0, void 0, function* () {
  8417. const unzipPath = yield io.which('unzip');
  8418. yield exec_1.exec(`"${unzipPath}"`, [file], { cwd: dest });
  8419. });
  8420. }
  8421. /**
  8422. * Caches a directory and installs it into the tool cacheDir
  8423. *
  8424. * @param sourceDir the directory to cache into tools
  8425. * @param tool tool name
  8426. * @param version version of the tool. semver format
  8427. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8428. */
  8429. function cacheDir(sourceDir, tool, version, arch) {
  8430. return __awaiter(this, void 0, void 0, function* () {
  8431. version = semver.clean(version) || version;
  8432. arch = arch || os.arch();
  8433. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8434. core.debug(`source dir: ${sourceDir}`);
  8435. if (!fs.statSync(sourceDir).isDirectory()) {
  8436. throw new Error('sourceDir is not a directory');
  8437. }
  8438. // Create the tool dir
  8439. const destPath = yield _createToolPath(tool, version, arch);
  8440. // copy each child item. do not move. move can fail on Windows
  8441. // due to anti-virus software having an open handle on a file.
  8442. for (const itemName of fs.readdirSync(sourceDir)) {
  8443. const s = path.join(sourceDir, itemName);
  8444. yield io.cp(s, destPath, { recursive: true });
  8445. }
  8446. // write .complete
  8447. _completeToolPath(tool, version, arch);
  8448. return destPath;
  8449. });
  8450. }
  8451. exports.cacheDir = cacheDir;
  8452. /**
  8453. * Caches a downloaded file (GUID) and installs it
  8454. * into the tool cache with a given targetName
  8455. *
  8456. * @param sourceFile the file to cache into tools. Typically a result of downloadTool which is a guid.
  8457. * @param targetFile the name of the file name in the tools directory
  8458. * @param tool tool name
  8459. * @param version version of the tool. semver format
  8460. * @param arch architecture of the tool. Optional. Defaults to machine architecture
  8461. */
  8462. function cacheFile(sourceFile, targetFile, tool, version, arch) {
  8463. return __awaiter(this, void 0, void 0, function* () {
  8464. version = semver.clean(version) || version;
  8465. arch = arch || os.arch();
  8466. core.debug(`Caching tool ${tool} ${version} ${arch}`);
  8467. core.debug(`source file: ${sourceFile}`);
  8468. if (!fs.statSync(sourceFile).isFile()) {
  8469. throw new Error('sourceFile is not a file');
  8470. }
  8471. // create the tool dir
  8472. const destFolder = yield _createToolPath(tool, version, arch);
  8473. // copy instead of move. move can fail on Windows due to
  8474. // anti-virus software having an open handle on a file.
  8475. const destPath = path.join(destFolder, targetFile);
  8476. core.debug(`destination file ${destPath}`);
  8477. yield io.cp(sourceFile, destPath);
  8478. // write .complete
  8479. _completeToolPath(tool, version, arch);
  8480. return destFolder;
  8481. });
  8482. }
  8483. exports.cacheFile = cacheFile;
  8484. /**
  8485. * Finds the path to a tool version in the local installed tool cache
  8486. *
  8487. * @param toolName name of the tool
  8488. * @param versionSpec version of the tool
  8489. * @param arch optional arch. defaults to arch of computer
  8490. */
  8491. function find(toolName, versionSpec, arch) {
  8492. if (!toolName) {
  8493. throw new Error('toolName parameter is required');
  8494. }
  8495. if (!versionSpec) {
  8496. throw new Error('versionSpec parameter is required');
  8497. }
  8498. arch = arch || os.arch();
  8499. // attempt to resolve an explicit version
  8500. if (!_isExplicitVersion(versionSpec)) {
  8501. const localVersions = findAllVersions(toolName, arch);
  8502. const match = _evaluateVersions(localVersions, versionSpec);
  8503. versionSpec = match;
  8504. }
  8505. // check for the explicit version in the cache
  8506. let toolPath = '';
  8507. if (versionSpec) {
  8508. versionSpec = semver.clean(versionSpec) || '';
  8509. const cachePath = path.join(cacheRoot, toolName, versionSpec, arch);
  8510. core.debug(`checking cache: ${cachePath}`);
  8511. if (fs.existsSync(cachePath) && fs.existsSync(`${cachePath}.complete`)) {
  8512. core.debug(`Found tool in cache ${toolName} ${versionSpec} ${arch}`);
  8513. toolPath = cachePath;
  8514. }
  8515. else {
  8516. core.debug('not found');
  8517. }
  8518. }
  8519. return toolPath;
  8520. }
  8521. exports.find = find;
  8522. /**
  8523. * Finds the paths to all versions of a tool that are installed in the local tool cache
  8524. *
  8525. * @param toolName name of the tool
  8526. * @param arch optional arch. defaults to arch of computer
  8527. */
  8528. function findAllVersions(toolName, arch) {
  8529. const versions = [];
  8530. arch = arch || os.arch();
  8531. const toolPath = path.join(cacheRoot, toolName);
  8532. if (fs.existsSync(toolPath)) {
  8533. const children = fs.readdirSync(toolPath);
  8534. for (const child of children) {
  8535. if (_isExplicitVersion(child)) {
  8536. const fullPath = path.join(toolPath, child, arch || '');
  8537. if (fs.existsSync(fullPath) && fs.existsSync(`${fullPath}.complete`)) {
  8538. versions.push(child);
  8539. }
  8540. }
  8541. }
  8542. }
  8543. return versions;
  8544. }
  8545. exports.findAllVersions = findAllVersions;
  8546. function _createExtractFolder(dest) {
  8547. return __awaiter(this, void 0, void 0, function* () {
  8548. if (!dest) {
  8549. // create a temp dir
  8550. dest = path.join(tempDirectory, uuidV4());
  8551. }
  8552. yield io.mkdirP(dest);
  8553. return dest;
  8554. });
  8555. }
  8556. function _createToolPath(tool, version, arch) {
  8557. return __awaiter(this, void 0, void 0, function* () {
  8558. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8559. core.debug(`destination ${folderPath}`);
  8560. const markerPath = `${folderPath}.complete`;
  8561. yield io.rmRF(folderPath);
  8562. yield io.rmRF(markerPath);
  8563. yield io.mkdirP(folderPath);
  8564. return folderPath;
  8565. });
  8566. }
  8567. function _completeToolPath(tool, version, arch) {
  8568. const folderPath = path.join(cacheRoot, tool, semver.clean(version) || version, arch || '');
  8569. const markerPath = `${folderPath}.complete`;
  8570. fs.writeFileSync(markerPath, '');
  8571. core.debug('finished caching tool');
  8572. }
  8573. function _isExplicitVersion(versionSpec) {
  8574. const c = semver.clean(versionSpec) || '';
  8575. core.debug(`isExplicit: ${c}`);
  8576. const valid = semver.valid(c) != null;
  8577. core.debug(`explicit? ${valid}`);
  8578. return valid;
  8579. }
  8580. function _evaluateVersions(versions, versionSpec) {
  8581. let version = '';
  8582. core.debug(`evaluating ${versions.length} versions`);
  8583. versions = versions.sort((a, b) => {
  8584. if (semver.gt(a, b)) {
  8585. return 1;
  8586. }
  8587. return -1;
  8588. });
  8589. for (let i = versions.length - 1; i >= 0; i--) {
  8590. const potential = versions[i];
  8591. const satisfied = semver.satisfies(potential, versionSpec);
  8592. if (satisfied) {
  8593. version = potential;
  8594. break;
  8595. }
  8596. }
  8597. if (version) {
  8598. core.debug(`matched: ${version}`);
  8599. }
  8600. else {
  8601. core.debug('match not found');
  8602. }
  8603. return version;
  8604. }
  8605. //# sourceMappingURL=tool-cache.js.map
  8606. /***/ }),
  8607. /***/ 536:
  8608. /***/ (function(module, __unusedexports, __webpack_require__) {
  8609. module.exports = hasFirstPage
  8610. const deprecate = __webpack_require__(370)
  8611. const getPageLinks = __webpack_require__(577)
  8612. function hasFirstPage (link) {
  8613. deprecate(`octokit.hasFirstPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  8614. return getPageLinks(link).first
  8615. }
  8616. /***/ }),
  8617. /***/ 539:
  8618. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  8619. "use strict";
  8620. Object.defineProperty(exports, "__esModule", { value: true });
  8621. const url = __webpack_require__(835);
  8622. const http = __webpack_require__(605);
  8623. const https = __webpack_require__(211);
  8624. const pm = __webpack_require__(950);
  8625. let tunnel;
  8626. var HttpCodes;
  8627. (function (HttpCodes) {
  8628. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  8629. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  8630. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  8631. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  8632. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  8633. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  8634. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  8635. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  8636. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  8637. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  8638. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  8639. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  8640. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  8641. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  8642. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  8643. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  8644. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  8645. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  8646. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  8647. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  8648. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  8649. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  8650. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  8651. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  8652. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  8653. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  8654. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  8655. /**
  8656. * Returns the proxy URL, depending upon the supplied url and proxy environment variables.
  8657. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  8658. */
  8659. function getProxyUrl(serverUrl) {
  8660. let proxyUrl = pm.getProxyUrl(url.parse(serverUrl));
  8661. return proxyUrl ? proxyUrl.href : '';
  8662. }
  8663. exports.getProxyUrl = getProxyUrl;
  8664. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  8665. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  8666. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  8667. const ExponentialBackoffCeiling = 10;
  8668. const ExponentialBackoffTimeSlice = 5;
  8669. class HttpClientResponse {
  8670. constructor(message) {
  8671. this.message = message;
  8672. }
  8673. readBody() {
  8674. return new Promise(async (resolve, reject) => {
  8675. let output = Buffer.alloc(0);
  8676. this.message.on('data', (chunk) => {
  8677. output = Buffer.concat([output, chunk]);
  8678. });
  8679. this.message.on('end', () => {
  8680. resolve(output.toString());
  8681. });
  8682. });
  8683. }
  8684. }
  8685. exports.HttpClientResponse = HttpClientResponse;
  8686. function isHttps(requestUrl) {
  8687. let parsedUrl = url.parse(requestUrl);
  8688. return parsedUrl.protocol === 'https:';
  8689. }
  8690. exports.isHttps = isHttps;
  8691. class HttpClient {
  8692. constructor(userAgent, handlers, requestOptions) {
  8693. this._ignoreSslError = false;
  8694. this._allowRedirects = true;
  8695. this._allowRedirectDowngrade = false;
  8696. this._maxRedirects = 50;
  8697. this._allowRetries = false;
  8698. this._maxRetries = 1;
  8699. this._keepAlive = false;
  8700. this._disposed = false;
  8701. this.userAgent = userAgent;
  8702. this.handlers = handlers || [];
  8703. this.requestOptions = requestOptions;
  8704. if (requestOptions) {
  8705. if (requestOptions.ignoreSslError != null) {
  8706. this._ignoreSslError = requestOptions.ignoreSslError;
  8707. }
  8708. this._socketTimeout = requestOptions.socketTimeout;
  8709. if (requestOptions.allowRedirects != null) {
  8710. this._allowRedirects = requestOptions.allowRedirects;
  8711. }
  8712. if (requestOptions.allowRedirectDowngrade != null) {
  8713. this._allowRedirectDowngrade = requestOptions.allowRedirectDowngrade;
  8714. }
  8715. if (requestOptions.maxRedirects != null) {
  8716. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  8717. }
  8718. if (requestOptions.keepAlive != null) {
  8719. this._keepAlive = requestOptions.keepAlive;
  8720. }
  8721. if (requestOptions.allowRetries != null) {
  8722. this._allowRetries = requestOptions.allowRetries;
  8723. }
  8724. if (requestOptions.maxRetries != null) {
  8725. this._maxRetries = requestOptions.maxRetries;
  8726. }
  8727. }
  8728. }
  8729. options(requestUrl, additionalHeaders) {
  8730. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  8731. }
  8732. get(requestUrl, additionalHeaders) {
  8733. return this.request('GET', requestUrl, null, additionalHeaders || {});
  8734. }
  8735. del(requestUrl, additionalHeaders) {
  8736. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  8737. }
  8738. post(requestUrl, data, additionalHeaders) {
  8739. return this.request('POST', requestUrl, data, additionalHeaders || {});
  8740. }
  8741. patch(requestUrl, data, additionalHeaders) {
  8742. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  8743. }
  8744. put(requestUrl, data, additionalHeaders) {
  8745. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  8746. }
  8747. head(requestUrl, additionalHeaders) {
  8748. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  8749. }
  8750. sendStream(verb, requestUrl, stream, additionalHeaders) {
  8751. return this.request(verb, requestUrl, stream, additionalHeaders);
  8752. }
  8753. /**
  8754. * Makes a raw http request.
  8755. * All other methods such as get, post, patch, and request ultimately call this.
  8756. * Prefer get, del, post and patch
  8757. */
  8758. async request(verb, requestUrl, data, headers) {
  8759. if (this._disposed) {
  8760. throw new Error("Client has already been disposed.");
  8761. }
  8762. let parsedUrl = url.parse(requestUrl);
  8763. let info = this._prepareRequest(verb, parsedUrl, headers);
  8764. // Only perform retries on reads since writes may not be idempotent.
  8765. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  8766. let numTries = 0;
  8767. let response;
  8768. while (numTries < maxTries) {
  8769. response = await this.requestRaw(info, data);
  8770. // Check if it's an authentication challenge
  8771. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  8772. let authenticationHandler;
  8773. for (let i = 0; i < this.handlers.length; i++) {
  8774. if (this.handlers[i].canHandleAuthentication(response)) {
  8775. authenticationHandler = this.handlers[i];
  8776. break;
  8777. }
  8778. }
  8779. if (authenticationHandler) {
  8780. return authenticationHandler.handleAuthentication(this, info, data);
  8781. }
  8782. else {
  8783. // We have received an unauthorized response but have no handlers to handle it.
  8784. // Let the response return to the caller.
  8785. return response;
  8786. }
  8787. }
  8788. let redirectsRemaining = this._maxRedirects;
  8789. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  8790. && this._allowRedirects
  8791. && redirectsRemaining > 0) {
  8792. const redirectUrl = response.message.headers["location"];
  8793. if (!redirectUrl) {
  8794. // if there's no location to redirect to, we won't
  8795. break;
  8796. }
  8797. let parsedRedirectUrl = url.parse(redirectUrl);
  8798. if (parsedUrl.protocol == 'https:' && parsedUrl.protocol != parsedRedirectUrl.protocol && !this._allowRedirectDowngrade) {
  8799. 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.");
  8800. }
  8801. // we need to finish reading the response before reassigning response
  8802. // which will leak the open socket.
  8803. await response.readBody();
  8804. // let's make the request with the new redirectUrl
  8805. info = this._prepareRequest(verb, parsedRedirectUrl, headers);
  8806. response = await this.requestRaw(info, data);
  8807. redirectsRemaining--;
  8808. }
  8809. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  8810. // If not a retry code, return immediately instead of retrying
  8811. return response;
  8812. }
  8813. numTries += 1;
  8814. if (numTries < maxTries) {
  8815. await response.readBody();
  8816. await this._performExponentialBackoff(numTries);
  8817. }
  8818. }
  8819. return response;
  8820. }
  8821. /**
  8822. * Needs to be called if keepAlive is set to true in request options.
  8823. */
  8824. dispose() {
  8825. if (this._agent) {
  8826. this._agent.destroy();
  8827. }
  8828. this._disposed = true;
  8829. }
  8830. /**
  8831. * Raw request.
  8832. * @param info
  8833. * @param data
  8834. */
  8835. requestRaw(info, data) {
  8836. return new Promise((resolve, reject) => {
  8837. let callbackForResult = function (err, res) {
  8838. if (err) {
  8839. reject(err);
  8840. }
  8841. resolve(res);
  8842. };
  8843. this.requestRawWithCallback(info, data, callbackForResult);
  8844. });
  8845. }
  8846. /**
  8847. * Raw request with callback.
  8848. * @param info
  8849. * @param data
  8850. * @param onResult
  8851. */
  8852. requestRawWithCallback(info, data, onResult) {
  8853. let socket;
  8854. if (typeof (data) === 'string') {
  8855. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  8856. }
  8857. let callbackCalled = false;
  8858. let handleResult = (err, res) => {
  8859. if (!callbackCalled) {
  8860. callbackCalled = true;
  8861. onResult(err, res);
  8862. }
  8863. };
  8864. let req = info.httpModule.request(info.options, (msg) => {
  8865. let res = new HttpClientResponse(msg);
  8866. handleResult(null, res);
  8867. });
  8868. req.on('socket', (sock) => {
  8869. socket = sock;
  8870. });
  8871. // If we ever get disconnected, we want the socket to timeout eventually
  8872. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  8873. if (socket) {
  8874. socket.end();
  8875. }
  8876. handleResult(new Error('Request timeout: ' + info.options.path), null);
  8877. });
  8878. req.on('error', function (err) {
  8879. // err has statusCode property
  8880. // res should have headers
  8881. handleResult(err, null);
  8882. });
  8883. if (data && typeof (data) === 'string') {
  8884. req.write(data, 'utf8');
  8885. }
  8886. if (data && typeof (data) !== 'string') {
  8887. data.on('close', function () {
  8888. req.end();
  8889. });
  8890. data.pipe(req);
  8891. }
  8892. else {
  8893. req.end();
  8894. }
  8895. }
  8896. /**
  8897. * Gets an http agent. This function is useful when you need an http agent that handles
  8898. * routing through a proxy server - depending upon the url and proxy environment variables.
  8899. * @param serverUrl The server URL where the request will be sent. For example, https://api.github.com
  8900. */
  8901. getAgent(serverUrl) {
  8902. let parsedUrl = url.parse(serverUrl);
  8903. return this._getAgent(parsedUrl);
  8904. }
  8905. _prepareRequest(method, requestUrl, headers) {
  8906. const info = {};
  8907. info.parsedUrl = requestUrl;
  8908. const usingSsl = info.parsedUrl.protocol === 'https:';
  8909. info.httpModule = usingSsl ? https : http;
  8910. const defaultPort = usingSsl ? 443 : 80;
  8911. info.options = {};
  8912. info.options.host = info.parsedUrl.hostname;
  8913. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  8914. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  8915. info.options.method = method;
  8916. info.options.headers = this._mergeHeaders(headers);
  8917. if (this.userAgent != null) {
  8918. info.options.headers["user-agent"] = this.userAgent;
  8919. }
  8920. info.options.agent = this._getAgent(info.parsedUrl);
  8921. // gives handlers an opportunity to participate
  8922. if (this.handlers) {
  8923. this.handlers.forEach((handler) => {
  8924. handler.prepareRequest(info.options);
  8925. });
  8926. }
  8927. return info;
  8928. }
  8929. _mergeHeaders(headers) {
  8930. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  8931. if (this.requestOptions && this.requestOptions.headers) {
  8932. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  8933. }
  8934. return lowercaseKeys(headers || {});
  8935. }
  8936. _getAgent(parsedUrl) {
  8937. let agent;
  8938. let proxyUrl = pm.getProxyUrl(parsedUrl);
  8939. let useProxy = proxyUrl && proxyUrl.hostname;
  8940. if (this._keepAlive && useProxy) {
  8941. agent = this._proxyAgent;
  8942. }
  8943. if (this._keepAlive && !useProxy) {
  8944. agent = this._agent;
  8945. }
  8946. // if agent is already assigned use that agent.
  8947. if (!!agent) {
  8948. return agent;
  8949. }
  8950. const usingSsl = parsedUrl.protocol === 'https:';
  8951. let maxSockets = 100;
  8952. if (!!this.requestOptions) {
  8953. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  8954. }
  8955. if (useProxy) {
  8956. // If using proxy, need tunnel
  8957. if (!tunnel) {
  8958. tunnel = __webpack_require__(335);
  8959. }
  8960. const agentOptions = {
  8961. maxSockets: maxSockets,
  8962. keepAlive: this._keepAlive,
  8963. proxy: {
  8964. proxyAuth: proxyUrl.auth,
  8965. host: proxyUrl.hostname,
  8966. port: proxyUrl.port
  8967. },
  8968. };
  8969. let tunnelAgent;
  8970. const overHttps = proxyUrl.protocol === 'https:';
  8971. if (usingSsl) {
  8972. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  8973. }
  8974. else {
  8975. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  8976. }
  8977. agent = tunnelAgent(agentOptions);
  8978. this._proxyAgent = agent;
  8979. }
  8980. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  8981. if (this._keepAlive && !agent) {
  8982. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  8983. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  8984. this._agent = agent;
  8985. }
  8986. // if not using private agent and tunnel agent isn't setup then use global agent
  8987. if (!agent) {
  8988. agent = usingSsl ? https.globalAgent : http.globalAgent;
  8989. }
  8990. if (usingSsl && this._ignoreSslError) {
  8991. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  8992. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  8993. // we have to cast it to any and change it directly
  8994. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  8995. }
  8996. return agent;
  8997. }
  8998. _performExponentialBackoff(retryNumber) {
  8999. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  9000. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  9001. return new Promise(resolve => setTimeout(() => resolve(), ms));
  9002. }
  9003. }
  9004. exports.HttpClient = HttpClient;
  9005. /***/ }),
  9006. /***/ 550:
  9007. /***/ (function(module, __unusedexports, __webpack_require__) {
  9008. module.exports = getNextPage
  9009. const getPage = __webpack_require__(265)
  9010. function getNextPage (octokit, link, headers) {
  9011. return getPage(octokit, link, 'next', headers)
  9012. }
  9013. /***/ }),
  9014. /***/ 558:
  9015. /***/ (function(module, __unusedexports, __webpack_require__) {
  9016. module.exports = hasPreviousPage
  9017. const deprecate = __webpack_require__(370)
  9018. const getPageLinks = __webpack_require__(577)
  9019. function hasPreviousPage (link) {
  9020. deprecate(`octokit.hasPreviousPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  9021. return getPageLinks(link).prev
  9022. }
  9023. /***/ }),
  9024. /***/ 559:
  9025. /***/ (function(__unusedmodule, exports) {
  9026. "use strict";
  9027. Object.defineProperty(exports, "__esModule", { value: true });
  9028. class GitVersion {
  9029. /**
  9030. * Used for comparing the version of git and git-lfs against the minimum required version
  9031. * @param version the version string, e.g. 1.2 or 1.2.3
  9032. */
  9033. constructor(version) {
  9034. this.major = NaN;
  9035. this.minor = NaN;
  9036. this.patch = NaN;
  9037. if (version) {
  9038. const match = version.match(/^(\d+)\.(\d+)(\.(\d+))?$/);
  9039. if (match) {
  9040. this.major = Number(match[1]);
  9041. this.minor = Number(match[2]);
  9042. if (match[4]) {
  9043. this.patch = Number(match[4]);
  9044. }
  9045. }
  9046. }
  9047. }
  9048. /**
  9049. * Compares the instance against a minimum required version
  9050. * @param minimum Minimum version
  9051. */
  9052. checkMinimum(minimum) {
  9053. if (!minimum.isValid()) {
  9054. throw new Error('Arg minimum is not a valid version');
  9055. }
  9056. // Major is insufficient
  9057. if (this.major < minimum.major) {
  9058. return false;
  9059. }
  9060. // Major is equal
  9061. if (this.major === minimum.major) {
  9062. // Minor is insufficient
  9063. if (this.minor < minimum.minor) {
  9064. return false;
  9065. }
  9066. // Minor is equal
  9067. if (this.minor === minimum.minor) {
  9068. // Patch is insufficient
  9069. if (this.patch && this.patch < (minimum.patch || 0)) {
  9070. return false;
  9071. }
  9072. }
  9073. }
  9074. return true;
  9075. }
  9076. /**
  9077. * Indicates whether the instance was constructed from a valid version string
  9078. */
  9079. isValid() {
  9080. return !isNaN(this.major);
  9081. }
  9082. /**
  9083. * Returns the version as a string, e.g. 1.2 or 1.2.3
  9084. */
  9085. toString() {
  9086. let result = '';
  9087. if (this.isValid()) {
  9088. result = `${this.major}.${this.minor}`;
  9089. if (!isNaN(this.patch)) {
  9090. result += `.${this.patch}`;
  9091. }
  9092. }
  9093. return result;
  9094. }
  9095. }
  9096. exports.GitVersion = GitVersion;
  9097. /***/ }),
  9098. /***/ 562:
  9099. /***/ (function(module, __unusedexports, __webpack_require__) {
  9100. var once = __webpack_require__(969);
  9101. var noop = function() {};
  9102. var isRequest = function(stream) {
  9103. return stream.setHeader && typeof stream.abort === 'function';
  9104. };
  9105. var isChildProcess = function(stream) {
  9106. return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
  9107. };
  9108. var eos = function(stream, opts, callback) {
  9109. if (typeof opts === 'function') return eos(stream, null, opts);
  9110. if (!opts) opts = {};
  9111. callback = once(callback || noop);
  9112. var ws = stream._writableState;
  9113. var rs = stream._readableState;
  9114. var readable = opts.readable || (opts.readable !== false && stream.readable);
  9115. var writable = opts.writable || (opts.writable !== false && stream.writable);
  9116. var cancelled = false;
  9117. var onlegacyfinish = function() {
  9118. if (!stream.writable) onfinish();
  9119. };
  9120. var onfinish = function() {
  9121. writable = false;
  9122. if (!readable) callback.call(stream);
  9123. };
  9124. var onend = function() {
  9125. readable = false;
  9126. if (!writable) callback.call(stream);
  9127. };
  9128. var onexit = function(exitCode) {
  9129. callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
  9130. };
  9131. var onerror = function(err) {
  9132. callback.call(stream, err);
  9133. };
  9134. var onclose = function() {
  9135. process.nextTick(onclosenexttick);
  9136. };
  9137. var onclosenexttick = function() {
  9138. if (cancelled) return;
  9139. if (readable && !(rs && (rs.ended && !rs.destroyed))) return callback.call(stream, new Error('premature close'));
  9140. if (writable && !(ws && (ws.ended && !ws.destroyed))) return callback.call(stream, new Error('premature close'));
  9141. };
  9142. var onrequest = function() {
  9143. stream.req.on('finish', onfinish);
  9144. };
  9145. if (isRequest(stream)) {
  9146. stream.on('complete', onfinish);
  9147. stream.on('abort', onclose);
  9148. if (stream.req) onrequest();
  9149. else stream.on('request', onrequest);
  9150. } else if (writable && !ws) { // legacy streams
  9151. stream.on('end', onlegacyfinish);
  9152. stream.on('close', onlegacyfinish);
  9153. }
  9154. if (isChildProcess(stream)) stream.on('exit', onexit);
  9155. stream.on('end', onend);
  9156. stream.on('finish', onfinish);
  9157. if (opts.error !== false) stream.on('error', onerror);
  9158. stream.on('close', onclose);
  9159. return function() {
  9160. cancelled = true;
  9161. stream.removeListener('complete', onfinish);
  9162. stream.removeListener('abort', onclose);
  9163. stream.removeListener('request', onrequest);
  9164. if (stream.req) stream.req.removeListener('finish', onfinish);
  9165. stream.removeListener('end', onlegacyfinish);
  9166. stream.removeListener('close', onlegacyfinish);
  9167. stream.removeListener('finish', onfinish);
  9168. stream.removeListener('exit', onexit);
  9169. stream.removeListener('end', onend);
  9170. stream.removeListener('error', onerror);
  9171. stream.removeListener('close', onclose);
  9172. };
  9173. };
  9174. module.exports = eos;
  9175. /***/ }),
  9176. /***/ 563:
  9177. /***/ (function(module, __unusedexports, __webpack_require__) {
  9178. module.exports = getPreviousPage
  9179. const getPage = __webpack_require__(265)
  9180. function getPreviousPage (octokit, link, headers) {
  9181. return getPage(octokit, link, 'prev', headers)
  9182. }
  9183. /***/ }),
  9184. /***/ 568:
  9185. /***/ (function(module, __unusedexports, __webpack_require__) {
  9186. "use strict";
  9187. const path = __webpack_require__(622);
  9188. const niceTry = __webpack_require__(948);
  9189. const resolveCommand = __webpack_require__(489);
  9190. const escape = __webpack_require__(462);
  9191. const readShebang = __webpack_require__(389);
  9192. const semver = __webpack_require__(280);
  9193. const isWin = process.platform === 'win32';
  9194. const isExecutableRegExp = /\.(?:com|exe)$/i;
  9195. const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
  9196. // `options.shell` is supported in Node ^4.8.0, ^5.7.0 and >= 6.0.0
  9197. const supportsShellOption = niceTry(() => semver.satisfies(process.version, '^4.8.0 || ^5.7.0 || >= 6.0.0', true)) || false;
  9198. function detectShebang(parsed) {
  9199. parsed.file = resolveCommand(parsed);
  9200. const shebang = parsed.file && readShebang(parsed.file);
  9201. if (shebang) {
  9202. parsed.args.unshift(parsed.file);
  9203. parsed.command = shebang;
  9204. return resolveCommand(parsed);
  9205. }
  9206. return parsed.file;
  9207. }
  9208. function parseNonShell(parsed) {
  9209. if (!isWin) {
  9210. return parsed;
  9211. }
  9212. // Detect & add support for shebangs
  9213. const commandFile = detectShebang(parsed);
  9214. // We don't need a shell if the command filename is an executable
  9215. const needsShell = !isExecutableRegExp.test(commandFile);
  9216. // If a shell is required, use cmd.exe and take care of escaping everything correctly
  9217. // Note that `forceShell` is an hidden option used only in tests
  9218. if (parsed.options.forceShell || needsShell) {
  9219. // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
  9220. // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
  9221. // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
  9222. // we need to double escape them
  9223. const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);
  9224. // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
  9225. // This is necessary otherwise it will always fail with ENOENT in those cases
  9226. parsed.command = path.normalize(parsed.command);
  9227. // Escape command & arguments
  9228. parsed.command = escape.command(parsed.command);
  9229. parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));
  9230. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9231. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9232. parsed.command = process.env.comspec || 'cmd.exe';
  9233. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9234. }
  9235. return parsed;
  9236. }
  9237. function parseShell(parsed) {
  9238. // If node supports the shell option, there's no need to mimic its behavior
  9239. if (supportsShellOption) {
  9240. return parsed;
  9241. }
  9242. // Mimic node shell option
  9243. // See https://github.com/nodejs/node/blob/b9f6a2dc059a1062776133f3d4fd848c4da7d150/lib/child_process.js#L335
  9244. const shellCommand = [parsed.command].concat(parsed.args).join(' ');
  9245. if (isWin) {
  9246. parsed.command = typeof parsed.options.shell === 'string' ? parsed.options.shell : process.env.comspec || 'cmd.exe';
  9247. parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
  9248. parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
  9249. } else {
  9250. if (typeof parsed.options.shell === 'string') {
  9251. parsed.command = parsed.options.shell;
  9252. } else if (process.platform === 'android') {
  9253. parsed.command = '/system/bin/sh';
  9254. } else {
  9255. parsed.command = '/bin/sh';
  9256. }
  9257. parsed.args = ['-c', shellCommand];
  9258. }
  9259. return parsed;
  9260. }
  9261. function parse(command, args, options) {
  9262. // Normalize arguments, similar to nodejs
  9263. if (args && !Array.isArray(args)) {
  9264. options = args;
  9265. args = null;
  9266. }
  9267. args = args ? args.slice(0) : []; // Clone array to avoid changing the original
  9268. options = Object.assign({}, options); // Clone object to avoid changing the original
  9269. // Build our parsed object
  9270. const parsed = {
  9271. command,
  9272. args,
  9273. options,
  9274. file: undefined,
  9275. original: {
  9276. command,
  9277. args,
  9278. },
  9279. };
  9280. // Delegate further parsing to shell or non-shell
  9281. return options.shell ? parseShell(parsed) : parseNonShell(parsed);
  9282. }
  9283. module.exports = parse;
  9284. /***/ }),
  9285. /***/ 577:
  9286. /***/ (function(module) {
  9287. module.exports = getPageLinks
  9288. function getPageLinks (link) {
  9289. link = link.link || link.headers.link || ''
  9290. const links = {}
  9291. // link format:
  9292. // '<https://api.github.com/users/aseemk/followers?page=2>; rel="next", <https://api.github.com/users/aseemk/followers?page=2>; rel="last"'
  9293. link.replace(/<([^>]*)>;\s*rel="([\w]*)"/g, (m, uri, type) => {
  9294. links[type] = uri
  9295. })
  9296. return links
  9297. }
  9298. /***/ }),
  9299. /***/ 586:
  9300. /***/ (function(module, __unusedexports, __webpack_require__) {
  9301. module.exports = octokitRestApiEndpoints;
  9302. const ROUTES = __webpack_require__(705);
  9303. function octokitRestApiEndpoints(octokit) {
  9304. // Aliasing scopes for backward compatibility
  9305. // See https://github.com/octokit/rest.js/pull/1134
  9306. ROUTES.gitdata = ROUTES.git;
  9307. ROUTES.authorization = ROUTES.oauthAuthorizations;
  9308. ROUTES.pullRequests = ROUTES.pulls;
  9309. octokit.registerEndpoints(ROUTES);
  9310. }
  9311. /***/ }),
  9312. /***/ 587:
  9313. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9314. "use strict";
  9315. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  9316. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  9317. return new (P || (P = Promise))(function (resolve, reject) {
  9318. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  9319. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  9320. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  9321. step((generator = generator.apply(thisArg, _arguments || [])).next());
  9322. });
  9323. };
  9324. var __importStar = (this && this.__importStar) || function (mod) {
  9325. if (mod && mod.__esModule) return mod;
  9326. var result = {};
  9327. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9328. result["default"] = mod;
  9329. return result;
  9330. };
  9331. Object.defineProperty(exports, "__esModule", { value: true });
  9332. const core = __importStar(__webpack_require__(470));
  9333. const defaultMaxAttempts = 3;
  9334. const defaultMinSeconds = 10;
  9335. const defaultMaxSeconds = 20;
  9336. class RetryHelper {
  9337. constructor(maxAttempts = defaultMaxAttempts, minSeconds = defaultMinSeconds, maxSeconds = defaultMaxSeconds) {
  9338. this.maxAttempts = maxAttempts;
  9339. this.minSeconds = Math.floor(minSeconds);
  9340. this.maxSeconds = Math.floor(maxSeconds);
  9341. if (this.minSeconds > this.maxSeconds) {
  9342. throw new Error('min seconds should be less than or equal to max seconds');
  9343. }
  9344. }
  9345. execute(action) {
  9346. return __awaiter(this, void 0, void 0, function* () {
  9347. let attempt = 1;
  9348. while (attempt < this.maxAttempts) {
  9349. // Try
  9350. try {
  9351. return yield action();
  9352. }
  9353. catch (err) {
  9354. core.info(err.message);
  9355. }
  9356. // Sleep
  9357. const seconds = this.getSleepAmount();
  9358. core.info(`Waiting ${seconds} seconds before trying again`);
  9359. yield this.sleep(seconds);
  9360. attempt++;
  9361. }
  9362. // Last attempt
  9363. return yield action();
  9364. });
  9365. }
  9366. getSleepAmount() {
  9367. return (Math.floor(Math.random() * (this.maxSeconds - this.minSeconds + 1)) +
  9368. this.minSeconds);
  9369. }
  9370. sleep(seconds) {
  9371. return __awaiter(this, void 0, void 0, function* () {
  9372. return new Promise(resolve => setTimeout(resolve, seconds * 1000));
  9373. });
  9374. }
  9375. }
  9376. exports.RetryHelper = RetryHelper;
  9377. function execute(action) {
  9378. return __awaiter(this, void 0, void 0, function* () {
  9379. const retryHelper = new RetryHelper();
  9380. return yield retryHelper.execute(action);
  9381. });
  9382. }
  9383. exports.execute = execute;
  9384. /***/ }),
  9385. /***/ 605:
  9386. /***/ (function(module) {
  9387. module.exports = require("http");
  9388. /***/ }),
  9389. /***/ 614:
  9390. /***/ (function(module) {
  9391. module.exports = require("events");
  9392. /***/ }),
  9393. /***/ 618:
  9394. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  9395. "use strict";
  9396. var __importStar = (this && this.__importStar) || function (mod) {
  9397. if (mod && mod.__esModule) return mod;
  9398. var result = {};
  9399. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  9400. result["default"] = mod;
  9401. return result;
  9402. };
  9403. Object.defineProperty(exports, "__esModule", { value: true });
  9404. const fs = __importStar(__webpack_require__(747));
  9405. function directoryExistsSync(path, required) {
  9406. if (!path) {
  9407. throw new Error("Arg 'path' must not be empty");
  9408. }
  9409. let stats;
  9410. try {
  9411. stats = fs.statSync(path);
  9412. }
  9413. catch (error) {
  9414. if (error.code === 'ENOENT') {
  9415. if (!required) {
  9416. return false;
  9417. }
  9418. throw new Error(`Directory '${path}' does not exist`);
  9419. }
  9420. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9421. }
  9422. if (stats.isDirectory()) {
  9423. return true;
  9424. }
  9425. else if (!required) {
  9426. return false;
  9427. }
  9428. throw new Error(`Directory '${path}' does not exist`);
  9429. }
  9430. exports.directoryExistsSync = directoryExistsSync;
  9431. function existsSync(path) {
  9432. if (!path) {
  9433. throw new Error("Arg 'path' must not be empty");
  9434. }
  9435. try {
  9436. fs.statSync(path);
  9437. }
  9438. catch (error) {
  9439. if (error.code === 'ENOENT') {
  9440. return false;
  9441. }
  9442. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9443. }
  9444. return true;
  9445. }
  9446. exports.existsSync = existsSync;
  9447. function fileExistsSync(path) {
  9448. if (!path) {
  9449. throw new Error("Arg 'path' must not be empty");
  9450. }
  9451. let stats;
  9452. try {
  9453. stats = fs.statSync(path);
  9454. }
  9455. catch (error) {
  9456. if (error.code === 'ENOENT') {
  9457. return false;
  9458. }
  9459. throw new Error(`Encountered an error when checking whether path '${path}' exists: ${error.message}`);
  9460. }
  9461. if (!stats.isDirectory()) {
  9462. return true;
  9463. }
  9464. return false;
  9465. }
  9466. exports.fileExistsSync = fileExistsSync;
  9467. /***/ }),
  9468. /***/ 621:
  9469. /***/ (function(module, __unusedexports, __webpack_require__) {
  9470. "use strict";
  9471. const path = __webpack_require__(622);
  9472. const pathKey = __webpack_require__(39);
  9473. module.exports = opts => {
  9474. opts = Object.assign({
  9475. cwd: process.cwd(),
  9476. path: process.env[pathKey()]
  9477. }, opts);
  9478. let prev;
  9479. let pth = path.resolve(opts.cwd);
  9480. const ret = [];
  9481. while (prev !== pth) {
  9482. ret.push(path.join(pth, 'node_modules/.bin'));
  9483. prev = pth;
  9484. pth = path.resolve(pth, '..');
  9485. }
  9486. // ensure the running `node` binary is used
  9487. ret.push(path.dirname(process.execPath));
  9488. return ret.concat(opts.path).join(path.delimiter);
  9489. };
  9490. module.exports.env = opts => {
  9491. opts = Object.assign({
  9492. env: process.env
  9493. }, opts);
  9494. const env = Object.assign({}, opts.env);
  9495. const path = pathKey({env});
  9496. opts.path = env[path];
  9497. env[path] = module.exports(opts);
  9498. return env;
  9499. };
  9500. /***/ }),
  9501. /***/ 622:
  9502. /***/ (function(module) {
  9503. module.exports = require("path");
  9504. /***/ }),
  9505. /***/ 631:
  9506. /***/ (function(module) {
  9507. module.exports = require("net");
  9508. /***/ }),
  9509. /***/ 649:
  9510. /***/ (function(module, __unusedexports, __webpack_require__) {
  9511. module.exports = getLastPage
  9512. const getPage = __webpack_require__(265)
  9513. function getLastPage (octokit, link, headers) {
  9514. return getPage(octokit, link, 'last', headers)
  9515. }
  9516. /***/ }),
  9517. /***/ 654:
  9518. /***/ (function(module) {
  9519. // This is not the set of all possible signals.
  9520. //
  9521. // It IS, however, the set of all signals that trigger
  9522. // an exit on either Linux or BSD systems. Linux is a
  9523. // superset of the signal names supported on BSD, and
  9524. // the unknown signals just fail to register, so we can
  9525. // catch that easily enough.
  9526. //
  9527. // Don't bother with SIGKILL. It's uncatchable, which
  9528. // means that we can't fire any callbacks anyway.
  9529. //
  9530. // If a user does happen to register a handler on a non-
  9531. // fatal signal like SIGWINCH or something, and then
  9532. // exit, it'll end up firing `process.emit('exit')`, so
  9533. // the handler will be fired anyway.
  9534. //
  9535. // SIGBUS, SIGFPE, SIGSEGV and SIGILL, when not raised
  9536. // artificially, inherently leave the process in a
  9537. // state from which it is not safe to try and enter JS
  9538. // listeners.
  9539. module.exports = [
  9540. 'SIGABRT',
  9541. 'SIGALRM',
  9542. 'SIGHUP',
  9543. 'SIGINT',
  9544. 'SIGTERM'
  9545. ]
  9546. if (process.platform !== 'win32') {
  9547. module.exports.push(
  9548. 'SIGVTALRM',
  9549. 'SIGXCPU',
  9550. 'SIGXFSZ',
  9551. 'SIGUSR2',
  9552. 'SIGTRAP',
  9553. 'SIGSYS',
  9554. 'SIGQUIT',
  9555. 'SIGIOT'
  9556. // should detect profiler and enable/disable accordingly.
  9557. // see #21
  9558. // 'SIGPROF'
  9559. )
  9560. }
  9561. if (process.platform === 'linux') {
  9562. module.exports.push(
  9563. 'SIGIO',
  9564. 'SIGPOLL',
  9565. 'SIGPWR',
  9566. 'SIGSTKFLT',
  9567. 'SIGUNUSED'
  9568. )
  9569. }
  9570. /***/ }),
  9571. /***/ 656:
  9572. /***/ (function(module, exports) {
  9573. exports = module.exports = SemVer
  9574. var debug
  9575. /* istanbul ignore next */
  9576. if (typeof process === 'object' &&
  9577. process.env &&
  9578. process.env.NODE_DEBUG &&
  9579. /\bsemver\b/i.test(process.env.NODE_DEBUG)) {
  9580. debug = function () {
  9581. var args = Array.prototype.slice.call(arguments, 0)
  9582. args.unshift('SEMVER')
  9583. console.log.apply(console, args)
  9584. }
  9585. } else {
  9586. debug = function () {}
  9587. }
  9588. // Note: this is the semver.org version of the spec that it implements
  9589. // Not necessarily the package version of this code.
  9590. exports.SEMVER_SPEC_VERSION = '2.0.0'
  9591. var MAX_LENGTH = 256
  9592. var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
  9593. /* istanbul ignore next */ 9007199254740991
  9594. // Max safe segment length for coercion.
  9595. var MAX_SAFE_COMPONENT_LENGTH = 16
  9596. // The actual regexps go on exports.re
  9597. var re = exports.re = []
  9598. var src = exports.src = []
  9599. var t = exports.tokens = {}
  9600. var R = 0
  9601. function tok (n) {
  9602. t[n] = R++
  9603. }
  9604. // The following Regular Expressions can be used for tokenizing,
  9605. // validating, and parsing SemVer version strings.
  9606. // ## Numeric Identifier
  9607. // A single `0`, or a non-zero digit followed by zero or more digits.
  9608. tok('NUMERICIDENTIFIER')
  9609. src[t.NUMERICIDENTIFIER] = '0|[1-9]\\d*'
  9610. tok('NUMERICIDENTIFIERLOOSE')
  9611. src[t.NUMERICIDENTIFIERLOOSE] = '[0-9]+'
  9612. // ## Non-numeric Identifier
  9613. // Zero or more digits, followed by a letter or hyphen, and then zero or
  9614. // more letters, digits, or hyphens.
  9615. tok('NONNUMERICIDENTIFIER')
  9616. src[t.NONNUMERICIDENTIFIER] = '\\d*[a-zA-Z-][a-zA-Z0-9-]*'
  9617. // ## Main Version
  9618. // Three dot-separated numeric identifiers.
  9619. tok('MAINVERSION')
  9620. src[t.MAINVERSION] = '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9621. '(' + src[t.NUMERICIDENTIFIER] + ')\\.' +
  9622. '(' + src[t.NUMERICIDENTIFIER] + ')'
  9623. tok('MAINVERSIONLOOSE')
  9624. src[t.MAINVERSIONLOOSE] = '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9625. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')\\.' +
  9626. '(' + src[t.NUMERICIDENTIFIERLOOSE] + ')'
  9627. // ## Pre-release Version Identifier
  9628. // A numeric identifier, or a non-numeric identifier.
  9629. tok('PRERELEASEIDENTIFIER')
  9630. src[t.PRERELEASEIDENTIFIER] = '(?:' + src[t.NUMERICIDENTIFIER] +
  9631. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9632. tok('PRERELEASEIDENTIFIERLOOSE')
  9633. src[t.PRERELEASEIDENTIFIERLOOSE] = '(?:' + src[t.NUMERICIDENTIFIERLOOSE] +
  9634. '|' + src[t.NONNUMERICIDENTIFIER] + ')'
  9635. // ## Pre-release Version
  9636. // Hyphen, followed by one or more dot-separated pre-release version
  9637. // identifiers.
  9638. tok('PRERELEASE')
  9639. src[t.PRERELEASE] = '(?:-(' + src[t.PRERELEASEIDENTIFIER] +
  9640. '(?:\\.' + src[t.PRERELEASEIDENTIFIER] + ')*))'
  9641. tok('PRERELEASELOOSE')
  9642. src[t.PRERELEASELOOSE] = '(?:-?(' + src[t.PRERELEASEIDENTIFIERLOOSE] +
  9643. '(?:\\.' + src[t.PRERELEASEIDENTIFIERLOOSE] + ')*))'
  9644. // ## Build Metadata Identifier
  9645. // Any combination of digits, letters, or hyphens.
  9646. tok('BUILDIDENTIFIER')
  9647. src[t.BUILDIDENTIFIER] = '[0-9A-Za-z-]+'
  9648. // ## Build Metadata
  9649. // Plus sign, followed by one or more period-separated build metadata
  9650. // identifiers.
  9651. tok('BUILD')
  9652. src[t.BUILD] = '(?:\\+(' + src[t.BUILDIDENTIFIER] +
  9653. '(?:\\.' + src[t.BUILDIDENTIFIER] + ')*))'
  9654. // ## Full Version String
  9655. // A main version, followed optionally by a pre-release version and
  9656. // build metadata.
  9657. // Note that the only major, minor, patch, and pre-release sections of
  9658. // the version string are capturing groups. The build metadata is not a
  9659. // capturing group, because it should not ever be used in version
  9660. // comparison.
  9661. tok('FULL')
  9662. tok('FULLPLAIN')
  9663. src[t.FULLPLAIN] = 'v?' + src[t.MAINVERSION] +
  9664. src[t.PRERELEASE] + '?' +
  9665. src[t.BUILD] + '?'
  9666. src[t.FULL] = '^' + src[t.FULLPLAIN] + '$'
  9667. // like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
  9668. // also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
  9669. // common in the npm registry.
  9670. tok('LOOSEPLAIN')
  9671. src[t.LOOSEPLAIN] = '[v=\\s]*' + src[t.MAINVERSIONLOOSE] +
  9672. src[t.PRERELEASELOOSE] + '?' +
  9673. src[t.BUILD] + '?'
  9674. tok('LOOSE')
  9675. src[t.LOOSE] = '^' + src[t.LOOSEPLAIN] + '$'
  9676. tok('GTLT')
  9677. src[t.GTLT] = '((?:<|>)?=?)'
  9678. // Something like "2.*" or "1.2.x".
  9679. // Note that "x.x" is a valid xRange identifer, meaning "any version"
  9680. // Only the first item is strictly required.
  9681. tok('XRANGEIDENTIFIERLOOSE')
  9682. src[t.XRANGEIDENTIFIERLOOSE] = src[t.NUMERICIDENTIFIERLOOSE] + '|x|X|\\*'
  9683. tok('XRANGEIDENTIFIER')
  9684. src[t.XRANGEIDENTIFIER] = src[t.NUMERICIDENTIFIER] + '|x|X|\\*'
  9685. tok('XRANGEPLAIN')
  9686. src[t.XRANGEPLAIN] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIER] + ')' +
  9687. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9688. '(?:\\.(' + src[t.XRANGEIDENTIFIER] + ')' +
  9689. '(?:' + src[t.PRERELEASE] + ')?' +
  9690. src[t.BUILD] + '?' +
  9691. ')?)?'
  9692. tok('XRANGEPLAINLOOSE')
  9693. src[t.XRANGEPLAINLOOSE] = '[v=\\s]*(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9694. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9695. '(?:\\.(' + src[t.XRANGEIDENTIFIERLOOSE] + ')' +
  9696. '(?:' + src[t.PRERELEASELOOSE] + ')?' +
  9697. src[t.BUILD] + '?' +
  9698. ')?)?'
  9699. tok('XRANGE')
  9700. src[t.XRANGE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAIN] + '$'
  9701. tok('XRANGELOOSE')
  9702. src[t.XRANGELOOSE] = '^' + src[t.GTLT] + '\\s*' + src[t.XRANGEPLAINLOOSE] + '$'
  9703. // Coercion.
  9704. // Extract anything that could conceivably be a part of a valid semver
  9705. tok('COERCE')
  9706. src[t.COERCE] = '(^|[^\\d])' +
  9707. '(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '})' +
  9708. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  9709. '(?:\\.(\\d{1,' + MAX_SAFE_COMPONENT_LENGTH + '}))?' +
  9710. '(?:$|[^\\d])'
  9711. tok('COERCERTL')
  9712. re[t.COERCERTL] = new RegExp(src[t.COERCE], 'g')
  9713. // Tilde ranges.
  9714. // Meaning is "reasonably at or greater than"
  9715. tok('LONETILDE')
  9716. src[t.LONETILDE] = '(?:~>?)'
  9717. tok('TILDETRIM')
  9718. src[t.TILDETRIM] = '(\\s*)' + src[t.LONETILDE] + '\\s+'
  9719. re[t.TILDETRIM] = new RegExp(src[t.TILDETRIM], 'g')
  9720. var tildeTrimReplace = '$1~'
  9721. tok('TILDE')
  9722. src[t.TILDE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAIN] + '$'
  9723. tok('TILDELOOSE')
  9724. src[t.TILDELOOSE] = '^' + src[t.LONETILDE] + src[t.XRANGEPLAINLOOSE] + '$'
  9725. // Caret ranges.
  9726. // Meaning is "at least and backwards compatible with"
  9727. tok('LONECARET')
  9728. src[t.LONECARET] = '(?:\\^)'
  9729. tok('CARETTRIM')
  9730. src[t.CARETTRIM] = '(\\s*)' + src[t.LONECARET] + '\\s+'
  9731. re[t.CARETTRIM] = new RegExp(src[t.CARETTRIM], 'g')
  9732. var caretTrimReplace = '$1^'
  9733. tok('CARET')
  9734. src[t.CARET] = '^' + src[t.LONECARET] + src[t.XRANGEPLAIN] + '$'
  9735. tok('CARETLOOSE')
  9736. src[t.CARETLOOSE] = '^' + src[t.LONECARET] + src[t.XRANGEPLAINLOOSE] + '$'
  9737. // A simple gt/lt/eq thing, or just "" to indicate "any version"
  9738. tok('COMPARATORLOOSE')
  9739. src[t.COMPARATORLOOSE] = '^' + src[t.GTLT] + '\\s*(' + src[t.LOOSEPLAIN] + ')$|^$'
  9740. tok('COMPARATOR')
  9741. src[t.COMPARATOR] = '^' + src[t.GTLT] + '\\s*(' + src[t.FULLPLAIN] + ')$|^$'
  9742. // An expression to strip any whitespace between the gtlt and the thing
  9743. // it modifies, so that `> 1.2.3` ==> `>1.2.3`
  9744. tok('COMPARATORTRIM')
  9745. src[t.COMPARATORTRIM] = '(\\s*)' + src[t.GTLT] +
  9746. '\\s*(' + src[t.LOOSEPLAIN] + '|' + src[t.XRANGEPLAIN] + ')'
  9747. // this one has to use the /g flag
  9748. re[t.COMPARATORTRIM] = new RegExp(src[t.COMPARATORTRIM], 'g')
  9749. var comparatorTrimReplace = '$1$2$3'
  9750. // Something like `1.2.3 - 1.2.4`
  9751. // Note that these all use the loose form, because they'll be
  9752. // checked against either the strict or loose comparator form
  9753. // later.
  9754. tok('HYPHENRANGE')
  9755. src[t.HYPHENRANGE] = '^\\s*(' + src[t.XRANGEPLAIN] + ')' +
  9756. '\\s+-\\s+' +
  9757. '(' + src[t.XRANGEPLAIN] + ')' +
  9758. '\\s*$'
  9759. tok('HYPHENRANGELOOSE')
  9760. src[t.HYPHENRANGELOOSE] = '^\\s*(' + src[t.XRANGEPLAINLOOSE] + ')' +
  9761. '\\s+-\\s+' +
  9762. '(' + src[t.XRANGEPLAINLOOSE] + ')' +
  9763. '\\s*$'
  9764. // Star ranges basically just allow anything at all.
  9765. tok('STAR')
  9766. src[t.STAR] = '(<|>)?=?\\s*\\*'
  9767. // Compile to actual regexp objects.
  9768. // All are flag-free, unless they were created above with a flag.
  9769. for (var i = 0; i < R; i++) {
  9770. debug(i, src[i])
  9771. if (!re[i]) {
  9772. re[i] = new RegExp(src[i])
  9773. }
  9774. }
  9775. exports.parse = parse
  9776. function parse (version, options) {
  9777. if (!options || typeof options !== 'object') {
  9778. options = {
  9779. loose: !!options,
  9780. includePrerelease: false
  9781. }
  9782. }
  9783. if (version instanceof SemVer) {
  9784. return version
  9785. }
  9786. if (typeof version !== 'string') {
  9787. return null
  9788. }
  9789. if (version.length > MAX_LENGTH) {
  9790. return null
  9791. }
  9792. var r = options.loose ? re[t.LOOSE] : re[t.FULL]
  9793. if (!r.test(version)) {
  9794. return null
  9795. }
  9796. try {
  9797. return new SemVer(version, options)
  9798. } catch (er) {
  9799. return null
  9800. }
  9801. }
  9802. exports.valid = valid
  9803. function valid (version, options) {
  9804. var v = parse(version, options)
  9805. return v ? v.version : null
  9806. }
  9807. exports.clean = clean
  9808. function clean (version, options) {
  9809. var s = parse(version.trim().replace(/^[=v]+/, ''), options)
  9810. return s ? s.version : null
  9811. }
  9812. exports.SemVer = SemVer
  9813. function SemVer (version, options) {
  9814. if (!options || typeof options !== 'object') {
  9815. options = {
  9816. loose: !!options,
  9817. includePrerelease: false
  9818. }
  9819. }
  9820. if (version instanceof SemVer) {
  9821. if (version.loose === options.loose) {
  9822. return version
  9823. } else {
  9824. version = version.version
  9825. }
  9826. } else if (typeof version !== 'string') {
  9827. throw new TypeError('Invalid Version: ' + version)
  9828. }
  9829. if (version.length > MAX_LENGTH) {
  9830. throw new TypeError('version is longer than ' + MAX_LENGTH + ' characters')
  9831. }
  9832. if (!(this instanceof SemVer)) {
  9833. return new SemVer(version, options)
  9834. }
  9835. debug('SemVer', version, options)
  9836. this.options = options
  9837. this.loose = !!options.loose
  9838. var m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])
  9839. if (!m) {
  9840. throw new TypeError('Invalid Version: ' + version)
  9841. }
  9842. this.raw = version
  9843. // these are actually numbers
  9844. this.major = +m[1]
  9845. this.minor = +m[2]
  9846. this.patch = +m[3]
  9847. if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
  9848. throw new TypeError('Invalid major version')
  9849. }
  9850. if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
  9851. throw new TypeError('Invalid minor version')
  9852. }
  9853. if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
  9854. throw new TypeError('Invalid patch version')
  9855. }
  9856. // numberify any prerelease numeric ids
  9857. if (!m[4]) {
  9858. this.prerelease = []
  9859. } else {
  9860. this.prerelease = m[4].split('.').map(function (id) {
  9861. if (/^[0-9]+$/.test(id)) {
  9862. var num = +id
  9863. if (num >= 0 && num < MAX_SAFE_INTEGER) {
  9864. return num
  9865. }
  9866. }
  9867. return id
  9868. })
  9869. }
  9870. this.build = m[5] ? m[5].split('.') : []
  9871. this.format()
  9872. }
  9873. SemVer.prototype.format = function () {
  9874. this.version = this.major + '.' + this.minor + '.' + this.patch
  9875. if (this.prerelease.length) {
  9876. this.version += '-' + this.prerelease.join('.')
  9877. }
  9878. return this.version
  9879. }
  9880. SemVer.prototype.toString = function () {
  9881. return this.version
  9882. }
  9883. SemVer.prototype.compare = function (other) {
  9884. debug('SemVer.compare', this.version, this.options, other)
  9885. if (!(other instanceof SemVer)) {
  9886. other = new SemVer(other, this.options)
  9887. }
  9888. return this.compareMain(other) || this.comparePre(other)
  9889. }
  9890. SemVer.prototype.compareMain = function (other) {
  9891. if (!(other instanceof SemVer)) {
  9892. other = new SemVer(other, this.options)
  9893. }
  9894. return compareIdentifiers(this.major, other.major) ||
  9895. compareIdentifiers(this.minor, other.minor) ||
  9896. compareIdentifiers(this.patch, other.patch)
  9897. }
  9898. SemVer.prototype.comparePre = function (other) {
  9899. if (!(other instanceof SemVer)) {
  9900. other = new SemVer(other, this.options)
  9901. }
  9902. // NOT having a prerelease is > having one
  9903. if (this.prerelease.length && !other.prerelease.length) {
  9904. return -1
  9905. } else if (!this.prerelease.length && other.prerelease.length) {
  9906. return 1
  9907. } else if (!this.prerelease.length && !other.prerelease.length) {
  9908. return 0
  9909. }
  9910. var i = 0
  9911. do {
  9912. var a = this.prerelease[i]
  9913. var b = other.prerelease[i]
  9914. debug('prerelease compare', i, a, b)
  9915. if (a === undefined && b === undefined) {
  9916. return 0
  9917. } else if (b === undefined) {
  9918. return 1
  9919. } else if (a === undefined) {
  9920. return -1
  9921. } else if (a === b) {
  9922. continue
  9923. } else {
  9924. return compareIdentifiers(a, b)
  9925. }
  9926. } while (++i)
  9927. }
  9928. SemVer.prototype.compareBuild = function (other) {
  9929. if (!(other instanceof SemVer)) {
  9930. other = new SemVer(other, this.options)
  9931. }
  9932. var i = 0
  9933. do {
  9934. var a = this.build[i]
  9935. var b = other.build[i]
  9936. debug('prerelease compare', i, a, b)
  9937. if (a === undefined && b === undefined) {
  9938. return 0
  9939. } else if (b === undefined) {
  9940. return 1
  9941. } else if (a === undefined) {
  9942. return -1
  9943. } else if (a === b) {
  9944. continue
  9945. } else {
  9946. return compareIdentifiers(a, b)
  9947. }
  9948. } while (++i)
  9949. }
  9950. // preminor will bump the version up to the next minor release, and immediately
  9951. // down to pre-release. premajor and prepatch work the same way.
  9952. SemVer.prototype.inc = function (release, identifier) {
  9953. switch (release) {
  9954. case 'premajor':
  9955. this.prerelease.length = 0
  9956. this.patch = 0
  9957. this.minor = 0
  9958. this.major++
  9959. this.inc('pre', identifier)
  9960. break
  9961. case 'preminor':
  9962. this.prerelease.length = 0
  9963. this.patch = 0
  9964. this.minor++
  9965. this.inc('pre', identifier)
  9966. break
  9967. case 'prepatch':
  9968. // If this is already a prerelease, it will bump to the next version
  9969. // drop any prereleases that might already exist, since they are not
  9970. // relevant at this point.
  9971. this.prerelease.length = 0
  9972. this.inc('patch', identifier)
  9973. this.inc('pre', identifier)
  9974. break
  9975. // If the input is a non-prerelease version, this acts the same as
  9976. // prepatch.
  9977. case 'prerelease':
  9978. if (this.prerelease.length === 0) {
  9979. this.inc('patch', identifier)
  9980. }
  9981. this.inc('pre', identifier)
  9982. break
  9983. case 'major':
  9984. // If this is a pre-major version, bump up to the same major version.
  9985. // Otherwise increment major.
  9986. // 1.0.0-5 bumps to 1.0.0
  9987. // 1.1.0 bumps to 2.0.0
  9988. if (this.minor !== 0 ||
  9989. this.patch !== 0 ||
  9990. this.prerelease.length === 0) {
  9991. this.major++
  9992. }
  9993. this.minor = 0
  9994. this.patch = 0
  9995. this.prerelease = []
  9996. break
  9997. case 'minor':
  9998. // If this is a pre-minor version, bump up to the same minor version.
  9999. // Otherwise increment minor.
  10000. // 1.2.0-5 bumps to 1.2.0
  10001. // 1.2.1 bumps to 1.3.0
  10002. if (this.patch !== 0 || this.prerelease.length === 0) {
  10003. this.minor++
  10004. }
  10005. this.patch = 0
  10006. this.prerelease = []
  10007. break
  10008. case 'patch':
  10009. // If this is not a pre-release version, it will increment the patch.
  10010. // If it is a pre-release it will bump up to the same patch version.
  10011. // 1.2.0-5 patches to 1.2.0
  10012. // 1.2.0 patches to 1.2.1
  10013. if (this.prerelease.length === 0) {
  10014. this.patch++
  10015. }
  10016. this.prerelease = []
  10017. break
  10018. // This probably shouldn't be used publicly.
  10019. // 1.0.0 "pre" would become 1.0.0-0 which is the wrong direction.
  10020. case 'pre':
  10021. if (this.prerelease.length === 0) {
  10022. this.prerelease = [0]
  10023. } else {
  10024. var i = this.prerelease.length
  10025. while (--i >= 0) {
  10026. if (typeof this.prerelease[i] === 'number') {
  10027. this.prerelease[i]++
  10028. i = -2
  10029. }
  10030. }
  10031. if (i === -1) {
  10032. // didn't increment anything
  10033. this.prerelease.push(0)
  10034. }
  10035. }
  10036. if (identifier) {
  10037. // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
  10038. // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
  10039. if (this.prerelease[0] === identifier) {
  10040. if (isNaN(this.prerelease[1])) {
  10041. this.prerelease = [identifier, 0]
  10042. }
  10043. } else {
  10044. this.prerelease = [identifier, 0]
  10045. }
  10046. }
  10047. break
  10048. default:
  10049. throw new Error('invalid increment argument: ' + release)
  10050. }
  10051. this.format()
  10052. this.raw = this.version
  10053. return this
  10054. }
  10055. exports.inc = inc
  10056. function inc (version, release, loose, identifier) {
  10057. if (typeof (loose) === 'string') {
  10058. identifier = loose
  10059. loose = undefined
  10060. }
  10061. try {
  10062. return new SemVer(version, loose).inc(release, identifier).version
  10063. } catch (er) {
  10064. return null
  10065. }
  10066. }
  10067. exports.diff = diff
  10068. function diff (version1, version2) {
  10069. if (eq(version1, version2)) {
  10070. return null
  10071. } else {
  10072. var v1 = parse(version1)
  10073. var v2 = parse(version2)
  10074. var prefix = ''
  10075. if (v1.prerelease.length || v2.prerelease.length) {
  10076. prefix = 'pre'
  10077. var defaultResult = 'prerelease'
  10078. }
  10079. for (var key in v1) {
  10080. if (key === 'major' || key === 'minor' || key === 'patch') {
  10081. if (v1[key] !== v2[key]) {
  10082. return prefix + key
  10083. }
  10084. }
  10085. }
  10086. return defaultResult // may be undefined
  10087. }
  10088. }
  10089. exports.compareIdentifiers = compareIdentifiers
  10090. var numeric = /^[0-9]+$/
  10091. function compareIdentifiers (a, b) {
  10092. var anum = numeric.test(a)
  10093. var bnum = numeric.test(b)
  10094. if (anum && bnum) {
  10095. a = +a
  10096. b = +b
  10097. }
  10098. return a === b ? 0
  10099. : (anum && !bnum) ? -1
  10100. : (bnum && !anum) ? 1
  10101. : a < b ? -1
  10102. : 1
  10103. }
  10104. exports.rcompareIdentifiers = rcompareIdentifiers
  10105. function rcompareIdentifiers (a, b) {
  10106. return compareIdentifiers(b, a)
  10107. }
  10108. exports.major = major
  10109. function major (a, loose) {
  10110. return new SemVer(a, loose).major
  10111. }
  10112. exports.minor = minor
  10113. function minor (a, loose) {
  10114. return new SemVer(a, loose).minor
  10115. }
  10116. exports.patch = patch
  10117. function patch (a, loose) {
  10118. return new SemVer(a, loose).patch
  10119. }
  10120. exports.compare = compare
  10121. function compare (a, b, loose) {
  10122. return new SemVer(a, loose).compare(new SemVer(b, loose))
  10123. }
  10124. exports.compareLoose = compareLoose
  10125. function compareLoose (a, b) {
  10126. return compare(a, b, true)
  10127. }
  10128. exports.compareBuild = compareBuild
  10129. function compareBuild (a, b, loose) {
  10130. var versionA = new SemVer(a, loose)
  10131. var versionB = new SemVer(b, loose)
  10132. return versionA.compare(versionB) || versionA.compareBuild(versionB)
  10133. }
  10134. exports.rcompare = rcompare
  10135. function rcompare (a, b, loose) {
  10136. return compare(b, a, loose)
  10137. }
  10138. exports.sort = sort
  10139. function sort (list, loose) {
  10140. return list.sort(function (a, b) {
  10141. return exports.compareBuild(a, b, loose)
  10142. })
  10143. }
  10144. exports.rsort = rsort
  10145. function rsort (list, loose) {
  10146. return list.sort(function (a, b) {
  10147. return exports.compareBuild(b, a, loose)
  10148. })
  10149. }
  10150. exports.gt = gt
  10151. function gt (a, b, loose) {
  10152. return compare(a, b, loose) > 0
  10153. }
  10154. exports.lt = lt
  10155. function lt (a, b, loose) {
  10156. return compare(a, b, loose) < 0
  10157. }
  10158. exports.eq = eq
  10159. function eq (a, b, loose) {
  10160. return compare(a, b, loose) === 0
  10161. }
  10162. exports.neq = neq
  10163. function neq (a, b, loose) {
  10164. return compare(a, b, loose) !== 0
  10165. }
  10166. exports.gte = gte
  10167. function gte (a, b, loose) {
  10168. return compare(a, b, loose) >= 0
  10169. }
  10170. exports.lte = lte
  10171. function lte (a, b, loose) {
  10172. return compare(a, b, loose) <= 0
  10173. }
  10174. exports.cmp = cmp
  10175. function cmp (a, op, b, loose) {
  10176. switch (op) {
  10177. case '===':
  10178. if (typeof a === 'object')
  10179. a = a.version
  10180. if (typeof b === 'object')
  10181. b = b.version
  10182. return a === b
  10183. case '!==':
  10184. if (typeof a === 'object')
  10185. a = a.version
  10186. if (typeof b === 'object')
  10187. b = b.version
  10188. return a !== b
  10189. case '':
  10190. case '=':
  10191. case '==':
  10192. return eq(a, b, loose)
  10193. case '!=':
  10194. return neq(a, b, loose)
  10195. case '>':
  10196. return gt(a, b, loose)
  10197. case '>=':
  10198. return gte(a, b, loose)
  10199. case '<':
  10200. return lt(a, b, loose)
  10201. case '<=':
  10202. return lte(a, b, loose)
  10203. default:
  10204. throw new TypeError('Invalid operator: ' + op)
  10205. }
  10206. }
  10207. exports.Comparator = Comparator
  10208. function Comparator (comp, options) {
  10209. if (!options || typeof options !== 'object') {
  10210. options = {
  10211. loose: !!options,
  10212. includePrerelease: false
  10213. }
  10214. }
  10215. if (comp instanceof Comparator) {
  10216. if (comp.loose === !!options.loose) {
  10217. return comp
  10218. } else {
  10219. comp = comp.value
  10220. }
  10221. }
  10222. if (!(this instanceof Comparator)) {
  10223. return new Comparator(comp, options)
  10224. }
  10225. debug('comparator', comp, options)
  10226. this.options = options
  10227. this.loose = !!options.loose
  10228. this.parse(comp)
  10229. if (this.semver === ANY) {
  10230. this.value = ''
  10231. } else {
  10232. this.value = this.operator + this.semver.version
  10233. }
  10234. debug('comp', this)
  10235. }
  10236. var ANY = {}
  10237. Comparator.prototype.parse = function (comp) {
  10238. var r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10239. var m = comp.match(r)
  10240. if (!m) {
  10241. throw new TypeError('Invalid comparator: ' + comp)
  10242. }
  10243. this.operator = m[1] !== undefined ? m[1] : ''
  10244. if (this.operator === '=') {
  10245. this.operator = ''
  10246. }
  10247. // if it literally is just '>' or '' then allow anything.
  10248. if (!m[2]) {
  10249. this.semver = ANY
  10250. } else {
  10251. this.semver = new SemVer(m[2], this.options.loose)
  10252. }
  10253. }
  10254. Comparator.prototype.toString = function () {
  10255. return this.value
  10256. }
  10257. Comparator.prototype.test = function (version) {
  10258. debug('Comparator.test', version, this.options.loose)
  10259. if (this.semver === ANY || version === ANY) {
  10260. return true
  10261. }
  10262. if (typeof version === 'string') {
  10263. try {
  10264. version = new SemVer(version, this.options)
  10265. } catch (er) {
  10266. return false
  10267. }
  10268. }
  10269. return cmp(version, this.operator, this.semver, this.options)
  10270. }
  10271. Comparator.prototype.intersects = function (comp, options) {
  10272. if (!(comp instanceof Comparator)) {
  10273. throw new TypeError('a Comparator is required')
  10274. }
  10275. if (!options || typeof options !== 'object') {
  10276. options = {
  10277. loose: !!options,
  10278. includePrerelease: false
  10279. }
  10280. }
  10281. var rangeTmp
  10282. if (this.operator === '') {
  10283. if (this.value === '') {
  10284. return true
  10285. }
  10286. rangeTmp = new Range(comp.value, options)
  10287. return satisfies(this.value, rangeTmp, options)
  10288. } else if (comp.operator === '') {
  10289. if (comp.value === '') {
  10290. return true
  10291. }
  10292. rangeTmp = new Range(this.value, options)
  10293. return satisfies(comp.semver, rangeTmp, options)
  10294. }
  10295. var sameDirectionIncreasing =
  10296. (this.operator === '>=' || this.operator === '>') &&
  10297. (comp.operator === '>=' || comp.operator === '>')
  10298. var sameDirectionDecreasing =
  10299. (this.operator === '<=' || this.operator === '<') &&
  10300. (comp.operator === '<=' || comp.operator === '<')
  10301. var sameSemVer = this.semver.version === comp.semver.version
  10302. var differentDirectionsInclusive =
  10303. (this.operator === '>=' || this.operator === '<=') &&
  10304. (comp.operator === '>=' || comp.operator === '<=')
  10305. var oppositeDirectionsLessThan =
  10306. cmp(this.semver, '<', comp.semver, options) &&
  10307. ((this.operator === '>=' || this.operator === '>') &&
  10308. (comp.operator === '<=' || comp.operator === '<'))
  10309. var oppositeDirectionsGreaterThan =
  10310. cmp(this.semver, '>', comp.semver, options) &&
  10311. ((this.operator === '<=' || this.operator === '<') &&
  10312. (comp.operator === '>=' || comp.operator === '>'))
  10313. return sameDirectionIncreasing || sameDirectionDecreasing ||
  10314. (sameSemVer && differentDirectionsInclusive) ||
  10315. oppositeDirectionsLessThan || oppositeDirectionsGreaterThan
  10316. }
  10317. exports.Range = Range
  10318. function Range (range, options) {
  10319. if (!options || typeof options !== 'object') {
  10320. options = {
  10321. loose: !!options,
  10322. includePrerelease: false
  10323. }
  10324. }
  10325. if (range instanceof Range) {
  10326. if (range.loose === !!options.loose &&
  10327. range.includePrerelease === !!options.includePrerelease) {
  10328. return range
  10329. } else {
  10330. return new Range(range.raw, options)
  10331. }
  10332. }
  10333. if (range instanceof Comparator) {
  10334. return new Range(range.value, options)
  10335. }
  10336. if (!(this instanceof Range)) {
  10337. return new Range(range, options)
  10338. }
  10339. this.options = options
  10340. this.loose = !!options.loose
  10341. this.includePrerelease = !!options.includePrerelease
  10342. // First, split based on boolean or ||
  10343. this.raw = range
  10344. this.set = range.split(/\s*\|\|\s*/).map(function (range) {
  10345. return this.parseRange(range.trim())
  10346. }, this).filter(function (c) {
  10347. // throw out any that are not relevant for whatever reason
  10348. return c.length
  10349. })
  10350. if (!this.set.length) {
  10351. throw new TypeError('Invalid SemVer Range: ' + range)
  10352. }
  10353. this.format()
  10354. }
  10355. Range.prototype.format = function () {
  10356. this.range = this.set.map(function (comps) {
  10357. return comps.join(' ').trim()
  10358. }).join('||').trim()
  10359. return this.range
  10360. }
  10361. Range.prototype.toString = function () {
  10362. return this.range
  10363. }
  10364. Range.prototype.parseRange = function (range) {
  10365. var loose = this.options.loose
  10366. range = range.trim()
  10367. // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
  10368. var hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
  10369. range = range.replace(hr, hyphenReplace)
  10370. debug('hyphen replace', range)
  10371. // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
  10372. range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
  10373. debug('comparator trim', range, re[t.COMPARATORTRIM])
  10374. // `~ 1.2.3` => `~1.2.3`
  10375. range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
  10376. // `^ 1.2.3` => `^1.2.3`
  10377. range = range.replace(re[t.CARETTRIM], caretTrimReplace)
  10378. // normalize spaces
  10379. range = range.split(/\s+/).join(' ')
  10380. // At this point, the range is completely trimmed and
  10381. // ready to be split into comparators.
  10382. var compRe = loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
  10383. var set = range.split(' ').map(function (comp) {
  10384. return parseComparator(comp, this.options)
  10385. }, this).join(' ').split(/\s+/)
  10386. if (this.options.loose) {
  10387. // in loose mode, throw out any that are not valid comparators
  10388. set = set.filter(function (comp) {
  10389. return !!comp.match(compRe)
  10390. })
  10391. }
  10392. set = set.map(function (comp) {
  10393. return new Comparator(comp, this.options)
  10394. }, this)
  10395. return set
  10396. }
  10397. Range.prototype.intersects = function (range, options) {
  10398. if (!(range instanceof Range)) {
  10399. throw new TypeError('a Range is required')
  10400. }
  10401. return this.set.some(function (thisComparators) {
  10402. return (
  10403. isSatisfiable(thisComparators, options) &&
  10404. range.set.some(function (rangeComparators) {
  10405. return (
  10406. isSatisfiable(rangeComparators, options) &&
  10407. thisComparators.every(function (thisComparator) {
  10408. return rangeComparators.every(function (rangeComparator) {
  10409. return thisComparator.intersects(rangeComparator, options)
  10410. })
  10411. })
  10412. )
  10413. })
  10414. )
  10415. })
  10416. }
  10417. // take a set of comparators and determine whether there
  10418. // exists a version which can satisfy it
  10419. function isSatisfiable (comparators, options) {
  10420. var result = true
  10421. var remainingComparators = comparators.slice()
  10422. var testComparator = remainingComparators.pop()
  10423. while (result && remainingComparators.length) {
  10424. result = remainingComparators.every(function (otherComparator) {
  10425. return testComparator.intersects(otherComparator, options)
  10426. })
  10427. testComparator = remainingComparators.pop()
  10428. }
  10429. return result
  10430. }
  10431. // Mostly just for testing and legacy API reasons
  10432. exports.toComparators = toComparators
  10433. function toComparators (range, options) {
  10434. return new Range(range, options).set.map(function (comp) {
  10435. return comp.map(function (c) {
  10436. return c.value
  10437. }).join(' ').trim().split(' ')
  10438. })
  10439. }
  10440. // comprised of xranges, tildes, stars, and gtlt's at this point.
  10441. // already replaced the hyphen ranges
  10442. // turn into a set of JUST comparators.
  10443. function parseComparator (comp, options) {
  10444. debug('comp', comp, options)
  10445. comp = replaceCarets(comp, options)
  10446. debug('caret', comp)
  10447. comp = replaceTildes(comp, options)
  10448. debug('tildes', comp)
  10449. comp = replaceXRanges(comp, options)
  10450. debug('xrange', comp)
  10451. comp = replaceStars(comp, options)
  10452. debug('stars', comp)
  10453. return comp
  10454. }
  10455. function isX (id) {
  10456. return !id || id.toLowerCase() === 'x' || id === '*'
  10457. }
  10458. // ~, ~> --> * (any, kinda silly)
  10459. // ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0
  10460. // ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0
  10461. // ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0
  10462. // ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0
  10463. // ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0
  10464. function replaceTildes (comp, options) {
  10465. return comp.trim().split(/\s+/).map(function (comp) {
  10466. return replaceTilde(comp, options)
  10467. }).join(' ')
  10468. }
  10469. function replaceTilde (comp, options) {
  10470. var r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  10471. return comp.replace(r, function (_, M, m, p, pr) {
  10472. debug('tilde', comp, _, M, m, p, pr)
  10473. var ret
  10474. if (isX(M)) {
  10475. ret = ''
  10476. } else if (isX(m)) {
  10477. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10478. } else if (isX(p)) {
  10479. // ~1.2 == >=1.2.0 <1.3.0
  10480. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10481. } else if (pr) {
  10482. debug('replaceTilde pr', pr)
  10483. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10484. ' <' + M + '.' + (+m + 1) + '.0'
  10485. } else {
  10486. // ~1.2.3 == >=1.2.3 <1.3.0
  10487. ret = '>=' + M + '.' + m + '.' + p +
  10488. ' <' + M + '.' + (+m + 1) + '.0'
  10489. }
  10490. debug('tilde return', ret)
  10491. return ret
  10492. })
  10493. }
  10494. // ^ --> * (any, kinda silly)
  10495. // ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0
  10496. // ^2.0, ^2.0.x --> >=2.0.0 <3.0.0
  10497. // ^1.2, ^1.2.x --> >=1.2.0 <2.0.0
  10498. // ^1.2.3 --> >=1.2.3 <2.0.0
  10499. // ^1.2.0 --> >=1.2.0 <2.0.0
  10500. function replaceCarets (comp, options) {
  10501. return comp.trim().split(/\s+/).map(function (comp) {
  10502. return replaceCaret(comp, options)
  10503. }).join(' ')
  10504. }
  10505. function replaceCaret (comp, options) {
  10506. debug('caret', comp, options)
  10507. var r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  10508. return comp.replace(r, function (_, M, m, p, pr) {
  10509. debug('caret', comp, _, M, m, p, pr)
  10510. var ret
  10511. if (isX(M)) {
  10512. ret = ''
  10513. } else if (isX(m)) {
  10514. ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'
  10515. } else if (isX(p)) {
  10516. if (M === '0') {
  10517. ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'
  10518. } else {
  10519. ret = '>=' + M + '.' + m + '.0 <' + (+M + 1) + '.0.0'
  10520. }
  10521. } else if (pr) {
  10522. debug('replaceCaret pr', pr)
  10523. if (M === '0') {
  10524. if (m === '0') {
  10525. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10526. ' <' + M + '.' + m + '.' + (+p + 1)
  10527. } else {
  10528. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10529. ' <' + M + '.' + (+m + 1) + '.0'
  10530. }
  10531. } else {
  10532. ret = '>=' + M + '.' + m + '.' + p + '-' + pr +
  10533. ' <' + (+M + 1) + '.0.0'
  10534. }
  10535. } else {
  10536. debug('no pr')
  10537. if (M === '0') {
  10538. if (m === '0') {
  10539. ret = '>=' + M + '.' + m + '.' + p +
  10540. ' <' + M + '.' + m + '.' + (+p + 1)
  10541. } else {
  10542. ret = '>=' + M + '.' + m + '.' + p +
  10543. ' <' + M + '.' + (+m + 1) + '.0'
  10544. }
  10545. } else {
  10546. ret = '>=' + M + '.' + m + '.' + p +
  10547. ' <' + (+M + 1) + '.0.0'
  10548. }
  10549. }
  10550. debug('caret return', ret)
  10551. return ret
  10552. })
  10553. }
  10554. function replaceXRanges (comp, options) {
  10555. debug('replaceXRanges', comp, options)
  10556. return comp.split(/\s+/).map(function (comp) {
  10557. return replaceXRange(comp, options)
  10558. }).join(' ')
  10559. }
  10560. function replaceXRange (comp, options) {
  10561. comp = comp.trim()
  10562. var r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  10563. return comp.replace(r, function (ret, gtlt, M, m, p, pr) {
  10564. debug('xRange', comp, ret, gtlt, M, m, p, pr)
  10565. var xM = isX(M)
  10566. var xm = xM || isX(m)
  10567. var xp = xm || isX(p)
  10568. var anyX = xp
  10569. if (gtlt === '=' && anyX) {
  10570. gtlt = ''
  10571. }
  10572. // if we're including prereleases in the match, then we need
  10573. // to fix this to -0, the lowest possible prerelease value
  10574. pr = options.includePrerelease ? '-0' : ''
  10575. if (xM) {
  10576. if (gtlt === '>' || gtlt === '<') {
  10577. // nothing is allowed
  10578. ret = '<0.0.0-0'
  10579. } else {
  10580. // nothing is forbidden
  10581. ret = '*'
  10582. }
  10583. } else if (gtlt && anyX) {
  10584. // we know patch is an x, because we have any x at all.
  10585. // replace X with 0
  10586. if (xm) {
  10587. m = 0
  10588. }
  10589. p = 0
  10590. if (gtlt === '>') {
  10591. // >1 => >=2.0.0
  10592. // >1.2 => >=1.3.0
  10593. // >1.2.3 => >= 1.2.4
  10594. gtlt = '>='
  10595. if (xm) {
  10596. M = +M + 1
  10597. m = 0
  10598. p = 0
  10599. } else {
  10600. m = +m + 1
  10601. p = 0
  10602. }
  10603. } else if (gtlt === '<=') {
  10604. // <=0.7.x is actually <0.8.0, since any 0.7.x should
  10605. // pass. Similarly, <=7.x is actually <8.0.0, etc.
  10606. gtlt = '<'
  10607. if (xm) {
  10608. M = +M + 1
  10609. } else {
  10610. m = +m + 1
  10611. }
  10612. }
  10613. ret = gtlt + M + '.' + m + '.' + p + pr
  10614. } else if (xm) {
  10615. ret = '>=' + M + '.0.0' + pr + ' <' + (+M + 1) + '.0.0' + pr
  10616. } else if (xp) {
  10617. ret = '>=' + M + '.' + m + '.0' + pr +
  10618. ' <' + M + '.' + (+m + 1) + '.0' + pr
  10619. }
  10620. debug('xRange return', ret)
  10621. return ret
  10622. })
  10623. }
  10624. // Because * is AND-ed with everything else in the comparator,
  10625. // and '' means "any version", just remove the *s entirely.
  10626. function replaceStars (comp, options) {
  10627. debug('replaceStars', comp, options)
  10628. // Looseness is ignored here. star is always as loose as it gets!
  10629. return comp.trim().replace(re[t.STAR], '')
  10630. }
  10631. // This function is passed to string.replace(re[t.HYPHENRANGE])
  10632. // M, m, patch, prerelease, build
  10633. // 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
  10634. // 1.2.3 - 3.4 => >=1.2.0 <3.5.0 Any 3.4.x will do
  10635. // 1.2 - 3.4 => >=1.2.0 <3.5.0
  10636. function hyphenReplace ($0,
  10637. from, fM, fm, fp, fpr, fb,
  10638. to, tM, tm, tp, tpr, tb) {
  10639. if (isX(fM)) {
  10640. from = ''
  10641. } else if (isX(fm)) {
  10642. from = '>=' + fM + '.0.0'
  10643. } else if (isX(fp)) {
  10644. from = '>=' + fM + '.' + fm + '.0'
  10645. } else {
  10646. from = '>=' + from
  10647. }
  10648. if (isX(tM)) {
  10649. to = ''
  10650. } else if (isX(tm)) {
  10651. to = '<' + (+tM + 1) + '.0.0'
  10652. } else if (isX(tp)) {
  10653. to = '<' + tM + '.' + (+tm + 1) + '.0'
  10654. } else if (tpr) {
  10655. to = '<=' + tM + '.' + tm + '.' + tp + '-' + tpr
  10656. } else {
  10657. to = '<=' + to
  10658. }
  10659. return (from + ' ' + to).trim()
  10660. }
  10661. // if ANY of the sets match ALL of its comparators, then pass
  10662. Range.prototype.test = function (version) {
  10663. if (!version) {
  10664. return false
  10665. }
  10666. if (typeof version === 'string') {
  10667. try {
  10668. version = new SemVer(version, this.options)
  10669. } catch (er) {
  10670. return false
  10671. }
  10672. }
  10673. for (var i = 0; i < this.set.length; i++) {
  10674. if (testSet(this.set[i], version, this.options)) {
  10675. return true
  10676. }
  10677. }
  10678. return false
  10679. }
  10680. function testSet (set, version, options) {
  10681. for (var i = 0; i < set.length; i++) {
  10682. if (!set[i].test(version)) {
  10683. return false
  10684. }
  10685. }
  10686. if (version.prerelease.length && !options.includePrerelease) {
  10687. // Find the set of versions that are allowed to have prereleases
  10688. // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
  10689. // That should allow `1.2.3-pr.2` to pass.
  10690. // However, `1.2.4-alpha.notready` should NOT be allowed,
  10691. // even though it's within the range set by the comparators.
  10692. for (i = 0; i < set.length; i++) {
  10693. debug(set[i].semver)
  10694. if (set[i].semver === ANY) {
  10695. continue
  10696. }
  10697. if (set[i].semver.prerelease.length > 0) {
  10698. var allowed = set[i].semver
  10699. if (allowed.major === version.major &&
  10700. allowed.minor === version.minor &&
  10701. allowed.patch === version.patch) {
  10702. return true
  10703. }
  10704. }
  10705. }
  10706. // Version has a -pre, but it's not one of the ones we like.
  10707. return false
  10708. }
  10709. return true
  10710. }
  10711. exports.satisfies = satisfies
  10712. function satisfies (version, range, options) {
  10713. try {
  10714. range = new Range(range, options)
  10715. } catch (er) {
  10716. return false
  10717. }
  10718. return range.test(version)
  10719. }
  10720. exports.maxSatisfying = maxSatisfying
  10721. function maxSatisfying (versions, range, options) {
  10722. var max = null
  10723. var maxSV = null
  10724. try {
  10725. var rangeObj = new Range(range, options)
  10726. } catch (er) {
  10727. return null
  10728. }
  10729. versions.forEach(function (v) {
  10730. if (rangeObj.test(v)) {
  10731. // satisfies(v, range, options)
  10732. if (!max || maxSV.compare(v) === -1) {
  10733. // compare(max, v, true)
  10734. max = v
  10735. maxSV = new SemVer(max, options)
  10736. }
  10737. }
  10738. })
  10739. return max
  10740. }
  10741. exports.minSatisfying = minSatisfying
  10742. function minSatisfying (versions, range, options) {
  10743. var min = null
  10744. var minSV = null
  10745. try {
  10746. var rangeObj = new Range(range, options)
  10747. } catch (er) {
  10748. return null
  10749. }
  10750. versions.forEach(function (v) {
  10751. if (rangeObj.test(v)) {
  10752. // satisfies(v, range, options)
  10753. if (!min || minSV.compare(v) === 1) {
  10754. // compare(min, v, true)
  10755. min = v
  10756. minSV = new SemVer(min, options)
  10757. }
  10758. }
  10759. })
  10760. return min
  10761. }
  10762. exports.minVersion = minVersion
  10763. function minVersion (range, loose) {
  10764. range = new Range(range, loose)
  10765. var minver = new SemVer('0.0.0')
  10766. if (range.test(minver)) {
  10767. return minver
  10768. }
  10769. minver = new SemVer('0.0.0-0')
  10770. if (range.test(minver)) {
  10771. return minver
  10772. }
  10773. minver = null
  10774. for (var i = 0; i < range.set.length; ++i) {
  10775. var comparators = range.set[i]
  10776. comparators.forEach(function (comparator) {
  10777. // Clone to avoid manipulating the comparator's semver object.
  10778. var compver = new SemVer(comparator.semver.version)
  10779. switch (comparator.operator) {
  10780. case '>':
  10781. if (compver.prerelease.length === 0) {
  10782. compver.patch++
  10783. } else {
  10784. compver.prerelease.push(0)
  10785. }
  10786. compver.raw = compver.format()
  10787. /* fallthrough */
  10788. case '':
  10789. case '>=':
  10790. if (!minver || gt(minver, compver)) {
  10791. minver = compver
  10792. }
  10793. break
  10794. case '<':
  10795. case '<=':
  10796. /* Ignore maximum versions */
  10797. break
  10798. /* istanbul ignore next */
  10799. default:
  10800. throw new Error('Unexpected operation: ' + comparator.operator)
  10801. }
  10802. })
  10803. }
  10804. if (minver && range.test(minver)) {
  10805. return minver
  10806. }
  10807. return null
  10808. }
  10809. exports.validRange = validRange
  10810. function validRange (range, options) {
  10811. try {
  10812. // Return '*' instead of '' so that truthiness works.
  10813. // This will throw if it's invalid anyway
  10814. return new Range(range, options).range || '*'
  10815. } catch (er) {
  10816. return null
  10817. }
  10818. }
  10819. // Determine if version is less than all the versions possible in the range
  10820. exports.ltr = ltr
  10821. function ltr (version, range, options) {
  10822. return outside(version, range, '<', options)
  10823. }
  10824. // Determine if version is greater than all the versions possible in the range.
  10825. exports.gtr = gtr
  10826. function gtr (version, range, options) {
  10827. return outside(version, range, '>', options)
  10828. }
  10829. exports.outside = outside
  10830. function outside (version, range, hilo, options) {
  10831. version = new SemVer(version, options)
  10832. range = new Range(range, options)
  10833. var gtfn, ltefn, ltfn, comp, ecomp
  10834. switch (hilo) {
  10835. case '>':
  10836. gtfn = gt
  10837. ltefn = lte
  10838. ltfn = lt
  10839. comp = '>'
  10840. ecomp = '>='
  10841. break
  10842. case '<':
  10843. gtfn = lt
  10844. ltefn = gte
  10845. ltfn = gt
  10846. comp = '<'
  10847. ecomp = '<='
  10848. break
  10849. default:
  10850. throw new TypeError('Must provide a hilo val of "<" or ">"')
  10851. }
  10852. // If it satisifes the range it is not outside
  10853. if (satisfies(version, range, options)) {
  10854. return false
  10855. }
  10856. // From now on, variable terms are as if we're in "gtr" mode.
  10857. // but note that everything is flipped for the "ltr" function.
  10858. for (var i = 0; i < range.set.length; ++i) {
  10859. var comparators = range.set[i]
  10860. var high = null
  10861. var low = null
  10862. comparators.forEach(function (comparator) {
  10863. if (comparator.semver === ANY) {
  10864. comparator = new Comparator('>=0.0.0')
  10865. }
  10866. high = high || comparator
  10867. low = low || comparator
  10868. if (gtfn(comparator.semver, high.semver, options)) {
  10869. high = comparator
  10870. } else if (ltfn(comparator.semver, low.semver, options)) {
  10871. low = comparator
  10872. }
  10873. })
  10874. // If the edge version comparator has a operator then our version
  10875. // isn't outside it
  10876. if (high.operator === comp || high.operator === ecomp) {
  10877. return false
  10878. }
  10879. // If the lowest version comparator has an operator and our version
  10880. // is less than it then it isn't higher than the range
  10881. if ((!low.operator || low.operator === comp) &&
  10882. ltefn(version, low.semver)) {
  10883. return false
  10884. } else if (low.operator === ecomp && ltfn(version, low.semver)) {
  10885. return false
  10886. }
  10887. }
  10888. return true
  10889. }
  10890. exports.prerelease = prerelease
  10891. function prerelease (version, options) {
  10892. var parsed = parse(version, options)
  10893. return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
  10894. }
  10895. exports.intersects = intersects
  10896. function intersects (r1, r2, options) {
  10897. r1 = new Range(r1, options)
  10898. r2 = new Range(r2, options)
  10899. return r1.intersects(r2)
  10900. }
  10901. exports.coerce = coerce
  10902. function coerce (version, options) {
  10903. if (version instanceof SemVer) {
  10904. return version
  10905. }
  10906. if (typeof version === 'number') {
  10907. version = String(version)
  10908. }
  10909. if (typeof version !== 'string') {
  10910. return null
  10911. }
  10912. options = options || {}
  10913. var match = null
  10914. if (!options.rtl) {
  10915. match = version.match(re[t.COERCE])
  10916. } else {
  10917. // Find the right-most coercible string that does not share
  10918. // a terminus with a more left-ward coercible string.
  10919. // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
  10920. //
  10921. // Walk through the string checking with a /g regexp
  10922. // Manually set the index so as to pick up overlapping matches.
  10923. // Stop when we get a match that ends at the string end, since no
  10924. // coercible string can be more right-ward without the same terminus.
  10925. var next
  10926. while ((next = re[t.COERCERTL].exec(version)) &&
  10927. (!match || match.index + match[0].length !== version.length)
  10928. ) {
  10929. if (!match ||
  10930. next.index + next[0].length !== match.index + match[0].length) {
  10931. match = next
  10932. }
  10933. re[t.COERCERTL].lastIndex = next.index + next[1].length + next[2].length
  10934. }
  10935. // leave it in a clean state
  10936. re[t.COERCERTL].lastIndex = -1
  10937. }
  10938. if (match === null) {
  10939. return null
  10940. }
  10941. return parse(match[2] +
  10942. '.' + (match[3] || '0') +
  10943. '.' + (match[4] || '0'), options)
  10944. }
  10945. /***/ }),
  10946. /***/ 669:
  10947. /***/ (function(module) {
  10948. module.exports = require("util");
  10949. /***/ }),
  10950. /***/ 672:
  10951. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  10952. "use strict";
  10953. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  10954. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  10955. return new (P || (P = Promise))(function (resolve, reject) {
  10956. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  10957. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  10958. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  10959. step((generator = generator.apply(thisArg, _arguments || [])).next());
  10960. });
  10961. };
  10962. var _a;
  10963. Object.defineProperty(exports, "__esModule", { value: true });
  10964. const assert_1 = __webpack_require__(357);
  10965. const fs = __webpack_require__(747);
  10966. const path = __webpack_require__(622);
  10967. _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;
  10968. exports.IS_WINDOWS = process.platform === 'win32';
  10969. function exists(fsPath) {
  10970. return __awaiter(this, void 0, void 0, function* () {
  10971. try {
  10972. yield exports.stat(fsPath);
  10973. }
  10974. catch (err) {
  10975. if (err.code === 'ENOENT') {
  10976. return false;
  10977. }
  10978. throw err;
  10979. }
  10980. return true;
  10981. });
  10982. }
  10983. exports.exists = exists;
  10984. function isDirectory(fsPath, useStat = false) {
  10985. return __awaiter(this, void 0, void 0, function* () {
  10986. const stats = useStat ? yield exports.stat(fsPath) : yield exports.lstat(fsPath);
  10987. return stats.isDirectory();
  10988. });
  10989. }
  10990. exports.isDirectory = isDirectory;
  10991. /**
  10992. * On OSX/Linux, true if path starts with '/'. On Windows, true for paths like:
  10993. * \, \hello, \\hello\share, C:, and C:\hello (and corresponding alternate separator cases).
  10994. */
  10995. function isRooted(p) {
  10996. p = normalizeSeparators(p);
  10997. if (!p) {
  10998. throw new Error('isRooted() parameter "p" cannot be empty');
  10999. }
  11000. if (exports.IS_WINDOWS) {
  11001. return (p.startsWith('\\') || /^[A-Z]:/i.test(p) // e.g. \ or \hello or \\hello
  11002. ); // e.g. C: or C:\hello
  11003. }
  11004. return p.startsWith('/');
  11005. }
  11006. exports.isRooted = isRooted;
  11007. /**
  11008. * Recursively create a directory at `fsPath`.
  11009. *
  11010. * This implementation is optimistic, meaning it attempts to create the full
  11011. * path first, and backs up the path stack from there.
  11012. *
  11013. * @param fsPath The path to create
  11014. * @param maxDepth The maximum recursion depth
  11015. * @param depth The current recursion depth
  11016. */
  11017. function mkdirP(fsPath, maxDepth = 1000, depth = 1) {
  11018. return __awaiter(this, void 0, void 0, function* () {
  11019. assert_1.ok(fsPath, 'a path argument must be provided');
  11020. fsPath = path.resolve(fsPath);
  11021. if (depth >= maxDepth)
  11022. return exports.mkdir(fsPath);
  11023. try {
  11024. yield exports.mkdir(fsPath);
  11025. return;
  11026. }
  11027. catch (err) {
  11028. switch (err.code) {
  11029. case 'ENOENT': {
  11030. yield mkdirP(path.dirname(fsPath), maxDepth, depth + 1);
  11031. yield exports.mkdir(fsPath);
  11032. return;
  11033. }
  11034. default: {
  11035. let stats;
  11036. try {
  11037. stats = yield exports.stat(fsPath);
  11038. }
  11039. catch (err2) {
  11040. throw err;
  11041. }
  11042. if (!stats.isDirectory())
  11043. throw err;
  11044. }
  11045. }
  11046. }
  11047. });
  11048. }
  11049. exports.mkdirP = mkdirP;
  11050. /**
  11051. * Best effort attempt to determine whether a file exists and is executable.
  11052. * @param filePath file path to check
  11053. * @param extensions additional file extensions to try
  11054. * @return if file exists and is executable, returns the file path. otherwise empty string.
  11055. */
  11056. function tryGetExecutablePath(filePath, extensions) {
  11057. return __awaiter(this, void 0, void 0, function* () {
  11058. let stats = undefined;
  11059. try {
  11060. // test file exists
  11061. stats = yield exports.stat(filePath);
  11062. }
  11063. catch (err) {
  11064. if (err.code !== 'ENOENT') {
  11065. // eslint-disable-next-line no-console
  11066. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11067. }
  11068. }
  11069. if (stats && stats.isFile()) {
  11070. if (exports.IS_WINDOWS) {
  11071. // on Windows, test for valid extension
  11072. const upperExt = path.extname(filePath).toUpperCase();
  11073. if (extensions.some(validExt => validExt.toUpperCase() === upperExt)) {
  11074. return filePath;
  11075. }
  11076. }
  11077. else {
  11078. if (isUnixExecutable(stats)) {
  11079. return filePath;
  11080. }
  11081. }
  11082. }
  11083. // try each extension
  11084. const originalFilePath = filePath;
  11085. for (const extension of extensions) {
  11086. filePath = originalFilePath + extension;
  11087. stats = undefined;
  11088. try {
  11089. stats = yield exports.stat(filePath);
  11090. }
  11091. catch (err) {
  11092. if (err.code !== 'ENOENT') {
  11093. // eslint-disable-next-line no-console
  11094. console.log(`Unexpected error attempting to determine if executable file exists '${filePath}': ${err}`);
  11095. }
  11096. }
  11097. if (stats && stats.isFile()) {
  11098. if (exports.IS_WINDOWS) {
  11099. // preserve the case of the actual file (since an extension was appended)
  11100. try {
  11101. const directory = path.dirname(filePath);
  11102. const upperName = path.basename(filePath).toUpperCase();
  11103. for (const actualName of yield exports.readdir(directory)) {
  11104. if (upperName === actualName.toUpperCase()) {
  11105. filePath = path.join(directory, actualName);
  11106. break;
  11107. }
  11108. }
  11109. }
  11110. catch (err) {
  11111. // eslint-disable-next-line no-console
  11112. console.log(`Unexpected error attempting to determine the actual case of the file '${filePath}': ${err}`);
  11113. }
  11114. return filePath;
  11115. }
  11116. else {
  11117. if (isUnixExecutable(stats)) {
  11118. return filePath;
  11119. }
  11120. }
  11121. }
  11122. }
  11123. return '';
  11124. });
  11125. }
  11126. exports.tryGetExecutablePath = tryGetExecutablePath;
  11127. function normalizeSeparators(p) {
  11128. p = p || '';
  11129. if (exports.IS_WINDOWS) {
  11130. // convert slashes on Windows
  11131. p = p.replace(/\//g, '\\');
  11132. // remove redundant slashes
  11133. return p.replace(/\\\\+/g, '\\');
  11134. }
  11135. // remove redundant slashes
  11136. return p.replace(/\/\/+/g, '/');
  11137. }
  11138. // on Mac/Linux, test the execute bit
  11139. // R W X R W X R W X
  11140. // 256 128 64 32 16 8 4 2 1
  11141. function isUnixExecutable(stats) {
  11142. return ((stats.mode & 1) > 0 ||
  11143. ((stats.mode & 8) > 0 && stats.gid === process.getgid()) ||
  11144. ((stats.mode & 64) > 0 && stats.uid === process.getuid()));
  11145. }
  11146. //# sourceMappingURL=io-util.js.map
  11147. /***/ }),
  11148. /***/ 674:
  11149. /***/ (function(module, __unusedexports, __webpack_require__) {
  11150. module.exports = authenticate;
  11151. const { Deprecation } = __webpack_require__(692);
  11152. const once = __webpack_require__(969);
  11153. const deprecateAuthenticate = once((log, deprecation) => log.warn(deprecation));
  11154. function authenticate(state, options) {
  11155. deprecateAuthenticate(
  11156. state.octokit.log,
  11157. new Deprecation(
  11158. '[@octokit/rest] octokit.authenticate() is deprecated. Use "auth" constructor option instead.'
  11159. )
  11160. );
  11161. if (!options) {
  11162. state.auth = false;
  11163. return;
  11164. }
  11165. switch (options.type) {
  11166. case "basic":
  11167. if (!options.username || !options.password) {
  11168. throw new Error(
  11169. "Basic authentication requires both a username and password to be set"
  11170. );
  11171. }
  11172. break;
  11173. case "oauth":
  11174. if (!options.token && !(options.key && options.secret)) {
  11175. throw new Error(
  11176. "OAuth2 authentication requires a token or key & secret to be set"
  11177. );
  11178. }
  11179. break;
  11180. case "token":
  11181. case "app":
  11182. if (!options.token) {
  11183. throw new Error("Token authentication requires a token to be set");
  11184. }
  11185. break;
  11186. default:
  11187. throw new Error(
  11188. "Invalid authentication type, must be 'basic', 'oauth', 'token' or 'app'"
  11189. );
  11190. }
  11191. state.auth = options;
  11192. }
  11193. /***/ }),
  11194. /***/ 675:
  11195. /***/ (function(module) {
  11196. module.exports = function btoa(str) {
  11197. return new Buffer(str).toString('base64')
  11198. }
  11199. /***/ }),
  11200. /***/ 692:
  11201. /***/ (function(__unusedmodule, exports) {
  11202. "use strict";
  11203. Object.defineProperty(exports, '__esModule', { value: true });
  11204. class Deprecation extends Error {
  11205. constructor(message) {
  11206. super(message); // Maintains proper stack trace (only available on V8)
  11207. /* istanbul ignore next */
  11208. if (Error.captureStackTrace) {
  11209. Error.captureStackTrace(this, this.constructor);
  11210. }
  11211. this.name = 'Deprecation';
  11212. }
  11213. }
  11214. exports.Deprecation = Deprecation;
  11215. /***/ }),
  11216. /***/ 696:
  11217. /***/ (function(module) {
  11218. "use strict";
  11219. /*!
  11220. * isobject <https://github.com/jonschlinkert/isobject>
  11221. *
  11222. * Copyright (c) 2014-2017, Jon Schlinkert.
  11223. * Released under the MIT License.
  11224. */
  11225. function isObject(val) {
  11226. return val != null && typeof val === 'object' && Array.isArray(val) === false;
  11227. }
  11228. /*!
  11229. * is-plain-object <https://github.com/jonschlinkert/is-plain-object>
  11230. *
  11231. * Copyright (c) 2014-2017, Jon Schlinkert.
  11232. * Released under the MIT License.
  11233. */
  11234. function isObjectObject(o) {
  11235. return isObject(o) === true
  11236. && Object.prototype.toString.call(o) === '[object Object]';
  11237. }
  11238. function isPlainObject(o) {
  11239. var ctor,prot;
  11240. if (isObjectObject(o) === false) return false;
  11241. // If has modified constructor
  11242. ctor = o.constructor;
  11243. if (typeof ctor !== 'function') return false;
  11244. // If has modified prototype
  11245. prot = ctor.prototype;
  11246. if (isObjectObject(prot) === false) return false;
  11247. // If constructor does not have an Object-specific method
  11248. if (prot.hasOwnProperty('isPrototypeOf') === false) {
  11249. return false;
  11250. }
  11251. // Most likely a plain Object
  11252. return true;
  11253. }
  11254. module.exports = isPlainObject;
  11255. /***/ }),
  11256. /***/ 697:
  11257. /***/ (function(module) {
  11258. "use strict";
  11259. module.exports = (promise, onFinally) => {
  11260. onFinally = onFinally || (() => {});
  11261. return promise.then(
  11262. val => new Promise(resolve => {
  11263. resolve(onFinally());
  11264. }).then(() => val),
  11265. err => new Promise(resolve => {
  11266. resolve(onFinally());
  11267. }).then(() => {
  11268. throw err;
  11269. })
  11270. );
  11271. };
  11272. /***/ }),
  11273. /***/ 705:
  11274. /***/ (function(module) {
  11275. 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"}}};
  11276. /***/ }),
  11277. /***/ 722:
  11278. /***/ (function(module) {
  11279. /**
  11280. * Convert array of 16 byte values to UUID string format of the form:
  11281. * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
  11282. */
  11283. var byteToHex = [];
  11284. for (var i = 0; i < 256; ++i) {
  11285. byteToHex[i] = (i + 0x100).toString(16).substr(1);
  11286. }
  11287. function bytesToUuid(buf, offset) {
  11288. var i = offset || 0;
  11289. var bth = byteToHex;
  11290. // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
  11291. return ([bth[buf[i++]], bth[buf[i++]],
  11292. bth[buf[i++]], bth[buf[i++]], '-',
  11293. bth[buf[i++]], bth[buf[i++]], '-',
  11294. bth[buf[i++]], bth[buf[i++]], '-',
  11295. bth[buf[i++]], bth[buf[i++]], '-',
  11296. bth[buf[i++]], bth[buf[i++]],
  11297. bth[buf[i++]], bth[buf[i++]],
  11298. bth[buf[i++]], bth[buf[i++]]]).join('');
  11299. }
  11300. module.exports = bytesToUuid;
  11301. /***/ }),
  11302. /***/ 742:
  11303. /***/ (function(module, __unusedexports, __webpack_require__) {
  11304. var fs = __webpack_require__(747)
  11305. var core
  11306. if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  11307. core = __webpack_require__(818)
  11308. } else {
  11309. core = __webpack_require__(197)
  11310. }
  11311. module.exports = isexe
  11312. isexe.sync = sync
  11313. function isexe (path, options, cb) {
  11314. if (typeof options === 'function') {
  11315. cb = options
  11316. options = {}
  11317. }
  11318. if (!cb) {
  11319. if (typeof Promise !== 'function') {
  11320. throw new TypeError('callback not provided')
  11321. }
  11322. return new Promise(function (resolve, reject) {
  11323. isexe(path, options || {}, function (er, is) {
  11324. if (er) {
  11325. reject(er)
  11326. } else {
  11327. resolve(is)
  11328. }
  11329. })
  11330. })
  11331. }
  11332. core(path, options || {}, function (er, is) {
  11333. // ignore EACCES because that just means we aren't allowed to run it
  11334. if (er) {
  11335. if (er.code === 'EACCES' || options && options.ignoreErrors) {
  11336. er = null
  11337. is = false
  11338. }
  11339. }
  11340. cb(er, is)
  11341. })
  11342. }
  11343. function sync (path, options) {
  11344. // my kingdom for a filtered catch
  11345. try {
  11346. return core.sync(path, options || {})
  11347. } catch (er) {
  11348. if (options && options.ignoreErrors || er.code === 'EACCES') {
  11349. return false
  11350. } else {
  11351. throw er
  11352. }
  11353. }
  11354. }
  11355. /***/ }),
  11356. /***/ 747:
  11357. /***/ (function(module) {
  11358. module.exports = require("fs");
  11359. /***/ }),
  11360. /***/ 753:
  11361. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11362. "use strict";
  11363. Object.defineProperty(exports, '__esModule', { value: true });
  11364. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11365. var endpoint = __webpack_require__(385);
  11366. var universalUserAgent = __webpack_require__(796);
  11367. var isPlainObject = _interopDefault(__webpack_require__(696));
  11368. var nodeFetch = _interopDefault(__webpack_require__(454));
  11369. var requestError = __webpack_require__(463);
  11370. const VERSION = "5.3.1";
  11371. function getBufferResponse(response) {
  11372. return response.arrayBuffer();
  11373. }
  11374. function fetchWrapper(requestOptions) {
  11375. if (isPlainObject(requestOptions.body) || Array.isArray(requestOptions.body)) {
  11376. requestOptions.body = JSON.stringify(requestOptions.body);
  11377. }
  11378. let headers = {};
  11379. let status;
  11380. let url;
  11381. const fetch = requestOptions.request && requestOptions.request.fetch || nodeFetch;
  11382. return fetch(requestOptions.url, Object.assign({
  11383. method: requestOptions.method,
  11384. body: requestOptions.body,
  11385. headers: requestOptions.headers,
  11386. redirect: requestOptions.redirect
  11387. }, requestOptions.request)).then(response => {
  11388. url = response.url;
  11389. status = response.status;
  11390. for (const keyAndValue of response.headers) {
  11391. headers[keyAndValue[0]] = keyAndValue[1];
  11392. }
  11393. if (status === 204 || status === 205) {
  11394. return;
  11395. } // GitHub API returns 200 for HEAD requsets
  11396. if (requestOptions.method === "HEAD") {
  11397. if (status < 400) {
  11398. return;
  11399. }
  11400. throw new requestError.RequestError(response.statusText, status, {
  11401. headers,
  11402. request: requestOptions
  11403. });
  11404. }
  11405. if (status === 304) {
  11406. throw new requestError.RequestError("Not modified", status, {
  11407. headers,
  11408. request: requestOptions
  11409. });
  11410. }
  11411. if (status >= 400) {
  11412. return response.text().then(message => {
  11413. const error = new requestError.RequestError(message, status, {
  11414. headers,
  11415. request: requestOptions
  11416. });
  11417. try {
  11418. let responseBody = JSON.parse(error.message);
  11419. Object.assign(error, responseBody);
  11420. let errors = responseBody.errors; // Assumption `errors` would always be in Array Fotmat
  11421. error.message = error.message + ": " + errors.map(JSON.stringify).join(", ");
  11422. } catch (e) {// ignore, see octokit/rest.js#684
  11423. }
  11424. throw error;
  11425. });
  11426. }
  11427. const contentType = response.headers.get("content-type");
  11428. if (/application\/json/.test(contentType)) {
  11429. return response.json();
  11430. }
  11431. if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) {
  11432. return response.text();
  11433. }
  11434. return getBufferResponse(response);
  11435. }).then(data => {
  11436. return {
  11437. status,
  11438. url,
  11439. headers,
  11440. data
  11441. };
  11442. }).catch(error => {
  11443. if (error instanceof requestError.RequestError) {
  11444. throw error;
  11445. }
  11446. throw new requestError.RequestError(error.message, 500, {
  11447. headers,
  11448. request: requestOptions
  11449. });
  11450. });
  11451. }
  11452. function withDefaults(oldEndpoint, newDefaults) {
  11453. const endpoint = oldEndpoint.defaults(newDefaults);
  11454. const newApi = function (route, parameters) {
  11455. const endpointOptions = endpoint.merge(route, parameters);
  11456. if (!endpointOptions.request || !endpointOptions.request.hook) {
  11457. return fetchWrapper(endpoint.parse(endpointOptions));
  11458. }
  11459. const request = (route, parameters) => {
  11460. return fetchWrapper(endpoint.parse(endpoint.merge(route, parameters)));
  11461. };
  11462. Object.assign(request, {
  11463. endpoint,
  11464. defaults: withDefaults.bind(null, endpoint)
  11465. });
  11466. return endpointOptions.request.hook(request, endpointOptions);
  11467. };
  11468. return Object.assign(newApi, {
  11469. endpoint,
  11470. defaults: withDefaults.bind(null, endpoint)
  11471. });
  11472. }
  11473. const request = withDefaults(endpoint.endpoint, {
  11474. headers: {
  11475. "user-agent": `octokit-request.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  11476. }
  11477. });
  11478. exports.request = request;
  11479. //# sourceMappingURL=index.js.map
  11480. /***/ }),
  11481. /***/ 761:
  11482. /***/ (function(module) {
  11483. module.exports = require("zlib");
  11484. /***/ }),
  11485. /***/ 763:
  11486. /***/ (function(module) {
  11487. module.exports = removeHook
  11488. function removeHook (state, name, method) {
  11489. if (!state.registry[name]) {
  11490. return
  11491. }
  11492. var index = state.registry[name]
  11493. .map(function (registered) { return registered.orig })
  11494. .indexOf(method)
  11495. if (index === -1) {
  11496. return
  11497. }
  11498. state.registry[name].splice(index, 1)
  11499. }
  11500. /***/ }),
  11501. /***/ 768:
  11502. /***/ (function(module) {
  11503. "use strict";
  11504. module.exports = function (x) {
  11505. var lf = typeof x === 'string' ? '\n' : '\n'.charCodeAt();
  11506. var cr = typeof x === 'string' ? '\r' : '\r'.charCodeAt();
  11507. if (x[x.length - 1] === lf) {
  11508. x = x.slice(0, x.length - 1);
  11509. }
  11510. if (x[x.length - 1] === cr) {
  11511. x = x.slice(0, x.length - 1);
  11512. }
  11513. return x;
  11514. };
  11515. /***/ }),
  11516. /***/ 777:
  11517. /***/ (function(module, __unusedexports, __webpack_require__) {
  11518. module.exports = getFirstPage
  11519. const getPage = __webpack_require__(265)
  11520. function getFirstPage (octokit, link, headers) {
  11521. return getPage(octokit, link, 'first', headers)
  11522. }
  11523. /***/ }),
  11524. /***/ 796:
  11525. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11526. "use strict";
  11527. Object.defineProperty(exports, '__esModule', { value: true });
  11528. function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
  11529. var osName = _interopDefault(__webpack_require__(2));
  11530. function getUserAgent() {
  11531. try {
  11532. return `Node.js/${process.version.substr(1)} (${osName()}; ${process.arch})`;
  11533. } catch (error) {
  11534. if (/wmic os get Caption/.test(error.message)) {
  11535. return "Windows <version undetectable>";
  11536. }
  11537. throw error;
  11538. }
  11539. }
  11540. exports.getUserAgent = getUserAgent;
  11541. //# sourceMappingURL=index.js.map
  11542. /***/ }),
  11543. /***/ 807:
  11544. /***/ (function(module, __unusedexports, __webpack_require__) {
  11545. module.exports = paginate;
  11546. const iterator = __webpack_require__(8);
  11547. function paginate(octokit, route, options, mapFn) {
  11548. if (typeof options === "function") {
  11549. mapFn = options;
  11550. options = undefined;
  11551. }
  11552. options = octokit.request.endpoint.merge(route, options);
  11553. return gather(
  11554. octokit,
  11555. [],
  11556. iterator(octokit, options)[Symbol.asyncIterator](),
  11557. mapFn
  11558. );
  11559. }
  11560. function gather(octokit, results, iterator, mapFn) {
  11561. return iterator.next().then(result => {
  11562. if (result.done) {
  11563. return results;
  11564. }
  11565. let earlyExit = false;
  11566. function done() {
  11567. earlyExit = true;
  11568. }
  11569. results = results.concat(
  11570. mapFn ? mapFn(result.value, done) : result.value.data
  11571. );
  11572. if (earlyExit) {
  11573. return results;
  11574. }
  11575. return gather(octokit, results, iterator, mapFn);
  11576. });
  11577. }
  11578. /***/ }),
  11579. /***/ 813:
  11580. /***/ (function(__unusedmodule, exports) {
  11581. "use strict";
  11582. Object.defineProperty(exports, '__esModule', { value: true });
  11583. async function auth(token) {
  11584. const tokenType = token.split(/\./).length === 3 ? "app" : /^v\d+\./.test(token) ? "installation" : "oauth";
  11585. return {
  11586. type: "token",
  11587. token: token,
  11588. tokenType
  11589. };
  11590. }
  11591. /**
  11592. * Prefix token for usage in the Authorization header
  11593. *
  11594. * @param token OAuth token or JSON Web Token
  11595. */
  11596. function withAuthorizationPrefix(token) {
  11597. if (token.split(/\./).length === 3) {
  11598. return `bearer ${token}`;
  11599. }
  11600. return `token ${token}`;
  11601. }
  11602. async function hook(token, request, route, parameters) {
  11603. const endpoint = request.endpoint.merge(route, parameters);
  11604. endpoint.headers.authorization = withAuthorizationPrefix(token);
  11605. return request(endpoint);
  11606. }
  11607. const createTokenAuth = function createTokenAuth(token) {
  11608. if (!token) {
  11609. throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
  11610. }
  11611. if (typeof token !== "string") {
  11612. throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
  11613. }
  11614. token = token.replace(/^(token|bearer) +/i, "");
  11615. return Object.assign(auth.bind(null, token), {
  11616. hook: hook.bind(null, token)
  11617. });
  11618. };
  11619. exports.createTokenAuth = createTokenAuth;
  11620. //# sourceMappingURL=index.js.map
  11621. /***/ }),
  11622. /***/ 814:
  11623. /***/ (function(module, __unusedexports, __webpack_require__) {
  11624. module.exports = which
  11625. which.sync = whichSync
  11626. var isWindows = process.platform === 'win32' ||
  11627. process.env.OSTYPE === 'cygwin' ||
  11628. process.env.OSTYPE === 'msys'
  11629. var path = __webpack_require__(622)
  11630. var COLON = isWindows ? ';' : ':'
  11631. var isexe = __webpack_require__(742)
  11632. function getNotFoundError (cmd) {
  11633. var er = new Error('not found: ' + cmd)
  11634. er.code = 'ENOENT'
  11635. return er
  11636. }
  11637. function getPathInfo (cmd, opt) {
  11638. var colon = opt.colon || COLON
  11639. var pathEnv = opt.path || process.env.PATH || ''
  11640. var pathExt = ['']
  11641. pathEnv = pathEnv.split(colon)
  11642. var pathExtExe = ''
  11643. if (isWindows) {
  11644. pathEnv.unshift(process.cwd())
  11645. pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
  11646. pathExt = pathExtExe.split(colon)
  11647. // Always test the cmd itself first. isexe will check to make sure
  11648. // it's found in the pathExt set.
  11649. if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
  11650. pathExt.unshift('')
  11651. }
  11652. // If it has a slash, then we don't bother searching the pathenv.
  11653. // just check the file itself, and that's it.
  11654. if (cmd.match(/\//) || isWindows && cmd.match(/\\/))
  11655. pathEnv = ['']
  11656. return {
  11657. env: pathEnv,
  11658. ext: pathExt,
  11659. extExe: pathExtExe
  11660. }
  11661. }
  11662. function which (cmd, opt, cb) {
  11663. if (typeof opt === 'function') {
  11664. cb = opt
  11665. opt = {}
  11666. }
  11667. var info = getPathInfo(cmd, opt)
  11668. var pathEnv = info.env
  11669. var pathExt = info.ext
  11670. var pathExtExe = info.extExe
  11671. var found = []
  11672. ;(function F (i, l) {
  11673. if (i === l) {
  11674. if (opt.all && found.length)
  11675. return cb(null, found)
  11676. else
  11677. return cb(getNotFoundError(cmd))
  11678. }
  11679. var pathPart = pathEnv[i]
  11680. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  11681. pathPart = pathPart.slice(1, -1)
  11682. var p = path.join(pathPart, cmd)
  11683. if (!pathPart && (/^\.[\\\/]/).test(cmd)) {
  11684. p = cmd.slice(0, 2) + p
  11685. }
  11686. ;(function E (ii, ll) {
  11687. if (ii === ll) return F(i + 1, l)
  11688. var ext = pathExt[ii]
  11689. isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
  11690. if (!er && is) {
  11691. if (opt.all)
  11692. found.push(p + ext)
  11693. else
  11694. return cb(null, p + ext)
  11695. }
  11696. return E(ii + 1, ll)
  11697. })
  11698. })(0, pathExt.length)
  11699. })(0, pathEnv.length)
  11700. }
  11701. function whichSync (cmd, opt) {
  11702. opt = opt || {}
  11703. var info = getPathInfo(cmd, opt)
  11704. var pathEnv = info.env
  11705. var pathExt = info.ext
  11706. var pathExtExe = info.extExe
  11707. var found = []
  11708. for (var i = 0, l = pathEnv.length; i < l; i ++) {
  11709. var pathPart = pathEnv[i]
  11710. if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
  11711. pathPart = pathPart.slice(1, -1)
  11712. var p = path.join(pathPart, cmd)
  11713. if (!pathPart && /^\.[\\\/]/.test(cmd)) {
  11714. p = cmd.slice(0, 2) + p
  11715. }
  11716. for (var j = 0, ll = pathExt.length; j < ll; j ++) {
  11717. var cur = p + pathExt[j]
  11718. var is
  11719. try {
  11720. is = isexe.sync(cur, { pathExt: pathExtExe })
  11721. if (is) {
  11722. if (opt.all)
  11723. found.push(cur)
  11724. else
  11725. return cur
  11726. }
  11727. } catch (ex) {}
  11728. }
  11729. }
  11730. if (opt.all && found.length)
  11731. return found
  11732. if (opt.nothrow)
  11733. return null
  11734. throw getNotFoundError(cmd)
  11735. }
  11736. /***/ }),
  11737. /***/ 816:
  11738. /***/ (function(module) {
  11739. "use strict";
  11740. module.exports = /^#!.*/;
  11741. /***/ }),
  11742. /***/ 818:
  11743. /***/ (function(module, __unusedexports, __webpack_require__) {
  11744. module.exports = isexe
  11745. isexe.sync = sync
  11746. var fs = __webpack_require__(747)
  11747. function checkPathExt (path, options) {
  11748. var pathext = options.pathExt !== undefined ?
  11749. options.pathExt : process.env.PATHEXT
  11750. if (!pathext) {
  11751. return true
  11752. }
  11753. pathext = pathext.split(';')
  11754. if (pathext.indexOf('') !== -1) {
  11755. return true
  11756. }
  11757. for (var i = 0; i < pathext.length; i++) {
  11758. var p = pathext[i].toLowerCase()
  11759. if (p && path.substr(-p.length).toLowerCase() === p) {
  11760. return true
  11761. }
  11762. }
  11763. return false
  11764. }
  11765. function checkStat (stat, path, options) {
  11766. if (!stat.isSymbolicLink() && !stat.isFile()) {
  11767. return false
  11768. }
  11769. return checkPathExt(path, options)
  11770. }
  11771. function isexe (path, options, cb) {
  11772. fs.stat(path, function (er, stat) {
  11773. cb(er, er ? false : checkStat(stat, path, options))
  11774. })
  11775. }
  11776. function sync (path, options) {
  11777. return checkStat(fs.statSync(path), path, options)
  11778. }
  11779. /***/ }),
  11780. /***/ 821:
  11781. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  11782. "use strict";
  11783. var __importStar = (this && this.__importStar) || function (mod) {
  11784. if (mod && mod.__esModule) return mod;
  11785. var result = {};
  11786. if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
  11787. result["default"] = mod;
  11788. return result;
  11789. };
  11790. Object.defineProperty(exports, "__esModule", { value: true });
  11791. const core = __importStar(__webpack_require__(470));
  11792. const fsHelper = __importStar(__webpack_require__(618));
  11793. const github = __importStar(__webpack_require__(469));
  11794. const path = __importStar(__webpack_require__(622));
  11795. function getInputs() {
  11796. const result = {};
  11797. // GitHub workspace
  11798. let githubWorkspacePath = process.env['GITHUB_WORKSPACE'];
  11799. if (!githubWorkspacePath) {
  11800. throw new Error('GITHUB_WORKSPACE not defined');
  11801. }
  11802. githubWorkspacePath = path.resolve(githubWorkspacePath);
  11803. core.debug(`GITHUB_WORKSPACE = '${githubWorkspacePath}'`);
  11804. fsHelper.directoryExistsSync(githubWorkspacePath, true);
  11805. // Qualified repository
  11806. const qualifiedRepository = core.getInput('repository') ||
  11807. `${github.context.repo.owner}/${github.context.repo.repo}`;
  11808. core.debug(`qualified repository = '${qualifiedRepository}'`);
  11809. const splitRepository = qualifiedRepository.split('/');
  11810. if (splitRepository.length !== 2 ||
  11811. !splitRepository[0] ||
  11812. !splitRepository[1]) {
  11813. throw new Error(`Invalid repository '${qualifiedRepository}'. Expected format {owner}/{repo}.`);
  11814. }
  11815. result.repositoryOwner = splitRepository[0];
  11816. result.repositoryName = splitRepository[1];
  11817. // Repository path
  11818. result.repositoryPath = core.getInput('path') || '.';
  11819. result.repositoryPath = path.resolve(githubWorkspacePath, result.repositoryPath);
  11820. if (!(result.repositoryPath + path.sep).startsWith(githubWorkspacePath + path.sep)) {
  11821. throw new Error(`Repository path '${result.repositoryPath}' is not under '${githubWorkspacePath}'`);
  11822. }
  11823. // Workflow repository?
  11824. const isWorkflowRepository = qualifiedRepository.toUpperCase() ===
  11825. `${github.context.repo.owner}/${github.context.repo.repo}`.toUpperCase();
  11826. // Source branch, source version
  11827. result.ref = core.getInput('ref');
  11828. if (!result.ref) {
  11829. if (isWorkflowRepository) {
  11830. result.ref = github.context.ref;
  11831. result.commit = github.context.sha;
  11832. // Some events have an unqualifed ref. For example when a PR is merged (pull_request closed event),
  11833. // the ref is unqualifed like "master" instead of "refs/heads/master".
  11834. if (result.commit && result.ref && !result.ref.startsWith('refs/')) {
  11835. result.ref = `refs/heads/${result.ref}`;
  11836. }
  11837. }
  11838. if (!result.ref && !result.commit) {
  11839. result.ref = 'refs/heads/master';
  11840. }
  11841. }
  11842. // SHA?
  11843. else if (result.ref.match(/^[0-9a-fA-F]{40}$/)) {
  11844. result.commit = result.ref;
  11845. result.ref = '';
  11846. }
  11847. core.debug(`ref = '${result.ref}'`);
  11848. core.debug(`commit = '${result.commit}'`);
  11849. // Clean
  11850. result.clean = (core.getInput('clean') || 'true').toUpperCase() === 'TRUE';
  11851. core.debug(`clean = ${result.clean}`);
  11852. // Submodules
  11853. if (core.getInput('submodules')) {
  11854. throw new Error("The input 'submodules' is not supported in actions/checkout@v2");
  11855. }
  11856. // Fetch depth
  11857. result.fetchDepth = Math.floor(Number(core.getInput('fetch-depth') || '1'));
  11858. if (isNaN(result.fetchDepth) || result.fetchDepth < 0) {
  11859. result.fetchDepth = 0;
  11860. }
  11861. core.debug(`fetch depth = ${result.fetchDepth}`);
  11862. // LFS
  11863. result.lfs = (core.getInput('lfs') || 'false').toUpperCase() === 'TRUE';
  11864. core.debug(`lfs = ${result.lfs}`);
  11865. // Auth token
  11866. result.authToken = core.getInput('token');
  11867. // Persist credentials
  11868. result.persistCredentials =
  11869. (core.getInput('persist-credentials') || 'false').toUpperCase() === 'TRUE';
  11870. return result;
  11871. }
  11872. exports.getInputs = getInputs;
  11873. /***/ }),
  11874. /***/ 826:
  11875. /***/ (function(module, __unusedexports, __webpack_require__) {
  11876. var rng = __webpack_require__(139);
  11877. var bytesToUuid = __webpack_require__(722);
  11878. function v4(options, buf, offset) {
  11879. var i = buf && offset || 0;
  11880. if (typeof(options) == 'string') {
  11881. buf = options === 'binary' ? new Array(16) : null;
  11882. options = null;
  11883. }
  11884. options = options || {};
  11885. var rnds = options.random || (options.rng || rng)();
  11886. // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
  11887. rnds[6] = (rnds[6] & 0x0f) | 0x40;
  11888. rnds[8] = (rnds[8] & 0x3f) | 0x80;
  11889. // Copy bytes to buffer, if provided
  11890. if (buf) {
  11891. for (var ii = 0; ii < 16; ++ii) {
  11892. buf[i + ii] = rnds[ii];
  11893. }
  11894. }
  11895. return buf || bytesToUuid(rnds);
  11896. }
  11897. module.exports = v4;
  11898. /***/ }),
  11899. /***/ 835:
  11900. /***/ (function(module) {
  11901. module.exports = require("url");
  11902. /***/ }),
  11903. /***/ 850:
  11904. /***/ (function(module, __unusedexports, __webpack_require__) {
  11905. module.exports = paginationMethodsPlugin
  11906. function paginationMethodsPlugin (octokit) {
  11907. octokit.getFirstPage = __webpack_require__(777).bind(null, octokit)
  11908. octokit.getLastPage = __webpack_require__(649).bind(null, octokit)
  11909. octokit.getNextPage = __webpack_require__(550).bind(null, octokit)
  11910. octokit.getPreviousPage = __webpack_require__(563).bind(null, octokit)
  11911. octokit.hasFirstPage = __webpack_require__(536)
  11912. octokit.hasLastPage = __webpack_require__(336)
  11913. octokit.hasNextPage = __webpack_require__(929)
  11914. octokit.hasPreviousPage = __webpack_require__(558)
  11915. }
  11916. /***/ }),
  11917. /***/ 854:
  11918. /***/ (function(module) {
  11919. /**
  11920. * lodash (Custom Build) <https://lodash.com/>
  11921. * Build: `lodash modularize exports="npm" -o ./`
  11922. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  11923. * Released under MIT license <https://lodash.com/license>
  11924. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  11925. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  11926. */
  11927. /** Used as the `TypeError` message for "Functions" methods. */
  11928. var FUNC_ERROR_TEXT = 'Expected a function';
  11929. /** Used to stand-in for `undefined` hash values. */
  11930. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  11931. /** Used as references for various `Number` constants. */
  11932. var INFINITY = 1 / 0;
  11933. /** `Object#toString` result references. */
  11934. var funcTag = '[object Function]',
  11935. genTag = '[object GeneratorFunction]',
  11936. symbolTag = '[object Symbol]';
  11937. /** Used to match property names within property paths. */
  11938. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  11939. reIsPlainProp = /^\w*$/,
  11940. reLeadingDot = /^\./,
  11941. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  11942. /**
  11943. * Used to match `RegExp`
  11944. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  11945. */
  11946. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  11947. /** Used to match backslashes in property paths. */
  11948. var reEscapeChar = /\\(\\)?/g;
  11949. /** Used to detect host constructors (Safari). */
  11950. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  11951. /** Detect free variable `global` from Node.js. */
  11952. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  11953. /** Detect free variable `self`. */
  11954. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  11955. /** Used as a reference to the global object. */
  11956. var root = freeGlobal || freeSelf || Function('return this')();
  11957. /**
  11958. * Gets the value at `key` of `object`.
  11959. *
  11960. * @private
  11961. * @param {Object} [object] The object to query.
  11962. * @param {string} key The key of the property to get.
  11963. * @returns {*} Returns the property value.
  11964. */
  11965. function getValue(object, key) {
  11966. return object == null ? undefined : object[key];
  11967. }
  11968. /**
  11969. * Checks if `value` is a host object in IE < 9.
  11970. *
  11971. * @private
  11972. * @param {*} value The value to check.
  11973. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  11974. */
  11975. function isHostObject(value) {
  11976. // Many host objects are `Object` objects that can coerce to strings
  11977. // despite having improperly defined `toString` methods.
  11978. var result = false;
  11979. if (value != null && typeof value.toString != 'function') {
  11980. try {
  11981. result = !!(value + '');
  11982. } catch (e) {}
  11983. }
  11984. return result;
  11985. }
  11986. /** Used for built-in method references. */
  11987. var arrayProto = Array.prototype,
  11988. funcProto = Function.prototype,
  11989. objectProto = Object.prototype;
  11990. /** Used to detect overreaching core-js shims. */
  11991. var coreJsData = root['__core-js_shared__'];
  11992. /** Used to detect methods masquerading as native. */
  11993. var maskSrcKey = (function() {
  11994. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  11995. return uid ? ('Symbol(src)_1.' + uid) : '';
  11996. }());
  11997. /** Used to resolve the decompiled source of functions. */
  11998. var funcToString = funcProto.toString;
  11999. /** Used to check objects for own properties. */
  12000. var hasOwnProperty = objectProto.hasOwnProperty;
  12001. /**
  12002. * Used to resolve the
  12003. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  12004. * of values.
  12005. */
  12006. var objectToString = objectProto.toString;
  12007. /** Used to detect if a method is native. */
  12008. var reIsNative = RegExp('^' +
  12009. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  12010. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  12011. );
  12012. /** Built-in value references. */
  12013. var Symbol = root.Symbol,
  12014. splice = arrayProto.splice;
  12015. /* Built-in method references that are verified to be native. */
  12016. var Map = getNative(root, 'Map'),
  12017. nativeCreate = getNative(Object, 'create');
  12018. /** Used to convert symbols to primitives and strings. */
  12019. var symbolProto = Symbol ? Symbol.prototype : undefined,
  12020. symbolToString = symbolProto ? symbolProto.toString : undefined;
  12021. /**
  12022. * Creates a hash object.
  12023. *
  12024. * @private
  12025. * @constructor
  12026. * @param {Array} [entries] The key-value pairs to cache.
  12027. */
  12028. function Hash(entries) {
  12029. var index = -1,
  12030. length = entries ? entries.length : 0;
  12031. this.clear();
  12032. while (++index < length) {
  12033. var entry = entries[index];
  12034. this.set(entry[0], entry[1]);
  12035. }
  12036. }
  12037. /**
  12038. * Removes all key-value entries from the hash.
  12039. *
  12040. * @private
  12041. * @name clear
  12042. * @memberOf Hash
  12043. */
  12044. function hashClear() {
  12045. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  12046. }
  12047. /**
  12048. * Removes `key` and its value from the hash.
  12049. *
  12050. * @private
  12051. * @name delete
  12052. * @memberOf Hash
  12053. * @param {Object} hash The hash to modify.
  12054. * @param {string} key The key of the value to remove.
  12055. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12056. */
  12057. function hashDelete(key) {
  12058. return this.has(key) && delete this.__data__[key];
  12059. }
  12060. /**
  12061. * Gets the hash value for `key`.
  12062. *
  12063. * @private
  12064. * @name get
  12065. * @memberOf Hash
  12066. * @param {string} key The key of the value to get.
  12067. * @returns {*} Returns the entry value.
  12068. */
  12069. function hashGet(key) {
  12070. var data = this.__data__;
  12071. if (nativeCreate) {
  12072. var result = data[key];
  12073. return result === HASH_UNDEFINED ? undefined : result;
  12074. }
  12075. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  12076. }
  12077. /**
  12078. * Checks if a hash value for `key` exists.
  12079. *
  12080. * @private
  12081. * @name has
  12082. * @memberOf Hash
  12083. * @param {string} key The key of the entry to check.
  12084. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12085. */
  12086. function hashHas(key) {
  12087. var data = this.__data__;
  12088. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  12089. }
  12090. /**
  12091. * Sets the hash `key` to `value`.
  12092. *
  12093. * @private
  12094. * @name set
  12095. * @memberOf Hash
  12096. * @param {string} key The key of the value to set.
  12097. * @param {*} value The value to set.
  12098. * @returns {Object} Returns the hash instance.
  12099. */
  12100. function hashSet(key, value) {
  12101. var data = this.__data__;
  12102. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  12103. return this;
  12104. }
  12105. // Add methods to `Hash`.
  12106. Hash.prototype.clear = hashClear;
  12107. Hash.prototype['delete'] = hashDelete;
  12108. Hash.prototype.get = hashGet;
  12109. Hash.prototype.has = hashHas;
  12110. Hash.prototype.set = hashSet;
  12111. /**
  12112. * Creates an list cache object.
  12113. *
  12114. * @private
  12115. * @constructor
  12116. * @param {Array} [entries] The key-value pairs to cache.
  12117. */
  12118. function ListCache(entries) {
  12119. var index = -1,
  12120. length = entries ? entries.length : 0;
  12121. this.clear();
  12122. while (++index < length) {
  12123. var entry = entries[index];
  12124. this.set(entry[0], entry[1]);
  12125. }
  12126. }
  12127. /**
  12128. * Removes all key-value entries from the list cache.
  12129. *
  12130. * @private
  12131. * @name clear
  12132. * @memberOf ListCache
  12133. */
  12134. function listCacheClear() {
  12135. this.__data__ = [];
  12136. }
  12137. /**
  12138. * Removes `key` and its value from the list cache.
  12139. *
  12140. * @private
  12141. * @name delete
  12142. * @memberOf ListCache
  12143. * @param {string} key The key of the value to remove.
  12144. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12145. */
  12146. function listCacheDelete(key) {
  12147. var data = this.__data__,
  12148. index = assocIndexOf(data, key);
  12149. if (index < 0) {
  12150. return false;
  12151. }
  12152. var lastIndex = data.length - 1;
  12153. if (index == lastIndex) {
  12154. data.pop();
  12155. } else {
  12156. splice.call(data, index, 1);
  12157. }
  12158. return true;
  12159. }
  12160. /**
  12161. * Gets the list cache value for `key`.
  12162. *
  12163. * @private
  12164. * @name get
  12165. * @memberOf ListCache
  12166. * @param {string} key The key of the value to get.
  12167. * @returns {*} Returns the entry value.
  12168. */
  12169. function listCacheGet(key) {
  12170. var data = this.__data__,
  12171. index = assocIndexOf(data, key);
  12172. return index < 0 ? undefined : data[index][1];
  12173. }
  12174. /**
  12175. * Checks if a list cache value for `key` exists.
  12176. *
  12177. * @private
  12178. * @name has
  12179. * @memberOf ListCache
  12180. * @param {string} key The key of the entry to check.
  12181. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  12182. */
  12183. function listCacheHas(key) {
  12184. return assocIndexOf(this.__data__, key) > -1;
  12185. }
  12186. /**
  12187. * Sets the list cache `key` to `value`.
  12188. *
  12189. * @private
  12190. * @name set
  12191. * @memberOf ListCache
  12192. * @param {string} key The key of the value to set.
  12193. * @param {*} value The value to set.
  12194. * @returns {Object} Returns the list cache instance.
  12195. */
  12196. function listCacheSet(key, value) {
  12197. var data = this.__data__,
  12198. index = assocIndexOf(data, key);
  12199. if (index < 0) {
  12200. data.push([key, value]);
  12201. } else {
  12202. data[index][1] = value;
  12203. }
  12204. return this;
  12205. }
  12206. // Add methods to `ListCache`.
  12207. ListCache.prototype.clear = listCacheClear;
  12208. ListCache.prototype['delete'] = listCacheDelete;
  12209. ListCache.prototype.get = listCacheGet;
  12210. ListCache.prototype.has = listCacheHas;
  12211. ListCache.prototype.set = listCacheSet;
  12212. /**
  12213. * Creates a map cache object to store key-value pairs.
  12214. *
  12215. * @private
  12216. * @constructor
  12217. * @param {Array} [entries] The key-value pairs to cache.
  12218. */
  12219. function MapCache(entries) {
  12220. var index = -1,
  12221. length = entries ? entries.length : 0;
  12222. this.clear();
  12223. while (++index < length) {
  12224. var entry = entries[index];
  12225. this.set(entry[0], entry[1]);
  12226. }
  12227. }
  12228. /**
  12229. * Removes all key-value entries from the map.
  12230. *
  12231. * @private
  12232. * @name clear
  12233. * @memberOf MapCache
  12234. */
  12235. function mapCacheClear() {
  12236. this.__data__ = {
  12237. 'hash': new Hash,
  12238. 'map': new (Map || ListCache),
  12239. 'string': new Hash
  12240. };
  12241. }
  12242. /**
  12243. * Removes `key` and its value from the map.
  12244. *
  12245. * @private
  12246. * @name delete
  12247. * @memberOf MapCache
  12248. * @param {string} key The key of the value to remove.
  12249. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  12250. */
  12251. function mapCacheDelete(key) {
  12252. return getMapData(this, key)['delete'](key);
  12253. }
  12254. /**
  12255. * Gets the map value for `key`.
  12256. *
  12257. * @private
  12258. * @name get
  12259. * @memberOf MapCache
  12260. * @param {string} key The key of the value to get.
  12261. * @returns {*} Returns the entry value.
  12262. */
  12263. function mapCacheGet(key) {
  12264. return getMapData(this, key).get(key);
  12265. }
  12266. /**
  12267. * Checks if a map value for `key` exists.
  12268. *
  12269. * @private
  12270. * @name has
  12271. * @memberOf MapCache
  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 mapCacheHas(key) {
  12276. return getMapData(this, key).has(key);
  12277. }
  12278. /**
  12279. * Sets the map `key` to `value`.
  12280. *
  12281. * @private
  12282. * @name set
  12283. * @memberOf MapCache
  12284. * @param {string} key The key of the value to set.
  12285. * @param {*} value The value to set.
  12286. * @returns {Object} Returns the map cache instance.
  12287. */
  12288. function mapCacheSet(key, value) {
  12289. getMapData(this, key).set(key, value);
  12290. return this;
  12291. }
  12292. // Add methods to `MapCache`.
  12293. MapCache.prototype.clear = mapCacheClear;
  12294. MapCache.prototype['delete'] = mapCacheDelete;
  12295. MapCache.prototype.get = mapCacheGet;
  12296. MapCache.prototype.has = mapCacheHas;
  12297. MapCache.prototype.set = mapCacheSet;
  12298. /**
  12299. * Gets the index at which the `key` is found in `array` of key-value pairs.
  12300. *
  12301. * @private
  12302. * @param {Array} array The array to inspect.
  12303. * @param {*} key The key to search for.
  12304. * @returns {number} Returns the index of the matched value, else `-1`.
  12305. */
  12306. function assocIndexOf(array, key) {
  12307. var length = array.length;
  12308. while (length--) {
  12309. if (eq(array[length][0], key)) {
  12310. return length;
  12311. }
  12312. }
  12313. return -1;
  12314. }
  12315. /**
  12316. * The base implementation of `_.get` without support for default values.
  12317. *
  12318. * @private
  12319. * @param {Object} object The object to query.
  12320. * @param {Array|string} path The path of the property to get.
  12321. * @returns {*} Returns the resolved value.
  12322. */
  12323. function baseGet(object, path) {
  12324. path = isKey(path, object) ? [path] : castPath(path);
  12325. var index = 0,
  12326. length = path.length;
  12327. while (object != null && index < length) {
  12328. object = object[toKey(path[index++])];
  12329. }
  12330. return (index && index == length) ? object : undefined;
  12331. }
  12332. /**
  12333. * The base implementation of `_.isNative` without bad shim checks.
  12334. *
  12335. * @private
  12336. * @param {*} value The value to check.
  12337. * @returns {boolean} Returns `true` if `value` is a native function,
  12338. * else `false`.
  12339. */
  12340. function baseIsNative(value) {
  12341. if (!isObject(value) || isMasked(value)) {
  12342. return false;
  12343. }
  12344. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  12345. return pattern.test(toSource(value));
  12346. }
  12347. /**
  12348. * The base implementation of `_.toString` which doesn't convert nullish
  12349. * values to empty strings.
  12350. *
  12351. * @private
  12352. * @param {*} value The value to process.
  12353. * @returns {string} Returns the string.
  12354. */
  12355. function baseToString(value) {
  12356. // Exit early for strings to avoid a performance hit in some environments.
  12357. if (typeof value == 'string') {
  12358. return value;
  12359. }
  12360. if (isSymbol(value)) {
  12361. return symbolToString ? symbolToString.call(value) : '';
  12362. }
  12363. var result = (value + '');
  12364. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12365. }
  12366. /**
  12367. * Casts `value` to a path array if it's not one.
  12368. *
  12369. * @private
  12370. * @param {*} value The value to inspect.
  12371. * @returns {Array} Returns the cast property path array.
  12372. */
  12373. function castPath(value) {
  12374. return isArray(value) ? value : stringToPath(value);
  12375. }
  12376. /**
  12377. * Gets the data for `map`.
  12378. *
  12379. * @private
  12380. * @param {Object} map The map to query.
  12381. * @param {string} key The reference key.
  12382. * @returns {*} Returns the map data.
  12383. */
  12384. function getMapData(map, key) {
  12385. var data = map.__data__;
  12386. return isKeyable(key)
  12387. ? data[typeof key == 'string' ? 'string' : 'hash']
  12388. : data.map;
  12389. }
  12390. /**
  12391. * Gets the native function at `key` of `object`.
  12392. *
  12393. * @private
  12394. * @param {Object} object The object to query.
  12395. * @param {string} key The key of the method to get.
  12396. * @returns {*} Returns the function if it's native, else `undefined`.
  12397. */
  12398. function getNative(object, key) {
  12399. var value = getValue(object, key);
  12400. return baseIsNative(value) ? value : undefined;
  12401. }
  12402. /**
  12403. * Checks if `value` is a property name and not a property path.
  12404. *
  12405. * @private
  12406. * @param {*} value The value to check.
  12407. * @param {Object} [object] The object to query keys on.
  12408. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  12409. */
  12410. function isKey(value, object) {
  12411. if (isArray(value)) {
  12412. return false;
  12413. }
  12414. var type = typeof value;
  12415. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  12416. value == null || isSymbol(value)) {
  12417. return true;
  12418. }
  12419. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  12420. (object != null && value in Object(object));
  12421. }
  12422. /**
  12423. * Checks if `value` is suitable for use as unique object key.
  12424. *
  12425. * @private
  12426. * @param {*} value The value to check.
  12427. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  12428. */
  12429. function isKeyable(value) {
  12430. var type = typeof value;
  12431. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  12432. ? (value !== '__proto__')
  12433. : (value === null);
  12434. }
  12435. /**
  12436. * Checks if `func` has its source masked.
  12437. *
  12438. * @private
  12439. * @param {Function} func The function to check.
  12440. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  12441. */
  12442. function isMasked(func) {
  12443. return !!maskSrcKey && (maskSrcKey in func);
  12444. }
  12445. /**
  12446. * Converts `string` to a property path array.
  12447. *
  12448. * @private
  12449. * @param {string} string The string to convert.
  12450. * @returns {Array} Returns the property path array.
  12451. */
  12452. var stringToPath = memoize(function(string) {
  12453. string = toString(string);
  12454. var result = [];
  12455. if (reLeadingDot.test(string)) {
  12456. result.push('');
  12457. }
  12458. string.replace(rePropName, function(match, number, quote, string) {
  12459. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  12460. });
  12461. return result;
  12462. });
  12463. /**
  12464. * Converts `value` to a string key if it's not a string or symbol.
  12465. *
  12466. * @private
  12467. * @param {*} value The value to inspect.
  12468. * @returns {string|symbol} Returns the key.
  12469. */
  12470. function toKey(value) {
  12471. if (typeof value == 'string' || isSymbol(value)) {
  12472. return value;
  12473. }
  12474. var result = (value + '');
  12475. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  12476. }
  12477. /**
  12478. * Converts `func` to its source code.
  12479. *
  12480. * @private
  12481. * @param {Function} func The function to process.
  12482. * @returns {string} Returns the source code.
  12483. */
  12484. function toSource(func) {
  12485. if (func != null) {
  12486. try {
  12487. return funcToString.call(func);
  12488. } catch (e) {}
  12489. try {
  12490. return (func + '');
  12491. } catch (e) {}
  12492. }
  12493. return '';
  12494. }
  12495. /**
  12496. * Creates a function that memoizes the result of `func`. If `resolver` is
  12497. * provided, it determines the cache key for storing the result based on the
  12498. * arguments provided to the memoized function. By default, the first argument
  12499. * provided to the memoized function is used as the map cache key. The `func`
  12500. * is invoked with the `this` binding of the memoized function.
  12501. *
  12502. * **Note:** The cache is exposed as the `cache` property on the memoized
  12503. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  12504. * constructor with one whose instances implement the
  12505. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  12506. * method interface of `delete`, `get`, `has`, and `set`.
  12507. *
  12508. * @static
  12509. * @memberOf _
  12510. * @since 0.1.0
  12511. * @category Function
  12512. * @param {Function} func The function to have its output memoized.
  12513. * @param {Function} [resolver] The function to resolve the cache key.
  12514. * @returns {Function} Returns the new memoized function.
  12515. * @example
  12516. *
  12517. * var object = { 'a': 1, 'b': 2 };
  12518. * var other = { 'c': 3, 'd': 4 };
  12519. *
  12520. * var values = _.memoize(_.values);
  12521. * values(object);
  12522. * // => [1, 2]
  12523. *
  12524. * values(other);
  12525. * // => [3, 4]
  12526. *
  12527. * object.a = 2;
  12528. * values(object);
  12529. * // => [1, 2]
  12530. *
  12531. * // Modify the result cache.
  12532. * values.cache.set(object, ['a', 'b']);
  12533. * values(object);
  12534. * // => ['a', 'b']
  12535. *
  12536. * // Replace `_.memoize.Cache`.
  12537. * _.memoize.Cache = WeakMap;
  12538. */
  12539. function memoize(func, resolver) {
  12540. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  12541. throw new TypeError(FUNC_ERROR_TEXT);
  12542. }
  12543. var memoized = function() {
  12544. var args = arguments,
  12545. key = resolver ? resolver.apply(this, args) : args[0],
  12546. cache = memoized.cache;
  12547. if (cache.has(key)) {
  12548. return cache.get(key);
  12549. }
  12550. var result = func.apply(this, args);
  12551. memoized.cache = cache.set(key, result);
  12552. return result;
  12553. };
  12554. memoized.cache = new (memoize.Cache || MapCache);
  12555. return memoized;
  12556. }
  12557. // Assign cache to `_.memoize`.
  12558. memoize.Cache = MapCache;
  12559. /**
  12560. * Performs a
  12561. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  12562. * comparison between two values to determine if they are equivalent.
  12563. *
  12564. * @static
  12565. * @memberOf _
  12566. * @since 4.0.0
  12567. * @category Lang
  12568. * @param {*} value The value to compare.
  12569. * @param {*} other The other value to compare.
  12570. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  12571. * @example
  12572. *
  12573. * var object = { 'a': 1 };
  12574. * var other = { 'a': 1 };
  12575. *
  12576. * _.eq(object, object);
  12577. * // => true
  12578. *
  12579. * _.eq(object, other);
  12580. * // => false
  12581. *
  12582. * _.eq('a', 'a');
  12583. * // => true
  12584. *
  12585. * _.eq('a', Object('a'));
  12586. * // => false
  12587. *
  12588. * _.eq(NaN, NaN);
  12589. * // => true
  12590. */
  12591. function eq(value, other) {
  12592. return value === other || (value !== value && other !== other);
  12593. }
  12594. /**
  12595. * Checks if `value` is classified as an `Array` object.
  12596. *
  12597. * @static
  12598. * @memberOf _
  12599. * @since 0.1.0
  12600. * @category Lang
  12601. * @param {*} value The value to check.
  12602. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  12603. * @example
  12604. *
  12605. * _.isArray([1, 2, 3]);
  12606. * // => true
  12607. *
  12608. * _.isArray(document.body.children);
  12609. * // => false
  12610. *
  12611. * _.isArray('abc');
  12612. * // => false
  12613. *
  12614. * _.isArray(_.noop);
  12615. * // => false
  12616. */
  12617. var isArray = Array.isArray;
  12618. /**
  12619. * Checks if `value` is classified as a `Function` object.
  12620. *
  12621. * @static
  12622. * @memberOf _
  12623. * @since 0.1.0
  12624. * @category Lang
  12625. * @param {*} value The value to check.
  12626. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  12627. * @example
  12628. *
  12629. * _.isFunction(_);
  12630. * // => true
  12631. *
  12632. * _.isFunction(/abc/);
  12633. * // => false
  12634. */
  12635. function isFunction(value) {
  12636. // The use of `Object#toString` avoids issues with the `typeof` operator
  12637. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  12638. var tag = isObject(value) ? objectToString.call(value) : '';
  12639. return tag == funcTag || tag == genTag;
  12640. }
  12641. /**
  12642. * Checks if `value` is the
  12643. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  12644. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  12645. *
  12646. * @static
  12647. * @memberOf _
  12648. * @since 0.1.0
  12649. * @category Lang
  12650. * @param {*} value The value to check.
  12651. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  12652. * @example
  12653. *
  12654. * _.isObject({});
  12655. * // => true
  12656. *
  12657. * _.isObject([1, 2, 3]);
  12658. * // => true
  12659. *
  12660. * _.isObject(_.noop);
  12661. * // => true
  12662. *
  12663. * _.isObject(null);
  12664. * // => false
  12665. */
  12666. function isObject(value) {
  12667. var type = typeof value;
  12668. return !!value && (type == 'object' || type == 'function');
  12669. }
  12670. /**
  12671. * Checks if `value` is object-like. A value is object-like if it's not `null`
  12672. * and has a `typeof` result of "object".
  12673. *
  12674. * @static
  12675. * @memberOf _
  12676. * @since 4.0.0
  12677. * @category Lang
  12678. * @param {*} value The value to check.
  12679. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  12680. * @example
  12681. *
  12682. * _.isObjectLike({});
  12683. * // => true
  12684. *
  12685. * _.isObjectLike([1, 2, 3]);
  12686. * // => true
  12687. *
  12688. * _.isObjectLike(_.noop);
  12689. * // => false
  12690. *
  12691. * _.isObjectLike(null);
  12692. * // => false
  12693. */
  12694. function isObjectLike(value) {
  12695. return !!value && typeof value == 'object';
  12696. }
  12697. /**
  12698. * Checks if `value` is classified as a `Symbol` primitive or object.
  12699. *
  12700. * @static
  12701. * @memberOf _
  12702. * @since 4.0.0
  12703. * @category Lang
  12704. * @param {*} value The value to check.
  12705. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  12706. * @example
  12707. *
  12708. * _.isSymbol(Symbol.iterator);
  12709. * // => true
  12710. *
  12711. * _.isSymbol('abc');
  12712. * // => false
  12713. */
  12714. function isSymbol(value) {
  12715. return typeof value == 'symbol' ||
  12716. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  12717. }
  12718. /**
  12719. * Converts `value` to a string. An empty string is returned for `null`
  12720. * and `undefined` values. The sign of `-0` is preserved.
  12721. *
  12722. * @static
  12723. * @memberOf _
  12724. * @since 4.0.0
  12725. * @category Lang
  12726. * @param {*} value The value to process.
  12727. * @returns {string} Returns the string.
  12728. * @example
  12729. *
  12730. * _.toString(null);
  12731. * // => ''
  12732. *
  12733. * _.toString(-0);
  12734. * // => '-0'
  12735. *
  12736. * _.toString([1, 2, 3]);
  12737. * // => '1,2,3'
  12738. */
  12739. function toString(value) {
  12740. return value == null ? '' : baseToString(value);
  12741. }
  12742. /**
  12743. * Gets the value at `path` of `object`. If the resolved value is
  12744. * `undefined`, the `defaultValue` is returned in its place.
  12745. *
  12746. * @static
  12747. * @memberOf _
  12748. * @since 3.7.0
  12749. * @category Object
  12750. * @param {Object} object The object to query.
  12751. * @param {Array|string} path The path of the property to get.
  12752. * @param {*} [defaultValue] The value returned for `undefined` resolved values.
  12753. * @returns {*} Returns the resolved value.
  12754. * @example
  12755. *
  12756. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  12757. *
  12758. * _.get(object, 'a[0].b.c');
  12759. * // => 3
  12760. *
  12761. * _.get(object, ['a', '0', 'b', 'c']);
  12762. * // => 3
  12763. *
  12764. * _.get(object, 'a.b.c', 'default');
  12765. * // => 'default'
  12766. */
  12767. function get(object, path, defaultValue) {
  12768. var result = object == null ? undefined : baseGet(object, path);
  12769. return result === undefined ? defaultValue : result;
  12770. }
  12771. module.exports = get;
  12772. /***/ }),
  12773. /***/ 855:
  12774. /***/ (function(module, __unusedexports, __webpack_require__) {
  12775. module.exports = registerPlugin;
  12776. const factory = __webpack_require__(47);
  12777. function registerPlugin(plugins, pluginFunction) {
  12778. return factory(
  12779. plugins.includes(pluginFunction) ? plugins : plugins.concat(pluginFunction)
  12780. );
  12781. }
  12782. /***/ }),
  12783. /***/ 856:
  12784. /***/ (function(module, __unusedexports, __webpack_require__) {
  12785. module.exports = __webpack_require__(141);
  12786. /***/ }),
  12787. /***/ 863:
  12788. /***/ (function(module, __unusedexports, __webpack_require__) {
  12789. module.exports = authenticationBeforeRequest;
  12790. const btoa = __webpack_require__(675);
  12791. const withAuthorizationPrefix = __webpack_require__(143);
  12792. function authenticationBeforeRequest(state, options) {
  12793. if (typeof state.auth === "string") {
  12794. options.headers.authorization = withAuthorizationPrefix(state.auth);
  12795. return;
  12796. }
  12797. if (state.auth.username) {
  12798. const hash = btoa(`${state.auth.username}:${state.auth.password}`);
  12799. options.headers.authorization = `Basic ${hash}`;
  12800. if (state.otp) {
  12801. options.headers["x-github-otp"] = state.otp;
  12802. }
  12803. return;
  12804. }
  12805. if (state.auth.clientId) {
  12806. // There is a special case for OAuth applications, when `clientId` and `clientSecret` is passed as
  12807. // Basic Authorization instead of query parameters. The only routes where that applies share the same
  12808. // URL though: `/applications/:client_id/tokens/:access_token`.
  12809. //
  12810. // 1. [Check an authorization](https://developer.github.com/v3/oauth_authorizations/#check-an-authorization)
  12811. // 2. [Reset an authorization](https://developer.github.com/v3/oauth_authorizations/#reset-an-authorization)
  12812. // 3. [Revoke an authorization for an application](https://developer.github.com/v3/oauth_authorizations/#revoke-an-authorization-for-an-application)
  12813. //
  12814. // We identify by checking the URL. It must merge both "/applications/:client_id/tokens/:access_token"
  12815. // as well as "/applications/123/tokens/token456"
  12816. if (/\/applications\/:?[\w_]+\/tokens\/:?[\w_]+($|\?)/.test(options.url)) {
  12817. const hash = btoa(`${state.auth.clientId}:${state.auth.clientSecret}`);
  12818. options.headers.authorization = `Basic ${hash}`;
  12819. return;
  12820. }
  12821. options.url += options.url.indexOf("?") === -1 ? "?" : "&";
  12822. options.url += `client_id=${state.auth.clientId}&client_secret=${state.auth.clientSecret}`;
  12823. return;
  12824. }
  12825. return Promise.resolve()
  12826. .then(() => {
  12827. return state.auth();
  12828. })
  12829. .then(authorization => {
  12830. options.headers.authorization = withAuthorizationPrefix(authorization);
  12831. });
  12832. }
  12833. /***/ }),
  12834. /***/ 866:
  12835. /***/ (function(module, __unusedexports, __webpack_require__) {
  12836. "use strict";
  12837. var shebangRegex = __webpack_require__(816);
  12838. module.exports = function (str) {
  12839. var match = str.match(shebangRegex);
  12840. if (!match) {
  12841. return null;
  12842. }
  12843. var arr = match[0].replace(/#! ?/, '').split(' ');
  12844. var bin = arr[0].split('/').pop();
  12845. var arg = arr[1];
  12846. return (bin === 'env' ?
  12847. arg :
  12848. bin + (arg ? ' ' + arg : '')
  12849. );
  12850. };
  12851. /***/ }),
  12852. /***/ 874:
  12853. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  12854. "use strict";
  12855. // Copyright (c) Microsoft. All rights reserved.
  12856. // Licensed under the MIT license. See LICENSE file in the project root for full license information.
  12857. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  12858. return new (P || (P = Promise))(function (resolve, reject) {
  12859. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  12860. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  12861. function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
  12862. step((generator = generator.apply(thisArg, _arguments || [])).next());
  12863. });
  12864. };
  12865. Object.defineProperty(exports, "__esModule", { value: true });
  12866. const url = __webpack_require__(835);
  12867. const http = __webpack_require__(605);
  12868. const https = __webpack_require__(211);
  12869. let fs;
  12870. let tunnel;
  12871. var HttpCodes;
  12872. (function (HttpCodes) {
  12873. HttpCodes[HttpCodes["OK"] = 200] = "OK";
  12874. HttpCodes[HttpCodes["MultipleChoices"] = 300] = "MultipleChoices";
  12875. HttpCodes[HttpCodes["MovedPermanently"] = 301] = "MovedPermanently";
  12876. HttpCodes[HttpCodes["ResourceMoved"] = 302] = "ResourceMoved";
  12877. HttpCodes[HttpCodes["SeeOther"] = 303] = "SeeOther";
  12878. HttpCodes[HttpCodes["NotModified"] = 304] = "NotModified";
  12879. HttpCodes[HttpCodes["UseProxy"] = 305] = "UseProxy";
  12880. HttpCodes[HttpCodes["SwitchProxy"] = 306] = "SwitchProxy";
  12881. HttpCodes[HttpCodes["TemporaryRedirect"] = 307] = "TemporaryRedirect";
  12882. HttpCodes[HttpCodes["PermanentRedirect"] = 308] = "PermanentRedirect";
  12883. HttpCodes[HttpCodes["BadRequest"] = 400] = "BadRequest";
  12884. HttpCodes[HttpCodes["Unauthorized"] = 401] = "Unauthorized";
  12885. HttpCodes[HttpCodes["PaymentRequired"] = 402] = "PaymentRequired";
  12886. HttpCodes[HttpCodes["Forbidden"] = 403] = "Forbidden";
  12887. HttpCodes[HttpCodes["NotFound"] = 404] = "NotFound";
  12888. HttpCodes[HttpCodes["MethodNotAllowed"] = 405] = "MethodNotAllowed";
  12889. HttpCodes[HttpCodes["NotAcceptable"] = 406] = "NotAcceptable";
  12890. HttpCodes[HttpCodes["ProxyAuthenticationRequired"] = 407] = "ProxyAuthenticationRequired";
  12891. HttpCodes[HttpCodes["RequestTimeout"] = 408] = "RequestTimeout";
  12892. HttpCodes[HttpCodes["Conflict"] = 409] = "Conflict";
  12893. HttpCodes[HttpCodes["Gone"] = 410] = "Gone";
  12894. HttpCodes[HttpCodes["InternalServerError"] = 500] = "InternalServerError";
  12895. HttpCodes[HttpCodes["NotImplemented"] = 501] = "NotImplemented";
  12896. HttpCodes[HttpCodes["BadGateway"] = 502] = "BadGateway";
  12897. HttpCodes[HttpCodes["ServiceUnavailable"] = 503] = "ServiceUnavailable";
  12898. HttpCodes[HttpCodes["GatewayTimeout"] = 504] = "GatewayTimeout";
  12899. })(HttpCodes = exports.HttpCodes || (exports.HttpCodes = {}));
  12900. const HttpRedirectCodes = [HttpCodes.MovedPermanently, HttpCodes.ResourceMoved, HttpCodes.SeeOther, HttpCodes.TemporaryRedirect, HttpCodes.PermanentRedirect];
  12901. const HttpResponseRetryCodes = [HttpCodes.BadGateway, HttpCodes.ServiceUnavailable, HttpCodes.GatewayTimeout];
  12902. const RetryableHttpVerbs = ['OPTIONS', 'GET', 'DELETE', 'HEAD'];
  12903. const ExponentialBackoffCeiling = 10;
  12904. const ExponentialBackoffTimeSlice = 5;
  12905. class HttpClientResponse {
  12906. constructor(message) {
  12907. this.message = message;
  12908. }
  12909. readBody() {
  12910. return new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
  12911. let output = '';
  12912. this.message.on('data', (chunk) => {
  12913. output += chunk;
  12914. });
  12915. this.message.on('end', () => {
  12916. resolve(output);
  12917. });
  12918. }));
  12919. }
  12920. }
  12921. exports.HttpClientResponse = HttpClientResponse;
  12922. function isHttps(requestUrl) {
  12923. let parsedUrl = url.parse(requestUrl);
  12924. return parsedUrl.protocol === 'https:';
  12925. }
  12926. exports.isHttps = isHttps;
  12927. var EnvironmentVariables;
  12928. (function (EnvironmentVariables) {
  12929. EnvironmentVariables["HTTP_PROXY"] = "HTTP_PROXY";
  12930. EnvironmentVariables["HTTPS_PROXY"] = "HTTPS_PROXY";
  12931. })(EnvironmentVariables || (EnvironmentVariables = {}));
  12932. class HttpClient {
  12933. constructor(userAgent, handlers, requestOptions) {
  12934. this._ignoreSslError = false;
  12935. this._allowRedirects = true;
  12936. this._maxRedirects = 50;
  12937. this._allowRetries = false;
  12938. this._maxRetries = 1;
  12939. this._keepAlive = false;
  12940. this._disposed = false;
  12941. this.userAgent = userAgent;
  12942. this.handlers = handlers || [];
  12943. this.requestOptions = requestOptions;
  12944. if (requestOptions) {
  12945. if (requestOptions.ignoreSslError != null) {
  12946. this._ignoreSslError = requestOptions.ignoreSslError;
  12947. }
  12948. this._socketTimeout = requestOptions.socketTimeout;
  12949. this._httpProxy = requestOptions.proxy;
  12950. if (requestOptions.proxy && requestOptions.proxy.proxyBypassHosts) {
  12951. this._httpProxyBypassHosts = [];
  12952. requestOptions.proxy.proxyBypassHosts.forEach(bypass => {
  12953. this._httpProxyBypassHosts.push(new RegExp(bypass, 'i'));
  12954. });
  12955. }
  12956. this._certConfig = requestOptions.cert;
  12957. if (this._certConfig) {
  12958. // If using cert, need fs
  12959. fs = __webpack_require__(747);
  12960. // cache the cert content into memory, so we don't have to read it from disk every time
  12961. if (this._certConfig.caFile && fs.existsSync(this._certConfig.caFile)) {
  12962. this._ca = fs.readFileSync(this._certConfig.caFile, 'utf8');
  12963. }
  12964. if (this._certConfig.certFile && fs.existsSync(this._certConfig.certFile)) {
  12965. this._cert = fs.readFileSync(this._certConfig.certFile, 'utf8');
  12966. }
  12967. if (this._certConfig.keyFile && fs.existsSync(this._certConfig.keyFile)) {
  12968. this._key = fs.readFileSync(this._certConfig.keyFile, 'utf8');
  12969. }
  12970. }
  12971. if (requestOptions.allowRedirects != null) {
  12972. this._allowRedirects = requestOptions.allowRedirects;
  12973. }
  12974. if (requestOptions.maxRedirects != null) {
  12975. this._maxRedirects = Math.max(requestOptions.maxRedirects, 0);
  12976. }
  12977. if (requestOptions.keepAlive != null) {
  12978. this._keepAlive = requestOptions.keepAlive;
  12979. }
  12980. if (requestOptions.allowRetries != null) {
  12981. this._allowRetries = requestOptions.allowRetries;
  12982. }
  12983. if (requestOptions.maxRetries != null) {
  12984. this._maxRetries = requestOptions.maxRetries;
  12985. }
  12986. }
  12987. }
  12988. options(requestUrl, additionalHeaders) {
  12989. return this.request('OPTIONS', requestUrl, null, additionalHeaders || {});
  12990. }
  12991. get(requestUrl, additionalHeaders) {
  12992. return this.request('GET', requestUrl, null, additionalHeaders || {});
  12993. }
  12994. del(requestUrl, additionalHeaders) {
  12995. return this.request('DELETE', requestUrl, null, additionalHeaders || {});
  12996. }
  12997. post(requestUrl, data, additionalHeaders) {
  12998. return this.request('POST', requestUrl, data, additionalHeaders || {});
  12999. }
  13000. patch(requestUrl, data, additionalHeaders) {
  13001. return this.request('PATCH', requestUrl, data, additionalHeaders || {});
  13002. }
  13003. put(requestUrl, data, additionalHeaders) {
  13004. return this.request('PUT', requestUrl, data, additionalHeaders || {});
  13005. }
  13006. head(requestUrl, additionalHeaders) {
  13007. return this.request('HEAD', requestUrl, null, additionalHeaders || {});
  13008. }
  13009. sendStream(verb, requestUrl, stream, additionalHeaders) {
  13010. return this.request(verb, requestUrl, stream, additionalHeaders);
  13011. }
  13012. /**
  13013. * Makes a raw http request.
  13014. * All other methods such as get, post, patch, and request ultimately call this.
  13015. * Prefer get, del, post and patch
  13016. */
  13017. request(verb, requestUrl, data, headers) {
  13018. return __awaiter(this, void 0, void 0, function* () {
  13019. if (this._disposed) {
  13020. throw new Error("Client has already been disposed.");
  13021. }
  13022. let info = this._prepareRequest(verb, requestUrl, headers);
  13023. // Only perform retries on reads since writes may not be idempotent.
  13024. let maxTries = (this._allowRetries && RetryableHttpVerbs.indexOf(verb) != -1) ? this._maxRetries + 1 : 1;
  13025. let numTries = 0;
  13026. let response;
  13027. while (numTries < maxTries) {
  13028. response = yield this.requestRaw(info, data);
  13029. // Check if it's an authentication challenge
  13030. if (response && response.message && response.message.statusCode === HttpCodes.Unauthorized) {
  13031. let authenticationHandler;
  13032. for (let i = 0; i < this.handlers.length; i++) {
  13033. if (this.handlers[i].canHandleAuthentication(response)) {
  13034. authenticationHandler = this.handlers[i];
  13035. break;
  13036. }
  13037. }
  13038. if (authenticationHandler) {
  13039. return authenticationHandler.handleAuthentication(this, info, data);
  13040. }
  13041. else {
  13042. // We have received an unauthorized response but have no handlers to handle it.
  13043. // Let the response return to the caller.
  13044. return response;
  13045. }
  13046. }
  13047. let redirectsRemaining = this._maxRedirects;
  13048. while (HttpRedirectCodes.indexOf(response.message.statusCode) != -1
  13049. && this._allowRedirects
  13050. && redirectsRemaining > 0) {
  13051. const redirectUrl = response.message.headers["location"];
  13052. if (!redirectUrl) {
  13053. // if there's no location to redirect to, we won't
  13054. break;
  13055. }
  13056. // we need to finish reading the response before reassigning response
  13057. // which will leak the open socket.
  13058. yield response.readBody();
  13059. // let's make the request with the new redirectUrl
  13060. info = this._prepareRequest(verb, redirectUrl, headers);
  13061. response = yield this.requestRaw(info, data);
  13062. redirectsRemaining--;
  13063. }
  13064. if (HttpResponseRetryCodes.indexOf(response.message.statusCode) == -1) {
  13065. // If not a retry code, return immediately instead of retrying
  13066. return response;
  13067. }
  13068. numTries += 1;
  13069. if (numTries < maxTries) {
  13070. yield response.readBody();
  13071. yield this._performExponentialBackoff(numTries);
  13072. }
  13073. }
  13074. return response;
  13075. });
  13076. }
  13077. /**
  13078. * Needs to be called if keepAlive is set to true in request options.
  13079. */
  13080. dispose() {
  13081. if (this._agent) {
  13082. this._agent.destroy();
  13083. }
  13084. this._disposed = true;
  13085. }
  13086. /**
  13087. * Raw request.
  13088. * @param info
  13089. * @param data
  13090. */
  13091. requestRaw(info, data) {
  13092. return new Promise((resolve, reject) => {
  13093. let callbackForResult = function (err, res) {
  13094. if (err) {
  13095. reject(err);
  13096. }
  13097. resolve(res);
  13098. };
  13099. this.requestRawWithCallback(info, data, callbackForResult);
  13100. });
  13101. }
  13102. /**
  13103. * Raw request with callback.
  13104. * @param info
  13105. * @param data
  13106. * @param onResult
  13107. */
  13108. requestRawWithCallback(info, data, onResult) {
  13109. let socket;
  13110. let isDataString = typeof (data) === 'string';
  13111. if (typeof (data) === 'string') {
  13112. info.options.headers["Content-Length"] = Buffer.byteLength(data, 'utf8');
  13113. }
  13114. let callbackCalled = false;
  13115. let handleResult = (err, res) => {
  13116. if (!callbackCalled) {
  13117. callbackCalled = true;
  13118. onResult(err, res);
  13119. }
  13120. };
  13121. let req = info.httpModule.request(info.options, (msg) => {
  13122. let res = new HttpClientResponse(msg);
  13123. handleResult(null, res);
  13124. });
  13125. req.on('socket', (sock) => {
  13126. socket = sock;
  13127. });
  13128. // If we ever get disconnected, we want the socket to timeout eventually
  13129. req.setTimeout(this._socketTimeout || 3 * 60000, () => {
  13130. if (socket) {
  13131. socket.end();
  13132. }
  13133. handleResult(new Error('Request timeout: ' + info.options.path), null);
  13134. });
  13135. req.on('error', function (err) {
  13136. // err has statusCode property
  13137. // res should have headers
  13138. handleResult(err, null);
  13139. });
  13140. if (data && typeof (data) === 'string') {
  13141. req.write(data, 'utf8');
  13142. }
  13143. if (data && typeof (data) !== 'string') {
  13144. data.on('close', function () {
  13145. req.end();
  13146. });
  13147. data.pipe(req);
  13148. }
  13149. else {
  13150. req.end();
  13151. }
  13152. }
  13153. _prepareRequest(method, requestUrl, headers) {
  13154. const info = {};
  13155. info.parsedUrl = url.parse(requestUrl);
  13156. const usingSsl = info.parsedUrl.protocol === 'https:';
  13157. info.httpModule = usingSsl ? https : http;
  13158. const defaultPort = usingSsl ? 443 : 80;
  13159. info.options = {};
  13160. info.options.host = info.parsedUrl.hostname;
  13161. info.options.port = info.parsedUrl.port ? parseInt(info.parsedUrl.port) : defaultPort;
  13162. info.options.path = (info.parsedUrl.pathname || '') + (info.parsedUrl.search || '');
  13163. info.options.method = method;
  13164. info.options.headers = this._mergeHeaders(headers);
  13165. info.options.headers["user-agent"] = this.userAgent;
  13166. info.options.agent = this._getAgent(requestUrl);
  13167. // gives handlers an opportunity to participate
  13168. if (this.handlers && !this._isPresigned(requestUrl)) {
  13169. this.handlers.forEach((handler) => {
  13170. handler.prepareRequest(info.options);
  13171. });
  13172. }
  13173. return info;
  13174. }
  13175. _isPresigned(requestUrl) {
  13176. if (this.requestOptions && this.requestOptions.presignedUrlPatterns) {
  13177. const patterns = this.requestOptions.presignedUrlPatterns;
  13178. for (let i = 0; i < patterns.length; i++) {
  13179. if (requestUrl.match(patterns[i])) {
  13180. return true;
  13181. }
  13182. }
  13183. }
  13184. return false;
  13185. }
  13186. _mergeHeaders(headers) {
  13187. const lowercaseKeys = obj => Object.keys(obj).reduce((c, k) => (c[k.toLowerCase()] = obj[k], c), {});
  13188. if (this.requestOptions && this.requestOptions.headers) {
  13189. return Object.assign({}, lowercaseKeys(this.requestOptions.headers), lowercaseKeys(headers));
  13190. }
  13191. return lowercaseKeys(headers || {});
  13192. }
  13193. _getAgent(requestUrl) {
  13194. let agent;
  13195. let proxy = this._getProxy(requestUrl);
  13196. let useProxy = proxy.proxyUrl && proxy.proxyUrl.hostname && !this._isBypassProxy(requestUrl);
  13197. if (this._keepAlive && useProxy) {
  13198. agent = this._proxyAgent;
  13199. }
  13200. if (this._keepAlive && !useProxy) {
  13201. agent = this._agent;
  13202. }
  13203. // if agent is already assigned use that agent.
  13204. if (!!agent) {
  13205. return agent;
  13206. }
  13207. let parsedUrl = url.parse(requestUrl);
  13208. const usingSsl = parsedUrl.protocol === 'https:';
  13209. let maxSockets = 100;
  13210. if (!!this.requestOptions) {
  13211. maxSockets = this.requestOptions.maxSockets || http.globalAgent.maxSockets;
  13212. }
  13213. if (useProxy) {
  13214. // If using proxy, need tunnel
  13215. if (!tunnel) {
  13216. tunnel = __webpack_require__(856);
  13217. }
  13218. const agentOptions = {
  13219. maxSockets: maxSockets,
  13220. keepAlive: this._keepAlive,
  13221. proxy: {
  13222. proxyAuth: proxy.proxyAuth,
  13223. host: proxy.proxyUrl.hostname,
  13224. port: proxy.proxyUrl.port
  13225. },
  13226. };
  13227. let tunnelAgent;
  13228. const overHttps = proxy.proxyUrl.protocol === 'https:';
  13229. if (usingSsl) {
  13230. tunnelAgent = overHttps ? tunnel.httpsOverHttps : tunnel.httpsOverHttp;
  13231. }
  13232. else {
  13233. tunnelAgent = overHttps ? tunnel.httpOverHttps : tunnel.httpOverHttp;
  13234. }
  13235. agent = tunnelAgent(agentOptions);
  13236. this._proxyAgent = agent;
  13237. }
  13238. // if reusing agent across request and tunneling agent isn't assigned create a new agent
  13239. if (this._keepAlive && !agent) {
  13240. const options = { keepAlive: this._keepAlive, maxSockets: maxSockets };
  13241. agent = usingSsl ? new https.Agent(options) : new http.Agent(options);
  13242. this._agent = agent;
  13243. }
  13244. // if not using private agent and tunnel agent isn't setup then use global agent
  13245. if (!agent) {
  13246. agent = usingSsl ? https.globalAgent : http.globalAgent;
  13247. }
  13248. if (usingSsl && this._ignoreSslError) {
  13249. // we don't want to set NODE_TLS_REJECT_UNAUTHORIZED=0 since that will affect request for entire process
  13250. // http.RequestOptions doesn't expose a way to modify RequestOptions.agent.options
  13251. // we have to cast it to any and change it directly
  13252. agent.options = Object.assign(agent.options || {}, { rejectUnauthorized: false });
  13253. }
  13254. if (usingSsl && this._certConfig) {
  13255. agent.options = Object.assign(agent.options || {}, { ca: this._ca, cert: this._cert, key: this._key, passphrase: this._certConfig.passphrase });
  13256. }
  13257. return agent;
  13258. }
  13259. _getProxy(requestUrl) {
  13260. const parsedUrl = url.parse(requestUrl);
  13261. let usingSsl = parsedUrl.protocol === 'https:';
  13262. let proxyConfig = this._httpProxy;
  13263. // fallback to http_proxy and https_proxy env
  13264. let https_proxy = process.env[EnvironmentVariables.HTTPS_PROXY];
  13265. let http_proxy = process.env[EnvironmentVariables.HTTP_PROXY];
  13266. if (!proxyConfig) {
  13267. if (https_proxy && usingSsl) {
  13268. proxyConfig = {
  13269. proxyUrl: https_proxy
  13270. };
  13271. }
  13272. else if (http_proxy) {
  13273. proxyConfig = {
  13274. proxyUrl: http_proxy
  13275. };
  13276. }
  13277. }
  13278. let proxyUrl;
  13279. let proxyAuth;
  13280. if (proxyConfig) {
  13281. if (proxyConfig.proxyUrl.length > 0) {
  13282. proxyUrl = url.parse(proxyConfig.proxyUrl);
  13283. }
  13284. if (proxyConfig.proxyUsername || proxyConfig.proxyPassword) {
  13285. proxyAuth = proxyConfig.proxyUsername + ":" + proxyConfig.proxyPassword;
  13286. }
  13287. }
  13288. return { proxyUrl: proxyUrl, proxyAuth: proxyAuth };
  13289. }
  13290. _isBypassProxy(requestUrl) {
  13291. if (!this._httpProxyBypassHosts) {
  13292. return false;
  13293. }
  13294. let bypass = false;
  13295. this._httpProxyBypassHosts.forEach(bypassHost => {
  13296. if (bypassHost.test(requestUrl)) {
  13297. bypass = true;
  13298. }
  13299. });
  13300. return bypass;
  13301. }
  13302. _performExponentialBackoff(retryNumber) {
  13303. retryNumber = Math.min(ExponentialBackoffCeiling, retryNumber);
  13304. const ms = ExponentialBackoffTimeSlice * Math.pow(2, retryNumber);
  13305. return new Promise(resolve => setTimeout(() => resolve(), ms));
  13306. }
  13307. }
  13308. exports.HttpClient = HttpClient;
  13309. /***/ }),
  13310. /***/ 881:
  13311. /***/ (function(module) {
  13312. "use strict";
  13313. const isWin = process.platform === 'win32';
  13314. function notFoundError(original, syscall) {
  13315. return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
  13316. code: 'ENOENT',
  13317. errno: 'ENOENT',
  13318. syscall: `${syscall} ${original.command}`,
  13319. path: original.command,
  13320. spawnargs: original.args,
  13321. });
  13322. }
  13323. function hookChildProcess(cp, parsed) {
  13324. if (!isWin) {
  13325. return;
  13326. }
  13327. const originalEmit = cp.emit;
  13328. cp.emit = function (name, arg1) {
  13329. // If emitting "exit" event and exit code is 1, we need to check if
  13330. // the command exists and emit an "error" instead
  13331. // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
  13332. if (name === 'exit') {
  13333. const err = verifyENOENT(arg1, parsed, 'spawn');
  13334. if (err) {
  13335. return originalEmit.call(cp, 'error', err);
  13336. }
  13337. }
  13338. return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
  13339. };
  13340. }
  13341. function verifyENOENT(status, parsed) {
  13342. if (isWin && status === 1 && !parsed.file) {
  13343. return notFoundError(parsed.original, 'spawn');
  13344. }
  13345. return null;
  13346. }
  13347. function verifyENOENTSync(status, parsed) {
  13348. if (isWin && status === 1 && !parsed.file) {
  13349. return notFoundError(parsed.original, 'spawnSync');
  13350. }
  13351. return null;
  13352. }
  13353. module.exports = {
  13354. hookChildProcess,
  13355. verifyENOENT,
  13356. verifyENOENTSync,
  13357. notFoundError,
  13358. };
  13359. /***/ }),
  13360. /***/ 883:
  13361. /***/ (function(module) {
  13362. /**
  13363. * lodash (Custom Build) <https://lodash.com/>
  13364. * Build: `lodash modularize exports="npm" -o ./`
  13365. * Copyright jQuery Foundation and other contributors <https://jquery.org/>
  13366. * Released under MIT license <https://lodash.com/license>
  13367. * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
  13368. * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  13369. */
  13370. /** Used as the `TypeError` message for "Functions" methods. */
  13371. var FUNC_ERROR_TEXT = 'Expected a function';
  13372. /** Used to stand-in for `undefined` hash values. */
  13373. var HASH_UNDEFINED = '__lodash_hash_undefined__';
  13374. /** Used as references for various `Number` constants. */
  13375. var INFINITY = 1 / 0,
  13376. MAX_SAFE_INTEGER = 9007199254740991;
  13377. /** `Object#toString` result references. */
  13378. var funcTag = '[object Function]',
  13379. genTag = '[object GeneratorFunction]',
  13380. symbolTag = '[object Symbol]';
  13381. /** Used to match property names within property paths. */
  13382. var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,
  13383. reIsPlainProp = /^\w*$/,
  13384. reLeadingDot = /^\./,
  13385. rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g;
  13386. /**
  13387. * Used to match `RegExp`
  13388. * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).
  13389. */
  13390. var reRegExpChar = /[\\^$.*+?()[\]{}|]/g;
  13391. /** Used to match backslashes in property paths. */
  13392. var reEscapeChar = /\\(\\)?/g;
  13393. /** Used to detect host constructors (Safari). */
  13394. var reIsHostCtor = /^\[object .+?Constructor\]$/;
  13395. /** Used to detect unsigned integer values. */
  13396. var reIsUint = /^(?:0|[1-9]\d*)$/;
  13397. /** Detect free variable `global` from Node.js. */
  13398. var freeGlobal = typeof global == 'object' && global && global.Object === Object && global;
  13399. /** Detect free variable `self`. */
  13400. var freeSelf = typeof self == 'object' && self && self.Object === Object && self;
  13401. /** Used as a reference to the global object. */
  13402. var root = freeGlobal || freeSelf || Function('return this')();
  13403. /**
  13404. * Gets the value at `key` of `object`.
  13405. *
  13406. * @private
  13407. * @param {Object} [object] The object to query.
  13408. * @param {string} key The key of the property to get.
  13409. * @returns {*} Returns the property value.
  13410. */
  13411. function getValue(object, key) {
  13412. return object == null ? undefined : object[key];
  13413. }
  13414. /**
  13415. * Checks if `value` is a host object in IE < 9.
  13416. *
  13417. * @private
  13418. * @param {*} value The value to check.
  13419. * @returns {boolean} Returns `true` if `value` is a host object, else `false`.
  13420. */
  13421. function isHostObject(value) {
  13422. // Many host objects are `Object` objects that can coerce to strings
  13423. // despite having improperly defined `toString` methods.
  13424. var result = false;
  13425. if (value != null && typeof value.toString != 'function') {
  13426. try {
  13427. result = !!(value + '');
  13428. } catch (e) {}
  13429. }
  13430. return result;
  13431. }
  13432. /** Used for built-in method references. */
  13433. var arrayProto = Array.prototype,
  13434. funcProto = Function.prototype,
  13435. objectProto = Object.prototype;
  13436. /** Used to detect overreaching core-js shims. */
  13437. var coreJsData = root['__core-js_shared__'];
  13438. /** Used to detect methods masquerading as native. */
  13439. var maskSrcKey = (function() {
  13440. var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');
  13441. return uid ? ('Symbol(src)_1.' + uid) : '';
  13442. }());
  13443. /** Used to resolve the decompiled source of functions. */
  13444. var funcToString = funcProto.toString;
  13445. /** Used to check objects for own properties. */
  13446. var hasOwnProperty = objectProto.hasOwnProperty;
  13447. /**
  13448. * Used to resolve the
  13449. * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
  13450. * of values.
  13451. */
  13452. var objectToString = objectProto.toString;
  13453. /** Used to detect if a method is native. */
  13454. var reIsNative = RegExp('^' +
  13455. funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&')
  13456. .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'
  13457. );
  13458. /** Built-in value references. */
  13459. var Symbol = root.Symbol,
  13460. splice = arrayProto.splice;
  13461. /* Built-in method references that are verified to be native. */
  13462. var Map = getNative(root, 'Map'),
  13463. nativeCreate = getNative(Object, 'create');
  13464. /** Used to convert symbols to primitives and strings. */
  13465. var symbolProto = Symbol ? Symbol.prototype : undefined,
  13466. symbolToString = symbolProto ? symbolProto.toString : undefined;
  13467. /**
  13468. * Creates a hash object.
  13469. *
  13470. * @private
  13471. * @constructor
  13472. * @param {Array} [entries] The key-value pairs to cache.
  13473. */
  13474. function Hash(entries) {
  13475. var index = -1,
  13476. length = entries ? entries.length : 0;
  13477. this.clear();
  13478. while (++index < length) {
  13479. var entry = entries[index];
  13480. this.set(entry[0], entry[1]);
  13481. }
  13482. }
  13483. /**
  13484. * Removes all key-value entries from the hash.
  13485. *
  13486. * @private
  13487. * @name clear
  13488. * @memberOf Hash
  13489. */
  13490. function hashClear() {
  13491. this.__data__ = nativeCreate ? nativeCreate(null) : {};
  13492. }
  13493. /**
  13494. * Removes `key` and its value from the hash.
  13495. *
  13496. * @private
  13497. * @name delete
  13498. * @memberOf Hash
  13499. * @param {Object} hash The hash to modify.
  13500. * @param {string} key The key of the value to remove.
  13501. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13502. */
  13503. function hashDelete(key) {
  13504. return this.has(key) && delete this.__data__[key];
  13505. }
  13506. /**
  13507. * Gets the hash value for `key`.
  13508. *
  13509. * @private
  13510. * @name get
  13511. * @memberOf Hash
  13512. * @param {string} key The key of the value to get.
  13513. * @returns {*} Returns the entry value.
  13514. */
  13515. function hashGet(key) {
  13516. var data = this.__data__;
  13517. if (nativeCreate) {
  13518. var result = data[key];
  13519. return result === HASH_UNDEFINED ? undefined : result;
  13520. }
  13521. return hasOwnProperty.call(data, key) ? data[key] : undefined;
  13522. }
  13523. /**
  13524. * Checks if a hash value for `key` exists.
  13525. *
  13526. * @private
  13527. * @name has
  13528. * @memberOf Hash
  13529. * @param {string} key The key of the entry to check.
  13530. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13531. */
  13532. function hashHas(key) {
  13533. var data = this.__data__;
  13534. return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key);
  13535. }
  13536. /**
  13537. * Sets the hash `key` to `value`.
  13538. *
  13539. * @private
  13540. * @name set
  13541. * @memberOf Hash
  13542. * @param {string} key The key of the value to set.
  13543. * @param {*} value The value to set.
  13544. * @returns {Object} Returns the hash instance.
  13545. */
  13546. function hashSet(key, value) {
  13547. var data = this.__data__;
  13548. data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;
  13549. return this;
  13550. }
  13551. // Add methods to `Hash`.
  13552. Hash.prototype.clear = hashClear;
  13553. Hash.prototype['delete'] = hashDelete;
  13554. Hash.prototype.get = hashGet;
  13555. Hash.prototype.has = hashHas;
  13556. Hash.prototype.set = hashSet;
  13557. /**
  13558. * Creates an list cache object.
  13559. *
  13560. * @private
  13561. * @constructor
  13562. * @param {Array} [entries] The key-value pairs to cache.
  13563. */
  13564. function ListCache(entries) {
  13565. var index = -1,
  13566. length = entries ? entries.length : 0;
  13567. this.clear();
  13568. while (++index < length) {
  13569. var entry = entries[index];
  13570. this.set(entry[0], entry[1]);
  13571. }
  13572. }
  13573. /**
  13574. * Removes all key-value entries from the list cache.
  13575. *
  13576. * @private
  13577. * @name clear
  13578. * @memberOf ListCache
  13579. */
  13580. function listCacheClear() {
  13581. this.__data__ = [];
  13582. }
  13583. /**
  13584. * Removes `key` and its value from the list cache.
  13585. *
  13586. * @private
  13587. * @name delete
  13588. * @memberOf ListCache
  13589. * @param {string} key The key of the value to remove.
  13590. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13591. */
  13592. function listCacheDelete(key) {
  13593. var data = this.__data__,
  13594. index = assocIndexOf(data, key);
  13595. if (index < 0) {
  13596. return false;
  13597. }
  13598. var lastIndex = data.length - 1;
  13599. if (index == lastIndex) {
  13600. data.pop();
  13601. } else {
  13602. splice.call(data, index, 1);
  13603. }
  13604. return true;
  13605. }
  13606. /**
  13607. * Gets the list cache value for `key`.
  13608. *
  13609. * @private
  13610. * @name get
  13611. * @memberOf ListCache
  13612. * @param {string} key The key of the value to get.
  13613. * @returns {*} Returns the entry value.
  13614. */
  13615. function listCacheGet(key) {
  13616. var data = this.__data__,
  13617. index = assocIndexOf(data, key);
  13618. return index < 0 ? undefined : data[index][1];
  13619. }
  13620. /**
  13621. * Checks if a list cache value for `key` exists.
  13622. *
  13623. * @private
  13624. * @name has
  13625. * @memberOf ListCache
  13626. * @param {string} key The key of the entry to check.
  13627. * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.
  13628. */
  13629. function listCacheHas(key) {
  13630. return assocIndexOf(this.__data__, key) > -1;
  13631. }
  13632. /**
  13633. * Sets the list cache `key` to `value`.
  13634. *
  13635. * @private
  13636. * @name set
  13637. * @memberOf ListCache
  13638. * @param {string} key The key of the value to set.
  13639. * @param {*} value The value to set.
  13640. * @returns {Object} Returns the list cache instance.
  13641. */
  13642. function listCacheSet(key, value) {
  13643. var data = this.__data__,
  13644. index = assocIndexOf(data, key);
  13645. if (index < 0) {
  13646. data.push([key, value]);
  13647. } else {
  13648. data[index][1] = value;
  13649. }
  13650. return this;
  13651. }
  13652. // Add methods to `ListCache`.
  13653. ListCache.prototype.clear = listCacheClear;
  13654. ListCache.prototype['delete'] = listCacheDelete;
  13655. ListCache.prototype.get = listCacheGet;
  13656. ListCache.prototype.has = listCacheHas;
  13657. ListCache.prototype.set = listCacheSet;
  13658. /**
  13659. * Creates a map cache object to store key-value pairs.
  13660. *
  13661. * @private
  13662. * @constructor
  13663. * @param {Array} [entries] The key-value pairs to cache.
  13664. */
  13665. function MapCache(entries) {
  13666. var index = -1,
  13667. length = entries ? entries.length : 0;
  13668. this.clear();
  13669. while (++index < length) {
  13670. var entry = entries[index];
  13671. this.set(entry[0], entry[1]);
  13672. }
  13673. }
  13674. /**
  13675. * Removes all key-value entries from the map.
  13676. *
  13677. * @private
  13678. * @name clear
  13679. * @memberOf MapCache
  13680. */
  13681. function mapCacheClear() {
  13682. this.__data__ = {
  13683. 'hash': new Hash,
  13684. 'map': new (Map || ListCache),
  13685. 'string': new Hash
  13686. };
  13687. }
  13688. /**
  13689. * Removes `key` and its value from the map.
  13690. *
  13691. * @private
  13692. * @name delete
  13693. * @memberOf MapCache
  13694. * @param {string} key The key of the value to remove.
  13695. * @returns {boolean} Returns `true` if the entry was removed, else `false`.
  13696. */
  13697. function mapCacheDelete(key) {
  13698. return getMapData(this, key)['delete'](key);
  13699. }
  13700. /**
  13701. * Gets the map value for `key`.
  13702. *
  13703. * @private
  13704. * @name get
  13705. * @memberOf MapCache
  13706. * @param {string} key The key of the value to get.
  13707. * @returns {*} Returns the entry value.
  13708. */
  13709. function mapCacheGet(key) {
  13710. return getMapData(this, key).get(key);
  13711. }
  13712. /**
  13713. * Checks if a map value for `key` exists.
  13714. *
  13715. * @private
  13716. * @name has
  13717. * @memberOf MapCache
  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 mapCacheHas(key) {
  13722. return getMapData(this, key).has(key);
  13723. }
  13724. /**
  13725. * Sets the map `key` to `value`.
  13726. *
  13727. * @private
  13728. * @name set
  13729. * @memberOf MapCache
  13730. * @param {string} key The key of the value to set.
  13731. * @param {*} value The value to set.
  13732. * @returns {Object} Returns the map cache instance.
  13733. */
  13734. function mapCacheSet(key, value) {
  13735. getMapData(this, key).set(key, value);
  13736. return this;
  13737. }
  13738. // Add methods to `MapCache`.
  13739. MapCache.prototype.clear = mapCacheClear;
  13740. MapCache.prototype['delete'] = mapCacheDelete;
  13741. MapCache.prototype.get = mapCacheGet;
  13742. MapCache.prototype.has = mapCacheHas;
  13743. MapCache.prototype.set = mapCacheSet;
  13744. /**
  13745. * Assigns `value` to `key` of `object` if the existing value is not equivalent
  13746. * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  13747. * for equality comparisons.
  13748. *
  13749. * @private
  13750. * @param {Object} object The object to modify.
  13751. * @param {string} key The key of the property to assign.
  13752. * @param {*} value The value to assign.
  13753. */
  13754. function assignValue(object, key, value) {
  13755. var objValue = object[key];
  13756. if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||
  13757. (value === undefined && !(key in object))) {
  13758. object[key] = value;
  13759. }
  13760. }
  13761. /**
  13762. * Gets the index at which the `key` is found in `array` of key-value pairs.
  13763. *
  13764. * @private
  13765. * @param {Array} array The array to inspect.
  13766. * @param {*} key The key to search for.
  13767. * @returns {number} Returns the index of the matched value, else `-1`.
  13768. */
  13769. function assocIndexOf(array, key) {
  13770. var length = array.length;
  13771. while (length--) {
  13772. if (eq(array[length][0], key)) {
  13773. return length;
  13774. }
  13775. }
  13776. return -1;
  13777. }
  13778. /**
  13779. * The base implementation of `_.isNative` without bad shim checks.
  13780. *
  13781. * @private
  13782. * @param {*} value The value to check.
  13783. * @returns {boolean} Returns `true` if `value` is a native function,
  13784. * else `false`.
  13785. */
  13786. function baseIsNative(value) {
  13787. if (!isObject(value) || isMasked(value)) {
  13788. return false;
  13789. }
  13790. var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor;
  13791. return pattern.test(toSource(value));
  13792. }
  13793. /**
  13794. * The base implementation of `_.set`.
  13795. *
  13796. * @private
  13797. * @param {Object} object The object to modify.
  13798. * @param {Array|string} path The path of the property to set.
  13799. * @param {*} value The value to set.
  13800. * @param {Function} [customizer] The function to customize path creation.
  13801. * @returns {Object} Returns `object`.
  13802. */
  13803. function baseSet(object, path, value, customizer) {
  13804. if (!isObject(object)) {
  13805. return object;
  13806. }
  13807. path = isKey(path, object) ? [path] : castPath(path);
  13808. var index = -1,
  13809. length = path.length,
  13810. lastIndex = length - 1,
  13811. nested = object;
  13812. while (nested != null && ++index < length) {
  13813. var key = toKey(path[index]),
  13814. newValue = value;
  13815. if (index != lastIndex) {
  13816. var objValue = nested[key];
  13817. newValue = customizer ? customizer(objValue, key, nested) : undefined;
  13818. if (newValue === undefined) {
  13819. newValue = isObject(objValue)
  13820. ? objValue
  13821. : (isIndex(path[index + 1]) ? [] : {});
  13822. }
  13823. }
  13824. assignValue(nested, key, newValue);
  13825. nested = nested[key];
  13826. }
  13827. return object;
  13828. }
  13829. /**
  13830. * The base implementation of `_.toString` which doesn't convert nullish
  13831. * values to empty strings.
  13832. *
  13833. * @private
  13834. * @param {*} value The value to process.
  13835. * @returns {string} Returns the string.
  13836. */
  13837. function baseToString(value) {
  13838. // Exit early for strings to avoid a performance hit in some environments.
  13839. if (typeof value == 'string') {
  13840. return value;
  13841. }
  13842. if (isSymbol(value)) {
  13843. return symbolToString ? symbolToString.call(value) : '';
  13844. }
  13845. var result = (value + '');
  13846. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  13847. }
  13848. /**
  13849. * Casts `value` to a path array if it's not one.
  13850. *
  13851. * @private
  13852. * @param {*} value The value to inspect.
  13853. * @returns {Array} Returns the cast property path array.
  13854. */
  13855. function castPath(value) {
  13856. return isArray(value) ? value : stringToPath(value);
  13857. }
  13858. /**
  13859. * Gets the data for `map`.
  13860. *
  13861. * @private
  13862. * @param {Object} map The map to query.
  13863. * @param {string} key The reference key.
  13864. * @returns {*} Returns the map data.
  13865. */
  13866. function getMapData(map, key) {
  13867. var data = map.__data__;
  13868. return isKeyable(key)
  13869. ? data[typeof key == 'string' ? 'string' : 'hash']
  13870. : data.map;
  13871. }
  13872. /**
  13873. * Gets the native function at `key` of `object`.
  13874. *
  13875. * @private
  13876. * @param {Object} object The object to query.
  13877. * @param {string} key The key of the method to get.
  13878. * @returns {*} Returns the function if it's native, else `undefined`.
  13879. */
  13880. function getNative(object, key) {
  13881. var value = getValue(object, key);
  13882. return baseIsNative(value) ? value : undefined;
  13883. }
  13884. /**
  13885. * Checks if `value` is a valid array-like index.
  13886. *
  13887. * @private
  13888. * @param {*} value The value to check.
  13889. * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.
  13890. * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.
  13891. */
  13892. function isIndex(value, length) {
  13893. length = length == null ? MAX_SAFE_INTEGER : length;
  13894. return !!length &&
  13895. (typeof value == 'number' || reIsUint.test(value)) &&
  13896. (value > -1 && value % 1 == 0 && value < length);
  13897. }
  13898. /**
  13899. * Checks if `value` is a property name and not a property path.
  13900. *
  13901. * @private
  13902. * @param {*} value The value to check.
  13903. * @param {Object} [object] The object to query keys on.
  13904. * @returns {boolean} Returns `true` if `value` is a property name, else `false`.
  13905. */
  13906. function isKey(value, object) {
  13907. if (isArray(value)) {
  13908. return false;
  13909. }
  13910. var type = typeof value;
  13911. if (type == 'number' || type == 'symbol' || type == 'boolean' ||
  13912. value == null || isSymbol(value)) {
  13913. return true;
  13914. }
  13915. return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||
  13916. (object != null && value in Object(object));
  13917. }
  13918. /**
  13919. * Checks if `value` is suitable for use as unique object key.
  13920. *
  13921. * @private
  13922. * @param {*} value The value to check.
  13923. * @returns {boolean} Returns `true` if `value` is suitable, else `false`.
  13924. */
  13925. function isKeyable(value) {
  13926. var type = typeof value;
  13927. return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')
  13928. ? (value !== '__proto__')
  13929. : (value === null);
  13930. }
  13931. /**
  13932. * Checks if `func` has its source masked.
  13933. *
  13934. * @private
  13935. * @param {Function} func The function to check.
  13936. * @returns {boolean} Returns `true` if `func` is masked, else `false`.
  13937. */
  13938. function isMasked(func) {
  13939. return !!maskSrcKey && (maskSrcKey in func);
  13940. }
  13941. /**
  13942. * Converts `string` to a property path array.
  13943. *
  13944. * @private
  13945. * @param {string} string The string to convert.
  13946. * @returns {Array} Returns the property path array.
  13947. */
  13948. var stringToPath = memoize(function(string) {
  13949. string = toString(string);
  13950. var result = [];
  13951. if (reLeadingDot.test(string)) {
  13952. result.push('');
  13953. }
  13954. string.replace(rePropName, function(match, number, quote, string) {
  13955. result.push(quote ? string.replace(reEscapeChar, '$1') : (number || match));
  13956. });
  13957. return result;
  13958. });
  13959. /**
  13960. * Converts `value` to a string key if it's not a string or symbol.
  13961. *
  13962. * @private
  13963. * @param {*} value The value to inspect.
  13964. * @returns {string|symbol} Returns the key.
  13965. */
  13966. function toKey(value) {
  13967. if (typeof value == 'string' || isSymbol(value)) {
  13968. return value;
  13969. }
  13970. var result = (value + '');
  13971. return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
  13972. }
  13973. /**
  13974. * Converts `func` to its source code.
  13975. *
  13976. * @private
  13977. * @param {Function} func The function to process.
  13978. * @returns {string} Returns the source code.
  13979. */
  13980. function toSource(func) {
  13981. if (func != null) {
  13982. try {
  13983. return funcToString.call(func);
  13984. } catch (e) {}
  13985. try {
  13986. return (func + '');
  13987. } catch (e) {}
  13988. }
  13989. return '';
  13990. }
  13991. /**
  13992. * Creates a function that memoizes the result of `func`. If `resolver` is
  13993. * provided, it determines the cache key for storing the result based on the
  13994. * arguments provided to the memoized function. By default, the first argument
  13995. * provided to the memoized function is used as the map cache key. The `func`
  13996. * is invoked with the `this` binding of the memoized function.
  13997. *
  13998. * **Note:** The cache is exposed as the `cache` property on the memoized
  13999. * function. Its creation may be customized by replacing the `_.memoize.Cache`
  14000. * constructor with one whose instances implement the
  14001. * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)
  14002. * method interface of `delete`, `get`, `has`, and `set`.
  14003. *
  14004. * @static
  14005. * @memberOf _
  14006. * @since 0.1.0
  14007. * @category Function
  14008. * @param {Function} func The function to have its output memoized.
  14009. * @param {Function} [resolver] The function to resolve the cache key.
  14010. * @returns {Function} Returns the new memoized function.
  14011. * @example
  14012. *
  14013. * var object = { 'a': 1, 'b': 2 };
  14014. * var other = { 'c': 3, 'd': 4 };
  14015. *
  14016. * var values = _.memoize(_.values);
  14017. * values(object);
  14018. * // => [1, 2]
  14019. *
  14020. * values(other);
  14021. * // => [3, 4]
  14022. *
  14023. * object.a = 2;
  14024. * values(object);
  14025. * // => [1, 2]
  14026. *
  14027. * // Modify the result cache.
  14028. * values.cache.set(object, ['a', 'b']);
  14029. * values(object);
  14030. * // => ['a', 'b']
  14031. *
  14032. * // Replace `_.memoize.Cache`.
  14033. * _.memoize.Cache = WeakMap;
  14034. */
  14035. function memoize(func, resolver) {
  14036. if (typeof func != 'function' || (resolver && typeof resolver != 'function')) {
  14037. throw new TypeError(FUNC_ERROR_TEXT);
  14038. }
  14039. var memoized = function() {
  14040. var args = arguments,
  14041. key = resolver ? resolver.apply(this, args) : args[0],
  14042. cache = memoized.cache;
  14043. if (cache.has(key)) {
  14044. return cache.get(key);
  14045. }
  14046. var result = func.apply(this, args);
  14047. memoized.cache = cache.set(key, result);
  14048. return result;
  14049. };
  14050. memoized.cache = new (memoize.Cache || MapCache);
  14051. return memoized;
  14052. }
  14053. // Assign cache to `_.memoize`.
  14054. memoize.Cache = MapCache;
  14055. /**
  14056. * Performs a
  14057. * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)
  14058. * comparison between two values to determine if they are equivalent.
  14059. *
  14060. * @static
  14061. * @memberOf _
  14062. * @since 4.0.0
  14063. * @category Lang
  14064. * @param {*} value The value to compare.
  14065. * @param {*} other The other value to compare.
  14066. * @returns {boolean} Returns `true` if the values are equivalent, else `false`.
  14067. * @example
  14068. *
  14069. * var object = { 'a': 1 };
  14070. * var other = { 'a': 1 };
  14071. *
  14072. * _.eq(object, object);
  14073. * // => true
  14074. *
  14075. * _.eq(object, other);
  14076. * // => false
  14077. *
  14078. * _.eq('a', 'a');
  14079. * // => true
  14080. *
  14081. * _.eq('a', Object('a'));
  14082. * // => false
  14083. *
  14084. * _.eq(NaN, NaN);
  14085. * // => true
  14086. */
  14087. function eq(value, other) {
  14088. return value === other || (value !== value && other !== other);
  14089. }
  14090. /**
  14091. * Checks if `value` is classified as an `Array` object.
  14092. *
  14093. * @static
  14094. * @memberOf _
  14095. * @since 0.1.0
  14096. * @category Lang
  14097. * @param {*} value The value to check.
  14098. * @returns {boolean} Returns `true` if `value` is an array, else `false`.
  14099. * @example
  14100. *
  14101. * _.isArray([1, 2, 3]);
  14102. * // => true
  14103. *
  14104. * _.isArray(document.body.children);
  14105. * // => false
  14106. *
  14107. * _.isArray('abc');
  14108. * // => false
  14109. *
  14110. * _.isArray(_.noop);
  14111. * // => false
  14112. */
  14113. var isArray = Array.isArray;
  14114. /**
  14115. * Checks if `value` is classified as a `Function` object.
  14116. *
  14117. * @static
  14118. * @memberOf _
  14119. * @since 0.1.0
  14120. * @category Lang
  14121. * @param {*} value The value to check.
  14122. * @returns {boolean} Returns `true` if `value` is a function, else `false`.
  14123. * @example
  14124. *
  14125. * _.isFunction(_);
  14126. * // => true
  14127. *
  14128. * _.isFunction(/abc/);
  14129. * // => false
  14130. */
  14131. function isFunction(value) {
  14132. // The use of `Object#toString` avoids issues with the `typeof` operator
  14133. // in Safari 8-9 which returns 'object' for typed array and other constructors.
  14134. var tag = isObject(value) ? objectToString.call(value) : '';
  14135. return tag == funcTag || tag == genTag;
  14136. }
  14137. /**
  14138. * Checks if `value` is the
  14139. * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)
  14140. * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
  14141. *
  14142. * @static
  14143. * @memberOf _
  14144. * @since 0.1.0
  14145. * @category Lang
  14146. * @param {*} value The value to check.
  14147. * @returns {boolean} Returns `true` if `value` is an object, else `false`.
  14148. * @example
  14149. *
  14150. * _.isObject({});
  14151. * // => true
  14152. *
  14153. * _.isObject([1, 2, 3]);
  14154. * // => true
  14155. *
  14156. * _.isObject(_.noop);
  14157. * // => true
  14158. *
  14159. * _.isObject(null);
  14160. * // => false
  14161. */
  14162. function isObject(value) {
  14163. var type = typeof value;
  14164. return !!value && (type == 'object' || type == 'function');
  14165. }
  14166. /**
  14167. * Checks if `value` is object-like. A value is object-like if it's not `null`
  14168. * and has a `typeof` result of "object".
  14169. *
  14170. * @static
  14171. * @memberOf _
  14172. * @since 4.0.0
  14173. * @category Lang
  14174. * @param {*} value The value to check.
  14175. * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
  14176. * @example
  14177. *
  14178. * _.isObjectLike({});
  14179. * // => true
  14180. *
  14181. * _.isObjectLike([1, 2, 3]);
  14182. * // => true
  14183. *
  14184. * _.isObjectLike(_.noop);
  14185. * // => false
  14186. *
  14187. * _.isObjectLike(null);
  14188. * // => false
  14189. */
  14190. function isObjectLike(value) {
  14191. return !!value && typeof value == 'object';
  14192. }
  14193. /**
  14194. * Checks if `value` is classified as a `Symbol` primitive or object.
  14195. *
  14196. * @static
  14197. * @memberOf _
  14198. * @since 4.0.0
  14199. * @category Lang
  14200. * @param {*} value The value to check.
  14201. * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.
  14202. * @example
  14203. *
  14204. * _.isSymbol(Symbol.iterator);
  14205. * // => true
  14206. *
  14207. * _.isSymbol('abc');
  14208. * // => false
  14209. */
  14210. function isSymbol(value) {
  14211. return typeof value == 'symbol' ||
  14212. (isObjectLike(value) && objectToString.call(value) == symbolTag);
  14213. }
  14214. /**
  14215. * Converts `value` to a string. An empty string is returned for `null`
  14216. * and `undefined` values. The sign of `-0` is preserved.
  14217. *
  14218. * @static
  14219. * @memberOf _
  14220. * @since 4.0.0
  14221. * @category Lang
  14222. * @param {*} value The value to process.
  14223. * @returns {string} Returns the string.
  14224. * @example
  14225. *
  14226. * _.toString(null);
  14227. * // => ''
  14228. *
  14229. * _.toString(-0);
  14230. * // => '-0'
  14231. *
  14232. * _.toString([1, 2, 3]);
  14233. * // => '1,2,3'
  14234. */
  14235. function toString(value) {
  14236. return value == null ? '' : baseToString(value);
  14237. }
  14238. /**
  14239. * Sets the value at `path` of `object`. If a portion of `path` doesn't exist,
  14240. * it's created. Arrays are created for missing index properties while objects
  14241. * are created for all other missing properties. Use `_.setWith` to customize
  14242. * `path` creation.
  14243. *
  14244. * **Note:** This method mutates `object`.
  14245. *
  14246. * @static
  14247. * @memberOf _
  14248. * @since 3.7.0
  14249. * @category Object
  14250. * @param {Object} object The object to modify.
  14251. * @param {Array|string} path The path of the property to set.
  14252. * @param {*} value The value to set.
  14253. * @returns {Object} Returns `object`.
  14254. * @example
  14255. *
  14256. * var object = { 'a': [{ 'b': { 'c': 3 } }] };
  14257. *
  14258. * _.set(object, 'a[0].b.c', 4);
  14259. * console.log(object.a[0].b.c);
  14260. * // => 4
  14261. *
  14262. * _.set(object, ['x', '0', 'y', 'z'], 5);
  14263. * console.log(object.x[0].y.z);
  14264. * // => 5
  14265. */
  14266. function set(object, path, value) {
  14267. return object == null ? object : baseSet(object, path, value);
  14268. }
  14269. module.exports = set;
  14270. /***/ }),
  14271. /***/ 898:
  14272. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14273. "use strict";
  14274. Object.defineProperty(exports, '__esModule', { value: true });
  14275. var request = __webpack_require__(753);
  14276. var universalUserAgent = __webpack_require__(796);
  14277. const VERSION = "4.3.1";
  14278. class GraphqlError extends Error {
  14279. constructor(request, response) {
  14280. const message = response.data.errors[0].message;
  14281. super(message);
  14282. Object.assign(this, response.data);
  14283. this.name = "GraphqlError";
  14284. this.request = request; // Maintains proper stack trace (only available on V8)
  14285. /* istanbul ignore next */
  14286. if (Error.captureStackTrace) {
  14287. Error.captureStackTrace(this, this.constructor);
  14288. }
  14289. }
  14290. }
  14291. const NON_VARIABLE_OPTIONS = ["method", "baseUrl", "url", "headers", "request", "query"];
  14292. function graphql(request, query, options) {
  14293. options = typeof query === "string" ? options = Object.assign({
  14294. query
  14295. }, options) : options = query;
  14296. const requestOptions = Object.keys(options).reduce((result, key) => {
  14297. if (NON_VARIABLE_OPTIONS.includes(key)) {
  14298. result[key] = options[key];
  14299. return result;
  14300. }
  14301. if (!result.variables) {
  14302. result.variables = {};
  14303. }
  14304. result.variables[key] = options[key];
  14305. return result;
  14306. }, {});
  14307. return request(requestOptions).then(response => {
  14308. if (response.data.errors) {
  14309. throw new GraphqlError(requestOptions, {
  14310. data: response.data
  14311. });
  14312. }
  14313. return response.data.data;
  14314. });
  14315. }
  14316. function withDefaults(request$1, newDefaults) {
  14317. const newRequest = request$1.defaults(newDefaults);
  14318. const newApi = (query, options) => {
  14319. return graphql(newRequest, query, options);
  14320. };
  14321. return Object.assign(newApi, {
  14322. defaults: withDefaults.bind(null, newRequest),
  14323. endpoint: request.request.endpoint
  14324. });
  14325. }
  14326. const graphql$1 = withDefaults(request.request, {
  14327. headers: {
  14328. "user-agent": `octokit-graphql.js/${VERSION} ${universalUserAgent.getUserAgent()}`
  14329. },
  14330. method: "POST",
  14331. url: "/graphql"
  14332. });
  14333. function withCustomRequest(customRequest) {
  14334. return withDefaults(customRequest, {
  14335. method: "POST",
  14336. url: "/graphql"
  14337. });
  14338. }
  14339. exports.graphql = graphql$1;
  14340. exports.withCustomRequest = withCustomRequest;
  14341. //# sourceMappingURL=index.js.map
  14342. /***/ }),
  14343. /***/ 899:
  14344. /***/ (function(module, __unusedexports, __webpack_require__) {
  14345. module.exports = registerEndpoints;
  14346. const { Deprecation } = __webpack_require__(692);
  14347. function registerEndpoints(octokit, routes) {
  14348. Object.keys(routes).forEach(namespaceName => {
  14349. if (!octokit[namespaceName]) {
  14350. octokit[namespaceName] = {};
  14351. }
  14352. Object.keys(routes[namespaceName]).forEach(apiName => {
  14353. const apiOptions = routes[namespaceName][apiName];
  14354. const endpointDefaults = ["method", "url", "headers"].reduce(
  14355. (map, key) => {
  14356. if (typeof apiOptions[key] !== "undefined") {
  14357. map[key] = apiOptions[key];
  14358. }
  14359. return map;
  14360. },
  14361. {}
  14362. );
  14363. endpointDefaults.request = {
  14364. validate: apiOptions.params
  14365. };
  14366. let request = octokit.request.defaults(endpointDefaults);
  14367. // patch request & endpoint methods to support deprecated parameters.
  14368. // Not the most elegant solution, but we don’t want to move deprecation
  14369. // logic into octokit/endpoint.js as it’s out of scope
  14370. const hasDeprecatedParam = Object.keys(apiOptions.params || {}).find(
  14371. key => apiOptions.params[key].deprecated
  14372. );
  14373. if (hasDeprecatedParam) {
  14374. const patch = patchForDeprecation.bind(null, octokit, apiOptions);
  14375. request = patch(
  14376. octokit.request.defaults(endpointDefaults),
  14377. `.${namespaceName}.${apiName}()`
  14378. );
  14379. request.endpoint = patch(
  14380. request.endpoint,
  14381. `.${namespaceName}.${apiName}.endpoint()`
  14382. );
  14383. request.endpoint.merge = patch(
  14384. request.endpoint.merge,
  14385. `.${namespaceName}.${apiName}.endpoint.merge()`
  14386. );
  14387. }
  14388. if (apiOptions.deprecated) {
  14389. octokit[namespaceName][apiName] = function deprecatedEndpointMethod() {
  14390. octokit.log.warn(
  14391. new Deprecation(`[@octokit/rest] ${apiOptions.deprecated}`)
  14392. );
  14393. octokit[namespaceName][apiName] = request;
  14394. return request.apply(null, arguments);
  14395. };
  14396. return;
  14397. }
  14398. octokit[namespaceName][apiName] = request;
  14399. });
  14400. });
  14401. }
  14402. function patchForDeprecation(octokit, apiOptions, method, methodName) {
  14403. const patchedMethod = options => {
  14404. options = Object.assign({}, options);
  14405. Object.keys(options).forEach(key => {
  14406. if (apiOptions.params[key] && apiOptions.params[key].deprecated) {
  14407. const aliasKey = apiOptions.params[key].alias;
  14408. octokit.log.warn(
  14409. new Deprecation(
  14410. `[@octokit/rest] "${key}" parameter is deprecated for "${methodName}". Use "${aliasKey}" instead`
  14411. )
  14412. );
  14413. if (!(aliasKey in options)) {
  14414. options[aliasKey] = options[key];
  14415. }
  14416. delete options[key];
  14417. }
  14418. });
  14419. return method(options);
  14420. };
  14421. Object.keys(method).forEach(key => {
  14422. patchedMethod[key] = method[key];
  14423. });
  14424. return patchedMethod;
  14425. }
  14426. /***/ }),
  14427. /***/ 929:
  14428. /***/ (function(module, __unusedexports, __webpack_require__) {
  14429. module.exports = hasNextPage
  14430. const deprecate = __webpack_require__(370)
  14431. const getPageLinks = __webpack_require__(577)
  14432. function hasNextPage (link) {
  14433. deprecate(`octokit.hasNextPage() – You can use octokit.paginate or async iterators instead: https://github.com/octokit/rest.js#pagination.`)
  14434. return getPageLinks(link).next
  14435. }
  14436. /***/ }),
  14437. /***/ 948:
  14438. /***/ (function(module) {
  14439. "use strict";
  14440. /**
  14441. * Tries to execute a function and discards any error that occurs.
  14442. * @param {Function} fn - Function that might or might not throw an error.
  14443. * @returns {?*} Return-value of the function when no error occurred.
  14444. */
  14445. module.exports = function(fn) {
  14446. try { return fn() } catch (e) {}
  14447. }
  14448. /***/ }),
  14449. /***/ 950:
  14450. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14451. "use strict";
  14452. Object.defineProperty(exports, "__esModule", { value: true });
  14453. const url = __webpack_require__(835);
  14454. function getProxyUrl(reqUrl) {
  14455. let usingSsl = reqUrl.protocol === 'https:';
  14456. let proxyUrl;
  14457. if (checkBypass(reqUrl)) {
  14458. return proxyUrl;
  14459. }
  14460. let proxyVar;
  14461. if (usingSsl) {
  14462. proxyVar = process.env["https_proxy"] ||
  14463. process.env["HTTPS_PROXY"];
  14464. }
  14465. else {
  14466. proxyVar = process.env["http_proxy"] ||
  14467. process.env["HTTP_PROXY"];
  14468. }
  14469. if (proxyVar) {
  14470. proxyUrl = url.parse(proxyVar);
  14471. }
  14472. return proxyUrl;
  14473. }
  14474. exports.getProxyUrl = getProxyUrl;
  14475. function checkBypass(reqUrl) {
  14476. if (!reqUrl.hostname) {
  14477. return false;
  14478. }
  14479. let noProxy = process.env["no_proxy"] || process.env["NO_PROXY"] || '';
  14480. if (!noProxy) {
  14481. return false;
  14482. }
  14483. // Determine the request port
  14484. let reqPort;
  14485. if (reqUrl.port) {
  14486. reqPort = Number(reqUrl.port);
  14487. }
  14488. else if (reqUrl.protocol === 'http:') {
  14489. reqPort = 80;
  14490. }
  14491. else if (reqUrl.protocol === 'https:') {
  14492. reqPort = 443;
  14493. }
  14494. // Format the request hostname and hostname with port
  14495. let upperReqHosts = [reqUrl.hostname.toUpperCase()];
  14496. if (typeof reqPort === 'number') {
  14497. upperReqHosts.push(`${upperReqHosts[0]}:${reqPort}`);
  14498. }
  14499. // Compare request host against noproxy
  14500. for (let upperNoProxyItem of noProxy.split(',').map(x => x.trim().toUpperCase()).filter(x => x)) {
  14501. if (upperReqHosts.some(x => x === upperNoProxyItem)) {
  14502. return true;
  14503. }
  14504. }
  14505. return false;
  14506. }
  14507. exports.checkBypass = checkBypass;
  14508. /***/ }),
  14509. /***/ 954:
  14510. /***/ (function(module) {
  14511. module.exports = validateAuth;
  14512. function validateAuth(auth) {
  14513. if (typeof auth === "string") {
  14514. return;
  14515. }
  14516. if (typeof auth === "function") {
  14517. return;
  14518. }
  14519. if (auth.username && auth.password) {
  14520. return;
  14521. }
  14522. if (auth.clientId && auth.clientSecret) {
  14523. return;
  14524. }
  14525. throw new Error(`Invalid "auth" option: ${JSON.stringify(auth)}`);
  14526. }
  14527. /***/ }),
  14528. /***/ 955:
  14529. /***/ (function(module, __unusedexports, __webpack_require__) {
  14530. "use strict";
  14531. const path = __webpack_require__(622);
  14532. const childProcess = __webpack_require__(129);
  14533. const crossSpawn = __webpack_require__(20);
  14534. const stripEof = __webpack_require__(768);
  14535. const npmRunPath = __webpack_require__(621);
  14536. const isStream = __webpack_require__(323);
  14537. const _getStream = __webpack_require__(145);
  14538. const pFinally = __webpack_require__(697);
  14539. const onExit = __webpack_require__(260);
  14540. const errname = __webpack_require__(427);
  14541. const stdio = __webpack_require__(168);
  14542. const TEN_MEGABYTES = 1000 * 1000 * 10;
  14543. function handleArgs(cmd, args, opts) {
  14544. let parsed;
  14545. opts = Object.assign({
  14546. extendEnv: true,
  14547. env: {}
  14548. }, opts);
  14549. if (opts.extendEnv) {
  14550. opts.env = Object.assign({}, process.env, opts.env);
  14551. }
  14552. if (opts.__winShell === true) {
  14553. delete opts.__winShell;
  14554. parsed = {
  14555. command: cmd,
  14556. args,
  14557. options: opts,
  14558. file: cmd,
  14559. original: {
  14560. cmd,
  14561. args
  14562. }
  14563. };
  14564. } else {
  14565. parsed = crossSpawn._parse(cmd, args, opts);
  14566. }
  14567. opts = Object.assign({
  14568. maxBuffer: TEN_MEGABYTES,
  14569. buffer: true,
  14570. stripEof: true,
  14571. preferLocal: true,
  14572. localDir: parsed.options.cwd || process.cwd(),
  14573. encoding: 'utf8',
  14574. reject: true,
  14575. cleanup: true
  14576. }, parsed.options);
  14577. opts.stdio = stdio(opts);
  14578. if (opts.preferLocal) {
  14579. opts.env = npmRunPath.env(Object.assign({}, opts, {cwd: opts.localDir}));
  14580. }
  14581. if (opts.detached) {
  14582. // #115
  14583. opts.cleanup = false;
  14584. }
  14585. if (process.platform === 'win32' && path.basename(parsed.command) === 'cmd.exe') {
  14586. // #116
  14587. parsed.args.unshift('/q');
  14588. }
  14589. return {
  14590. cmd: parsed.command,
  14591. args: parsed.args,
  14592. opts,
  14593. parsed
  14594. };
  14595. }
  14596. function handleInput(spawned, input) {
  14597. if (input === null || input === undefined) {
  14598. return;
  14599. }
  14600. if (isStream(input)) {
  14601. input.pipe(spawned.stdin);
  14602. } else {
  14603. spawned.stdin.end(input);
  14604. }
  14605. }
  14606. function handleOutput(opts, val) {
  14607. if (val && opts.stripEof) {
  14608. val = stripEof(val);
  14609. }
  14610. return val;
  14611. }
  14612. function handleShell(fn, cmd, opts) {
  14613. let file = '/bin/sh';
  14614. let args = ['-c', cmd];
  14615. opts = Object.assign({}, opts);
  14616. if (process.platform === 'win32') {
  14617. opts.__winShell = true;
  14618. file = process.env.comspec || 'cmd.exe';
  14619. args = ['/s', '/c', `"${cmd}"`];
  14620. opts.windowsVerbatimArguments = true;
  14621. }
  14622. if (opts.shell) {
  14623. file = opts.shell;
  14624. delete opts.shell;
  14625. }
  14626. return fn(file, args, opts);
  14627. }
  14628. function getStream(process, stream, {encoding, buffer, maxBuffer}) {
  14629. if (!process[stream]) {
  14630. return null;
  14631. }
  14632. let ret;
  14633. if (!buffer) {
  14634. // TODO: Use `ret = util.promisify(stream.finished)(process[stream]);` when targeting Node.js 10
  14635. ret = new Promise((resolve, reject) => {
  14636. process[stream]
  14637. .once('end', resolve)
  14638. .once('error', reject);
  14639. });
  14640. } else if (encoding) {
  14641. ret = _getStream(process[stream], {
  14642. encoding,
  14643. maxBuffer
  14644. });
  14645. } else {
  14646. ret = _getStream.buffer(process[stream], {maxBuffer});
  14647. }
  14648. return ret.catch(err => {
  14649. err.stream = stream;
  14650. err.message = `${stream} ${err.message}`;
  14651. throw err;
  14652. });
  14653. }
  14654. function makeError(result, options) {
  14655. const {stdout, stderr} = result;
  14656. let err = result.error;
  14657. const {code, signal} = result;
  14658. const {parsed, joinedCmd} = options;
  14659. const timedOut = options.timedOut || false;
  14660. if (!err) {
  14661. let output = '';
  14662. if (Array.isArray(parsed.opts.stdio)) {
  14663. if (parsed.opts.stdio[2] !== 'inherit') {
  14664. output += output.length > 0 ? stderr : `\n${stderr}`;
  14665. }
  14666. if (parsed.opts.stdio[1] !== 'inherit') {
  14667. output += `\n${stdout}`;
  14668. }
  14669. } else if (parsed.opts.stdio !== 'inherit') {
  14670. output = `\n${stderr}${stdout}`;
  14671. }
  14672. err = new Error(`Command failed: ${joinedCmd}${output}`);
  14673. err.code = code < 0 ? errname(code) : code;
  14674. }
  14675. err.stdout = stdout;
  14676. err.stderr = stderr;
  14677. err.failed = true;
  14678. err.signal = signal || null;
  14679. err.cmd = joinedCmd;
  14680. err.timedOut = timedOut;
  14681. return err;
  14682. }
  14683. function joinCmd(cmd, args) {
  14684. let joinedCmd = cmd;
  14685. if (Array.isArray(args) && args.length > 0) {
  14686. joinedCmd += ' ' + args.join(' ');
  14687. }
  14688. return joinedCmd;
  14689. }
  14690. module.exports = (cmd, args, opts) => {
  14691. const parsed = handleArgs(cmd, args, opts);
  14692. const {encoding, buffer, maxBuffer} = parsed.opts;
  14693. const joinedCmd = joinCmd(cmd, args);
  14694. let spawned;
  14695. try {
  14696. spawned = childProcess.spawn(parsed.cmd, parsed.args, parsed.opts);
  14697. } catch (err) {
  14698. return Promise.reject(err);
  14699. }
  14700. let removeExitHandler;
  14701. if (parsed.opts.cleanup) {
  14702. removeExitHandler = onExit(() => {
  14703. spawned.kill();
  14704. });
  14705. }
  14706. let timeoutId = null;
  14707. let timedOut = false;
  14708. const cleanup = () => {
  14709. if (timeoutId) {
  14710. clearTimeout(timeoutId);
  14711. timeoutId = null;
  14712. }
  14713. if (removeExitHandler) {
  14714. removeExitHandler();
  14715. }
  14716. };
  14717. if (parsed.opts.timeout > 0) {
  14718. timeoutId = setTimeout(() => {
  14719. timeoutId = null;
  14720. timedOut = true;
  14721. spawned.kill(parsed.opts.killSignal);
  14722. }, parsed.opts.timeout);
  14723. }
  14724. const processDone = new Promise(resolve => {
  14725. spawned.on('exit', (code, signal) => {
  14726. cleanup();
  14727. resolve({code, signal});
  14728. });
  14729. spawned.on('error', err => {
  14730. cleanup();
  14731. resolve({error: err});
  14732. });
  14733. if (spawned.stdin) {
  14734. spawned.stdin.on('error', err => {
  14735. cleanup();
  14736. resolve({error: err});
  14737. });
  14738. }
  14739. });
  14740. function destroy() {
  14741. if (spawned.stdout) {
  14742. spawned.stdout.destroy();
  14743. }
  14744. if (spawned.stderr) {
  14745. spawned.stderr.destroy();
  14746. }
  14747. }
  14748. const handlePromise = () => pFinally(Promise.all([
  14749. processDone,
  14750. getStream(spawned, 'stdout', {encoding, buffer, maxBuffer}),
  14751. getStream(spawned, 'stderr', {encoding, buffer, maxBuffer})
  14752. ]).then(arr => {
  14753. const result = arr[0];
  14754. result.stdout = arr[1];
  14755. result.stderr = arr[2];
  14756. if (result.error || result.code !== 0 || result.signal !== null) {
  14757. const err = makeError(result, {
  14758. joinedCmd,
  14759. parsed,
  14760. timedOut
  14761. });
  14762. // TODO: missing some timeout logic for killed
  14763. // https://github.com/nodejs/node/blob/master/lib/child_process.js#L203
  14764. // err.killed = spawned.killed || killed;
  14765. err.killed = err.killed || spawned.killed;
  14766. if (!parsed.opts.reject) {
  14767. return err;
  14768. }
  14769. throw err;
  14770. }
  14771. return {
  14772. stdout: handleOutput(parsed.opts, result.stdout),
  14773. stderr: handleOutput(parsed.opts, result.stderr),
  14774. code: 0,
  14775. failed: false,
  14776. killed: false,
  14777. signal: null,
  14778. cmd: joinedCmd,
  14779. timedOut: false
  14780. };
  14781. }), destroy);
  14782. crossSpawn._enoent.hookChildProcess(spawned, parsed.parsed);
  14783. handleInput(spawned, parsed.opts.input);
  14784. spawned.then = (onfulfilled, onrejected) => handlePromise().then(onfulfilled, onrejected);
  14785. spawned.catch = onrejected => handlePromise().catch(onrejected);
  14786. return spawned;
  14787. };
  14788. // TODO: set `stderr: 'ignore'` when that option is implemented
  14789. module.exports.stdout = (...args) => module.exports(...args).then(x => x.stdout);
  14790. // TODO: set `stdout: 'ignore'` when that option is implemented
  14791. module.exports.stderr = (...args) => module.exports(...args).then(x => x.stderr);
  14792. module.exports.shell = (cmd, opts) => handleShell(module.exports, cmd, opts);
  14793. module.exports.sync = (cmd, args, opts) => {
  14794. const parsed = handleArgs(cmd, args, opts);
  14795. const joinedCmd = joinCmd(cmd, args);
  14796. if (isStream(parsed.opts.input)) {
  14797. throw new TypeError('The `input` option cannot be a stream in sync mode');
  14798. }
  14799. const result = childProcess.spawnSync(parsed.cmd, parsed.args, parsed.opts);
  14800. result.code = result.status;
  14801. if (result.error || result.status !== 0 || result.signal !== null) {
  14802. const err = makeError(result, {
  14803. joinedCmd,
  14804. parsed
  14805. });
  14806. if (!parsed.opts.reject) {
  14807. return err;
  14808. }
  14809. throw err;
  14810. }
  14811. return {
  14812. stdout: handleOutput(parsed.opts, result.stdout),
  14813. stderr: handleOutput(parsed.opts, result.stderr),
  14814. code: 0,
  14815. failed: false,
  14816. signal: null,
  14817. cmd: joinedCmd,
  14818. timedOut: false
  14819. };
  14820. };
  14821. module.exports.shellSync = (cmd, opts) => handleShell(module.exports.sync, cmd, opts);
  14822. /***/ }),
  14823. /***/ 966:
  14824. /***/ (function(module, __unusedexports, __webpack_require__) {
  14825. "use strict";
  14826. const {PassThrough} = __webpack_require__(413);
  14827. module.exports = options => {
  14828. options = Object.assign({}, options);
  14829. const {array} = options;
  14830. let {encoding} = options;
  14831. const buffer = encoding === 'buffer';
  14832. let objectMode = false;
  14833. if (array) {
  14834. objectMode = !(encoding || buffer);
  14835. } else {
  14836. encoding = encoding || 'utf8';
  14837. }
  14838. if (buffer) {
  14839. encoding = null;
  14840. }
  14841. let len = 0;
  14842. const ret = [];
  14843. const stream = new PassThrough({objectMode});
  14844. if (encoding) {
  14845. stream.setEncoding(encoding);
  14846. }
  14847. stream.on('data', chunk => {
  14848. ret.push(chunk);
  14849. if (objectMode) {
  14850. len = ret.length;
  14851. } else {
  14852. len += chunk.length;
  14853. }
  14854. });
  14855. stream.getBufferedValue = () => {
  14856. if (array) {
  14857. return ret;
  14858. }
  14859. return buffer ? Buffer.concat(ret, len) : ret.join('');
  14860. };
  14861. stream.getBufferedLength = () => len;
  14862. return stream;
  14863. };
  14864. /***/ }),
  14865. /***/ 969:
  14866. /***/ (function(module, __unusedexports, __webpack_require__) {
  14867. var wrappy = __webpack_require__(11)
  14868. module.exports = wrappy(once)
  14869. module.exports.strict = wrappy(onceStrict)
  14870. once.proto = once(function () {
  14871. Object.defineProperty(Function.prototype, 'once', {
  14872. value: function () {
  14873. return once(this)
  14874. },
  14875. configurable: true
  14876. })
  14877. Object.defineProperty(Function.prototype, 'onceStrict', {
  14878. value: function () {
  14879. return onceStrict(this)
  14880. },
  14881. configurable: true
  14882. })
  14883. })
  14884. function once (fn) {
  14885. var f = function () {
  14886. if (f.called) return f.value
  14887. f.called = true
  14888. return f.value = fn.apply(this, arguments)
  14889. }
  14890. f.called = false
  14891. return f
  14892. }
  14893. function onceStrict (fn) {
  14894. var f = function () {
  14895. if (f.called)
  14896. throw new Error(f.onceError)
  14897. f.called = true
  14898. return f.value = fn.apply(this, arguments)
  14899. }
  14900. var name = fn.name || 'Function wrapped with `once`'
  14901. f.onceError = name + " shouldn't be called more than once"
  14902. f.called = false
  14903. return f
  14904. }
  14905. /***/ }),
  14906. /***/ 986:
  14907. /***/ (function(__unusedmodule, exports, __webpack_require__) {
  14908. "use strict";
  14909. var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
  14910. function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
  14911. return new (P || (P = Promise))(function (resolve, reject) {
  14912. function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
  14913. function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
  14914. function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
  14915. step((generator = generator.apply(thisArg, _arguments || [])).next());
  14916. });
  14917. };
  14918. Object.defineProperty(exports, "__esModule", { value: true });
  14919. const tr = __webpack_require__(9);
  14920. /**
  14921. * Exec a command.
  14922. * Output will be streamed to the live console.
  14923. * Returns promise with return code
  14924. *
  14925. * @param commandLine command to execute (can include additional args). Must be correctly escaped.
  14926. * @param args optional arguments for tool. Escaping is handled by the lib.
  14927. * @param options optional exec options. See ExecOptions
  14928. * @returns Promise<number> exit code
  14929. */
  14930. function exec(commandLine, args, options) {
  14931. return __awaiter(this, void 0, void 0, function* () {
  14932. const commandArgs = tr.argStringToArray(commandLine);
  14933. if (commandArgs.length === 0) {
  14934. throw new Error(`Parameter 'commandLine' cannot be null or empty.`);
  14935. }
  14936. // Path to tool to execute should be first arg
  14937. const toolPath = commandArgs[0];
  14938. args = commandArgs.slice(1).concat(args || []);
  14939. const runner = new tr.ToolRunner(toolPath, args, options);
  14940. return runner.exec();
  14941. });
  14942. }
  14943. exports.exec = exec;
  14944. //# sourceMappingURL=exec.js.map
  14945. /***/ }),
  14946. /***/ 991:
  14947. /***/ (function(module, __unusedexports, __webpack_require__) {
  14948. module.exports = authenticationRequestError;
  14949. const { RequestError } = __webpack_require__(463);
  14950. function authenticationRequestError(state, error, options) {
  14951. if (!error.headers) throw error;
  14952. const otpRequired = /required/.test(error.headers["x-github-otp"] || "");
  14953. // handle "2FA required" error only
  14954. if (error.status !== 401 || !otpRequired) {
  14955. throw error;
  14956. }
  14957. if (
  14958. error.status === 401 &&
  14959. otpRequired &&
  14960. error.request &&
  14961. error.request.headers["x-github-otp"]
  14962. ) {
  14963. if (state.otp) {
  14964. delete state.otp; // no longer valid, request again
  14965. } else {
  14966. throw new RequestError(
  14967. "Invalid one-time password for two-factor authentication",
  14968. 401,
  14969. {
  14970. headers: error.headers,
  14971. request: options
  14972. }
  14973. );
  14974. }
  14975. }
  14976. if (typeof state.auth.on2fa !== "function") {
  14977. throw new RequestError(
  14978. "2FA required, but options.on2fa is not a function. See https://github.com/octokit/rest.js#authentication",
  14979. 401,
  14980. {
  14981. headers: error.headers,
  14982. request: options
  14983. }
  14984. );
  14985. }
  14986. return Promise.resolve()
  14987. .then(() => {
  14988. return state.auth.on2fa();
  14989. })
  14990. .then(oneTimePassword => {
  14991. const newOptions = Object.assign(options, {
  14992. headers: Object.assign(options.headers, {
  14993. "x-github-otp": oneTimePassword
  14994. })
  14995. });
  14996. return state.octokit.request(newOptions).then(response => {
  14997. // If OTP still valid, then persist it for following requests
  14998. state.otp = oneTimePassword;
  14999. return response;
  15000. });
  15001. });
  15002. }
  15003. /***/ })
  15004. /******/ });